|
SensorLib 0.5.1
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
#include <IoExpanderDrv.hpp>Go to the source code of this file.
Macros | |
| #define | SENSOR_SDA 17 |
| #define | SENSOR_SCL 18 |
| #define | SENSOR_IRQ 10 |
Functions | |
| void | onKeyboardInterrupt () |
| void | scanKeyboard (bool state[ROW_COUNT][COLUMN_COUNT]) |
| const char * | specialKeyName (uint8_t row, uint8_t column) |
| void | printKeyName (uint8_t row, uint8_t column, bool symbolLayer) |
| void | reportChanges (const bool current[ROW_COUNT][COLUMN_COUNT]) |
| void | setup () |
| void | loop () |
Variables | |
| IoExpanderAW9523 | expander |
| volatile bool | keyboardInterrupt = false |
| bool | keyState [ROW_COUNT][COLUMN_COUNT] = {} |
AW9523 5x7 interrupt-driven keyboard matrix example.
Rows: P0_0-P0_4 (open-drain outputs) Columns: P0_5-P0_7 and P1_0-P1_3 (inputs with external pull-ups) INTN: Active-low open-drain output; connect it to SENSOR_IRQ.
Definition in file aw9523_keypad_5x7.ino.
| #define SENSOR_IRQ 10 |
Definition at line 24 of file aw9523_keypad_5x7.ino.
| #define SENSOR_SCL 18 |
Definition at line 20 of file aw9523_keypad_5x7.ino.
| #define SENSOR_SDA 17 |
Definition at line 16 of file aw9523_keypad_5x7.ino.
| void loop | ( | ) |
Definition at line 164 of file aw9523_keypad_5x7.ino.
References keyboardInterrupt, onKeyboardInterrupt(), reportChanges(), scanKeyboard(), and SENSOR_IRQ.
| void onKeyboardInterrupt | ( | ) |
Definition at line 62 of file aw9523_keypad_5x7.ino.
References keyboardInterrupt.
| void printKeyName | ( | uint8_t | row, |
| uint8_t | column, | ||
| bool | symbolLayer | ||
| ) |
Definition at line 101 of file aw9523_keypad_5x7.ino.
References specialKeyName().
Referenced by reportChanges().
| void reportChanges | ( | const bool | current[ROW_COUNT][COLUMN_COUNT] | ) |
Definition at line 121 of file aw9523_keypad_5x7.ino.
References keyState, and printKeyName().
Referenced by loop().
| void scanKeyboard | ( | bool | state[ROW_COUNT][COLUMN_COUNT] | ) |
Definition at line 67 of file aw9523_keypad_5x7.ino.
References IoExpanderAW9523::digitalReadPort(), IoExpanderBase::digitalWrite(), IoExpanderAW9523::digitalWritePort(), and expander.
| void setup | ( | ) |
Definition at line 137 of file aw9523_keypad_5x7.ino.
References I2CDeviceNoHal::begin(), IoExpanderBase::configPins(), IoExpanderAW9523::digitalWritePort(), IoExpanderAW9523::enableInterrupts(), expander, keyboardInterrupt, keyState, onKeyboardInterrupt(), IoExpanderAW9523::PORT_ALL, scanKeyboard(), SENSOR_IRQ, SENSOR_SCL, SENSOR_SDA, and IoExpanderAW9523::setPort0PushPull().
| const char * specialKeyName | ( | uint8_t | row, |
| uint8_t | column | ||
| ) |
Definition at line 90 of file aw9523_keypad_5x7.ino.
Referenced by printKeyName().
| IoExpanderAW9523 expander |
Definition at line 58 of file aw9523_keypad_5x7.ino.
Referenced by scanKeyboard(), and setup().
| volatile bool keyboardInterrupt = false |
Definition at line 59 of file aw9523_keypad_5x7.ino.
Referenced by loop(), onKeyboardInterrupt(), and setup().
| bool keyState[ROW_COUNT][COLUMN_COUNT] = {} |
Definition at line 60 of file aw9523_keypad_5x7.ino.
Referenced by reportChanges(), and setup().