Example of UART-DMA transfers taken form the npx cmsis driver libary

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

lpc17xx_uart.h File Reference

lpc17xx_uart.h File Reference

Contains all macro definitions and function prototypes support for UART firmware library on LPC17xx. More...

Go to the source code of this file.

Data Structures

struct  UART_AB_CFG_Type
 Auto Baudrate mode configuration type definition. More...
struct  UART_CFG_Type
 UART Configuration Structure definition. More...
struct  UART_FIFO_CFG_Type
 UART FIFO Configuration Structure definition. More...
struct  UART1_RS485_CTRLCFG_Type
 UART1 Full modem - RS485 Control configuration type. More...

Enumerations

enum  UART_DATABIT_Type { UART_DATABIT_5 = 0, UART_DATABIT_6, UART_DATABIT_7, UART_DATABIT_8 }
 

UART Databit type definitions.

More...
enum  UART_STOPBIT_Type { UART_STOPBIT_1 = (0), UART_STOPBIT_2 }
 

UART Stop bit type definitions.

More...
enum  UART_PARITY_Type {
  UART_PARITY_NONE = 0, UART_PARITY_ODD, UART_PARITY_EVEN, UART_PARITY_SP_1,
  UART_PARITY_SP_0
}
 

UART Parity type definitions.

More...
enum  UART_FITO_LEVEL_Type { UART_FIFO_TRGLEV0 = 0, UART_FIFO_TRGLEV1, UART_FIFO_TRGLEV2, UART_FIFO_TRGLEV3 }
 

FIFO Level type definitions.

More...
enum  UART_INT_Type {
  UART_INTCFG_RBR = 0, UART_INTCFG_THRE, UART_INTCFG_RLS, UART1_INTCFG_MS,
  UART1_INTCFG_CTS, UART_INTCFG_ABEO, UART_INTCFG_ABTO
}
 

UART Interrupt Type definitions.

More...
enum  UART_LS_Type {
  UART_LINESTAT_RDR = UART_LSR_RDR, UART_LINESTAT_OE = UART_LSR_OE, UART_LINESTAT_PE = UART_LSR_PE, UART_LINESTAT_FE = UART_LSR_FE,
  UART_LINESTAT_BI = UART_LSR_BI, UART_LINESTAT_THRE = UART_LSR_THRE, UART_LINESTAT_TEMT = UART_LSR_TEMT, UART_LINESTAT_RXFE = UART_LSR_RXFE
}
 

UART Line Status Type definition.

More...
enum  UART_AB_MODE_Type { UART_AUTOBAUD_MODE0 = 0, UART_AUTOBAUD_MODE1 }
 

UART Auto-baudrate mode type definition.

More...
enum  UART_ABEO_Type { UART_AUTOBAUD_INTSTAT_ABEO = UART_IIR_ABEO_INT, UART_AUTOBAUD_INTSTAT_ABTO = UART_IIR_ABTO_INT }
 

UART End of Auto-baudrate type definition.

More...
enum  UART_IrDA_PULSE_Type {
  UART_IrDA_PULSEDIV2 = 0, UART_IrDA_PULSEDIV4, UART_IrDA_PULSEDIV8, UART_IrDA_PULSEDIV16,
  UART_IrDA_PULSEDIV32, UART_IrDA_PULSEDIV64, UART_IrDA_PULSEDIV128, UART_IrDA_PULSEDIV256
}
 

UART IrDA Control type Definition.

More...
enum  UART1_SignalState
 

UART1 Full modem - Signal states definition.

More...
enum  UART_MODEM_STAT_type {
  UART1_MODEM_STAT_DELTA_CTS = UART1_MSR_DELTA_CTS, UART1_MODEM_STAT_DELTA_DSR = UART1_MSR_DELTA_DSR, UART1_MODEM_STAT_LO2HI_RI = UART1_MSR_LO2HI_RI, UART1_MODEM_STAT_DELTA_DCD = UART1_MSR_DELTA_DCD,
  UART1_MODEM_STAT_CTS = UART1_MSR_CTS, UART1_MODEM_STAT_DSR = UART1_MSR_DSR, UART1_MODEM_STAT_RI = UART1_MSR_RI, UART1_MODEM_STAT_DCD = UART1_MSR_DCD
}
 

UART modem status type definition.

More...
enum  UART_MODEM_PIN_Type { UART1_MODEM_PIN_DTR = 0, UART1_MODEM_PIN_RTS }
 

Modem output pin type definition.

More...
enum  UART_MODEM_MODE_Type { UART1_MODEM_MODE_LOOPBACK = 0, UART1_MODEM_MODE_AUTO_RTS, UART1_MODEM_MODE_AUTO_CTS }
 

UART Modem mode type definition.

More...
enum  UART_RS485_DIRCTRL_PIN_Type { UART1_RS485_DIRCTRL_RTS = 0, UART1_RS485_DIRCTRL_DTR }
 

UART Direction Control Pin type definition.

More...

Functions

