diff options
| author | Ryan <fauxpark@gmail.com> | 2024-05-03 15:21:29 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-03 15:21:29 +1000 |
| commit | d09a06a1b354760fd0e64a453abade972900e885 (patch) | |
| tree | 88d94640f4507ac8d7f570607423825bec3c6f89 /keyboards/om60 | |
| parent | 5426a7a129acf2ff5c8b435014747f1238e17965 (diff) | |
Update GPIO API usage in keyboard code (#23361)
Diffstat (limited to 'keyboards/om60')
| -rw-r--r-- | keyboards/om60/matrix.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/keyboards/om60/matrix.c b/keyboards/om60/matrix.c index b0e252ec45..837abcdca1 100644 --- a/keyboards/om60/matrix.c +++ b/keyboards/om60/matrix.c | |||
| @@ -31,37 +31,37 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; | |||
| 31 | 31 | ||
| 32 | static void select_row(uint8_t row) | 32 | static void select_row(uint8_t row) |
| 33 | { | 33 | { |
| 34 | setPinOutput(row_pins[row]); | 34 | gpio_set_pin_output(row_pins[row]); |
| 35 | writePinLow(row_pins[row]); | 35 | gpio_write_pin_low(row_pins[row]); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | static void unselect_row(uint8_t row) | 38 | static void unselect_row(uint8_t row) |
| 39 | { | 39 | { |
| 40 | setPinInputHigh(row_pins[row]); | 40 | gpio_set_pin_input_high(row_pins[row]); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | static void unselect_rows(void) | 43 | static void unselect_rows(void) |
| 44 | { | 44 | { |
| 45 | for(uint8_t x = 0; x < MATRIX_ROWS; x++) { | 45 | for(uint8_t x = 0; x < MATRIX_ROWS; x++) { |
| 46 | setPinInputHigh(row_pins[x]); | 46 | gpio_set_pin_input_high(row_pins[x]); |
| 47 | } | 47 | } |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | static void select_col(uint8_t col) | 50 | static void select_col(uint8_t col) |
| 51 | { | 51 | { |
| 52 | setPinOutput(col_pins[col]); | 52 | gpio_set_pin_output(col_pins[col]); |
| 53 | writePinLow(col_pins[col]); | 53 | gpio_write_pin_low(col_pins[col]); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | static void unselect_col(uint8_t col) | 56 | static void unselect_col(uint8_t col) |
| 57 | { | 57 | { |
| 58 | setPinInputHigh(col_pins[col]); | 58 | gpio_set_pin_input_high(col_pins[col]); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | static void unselect_cols(void) | 61 | static void unselect_cols(void) |
| 62 | { | 62 | { |
| 63 | for(uint8_t x = 0; x < MATRIX_COLS; x++) { | 63 | for(uint8_t x = 0; x < MATRIX_COLS; x++) { |
| 64 | setPinInputHigh(col_pins[x]); | 64 | gpio_set_pin_input_high(col_pins[x]); |
| 65 | } | 65 | } |
| 66 | } | 66 | } |
| 67 | 67 | ||
| @@ -69,10 +69,10 @@ static void init_pins(void) { | |||
| 69 | unselect_rows(); | 69 | unselect_rows(); |
| 70 | unselect_cols(); | 70 | unselect_cols(); |
| 71 | for (uint8_t x = 0; x < MATRIX_COLS; x++) { | 71 | for (uint8_t x = 0; x < MATRIX_COLS; x++) { |
| 72 | setPinInputHigh(col_pins[x]); | 72 | gpio_set_pin_input_high(col_pins[x]); |
| 73 | } | 73 | } |
| 74 | for (uint8_t x = 0; x < MATRIX_ROWS; x++) { | 74 | for (uint8_t x = 0; x < MATRIX_ROWS; x++) { |
| 75 | setPinInputHigh(row_pins[x]); | 75 | gpio_set_pin_input_high(row_pins[x]); |
| 76 | } | 76 | } |
| 77 | } | 77 | } |
| 78 | 78 | ||
| @@ -92,7 +92,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) | |||
| 92 | for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { | 92 | for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { |
| 93 | 93 | ||
| 94 | // Select the col pin to read (active low) | 94 | // Select the col pin to read (active low) |
| 95 | uint8_t pin_state = readPin(col_pins[col_index]); | 95 | uint8_t pin_state = gpio_read_pin(col_pins[col_index]); |
| 96 | 96 | ||
| 97 | // Populate the matrix row with the state of the col pin | 97 | // Populate the matrix row with the state of the col pin |
| 98 | current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); | 98 | current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); |
| @@ -120,7 +120,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) | |||
| 120 | matrix_row_t last_row_value = current_matrix[tmp]; | 120 | matrix_row_t last_row_value = current_matrix[tmp]; |
| 121 | 121 | ||
| 122 | // Check row pin state | 122 | // Check row pin state |
| 123 | if (readPin(row_pins[row_index]) == 0) | 123 | if (gpio_read_pin(row_pins[row_index]) == 0) |
| 124 | { | 124 | { |
| 125 | // Pin LO, set col bit | 125 | // Pin LO, set col bit |
| 126 | current_matrix[tmp] |= (ROW_SHIFTER << current_col); | 126 | current_matrix[tmp] |= (ROW_SHIFTER << current_col); |
