|
enum | { UART_BW_MUL1 = 0,
UART_BW_MUL2 = 1,
UART_BW_MUL3 = 2,
UART_BW_MUL4 = 3
} |
| Define mul bits. More...
|
|
enum | UART_ParityTypeDef { PARITY_NONE = 0,
PARITY_EVEN,
PARITY_ODD
} |
| Define parity type. More...
|
|
enum | UART_StopBitTypeDef { STOP_BIT_ONE = 0,
STOP_BIT_ONE_DOT_FIVE = BIT(4),
STOP_BIT_TWO = BIT(5)
} |
| Define the length of stop bit. More...
|
|
enum | UART_RTSModeTypeDef { UART_RTS_MODE_AUTO = 0,
UART_RTS_MODE_MANUAL
} |
| Define UART RTS mode. More...
|
|
enum | UART_TxPinDef {
UART_TX_PA2 = GPIO_PA2,
UART_TX_PB1 = GPIO_PB1,
UART_TX_PD0 = GPIO_PD0,
UART_TX_PD3 = GPIO_PD3,
UART_TX_PD7 = GPIO_PD7
} |
| Define UART TX pin:A2 B1 D0 D3 D7. More...
|
|
enum | UART_RxPinDef {
UART_RX_PA0 = GPIO_PA0,
UART_RX_PB0 = GPIO_PB0,
UART_RX_PB7 = GPIO_PB7,
UART_RX_PC3 = GPIO_PC3,
UART_RX_PC5 = GPIO_PC5,
UART_RX_PD6 = GPIO_PD6
} |
| Define UART RX pin: A0 B0 B7 C3 C5 D6. More...
|
|
enum | UART_CtsPinDef { UART_CTS_PA3 = GPIO_PA3,
UART_CTS_PB2 = GPIO_PB2,
UART_CTS_PC4 = GPIO_PC4,
UART_CTS_PD1 = GPIO_PD1
} |
| Define UART CTS pin : A3 B2 C4 D1. More...
|
|
enum | UART_RtsPinDef { UART_RTS_PA4 = GPIO_PA4,
UART_RTS_PB3 = GPIO_PB3,
UART_RTS_PB6 = GPIO_PB6,
UART_RTS_PC0 = GPIO_PC0
} |
| Define UART RTS pin : A4 B3 B6 C0. More...
|
|
|
static unsigned char | uart_tx_is_busy (void) |
| This function servers to indicate Tx state. More...
|
|
static void | uart_reset (void) |
| This function resets the UART module. More...
|
|
void | uart_init (unsigned short g_uart_div, unsigned char g_bwpc, UART_ParityTypeDef Parity, UART_StopBitTypeDef StopBit) |
| This function initializes the UART module. More...
|
|
void | uart_init_baudrate (unsigned int Baudrate, unsigned int System_clock, UART_ParityTypeDef Parity, UART_StopBitTypeDef StopBit) |
| This function initializes the UART module. More...
|
|
void | uart_dma_enable (unsigned char rx_dma_en, unsigned char tx_dma_en) |
| enable uart DMA mode More...
|
|
void | uart_irq_enable (unsigned char rx_irq_en, unsigned char tx_irq_en) |
| config the irq of uart tx and rx More...
|
|
void | uart_ndma_send_byte (unsigned char uartData) |
| uart send data function with not DMA method. variable uart_TxIndex,it must cycle the four registers 0x90 0x91 0x92 0x93 for the design of SOC. so we need variable to remember the index. More...
|
|
void | uart_ndma_irq_triglevel (unsigned char rx_level, unsigned char tx_level) |
| config the number level setting the irq bit of status register 0x9d ie 0x9d[3]. uart_ndma_get_irq If the cnt register value(0x9c[0,3]) larger or equal than the value of 0x99[0,3] or the cnt register value(0x9c[4,7]) less or equal than the value of 0x99[4,7], it will set the irq bit of status register 0x9d, ie 0x9d[3] More...
|
|
unsigned char | uart_ndmairq_get (void) |
| get the status of uart irq. More...
|
|
volatile unsigned char | uart_dma_send (unsigned char *Addr) |
| uart send data function, this function tell the DMA to get data from the RAM and start the DMA transmission More...
|
|
volatile unsigned char | uart_send_byte (unsigned char byte) |
| uart send data function, this function tell the DMA to get data from the RAM and start the DMA transmission More...
|
|
void | uart_recbuff_init (unsigned char *RecvAddr, unsigned short RecvBufLen) |
| data receive buffer initiate function. DMA would move received uart data to the address space, uart packet length needs to be no larger than (recBuffLen - 4). More...
|
|
unsigned char | uart_is_parity_error (void) |
| This function determines whether parity error occurs once a packet arrives. More...
|
|
void | uart_clear_parity_error (void) |
| This function clears parity error status once when it occurs. More...
|
|
void | uart_set_rts (unsigned char Enable, UART_RTSModeTypeDef Mode, unsigned char Thresh, unsigned char Invert, UART_RtsPinDef pin) |
| UART hardware flow control configuration. Configure RTS pin. More...
|
|
void | uart_set_rts_level (unsigned char Polarity) |
| This function sets the RTS pin's level manually. More...
|
|
void | uart_set_cts (unsigned char Enable, unsigned char Select, UART_CtsPinDef pin) |
| UART hardware flow control configuration. Configure CTS pin. More...
|
|
void | uart_gpio_set (UART_TxPinDef tx_pin, UART_RxPinDef rx_pin) |
| This function serves to select pin for UART module. More...
|
|
void uart_ndma_irq_triglevel |
( |
unsigned char |
rx_level, |
|
|
unsigned char |
tx_level |
|
) |
| |
config the number level setting the irq bit of status register 0x9d ie 0x9d[3]. uart_ndma_get_irq If the cnt register value(0x9c[0,3]) larger or equal than the value of 0x99[0,3] or the cnt register value(0x9c[4,7]) less or equal than the value of 0x99[4,7], it will set the irq bit of status register 0x9d, ie 0x9d[3]
- Parameters
-
[in] | rx_level | - receive level value. ie 0x99[0,3] |
[in] | tx_level | - transmit level value.ie 0x99[4,7] |
- Returns
- none