SBC_FS23 API :Sbc_fs23_SetWakeupConfig

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SBC_FS23 API :Sbc_fs23_SetWakeupConfig

Jump to solution
706 Views
WeiC
Contributor I

In the " CDD_Sbc_fs23.c" file ,API "Sbc_fs23_SetWakeupConfig" has two lines code,as follows

/*--------------------------------------------------*/

u16TxData = (u16RxData & (~(SBC_FS23_M_WK1_WUEN_WAKEUP_MASK | SBC_FS23_M_WK2_WUEN_WAKEUP_MASK | SBC_FS23_M_HVIO1_WUEN_WAKEUP_MASK | SBC_FS23_M_HVIO2_WUEN_WAKEUP_MASK | SBC_FS23_M_LVIO3_WUEN_WAKEUP_MASK | SBC_FS23_M_LVIO4_WUEN_WAKEUP_MASK | SBC_FS23_M_LVI5_WUEN_WAKEUP_MASK))) | (*Sbc_fs23_pConfigPtr->Sbc_fs23_WuConfig)[WakeupSettingId].IoWuEnReg;

..................................

u16TxData = (u16RxData & (~(SBC_FS23_M_CAN_WUEN_WAKEUP_MASK | SBC_FS23_M_LIN_WUEN_WAKEUP_MASK | SBC_FS23_M_LDT_WUEN_WAKEUP_MASK))) | (*Sbc_fs23_pConfigPtr->Sbc_fs23_WuConfig)[WakeupSettingId].Wu1EnReg;

/*--------------------------------------------------*/

what means about “(u16RxData & (~............))| XxxxCfg.XxxxEnReg"? why not directly use“(u16RxData | XxxxCfg.XxxxEnReg"?

I don't understand the operation of "u16RxData & (~............)".

 

0 Kudos
Reply
1 Solution
646 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

By using & (~(………)) we make sure that those configurable wake-up and interrupt enable bits are first zeroed before writing a new value to them.  

BR, Tomas

View solution in original post

0 Kudos
Reply
1 Reply
647 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

By using & (~(………)) we make sure that those configurable wake-up and interrupt enable bits are first zeroed before writing a new value to them.  

BR, Tomas

0 Kudos
Reply