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

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

lpc17xx_uart.c File Reference

lpc17xx_uart.c File Reference

Contains all functions support for UART firmware library on LPC17xx. More...

Go to the source code of this file.

Functions

static Status uart_set_divisors (LPC_UART_TypeDef *UARTx, uint32_t baudrate)
 Determines best dividers to get a target clock rate.
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_ForceBreak (LPC_UART_TypeDef *UARTx)
 Force BREAK character on UART line, output pin UARTx TXD is forced to logic 0.
void UART_IntConfig (LPC_UART_TypeDef *UARTx, UART_INT_Type UARTIntCfg, FunctionalState NewState)
 Enable or disable specified UART interrupt.
uint8_t UART_GetLineStatus (LPC_UART_TypeDef *UARTx)
 Get current value of Line Status register in UART peripheral.
uint32_t UART_GetIntId (LPC_UART_TypeDef *UARTx)
 Get Interrupt Identification value.
FlagStatus UART_CheckBusy (LPC_UART_TypeDef *UARTx)
 Check whether if UART is busy or not.
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.

void UART_ABCmd (LPC_UART_TypeDef *UARTx, UART_AB_CFG_Type *ABConfigStruct,\FunctionalState NewState)
 Start/Stop Auto Baudrate activity.
void UART_ABClearIntPending (LPC_UART_TypeDef *UARTx, UART_ABEO_Type ABIntType)
 Clear Autobaud Interrupt Pending.
void UART_TxCmd (LPC_UART_TypeDef *UARTx, FunctionalState NewState)
 Enable/Disable transmission on UART TxD pin.
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.
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_RS485Config (LPC_UART1_TypeDef *UARTx, UART1_RS485_CTRLCFG_Type *RS485ConfigStruct)
 Configure UART peripheral in RS485 mode according to the specified parameters in the RS485ConfigStruct.
void UART_RS485ReceiverCmd (LPC_UART1_TypeDef *UARTx, FunctionalState NewState)
 Enable/Disable receiver in RS485 module in UART1.
uint32_t UART_RS485Send (LPC_UART1_TypeDef *UARTx, uint8_t *pDatFrm,\uint32_t size, uint8_t ParityStick)
 Send data on RS485 bus with specified parity stick value (9-bit mode).
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.

Detailed Description

Contains all functions 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.c.