APM:Libraries
|
Go to the source code of this file.
Macros | |
#define | _USART2 NULL |
Functions | |
void | usart_foreach (void(*fn)(const usart_dev *)) |
Call a function on each USART. More... | |
void | usart_init (const usart_dev *dev) |
Initialize a serial port. More... | |
void | usart_setup (const usart_dev *dev, uint32_t baudRate, uint16_t wordLength, uint16_t stopBits, uint16_t parity, uint16_t mode, uint16_t hardwareFlowControl) |
Configure a serial port's baud rate. More... | |
uint32_t | usart_tx (const usart_dev *dev, const uint8_t *buf, uint32_t len) |
Nonblocking USART transmit. More... | |
void | usart_putudec (const usart_dev *dev, uint32_t val) |
Transmit an unsigned integer to the specified serial port in decimal format. More... | |
static void | usart_rx_irq (const usart_dev *dev) |
static void | usart_tx_irq (const usart_dev *dev) |
void | USART1_IRQHandler (void) |
void | USART3_IRQHandler (void) |
Variables | |
static ring_buffer usart1_txrb | IN_CCM |
static const usart_dev | usart1 |
const usart_dev *const | _USART1 = &usart1 |
static const usart_dev | usart3 |
const usart_dev *const | _USART3 = &usart3 |
const usart_dev *const | UARTS [] |
uint32_t | us_ticks |
void USART1_IRQHandler | ( | void | ) |
Definition at line 362 of file usart.c.
Referenced by usart_set_callback().
void USART3_IRQHandler | ( | void | ) |
Definition at line 376 of file usart.c.
Referenced by usart_set_callback().
void usart_foreach | ( | void(*)(const usart_dev *) | fn | ) |
Call a function on each USART.
fn | Function to call. |
Definition at line 163 of file usart.c.
Referenced by usart_disable(), and usart_disable_all().
void usart_init | ( | const usart_dev * | dev | ) |
Initialize a serial port.
dev | Serial port to be initialized |
Definition at line 187 of file usart.c.
Referenced by F4Light::UARTDriver::begin().
void usart_putudec | ( | const usart_dev * | dev, |
uint32_t | val | ||
) |
Transmit an unsigned integer to the specified serial port in decimal format.
This function blocks until the integer's digits have been completely transmitted.
dev | Serial port to send on |
val | Number to print |
Definition at line 282 of file usart.c.
Referenced by usart_disable_all().
|
inlinestatic |
Definition at line 301 of file usart.c.
Referenced by USART1_IRQHandler(), and USART3_IRQHandler().
void usart_setup | ( | const usart_dev * | dev, |
uint32_t | baudRate, | ||
uint16_t | wordLength, | ||
uint16_t | stopBits, | ||
uint16_t | parity, | ||
uint16_t | mode, | ||
uint16_t | hardwareFlowControl | ||
) |
Configure a serial port's baud rate.
dev | Serial port to be configured |
baudRate | Baud rate for transmit/receive. |
wordLength | Specifies the number of data bits transmitted or received in a frame. This parameter can be a value of USART_Word_Length |
stopBits | Specifies the number of stop bits transmitted. This parameter can be a value of USART_Stop_Bits |
parity | Specifies the parity mode. This parameter can be a value of USART_Parity |
mode | Specifies wether the Receive or Transmit mode is enabled or disabled. This parameter can be a value of USART_Mode |
hardwareFlowControl | Specifies wether the hardware flow control mode is enabled or disabled. This parameter can be a value of USART_Hardware_Flow_Control |
Definition at line 199 of file usart.c.
Referenced by F4Light::UARTDriver::begin().
uint32_t usart_tx | ( | const usart_dev * | dev, |
const uint8_t * | buf, | ||
uint32_t | len | ||
) |
Nonblocking USART transmit.
dev | Serial port to transmit over |
buf | Buffer to transmit |
len | Maximum number of bytes to transmit |
Definition at line 258 of file usart.c.
Referenced by usart_disable_all(), usart_putc(), and F4Light::UARTDriver::write().
|
inlinestatic |
Definition at line 334 of file usart.c.
Referenced by USART1_IRQHandler(), and USART3_IRQHandler().
|
static |
const usart_dev* const UARTS[] |
uint32_t us_ticks |
Definition at line 10 of file stopwatch.c.
Referenced by usart_foreach().
|
static |
|
static |