aboutsummaryrefslogtreecommitdiff
path: root/keyboards/nullbitsco/nibble/matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/nullbitsco/nibble/matrix.c')
-rw-r--r--keyboards/nullbitsco/nibble/matrix.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/keyboards/nullbitsco/nibble/matrix.c b/keyboards/nullbitsco/nibble/matrix.c
index 496c5dbe32..7ea5a6c470 100644
--- a/keyboards/nullbitsco/nibble/matrix.c
+++ b/keyboards/nullbitsco/nibble/matrix.c
@@ -13,7 +13,8 @@
* 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 "quantum.h"
+#include "matrix.h"
+#include "wait.h"
#define COL_SHIFTER ((uint32_t)1)
@@ -26,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]);
}
}
@@ -44,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);
}
}
@@ -59,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);
}