DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

AN664 데이터 시트보기 (PDF) - Silicon Laboratories

부품명
상세내역
제조사
AN664 Datasheet PDF : 18 Pages
1 2 3 4 5 6 7 8 9 10 Next Last
AN664
4.1. USART0 HAL Example
The sim3u1xx.h device file contains the USART0 interrupt vector (USART0_IRQn) and base pointer information
(SI32_USART_0). The SI32_USART_A_Registers.h file contains the module structure, which includes structures
of bit fields for each register. The SI32_USART_A_Type.h and Type.c files contain routines that access each of
these bits.
Figure 4 displays a block diagram showing the relationship of the HAL files for the USART0 module.
sim3u1xx.h
Interrupt Vector: USART0_IRQn
Base Pointer: SI32_USART_0
USART0
SI32_USART_A_Registers.h
CONFIG.TPARMD
#define SI32_USART_A_CONFIG_TPARMD_MASK 0x00600000
#define SI32_USART_A_CONFIG_TPARMD_SHIFT 21
// Odd Parity.
#define SI32_USART_A_CONFIG_TPARMD_ODD_VALUE 0
#define SI32_USART_A_CONFIG_TPARMD_ODD_U32 \
(SI32_USART_A_CONFIG_TPARMD_ODD_VALUE <<
SI32_USART_A_CONFIG_TPARMD_SHIFT)
...
SI32_USART_A_Type.c
void
_SI32_USART_A_select_tx_parity(
SI32_USART_A_Type * basePointer,
uint32_t parity)
{
assert(parity < 4); // parity < 2^2
//{{
basePointer->CONFIG_CLR = SI32_USART_A_CONFIG_TPARMD_MASK;
basePointer->CONFIG_SET = parity << SI32_USART_A_CONFIG_TPARMD_SHIFT;
//}}
}
SI32_USART_A_Type.h
void
_SI32_USART_A_select_tx_parity(
SI32_USART_A_Type * basePointer,
uint32_t parity);
Figure 4. Example USART HAL Block Diagram
Firmware can call the USART0 select tx parity routine using the base pointer defined in si3mu1xx.h and the
function implemented in SI32_USART_A_Type.c:
SI32_USART_A_select_tx_parity(SI32_USART_0, parity);
4
Rev. 0.2

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]