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
|
|
@ -43,27 +43,27 @@ pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
|||
|
||||
static inline void setPinOutput_writeLow(pin_t pin) {
|
||||
ATOMIC_BLOCK_FORCEON {
|
||||
setPinOutput(pin);
|
||||
writePinLow(pin);
|
||||
gpio_set_pin_output(pin);
|
||||
gpio_write_pin_low(pin);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void setPinOutput_writeHigh(pin_t pin) {
|
||||
ATOMIC_BLOCK_FORCEON {
|
||||
setPinOutput(pin);
|
||||
writePinHigh(pin);
|
||||
gpio_set_pin_output(pin);
|
||||
gpio_write_pin_high(pin);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void setPinInput_high(pin_t pin) {
|
||||
ATOMIC_BLOCK_FORCEON {
|
||||
setPinInputHigh(pin);
|
||||
gpio_set_pin_input_high(pin);
|
||||
}
|
||||
}
|
||||
|
||||
static inline uint8_t readMatrixPin(pin_t pin) {
|
||||
if (pin != NO_PIN) {
|
||||
return readPin(pin);
|
||||
return gpio_read_pin(pin);
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -81,13 +81,13 @@ static void HC595_output(SIZE_T data, uint8_t bit) {
|
|||
ATOMIC_BLOCK_FORCEON {
|
||||
for (uint8_t i = 0; i < (SHIFT_COL_END - SHIFT_COL_START + 1); i++) {
|
||||
if (data & 0x1) {
|
||||
writePinHigh(HC595_DS);
|
||||
gpio_write_pin_high(HC595_DS);
|
||||
} else {
|
||||
writePinLow(HC595_DS);
|
||||
gpio_write_pin_low(HC595_DS);
|
||||
}
|
||||
writePinHigh(HC595_SHCP);
|
||||
gpio_write_pin_high(HC595_SHCP);
|
||||
HC595_delay(n);
|
||||
writePinLow(HC595_SHCP);
|
||||
gpio_write_pin_low(HC595_SHCP);
|
||||
HC595_delay(n);
|
||||
if (bit) {
|
||||
break;
|
||||
|
|
@ -95,9 +95,9 @@ static void HC595_output(SIZE_T data, uint8_t bit) {
|
|||
data = data >> 1;
|
||||
}
|
||||
}
|
||||
writePinHigh(HC595_STCP);
|
||||
gpio_write_pin_high(HC595_STCP);
|
||||
HC595_delay(n);
|
||||
writePinLow(HC595_STCP);
|
||||
gpio_write_pin_low(HC595_STCP);
|
||||
HC595_delay(n);
|
||||
}
|
||||
}
|
||||
|
|
@ -175,9 +175,9 @@ static void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t curre
|
|||
}
|
||||
|
||||
void matrix_init_custom(void) {
|
||||
setPinOutput(HC595_DS);
|
||||
setPinOutput(HC595_STCP);
|
||||
setPinOutput(HC595_SHCP);
|
||||
gpio_set_pin_output(HC595_DS);
|
||||
gpio_set_pin_output(HC595_STCP);
|
||||
gpio_set_pin_output(HC595_SHCP);
|
||||
|
||||
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||
if (row_pins[x] != NO_PIN) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue