Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

Functions

int uart_poll_in (const struct device *dev, unsigned char *p_char)
 Poll the device for input. More...
 
int uart_poll_in_u16 (const struct device *dev, uint16_t *p_u16)
 Poll the device for wide data input. More...
 
void uart_poll_out (const struct device *dev, unsigned char out_char)
 Output a character in polled mode. More...
 
void uart_poll_out_u16 (const struct device *dev, uint16_t out_u16)
 Output wide data in polled mode. More...
 

Detailed Description

Function Documentation

◆ uart_poll_in()

int uart_poll_in ( const struct device dev,
unsigned char *  p_char 
)

#include <include/drivers/uart.h>

Poll the device for input.

Parameters
devUART device instance.
p_charPointer to character.
Return values
0If a character arrived.
-1If no character was available to read (i.e. the UART input buffer was empty).
-ENOSYSIf the operation is not implemented.
-EBUSYIf async reception was enabled using uart_rx_enable

◆ uart_poll_in_u16()

int uart_poll_in_u16 ( const struct device dev,
uint16_t p_u16 
)

#include <include/drivers/uart.h>

Poll the device for wide data input.

Parameters
devUART device instance.
p_u16Pointer to 16-bit data.
Return values
0If data arrived.
-1If no data was available to read (i.e., the UART input buffer was empty).
-ENOTSUPIf API is not enabled.
-ENOSYSIf the function is not implemented.
-EBUSYIf async reception was enabled using uart_rx_enable

◆ uart_poll_out()

void uart_poll_out ( const struct device dev,
unsigned char  out_char 
)

#include <include/drivers/uart.h>

Output a character in polled mode.

This routine checks if the transmitter is empty. When the transmitter is empty, it writes a character to the data register.

To send a character when hardware flow control is enabled, the handshake signal CTS must be asserted.

Parameters
devUART device instance.
out_charCharacter to send.

◆ uart_poll_out_u16()

void uart_poll_out_u16 ( const struct device dev,
uint16_t  out_u16 
)

#include <include/drivers/uart.h>

Output wide data in polled mode.

This routine checks if the transmitter is empty. When the transmitter is empty, it writes a datum to the data register.

To send a datum when hardware flow control is enabled, the handshake signal CTS must be asserted.

Parameters
devUART device instance.
out_u16Wide data to send.