PebbleOS v4.47.0-160-g9e782207f
Loading...
Searching...
No Matches
ADC keys

Keys on a resistor ladder, read through an ADC channel. More...

Data Structures

struct  pbl_adc_keys_key
 A key. More...
 
struct  pbl_adc_keys_state
 Runtime state. More...
 
struct  pbl_adc_keys
 ADC keys. More...
 

Detailed Description

Keys on a resistor ladder, read through an ADC channel.

The key whose voltage is the nearest to the channel's is pressed, none if the key-up voltage is the nearest. The channel is read once the line has settled after an interrupt that a press or release raises.


Data Structure Documentation

◆ pbl_adc_keys_key

struct pbl_adc_keys_key

A key.

Data Fields
uint16_t code PBL_INPUT_EV_KEY code, linux,code.
const char * label Name, label.
int32_t press_uv Voltage while pressed, in microvolts, press-threshold-microvolt.

◆ pbl_adc_keys_state

struct pbl_adc_keys_state

Runtime state.

Data Fields
uint8_t failures Failed reads in a row since the last edge.
const struct pbl_adc_keys * keys Keys.
const struct pbl_adc_keys_key * pressed Key pressed, NULL if none.
struct pbl_delayed_work scan Read of the channel.

◆ pbl_adc_keys

struct pbl_adc_keys

ADC keys.

Data Fields
struct pbl_adc_channel channel Channel, io-channels.
struct pbl_device dev Device.
struct pbl_irq_spec irq Interrupt on a press or release, interrupts.
const struct pbl_adc_keys_key * keys Keys.
int32_t keyup_uv Voltage with no key pressed, in microvolts, keyup-threshold-microvolt.
uint8_t num_keys Number of keys.
struct pbl_pinctrl pinctrl Pad of the line, if the board sets it up, pinctrl-0.
struct pbl_adc_keys_state * state Runtime state.