[sx1509] Move SENSE_REGS array to registers header

This commit is contained in:
J. Nick Koston
2026-04-09 16:54:44 -10:00
parent 010717afa2
commit 801f385896
2 changed files with 2 additions and 2 deletions
-2
View File
@@ -347,8 +347,6 @@ void SX1509Component::enable_pin_interrupt_(uint8_t pin) {
this->write_byte_16(REG_INTERRUPT_MASK_B, mask);
// Configure sense to trigger on both edges
// Each sense register covers 4 pins with 2 bits per pin
static constexpr uint8_t SENSE_REGS[] = {REG_SENSE_LOW_A, REG_SENSE_HIGH_A, REG_SENSE_LOW_B, REG_SENSE_HIGH_B};
uint8_t sense_reg = SENSE_REGS[pin / 4];
uint8_t sense_val = 0;
this->read_byte(sense_reg, &sense_val);
@@ -59,6 +59,8 @@ const uint8_t REG_SENSE_HIGH_A = 0x16; // RegSenseHighA Sense register for I
const uint8_t REG_SENSE_LOW_A = 0x17; // RegSenseLowA Sense register for I/O[3:0] 0000 0000
// Sense register values (2 bits per pin): 00=None, 01=Rising, 10=Falling, 11=Both
const uint8_t SENSE_BOTH_EDGES = 0x03;
// Sense register lookup: each register covers 4 pins (pins 0-3, 4-7, 8-11, 12-15)
const uint8_t SENSE_REGS[] = {REG_SENSE_LOW_A, REG_SENSE_HIGH_A, REG_SENSE_LOW_B, REG_SENSE_HIGH_B};
const uint8_t REG_INTERRUPT_SOURCE_B =
0x18; // RegInterruptSourceB Interrupt source register _ I/O[15_8] (Bank B) 0000 0000
const uint8_t REG_INTERRUPT_SOURCE_A =