Hello!
I am implementing the input of the key of the matrix structure of the circuit diagram below.
First of all, I tested whether the GPIO output (Row 1~4) and input (Column 1~5) are working normally.
- When all High outputs are given to Rows 1 to 4 and the button is pressed to confirm that signals are input to Columns 1 to 5, High signals are normally input to the Columns.
I confirmed that the " void bsp_event_handler(bsp_event_t event) " function was called.
[ PC Terminal ]
By sending data to PC through UART, it was confirmed that 5 Buttons were normally recognized.
---> question from here
The SW configuration for the matrix structure I thought of is as follows.
1) Before entering Sleep Mode, set all Rows 1 ~ 4 to High -> Wake-up occurs when any button is pressed in Sleep mode.
2) In the above test, it was confirmed that the handler functions are executed in the following order at wake-up.
static void gpiote_event_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action) -> void bsp_event_handler(bsp_event_t event) ->
static void detection_delay_timeout_handler(void * p_context)
3) So, in the first static void gpiote_event_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action) function,
Row 1 ~ 4 All High is set to High sequentially in the order of 1-> 2 -> 3 -> 4 -> to distinguish which button it actually is.
In the static void gpiote_event_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action) function, make row high sequentially to distinguish which button was pressed.
The question is whether it is the right choice to try to distinguish in the void gpiote_event_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action) function?
And if you have similar examples, please provide them.
tnank