Skip to content

Commit

Permalink
I2C IO expanders read same address repeatedly #798
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Gardner-Stephen committed Apr 5, 2024
1 parent e826cd4 commit acac60c
Show file tree
Hide file tree
Showing 2 changed files with 402 additions and 59 deletions.
48 changes: 40 additions & 8 deletions src/tools/i2cstatemapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,46 @@ struct entry e[] = {
// so we have to schedule multiple jobs.

#ifdef KEYPAD
{ 0x40, 0x00, 0x07, 0x00, "IO Expander #0" },
{ 0x42, 0x00, 0x07, 0x08, "IO Expander #1" },
{ 0x44, 0x00, 0x07, 0x10, "IO Expander #2" },
{ 0x46, 0x00, 0x07, 0x18, "IO Expander #3" },
{ 0x48, 0x00, 0x07, 0x20, "IO Expander #4" },
{ 0x4a, 0x00, 0x07, 0x28, "IO Expander #5" },
{ 0x4c, 0x00, 0x07, 0x30, "IO Expander #6" },
{ 0x4e, 0x00, 0x07, 0x38, "IO Expander #7" },
{ 0x40, 0x00, 0x01, 0x00, "IO Expander #0 regs 0-1" },
{ 0x40, 0x02, 0x03, 0x02, "IO Expander #0 regs 2-3" },
{ 0x40, 0x04, 0x05, 0x04, "IO Expander #0 regs 4-5" },
{ 0x40, 0x06, 0x07, 0x06, "IO Expander #0 regs 6-7" },

{ 0x42, 0x00, 0x01, 0x08, "IO Expander #1 regs 0-1" },
{ 0x42, 0x02, 0x03, 0x0A, "IO Expander #1 regs 2-3" },
{ 0x42, 0x04, 0x05, 0x0C, "IO Expander #1 regs 4-5" },
{ 0x42, 0x06, 0x07, 0x0E, "IO Expander #1 regs 6-7" },

{ 0x44, 0x00, 0x01, 0x10, "IO Expander #2 regs 0-1" },
{ 0x44, 0x02, 0x03, 0x12, "IO Expander #2 regs 2-3" },
{ 0x44, 0x04, 0x05, 0x14, "IO Expander #2 regs 4-5" },
{ 0x44, 0x06, 0x07, 0x16, "IO Expander #2 regs 6-7" },

{ 0x46, 0x00, 0x01, 0x18, "IO Expander #3 regs 0-1" },
{ 0x46, 0x02, 0x03, 0x1A, "IO Expander #3 regs 2-3" },
{ 0x46, 0x04, 0x05, 0x1C, "IO Expander #3 regs 4-5" },
{ 0x46, 0x06, 0x07, 0x1E, "IO Expander #3 regs 6-7" },

{ 0x48, 0x00, 0x01, 0x10, "IO Expander #4 regs 0-1" },
{ 0x48, 0x02, 0x03, 0x12, "IO Expander #4 regs 2-3" },
{ 0x48, 0x04, 0x05, 0x14, "IO Expander #4 regs 4-5" },
{ 0x48, 0x06, 0x07, 0x16, "IO Expander #4 regs 6-7" },

{ 0x4A, 0x00, 0x01, 0x28, "IO Expander #5 regs 0-1" },
{ 0x4A, 0x02, 0x03, 0x2A, "IO Expander #5 regs 2-3" },
{ 0x4A, 0x04, 0x05, 0x2C, "IO Expander #5 regs 4-5" },
{ 0x4A, 0x06, 0x07, 0x2E, "IO Expander #5 regs 6-7" },

{ 0x4C, 0x00, 0x01, 0x30, "IO Expander #6 regs 0-1" },
{ 0x4C, 0x02, 0x03, 0x32, "IO Expander #6 regs 2-3" },
{ 0x4C, 0x04, 0x05, 0x34, "IO Expander #6 regs 4-5" },
{ 0x4C, 0x06, 0x07, 0x36, "IO Expander #6 regs 6-7" },

{ 0x4E, 0x00, 0x01, 0x38, "IO Expander #7 regs 0-1" },
{ 0x4E, 0x02, 0x03, 0x3A, "IO Expander #7 regs 2-3" },
{ 0x4E, 0x04, 0x05, 0x3C, "IO Expander #7 regs 4-5" },
{ 0x4E, 0x06, 0x07, 0x3E, "IO Expander #7 regs 6-7" },

#endif

#ifdef MEGAPHONER1
Expand Down
Loading

0 comments on commit acac60c

Please sign in to comment.