aboutsummaryrefslogtreecommitdiff
path: root/keyboards/converter
diff options
context:
space:
mode:
authorRyan <[email protected]>2024-05-03 15:21:29 +1000
committerGitHub <[email protected]>2024-05-03 15:21:29 +1000
commitd09a06a1b354760fd0e64a453abade972900e885 (patch)
tree88d94640f4507ac8d7f570607423825bec3c6f89 /keyboards/converter
parent5426a7a129acf2ff5c8b435014747f1238e17965 (diff)
downloadqmk_firmware-d09a06a1b354760fd0e64a453abade972900e885.tar.gz
qmk_firmware-d09a06a1b354760fd0e64a453abade972900e885.zip
Update GPIO API usage in keyboard code (#23361)
Diffstat (limited to 'keyboards/converter')
-rw-r--r--keyboards/converter/palm_usb/matrix.c36
-rw-r--r--keyboards/converter/siemens_tastatur/matrix.c48
-rw-r--r--keyboards/converter/xt_usb/config.h6
-rw-r--r--keyboards/converter/xt_usb/xt.h20
4 files changed, 55 insertions, 55 deletions
diff --git a/keyboards/converter/palm_usb/matrix.c b/keyboards/converter/palm_usb/matrix.c
index 8ae89deb6a..db3784df19 100644
--- a/keyboards/converter/palm_usb/matrix.c
+++ b/keyboards/converter/palm_usb/matrix.c
@@ -95,27 +95,27 @@ void pins_init(void) {
// set pins for pullups, Rts , power &etc.
//print ("pins setup\n");
- setPinOutput(VCC_PIN);
- writePinLow(VCC_PIN);
+ gpio_set_pin_output(VCC_PIN);
+ gpio_write_pin_low(VCC_PIN);
#if ( HANDSPRING == 0)
#ifdef CY835
- setPinOutput(GND_PIN);
- writePinLow(GND_PIN);
+ gpio_set_pin_output(GND_PIN);
+ gpio_write_pin_low(GND_PIN);
- setPinOutput(PULLDOWN_PIN);
- writePinLow(PULLDOWN_PIN);
+ gpio_set_pin_output(PULLDOWN_PIN);
+ gpio_write_pin_low(PULLDOWN_PIN);
#endif
- setPinInput(DCD_PIN);
- setPinInput(RTS_PIN);
+ gpio_set_pin_input(DCD_PIN);
+ gpio_set_pin_input(RTS_PIN);
#endif
/* check that the other side isn't powered up.
- test=readPin(DCD_PIN);
+ test=gpio_read_pin(DCD_PIN);
xprintf("b%02X:", test);
- test=readPin(RTS_PIN);
+ test=gpio_read_pin(RTS_PIN);
xprintf("%02X\n", test);
*/
@@ -128,16 +128,16 @@ uint8_t rts_reset(void) {
// On boot, we keep rts as input, then switch roles here
// on leaving sleep, we toggle the same way
- firstread=readPin(RTS_PIN);
+ firstread=gpio_read_pin(RTS_PIN);
// printf("r%02X:", firstread);
- setPinOutput(RTS_PIN);
+ gpio_set_pin_output(RTS_PIN);
if (firstread) {
- writePinLow(RTS_PIN);
+ gpio_write_pin_low(RTS_PIN);
}
wait_ms(10);
- writePinHigh(RTS_PIN);
+ gpio_write_pin_high(RTS_PIN);
/* the future is Arm
@@ -223,9 +223,9 @@ uint8_t handspring_handshake(void) {
}
uint8_t handspring_reset(void) {
- writePinLow(VCC_PIN);
+ gpio_write_pin_low(VCC_PIN);
wait_ms(5);
- writePinHigh(VCC_PIN);
+ gpio_write_pin_high(VCC_PIN);
if ( handspring_handshake() ) {
last_activity = timer_read();
@@ -249,7 +249,7 @@ void matrix_init(void)
#endif
print("power up\n");
- writePinHigh(VCC_PIN);
+ gpio_write_pin_high(VCC_PIN);
// wait for DCD strobe from keyboard - it will do this
// up to 3 times, then the board needs the RTS toggled to try again
@@ -264,7 +264,7 @@ void matrix_init(void)
}
#else /// Palm / HP device with DCD
- while( !readPin(DCD_PIN) ) {;}
+ while( !gpio_read_pin(DCD_PIN) ) {;}
print("dcd\n");
rts_reset(); // at this point the keyboard should think all is well.
diff --git a/keyboards/converter/siemens_tastatur/matrix.c b/keyboards/converter/siemens_tastatur/matrix.c
index 78054ee0fa..447c4641d6 100644
--- a/keyboards/converter/siemens_tastatur/matrix.c
+++ b/keyboards/converter/siemens_tastatur/matrix.c
@@ -79,29 +79,29 @@ static void pal_cb(void* unused) {
void matrix_init(void) {
//Set I/O as pull-up inputs to read states
- setPinInputHigh(A0);
- setPinInputHigh(A1);
- setPinInputHigh(A2);
- setPinInputHigh(A3);
- setPinInputHigh(A4);
- setPinInputHigh(A5);
- setPinInputHigh(A6);
- setPinInputHigh(A7);
- setPinInputHigh(A8);
- setPinInputHigh(A9);
- setPinInputHigh(A10);
- setPinInputHigh(B3);
- setPinInputHigh(B4);
- setPinInputHigh(B5);
- setPinInputHigh(B6);
- setPinInputHigh(B7);
- setPinInputHigh(B8);
- setPinInputHigh(B9);
- setPinInputHigh(B11);
- setPinInputHigh(B12);
- setPinInputHigh(B13);
- setPinInputHigh(B14);
- setPinInputHigh(B15);
+ gpio_set_pin_input_high(A0);
+ gpio_set_pin_input_high(A1);
+ gpio_set_pin_input_high(A2);
+ gpio_set_pin_input_high(A3);
+ gpio_set_pin_input_high(A4);
+ gpio_set_pin_input_high(A5);
+ gpio_set_pin_input_high(A6);
+ gpio_set_pin_input_high(A7);
+ gpio_set_pin_input_high(A8);
+ gpio_set_pin_input_high(A9);
+ gpio_set_pin_input_high(A10);
+ gpio_set_pin_input_high(B3);
+ gpio_set_pin_input_high(B4);
+ gpio_set_pin_input_high(B5);
+ gpio_set_pin_input_high(B6);
+ gpio_set_pin_input_high(B7);
+ gpio_set_pin_input_high(B8);
+ gpio_set_pin_input_high(B9);
+ gpio_set_pin_input_high(B11);
+ gpio_set_pin_input_high(B12);
+ gpio_set_pin_input_high(B13);
+ gpio_set_pin_input_high(B14);
+ gpio_set_pin_input_high(B15);
memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t));
@@ -207,7 +207,7 @@ uint8_t matrix_scan(void) {
matrix[3] = 0x00;
}
//Special case for Shift
- if (readPin(B11) == 0) { matrix[3] |= 0x01; }
+ if (gpio_read_pin(B11) == 0) { matrix[3] |= 0x01; }
porta_buffer = 65535;
portb_buffer = 65535;
diff --git a/keyboards/converter/xt_usb/config.h b/keyboards/converter/xt_usb/config.h
index 7d006b4116..a080698d87 100644
--- a/keyboards/converter/xt_usb/config.h
+++ b/keyboards/converter/xt_usb/config.h
@@ -34,10 +34,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* hard reset: low pulse for 500ms and after that HiZ for safety */
#define XT_RESET() do { \
- writePinLow(XT_RST_PIN); \
- setPinOutput(XT_RST_PIN); \
+ gpio_write_pin_low(XT_RST_PIN); \
+ gpio_set_pin_output(XT_RST_PIN); \
wait_ms(500); \
- setPinInput(XT_RST_PIN); \
+ gpio_set_pin_input(XT_RST_PIN); \
} while (0)
/* INT1 for falling edge of clock line */
diff --git a/keyboards/converter/xt_usb/xt.h b/keyboards/converter/xt_usb/xt.h
index e9c1c7751d..09363d75b3 100644
--- a/keyboards/converter/xt_usb/xt.h
+++ b/keyboards/converter/xt_usb/xt.h
@@ -43,30 +43,30 @@ POSSIBILITY OF SUCH DAMAGE.
#define XT_DATA_IN() \
do { \
- setPinInput(XT_DATA_PIN); \
- writePinHigh(XT_DATA_PIN); \
+ gpio_set_pin_input(XT_DATA_PIN); \
+ gpio_write_pin_high(XT_DATA_PIN); \
} while (0)
-#define XT_DATA_READ() readPin(XT_DATA_PIN)
+#define XT_DATA_READ() gpio_read_pin(XT_DATA_PIN)
#define XT_DATA_LO() \
do { \
- writePinLow(XT_DATA_PIN); \
- setPinOutput(XT_DATA_PIN); \
+ gpio_write_pin_low(XT_DATA_PIN); \
+ gpio_set_pin_output(XT_DATA_PIN); \
} while (0)
#define XT_CLOCK_IN() \
do { \
- setPinInput(XT_CLOCK_PIN); \
- writePinHigh(XT_CLOCK_PIN); \
+ gpio_set_pin_input(XT_CLOCK_PIN); \
+ gpio_write_pin_high(XT_CLOCK_PIN); \
} while (0)
-#define XT_CLOCK_READ() readPin(XT_CLOCK_PIN)
+#define XT_CLOCK_READ() gpio_read_pin(XT_CLOCK_PIN)
#define XT_CLOCK_LO() \
do { \
- writePinLow(XT_CLOCK_PIN); \
- setPinOutput(XT_CLOCK_PIN); \
+ gpio_write_pin_low(XT_CLOCK_PIN); \
+ gpio_set_pin_output(XT_CLOCK_PIN); \
} while (0)
void xt_host_init(void);