One of the main draws of using an EZR32 device is its low current consumption in low energy modes. When using EM2, EM3, or EM4, you obviously want the device to consume as little current as possible. However, just entering these modes will not shut the radio down (these energy modes only affect the MCU core), so the radio will continue to draw large amounts of current (relatively speaking), even when the MCU is in a low power mode.
There are two options for decreasing the radio current for low power modes:
Method #1 consumes the least amount of current (30nA), but has the drawback of requiring a complete re-initialization of the radio (which takes ~30ms).
Method #2 consumes slightly more current (50nA), but allows the radio to be ready much sooner (~500us). In most cases #2 is the preferred method.
In the ezradio api, you can use the ezradio_change_state() function to move the radio between sleep and active states.
If you're using a low energy mode in the EZR32 device, such as EM3, you can 'nest' the energy mode function in sleep / active state commands to minimize current consumption of the entire device (MCU and Radio):
ezradio_change_state(EZRADIO_CMD_CHANGE_STATE_ARG_NEXT_STATE1_NEW_STATE_ENUM_SLEEP); EMU_EnterEM3(true); ezradio_change_state(EZRADIO_CMD_CHANGE_STATE_ARG_NEXT_STATE1_NEW_STATE_ENUM_READY);
Note, as the pull-down on the INT pin as this sometimes causes additional leakage, you may also need to disable it:
ezradio_change_state(EZRADIO_CMD_CHANGE_STATE_ARG_NEXT_STATE1_NEW_STATE_ENUM_SLEEP); GPIO_PinModeSet((GPIO_Port_TypeDef) RF_INT_PORT, RF_INT_PIN, gpioModeInput, 0); EMU_EnterEM3(true); GPIO_PinModeSet((GPIO_Port_TypeDef) RF_INT_PORT, RF_INT_PIN, gpioModeInputPull, 0); ezradio_change_state(EZRADIO_CMD_CHANGE_STATE_ARG_NEXT_STATE1_NEW_STATE_EN
In this way i have 12mA avg, too much for a battery sensor