18#ifndef __VSF_TEMPLATE_USART_H__
19#define __VSF_TEMPLATE_USART_H__
32#ifndef VSF_USART_CFG_MULTI_CLASS
33# define VSF_USART_CFG_MULTI_CLASS ENABLED
36#if defined(VSF_HW_USART_COUNT) && !defined(VSF_HW_USART_MASK)
37# define VSF_HW_USART_MASK VSF_HAL_COUNT_TO_MASK(VSF_HW_USART_COUNT)
40#if defined(VSF_HW_USART_MASK) && !defined(VSF_HW_USART_COUNT)
41# define VSF_HW_USART_COUNT VSF_HAL_MASK_TO_COUNT(VSF_HW_USART_MASK)
53#ifndef VSF_USART_CFG_PREFIX
54# if VSF_USART_CFG_MULTI_CLASS == ENABLED
55# define VSF_USART_CFG_PREFIX vsf
56# elif defined(VSF_HW_USART_COUNT) && (VSF_HW_USART_COUNT != 0)
57# define VSF_USART_CFG_PREFIX vsf_hw
59# define VSF_USART_CFG_PREFIX vsf
65#ifndef VSF_USART_CFG_FUNCTION_RENAME
66# define VSF_USART_CFG_FUNCTION_RENAME ENABLED
71#ifndef VSF_USART_CFG_REIMPLEMENT_TYPE_MODE
72# define VSF_USART_CFG_REIMPLEMENT_TYPE_MODE DISABLED
77#ifndef VSF_USART_CFG_REIMPLEMENT_TYPE_IRQ_MASK
78# define VSF_USART_CFG_REIMPLEMENT_TYPE_IRQ_MASK DISABLED
83#ifndef VSF_USART_CFG_REIMPLEMENT_TYPE_STATUS
84# define VSF_USART_CFG_REIMPLEMENT_TYPE_STATUS DISABLED
89#ifndef VSF_USART_CFG_REIMPLEMENT_TYPE_CMD
90# define VSF_USART_CFG_REIMPLEMENT_TYPE_CMD DISABLED
93#ifndef VSF_USART_CFG_REIMPLEMENT_MODE_TO_DATA_BITS
94# define VSF_USART_CFG_REIMPLEMENT_MODE_TO_DATA_BITS \
101#if VSF_USART_CFG_REIMPLEMENT_TYPE_CFG == DISABLED
102# define VSF_USART_CFG_REIMPLEMENT_TYPE_CFG DISABLED
108#if VSF_USART_CFG_REIMPLEMENT_TYPE_CAPABILITY == DISABLED
109# define VSF_USART_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED
112#ifndef VSF_USART_CFG_INHERT_HAL_CAPABILITY
113# define VSF_USART_CFG_INHERT_HAL_CAPABILITY ENABLED
116#ifndef VSF_USART_CFG_REQUEST_API
117# define VSF_USART_CFG_REQUEST_API ENABLED
120#ifndef VSF_USART_CFG_FIFO_API
121# define VSF_USART_CFG_FIFO_API ENABLED
126#define __VSF_USART_BASE_APIS(__prefix_name) \
127 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, usart, init, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr, vsf_usart_cfg_t *cfg_ptr) \
128 __VSF_HAL_TEMPLATE_API(__prefix_name, void, usart, fini, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
129 __VSF_HAL_TEMPLATE_API(__prefix_name, fsm_rt_t, usart, enable, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
130 __VSF_HAL_TEMPLATE_API(__prefix_name, fsm_rt_t, usart, disable, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
131 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_usart_capability_t, usart, capability, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
132 __VSF_HAL_TEMPLATE_API(__prefix_name, void, usart, irq_enable, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr, vsf_usart_irq_mask_t irq_mask) \
133 __VSF_HAL_TEMPLATE_API(__prefix_name, void, usart, irq_disable, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr, vsf_usart_irq_mask_t irq_mask) \
134 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_usart_status_t, usart, status, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr)
136#if VSF_USART_CFG_FIFO_API == ENABLED
137# define __VSF_USART_FIFO_APIS(__prefix_name) \
138 __VSF_HAL_TEMPLATE_API(__prefix_name, uint_fast16_t, usart, rxfifo_get_data_count, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
139 __VSF_HAL_TEMPLATE_API(__prefix_name, uint_fast16_t, usart, rxfifo_read, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr, void *buffer_ptr, uint_fast16_t count) \
140 __VSF_HAL_TEMPLATE_API(__prefix_name, uint_fast16_t, usart, txfifo_get_free_count, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
141 __VSF_HAL_TEMPLATE_API(__prefix_name, uint_fast16_t, usart, txfifo_write, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr, void *buffer_ptr, uint_fast16_t count)
143# define __VSF_USART_FIFO_APIS(__prefix_name)
146#if VSF_USART_CFG_REQUEST_API == ENABLED
147# define __VSF_USART_REQUEST_APIS(__prefix_name) \
148 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, usart, request_rx, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr, void *buffer_ptr, uint_fast32_t count) \
149 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, usart, request_tx, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr, void *buffer_ptr, uint_fast32_t count) \
150 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, usart, cancel_rx, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
151 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, usart, cancel_tx, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
152 __VSF_HAL_TEMPLATE_API(__prefix_name, int_fast32_t, usart, get_rx_count, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
153 __VSF_HAL_TEMPLATE_API(__prefix_name, int_fast32_t, usart, get_tx_count, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr)
155# define __VSF_USART_REQUEST_APIS(__prefix_name)
158#define __VSF_USART_REQUEST_EXTRA_APIS(__prefix_name) \
159 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, usart, cmd, VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr, vsf_usart_cmd_t cmd, void* param)
161#define VSF_USART_ADDITIONAL_APIS(__prefix_name) \
162 static inline vsf_err_t VSF_MCONNECT(__prefix_name, _usart_send_break) \
163 (VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
165 return VSF_MCONNECT(__prefix_name, _usart_cmd)(usart_ptr, \
166 VSF_USART_CMD_SEND_BREAK, NULL); \
168 static inline vsf_err_t VSF_MCONNECT(__prefix_name, _usart_set_break) \
169 (VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
171 vsf_usart_capability_t cap = \
172 VSF_MCONNECT(__prefix_name, _usart_capability)(usart_ptr); \
173 VSF_HAL_ASSERT(cap.support_set_and_clear_break); \
174 return VSF_MCONNECT(__prefix_name, _usart_cmd)(usart_ptr, \
175 VSF_USART_CMD_SET_BREAK, NULL); \
177 static inline vsf_err_t VSF_MCONNECT(__prefix_name, _usart_clear_break) \
178 (VSF_MCONNECT(__prefix_name, _usart_t) *usart_ptr) \
180 vsf_usart_capability_t cap = \
181 VSF_MCONNECT(__prefix_name, _usart_capability)(usart_ptr); \
182 VSF_HAL_ASSERT(cap.support_set_and_clear_break); \
183 return VSF_MCONNECT(__prefix_name, _usart_cmd)(usart_ptr, \
184 VSF_USART_CMD_CLEAR_BREAK, NULL); \
187#define VSF_USART_APIS(__prefix_name) \
188 __VSF_USART_BASE_APIS(__prefix_name) \
189 __VSF_USART_FIFO_APIS(__prefix_name) \
190 __VSF_USART_REQUEST_APIS(__prefix_name) \
191 __VSF_USART_REQUEST_EXTRA_APIS(__prefix_name)
195#if VSF_USART_CFG_REIMPLEMENT_TYPE_MODE == DISABLED
366 VSF_USART_RX_FIFO_THRESHOLD_1 = (0x0ul << 17),
368 VSF_USART_RX_FIFO_THRESHOLD_2 = (0x1ul << 17),
370 VSF_USART_RX_FIFO_THRESHOLD_3 = (0x2ul << 17),
372 VSF_USART_RX_FIFO_THRESHOLD_4 = (0x3ul << 17),
374 VSF_USART_RX_FIFO_THRESHOLD_5 = (0x4ul << 17),
376 VSF_USART_RX_FIFO_THRESHOLD_6 = (0x5ul << 17),
378 VSF_USART_RX_FIFO_THRESHOLD_7 = (0x6ul << 17),
380 VSF_USART_RX_FIFO_THRESHOLD_8 = (0x7ul << 17),
381 VSF_USART_RX_FIFO_THRESHOLD_NOT_EMPTY = VSF_USART_RX_FIFO_THRESHOLD_1,
382 VSF_USART_RX_FIFO_THRESHOLD_HALF_FULL = VSF_USART_RX_FIFO_THRESHOLD_4,
383 VSF_USART_RX_FIFO_THRESHOLD_FULL = VSF_USART_RX_FIFO_THRESHOLD_8,
393 VSF_USART_IRDA_ENABLE = (0x1ul << 18),
394 VSF_USART_IRDA_DISABLE = (0x0ul << 18),
395 #define VSF_USART_IRDA_ENABLE VSF_USART_IRDA_ENABLE
396 #define VSF_USART_IRDA_DISABLE VSF_USART_IRDA_DISABLE
397 #define VSF_USART_IRDA_MASK VSF_USART_IRDA_ENABLE | VSF_USART_IRDA_DISABLE
399 VSF_USART_SMARTCARD_ENABLE = (0x1ul << 19),
400 VSF_USART_SMARTCARD_DISABLE = (0x0ul << 19),
401 #define VSF_USART_SMARTCARD_ENABLE VSF_USART_SMARTCARD_ENABLE
402 #define VSF_USART_SMARTCARD_DISABLE VSF_USART_SMARTCARD_DISABLE
403 #define VSF_USART_SMARTCARD_MASK VSF_USART_SMARTCARDENABLE | VSF_USART_SMARTCARD_DISABLE
405 // whether the clock pulse corresponding to the last transmitted
406 VSF_USART_SYNC_CLOCK_LAST_BIT_ENABLE = (0x0ul << 20),
407 VSF_USART_SYNC_CLOCK_LAST_BIT_DISABLE = (0x0ul << 20),
408 #define VSF_USART_SYNC_CLOCK_LAST_BIT_ENABLE VSF_USART_SYNC_CLOCK_LAST_BIT_ENABLE
409 #define VSF_USART_SYNC_CLOCK_LAST_BIT_DISABLE VSF_USART_SYNC_CLOCK_LAST_BIT_DISABLE
410 #define VSF_USART_SYNC_CLOCK_LAST_BIT_MASK VSF_USART_SYNC_CLOCK_LAST_BIT_ENABLE | \
411 VSF_USART_SYNC_CLOCK_LAST_BIT_DISABLE
413 // divisor of IRDA clock
414 VSF_USART_IRDA_PRESCALER_BIT_OFFSET = (21),
415 VSF_USART_IRDA_PRESCALER_MASK = (0xFul << VSF_USART_IRDA_PRESCALER_BIT_OFFSET),
416 #define VSF_USART_IRDA_PRESCALER_BIT_OFFSET VSF_USART_IRDA_PRESCALER_BIT_OFFSET
417 #define VSF_USART_IRDA_PRESCALER_MASK VSF_USART_IRDA_PRESCALER_MASK
423#ifndef VSF_USART_PARITY_MASK
431#ifndef VSF_USART_STOPBIT_MASK
438#ifndef VSF_USART_BIT_LENGTH_MASK
447#ifndef VSF_USART_TX_FIFO_THRESHOLD_MASK
453#ifndef VSF_USART_RX_FIFO_THRESHOLD_MASK
459#ifndef VSF_USART_HWCONTROL_MASK
498#ifdef VSF_USART_SYNC_CLOCK_LAST_BIT_MASK
502#ifdef VSF_USART_IRDA_PRESCALER_MASK
503 | VSF_USART_IRDA_PRESCALER_MASK
505#ifdef VSF_USART_IRDA_MASK
506 | VSF_USART_IRDA_MASK
509#ifdef VSF_USART_SMARTCARD_MASK
510 | VSF_USART_SMARTCARD_MASK
514#if VSF_USART_CFG_REIMPLEMENT_TYPE_IRQ_MASK == DISABLED
578#ifndef VSF_USART_IRQ_MASK_ERR
585#ifndef VSF_USART_IRQ_ALL_BITS_MASK
593# ifdef VSF_USART_IRQ_MASK_TX_HALF_CPL
594 | VSF_USART_IRQ_MASK_TX_HALF_CPL
596# ifdef VSF_USART_IRQ_MASK_RX_HALF_CPL
597 | VSF_USART_IRQ_MASK_RX_HALF_CPL
599# ifdef VSF_USART_IRQ_MASK_CANCEL_TX_CPL
600 | VSF_USART_IRQ_MASK_CANCEL_TX_CPL
602# ifdef VSF_USART_IRQ_MASK_CANCEL_RX_CPL
603 | VSF_USART_IRQ_MASK_CANCEL_RX_CPL
608#if VSF_USART_CFG_REIMPLEMENT_TYPE_CFG == DISABLED
629#if VSF_USART_CFG_REIMPLEMENT_TYPE_CMD == DISABLED
678#if VSF_USART_CFG_REIMPLEMENT_TYPE_STATUS == DISABLED
696#if VSF_USART_CFG_INHERT_HAL_CAPABILITY == ENABLED
719#undef __VSF_HAL_TEMPLATE_API
720#define __VSF_HAL_TEMPLATE_API VSF_HAL_TEMPLATE_API_FP
725#if VSF_USART_CFG_MULTI_CLASS == ENABLED
1025#if VSF_USART_CFG_REIMPLEMENT_MODE_TO_DATA_BITS == DISABLED
1107#if VSF_USART_CFG_FUNCTION_RENAME == ENABLED
1108# define __vsf_usart_t VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_t)
1109# define vsf_usart_init(__USART, ...) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_init) ((__vsf_usart_t *)(__USART), ##__VA_ARGS__)
1110# define vsf_usart_fini(__USART) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_fini) ((__vsf_usart_t *)(__USART))
1111# define vsf_usart_capability(__USART) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_capability) ((__vsf_usart_t *)(__USART))
1112# define vsf_usart_enable(__USART) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_enable) ((__vsf_usart_t *)(__USART))
1113# define vsf_usart_disable(__USART) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_disable) ((__vsf_usart_t *)(__USART))
1114# define vsf_usart_irq_enable(__USART, ...) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_irq_enable) ((__vsf_usart_t *)(__USART), ##__VA_ARGS__)
1115# define vsf_usart_irq_disable(__USART, ...) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_irq_disable) ((__vsf_usart_t *)(__USART), ##__VA_ARGS__)
1116# define vsf_usart_status(__USART) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_status) ((__vsf_usart_t *)(__USART))
1117# define vsf_usart_rxfifo_get_data_count(__USART, ...) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_rxfifo_get_data_count) ((__vsf_usart_t *)(__USART), ##__VA_ARGS__)
1118# define vsf_usart_rxfifo_read(__USART, ...) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_rxfifo_read) ((__vsf_usart_t *)(__USART), ##__VA_ARGS__)
1119# define vsf_usart_txfifo_get_free_count(__USART, ...) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_txfifo_get_free_count) ((__vsf_usart_t *)(__USART), ##__VA_ARGS__)
1120# define vsf_usart_txfifo_write(__USART, ...) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_txfifo_write) ((__vsf_usart_t *)(__USART), ##__VA_ARGS__)
1121# define vsf_usart_request_rx(__USART, ...) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_request_rx) ((__vsf_usart_t *)(__USART), ##__VA_ARGS__)
1122# define vsf_usart_request_tx(__USART, ...) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_request_tx) ((__vsf_usart_t *)(__USART), ##__VA_ARGS__)
1123# define vsf_usart_cancel_rx(__USART) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_cancel_rx) ((__vsf_usart_t *)(__USART))
1124# define vsf_usart_cancel_tx(__USART) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_cancel_tx) ((__vsf_usart_t *)(__USART))
1125# define vsf_usart_get_rx_count(__USART) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_get_rx_count) ((__vsf_usart_t *)(__USART))
1126# define vsf_usart_get_tx_count(__USART) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_get_tx_count) ((__vsf_usart_t *)(__USART))
1127# define vsf_usart_send_break(__USART, ...) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_send_break) ((__vsf_usart_t *)(__USART))
1128# define vsf_usart_set_break(__USART) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_send_break) ((__vsf_usart_t *)(__USART))
1129# define vsf_usart_clear_break(__USART) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_send_break) ((__vsf_usart_t *)(__USART))
1130# define vsf_usart_cmd(__USART, ...) VSF_MCONNECT(VSF_USART_CFG_PREFIX, _usart_cmd) ((__vsf_usart_t *)(__USART), ##__VA_ARGS__)
vsf_err_t
Definition __type.h:42
vsf_usart_mode_t
Definition uart.h:32
vsf_usart_irq_mask_t
Definition uart.h:106
#define VSF_USART_SYNC_CLOCK_LAST_BIT_MASK
Definition usart.h:129
vsf_arch_prio_t
Definition cortex_a_generic.h:88
#define NULL
Definition lvgl.h:26
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
const i_spi_t vsf_spi_irq_mask_t irq_mask
Definition spi_interface.h:38
unsigned int uint_fast32_t
Definition stdint.h:27
int int_fast32_t
Definition stdint.h:26
unsigned short uint_fast16_t
Definition stdint.h:25
Definition vsf_template_hal_driver.h:203
Definition vsf_template_hal_driver.h:196
Definition vsf_template_usart.h:695
uint8_t max_data_bits
Definition vsf_template_usart.h:710
uint8_t support_set_and_clear_break
Definition vsf_template_usart.h:715
inherit(vsf_peripheral_capability_t) vsf_usart_irq_mask_t irq_mask
uint8_t support_rx_timeout
Definition vsf_template_usart.h:713
uint8_t rxfifo_depth
Definition vsf_template_usart.h:708
uint8_t support_send_break
Definition vsf_template_usart.h:714
uint8_t txfifo_depth
Definition vsf_template_usart.h:706
uint8_t min_data_bits
Definition vsf_template_usart.h:711
uint32_t min_baudrate
Definition vsf_template_usart.h:703
uint32_t max_baudrate
Definition vsf_template_usart.h:702
Definition vsf_template_usart.h:621
uint32_t mode
Definition vsf_template_usart.h:622
uint32_t baudrate
Definition vsf_template_usart.h:623
uint32_t rx_timeout
Definition vsf_template_usart.h:624
vsf_usart_isr_t isr
Definition vsf_template_usart.h:625
Definition vsf_template_usart.h:615
vsf_arch_prio_t prio
Definition vsf_template_usart.h:618
vsf_usart_isr_handler_t * handler_fn
Definition vsf_template_usart.h:616
void * target_ptr
Definition vsf_template_usart.h:617
Definition vsf_template_usart.h:718
uint32_t is_busy
Definition usart.h:280
Definition vsf_template_usart.h:726
const vsf_usart_op_t * op
Definition vsf_template_usart.h:727
fsm_rt_t
Definition vsf_fsm.h:315
#define VSF_HAL_ASSERT(__CON)
all hal modules use this configuration file
Definition vsf_hal_cfg.h:36
#define vsf_usart_send_break(__USART,...)
Definition vsf_template_usart.h:1127
#define vsf_usart_txfifo_get_free_count(__USART,...)
Definition vsf_template_usart.h:1119
#define vsf_usart_disable(__USART)
Definition vsf_template_usart.h:1113
@ VSF_USART_IRQ_MASK_ERR
Definition vsf_template_usart.h:579
@ VSF_USART_IRQ_MASK_TX_FIFO_THRESHOLD
Definition vsf_template_usart.h:575
@ VSF_USART_IRQ_ALL_BITS_MASK
Definition vsf_template_usart.h:586
@ VSF_USART_IRQ_MASK_RX_IDLE
Definition vsf_template_usart.h:574
@ VSF_USART_IRQ_MASK_RX_FIFO_THRESHOLD
Definition vsf_template_usart.h:576
#define vsf_usart_init(__USART,...)
Definition vsf_template_usart.h:1109
#define vsf_usart_capability(__USART)
Definition vsf_template_usart.h:1111
vsf_usart_mode_t
Predefined VSF USART modes that can be reimplemented in specific hal drivers.
Definition vsf_template_usart.h:270
@ VSF_USART_TX_FIFO_THRESHOLD_EMPTY
TX FIFO becomes emtpy.
Definition vsf_template_usart.h:344
@ VSF_USART_HALF_DUPLEX_DISABLE
Definition vsf_template_usart.h:313
@ VSF_USART_8_BIT_LENGTH
data bits : 8,
Definition vsf_template_usart.h:288
@ VSF_USART_SYNC_CLOCK_ENABLE
Definition vsf_template_usart.h:304
@ VSF_USART_EVEN_PARITY
Definition vsf_template_usart.h:273
@ VSF_USART_RX_FIFO_THRESHOLD_NOT_EMPTY
Definition vsf_template_usart.h:387
@ VSF_USART_ODD_PARITY
Definition vsf_template_usart.h:274
@ VSF_USART_SYNC_CLOCK_PHASE_1_EDGE
Definition vsf_template_usart.h:310
@ VSF_USART_NO_PARITY
USART Parity.
Definition vsf_template_usart.h:272
@ VSF_USART_10_BIT_LENGTH
data bits : 10,
Definition vsf_template_usart.h:290
@ VSF_USART_RTS_HWCONTROL
Definition vsf_template_usart.h:294
@ VSF_USART_RX_FIFO_THRESHOLD_HALF_FULL
Half of the threshold for RX FIFO.
Definition vsf_template_usart.h:388
@ VSF_USART_RX_ENABLE
Definition vsf_template_usart.h:301
@ VSF_USART_FORCE_0_PARITY
Definition vsf_template_usart.h:275
@ VSF_USART_TX_FIFO_THRESHOLD_NOT_FULL
Definition vsf_template_usart.h:349
@ VSF_USART_TX_ENABLE
Definition vsf_template_usart.h:298
@ VSF_USART_SYNC_CLOCK_POLARITY_HIGH
Definition vsf_template_usart.h:309
@ VSF_USART_9_BIT_LENGTH
data bits : 9,
Definition vsf_template_usart.h:289
@ VSF_USART_7_BIT_LENGTH
data bits : 7,
Definition vsf_template_usart.h:287
@ VSF_USART_1_STOPBIT
USART Stopbit.
Definition vsf_template_usart.h:279
@ VSF_USART_FORCE_1_PARITY
Definition vsf_template_usart.h:276
@ VSF_USART_SYNC_CLOCK_POLARITY_LOW
USART SYNC Mode Clock.
Definition vsf_template_usart.h:308
@ VSF_USART_RX_DISABLE
Definition vsf_template_usart.h:302
@ VSF_USART_2_STOPBIT
stopbit: 2 bit
Definition vsf_template_usart.h:282
@ VSF_USART_CTS_HWCONTROL
Definition vsf_template_usart.h:295
@ VSF_USART_5_BIT_LENGTH
USART Databit Lenght.
Definition vsf_template_usart.h:285
@ VSF_USART_SYNC_CLOCK_DISABLE
Definition vsf_template_usart.h:305
@ VSF_USART_RTS_CTS_HWCONTROL
Definition vsf_template_usart.h:296
@ VSF_USART_SYNC_CLOCK_PHASE_2_EDGE
Definition vsf_template_usart.h:311
@ VSF_USART_HALF_DUPLEX_ENABLE
Definition vsf_template_usart.h:314
@ VSF_USART_TX_DISABLE
Definition vsf_template_usart.h:299
@ VSF_USART_RX_FIFO_THRESHOLD_FULL
Full of the threshold for RX FIFO.
Definition vsf_template_usart.h:389
@ VSF_USART_6_BIT_LENGTH
data bits : 6,
Definition vsf_template_usart.h:286
@ VSF_USART_0_5_STOPBIT
stopbit: 0.5 bit
Definition vsf_template_usart.h:281
@ VSF_USART_TX_FIFO_THRESHOLD_HALF_EMPTY
Definition vsf_template_usart.h:345
@ VSF_USART_NO_HWCONTROL
USART Hardware Control.
Definition vsf_template_usart.h:293
@ VSF_USART_1_5_STOPBIT
stopbit: 1.5 bit
Definition vsf_template_usart.h:280
#define vsf_usart_request_tx(__USART,...)
Definition vsf_template_usart.h:1122
#define vsf_usart_clear_break(__USART)
Definition vsf_template_usart.h:1129
#define vsf_usart_rxfifo_read(__USART,...)
Definition vsf_template_usart.h:1118
#define vsf_usart_irq_disable(__USART,...)
Definition vsf_template_usart.h:1115
#define vsf_usart_rxfifo_get_data_count(__USART,...)
Definition vsf_template_usart.h:1117
#define vsf_usart_cmd(__USART,...)
Definition vsf_template_usart.h:1130
#define vsf_usart_cancel_tx(__USART)
Definition vsf_template_usart.h:1124
#define vsf_usart_request_rx(__USART,...)
Definition vsf_template_usart.h:1121
vsf_usart_cmd_t
Predefined VSF USART command that can be reimplemented in specific hal drivers.
Definition vsf_template_usart.h:647
@ VSF_USART_CMD_SET_BREAK
usart set break condition
Definition vsf_template_usart.h:654
@ VSF_USART_CMD_CLEAR_BREAK
usart clean break condition
Definition vsf_template_usart.h:656
@ VSF_USART_CMD_SEND_BREAK
Definition vsf_template_usart.h:651
@ VSF_USART_BIT_LENGTH_MASK
Definition vsf_template_usart.h:439
@ VSF_USART_SYNC_CLOCK_POLARITY_MASK
Definition vsf_template_usart.h:478
@ VSF_USART_TX_FIFO_THRESHOLD_MASK
Definition vsf_template_usart.h:448
@ VSF_USART_PARITY_MASK
Definition vsf_template_usart.h:424
@ VSF_USART_MODE_ALL_BITS_MASK
Definition vsf_template_usart.h:486
@ VSF_USART_HALF_DUPLEX_MASK
Definition vsf_template_usart.h:475
@ VSF_USART_HWCONTROL_MASK
Definition vsf_template_usart.h:460
@ VSF_USART_RX_MASK
Definition vsf_template_usart.h:469
@ VSF_USART_SYNC_CLOCK_PHASE_MASK
Definition vsf_template_usart.h:481
@ VSF_USART_STOPBIT_MASK
Definition vsf_template_usart.h:432
@ VSF_USART_RX_FIFO_THRESHOLD_MASK
Definition vsf_template_usart.h:454
@ VSF_USART_SYNC_CLOCK_MASK
Definition vsf_template_usart.h:472
@ VSF_USART_TX_MASK
Definition vsf_template_usart.h:466
#define vsf_usart_txfifo_write(__USART,...)
Definition vsf_template_usart.h:1120
#define vsf_usart_cancel_rx(__USART)
Definition vsf_template_usart.h:1123
vsf_usart_irq_mask_t
Predefined VSF USART interrupt that can be reimplemented in specific hal drivers.
Definition vsf_template_usart.h:537
@ VSF_USART_IRQ_MASK_TX_CPL
Definition vsf_template_usart.h:539
@ VSF_USART_IRQ_MASK_OVERFLOW_ERR
Definition vsf_template_usart.h:554
@ VSF_USART_IRQ_MASK_CTS
Definition vsf_template_usart.h:548
@ VSF_USART_IRQ_MASK_TX
Definition vsf_template_usart.h:543
@ VSF_USART_IRQ_MASK_BREAK_ERR
Definition vsf_template_usart.h:553
@ VSF_USART_IRQ_MASK_RX
Definition vsf_template_usart.h:544
@ VSF_USART_IRQ_MASK_RX_TIMEOUT
Definition vsf_template_usart.h:545
@ VSF_USART_IRQ_MASK_RX_CPL
Definition vsf_template_usart.h:540
@ VSF_USART_IRQ_MASK_PARITY_ERR
Definition vsf_template_usart.h:552
@ VSF_USART_IRQ_MASK_FRAME_ERR
Definition vsf_template_usart.h:551
#define vsf_usart_get_tx_count(__USART)
Definition vsf_template_usart.h:1126
#define vsf_usart_status(__USART)
Definition vsf_template_usart.h:1116
#define vsf_usart_get_rx_count(__USART)
Definition vsf_template_usart.h:1125
#define VSF_USART_APIS(__prefix_name)
Definition vsf_template_usart.h:187
struct vsf_usart_status_t vsf_usart_status_t
#define vsf_usart_enable(__USART)
Definition vsf_template_usart.h:1112
#define vsf_usart_fini(__USART)
Definition vsf_template_usart.h:1110
void vsf_usart_isr_handler_t(void *target_ptr, vsf_usart_t *usart_ptr, vsf_usart_irq_mask_t irq_mask)
Definition vsf_template_usart.h:611
#define vsf_usart_irq_enable(__USART,...)
Definition vsf_template_usart.h:1114
#define vsf_usart_set_break(__USART)
Definition vsf_template_usart.h:1128