hm2_uart_send.3hm2
1 \# Author Andy Pugh 2 \# Issued under the terms of the GPL v2 License or any later version 3 .TH hm2_uart_send "3hm2" "2011-05-31" "LinuxCNC Documentation" "Hostmot2" 4 .SH NAME 5 6 hm2_uart_send \- write data to a Hostmot2 UART 7 8 .SH SYNTAX 9 .nf 10 .B #include <hostmot2-serial.h> 11 .HP 12 int hm2_uart_send(char* name, unsigned char data[], int count) 13 14 .SH DESCRIPTION 15 \fBhm2_uart_send\fR write 'count' bytes of data to the UART "name" from the 16 buffer 'data'. 17 18 The UART FIFO is 64 bytes deep, attempts to transmit more than 64 bytes may have 19 unexpected effects. 20 21 "name" is a unique string given to each UART during hostmot2 setup. The names of 22 the available channels are printed to standard output during the driver loading 23 process and take the form: 24 hm2_<board name>.<board index>.uart.<index> For example hm2_5i23.0.uart.0 25 26 This function performs writes of data to the specified UART.It should be used 27 inside a function in a realtime or userspace HAL component. 28 29 .SH RETURN VALUE 30 Returns the number of bytes sent on success and \-1 on failure. 31 32 .SH SEE ALSO 33 man hm2_uart_setup, man hm2_uart_read 34 See src/hal/drivers mesa_uart.comp for an example usage.