LinuxCNC Documentation
This page is 26% translated. Untranslated text is shown in English.

SYNTAX

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

ОПИСАНИЕ

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" — это уникальная строка, присваиваемая каждому UART во время настройки hostmot2. Имена доступных каналов выводятся на стандартный вывод во время процесса загрузки драйвера и имеют вид: hm2_<board name>.<board index>.uart.<index> например 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.

СМОТРИТЕ ТАКЖЕ

hm2_uart_setup(3), hm2_uart_read(3)

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