datasheetbank_Logo
データシート検索エンジンとフリーデータシート

AN664 データシートの表示(PDF) - Silicon Laboratories

部品番号
コンポーネント説明
一致するリスト
AN664 Datasheet PDF : 18 Pages
1 2 3 4 5 6 7 8 9 10 Next Last
AN664
2.1.2.1. Using the MASK Definition
The HAL uses MASK definitions to clear or set bitfields in registers that support clear and set addresses. In these
cases, the address can be set equal to the mask directly to manipulate the bitfield. For example:
void
_SI32_USART_A_disable_rx_start_bit(SI32_USART_A_Type * basePointer)
{
//{{
basePointer->CONFIG_CLR = SI32_USART_A_CONFIG_RSTRTEN_MASK;
//}}
}
2.1.2.2. Using the SHIFT Definition
The HAL uses the SHIFT definition when a field value is passed to a routine. This allows the calling code to pass in
a raw value, and the HAL can handle the actual placement of the bitfield in the register. For example:
void
_SI32_USART_A_select_rx_stop_bits(SI32_USART_A_Type * basePointer,
SI32_USART_A_STOP_BITS_Enum_Type bits)
{
assert(bits < 4); // bits < 2^2
//{{
basePointer->CONFIG_CLR = SI32_USART_A_CONFIG_RSTPMD_MASK;
basePointer->CONFIG_SET = bits << SI32_USART_A_CONFIG_RSTPMD_SHIFT;
//}}
}
2.1.2.3. Using the Enumeration Definitions
The HAL uses the U32 enumeration definitions for the clear and set addresses or when accessing the entire
register. The HAL does not use the value definitions themselves whenever possible, since accessing a single
bitfield in a register is inefficient. For example:
void
_SI32_USART_A_enable_rx_error_interrupts(SI32_USART_A_Type *
basePointer)
{
//{{
basePointer->CONTROL_SET = SI32_USART_A_CONTROL_RERIEN_ENABLED_U32;
//}}
}
Rev. 0.2
9

Share Link: 

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