wifiiot_uart.h

Overview

Related Modules:

Wifiiot

Description:

Declares the UART interface functions.

These functions are used for UART initialization, data input/output, and data flow control.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

WifiIotUartAttribute

Defines the basic attributes of a UART device.

WifiIotUartExtraAttr

Defines the extended attributes of a UART device.

Enumerations

Enumeration Name

Description

WifiIotUartIdx { WIFI_IOT_UART_IDX_0, WIFI_IOT_UART_IDX_1, WIFI_IOT_UART_IDX_2, WIFI_IOT_UART_IDX_MAX }

Enumerates the UART serial number.

WifiIotUartIdxDataBit { WIFI_IOT_UART_DATA_BIT_5 = 5, WIFI_IOT_UART_DATA_BIT_6, WIFI_IOT_UART_DATA_BIT_7, WIFI_IOT_UART_DATA_BIT_8 }

Enumerates the number of UART data bits.

WifiIotUartStopBit { WIFI_IOT_UART_STOP_BIT_1 = 1, WIFI_IOT_UART_STOP_BIT_2 = 2 }

Enumerates the number of UART stop bits.

WifiIotUartParity { WIFI_IOT_UART_PARITY_NONE = 0, WIFI_IOT_UART_PARITY_ODD = 1, WIFI_IOT_UART_PARITY_EVEN = 2 }

Enumerates the UART parity bit.

WifiIotUartFifoLine {   WIFI_IOT_FIFO_LINE_ONE_EIGHT = 1, WIFI_IOT_FIFO_LINE_ONE_QUARTER, WIFI_IOT_FIFO_LINE_HALF, WIFI_IOT_FIFO_LINE_THREE_QUARTERS,   WIFI_IOT_FIFO_LINE_SEVEN_EIGHTS }

Enumerates UART FIFO interrupt thresholds.

WifiIotUartBlockState { WIFI_IOT_UART_BLOCK_STATE_NONE_BLOCK = 1, WIFI_IOT_UART_BLOCK_STATE_BLOCK }

Enumerates UART block states.

WifiIotUartDmaState { WIFI_IOT_UART_NONE_DMA = 1, WIFI_IOT_UART_USE_DMA }

Enumerates UART DMA states.

WifiIotFlowCtrl { WIFI_IOT_FLOW_CTRL_NONE, WIFI_IOT_FLOW_CTRL_RTS_CTS, WIFI_IOT_FLOW_CTRL_RTS_ONLY, WIFI_IOT_FLOW_CTRL_CTS_ONLY }

Enumerates hardware flow control modes.

Functions

Function Name

Description

UartInit (WifiIotUartIdx id, const WifiIotUartAttributeparam, const WifiIotUartExtraAttrextraAttr)

unsigned int 

Configures a UART device.

UartRead (WifiIotUartIdx id, unsigned char data, unsigned int dataLen)

int 

Reads data from a UART device.

UartWrite (WifiIotUartIdx id, const unsigned char data, unsigned int dataLen)

int 

Writes data to a UART device.

UartDeinit (WifiIotUartIdx id)

unsigned int 

Deinitializes a UART device.

UartSetFlowCtrl (WifiIotUartIdx id, WifiIotFlowCtrl flowCtrl)

unsigned int 

Sets UART hardware flow control.