PAN1080 Peripheral API
Data Structures | Typedefs | Enumerations | Functions
pan_uart.h File Reference

Panchip uart adc driver header file. More...

Go to the source code of this file.

Data Structures

struct  UART_InitTypeDef
 Structure with uart init feature. More...
 

Typedefs

typedef enum UART_TxTrigger UART_TxTriggerDef
 
typedef enum UART_RxTrigger UART_RxTriggerDef
 
typedef enum UART_LineCtrl UART_LineCtrlDef
 
typedef enum UART_Irq UART_IrqDef
 
typedef enum UART_Event UART_EventDef
 
typedef enum UART_LineStatus UART_LineStatusDef
 
typedef enum UART_ModemStatus UART_ModemStatusDef
 

Enumerations

enum  UART_TxTrigger { UART_TX_FIFO_EMPTY = 0x0 , UART_TX_FIFO_TWO_CHARS = 0x1 , UART_TX_FIFO_QUARTER_FULL = 0x2 , UART_TX_FIFO_HALF_FULL = 0x3 }
 
enum  UART_RxTrigger { UART_RX_FIFO_ONE_CHAR = 0x0 , UART_RX_FIFO_QUARTER_FULL = 0x1 , UART_RX_FIFO_HALF_FULL = 0x2 , UART_RX_FIFO_TWO_LESS_THAN_FULL = 0x3 }
 
enum  UART_LineCtrl {
  Uart_Line_5n1 = 0x00 , Uart_Line_5n1_5 = 0x04 , Uart_Line_5e1 = 0x18 , Uart_Line_5e1_5 = 0x1c ,
  Uart_Line_5o1 = 0x08 , Uart_Line_5o1_5 = 0x0c , Uart_Line_5s1 = 0x38 , Uart_Line_5s1_5 = 0x3c ,
  Uart_Line_5m1 = 0x28 , Uart_Line_5m1_5 = 0x2c , Uart_Line_6n1 = 0x01 , Uart_Line_6n2 = 0x05 ,
  Uart_Line_6e1 = 0x19 , Uart_Line_6e2 = 0x1d , Uart_Line_6o1 = 0x09 , Uart_Line_6o2 = 0x0d ,
  Uart_Line_6s1 = 0x39 , Uart_Line_6s2 = 0x3d , Uart_Line_6m1 = 0x29 , Uart_Line_6m2 = 0x2d ,
  Uart_Line_7n1 = 0x02 , Uart_Line_7n2 = 0x06 , Uart_Line_7e1 = 0x1a , Uart_Line_7e2 = 0x1e ,
  Uart_Line_7o1 = 0x0a , Uart_Line_7o2 = 0x0e , Uart_Line_7s1 = 0x3a , Uart_Line_7s2 = 0x3e ,
  Uart_Line_7m1 = 0x2a , Uart_Line_7m2 = 0x2e , Uart_Line_8n1 = 0x03 , Uart_Line_8n2 = 0x07 ,
  Uart_Line_8e1 = 0x1b , Uart_Line_8e2 = 0x1f , Uart_Line_8o1 = 0x0b , Uart_Line_8o2 = 0x0f ,
  Uart_Line_8s1 = 0x3b , Uart_Line_8s2 = 0x3f , Uart_Line_8m1 = 0x2b , Uart_Line_8m2 = 0x2f
}
 
enum  UART_Irq {
  UART_IRQ_RECV_DATA_AVL = 0x01 , UART_IRQ_THR_EMPTY = 0x02 , UART_IRQ_LINE_STATUS = 0x04 , UART_IRQ_MODEM_STATUS = 0x08 ,
  UART_IRQ_ALL = 0x0f
}
 
enum  UART_Event {
  UART_EVENT_MODEM = 0x0 , UART_EVENT_NONE = 0x1 , UART_EVENT_THR_EMPTY = 0x2 , UART_EVENT_DATA = 0x4 ,
  UART_EVENT_LINE = 0x6 , UART_EVENT_TIMEOUT = 0xc
}
 
