summaryrefslogtreecommitdiff
path: root/keyboards/handwired
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/handwired')
-rw-r--r--keyboards/handwired/frenchdev/frenchdev.c4
-rw-r--r--keyboards/handwired/frenchdev/matrix.c6
-rw-r--r--keyboards/handwired/pterodactyl/matrix.c10
3 files changed, 10 insertions, 10 deletions
diff --git a/keyboards/handwired/frenchdev/frenchdev.c b/keyboards/handwired/frenchdev/frenchdev.c
index 65f1ccce4b..818c395c8e 100644
--- a/keyboards/handwired/frenchdev/frenchdev.c
+++ b/keyboards/handwired/frenchdev/frenchdev.c
@@ -84,14 +84,14 @@ uint8_t init_mcp23018(void) {
84 // - input : input : 1 84 // - input : input : 1
85 // - driving : output : 0 85 // - driving : output : 0
86 uint8_t data[] = {0b00000000, 0b00111111}; 86 uint8_t data[] = {0b00000000, 0b00111111};
87 mcp23018_status = i2c_writeReg(I2C_ADDR, IODIRA, data, sizeof(data), I2C_TIMEOUT); 87 mcp23018_status = i2c_write_register(I2C_ADDR, IODIRA, data, sizeof(data), I2C_TIMEOUT);
88 88
89 if (!mcp23018_status) { 89 if (!mcp23018_status) {
90 // set pull-up 90 // set pull-up
91 // - unused : on : 1 91 // - unused : on : 1
92 // - input : on : 1 92 // - input : on : 1
93 // - driving : off : 0 93 // - driving : off : 0
94 mcp23018_status = i2c_writeReg(I2C_ADDR, GPPUA, data, sizeof(data), I2C_TIMEOUT); 94 mcp23018_status = i2c_write_register(I2C_ADDR, GPPUA, data, sizeof(data), I2C_TIMEOUT);
95 } 95 }
96 96
97 // SREG=sreg_prev; 97 // SREG=sreg_prev;
diff --git a/keyboards/handwired/frenchdev/matrix.c b/keyboards/handwired/frenchdev/matrix.c
index af7c8b5444..68ec8e0801 100644
--- a/keyboards/handwired/frenchdev/matrix.c
+++ b/keyboards/handwired/frenchdev/matrix.c
@@ -224,7 +224,7 @@ static matrix_row_t read_cols(uint8_t row)
224 return 0; 224 return 0;
225 } else { 225 } else {
226 uint8_t data = 0; 226 uint8_t data = 0;
227 mcp23018_status = i2c_readReg(I2C_ADDR, GPIOB, &data, 1, I2C_TIMEOUT); 227 mcp23018_status = i2c_read_register(I2C_ADDR, GPIOB, &data, 1, I2C_TIMEOUT);
228 228
229 return ~data; 229 return ~data;
230 } 230 }
@@ -259,7 +259,7 @@ static void unselect_rows(void)
259 // set all rows hi-Z : 1 259 // set all rows hi-Z : 1
260 uint8_t data; 260 uint8_t data;
261 data = 0xFF & ~(0<<8); 261 data = 0xFF & ~(0<<8);
262 mcp23018_status = i2c_writeReg(I2C_ADDR, GPIOA, &data, 1, I2C_TIMEOUT); 262 mcp23018_status = i2c_write_register(I2C_ADDR, GPIOA, &data, 1, I2C_TIMEOUT);
263 263
264 } 264 }
265 265
@@ -283,7 +283,7 @@ static void select_row(uint8_t row)
283 // set active row low : 0 283 // set active row low : 0
284 // set other rows hi-Z : 1 284 // set other rows hi-Z : 1
285 uint8_t data = 0xFF & ~(1<<row) & ~(0<<8); 285 uint8_t data = 0xFF & ~(1<<row) & ~(0<<8);
286 mcp23018_status = i2c_writeReg(I2C_ADDR, GPIOA, &data, 1, I2C_TIMEOUT); 286 mcp23018_status = i2c_write_register(I2C_ADDR, GPIOA, &data, 1, I2C_TIMEOUT);
287 } 287 }
288 } else { 288 } else {
289 // select on teensy 289 // select on teensy
diff --git a/keyboards/handwired/pterodactyl/matrix.c b/keyboards/handwired/pterodactyl/matrix.c
index 0dff65eda6..54da26a7d4 100644
--- a/keyboards/handwired/pterodactyl/matrix.c
+++ b/keyboards/handwired/pterodactyl/matrix.c
@@ -182,14 +182,14 @@ void init_expander(void) {
182 uint8_t data[] = { expander_input_pin_mask, 0}; 182 uint8_t data[] = { expander_input_pin_mask, 0};
183# endif 183# endif
184#endif 184#endif
185 expander_status = i2c_writeReg(I2C_ADDR, IODIRA, data, sizeof(data), I2C_TIMEOUT); 185 expander_status = i2c_write_register(I2C_ADDR, IODIRA, data, sizeof(data), I2C_TIMEOUT);
186 186
187 if (!expander_status) { 187 if (!expander_status) {
188 // set pull-up 188 // set pull-up
189 // - unused : off : 0 189 // - unused : off : 0
190 // - input : on : 1 190 // - input : on : 1
191 // - driving : off : 0 191 // - driving : off : 0
192 expander_status = i2c_writeReg(I2C_ADDR, GPPUA, data, sizeof(data), I2C_TIMEOUT); 192 expander_status = i2c_write_register(I2C_ADDR, GPPUA, data, sizeof(data), I2C_TIMEOUT);
193 } 193 }
194 194
195} 195}
@@ -305,7 +305,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
305 // Read columns from expander, unless it's in an error state 305 // Read columns from expander, unless it's in an error state
306 if (! expander_status) { 306 if (! expander_status) {
307 uint8_t data; 307 uint8_t data;
308 i2c_readReg(I2C_ADDR, EXPANDER_COL_REGISTER, &data, 1, I2C_TIMEOUT); 308 i2c_read_register(I2C_ADDR, EXPANDER_COL_REGISTER, &data, 1, I2C_TIMEOUT);
309 current_matrix[current_row] |= (~data) & expander_input_pin_mask; 309 current_matrix[current_row] |= (~data) & expander_input_pin_mask;
310 } 310 }
311 311
@@ -329,7 +329,7 @@ static void select_row(uint8_t row) {
329 // set active row low : 0 329 // set active row low : 0
330 // set other rows hi-Z : 1 330 // set other rows hi-Z : 1
331 uint8_t data = 0xFF & ~(1<<row); 331 uint8_t data = 0xFF & ~(1<<row);
332 i2c_writeReg(I2C_ADDR, EXPANDER_ROW_REGISTER, &data, 1, I2C_TIMEOUT); 332 i2c_write_register(I2C_ADDR, EXPANDER_ROW_REGISTER, &data, 1, I2C_TIMEOUT);
333 } 333 }
334 334
335 // select on teensy 335 // select on teensy
@@ -385,7 +385,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
385 return false; 385 return false;
386 } 386 }
387 387
388 i2c_writeReg(I2C_ADDR, EXPANDER_ROW_REGISTER, &column_state, 1, I2C_TIMEOUT); 388 i2c_write_register(I2C_ADDR, EXPANDER_ROW_REGISTER, &column_state, 1, I2C_TIMEOUT);
389 column_state = ~column_state; 389 column_state = ~column_state;
390 } else { 390 } else {
391 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { 391 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {