diff options
| author | Joel Challis <git@zvecr.com> | 2019-12-03 19:39:21 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-03 19:39:21 +0000 |
| commit | 1718dfa658dbe8ad144100b561794c5596ac5f08 (patch) | |
| tree | b6252940f7b149efb3fd65bea40b4d353e01e973 /drivers/gpio/pca9555.c | |
| parent | 1c8208ad9a0d1a8cd423aea3ffb0aa5e370e1541 (diff) | |
| download | qmk_firmware-1718dfa658dbe8ad144100b561794c5596ac5f08.tar.gz qmk_firmware-1718dfa658dbe8ad144100b561794c5596ac5f08.zip | |
Increase matrix scanning speed on xd84 (#7517)
* Increase matrix scanning speed
* Fix func name in failure output
Diffstat (limited to 'drivers/gpio/pca9555.c')
| -rw-r--r-- | drivers/gpio/pca9555.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpio/pca9555.c b/drivers/gpio/pca9555.c index 496bbca04..02b5abbdd 100644 --- a/drivers/gpio/pca9555.c +++ b/drivers/gpio/pca9555.c | |||
| @@ -76,3 +76,20 @@ uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port) { | |||
| 76 | } | 76 | } |
| 77 | return data; | 77 | return data; |
| 78 | } | 78 | } |
| 79 | |||
| 80 | uint16_t pca9555_readAllPins(uint8_t slave_addr) { | ||
| 81 | uint8_t addr = SLAVE_TO_ADDR(slave_addr); | ||
| 82 | |||
| 83 | typedef union { | ||
| 84 | uint8_t u8[2]; | ||
| 85 | uint16_t u16; | ||
| 86 | } data16; | ||
| 87 | |||
| 88 | data16 data; | ||
| 89 | |||
| 90 | i2c_status_t ret = i2c_readReg(addr, CMD_INPUT_0, &data.u8[0], sizeof(data), TIMEOUT); | ||
| 91 | if (ret != I2C_STATUS_SUCCESS) { | ||
| 92 | print("pca9555_readAllPins::FAILED\n"); | ||
| 93 | } | ||
| 94 | return data.u16; | ||
| 95 | } | ||
