diff options
author | Ryan <fauxpark@gmail.com> | 2020-04-30 16:24:47 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-30 16:24:47 +1000 |
commit | 16a15c1cfcbfd0feb2c2cf1383676747e2f97d73 (patch) | |
tree | aaa3c9f5a23207861d05c37ed4860af8efd40f85 /keyboards | |
parent | 37a4b53c4f51b66992e687b5012c83df9cc6b138 (diff) |
QMK-ify some GPIO macros (#8315)
Diffstat (limited to 'keyboards')
-rw-r--r-- | keyboards/40percentclub/nano/keymaps/drashna/keymap.c | 1 | ||||
-rw-r--r-- | keyboards/claw44/ssd1306.h | 3 | ||||
-rw-r--r-- | keyboards/comet46/ssd1306.h | 3 | ||||
-rw-r--r-- | keyboards/converter/palm_usb/matrix.c | 41 | ||||
-rw-r--r-- | keyboards/crkbd/ssd1306.h | 3 | ||||
-rw-r--r-- | keyboards/helix/local_drivers/ssd1306.h | 1 | ||||
-rwxr-xr-x | keyboards/lily58/ssd1306.h | 3 | ||||
-rw-r--r-- | keyboards/yosino58/ssd1306.h | 3 |
8 files changed, 25 insertions, 33 deletions
diff --git a/keyboards/40percentclub/nano/keymaps/drashna/keymap.c b/keyboards/40percentclub/nano/keymaps/drashna/keymap.c index 998e55d5b2..f5d0787eeb 100644 --- a/keyboards/40percentclub/nano/keymaps/drashna/keymap.c +++ b/keyboards/40percentclub/nano/keymaps/drashna/keymap.c @@ -1,7 +1,6 @@ #include "drashna.h" #include "analog.h" #include "pointing_device.h" -#include "pincontrol.h" #define KC_X0 LT(_FN, KC_ESC) diff --git a/keyboards/claw44/ssd1306.h b/keyboards/claw44/ssd1306.h index ea8c923280..0ca093093a 100644 --- a/keyboards/claw44/ssd1306.h +++ b/keyboards/claw44/ssd1306.h @@ -2,7 +2,6 @@ #include <stdbool.h> #include <stdio.h> -#include "pincontrol.h" #include "action.h" enum ssd1306_cmds { @@ -88,4 +87,4 @@ void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_render(struct CharacterMatrix *matrix); -bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
\ No newline at end of file +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/comet46/ssd1306.h b/keyboards/comet46/ssd1306.h index ea8c923280..0ca093093a 100644 --- a/keyboards/comet46/ssd1306.h +++ b/keyboards/comet46/ssd1306.h @@ -2,7 +2,6 @@ #include <stdbool.h> #include <stdio.h> -#include "pincontrol.h" #include "action.h" enum ssd1306_cmds { @@ -88,4 +87,4 @@ void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_render(struct CharacterMatrix *matrix); -bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
\ No newline at end of file +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/converter/palm_usb/matrix.c b/keyboards/converter/palm_usb/matrix.c index 49212f2ef1..590b5eea32 100644 --- a/keyboards/converter/palm_usb/matrix.c +++ b/keyboards/converter/palm_usb/matrix.c @@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include QMK_KEYBOARD_H #include "protocol/serial.h" #include "timer.h" -#include "pincontrol.h" /* @@ -96,27 +95,27 @@ void pins_init(void) { // set pins for pullups, Rts , power &etc. //print ("pins setup\n"); - pinMode(VCC_PIN, PinDirectionOutput); - digitalWrite(VCC_PIN, PinLevelLow); + setPinOutput(VCC_PIN); + writePinLow(VCC_PIN); #if ( HANDSPRING == 0) #ifdef CY835 - pinMode(GND_PIN, PinDirectionOutput); - digitalWrite(GND_PIN, PinLevelLow); + setPinOutput(GND_PIN); + writePinLow(GND_PIN); - pinMode(PULLDOWN_PIN, PinDirectionOutput); - digitalWrite(PULLDOWN_PIN, PinLevelLow); + setPinOutput(PULLDOWN_PIN); + writePinLow(PULLDOWN_PIN); #endif - pinMode(DCD_PIN, PinDirectionInput); - pinMode(RTS_PIN, PinDirectionInput); + setPinInput(DCD_PIN); + setPinInput(RTS_PIN); #endif /* check that the other side isn't powered up. - test=digitalRead(DCD_PIN); + test=readPin(DCD_PIN); xprintf("b%02X:", test); - test=digitalRead(RTS_PIN); + test=readPin(RTS_PIN); xprintf("%02X\n", test); */ @@ -129,20 +128,20 @@ 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=digitalRead(RTS_PIN); + firstread=readPin(RTS_PIN); // printf("r%02X:", firstread); - pinMode(RTS_PIN, PinDirectionOutput); + setPinOutput(RTS_PIN); - if (firstread == PinLevelHigh) { - digitalWrite(RTS_PIN, PinLevelLow); + if (firstread) { + writePinLow(RTS_PIN); } _delay_ms(10); - digitalWrite(RTS_PIN, PinLevelHigh); + writePinHigh(RTS_PIN); /* the future is Arm - if (palReadPad(RTS_PIN_IOPRT) == PinLevelLow) + if (!palReadPad(RTS_PIN_IOPRT)) { _delay_ms(10); palSetPadMode(RTS_PINn_IOPORT, PinDirectionOutput_PUSHPULL); @@ -224,9 +223,9 @@ uint8_t handspring_handshake(void) { } uint8_t handspring_reset(void) { - digitalWrite(VCC_PIN, PinLevelLow); + writePinLow(VCC_PIN); _delay_ms(5); - digitalWrite(VCC_PIN, PinLevelHigh); + writePinHigh(VCC_PIN); if ( handspring_handshake() ) { last_activity = timer_read(); @@ -250,7 +249,7 @@ void matrix_init(void) #endif print("power up\n"); - digitalWrite(VCC_PIN, PinLevelHigh); + writePinHigh(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 @@ -265,7 +264,7 @@ void matrix_init(void) } #else /// Palm / HP device with DCD - while( digitalRead(DCD_PIN) != PinLevelHigh ) {;} + while( !readPin(DCD_PIN) ) {;} print("dcd\n"); rts_reset(); // at this point the keyboard should think all is well. diff --git a/keyboards/crkbd/ssd1306.h b/keyboards/crkbd/ssd1306.h index ea8c923280..0ca093093a 100644 --- a/keyboards/crkbd/ssd1306.h +++ b/keyboards/crkbd/ssd1306.h @@ -2,7 +2,6 @@ #include <stdbool.h> #include <stdio.h> -#include "pincontrol.h" #include "action.h" enum ssd1306_cmds { @@ -88,4 +87,4 @@ void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_render(struct CharacterMatrix *matrix); -bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
\ No newline at end of file +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/helix/local_drivers/ssd1306.h b/keyboards/helix/local_drivers/ssd1306.h index 9cf6983b7e..f9f91c6fed 100644 --- a/keyboards/helix/local_drivers/ssd1306.h +++ b/keyboards/helix/local_drivers/ssd1306.h @@ -3,7 +3,6 @@ #include <stdbool.h> #include <stdio.h> -#include "pincontrol.h" #include "action.h" enum ssd1306_cmds { diff --git a/keyboards/lily58/ssd1306.h b/keyboards/lily58/ssd1306.h index ea8c923280..0ca093093a 100755 --- a/keyboards/lily58/ssd1306.h +++ b/keyboards/lily58/ssd1306.h @@ -2,7 +2,6 @@ #include <stdbool.h> #include <stdio.h> -#include "pincontrol.h" #include "action.h" enum ssd1306_cmds { @@ -88,4 +87,4 @@ void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_render(struct CharacterMatrix *matrix); -bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
\ No newline at end of file +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/yosino58/ssd1306.h b/keyboards/yosino58/ssd1306.h index de0a9a02aa..acaf6217ef 100644 --- a/keyboards/yosino58/ssd1306.h +++ b/keyboards/yosino58/ssd1306.h @@ -2,7 +2,6 @@ #include <stdbool.h> #include <stdio.h> -#include "pincontrol.h" #include "action.h" enum ssd1306_cmds { @@ -93,4 +92,4 @@ void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_render(struct CharacterMatrix *matrix); -bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
\ No newline at end of file +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); |