Hi Mike !
But how-to interpret this text properly ?
If I configure desired pins for LLWU wakeup via MCUExpresso config tool it generate both calls, for wakeup and for filters and at list 4 pins can have filter:
/* LLWU digital filters configuration. */
const llwu_external_pin_filter_mode_t LLWU_filter_config[4] = {
{
.pinIndex = 12U,
.filterMode = kLLWU_PinFilterFallingEdge
},
{
.pinIndex = 13U,
.filterMode = kLLWU_PinFilterFallingEdge
},
{
.pinIndex = 14U,
.filterMode = kLLWU_PinFilterFallingEdge
},
{
.pinIndex = 15U,
.filterMode = kLLWU_PinFilterFallingEdge
}
};
void LLWU_init(void) {
LLWU_SetExternalWakeupPinMode(LLWU_PERIPHERAL, 12U, kLLWU_ExternalPinFallingEdge);
/* Initialize the LLWU wakeup pin 13. */
LLWU_SetExternalWakeupPinMode(LLWU_PERIPHERAL, 13U, kLLWU_ExternalPinFallingEdge);
/* Initialize the LLWU wakeup pin 14. */
LLWU_SetExternalWakeupPinMode(LLWU_PERIPHERAL, 14U, kLLWU_ExternalPinFallingEdge);
/* Initialize the LLWU wakeup pin 15. */
LLWU_SetExternalWakeupPinMode(LLWU_PERIPHERAL, 15U, kLLWU_ExternalPinFallingEdge);
/* Initialize digital filter on wakeup pin 12. */
LLWU_SetPinFilterMode(LLWU_PERIPHERAL, 0U, LLWU_filter_config[0]);
/* Initialize digital filter on wakeup pin 13. */
LLWU_SetPinFilterMode(LLWU_PERIPHERAL, 1U, LLWU_filter_config[1]);
/* Initialize digital filter on wakeup pin 14. */
LLWU_SetPinFilterMode(LLWU_PERIPHERAL, 2U, LLWU_filter_config[2]);
/* Initialize digital filter on wakeup pin 15. */
LLWU_SetPinFilterMode(LLWU_PERIPHERAL, 3U, LLWU_filter_config[3]);
/* Enable interrupt LLWU_IRQN request in the NVIC */
EnableIRQ(LLWU_IRQN);
}
So. do I undestand right K82 capabilites :
- max 4 filters
- set filters and wake up API should be used
But in may case I can simplify task like this :
- wakeup due LLWU asap to RUN mode, no any filters
- GPIO lines are configured for detect level interrupts ( Zero or One ) and they start to detect level
- GPIO should have digital filters for 100 clocks of LPO and all levels with duration less than 100 ms will be rejected
- be sure if MCU is not going to LLS3 when GPIO filtering ongoing.
What is difficult to test if 100 ms level is really detected properly. Some pulse generator required.
Or it should work by design ?
Regards,
Eugene