|
PebbleOS v4.47.0-1219-g7c542d7a9
|
TI TCA8418 key matrix scanner. More...
Data Structures | |
| struct | pbl_tca8418 |
| TCA8418. More... | |
Macros | |
| #define | PBL_TCA8418_NUM_PINS 18U |
| Pins, ROW0-7 then COL0-9. | |
| #define | PBL_TCA8418_DEFINE(sym, _bus, _addr, _irq, _num_rows, _num_cols, ...) |
Define and register a TCA8418, the GPIO port sym _gpio of its other pins and their interrupt controller sym _intc. | |
TI TCA8418 key matrix scanner.
Every key event is reported as a PBL_INPUT_MSC_SCAN of (row << 8) | column, then as a PBL_INPUT_EV_KEY with its code in the keymap, or PBL_INPUT_KEY_UNKNOWN.
The pins outside the matrix are GPIOs, ROW0-7 as 0-7 and COL0-9 as 8-17, whose inputs interrupt on both edges, e.g. for keys wired to ground with gpio-keys. Their calls may block.
| struct pbl_tca8418 |
TCA8418.
| Data Fields | ||
|---|---|---|
| struct pbl_device | dev | Device, child of the I2C bus. |
| struct pbl_i2c_dev | i2c | I2C device. |
| const struct pbl_intc * | intc | Interrupt controller of the GPIOs. |
| struct pbl_irq_spec | irq | Interrupt. |
| const uint32_t * | keymap |
Keymap, linux,keymap entries from MATRIX_KEY(). |
| uint8_t | keymap_len | Keymap entries. |
| uint8_t | num_cols |
Columns, keypad,num-columns. |
| uint8_t | num_rows |
Rows, keypad,num-rows. |
| struct pbl_tca8418_state * | state | Runtime state. |
| #define PBL_TCA8418_DEFINE | ( | sym, | |
| _bus, | |||
| _addr, | |||
| _irq, | |||
| _num_rows, | |||
| _num_cols, | |||
| ... | |||
| ) |
Define and register a TCA8418, the GPIO port sym _gpio of its other pins and their interrupt controller sym _intc.
| sym | Symbol of the struct pbl_tca8418. |
| _bus | I2C bus. |
| _addr | 7-bit I2C address. |
| _irq | Interrupt, a struct pbl_irq_spec. |
| _num_rows | Rows. |
| _num_cols | Columns. |
| ... | Keymap entries, from MATRIX_KEY(), if any. |
| #define PBL_TCA8418_NUM_PINS 18U |
Pins, ROW0-7 then COL0-9.