VSF Documented
|
Data Structures | |
struct | vsf_usart_ip_t |
struct | vsf_usart_t |
USART instance structure Used for USART Multi Class support. More... | |
Macros | |
#define | __VSF_USART_CLASS_IMPLEMENT |
#define | ____USART_LV0_IMPL(__N, __DONT_CARE) |
#define | __USART_LV0_IMPL(__N, __DONT_CARE) ____USART_LV0_IMPL(__N, __DONT_CARE) |
Typedefs | |
typedef struct vsf_usart_ip_t | vsf_usart_ip_t |
Functions | |
vsf_err_t | vsf_usart_init (vsf_usart_t *usart, vsf_usart_cfg_t *cfg) |
Initialize a USART instance. | |
fsm_rt_t | vsf_usart_enable (vsf_usart_t *usart) |
Enable a USART instance. | |
fsm_rt_t | vsf_usart_disable (vsf_usart_t *usart) |
Disable a USART instance. | |
void | vsf_usart_irq_enable (vsf_usart_t *usart, vsf_usart_irq_mask_t irq_mask) |
Enable interrupt masks of USART instance. | |
void | vsf_usart_irq_disable (vsf_usart_t *usart, vsf_usart_irq_mask_t irq_mask) |
Disable interrupt masks of USART instance. | |
vsf_usart_status_t | vsf_usart_status (vsf_usart_t *usart) |
Get the status of USART instance. | |
uint_fast16_t | vsf_usart_rxfifo_read (vsf_usart_t *usart, void *buffer, uint_fast16_t count) |
uint_fast16_t | vsf_usart_txfifo_write (vsf_usart_t *usart, void *buffer, uint_fast16_t count) |
vsf_err_t | vsf_usart_request_rx (vsf_usart_t *usart, void *buffer, uint_fast32_t count) |
Request a DMA receive operation through the USART. | |
vsf_err_t | vsf_usart_request_tx (vsf_usart_t *usart, void *buffer, uint_fast32_t count) |
Request a DMA transmit operation through the USART. | |
vsf_err_t | vsf_usart_cancel_rx (vsf_usart_t *usart) |
Cancel an ongoing USART receive operation. | |
vsf_err_t | vsf_usart_cancel_tx (vsf_usart_t *usart) |
Cancel an ongoing USART transmit operation. | |
int_fast32_t | vsf_usart_get_rx_count (vsf_usart_t *usart) |
Get the number of bytes received in the current or last USART operation. | |
int_fast32_t | vsf_usart_get_tx_count (vsf_usart_t *usart) |
Get the number of bytes transmitted in the current or last USART operation. | |
#define __VSF_USART_CLASS_IMPLEMENT |
#define ____USART_LV0_IMPL | ( | __N, | |
__DONT_CARE | |||
) |
#define __USART_LV0_IMPL | ( | __N, | |
__DONT_CARE | |||
) | ____USART_LV0_IMPL(__N, __DONT_CARE) |
typedef struct vsf_usart_ip_t vsf_usart_ip_t |
vsf_err_t vsf_usart_init | ( | vsf_usart_t * | usart_ptr, |
vsf_usart_cfg_t * | cfg_ptr | ||
) |
Initialize a USART instance.
[in] | usart_ptr | Pointer to USART instance |
[in] | cfg_ptr | Pointer to USART configuration |
calculate baudrate
fsm_rt_t vsf_usart_enable | ( | vsf_usart_t * | usart_ptr | ) |
Enable a USART instance.
[in] | usart_ptr | a pointer to structure vsf_usart_t |
don't forget to enable sync clock and peripheral_clk here
fsm_rt_t vsf_usart_disable | ( | vsf_usart_t * | usart_ptr | ) |
Disable a USART instance.
[in] | usart_ptr | a pointer to structure vsf_usart_t |
don't forget to disable sync clock and peripheral_clk here
void vsf_usart_irq_enable | ( | vsf_usart_t * | usart_ptr, |
vsf_usart_irq_mask_t | irq_mask | ||
) |
Enable interrupt masks of USART instance.
[in] | usart_ptr | a pointer to structure vsf_usart_t |
[in] | irq_mask | one or more values of enum vsf_usart_irq_mask_t |
void vsf_usart_irq_disable | ( | vsf_usart_t * | usart_ptr, |
vsf_usart_irq_mask_t | irq_mask | ||
) |
Disable interrupt masks of USART instance.
[in] | usart_ptr | a pointer to structure vsf_usart_t |
[in] | irq_mask | one or more values of enum vsf_usart_irq_mask_t |
vsf_usart_status_t vsf_usart_status | ( | vsf_usart_t * | usart_ptr | ) |
Get the status of USART instance.
[in] | usart_ptr | a pointer to structure vsf_usart_t |
uint_fast16_t vsf_usart_rxfifo_read | ( | vsf_usart_t * | usart, |
void * | buffer, | ||
uint_fast16_t | count | ||
) |
uint_fast16_t vsf_usart_txfifo_write | ( | vsf_usart_t * | usart, |
void * | buffer, | ||
uint_fast16_t | count | ||
) |
vsf_err_t vsf_usart_request_rx | ( | vsf_usart_t * | usart_ptr, |
void * | buffer_ptr, | ||
uint_fast32_t | count | ||
) |
Request a DMA receive operation through the USART.
[in] | usart_ptr | a pointer to structure vsf_usart_t |
[in] | buffer_ptr | Pointer to the receive buffer |
[in] | count | Number of bytes to receive |
vsf_err_t vsf_usart_request_tx | ( | vsf_usart_t * | usart_ptr, |
void * | buffer_ptr, | ||
uint_fast32_t | count | ||
) |
Request a DMA transmit operation through the USART.
[in] | usart_ptr | a pointer to structure vsf_usart_t |
[in] | buffer_ptr | Pointer to the transmit buffer |
[in] | count | Number of bytes to transmit |
vsf_err_t vsf_usart_cancel_rx | ( | vsf_usart_t * | usart_ptr | ) |
Cancel an ongoing USART receive operation.
[in] | usart_ptr | a pointer to structure vsf_usart_t |
vsf_err_t vsf_usart_cancel_tx | ( | vsf_usart_t * | usart_ptr | ) |
Cancel an ongoing USART transmit operation.
[in] | usart_ptr | a pointer to structure vsf_usart_t |
int_fast32_t vsf_usart_get_rx_count | ( | vsf_usart_t * | usart_ptr | ) |
Get the number of bytes received in the current or last USART operation.
[in] | usart_ptr | a pointer to structure vsf_usart_t |
int_fast32_t vsf_usart_get_tx_count | ( | vsf_usart_t * | usart_ptr | ) |
Get the number of bytes transmitted in the current or last USART operation.
[in] | usart_ptr | a pointer to structure vsf_usart_t |