void UART_Init (LPC_UART_TypeDef *UARTx, UART_CFG_Type *UART_ConfigStruct)
 Initializes the UARTx peripheral according to the specified parameters in the UART_ConfigStruct.
void UART_DeInit (LPC_UART_TypeDef *UARTx)
 De-initializes the UARTx peripheral registers to their default reset values.
void UART_ConfigStructInit (UART_CFG_Type *UART_InitStruct)
 Fills each UART_InitStruct member with its default value:

  • 9600 bps
  • 8-bit data
  • 1 Stopbit
  • None Parity.

void UART_SendByte (LPC_UART_TypeDef *UARTx, uint8_t Data)
 Transmit a single data through UART peripheral.
uint8_t UART_ReceiveByte (LPC_UART_TypeDef *UARTx)
 Receive a single data from UART peripheral.
uint32_t UART_Send (LPC_UART_TypeDef *UARTx, uint8_t *txbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag)
 Send a block of data via UART peripheral.
uint32_t UART_Receive (LPC_UART_TypeDef *UARTx, uint8_t *rxbuf,\uint32_t buflen, TRANSFER_BLOCK_Type flag)
 Receive a block of data via UART peripheral.
void UART_FIFOConfig (LPC_UART_TypeDef *UARTx, UART_FIFO_CFG_Type *FIFOCfg)
 Configure FIFO function on selected UART peripheral.
void UART_FIFOConfigStructInit (UART_FIFO_CFG_Type *UART_FIFOInitStruct)
 Fills each UART_FIFOInitStruct member with its default value:

  • FIFO_DMAMode = DISABLE
  • FIFO_Level = UART_FIFO_TRGLEV0
  • FIFO_ResetRxBuf = ENABLE
  • FIFO_ResetTxBuf = ENABLE
  • FIFO_State = ENABLE.

uint32_t UART_GetIntId (LPC_UART_TypeDef *UARTx)
 Get Interrupt Identification value.
uint8_t UART_GetLineStatus (LPC_UART_TypeDef *UARTx)
 Get current value of Line Status register in UART peripheral.
void UART_TxCmd (LPC_UART_TypeDef *UARTx, FunctionalState NewState)
 Enable/Disable transmission on UART TxD pin.
FlagStatus UART_CheckBusy (LPC_UART_TypeDef *UARTx)
 Check whether if UART is busy or not.
void UART_ForceBreak (LPC_UART_TypeDef *UARTx)
 Force BREAK character on UART line, output pin UARTx TXD is forced to logic 0.
void UART_ABClearIntPending (LPC_UART_TypeDef *UARTx, UART_ABEO_Type ABIntType)
 Clear Autobaud Interrupt Pending.
void UART_ABCmd (LPC_UART_TypeDef *UARTx, UART_AB_CFG_Type *ABConfigStruct,\FunctionalState NewState)
 Start/Stop Auto Baudrate activity.
void UART_FullModemForcePinState (LPC_UART1_TypeDef *UARTx, UART_MODEM_PIN_Type Pin,\UART1_SignalState NewState)
 Force pin DTR/RTS corresponding to given state (Full modem mode)
void UART_FullModemConfigMode (LPC_UART1_TypeDef *UARTx, UART_MODEM_MODE_Type Mode,\FunctionalState NewState)
 Configure Full Modem mode for UART peripheral.
uint8_t UART_FullModemGetStatus (LPC_UART1_TypeDef *UARTx)
 Get current status of modem status register.
void UART_RS485ReceiverCmd (LPC_UART1_TypeDef *UARTx, FunctionalState NewState)
 Enable/Disable receiver in RS485 module in UART1.
void UART_RS485SendSlvAddr (LPC_UART1_TypeDef *UARTx, uint8_t SlvAddr)
 Send Slave address frames on RS485 bus.
uint32_t UART_RS485SendData (LPC_UART1_TypeDef *UARTx, uint8_t *pData, uint32_t size)
 Send Data frames on RS485 bus.
void UART_IrDAInvtInputCmd (LPC_UART_TypeDef *UARTx, FunctionalState NewState)
 Enable or disable inverting serial input function of IrDA on UART peripheral.
void UART_IrDACmd (LPC_UART_TypeDef *UARTx, FunctionalState NewState)
 Enable or disable IrDA function on UART peripheral.
void UART_IrDAPulseDivConfig (LPC_UART_TypeDef *UARTx, UART_IrDA_PULSE_Type PulseDiv)
 Configure Pulse divider for IrDA function on UART peripheral.

Detailed Description

Contains all macro definitions and function prototypes support for UART firmware library on LPC17xx.

Version:
3.0
Date:
18. June. 2010
Author:
NXP MCU SW Application Team

Software that is described herein is for illustrative purposes only which provides customers with programming information regarding the products. This software is supplied "AS IS" without any warranties. NXP Semiconductors assumes no responsibility or liability for the use of the software, conveys no license or title under any patent, copyright, or mask work right to the product. NXP Semiconductors reserves the right to make changes in the software without notification. NXP Semiconductors also make no representation or warranty that such application will be suitable for the specified use without further testing or modification.

Definition in file lpc17xx_uart.h.