enum  UART_LineStatus {
  UART_LINE_DATA_RDY = 0x01 , UART_LINE_OVERRUN_ERR = 0x02 , UART_LINE_PARITY_ERR = 0x04 , UART_LINE_FRAME_ERR = 0x08 ,
  UART_LINE_BREAK_INT = 0x10 , UART_LINE_THRE = 0x20 , UART_LINE_TXSR_EMPTY = 0x40 , UART_LINE_RECV_FIFO_EMPTY = 0x80 ,
  UART_LINE_ADDR_RCVD = 0x100
}
 
enum  UART_ModemStatus {
  UART_MODEM_DCTS = 0x01 , UART_MODEM_DDSR = 0x02 , UART_MODEM_TERI = 0x04 , UART_MODEM_DDCD = 0x08 ,
  UART_MODEM_CTS = 0x10 , UART_MODEM_DSR = 0x20 , UART_MODEM_RI = 0x40 , UART_MODEM_DCD = 0x80
}
 

Functions

__STATIC_INLINE void UART_EnableStickParity (UART_T *UARTx)
 This function is used to enable stick parity. More...
 
__STATIC_INLINE void UART_DisableStickParity (UART_T *UARTx)
 This function is used to disable stick parity. More...
 
__STATIC_INLINE UART_LineStatusDef UART_GetLineStatus (UART_T *UARTx)
 This function is used to get line status. More...
 
__STATIC_INLINE UART_ModemStatusDef UART_GetModemStatus (UART_T *UARTx)
 
__STATIC_INLINE void UART_EnableFifo (UART_T *UARTx)
 This function enables receive and transmit FIFOs, if they are available. More...
 
__STATIC_INLINE void UART_DisableFifo (UART_T *UARTx)
 This function disables receive and transmit FIFOs. More...
 
__STATIC_INLINE bool UART_IsFifoEnabled (UART_T *UARTx)
 Adjust whether the FIFOs enabled or not. More...
 
__STATIC_INLINE void UART_ResetRxFifo (UART_T *UARTx)
 This function is used to reset rx fifo. More...
 
__STATIC_INLINE void UART_ResetTxFifo (UART_T *UARTx)
 This function is used to reset tx fifo. More...
 
__STATIC_INLINE void UART_SetTxTrigger (UART_T *UARTx, UART_TxTriggerDef level)
 Set the trigger level of the transmitter FIFO empty interrupt. More...
 
__STATIC_INLINE void UART_SetRxTrigger (UART_T *UARTx, UART_RxTriggerDef level)
 Sets the trigger level of the receiver FIFO full interrupt. More...
 
__STATIC_INLINE uint8_t UART_GetTxFifoLevel (UART_T *UARTx)
 Get the transmit fifo level. More...
 
__STATIC_INLINE uint8_t UART_GetRxFifoLevel (UART_T *UARTx)
 Get the receive fifo level. More...
 
__STATIC_INLINE void UART_EnableAfc (UART_T *UARTx)
 Enable auto flow control mode. More...
 
__STATIC_INLINE void UART_DisableAfc (UART_T *UARTx)
 Disable auto flow control mode. More...
 
__STATIC_INLINE bool UART_IsAfcEnabled (UART_T *UARTx)
 Check auto flow control mode enable or not. More...
 
__STATIC_INLINE void UART_SendData (UART_T *UARTx, uint8_t Data)
 Uart send data function. More...
 
__STATIC_INLINE uint8_t UART_ReceiveData (UART_T *UARTx)
 Uart receive data function. More...
 
__STATIC_INLINE void UART_EnablePtime (UART_T *UARTx)
 Programmable THRE interrupt mode enable. More...
 
__STATIC_INLINE void UART_DisablePtime (UART_T *UARTx)
 Programmable THRE interrupt mode disable. More...
 
