I have a keypad matrix that outputs the voltage level based on the button pressed. Normally, it outputs a maximum voltage (3.3V) and at the press of the button, it outputs the corresponding voltage level based on the voltage dividers (from 0 - 3.3V.)

What I want to do is instead of constantly reading the ADC to determine which button was pressed, I want an interrupt to be generated when the button is pressed and then start the ADC conversion so I only have to enable the ADC when a button was pressed. Currently, I have ADC in continuous mode, an interrupt is generated when ADC conversion gets completed and I have an if statement to check that if the value is not 3.3V, then I process the data for the button press. This, I believe, is not an efficient way of doing this. The keypad schematics are added below.

[![Keypad](https://i.stack.imgur.com/Ggewf.png)](https://i.stack.imgur.com/Ggewf.png)