diff options
author | Ryan <[email protected]> | 2024-01-16 13:26:40 +1100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-16 02:26:40 +0000 |
commit | a522b1f15627c69f94cbc814968be5a63519b8e3 (patch) | |
tree | 2a6ea5f05d6d728230294dd4a298e0343a22be9d /keyboards/handwired | |
parent | e1f59a6efc793522155db35155f6fbdc0504d504 (diff) | |
download | qmk_firmware-a522b1f15627c69f94cbc814968be5a63519b8e3.tar.gz qmk_firmware-a522b1f15627c69f94cbc814968be5a63519b8e3.zip |
i2c: rename read/write register functions (#22905)
Diffstat (limited to 'keyboards/handwired')
-rw-r--r-- | keyboards/handwired/d48/ds1307.c | 4 | ||||
-rw-r--r-- | keyboards/handwired/dactyl/matrix.c | 12 | ||||
-rw-r--r-- | keyboards/handwired/onekey/keymaps/i2c_scanner/keymap.c | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/keyboards/handwired/d48/ds1307.c b/keyboards/handwired/d48/ds1307.c index f6b57d50d2..2b3a88f315 100644 --- a/keyboards/handwired/d48/ds1307.c +++ b/keyboards/handwired/d48/ds1307.c @@ -8,12 +8,12 @@ void ds1307_set_time(uint8_t h, uint8_t m, uint8_t s) { ((h % 10) | ((h / 10) << 4)) & 0x3F, 0, 0, 0, 0, 0 }; // 24-hour mode - i2c_writeReg(DS1307_ADDR, 0, data, 8, 100); + i2c_write_register(DS1307_ADDR, 0, data, 8, 100); } void ds1307_get_time(uint8_t *h, uint8_t *m, uint8_t *s) { uint8_t data[3]; - i2c_readReg(DS1307_ADDR, 0, data, 3, 100); + i2c_read_register(DS1307_ADDR, 0, data, 3, 100); i2c_stop(); *s = (data[0] & 0b1111) + ((data[0] & 0b1110000) >> 4) * 10; *m = (data[1] & 0b1111) + ((data[1] & 0b1110000) >> 4) * 10; diff --git a/keyboards/handwired/dactyl/matrix.c b/keyboards/handwired/dactyl/matrix.c index d87fe4cbd1..140f4236c1 100644 --- a/keyboards/handwired/dactyl/matrix.c +++ b/keyboards/handwired/dactyl/matrix.c @@ -216,10 +216,10 @@ void init_expander(void) { #endif - expander_status = i2c_writeReg(I2C_ADDR, IODIRA, direction, 2, I2C_TIMEOUT); + expander_status = i2c_write_register(I2C_ADDR, IODIRA, direction, 2, I2C_TIMEOUT); if (expander_status) return; - expander_status = i2c_writeReg(I2C_ADDR, GPPUA, pullup, 2, I2C_TIMEOUT); + expander_status = i2c_write_register(I2C_ADDR, GPPUA, pullup, 2, I2C_TIMEOUT); } uint8_t matrix_scan(void) @@ -333,7 +333,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) // Read columns from expander, unless it's in an error state if (! expander_status) { uint8_t state = 0; - expander_status = i2c_readReg(I2C_ADDR, EXPANDER_COL_REGISTER, &state, 1, I2C_TIMEOUT); + expander_status = i2c_read_register(I2C_ADDR, EXPANDER_COL_REGISTER, &state, 1, I2C_TIMEOUT); if (! expander_status) { current_matrix[current_row] |= (~state) & expander_input_pin_mask; } @@ -359,7 +359,7 @@ static void select_row(uint8_t row) { // set active row low : 0 // set other rows hi-Z : 1 uint8_t port = 0xFF & ~(1<<row); - expander_status = i2c_writeReg(I2C_ADDR, EXPANDER_ROW_REGISTER, &port, 1, I2C_TIMEOUT); + expander_status = i2c_write_register(I2C_ADDR, EXPANDER_ROW_REGISTER, &port, 1, I2C_TIMEOUT); } // select on teensy @@ -415,7 +415,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) return false; } - expander_status = i2c_readReg(I2C_ADDR, EXPANDER_ROW_REGISTER, &column_state, 1, I2C_TIMEOUT); + expander_status = i2c_read_register(I2C_ADDR, EXPANDER_ROW_REGISTER, &column_state, 1, I2C_TIMEOUT); column_state = ~column_state; } else { @@ -460,7 +460,7 @@ static void select_col(uint8_t col) // set active col low : 0 // set other cols hi-Z : 1 uint8_t port = 0xFF & ~(1<<col); - expander_status = i2c_writeReg(I2C_ADDR, EXPANDER_COL_REGISTER, &port, 1, I2C_TIMEOUT); + expander_status = i2c_write_register(I2C_ADDR, EXPANDER_COL_REGISTER, &port, 1, I2C_TIMEOUT); } } else { // select on teensy diff --git a/keyboards/handwired/onekey/keymaps/i2c_scanner/keymap.c b/keyboards/handwired/onekey/keymaps/i2c_scanner/keymap.c index ea8443709d..43e61c29d3 100644 --- a/keyboards/handwired/onekey/keymaps/i2c_scanner/keymap.c +++ b/keyboards/handwired/onekey/keymaps/i2c_scanner/keymap.c @@ -14,7 +14,7 @@ i2c_status_t i2c_start_bodge(uint8_t address, uint16_t timeout) { // except on ChibiOS where the only way is do do "something" uint8_t data = 0; - return i2c_readReg(address, 0, &data, sizeof(data), TIMEOUT); + return i2c_read_register(address, 0, &data, sizeof(data), TIMEOUT); } # define i2c_start i2c_start_bodge |