SWRA704 June 2021 CC3120 , CC3130 , CC3135
The CC31xx can be enabled and disabled by controlling the nHib signal. The host MCU controls the nHib signal by changing the output of a GPIO. The host can toggle the GPIO followed by a 10 millisecond delay. This delay ensures that the host driver observes the minumim hibernate time according to the timing requirements in the device-specific data sheet.
user.h:
#define sl_DeviceEnable() NwpPowerOn()
#define sl_DeviceDisable() NwpPowerOff()
cc_pal.h:
extern void NwpPowerOn(void);
extern void NwpPowerOff(void);
cc_pal.c:
void NwpPowerOn(void)
{
HAL_GPIO_WritePin(HOST_nHIB_PORT, HOST_nHIB_PIN, 1);
}
void NwpPowerOff(void)
{
HAL_GPIO_WritePin(HOST_nHIB_PORT, HOST_nHIB_PIN, 0);
/* wait 10 msec */
HAL_Delay(10);
}