__STATIC_INLINE bool UART_IsPtimeEnabled (UART_T *UARTx)
 Check programmable THRE interrupt mode enable or not. More...
 
__STATIC_INLINE void UART_EnableIrq (UART_T *UARTx, UART_IrqDef irq)
 Enable interrupt,include Modem status linestatus,THRE,receive data. More...
 
__STATIC_INLINE void UART_DisableIrq (UART_T *UARTx, UART_IrqDef irq)
 Disable interrupt. More...
 
__STATIC_INLINE bool UART_IsIrqEnabled (UART_T *UARTx, UART_IrqDef irq)
 Check interrupt enable or not. More...
 
__STATIC_INLINE uint8_t UART_GetIrqMasked (UART_T *UARTx)
 Get which interrupt is actived. More...
 
__STATIC_INLINE UART_EventDef UART_GetActiveEvent (UART_T *UARTx)
 Get active interrupt ID. More...
 
__STATIC_INLINE bool UART_IsTxFifoEmpty (UART_T *UARTx)
 Check tx fifo empty or not. More...
 
__STATIC_INLINE bool UART_IsTxFifoFull (UART_T *UARTx)
 Check tx fifo full or not. More...
 
__STATIC_INLINE bool UART_IsRxFifoEmpty (UART_T *UARTx)
 Check rx fifo empty or not. More...
 
__STATIC_INLINE bool UART_IsRxFifoFull (UART_T *UARTx)
 Check rx fifo full or not. More...
 
__STATIC_INLINE void UART_EnableHaltTX (UART_T *UARTx)
 Enable halt transmit,this function is used to halt transmit for test. More...
 
__STATIC_INLINE void UART_DisableHaltTX (UART_T *UARTx)
 Disable halt transmit. More...
 
__STATIC_INLINE void UART_EnableRts (UART_T *UARTx)
 Enable request to send in flow control mode. More...
 
__STATIC_INLINE void UART_DisableRts (UART_T *UARTx)
 Disable request to send in flow control mode. More...
 
__STATIC_INLINE void UART_Enable9BitData (UART_T *UARTx)
 Enable 9-bit data transmit and receive transfer. More...
 
__STATIC_INLINE void UART_Disable9BitData (UART_T *UARTx)
 Disable 9-bit data transmit and receive transfer. More...
 
__STATIC_INLINE void UART_EnableAddrMatchMode (UART_T *UARTx)
 Enable address match feature during receive. More...
 
__STATIC_INLINE void UART_DisableAddrMatchMode (UART_T *UARTx)
 Disable address match feature during receive. More...
 
__STATIC_INLINE void UART_SendAddr (UART_T *UARTx)
 UART Send Address,9-bit character will be transmitted with 9-th bit set to 1 and the remaining 8-bits will match to what is being programmed in "Transmit Address Register". More...
 
__STATIC_INLINE void UART_SetReceiveAddress (UART_T *UARTx, uint32_t addr)
 This is an address matching register during receive mode,Set Receive Address. More...
 
__STATIC_INLINE void UART_SetTransmitAddress (UART_T *UARTx, uint32_t addr)
 This is an address matching register during transmit mode,Set transmit address. More...
 
bool UART_Init (UART_T *UARTx, UART_InitTypeDef *UART_InitStruct)
 Initializes the UARTx peripheral according to the specified parameters in the UART_InitStruct . More...
 
void UART_DeInit (UART_T *UARTx)
 Deinit the UARTx peripheral. More...
 
bool UART_SendMultipleData (UART_T *UARTx, uint8_t *Buf, size_t BufSize, size_t SendSize)
 This function is used to send multiple data. More...
 
bool UART_ReceiveMultipleData (UART_T *UARTx, uint8_t *Buf, size_t BufSize, size_t ExpectSize)
 This function is used to receive multiple data. More...
 

Detailed Description

Panchip uart adc driver header file.

Version
V1.00
Revision
3
Date
21/11/12 18:33