aboutsummaryrefslogtreecommitdiff
path: root/keyboards/barleycorn_smd/matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/barleycorn_smd/matrix.c')
-rw-r--r--keyboards/barleycorn_smd/matrix.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/keyboards/barleycorn_smd/matrix.c b/keyboards/barleycorn_smd/matrix.c
index 315093c8a9..f64e8fcd7f 100644
--- a/keyboards/barleycorn_smd/matrix.c
+++ b/keyboards/barleycorn_smd/matrix.c
@@ -14,10 +14,8 @@ 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 "matrix.h"
#include "wait.h"
-#include "quantum.h"
#include "i2c_master.h"
static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
@@ -25,17 +23,17 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
static 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]);
}
}
static 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]);
}
static void unselect_row(uint8_t row) {
- setPinInputHigh(row_pins[row]);
+ gpio_set_pin_input_high(row_pins[row]);
}
static void init_pins(void) {
@@ -48,7 +46,7 @@ static void init_pins(void) {
for (uint8_t x = 0; x < MATRIX_COLS; x++) {
if ( x < 8 ) {
- setPinInputHigh(col_pins[x]);
+ gpio_set_pin_input_high(col_pins[x]);
}
}
}
@@ -113,7 +111,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
pin_state = port_expander_col_buffer[1] & (1 << 1);
break;
default :
- pin_state = readPin(col_pins[col_index]);
+ pin_state = gpio_read_pin(col_pins[col_index]);
}
// Populate the matrix row with the state of the col pin