VSF Documented
|
Data Structures | |
struct | vsf_usart_ip_t |
struct | vsf_usart_t |
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 interrupt masks of usart instance. | |
fsm_rt_t | vsf_usart_disable (vsf_usart_t *usart) |
disable interrupt masks of 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) |
try to read the maximum length of data from the usart receive fifo | |
uint_fast16_t | vsf_usart_txfifo_write (vsf_usart_t *usart, void *buffer, uint_fast16_t count) |
try to write the maximum length of data from the usart send fifo | |
vsf_err_t | vsf_usart_request_rx (vsf_usart_t *usart, void *buffer, uint_fast32_t count) |
usart request to receive data of specified length | |
vsf_err_t | vsf_usart_request_tx (vsf_usart_t *usart, void *buffer, uint_fast32_t count) |
usart request to send data of specified length | |
vsf_err_t | vsf_usart_cancel_rx (vsf_usart_t *usart) |
cancel current current receive request | |
vsf_err_t | vsf_usart_cancel_tx (vsf_usart_t *usart) |
cancel current send request | |
int_fast32_t | vsf_usart_get_rx_count (vsf_usart_t *usart) |
get the number of current receive requests that have been received | |
int_fast32_t | vsf_usart_get_tx_count (vsf_usart_t *usart) |
get the number of current send requests that have been sended | |
#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 | a pointer to structure vsf_usart_t |
[in] | cfg_ptr | a pointer to structure vsf_usart_cfg_t |
calculate baudrate
fsm_rt_t vsf_usart_enable | ( | vsf_usart_t * | usart_ptr | ) |
enable interrupt masks of 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 interrupt masks of 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 value 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 value of enum vsf_usart_irq_mask_t, 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_ptr, |
void * | buffer_ptr, | ||
uint_fast16_t | count | ||
) |
try to read the maximum length of data from the usart receive fifo
[in] | usart_ptr | a pointer to structure vsf_usart_t |
[in] | buffer_ptr | data buffer |
[in] | count | maximum number of reads |
uint_fast16_t vsf_usart_txfifo_write | ( | vsf_usart_t * | usart_ptr, |
void * | buffer_ptr, | ||
uint_fast16_t | count | ||
) |
try to write the maximum length of data from the usart send fifo
[in] | usart_ptr | a pointer to structure vsf_usart_t |
[in] | buffer_ptr | data buffer |
[in] | count | maximum number of writes |
vsf_err_t vsf_usart_request_rx | ( | vsf_usart_t * | usart_ptr, |
void * | buffer_ptr, | ||
uint_fast32_t | count | ||
) |
usart request to receive data of specified length
[in] | usart_ptr | a pointer to structure vsf_usart_t |
[in] | buffer_ptr | data buffer |
[in] | count | number of requested data |
vsf_err_t vsf_usart_request_tx | ( | vsf_usart_t * | usart_ptr, |
void * | buffer_ptr, | ||
uint_fast32_t | count | ||
) |
usart request to send data of specified length
[in] | usart_ptr | a pointer to structure vsf_usart_t |
[in] | buffer_ptr | data buffer |
[in] | count | number of requested data |
vsf_err_t vsf_usart_cancel_rx | ( | vsf_usart_t * | usart_ptr | ) |
cancel current current receive request
[in] | usart_ptr | a pointer to structure vsf_usart_t |
vsf_err_t vsf_usart_cancel_tx | ( | vsf_usart_t * | usart_ptr | ) |
cancel current send request
[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 current receive requests that have been received
[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 current send requests that have been sended
[in] | usart_ptr | a pointer to structure vsf_usart_t |