HM2_UART_SEND

NAME
SYNTAX
DESCRIPTION
RETURN VALUE
SEE ALSO

NAME

hm2_uart_send - write data to a Hostmot2 UART

SYNTAX

#include <hostmot2-serial.h>
int hm2_uart_send(char* name, unsigned char data[], int count);

DESCRIPTION

hm2_uart_send write count bytes of data to the UART "name" from the buffer data.

The UART FIFO is 64 bytes deep, attempts to transmit more than 64 bytes may have unexpected effects.

"name" is a unique string given to each UART during hostmot2 setup. The names of the available channels are printed to standard output during the driver loading process and take the form: hm2_<board name>.<board index>.uart.<index>, for example hm2_5i23.0.uart.0.

This function performs writes of data to the specified UART. It should be used inside a function in a realtime or non-realtime HAL component.

RETURN VALUE

Returns the number of bytes sent on success and -1 on failure.

SEE ALSO

hm2_uart_setup(3hm2), hm2_uart_read(3hm2)

See src/hal/drivers mesa_uart.comp for an example usage.