/ docs / man / man3 / hm2_bspi_write_chan.3hm2
hm2_bspi_write_chan.3hm2
 1  \# Author Andy Pugh
 2  \# Issued under the terms of the GPL v2 License or any later version
 3  .TH hm2_bspi_write_chan "3hm2" "2011-05-31" "LinuxCNC Documentation" "Hostmot2"
 4  .SH NAME
 5  
 6  hm2_bspi_write_chan \- write data to a Hostmot2 Buffered SPI channel
 7  
 8  .SH SYNTAX
 9  .nf
10  .B #include <hostmot2-serial.h>
11  .HP
12  hm2_bspi_write_chan(char* name, int chan, u32 val)
13  
14  .SH DESCRIPTION
15  \fBhm2_bspi_write_chan\fR write one-time data to the bspi channel "chan" on the 
16  bspi instance "name". "name" is a unique string given to each bspi channel 
17  during hostmot2 setup. The names of the available
18  channels are printed to standard output during the driver loading process and 
19  take the form:
20  hm2_<board name>.<board index>.bspi.<index> For example hm2_5i23.0.bspi.0
21  
22  This function performs a one-time write of data to the specified channel. It is
23  typically used for setup and chip enabling purposes. It should not be used in 
24  the main loop for regular data transfers (but is appropriate to use for on-the-
25  fly setup changes).
26  
27  .SH REALTIME CONSIDERATIONS
28  May be called from init/cleanup code and from within realtime tasks.
29  Not available in userspace components.
30  
31  .SH RETURN VALUE
32  Returns 0 on success and \-1 on failure.
33  
34  .SH SEE ALSO
35  \fBhm2_allocate_bspi_tram(3hm2)\fR,
36  \fBhm2_bspi_set_read_function(3hm2)\fR,
37  \fBhm2_bspi_setup_chan(3hm2)\fR,
38  \fBhm2_bspi_set_write_function(3hm2)\fR,
39  \fBhm2_tram_add_bspi_frame(3hm2)\fR,
40  See src/hal/drivers mesa_7i65.comp for an example usage.