datasheetbank_Logo
数据手册搜索引擎和 Datasheet免费下载 PDF

AN664 查看數據表(PDF) - Silicon Laboratories

零件编号
产品描述 (功能)
比赛名单
AN664 Datasheet PDF : 18 Pages
1 2 3 4 5 6 7 8 9 10 Next Last
AN664
Each of the registers has a corresponding structure that defines the bit fields within that register. In addition,
registers that implement the clear and set addresses have 32-bit variables defined at the appropriate addresses.
Figure 6 shows the CONFIG register structure, which is declared as a part of the USART module structure.
Figure 6. Example USART CONFIG Register Structure
This CONFIG register structure has the TPARMD 2-bit field that controls the transmit parity. The U32 value
declared at the bottom of the structure is a union with the bit fields and is an entity that firmware can use to access
the entire register at one time.
The HAL Type.c functions and macros can access the entire USART0 CONFIG register:
SI32_USART_0->CONFIG.U32 = config;
The HAL can also read or write the TPARMD field in the USART0 CONFIG register:
parity = SI32_USART_0->CONFIG.TPARMD;
SI32_USART_0->CONFIG_SET = parity << SI32_USART_A_CONFIG_TPARMD_SHIFT;
Finally, the HAL can clear the TPARMD field:
SI32_USART_0->CONFIG_CLR = SI32_USART_A_CONFIG_TPARMD_MASK;
6
Rev. 0.2

Share Link: 

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