RTEMS
5.0.0
|
#include "chip.h"
#include <assert.h>
#include <string.h>
Functions | |
void | UART_Configure (Uart *uart, uint32_t mode, uint32_t baudrate, uint32_t masterClock) |
Configures an UART peripheral with the specified parameters. More... | |
void | UART_SetTransmitterEnabled (Uart *uart, uint8_t enabled) |
Enables or disables the transmitter of an UART peripheral. More... | |
void | UART_SetReceiverEnabled (Uart *uart, uint8_t enabled) |
Enables or disables the receiver of an UART peripheral. More... | |
uint32_t | UART_IsRxReady (Uart *uart) |
Return 1 if a character can be read in UART. More... | |
uint8_t | UART_GetChar (Uart *uart) |
Reads and returns a character from the UART. More... | |
uint32_t | UART_IsTxReady (Uart *uart) |
Return 1 if a character can be send to UART. More... | |
void | UART_PutChar (Uart *uart, uint8_t c) |
Sends one packet of data through the specified UART peripheral. This function operates synchronously, so it only returns when the data has been actually sent. More... | |
uint32_t | UART_GetStatus (Uart *uart) |
Get present status. More... | |
void | UART_EnableIt (Uart *uart, uint32_t mode) |
Enable interrupt. More... | |
void | UART_DisableIt (Uart *uart, uint32_t mode) |
Disable interrupt. More... | |
uint32_t | UART_GetItMask (Uart *uart) |
Return interrupt mask. More... | |
void | UART_SendBuffer (Uart *uart, uint8_t *pBuffer, uint32_t BuffLen) |
void | UART_ReceiveBuffer (Uart *uart, uint8_t *pBuffer, uint32_t BuffLen) |
void | UART_CompareConfig (Uart *uart, uint8_t Val1, uint8_t Val2) |
Implementation of UART (Universal Asynchronous Receiver Transmitter) controller.
void UART_Configure | ( | Uart * | uart, |
uint32_t | mode, | ||
uint32_t | baudrate, | ||
uint32_t | masterClock | ||
) |
Configures an UART peripheral with the specified parameters.
uart | Pointer to the UART peripheral to configure. |
mode | Desired value for the UART mode register (see the datasheet). |
baudrate | Baudrate at which the UART should operate (in Hz). |
masterClock | Frequency of the system master clock (in Hz). |
void UART_DisableIt | ( | Uart * | uart, |
uint32_t | mode | ||
) |
Disable interrupt.
uart | Pointer to an UART peripheral. |
mode | Interrupt mode. |
void UART_EnableIt | ( | Uart * | uart, |
uint32_t | mode | ||
) |
Enable interrupt.
uart | Pointer to an UART peripheral. |
mode | Interrupt mode. |
uint8_t UART_GetChar | ( | Uart * | uart | ) |
Reads and returns a character from the UART.
uart | Pointer to an UART peripheral. |
uint32_t UART_GetItMask | ( | Uart * | uart | ) |
Return interrupt mask.
uart | Pointer to an UART peripheral. |
uint32_t UART_GetStatus | ( | Uart * | uart | ) |
Get present status.
uart | Pointer to an UART peripheral. |
uint32_t UART_IsRxReady | ( | Uart * | uart | ) |
Return 1 if a character can be read in UART.
uart | Pointer to an UART peripheral. |
uint32_t UART_IsTxReady | ( | Uart * | uart | ) |
Return 1 if a character can be send to UART.
uart | Pointer to an UART peripheral. |
void UART_PutChar | ( | Uart * | uart, |
uint8_t | c | ||
) |
Sends one packet of data through the specified UART peripheral. This function operates synchronously, so it only returns when the data has been actually sent.
uart | Pointer to an UART peripheral. |
c | Character to send |
void UART_SetReceiverEnabled | ( | Uart * | uart, |
uint8_t | enabled | ||
) |
Enables or disables the receiver of an UART peripheral.
uart | Pointer to an UART peripheral |
enabled | If true, the receiver is enabled; otherwise it is disabled. |
void UART_SetTransmitterEnabled | ( | Uart * | uart, |
uint8_t | enabled | ||
) |
Enables or disables the transmitter of an UART peripheral.
uart | Pointer to an UART peripheral |
enabled | If true, the transmitter is enabled; otherwise it is disabled. |