CuVoodoo STM32F1 firmware template
|
library for enhanced USART communication (API) More...
Go to the source code of this file.
Enumerations | |
enum | usart_enhanced_parity_t { USART_ENHANCED_PARITY_NONE, USART_ENHANCED_PARITY_EVEN, USART_ENHANCED_PARITY_ODD, USART_ENHANCED_PARITY_MARK, USART_ENHANCED_PARITY_SPACE } |
enhanced USART setting for the additional parity bit More... | |
Functions | |
bool | usart_enhanced_config (uint32_t usart, uint8_t databits, enum usart_enhanced_parity_t parity) |
configure enhanced USART More... | |
void | usart_enhanced_send (uint32_t usart, uint8_t data) |
send data over the enhanced USART using the configuration More... | |
uint8_t | usart_enhanced_recv (uint32_t usart) |
receive data over the enhanced USART using the configuration More... | |
bool | usart_enhanced_parity_error (uint32_t usart) |
get the parity status of the received data More... | |
Variables | |
const bool | usart_enhanced_even_parity_lut [256] |
know if there is an even number of 1's in a integer More... | |
library for enhanced USART communication (API)
the USART peripherals only support 8 or 9-bit word and even or odd parity (included in the data bits). The library adds support for 5 to 8-bit words, none/even/odd/mark/space parity (on top of the data bits)
Definition in file usart_enhanced.h.
enhanced USART setting for the additional parity bit
Definition at line 26 of file usart_enhanced.h.
bool usart_enhanced_config | ( | uint32_t | usart, |
uint8_t | databits, | ||
enum usart_enhanced_parity_t | parity | ||
) |
configure enhanced USART
[in] | usart | USART peripheral base address |
[in] | databits | word size in bits (5 to 8) |
[in] | parity | additional parity bit |
Definition at line 68 of file usart_enhanced.c.
bool usart_enhanced_parity_error | ( | uint32_t | usart | ) |
get the parity status of the received data
[in] | usart | USART peripheral base address |
Definition at line 172 of file usart_enhanced.c.
uint8_t usart_enhanced_recv | ( | uint32_t | usart | ) |
receive data over the enhanced USART using the configuration
[in] | usart | USART peripheral base address |
Definition at line 131 of file usart_enhanced.c.
void usart_enhanced_send | ( | uint32_t | usart, |
uint8_t | data | ||
) |
send data over the enhanced USART using the configuration
[in] | usart | USART peripheral base address |
[in] | data | data to be sent |
Definition at line 96 of file usart_enhanced.c.
const bool usart_enhanced_even_parity_lut[256] |
know if there is an even number of 1's in a integer
Definition at line 41 of file usart_enhanced.c.