diff options
Diffstat (limited to 'keyboards/hineybush/hbcp/matrix.c')
| -rw-r--r-- | keyboards/hineybush/hbcp/matrix.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/keyboards/hineybush/hbcp/matrix.c b/keyboards/hineybush/hbcp/matrix.c index d493a7e9ef..c4cfc9edb3 100644 --- a/keyboards/hineybush/hbcp/matrix.c +++ b/keyboards/hineybush/hbcp/matrix.c @@ -14,12 +14,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <stdint.h> -#include <stdbool.h> #include "util.h" #include "matrix.h" #include "debounce.h" -#include "quantum.h" static const pin_t row_pins[] = MATRIX_ROW_PINS; static const pin_t col_pins[] = MATRIX_COL_PINS; @@ -30,11 +27,11 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan // matrix code void select_row(uint8_t row) { - setPinOutput(row_pins[row]); - writePinLow(row_pins[row]); + gpio_set_pin_output(row_pins[row]); + gpio_write_pin_low(row_pins[row]); } - void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } + void unselect_row(uint8_t row) { gpio_set_pin_input_high(row_pins[row]); } bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { // Store last value of row prior to reading @@ -50,7 +47,7 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan // For each col... for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { // Select the col pin to read (active low) - uint8_t pin_state = readPin(col_pins[col_index]); + uint8_t pin_state = gpio_read_pin(col_pins[col_index]); // Populate the matrix row with the state of the col pin current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); @@ -63,11 +60,11 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan } void select_col(uint8_t col) { - setPinOutput(col_pins[col]); - writePinLow(col_pins[col]); + gpio_set_pin_output(col_pins[col]); + gpio_write_pin_low(col_pins[col]); } - void unselect_col(uint8_t col) { setPinInputHigh(col_pins[col]); } + void unselect_col(uint8_t col) { gpio_set_pin_input_high(col_pins[col]); } bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { bool matrix_changed = false; @@ -82,7 +79,7 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan matrix_row_t last_row_value = current_matrix[row_index]; // Check row pin state - if (readPin(row_pins[row_index]) == 0) { + if (gpio_read_pin(row_pins[row_index]) == 0) { // Pin LO, set col bit current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); } @@ -101,13 +98,13 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan void unselect_rows(void) { for (uint8_t x = 0; x < MATRIX_ROWS; x++) { - setPinInputHigh(row_pins[x]); + gpio_set_pin_input_high(row_pins[x]); } } void unselect_cols(void) { for (uint8_t x = 0; x < MATRIX_COLS; x++) { - setPinInputHigh(col_pins[x]); + gpio_set_pin_input_high(col_pins[x]); } } |
