Update GPIO API usage in keyboard code (#23361)
This commit is contained in:
parent
5426a7a129
commit
d09a06a1b3
390 changed files with 3912 additions and 3913 deletions
|
@ -27,17 +27,17 @@ static const uint8_t col_pins[MATRIX_MUX_COLS] = MATRIX_COL_MUX_PINS;
|
|||
static void init_pins(void) {
|
||||
// Set cols to outputs, low
|
||||
for (uint8_t pin = 0; pin < MATRIX_MUX_COLS; pin++) {
|
||||
setPinOutput(col_pins[pin]);
|
||||
gpio_set_pin_output(col_pins[pin]);
|
||||
}
|
||||
|
||||
// Unselect cols
|
||||
for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) {
|
||||
writePinLow(col_pins[bit]);
|
||||
gpio_write_pin_low(col_pins[bit]);
|
||||
}
|
||||
|
||||
// Set rows to input, pullup
|
||||
for (uint8_t pin = 0; pin < MATRIX_ROWS; pin++) {
|
||||
setPinInputHigh(row_pins[pin]);
|
||||
gpio_set_pin_input_high(row_pins[pin]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ static void select_col(uint8_t col)
|
|||
{
|
||||
for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) {
|
||||
uint8_t state = (col & (0b1 << bit)) >> bit;
|
||||
writePin(col_pins[bit], state);
|
||||
gpio_write_pin(col_pins[bit], state);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
|||
{
|
||||
matrix_row_t last_row_value = current_matrix[row_index];
|
||||
|
||||
if (!readPin(row_pins[row_index]))
|
||||
if (!gpio_read_pin(row_pins[row_index]))
|
||||
{
|
||||
current_matrix[row_index] |= (COL_SHIFTER << current_col);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue