summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2024-05-03 15:21:29 +1000
committerGitHub <noreply@github.com>2024-05-03 15:21:29 +1000
commitd09a06a1b354760fd0e64a453abade972900e885 (patch)
tree88d94640f4507ac8d7f570607423825bec3c6f89
parent5426a7a129acf2ff5c8b435014747f1238e17965 (diff)
Update GPIO API usage in keyboard code (#23361)
-rw-r--r--keyboards/3w6/rev1/matrix.c14
-rw-r--r--keyboards/3w6/rev2/matrix.c14
-rw-r--r--keyboards/40percentclub/4pack/4pack.c4
-rw-r--r--keyboards/40percentclub/sixpack/sixpack.c6
-rw-r--r--keyboards/4pplet/eagle_viper_rep/rev_a/rev_a.c94
-rw-r--r--keyboards/4pplet/eagle_viper_rep/rev_b/rev_b.c30
-rw-r--r--keyboards/acheron/apollo/87h/delta/delta.c4
-rw-r--r--keyboards/acheron/apollo/87htsc/87htsc.c4
-rw-r--r--keyboards/acheron/athena/alpha/alpha.c8
-rw-r--r--keyboards/acheron/athena/beta/beta.c8
-rw-r--r--keyboards/acheron/austin/austin.c12
-rwxr-xr-xkeyboards/acheron/elongate/delta/delta.c32
-rw-r--r--keyboards/acheron/shark/beta/beta.c4
-rw-r--r--keyboards/aeboards/ext65/rev1/rev1.c18
-rw-r--r--keyboards/aeboards/ext65/rev2/rev2.c18
-rw-r--r--keyboards/aeboards/ext65/rev3/rev3.c6
-rw-r--r--keyboards/ai03/orbit/orbit.c24
-rw-r--r--keyboards/ai03/vega/vega.c8
-rw-r--r--keyboards/akko/5087/5087.c12
-rw-r--r--keyboards/akko/5108/5108.c6
-rw-r--r--keyboards/al1/matrix.c4
-rw-r--r--keyboards/anavi/knob1/knob1.c4
-rw-r--r--keyboards/anavi/knobs3/knobs3.c4
-rw-r--r--keyboards/argyle/matrix.c12
-rwxr-xr-xkeyboards/artifact/lvl/rev_hs01/rev_hs01.c2
-rw-r--r--keyboards/atlantis/ps17/ps17.c18
-rw-r--r--keyboards/atomic/atomic.c4
-rw-r--r--keyboards/bajjak/bajjak.h22
-rw-r--r--keyboards/bajjak/matrix.c56
-rw-r--r--keyboards/bandominedoni/bandominedoni.c14
-rw-r--r--keyboards/barleycorn_smd/matrix.c12
-rw-r--r--keyboards/bastardkb/charybdis/charybdis.c4
-rw-r--r--keyboards/bear_face/v1/v1.c4
-rw-r--r--keyboards/bear_face/v2/v2.c4
-rw-r--r--keyboards/bioi/g60/g60.c6
-rw-r--r--keyboards/bioi/morgan65/morgan65.c6
-rw-r--r--keyboards/bioi/s65/s65.c6
-rw-r--r--keyboards/blu/vimclutch/vimclutch.c4
-rw-r--r--keyboards/bobpad/bobpad.c2
-rw-r--r--keyboards/bpiphany/ghost_squid/ghost_squid.c4
-rw-r--r--keyboards/bpiphany/ghost_squid/ghost_squid.h4
-rw-r--r--keyboards/bpiphany/ghost_squid/matrix.c28
-rw-r--r--keyboards/capsunlocked/cu75/cu75.c8
-rw-r--r--keyboards/capsunlocked/cu80/v2/v2.c2
-rw-r--r--keyboards/centromere/centromere.c24
-rw-r--r--keyboards/centromere/centromere.h20
-rw-r--r--keyboards/cheshire/curiosity/curiosity.c12
-rw-r--r--keyboards/cipulot/common/ec_switch_matrix.c38
-rw-r--r--keyboards/clueboard/2x1800/2019/2019.c24
-rw-r--r--keyboards/clueboard/2x1800/2021/max7219.c4
-rw-r--r--keyboards/clueboard/66/rev4/rev4.c24
-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
-rw-r--r--keyboards/custommk/evo70_r2/matrix.c20
-rw-r--r--keyboards/cutie_club/wraith/wraith.c2
-rw-r--r--keyboards/dark/magnum_ergo_1/magnum_ergo_1.c44
-rw-r--r--keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c12
-rw-r--r--keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c12
-rw-r--r--keyboards/dekunukem/duckypad/duckypad.c8
-rwxr-xr-xkeyboards/dichotomy/dichotomy.c12
-rwxr-xr-xkeyboards/dichotomy/dichotomy.h12
-rw-r--r--keyboards/dinofizz/fnrow/v1/v1.c10
-rw-r--r--keyboards/dk60/dk60.c4
-rw-r--r--keyboards/dk60/dk60.h8
-rw-r--r--keyboards/dm9records/lain/lain.c6
-rw-r--r--keyboards/doppelganger/doppelganger.c14
-rw-r--r--keyboards/dp60/matrix.c144
-rw-r--r--keyboards/drop/lib/mux.c12
-rw-r--r--keyboards/duck/orion/v3/matrix.c6
-rw-r--r--keyboards/duck/orion/v3/v3.c6
-rw-r--r--keyboards/dumbpad/v0x/v0x.c20
-rw-r--r--keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c20
-rw-r--r--keyboards/dumbpad/v0x_right/v0x_right.c20
-rw-r--r--keyboards/dumbpad/v1x/v1x.c30
-rw-r--r--keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c30
-rw-r--r--keyboards/dumbpad/v1x_right/v1x_right.c30
-rw-r--r--keyboards/dumbpad/v3x/v3x.c30
-rw-r--r--keyboards/durgod/dgk6x/dgk6x.c20
-rw-r--r--keyboards/durgod/k310/k310.c36
-rw-r--r--keyboards/durgod/k320/k320.c36
-rw-r--r--keyboards/dztech/bocc/bocc.c4
-rw-r--r--keyboards/ealdin/quadrant/quadrant.c4
-rw-r--r--keyboards/edda/edda.c30
-rw-r--r--keyboards/enviousdesign/commissions/mini1800/mini1800.c10
-rw-r--r--keyboards/ergodox_ez/matrix.c54
-rw-r--r--keyboards/evyd13/gh80_3700/gh80_3700.c22
-rw-r--r--keyboards/evyd13/gud70/gud70.c4
-rw-r--r--keyboards/evyd13/pockettype/pockettype.c14
-rw-r--r--keyboards/evyd13/wasdat/matrix.c14
-rw-r--r--keyboards/evyd13/wasdat_code/matrix.c14
-rw-r--r--keyboards/exclusive/e6v2/oe/oe.c8
-rw-r--r--keyboards/exclusive/e85/hotswap/hotswap.c8
-rw-r--r--keyboards/exclusive/e85/soldered/soldered.c8
-rw-r--r--keyboards/ferris/0_1/matrix.c14
-rw-r--r--keyboards/ferris/0_2/matrix.c12
-rw-r--r--keyboards/fjlabs/bolsa65/bolsa65.c4
-rw-r--r--keyboards/flx/virgo/virgo.c8
-rw-r--r--keyboards/gboards/gergoplex/matrix.c10
-rw-r--r--keyboards/geistmaschine/macropod/matrix.c4
-rw-r--r--keyboards/geonworks/ee_at/ee_at.c12
-rw-r--r--keyboards/geonworks/w1_at/w1_at.c12
-rw-r--r--keyboards/gh60/revc/revc.h20
-rw-r--r--keyboards/ghs/rar/rar.c8
-rw-r--r--keyboards/gl516/a52gl/matrix.c24
-rw-r--r--keyboards/gl516/j73gl/matrix.c24
-rw-r--r--keyboards/gl516/n51gl/matrix.c24
-rw-r--r--keyboards/glenpickle/chimera_ortho_plus/chimera_ortho_plus.c1
-rw-r--r--keyboards/gmmk/gmmk2/p96/ansi/ansi.c6
-rw-r--r--keyboards/gmmk/gmmk2/p96/iso/iso.c6
-rw-r--r--keyboards/gmmk/numpad/matrix.c12
-rw-r--r--keyboards/gmmk/numpad/numpad.c4
-rw-r--r--keyboards/gray_studio/think65/solder/solder.c4
-rw-r--r--keyboards/halfcliff/matrix.c10
-rw-r--r--keyboards/handwired/2x5keypad/2x5keypad.c14
-rw-r--r--keyboards/handwired/aek64/aek64.c6
-rw-r--r--keyboards/handwired/battleship_gamepad/battleship_gamepad.c2
-rw-r--r--keyboards/handwired/colorlice/colorlice.c8
-rw-r--r--keyboards/handwired/dqz11n1g/matrix.c12
-rw-r--r--keyboards/handwired/evk/v1_3/v1_3.c8
-rw-r--r--keyboards/handwired/jopr/jopr.c6
-rw-r--r--keyboards/handwired/jotanck/jotanck.c4
-rw-r--r--keyboards/handwired/jotpad16/jotpad16.c4
-rw-r--r--keyboards/handwired/jtallbean/split_65/split_65.c8
-rw-r--r--keyboards/handwired/lagrange/lagrange.c4
-rw-r--r--keyboards/handwired/lagrange/transport.c16
-rw-r--r--keyboards/handwired/owlet60/matrix.c36
-rw-r--r--keyboards/handwired/prime_exl_plus/prime_exl_plus.c22
-rw-r--r--keyboards/handwired/retro_refit/retro_refit.c6
-rw-r--r--keyboards/handwired/selene/selene.c12
-rw-r--r--keyboards/handwired/sono1/sono1.c26
-rw-r--r--keyboards/handwired/symmetric70_proto/debug_config.h12
-rw-r--r--keyboards/handwired/symmetric70_proto/matrix_debug/matrix.c30
-rw-r--r--keyboards/handwired/symmetric70_proto/matrix_fast/matrix_extension_74hc15x.c6
-rw-r--r--keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c10
-rw-r--r--keyboards/handwired/traveller/traveller.c4
-rw-r--r--keyboards/handwired/woodpad/woodpad.c6
-rw-r--r--keyboards/handwired/z150/z150.c18
-rw-r--r--keyboards/hardwareabstraction/handwire/handwire.c10
-rw-r--r--keyboards/hazel/bad_wings/matrix.c12
-rw-r--r--keyboards/heliar/wm1_hotswap/wm1_hotswap.c18
-rw-r--r--keyboards/hhkb/yang/matrix.c20
-rw-r--r--keyboards/hhkb/yang/yang.c62
-rw-r--r--keyboards/hineybush/h10/h10.c4
-rw-r--r--keyboards/hineybush/h60/h60.c4
-rw-r--r--keyboards/hineybush/h87a/h87a.c8
-rw-r--r--keyboards/hineybush/h88/h88.c8
-rw-r--r--keyboards/hineybush/hbcp/matrix.c20
-rw-r--r--keyboards/hineybush/physix/physix.c10
-rw-r--r--keyboards/ibm/model_m/ashpil_usbc/ashpil_usbc.c18
-rw-r--r--keyboards/ibm/model_m/modelh/modelh.c4
-rw-r--r--keyboards/ibm/model_m/mschwingen/matrix.c12
-rw-r--r--keyboards/ibm/model_m/mschwingen/mschwingen.c36
-rw-r--r--keyboards/ibm/model_m/teensypp/teensypp.c18
-rw-r--r--keyboards/ibm/model_m/yugo_m/yugo_m.c12
-rw-r--r--keyboards/idb/idb_60/idb_60.c12
-rw-r--r--keyboards/ilumkb/volcano660/volcano660.c12
-rw-r--r--keyboards/ingrained/matrix.c14
-rw-r--r--keyboards/input_club/k_type/is31fl3733-dual.c4
-rw-r--r--keyboards/jae/j01/j01.c4
-rw-r--r--keyboards/jels/jels88/jels88.c8
-rw-r--r--keyboards/jian/nsrev2/config.h28
-rw-r--r--keyboards/jian/nsrev2/nsrev2.c6
-rw-r--r--keyboards/jian/rev1/config.h28
-rw-r--r--keyboards/jian/rev1/rev1.c6
-rw-r--r--keyboards/jian/rev2/config.h28
-rw-r--r--keyboards/jian/rev2/rev2.c6
-rw-r--r--keyboards/jones/v03/matrix.c12
-rw-r--r--keyboards/jones/v03_1/matrix.c12
-rw-r--r--keyboards/joshajohnson/hub16/matrix.c20
-rw-r--r--keyboards/jukaie/jk01/jk01.c12
-rw-r--r--keyboards/kabedon/kabedon980/kabedon980.c2
-rw-r--r--keyboards/kagizaraya/chidori/board.c16
-rw-r--r--keyboards/kakunpc/angel64/alpha/matrix.c24
-rw-r--r--keyboards/kakunpc/angel64/rev1/matrix.c24
-rw-r--r--keyboards/kakunpc/choc_taro/matrix.c24
-rw-r--r--keyboards/kakunpc/thedogkeyboard/matrix.c24
-rwxr-xr-xkeyboards/kbdfans/bella/soldered/soldered.c4
-rw-r--r--keyboards/kbdfans/kbd19x/kbd19x.h12
-rw-r--r--keyboards/kbdfans/kbd8x/kbd8x.h12
-rwxr-xr-xkeyboards/kbdfans/maja_soldered/maja_soldered.c4
-rw-r--r--keyboards/kbdfans/niu_mini/niu_mini.c4
-rw-r--r--keyboards/kbdfans/phaseone/phaseone.c2
-rw-r--r--keyboards/kbdmania/kmac/kmac.c30
-rw-r--r--keyboards/kbdmania/kmac/matrix.c24
-rw-r--r--keyboards/kbdmania/kmac_pad/kmac_pad.c4
-rw-r--r--keyboards/kbdmania/kmac_pad/matrix.c12
-rw-r--r--keyboards/kc60/kc60.c4
-rw-r--r--keyboards/kc60se/kc60se.c4
-rw-r--r--keyboards/keebio/kbo5000/rev1/rev1.c4
-rw-r--r--keyboards/keebio/quefrency/rev2/rev2.c4
-rw-r--r--keyboards/keebio/quefrency/rev3/rev3.c4
-rw-r--r--keyboards/keebio/sinc/sinc.c2
-rw-r--r--keyboards/keychron/c2_pro/matrix.c30
-rw-r--r--keyboards/keychron/q10/matrix.c12
-rwxr-xr-xkeyboards/keychron/q11/q11.c8
-rw-r--r--keyboards/keychron/q12/matrix.c12
-rw-r--r--keyboards/keychron/q1v2/matrix.c12
-rw-r--r--keyboards/keychron/q3/matrix.c12
-rw-r--r--keyboards/keychron/q5/matrix.c12
-rw-r--r--keyboards/keychron/q6/matrix.c12
-rw-r--r--keyboards/keychron/q65/matrix.c44
-rw-r--r--keyboards/keychron/v1/matrix.c44
-rw-r--r--keyboards/keychron/v10/matrix.c44
-rw-r--r--keyboards/keychron/v3/matrix.c44
-rw-r--r--keyboards/keychron/v5/matrix.c44
-rw-r--r--keyboards/keychron/v6/matrix.c44
-rwxr-xr-xkeyboards/keyhive/honeycomb/honeycomb.c12
-rwxr-xr-xkeyboards/keyhive/honeycomb/honeycomb.h12
-rw-r--r--keyboards/keyhive/lattice60/lattice60.c6
-rw-r--r--keyboards/keyhive/navi10/rev0/rev0.c4
-rw-r--r--keyboards/keyhive/navi10/rev2/rev2.c4
-rw-r--r--keyboards/keyhive/navi10/rev3/rev3.c4
-rw-r--r--keyboards/kin80/blackpill103/blackpill103.c4
-rw-r--r--keyboards/kin80/blackpill401/blackpill401.c4
-rw-r--r--keyboards/kin80/blackpill411/blackpill411.c4
-rw-r--r--keyboards/kin80/micro/micro.c4
-rw-r--r--keyboards/kinesis/kint36/kint36.c4
-rw-r--r--keyboards/kinesis/kint41/kint41.c4
-rw-r--r--keyboards/kinesis/kintlc/kintlc.c4
-rw-r--r--keyboards/kinesis/kintwin/kintwin.c18
-rw-r--r--keyboards/kinesis/nguyenvietyen/matrix.c32
-rw-r--r--keyboards/kkatano/wallaby/wallaby.c4
-rw-r--r--keyboards/kkatano/yurei/yurei.c4
-rw-r--r--keyboards/kopibeng/mnk88/mnk88.c8
-rw-r--r--keyboards/kopibeng/typ65/typ65.c42
-rw-r--r--keyboards/kopibeng/xt8x/xt8x.c12
-rw-r--r--keyboards/ktec/ergodone/ergodox_compat.h16
-rw-r--r--keyboards/ktec/ergodone/matrix.c100
-rw-r--r--keyboards/ktec/staryu/backlight_staryu.h4
-rw-r--r--keyboards/kv/revt/revt.c4
-rw-r--r--keyboards/lazydesigners/dimple/staggered/staggered.c4
-rw-r--r--keyboards/lfkeyboards/lfk78/lfk78.c4
-rw-r--r--keyboards/lfkeyboards/lfk87/lfk87.c4
-rw-r--r--keyboards/lfkeyboards/mini1800/mini1800.c4
-rw-r--r--keyboards/lfkeyboards/smk65/revb/revb.c8
-rw-r--r--keyboards/lz/erghost/matrix.c288
-rw-r--r--keyboards/machkeyboards/mach3/mach3.c4
-rw-r--r--keyboards/macrocat/macrocat.c4
-rw-r--r--keyboards/makeymakey/makeymakey.c78
-rw-r--r--keyboards/mariorion_v25/mariorion_v25.c42
-rw-r--r--keyboards/marksard/leftover30/leftover30.c8
-rw-r--r--keyboards/masterworks/classy_tkl/rev_a/rev_a.c8
-rw-r--r--keyboards/matrix/cain_re/cain_re.c12
-rw-r--r--keyboards/matrix/falcon/falcon.c8
-rw-r--r--keyboards/matrix/m12og/rev1/matrix.c12
-rw-r--r--keyboards/matrix/m12og/rev1/rev1.c2
-rw-r--r--keyboards/matrix/m12og/rev2/rev2.c18
-rw-r--r--keyboards/mc_76k/mc_76k.c6
-rw-r--r--keyboards/mechlovin/adelais/standard_led/avr/rev1/matrix.c268
-rw-r--r--keyboards/mechlovin/hannah910/hannah910.c22
-rw-r--r--keyboards/mechlovin/infinity87/rev2/matrix.c292
-rw-r--r--keyboards/mechlovin/infinity875/matrix.c292
-rw-r--r--keyboards/mechlovin/infinityce/infinityce.c4
-rw-r--r--keyboards/mechlovin/kanu/kanu.c16
-rw-r--r--keyboards/mechlovin/kay65/kay65.c2
-rw-r--r--keyboards/mechlovin/olly/bb/bb.c20
-rw-r--r--keyboards/mechlovin/olly/bb/matrix.c304
-rw-r--r--keyboards/mechlovin/olly/jf/rev1/matrix.c320
-rw-r--r--keyboards/mechlovin/olly/jf/rev1/rev1.c26
-rw-r--r--keyboards/mechlovin/olly/orion/orion.c20
-rw-r--r--keyboards/mechlovin/serratus/matrix.c292
-rw-r--r--keyboards/mechlovin/zed65/no_backlight/wearhaus66/wearhaus66.c2
-rw-r--r--keyboards/mechwild/puckbuddy/puckbuddy.c2
-rw-r--r--keyboards/mechwild/sugarglider/sugarglider.c24
-rw-r--r--keyboards/mexsistor/ludmila/matrix.c16
-rw-r--r--keyboards/miiiw/blackio83/rev_0100/matrix.c24
-rw-r--r--keyboards/miiiw/blackio83/rev_0100/rev_0100.c34
-rw-r--r--keyboards/miiiw/common/shift_register.c36
-rw-r--r--keyboards/mlego/m48/m48.h6
-rw-r--r--keyboards/mlego/m60/m60.h6
-rw-r--r--keyboards/mlego/m60_split/m60_split.h6
-rw-r--r--keyboards/mlego/m65/m65.h16
-rw-r--r--keyboards/mode/m65ha_alpha/m65ha_alpha.c6
-rw-r--r--keyboards/mode/m65hi_alpha/m65hi_alpha.c6
-rw-r--r--keyboards/mode/m65s/m65s.c6
-rw-r--r--keyboards/monsgeek/m3/m3.c14
-rw-r--r--keyboards/monsgeek/m5/m5.c6
-rw-r--r--keyboards/monstargear/xo87/solderable/solderable.c62
-rw-r--r--keyboards/neson_design/700e/700e.c6
-rw-r--r--keyboards/neson_design/n6/n6.c6
-rw-r--r--keyboards/nopunin10did/kastenwagen1840/kastenwagen1840.c24
-rw-r--r--keyboards/nopunin10did/kastenwagen48/kastenwagen48.c24
-rwxr-xr-xkeyboards/novelkeys/nk65b/nk65b.c4
-rw-r--r--keyboards/novelkeys/nk87b/nk87b.c4
-rw-r--r--keyboards/noxary/220/220.c4
-rw-r--r--keyboards/noxary/268_2/268_2.c4
-rw-r--r--keyboards/noxary/280/280.c8
-rw-r--r--keyboards/noxary/x268/x268.c4
-rw-r--r--keyboards/nullbitsco/common/bitc_led.c10
-rw-r--r--keyboards/nullbitsco/nibble/big_led.c24
-rw-r--r--keyboards/nullbitsco/nibble/matrix.c10
-rw-r--r--keyboards/nullbitsco/scramble/v1/v1.c10
-rw-r--r--keyboards/nullbitsco/snap/matrix.c14
-rw-r--r--keyboards/om60/matrix.c24
-rw-r--r--keyboards/opendeck/32/rev1/rev1.c6
-rw-r--r--keyboards/ortho5by12/ortho5by12.c8
-rw-r--r--keyboards/peej/lumberjack/lumberjack.c4
-rw-r--r--keyboards/peej/rosaline/rosaline.c4
-rw-r--r--keyboards/percent/canoe_gen2/canoe_gen2.c8
-rw-r--r--keyboards/pica40/rev2/rev2.c14
-rw-r--r--keyboards/planck/planck.c4
-rw-r--r--keyboards/planck/rev6_drop/matrix.c12
-rw-r--r--keyboards/planck/rev7/matrix.c26
-rw-r--r--keyboards/pom_keyboards/tnln95/tnln95.c12
-rw-r--r--keyboards/preonic/rev1/rev1.c4
-rw-r--r--keyboards/preonic/rev2/rev2.c4
-rw-r--r--keyboards/primekb/meridian/meridian.c4
-rw-r--r--keyboards/projectd/65/projectd_65_ansi/projectd_65_ansi.c6
-rw-r--r--keyboards/projectd/75/ansi/ansi.c6
-rw-r--r--keyboards/projectkb/alice/alice.c12
-rw-r--r--keyboards/protozoa/event_horizon/event_horizon.c2
-rw-r--r--keyboards/punk75/punk75.c4
-rw-r--r--keyboards/quad_h/lb75/lb75.c8
-rw-r--r--keyboards/qvex/lynepad/lynepad.c24
-rw-r--r--keyboards/qvex/lynepad2/matrix.c36
-rw-r--r--keyboards/rart/rartlite/rartlite.c4
-rw-r--r--keyboards/rate/pistachio_pro/matrix.c10
-rw-r--r--keyboards/redox/wireless/wireless.c16
-rw-r--r--keyboards/redox/wireless/wireless.h16
-rw-r--r--keyboards/redscarf_i/redscarf_i.c26
-rwxr-xr-xkeyboards/redscarf_iiplus/verb/matrix.c76
-rwxr-xr-xkeyboards/redscarf_iiplus/verc/matrix.c76
-rw-r--r--keyboards/redscarf_iiplus/verd/matrix.c76
-rw-r--r--keyboards/rmi_kb/wete/v1/v1.c12
-rwxr-xr-xkeyboards/rookiebwoy/neopad/rev1/rev1.c20
-rw-r--r--keyboards/rubi/rubi.c2
-rw-r--r--keyboards/ryanskidmore/rskeys100/matrix.c44
-rw-r--r--keyboards/sekigon/grs_70ec/ec_switch_matrix.c26
-rw-r--r--keyboards/sekigon/grs_70ec/grs_70ec.c10
-rw-r--r--keyboards/sergiopoverony/creator_pro/creator_pro.c14
-rw-r--r--keyboards/skyloong/gk61/pro/pro.c4
-rw-r--r--keyboards/skyloong/gk61/pro_48/pro_48.c4
-rw-r--r--keyboards/skyloong/gk61/v1/v1.c4
-rw-r--r--keyboards/smithrune/iron165r2/iron165r2.c6
-rw-r--r--keyboards/sneakbox/aliceclone/aliceclone.c12
-rw-r--r--keyboards/snes_macropad/matrix.c60
-rw-r--r--keyboards/splitkb/aurora/helix/rev1/rev1.c4
-rw-r--r--keyboards/sthlmkb/lagom/matrix.c10
-rw-r--r--keyboards/strech/soulstone/soulstone.c6
-rw-r--r--keyboards/switchplate/southpaw_65/southpaw_65.c4
-rw-r--r--keyboards/switchplate/southpaw_fullsize/southpaw_fullsize.c12
-rw-r--r--keyboards/team0110/p1800fl/p1800fl.c6
-rw-r--r--keyboards/technika/technika.c6
-rw-r--r--keyboards/telophase/telophase.c12
-rw-r--r--keyboards/telophase/telophase.h12
-rw-r--r--keyboards/tkc/m0lly/m0lly.c8
-rw-r--r--keyboards/tkc/osav2/osav2.c12
-rw-r--r--keyboards/tkc/tkc1800/tkc1800.c8
-rw-r--r--keyboards/torn/matrix.c12
-rw-r--r--keyboards/touchpad/matrix.c68
-rw-r--r--keyboards/tr60w/tr60w.c6
-rw-r--r--keyboards/tzarc/djinn/djinn.c44
-rw-r--r--keyboards/tzarc/djinn/djinn_portscan_matrix.c26
-rw-r--r--keyboards/tzarc/ghoul/ghoul.c12
-rw-r--r--keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/overnumpad_1xb.c10
-rw-r--r--keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/overnumpad_1xb.c10
-rw-r--r--keyboards/viktus/minne_topre/ec.c26
-rw-r--r--keyboards/viktus/osav2_numpad_topre/ec.c26
-rw-r--r--keyboards/viktus/osav2_topre/ec.c26
-rw-r--r--keyboards/viktus/sp111/matrix.c12
-rw-r--r--keyboards/viktus/sp111/sp111.c16
-rw-r--r--keyboards/viktus/sp111_v2/sp111_v2.c4
-rw-r--r--keyboards/viktus/sp_mini/sp_mini.c4
-rw-r--r--keyboards/viktus/styrka_topre/ec.c26
-rw-r--r--keyboards/vitamins_included/rev2/rev2.c6
-rw-r--r--keyboards/westfoxtrot/cypher/rev1/rev1.c8
-rw-r--r--keyboards/westfoxtrot/cypher/rev5/rev5.c8
-rw-r--r--keyboards/westfoxtrot/prophet/prophet.c8
-rw-r--r--keyboards/wilba_tech/wt60_xt/wt60_xt.c4
-rw-r--r--keyboards/wilba_tech/wt69_a/wt69_a.c4
-rw-r--r--keyboards/wilba_tech/wt70_jb/wt70_jb.c4
-rw-r--r--keyboards/wolfmarkclub/wm1/wm1.c12
-rw-r--r--keyboards/work_louder/micro/matrix.c12
-rw-r--r--keyboards/work_louder/micro/micro.c24
-rw-r--r--keyboards/work_louder/work_board/work_board.c12
-rw-r--r--keyboards/wsk/g4m3ralpha/g4m3ralpha.c18
-rw-r--r--keyboards/wuque/ikki68/ikki68.c4
-rw-r--r--keyboards/xiudi/xd75/xd75.c18
-rw-r--r--keyboards/ydkb/grape/matrix.c4
-rw-r--r--keyboards/ydkb/yd68/yd68.c16
-rw-r--r--keyboards/yiancardesigns/barleycorn/barleycorn.c10
-rw-r--r--keyboards/yiancardesigns/barleycorn/matrix.c12
-rw-r--r--keyboards/yiancardesigns/gingham/matrix.c12
-rw-r--r--keyboards/yiancardesigns/seigaiha/matrix.c12
-rw-r--r--keyboards/ymdk/yd60mq/yd60mq.c8
-rw-r--r--keyboards/zsa/moonlander/matrix.c64
-rw-r--r--keyboards/zsa/moonlander/moonlander.c12
-rw-r--r--keyboards/zsa/moonlander/moonlander.h6
390 files changed, 3914 insertions, 3915 deletions
diff --git a/keyboards/3w6/rev1/matrix.c b/keyboards/3w6/rev1/matrix.c
index aa3e43fbe0..0c06a743a1 100644
--- a/keyboards/3w6/rev1/matrix.c
+++ b/keyboards/3w6/rev1/matrix.c
@@ -165,8 +165,8 @@ static void init_cols(void) {
165 pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_L; 165 pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_L;
166 for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) { 166 for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) {
167 pin_t pin = matrix_col_pins_mcu[pin_index]; 167 pin_t pin = matrix_col_pins_mcu[pin_index];
168 setPinInput(pin); 168 gpio_set_pin_input(pin);
169 writePinHigh(pin); 169 gpio_write_pin_high(pin);
170 } 170 }
171} 171}
172 172
@@ -177,7 +177,7 @@ static matrix_row_t read_cols(uint8_t row) {
177 // For each col... 177 // For each col...
178 for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) { 178 for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) {
179 // Select the col pin to read (active low) 179 // Select the col pin to read (active low)
180 uint8_t pin_state = readPin(matrix_col_pins_mcu[col_index]); 180 uint8_t pin_state = gpio_read_pin(matrix_col_pins_mcu[col_index]);
181 181
182 // Populate the matrix row with the state of the col pin 182 // Populate the matrix row with the state of the col pin
183 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 183 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -223,8 +223,8 @@ static void unselect_rows(void) {
223 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; 223 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L;
224 for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) { 224 for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) {
225 pin_t pin = matrix_row_pins_mcu[pin_index]; 225 pin_t pin = matrix_row_pins_mcu[pin_index];
226 setPinInput(pin); 226 gpio_set_pin_input(pin);
227 writePinLow(pin); 227 gpio_write_pin_low(pin);
228 } 228 }
229} 229}
230 230
@@ -236,8 +236,8 @@ static void select_row(uint8_t row) {
236 // select on atmega32u4 236 // select on atmega32u4
237 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; 237 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L;
238 pin_t pin = matrix_row_pins_mcu[row]; 238 pin_t pin = matrix_row_pins_mcu[row];
239 setPinOutput(pin); 239 gpio_set_pin_output(pin);
240 writePinLow(pin); 240 gpio_write_pin_low(pin);
241 } else { 241 } else {
242 // select on tca9555 242 // select on tca9555
243 if (tca9555_status) { // if there was an error 243 if (tca9555_status) { // if there was an error
diff --git a/keyboards/3w6/rev2/matrix.c b/keyboards/3w6/rev2/matrix.c
index da7a5344e5..8c628215aa 100644
--- a/keyboards/3w6/rev2/matrix.c
+++ b/keyboards/3w6/rev2/matrix.c
@@ -165,8 +165,8 @@ static void init_cols(void) {
165 pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_L; 165 pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_L;
166 for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) { 166 for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) {
167 pin_t pin = matrix_col_pins_mcu[pin_index]; 167 pin_t pin = matrix_col_pins_mcu[pin_index];
168 setPinInput(pin); 168 gpio_set_pin_input(pin);
169 writePinHigh(pin); 169 gpio_write_pin_high(pin);
170 } 170 }
171} 171}
172 172
@@ -177,7 +177,7 @@ static matrix_row_t read_cols(uint8_t row) {
177 // For each col... 177 // For each col...
178 for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) { 178 for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) {
179 // Select the col pin to read (active low) 179 // Select the col pin to read (active low)
180 uint8_t pin_state = readPin(matrix_col_pins_mcu[col_index]); 180 uint8_t pin_state = gpio_read_pin(matrix_col_pins_mcu[col_index]);
181 181
182 // Populate the matrix row with the state of the col pin 182 // Populate the matrix row with the state of the col pin
183 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 183 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -221,8 +221,8 @@ static void unselect_rows(void) {
221 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; 221 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L;
222 for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) { 222 for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) {
223 pin_t pin = matrix_row_pins_mcu[pin_index]; 223 pin_t pin = matrix_row_pins_mcu[pin_index];
224 setPinInput(pin); 224 gpio_set_pin_input(pin);
225 writePinLow(pin); 225 gpio_write_pin_low(pin);
226 } 226 }
227} 227}
228 228
@@ -233,8 +233,8 @@ static void select_row(uint8_t row) {
233 // select on atmega32u4 233 // select on atmega32u4
234 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; 234 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L;
235 pin_t pin = matrix_row_pins_mcu[row]; 235 pin_t pin = matrix_row_pins_mcu[row];
236 setPinOutput(pin); 236 gpio_set_pin_output(pin);
237 writePinLow(pin); 237 gpio_write_pin_low(pin);
238 } else { 238 } else {
239 // select on tca9555 239 // select on tca9555
240 if (tca9555_status) { // if there was an error 240 if (tca9555_status) { // if there was an error
diff --git a/keyboards/40percentclub/4pack/4pack.c b/keyboards/40percentclub/4pack/4pack.c
index bd2efa5620..044ce45681 100644
--- a/keyboards/40percentclub/4pack/4pack.c
+++ b/keyboards/40percentclub/4pack/4pack.c
@@ -23,8 +23,8 @@ void matrix_init_kb(void) {
23 // put your keyboard start-up code here 23 // put your keyboard start-up code here
24 // runs once when the firmware starts up 24 // runs once when the firmware starts up
25 25
26 setPinOutput(F4); // cathodes 26 gpio_set_pin_output(F4); // cathodes
27 setPinOutput(F5); // cathodes 27 gpio_set_pin_output(F5); // cathodes
28 28
29 // Do the rest 29 // Do the rest
30 matrix_init_user(); 30 matrix_init_user();
diff --git a/keyboards/40percentclub/sixpack/sixpack.c b/keyboards/40percentclub/sixpack/sixpack.c
index c8c7bad444..fa7609c97f 100644
--- a/keyboards/40percentclub/sixpack/sixpack.c
+++ b/keyboards/40percentclub/sixpack/sixpack.c
@@ -16,9 +16,9 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 setPinOutput(B6); // Backlight cathodes Col.3 19 gpio_set_pin_output(B6); // Backlight cathodes Col.3
20 setPinOutput(F6); // Backlight cathodes Col.2 20 gpio_set_pin_output(F6); // Backlight cathodes Col.2
21 setPinOutput(F7); // Backlight cathodes Col.1 21 gpio_set_pin_output(F7); // Backlight cathodes Col.1
22 22
23 matrix_init_user(); 23 matrix_init_user();
24} 24}
diff --git a/keyboards/4pplet/eagle_viper_rep/rev_a/rev_a.c b/keyboards/4pplet/eagle_viper_rep/rev_a/rev_a.c
index 2971460bd2..4586044a94 100644
--- a/keyboards/4pplet/eagle_viper_rep/rev_a/rev_a.c
+++ b/keyboards/4pplet/eagle_viper_rep/rev_a/rev_a.c
@@ -17,9 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
17#include "rev_a.h" 17#include "rev_a.h"
18 18
19void board_init(void) { 19void board_init(void) {
20 setPinInputHigh(CAPS_PIN); 20 gpio_set_pin_input_high(CAPS_PIN);
21 setPinInputHigh(SCROLL_PIN); 21 gpio_set_pin_input_high(SCROLL_PIN);
22 setPinInputHigh(NUM_PIN); 22 gpio_set_pin_input_high(NUM_PIN);
23} 23}
24 24
25/* Set indicator leds to indicate lock states */ 25/* Set indicator leds to indicate lock states */
@@ -27,23 +27,23 @@ bool led_update_kb(led_t led_state) {
27 bool res = led_update_user(led_state); 27 bool res = led_update_user(led_state);
28 if(res && LOCK_LIGHTS) { 28 if(res && LOCK_LIGHTS) {
29 if(led_state.caps_lock){ 29 if(led_state.caps_lock){
30 setPinOutput(CAPS_PIN); 30 gpio_set_pin_output(CAPS_PIN);
31 writePin(CAPS_PIN, 0); 31 gpio_write_pin(CAPS_PIN, 0);
32 } 32 }
33 else 33 else
34 setPinInputHigh(CAPS_PIN); 34 gpio_set_pin_input_high(CAPS_PIN);
35 if(led_state.scroll_lock){ 35 if(led_state.scroll_lock){
36 setPinOutput(SCROLL_PIN); 36 gpio_set_pin_output(SCROLL_PIN);
37 writePin(SCROLL_PIN, 0); 37 gpio_write_pin(SCROLL_PIN, 0);
38 } 38 }
39 else 39 else
40 setPinInputHigh(SCROLL_PIN); 40 gpio_set_pin_input_high(SCROLL_PIN);
41 if(led_state.num_lock){ 41 if(led_state.num_lock){
42 setPinOutput(NUM_PIN); 42 gpio_set_pin_output(NUM_PIN);
43 writePin(NUM_PIN, 0); 43 gpio_write_pin(NUM_PIN, 0);
44 } 44 }
45 else 45 else
46 setPinInputHigh(NUM_PIN); 46 gpio_set_pin_input_high(NUM_PIN);
47 } 47 }
48 return res; 48 return res;
49} 49}
@@ -59,50 +59,50 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
59void setLayerLed(layer_state_t state){ 59void setLayerLed(layer_state_t state){
60 switch(get_highest_layer(state)){ 60 switch(get_highest_layer(state)){
61 case 0 : 61 case 0 :
62 setPinOutput(LAYER_1); 62 gpio_set_pin_output(LAYER_1);
63 writePin(LAYER_1, 0); 63 gpio_write_pin(LAYER_1, 0);
64 setPinInputHigh(LAYER_2); 64 gpio_set_pin_input_high(LAYER_2);
65 setPinInputHigh(LAYER_3); 65 gpio_set_pin_input_high(LAYER_3);
66 setPinInputHigh(LAYER_4); 66 gpio_set_pin_input_high(LAYER_4);
67 setPinInputHigh(LAYER_5); 67 gpio_set_pin_input_high(LAYER_5);
68 break; 68 break;
69 case 1 : 69 case 1 :
70 setPinOutput(LAYER_2); 70 gpio_set_pin_output(LAYER_2);
71 writePin(LAYER_2, 0); 71 gpio_write_pin(LAYER_2, 0);
72 setPinInputHigh(LAYER_1); 72 gpio_set_pin_input_high(LAYER_1);
73 setPinInputHigh(LAYER_3); 73 gpio_set_pin_input_high(LAYER_3);
74 setPinInputHigh(LAYER_4); 74 gpio_set_pin_input_high(LAYER_4);
75 setPinInputHigh(LAYER_5); 75 gpio_set_pin_input_high(LAYER_5);
76 break; 76 break;
77 case 2 : 77 case 2 :
78 setPinOutput(LAYER_3); 78 gpio_set_pin_output(LAYER_3);
79 writePin(LAYER_3, 0); 79 gpio_write_pin(LAYER_3, 0);
80 setPinInputHigh(LAYER_1); 80 gpio_set_pin_input_high(LAYER_1);
81 setPinInputHigh(LAYER_2); 81 gpio_set_pin_input_high(LAYER_2);
82 setPinInputHigh(LAYER_4); 82 gpio_set_pin_input_high(LAYER_4);
83 setPinInputHigh(LAYER_5); 83 gpio_set_pin_input_high(LAYER_5);
84 break; 84 break;
85 case 3 : 85 case 3 :
86 writePin(LAYER_4, 0); 86 gpio_write_pin(LAYER_4, 0);
87 setPinInputHigh(LAYER_5); 87 gpio_set_pin_input_high(LAYER_5);
88 setPinInputHigh(LAYER_1); 88 gpio_set_pin_input_high(LAYER_1);
89 setPinInputHigh(LAYER_2); 89 gpio_set_pin_input_high(LAYER_2);
90 setPinInputHigh(LAYER_3); 90 gpio_set_pin_input_high(LAYER_3);
91 setPinOutput(LAYER_4); 91 gpio_set_pin_output(LAYER_4);
92 break; 92 break;
93 case 4 : 93 case 4 :
94 setPinOutput(LAYER_5); 94 gpio_set_pin_output(LAYER_5);
95 writePin(LAYER_5, 0); 95 gpio_write_pin(LAYER_5, 0);
96 setPinInputHigh(LAYER_1); 96 gpio_set_pin_input_high(LAYER_1);
97 setPinInputHigh(LAYER_2); 97 gpio_set_pin_input_high(LAYER_2);
98 setPinInputHigh(LAYER_3); 98 gpio_set_pin_input_high(LAYER_3);
99 setPinInputHigh(LAYER_4); 99 gpio_set_pin_input_high(LAYER_4);
100 break; 100 break;
101 default : 101 default :
102 setPinInputHigh(LAYER_1); 102 gpio_set_pin_input_high(LAYER_1);
103 setPinInputHigh(LAYER_2); 103 gpio_set_pin_input_high(LAYER_2);
104 setPinInputHigh(LAYER_3); 104 gpio_set_pin_input_high(LAYER_3);
105 setPinInputHigh(LAYER_4); 105 gpio_set_pin_input_high(LAYER_4);
106 setPinInputHigh(LAYER_5); 106 gpio_set_pin_input_high(LAYER_5);
107 } 107 }
108} 108}
diff --git a/keyboards/4pplet/eagle_viper_rep/rev_b/rev_b.c b/keyboards/4pplet/eagle_viper_rep/rev_b/rev_b.c
index 2e71e34a26..ab052790c3 100644
--- a/keyboards/4pplet/eagle_viper_rep/rev_b/rev_b.c
+++ b/keyboards/4pplet/eagle_viper_rep/rev_b/rev_b.c
@@ -17,11 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
17#include "rev_b.h" 17#include "rev_b.h"
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 setPinOutput(LAYER_1); 20 gpio_set_pin_output(LAYER_1);
21 setPinOutput(LAYER_2); 21 gpio_set_pin_output(LAYER_2);
22 setPinOutput(LAYER_3); 22 gpio_set_pin_output(LAYER_3);
23 setPinOutput(LAYER_4); 23 gpio_set_pin_output(LAYER_4);
24 setPinOutput(LAYER_5); 24 gpio_set_pin_output(LAYER_5);
25 keyboard_pre_init_user(); 25 keyboard_pre_init_user();
26} 26}
27 27
@@ -32,26 +32,26 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
32} 32}
33/* Set indicator leds to indicate which layer is active */ 33/* Set indicator leds to indicate which layer is active */
34void setLayerLed(layer_state_t state){ 34void setLayerLed(layer_state_t state){
35 writePinLow(LAYER_1); 35 gpio_write_pin_low(LAYER_1);
36 writePinLow(LAYER_2); 36 gpio_write_pin_low(LAYER_2);
37 writePinLow(LAYER_3); 37 gpio_write_pin_low(LAYER_3);
38 writePinLow(LAYER_4); 38 gpio_write_pin_low(LAYER_4);
39 writePinLow(LAYER_5); 39 gpio_write_pin_low(LAYER_5);
40 switch (get_highest_layer(state)) { 40 switch (get_highest_layer(state)) {
41 case 0: 41 case 0:
42 writePinHigh(LAYER_1); 42 gpio_write_pin_high(LAYER_1);
43 break; 43 break;
44 case 1: 44 case 1:
45 writePinHigh(LAYER_2); 45 gpio_write_pin_high(LAYER_2);
46 break; 46 break;
47 case 2: 47 case 2:
48 writePinHigh(LAYER_3); 48 gpio_write_pin_high(LAYER_3);
49 break; 49 break;
50 case 3: 50 case 3:
51 writePinHigh(LAYER_4); 51 gpio_write_pin_high(LAYER_4);
52 break; 52 break;
53 case 4: 53 case 4:
54 writePinHigh(LAYER_5); 54 gpio_write_pin_high(LAYER_5);
55 break; 55 break;
56 } 56 }
57} 57}
diff --git a/keyboards/acheron/apollo/87h/delta/delta.c b/keyboards/acheron/apollo/87h/delta/delta.c
index 1e79584a9c..b17fce5c3a 100644
--- a/keyboards/acheron/apollo/87h/delta/delta.c
+++ b/keyboards/acheron/apollo/87h/delta/delta.c
@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "quantum.h" 18#include "quantum.h"
19 19
20void board_init(void) { 20void board_init(void) {
21 setPinInput(B9); 21 gpio_set_pin_input(B9);
22 setPinInput(B10); 22 gpio_set_pin_input(B10);
23} 23}
24 24
25led_config_t g_led_config = { { 25led_config_t g_led_config = { {
diff --git a/keyboards/acheron/apollo/87htsc/87htsc.c b/keyboards/acheron/apollo/87htsc/87htsc.c
index de66897f72..4225c34971 100644
--- a/keyboards/acheron/apollo/87htsc/87htsc.c
+++ b/keyboards/acheron/apollo/87htsc/87htsc.c
@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "quantum.h" 18#include "quantum.h"
19 19
20void board_init(void) { 20void board_init(void) {
21 setPinInput(B9); 21 gpio_set_pin_input(B9);
22 setPinInput(B10); 22 gpio_set_pin_input(B10);
23} 23}
24 24
25led_config_t g_led_config = { { 25led_config_t g_led_config = { {
diff --git a/keyboards/acheron/athena/alpha/alpha.c b/keyboards/acheron/athena/alpha/alpha.c
index 9e4f82f7ad..8fe47eff82 100644
--- a/keyboards/acheron/athena/alpha/alpha.c
+++ b/keyboards/acheron/athena/alpha/alpha.c
@@ -17,8 +17,8 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void board_init(void) { 19void board_init(void) {
20 setPinInput(B6); 20 gpio_set_pin_input(B6);
21 setPinInput(B7); 21 gpio_set_pin_input(B7);
22} 22}
23 23
24void keyboard_post_init_kb(void){ 24void keyboard_post_init_kb(void){
@@ -34,10 +34,10 @@ bool led_update_kb(led_t led_state) {
34 bool res = led_update_user(led_state); 34 bool res = led_update_user(led_state);
35 #ifdef CAPSLOCK_INDICATOR 35 #ifdef CAPSLOCK_INDICATOR
36 if(res) { 36 if(res) {
37 writePin(LED_CAPS_LOCK_PIN, !led_state.caps_lock); 37 gpio_write_pin(LED_CAPS_LOCK_PIN, !led_state.caps_lock);
38 } 38 }
39 #else 39 #else
40 writePin(LED_CAPS_LOCK_PIN, 0); 40 gpio_write_pin(LED_CAPS_LOCK_PIN, 0);
41 #endif 41 #endif
42 return res; 42 return res;
43} 43}
diff --git a/keyboards/acheron/athena/beta/beta.c b/keyboards/acheron/athena/beta/beta.c
index 9ad9c71cc8..fe22128437 100644
--- a/keyboards/acheron/athena/beta/beta.c
+++ b/keyboards/acheron/athena/beta/beta.c
@@ -17,18 +17,18 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void board_init(void) { 19void board_init(void) {
20 setPinInput(B6); 20 gpio_set_pin_input(B6);
21 setPinInput(B7); 21 gpio_set_pin_input(B7);
22} 22}
23 23
24bool led_update_kb(led_t led_state) { 24bool led_update_kb(led_t led_state) {
25 bool res = led_update_user(led_state); 25 bool res = led_update_user(led_state);
26 #ifdef CAPSLOCK_INDICATOR 26 #ifdef CAPSLOCK_INDICATOR
27 if(res) { 27 if(res) {
28 writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); 28 gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
29 } 29 }
30 #else 30 #else
31 writePin(LED_CAPS_LOCK_PIN, 0); 31 gpio_write_pin(LED_CAPS_LOCK_PIN, 0);
32 #endif 32 #endif
33 return res; 33 return res;
34} 34}
diff --git a/keyboards/acheron/austin/austin.c b/keyboards/acheron/austin/austin.c
index 5c0a4f642d..9a69d1c086 100644
--- a/keyboards/acheron/austin/austin.c
+++ b/keyboards/acheron/austin/austin.c
@@ -1,18 +1,18 @@
1#include "quantum.h" 1#include "quantum.h"
2 2
3void keyboard_pre_init_kb(void) { 3void keyboard_pre_init_kb(void) {
4 setPinOutput(A0); 4 gpio_set_pin_output(A0);
5 setPinOutput(A1); 5 gpio_set_pin_output(A1);
6 setPinOutput(A2); 6 gpio_set_pin_output(A2);
7 7
8 keyboard_pre_init_user(); 8 keyboard_pre_init_user();
9} 9}
10 10
11bool led_update_kb(led_t led_state) { 11bool led_update_kb(led_t led_state) {
12 if (led_update_user(led_state)) { 12 if (led_update_user(led_state)) {
13 writePin(A2, led_state.num_lock); 13 gpio_write_pin(A2, led_state.num_lock);
14 writePin(A0, led_state.caps_lock); 14 gpio_write_pin(A0, led_state.caps_lock);
15 writePin(A1, led_state.scroll_lock); 15 gpio_write_pin(A1, led_state.scroll_lock);
16 } 16 }
17 return true; 17 return true;
18} 18}
diff --git a/keyboards/acheron/elongate/delta/delta.c b/keyboards/acheron/elongate/delta/delta.c
index e621b4495b..98b60bae61 100755
--- a/keyboards/acheron/elongate/delta/delta.c
+++ b/keyboards/acheron/elongate/delta/delta.c
@@ -30,18 +30,18 @@ void led_init_ports(void) {
30bool led_update_kb(led_t led_state) { 30bool led_update_kb(led_t led_state) {
31 bool res = led_update_user(led_state); 31 bool res = led_update_user(led_state);
32 if(res) { 32 if(res) {
33 writePin(LED1_PIN, !led_state.num_lock); 33 gpio_write_pin(LED1_PIN, !led_state.num_lock);
34 writePin(LED2_PIN, !led_state.caps_lock); 34 gpio_write_pin(LED2_PIN, !led_state.caps_lock);
35 writePin(LED3_PIN, !led_state.scroll_lock); 35 gpio_write_pin(LED3_PIN, !led_state.scroll_lock);
36 } 36 }
37 return res; 37 return res;
38} 38}
39 39
40// Turns off all bottom LEDs 40// Turns off all bottom LEDs
41void turn_off_bottom_leds(void){ 41void turn_off_bottom_leds(void){
42 writePin(LED4_PIN, 1); 42 gpio_write_pin(LED4_PIN, 1);
43 writePin(LED5_PIN, 1); 43 gpio_write_pin(LED5_PIN, 1);
44 writePin(LED6_PIN, 1); 44 gpio_write_pin(LED6_PIN, 1);
45} 45}
46 46
47/* 47/*
@@ -53,19 +53,19 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
53 switch (get_highest_layer(state)) { 53 switch (get_highest_layer(state)) {
54// The base layer, or layer zero, will be handled by the default case. 54// The base layer, or layer zero, will be handled by the default case.
55 case 1: 55 case 1:
56 writePin(LED4_PIN, 1); 56 gpio_write_pin(LED4_PIN, 1);
57 writePin(LED5_PIN, 0); 57 gpio_write_pin(LED5_PIN, 0);
58 writePin(LED6_PIN, 1); 58 gpio_write_pin(LED6_PIN, 1);
59 break; 59 break;
60 case 2: 60 case 2:
61 writePin(LED4_PIN, 1); 61 gpio_write_pin(LED4_PIN, 1);
62 writePin(LED5_PIN, 1); 62 gpio_write_pin(LED5_PIN, 1);
63 writePin(LED6_PIN, 0); 63 gpio_write_pin(LED6_PIN, 0);
64 break; 64 break;
65 default: 65 default:
66 writePin(LED4_PIN, 0); 66 gpio_write_pin(LED4_PIN, 0);
67 writePin(LED5_PIN, 1); 67 gpio_write_pin(LED5_PIN, 1);
68 writePin(LED6_PIN, 1); 68 gpio_write_pin(LED6_PIN, 1);
69 break; 69 break;
70 } 70 }
71 return state; 71 return state;
@@ -73,5 +73,5 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
73 73
74// Since the keyboard starts at layer 0, the init function starts LED4 as lit up. 74// Since the keyboard starts at layer 0, the init function starts LED4 as lit up.
75void keyboard_post_init_kb(void){ 75void keyboard_post_init_kb(void){
76 writePin(LED4_PIN, 0); 76 gpio_write_pin(LED4_PIN, 0);
77} 77}
diff --git a/keyboards/acheron/shark/beta/beta.c b/keyboards/acheron/shark/beta/beta.c
index 5592353ad7..647dac60b7 100644
--- a/keyboards/acheron/shark/beta/beta.c
+++ b/keyboards/acheron/shark/beta/beta.c
@@ -17,6 +17,6 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void board_init(void) { 19void board_init(void) {
20 setPinInput(B6); 20 gpio_set_pin_input(B6);
21 setPinInput(B7); 21 gpio_set_pin_input(B7);
22} 22}
diff --git a/keyboards/aeboards/ext65/rev1/rev1.c b/keyboards/aeboards/ext65/rev1/rev1.c
index adbae94816..344a2bcb32 100644
--- a/keyboards/aeboards/ext65/rev1/rev1.c
+++ b/keyboards/aeboards/ext65/rev1/rev1.c
@@ -19,18 +19,18 @@
19void keyboard_pre_init_user(void) { 19void keyboard_pre_init_user(void) {
20 // Call the keyboard pre init code. 20 // Call the keyboard pre init code.
21 // Set our LED pins as output 21 // Set our LED pins as output
22 setPinOutput(D5); 22 gpio_set_pin_output(D5);
23 setPinOutput(D3); 23 gpio_set_pin_output(D3);
24 setPinOutput(D2); 24 gpio_set_pin_output(D2);
25 setPinOutput(D1); 25 gpio_set_pin_output(D1);
26} 26}
27 27
28bool led_update_kb(led_t led_state) { 28bool led_update_kb(led_t led_state) {
29 bool res = led_update_user(led_state); 29 bool res = led_update_user(led_state);
30 if(res) { 30 if(res) {
31 writePin(D5, led_state.num_lock); 31 gpio_write_pin(D5, led_state.num_lock);
32 writePin(D3, led_state.caps_lock); 32 gpio_write_pin(D3, led_state.caps_lock);
33 writePin(D2, led_state.scroll_lock); 33 gpio_write_pin(D2, led_state.scroll_lock);
34 } 34 }
35 return res; 35 return res;
36} 36}
@@ -38,10 +38,10 @@ bool led_update_kb(led_t led_state) {
38layer_state_t layer_state_set_kb(layer_state_t state) { 38layer_state_t layer_state_set_kb(layer_state_t state) {
39 switch (get_highest_layer(state)) { 39 switch (get_highest_layer(state)) {
40 case 1: 40 case 1:
41 writePinHigh(D1); 41 gpio_write_pin_high(D1);
42 break; 42 break;
43 default: // for any other layers, or the default layer 43 default: // for any other layers, or the default layer
44 writePinLow(D1); 44 gpio_write_pin_low(D1);
45 break; 45 break;
46 } 46 }
47 return layer_state_set_user(state); 47 return layer_state_set_user(state);
diff --git a/keyboards/aeboards/ext65/rev2/rev2.c b/keyboards/aeboards/ext65/rev2/rev2.c
index 934553abcf..5922b601cd 100644
--- a/keyboards/aeboards/ext65/rev2/rev2.c
+++ b/keyboards/aeboards/ext65/rev2/rev2.c
@@ -71,10 +71,10 @@ bool oled_task_kb(void) {
71void keyboard_pre_init_kb(void) { 71void keyboard_pre_init_kb(void) {
72 // Call the keyboard pre init code. 72 // Call the keyboard pre init code.
73 // Set our LED pins as output 73 // Set our LED pins as output
74 setPinOutput(B4); 74 gpio_set_pin_output(B4);
75 setPinOutput(B3); 75 gpio_set_pin_output(B3);
76 setPinOutput(A15); 76 gpio_set_pin_output(A15);
77 setPinOutput(A14); 77 gpio_set_pin_output(A14);
78 78
79 keyboard_pre_init_user(); 79 keyboard_pre_init_user();
80} 80}
@@ -82,9 +82,9 @@ void keyboard_pre_init_kb(void) {
82bool led_update_kb(led_t led_state) { 82bool led_update_kb(led_t led_state) {
83 bool res = led_update_user(led_state); 83 bool res = led_update_user(led_state);
84 if (res) { 84 if (res) {
85 writePin(B4, led_state.num_lock); 85 gpio_write_pin(B4, led_state.num_lock);
86 writePin(B3, led_state.caps_lock); 86 gpio_write_pin(B3, led_state.caps_lock);
87 writePin(A15, led_state.scroll_lock); 87 gpio_write_pin(A15, led_state.scroll_lock);
88 } 88 }
89 return res; 89 return res;
90} 90}
@@ -92,10 +92,10 @@ bool led_update_kb(led_t led_state) {
92layer_state_t layer_state_set_kb(layer_state_t state) { 92layer_state_t layer_state_set_kb(layer_state_t state) {
93 switch (get_highest_layer(state)) { 93 switch (get_highest_layer(state)) {
94 case 1: 94 case 1:
95 writePinHigh(A14); 95 gpio_write_pin_high(A14);
96 break; 96 break;
97 default: // for any other layers, or the default layer 97 default: // for any other layers, or the default layer
98 writePinLow(A14); 98 gpio_write_pin_low(A14);
99 break; 99 break;
100 } 100 }
101 return layer_state_set_user(state); 101 return layer_state_set_user(state);
diff --git a/keyboards/aeboards/ext65/rev3/rev3.c b/keyboards/aeboards/ext65/rev3/rev3.c
index b5e27756ec..f8fc2ef502 100644
--- a/keyboards/aeboards/ext65/rev3/rev3.c
+++ b/keyboards/aeboards/ext65/rev3/rev3.c
@@ -22,16 +22,16 @@ void matrix_io_delay(void) { __asm__ volatile("nop\nnop\nnop\n"); }
22void keyboard_pre_init_user(void) { 22void keyboard_pre_init_user(void) {
23 // Call the keyboard pre init code. 23 // Call the keyboard pre init code.
24 // Set our LED pins as output 24 // Set our LED pins as output
25 setPinOutput(LED_LAYERS_PIN); 25 gpio_set_pin_output(LED_LAYERS_PIN);
26} 26}
27 27
28layer_state_t layer_state_set_kb(layer_state_t state) { 28layer_state_t layer_state_set_kb(layer_state_t state) {
29 switch (get_highest_layer(state)) { 29 switch (get_highest_layer(state)) {
30 case 1: 30 case 1:
31 writePinHigh(LED_LAYERS_PIN); 31 gpio_write_pin_high(LED_LAYERS_PIN);
32 break; 32 break;
33 default: // for any other layers, or the default layer 33 default: // for any other layers, or the default layer
34 writePinLow(LED_LAYERS_PIN); 34 gpio_write_pin_low(LED_LAYERS_PIN);
35 break; 35 break;
36 } 36 }
37 return layer_state_set_user(state); 37 return layer_state_set_user(state);
diff --git a/keyboards/ai03/orbit/orbit.c b/keyboards/ai03/orbit/orbit.c
index 5097f9cd90..0c1e0dc32e 100644
--- a/keyboards/ai03/orbit/orbit.c
+++ b/keyboards/ai03/orbit/orbit.c
@@ -19,13 +19,13 @@
19void led_init_ports(void) { 19void led_init_ports(void) {
20 // Initialize indicator LEDs to output 20 // Initialize indicator LEDs to output
21 if (isLeftHand) { 21 if (isLeftHand) {
22 setPinOutput(C6); 22 gpio_set_pin_output(C6);
23 setPinOutput(B6); 23 gpio_set_pin_output(B6);
24 setPinOutput(B5); 24 gpio_set_pin_output(B5);
25 } else { 25 } else {
26 setPinOutput(F6); 26 gpio_set_pin_output(F6);
27 setPinOutput(F7); 27 gpio_set_pin_output(F7);
28 setPinOutput(C7); 28 gpio_set_pin_output(C7);
29 } 29 }
30 30
31 set_layer_indicators(0); 31 set_layer_indicators(0);
@@ -40,15 +40,15 @@ void led_toggle(uint8_t id, bool on) {
40 switch (id) { 40 switch (id) {
41 case 0: 41 case 0:
42 // Left hand C6 42 // Left hand C6
43 writePin(C6, on); 43 gpio_write_pin(C6, on);
44 break; 44 break;
45 case 1: 45 case 1:
46 // Left hand B6 46 // Left hand B6
47 writePin(B6, on); 47 gpio_write_pin(B6, on);
48 break; 48 break;
49 case 2: 49 case 2:
50 // Left hand B5 50 // Left hand B5
51 writePin(B5, on); 51 gpio_write_pin(B5, on);
52 break; 52 break;
53 default: 53 default:
54 break; 54 break;
@@ -57,15 +57,15 @@ void led_toggle(uint8_t id, bool on) {
57 switch (id) { 57 switch (id) {
58 case 3: 58 case 3:
59 // Right hand F6 59 // Right hand F6
60 writePin(F6, on); 60 gpio_write_pin(F6, on);
61 break; 61 break;
62 case 4: 62 case 4:
63 // Right hand F7 63 // Right hand F7
64 writePin(F7, on); 64 gpio_write_pin(F7, on);
65 break; 65 break;
66 case 5: 66 case 5:
67 // Right hand C7 67 // Right hand C7
68 writePin(C7, on); 68 gpio_write_pin(C7, on);
69 break; 69 break;
70 default: 70 default:
71 break; 71 break;
diff --git a/keyboards/ai03/vega/vega.c b/keyboards/ai03/vega/vega.c
index 6ed1651e50..44ded2c85c 100644
--- a/keyboards/ai03/vega/vega.c
+++ b/keyboards/ai03/vega/vega.c
@@ -19,8 +19,8 @@
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 // Initialize indicator LEDs to output 20 // Initialize indicator LEDs to output
21 21
22 setPinOutput(B7); // Caps 22 gpio_set_pin_output(B7); // Caps
23 setPinOutput(A5); // Slck 23 gpio_set_pin_output(A5); // Slck
24 24
25 matrix_init_user(); 25 matrix_init_user();
26} 26}
@@ -30,8 +30,8 @@ bool led_update_kb(led_t led_state) {
30 bool res = led_update_user(led_state); 30 bool res = led_update_user(led_state);
31 31
32 if(res) { 32 if(res) {
33 writePin(B7, !led_state.caps_lock); 33 gpio_write_pin(B7, !led_state.caps_lock);
34 writePin(A5, !led_state.scroll_lock); 34 gpio_write_pin(A5, !led_state.scroll_lock);
35 } 35 }
36 return res; 36 return res;
37} \ No newline at end of file 37} \ No newline at end of file
diff --git a/keyboards/akko/5087/5087.c b/keyboards/akko/5087/5087.c
index 7dd614b456..746a9a7816 100644
--- a/keyboards/akko/5087/5087.c
+++ b/keyboards/akko/5087/5087.c
@@ -137,17 +137,17 @@ enum __layers {
137// clang-format on 137// clang-format on
138 138
139void matrix_init_kb(void) { 139void matrix_init_kb(void) {
140 setPinOutput(LED_MAC_OS_PIN); // LDE2 MAC\WIN 140 gpio_set_pin_output(LED_MAC_OS_PIN); // LDE2 MAC\WIN
141 writePinLow(LED_MAC_OS_PIN); 141 gpio_write_pin_low(LED_MAC_OS_PIN);
142 setPinOutput(LED_WIN_LOCK_PIN); // LED3 Win Lock 142 gpio_set_pin_output(LED_WIN_LOCK_PIN); // LED3 Win Lock
143 writePinLow(LED_WIN_LOCK_PIN); 143 gpio_write_pin_low(LED_WIN_LOCK_PIN);
144 144
145 matrix_init_user(); 145 matrix_init_user();
146} 146}
147 147
148void housekeeping_task_kb(void){ 148void housekeeping_task_kb(void){
149 writePin(LED_MAC_OS_PIN, (get_highest_layer(default_layer_state) == 3)); 149 gpio_write_pin(LED_MAC_OS_PIN, (get_highest_layer(default_layer_state) == 3));
150 writePin(LED_WIN_LOCK_PIN, keymap_config.no_gui); 150 gpio_write_pin(LED_WIN_LOCK_PIN, keymap_config.no_gui);
151} 151}
152 152
153bool process_record_kb(uint16_t keycode, keyrecord_t* record) { 153bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
diff --git a/keyboards/akko/5108/5108.c b/keyboards/akko/5108/5108.c
index 91526289b6..7330707f45 100644
--- a/keyboards/akko/5108/5108.c
+++ b/keyboards/akko/5108/5108.c
@@ -148,15 +148,15 @@ const snled27351_led_t PROGMEM g_snled27351_leds[SNLED27351_LED_COUNT] = {
148#endif 148#endif
149 149
150void keyboard_pre_init_kb(void) { 150void keyboard_pre_init_kb(void) {
151 setPinOutput(LED_WIN_LOCK_PIN); // LED3 Win Lock 151 gpio_set_pin_output(LED_WIN_LOCK_PIN); // LED3 Win Lock
152 writePinLow(LED_WIN_LOCK_PIN); 152 gpio_write_pin_low(LED_WIN_LOCK_PIN);
153 keyboard_pre_init_user(); 153 keyboard_pre_init_user();
154} 154}
155 155
156bool led_update_kb(led_t led_state) { 156bool led_update_kb(led_t led_state) {
157 bool res = led_update_user(led_state); 157 bool res = led_update_user(led_state);
158 if (res) { 158 if (res) {
159 writePin(LED_WIN_LOCK_PIN, keymap_config.no_gui); 159 gpio_write_pin(LED_WIN_LOCK_PIN, keymap_config.no_gui);
160 } 160 }
161 return res; 161 return res;
162} 162}
diff --git a/keyboards/al1/matrix.c b/keyboards/al1/matrix.c
index e3d7971f1c..508a2b5ea9 100644
--- a/keyboards/al1/matrix.c
+++ b/keyboards/al1/matrix.c
@@ -48,7 +48,7 @@ static void select_col(uint8_t col) {
48 48
49static void init_pins(void) { 49static void init_pins(void) {
50 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 50 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
51 setPinInputHigh(row_pins[x]); 51 gpio_set_pin_input_high(row_pins[x]);
52 } 52 }
53} 53}
54 54
@@ -65,7 +65,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
65 matrix_row_t last_row_value = current_matrix[row_index]; 65 matrix_row_t last_row_value = current_matrix[row_index];
66 66
67 // Check row pin state 67 // Check row pin state
68 if (readPin(row_pins[row_index]) == 0) { 68 if (gpio_read_pin(row_pins[row_index]) == 0) {
69 // Pin LO, set col bit 69 // Pin LO, set col bit
70 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); 70 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
71 } else { 71 } else {
diff --git a/keyboards/anavi/knob1/knob1.c b/keyboards/anavi/knob1/knob1.c
index bb6f1e38bf..5e63ef4f32 100644
--- a/keyboards/anavi/knob1/knob1.c
+++ b/keyboards/anavi/knob1/knob1.c
@@ -6,8 +6,8 @@
6 6
7void keyboard_post_init_kb(void) { 7void keyboard_post_init_kb(void) {
8 // Enable RGB LED 8 // Enable RGB LED
9 setPinOutput(GP11); 9 gpio_set_pin_output(GP11);
10 writePinHigh(GP11); 10 gpio_write_pin_high(GP11);
11 rgblight_enable(); 11 rgblight_enable();
12 12
13 // Offload to the user func 13 // Offload to the user func
diff --git a/keyboards/anavi/knobs3/knobs3.c b/keyboards/anavi/knobs3/knobs3.c
index efae010163..01b3b60c6f 100644
--- a/keyboards/anavi/knobs3/knobs3.c
+++ b/keyboards/anavi/knobs3/knobs3.c
@@ -6,8 +6,8 @@
6 6
7void keyboard_post_init_kb(void) { 7void keyboard_post_init_kb(void) {
8 // Enable RGB LED 8 // Enable RGB LED
9 setPinOutput(GP11); 9 gpio_set_pin_output(GP11);
10 writePinHigh(GP11); 10 gpio_write_pin_high(GP11);
11 rgblight_enable(); 11 rgblight_enable();
12 12
13 // Offload to the user func 13 // Offload to the user func
diff --git a/keyboards/argyle/matrix.c b/keyboards/argyle/matrix.c
index d723392a01..d435b368c2 100644
--- a/keyboards/argyle/matrix.c
+++ b/keyboards/argyle/matrix.c
@@ -26,27 +26,27 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
26 26
27static inline void setPinOutput_writeLow(pin_t pin) { 27static inline void setPinOutput_writeLow(pin_t pin) {
28 ATOMIC_BLOCK_FORCEON { 28 ATOMIC_BLOCK_FORCEON {
29 setPinOutput(pin); 29 gpio_set_pin_output(pin);
30 writePinLow(pin); 30 gpio_write_pin_low(pin);
31 } 31 }
32} 32}
33 33
34static inline void setPinOutput_writeHigh(pin_t pin) { 34static inline void setPinOutput_writeHigh(pin_t pin) {
35 ATOMIC_BLOCK_FORCEON { 35 ATOMIC_BLOCK_FORCEON {
36 setPinOutput(pin); 36 gpio_set_pin_output(pin);
37 writePinHigh(pin); 37 gpio_write_pin_high(pin);
38 } 38 }
39} 39}
40 40
41static inline void setPinInputHigh_atomic(pin_t pin) { 41static inline void setPinInputHigh_atomic(pin_t pin) {
42 ATOMIC_BLOCK_FORCEON { 42 ATOMIC_BLOCK_FORCEON {
43 setPinInputHigh(pin); 43 gpio_set_pin_input_high(pin);
44 } 44 }
45} 45}
46 46
47static inline uint8_t readMatrixPin(pin_t pin) { 47static inline uint8_t readMatrixPin(pin_t pin) {
48 if (pin != NO_PIN) { 48 if (pin != NO_PIN) {
49 return (readPin(pin) == 0) ? 0 : 1; 49 return (gpio_read_pin(pin) == 0) ? 0 : 1;
50 } else { 50 } else {
51 return 1; 51 return 1;
52 } 52 }
diff --git a/keyboards/artifact/lvl/rev_hs01/rev_hs01.c b/keyboards/artifact/lvl/rev_hs01/rev_hs01.c
index 6266ef69ad..fdbfa8f272 100755
--- a/keyboards/artifact/lvl/rev_hs01/rev_hs01.c
+++ b/keyboards/artifact/lvl/rev_hs01/rev_hs01.c
@@ -17,5 +17,5 @@
17 17
18void led_init_ports(void) { 18void led_init_ports(void) {
19 // Set our LED pins as open drain outputs 19 // Set our LED pins as open drain outputs
20 setPinOutputOpenDrain(LED_CAPS_LOCK_PIN); 20 gpio_set_pin_output_open_drain(LED_CAPS_LOCK_PIN);
21} 21}
diff --git a/keyboards/atlantis/ps17/ps17.c b/keyboards/atlantis/ps17/ps17.c
index d660bdee6a..8caf8a2e8f 100644
--- a/keyboards/atlantis/ps17/ps17.c
+++ b/keyboards/atlantis/ps17/ps17.c
@@ -5,26 +5,26 @@
5 5
6layer_state_t layer_state_set_kb(layer_state_t state) { 6layer_state_t layer_state_set_kb(layer_state_t state) {
7 /* Display current layer using indicator LEDs */ 7 /* Display current layer using indicator LEDs */
8 writePin(LED_INDICATOR_0_PIN, !IS_LAYER_ON_STATE(state, 1)); 8 gpio_write_pin(LED_INDICATOR_0_PIN, !IS_LAYER_ON_STATE(state, 1));
9 writePin(LED_INDICATOR_1_PIN, !IS_LAYER_ON_STATE(state, 2)); 9 gpio_write_pin(LED_INDICATOR_1_PIN, !IS_LAYER_ON_STATE(state, 2));
10 writePin(LED_INDICATOR_2_PIN, !IS_LAYER_ON_STATE(state, 3)); 10 gpio_write_pin(LED_INDICATOR_2_PIN, !IS_LAYER_ON_STATE(state, 3));
11 return layer_state_set_user(state); 11 return layer_state_set_user(state);
12} 12}
13 13
14void keyboard_pre_init_kb(void) { 14void keyboard_pre_init_kb(void) {
15 /* Set indicator LEDs as outputs */ 15 /* Set indicator LEDs as outputs */
16 setPinOutput(LED_INDICATOR_0_PIN); 16 gpio_set_pin_output(LED_INDICATOR_0_PIN);
17 setPinOutput(LED_INDICATOR_1_PIN); 17 gpio_set_pin_output(LED_INDICATOR_1_PIN);
18 setPinOutput(LED_INDICATOR_2_PIN); 18 gpio_set_pin_output(LED_INDICATOR_2_PIN);
19 keyboard_pre_init_user(); 19 keyboard_pre_init_user();
20} 20}
21 21
22#ifdef RGB_MATRIX_ENABLE 22#ifdef RGB_MATRIX_ENABLE
23void suspend_power_down_kb(void) { 23void suspend_power_down_kb(void) {
24 /* Disable indicator LEDs when going to sleep */ 24 /* Disable indicator LEDs when going to sleep */
25 writePin(LED_INDICATOR_0_PIN, 1); 25 gpio_write_pin(LED_INDICATOR_0_PIN, 1);
26 writePin(LED_INDICATOR_1_PIN, 1); 26 gpio_write_pin(LED_INDICATOR_1_PIN, 1);
27 writePin(LED_INDICATOR_2_PIN, 1); 27 gpio_write_pin(LED_INDICATOR_2_PIN, 1);
28 suspend_power_down_user(); 28 suspend_power_down_user();
29} 29}
30 30
diff --git a/keyboards/atomic/atomic.c b/keyboards/atomic/atomic.c
index 68f3ce9764..8bfe706da0 100644
--- a/keyboards/atomic/atomic.c
+++ b/keyboards/atomic/atomic.c
@@ -21,8 +21,8 @@ void matrix_init_kb(void) {
21 // runs once when the firmware starts up 21 // runs once when the firmware starts up
22 22
23 // Turn status LED on 23 // Turn status LED on
24 setPinOutput(E6); 24 gpio_set_pin_output(E6);
25 writePinHigh(E6); 25 gpio_write_pin_high(E6);
26 26
27 matrix_init_user(); 27 matrix_init_user();
28} 28}
diff --git a/keyboards/bajjak/bajjak.h b/keyboards/bajjak/bajjak.h
index c2d2d77ef6..cd4ae50053 100644
--- a/keyboards/bajjak/bajjak.h
+++ b/keyboards/bajjak/bajjak.h
@@ -53,17 +53,17 @@ uint8_t bajjak_left_leds_update(void);
53#endif 53#endif
54 54
55 55
56inline void bajjak_board_led_on(void) { setPinOutput(D6); writePinHigh(D6); } 56inline void bajjak_board_led_on(void) { gpio_set_pin_output(D6); gpio_write_pin_high(D6); }
57inline void bajjak_right_led_1_on(void) { setPinOutput(B5); writePinHigh(B5); } 57inline void bajjak_right_led_1_on(void) { gpio_set_pin_output(B5); gpio_write_pin_high(B5); }
58inline void bajjak_right_led_2_on(void) { setPinOutput(B6); writePinHigh(B6); } 58inline void bajjak_right_led_2_on(void) { gpio_set_pin_output(B6); gpio_write_pin_high(B6); }
59inline void bajjak_right_led_3_on(void) { setPinOutput(B7); writePinHigh(B7); } 59inline void bajjak_right_led_3_on(void) { gpio_set_pin_output(B7); gpio_write_pin_high(B7); }
60inline void bajjak_right_led_on(uint8_t led) { setPinOutput(led+4); writePinHigh(led+4); } 60inline void bajjak_right_led_on(uint8_t led) { gpio_set_pin_output(led+4); gpio_write_pin_high(led+4); }
61 61
62inline void bajjak_board_led_off(void) { setPinInput(D6); writePinLow(D6); } 62inline void bajjak_board_led_off(void) { gpio_set_pin_input(D6); gpio_write_pin_low(D6); }
63inline void bajjak_right_led_1_off(void) { setPinInput(B5); writePinLow(B5); } 63inline void bajjak_right_led_1_off(void) { gpio_set_pin_input(B5); gpio_write_pin_low(B5); }
64inline void bajjak_right_led_2_off(void) { setPinInput(B6); writePinLow(B6); } 64inline void bajjak_right_led_2_off(void) { gpio_set_pin_input(B6); gpio_write_pin_low(B6); }
65inline void bajjak_right_led_3_off(void) { setPinInput(B7); writePinLow(B7); } 65inline void bajjak_right_led_3_off(void) { gpio_set_pin_input(B7); gpio_write_pin_low(B7); }
66inline void bajjak_right_led_off(uint8_t led) { setPinInput(led+4); writePinLow(led+4); } 66inline void bajjak_right_led_off(uint8_t led) { gpio_set_pin_input(led+4); gpio_write_pin_low(led+4); }
67 67
68#ifdef LEFT_LEDS 68#ifdef LEFT_LEDS
69bool bajjak_left_led_1; 69bool bajjak_left_led_1;
diff --git a/keyboards/bajjak/matrix.c b/keyboards/bajjak/matrix.c
index b0d1ab531f..5451bf787d 100644
--- a/keyboards/bajjak/matrix.c
+++ b/keyboards/bajjak/matrix.c
@@ -128,13 +128,13 @@ static void init_cols(void) {
128 // not needed, already done as part of init_mcp23018() 128 // not needed, already done as part of init_mcp23018()
129 129
130 // init on teensy 130 // init on teensy
131 setPinInputHigh(F0); 131 gpio_set_pin_input_high(F0);
132 setPinInputHigh(F1); 132 gpio_set_pin_input_high(F1);
133 setPinInputHigh(F4); 133 gpio_set_pin_input_high(F4);
134 setPinInputHigh(F5); 134 gpio_set_pin_input_high(F5);
135 setPinInputHigh(F6); 135 gpio_set_pin_input_high(F6);
136 setPinInputHigh(F7); 136 gpio_set_pin_input_high(F7);
137 setPinInputHigh(D7); 137 gpio_set_pin_input_high(D7);
138} 138}
139 139
140static matrix_row_t read_cols(uint8_t row) { 140static matrix_row_t read_cols(uint8_t row) {
@@ -175,13 +175,13 @@ static void unselect_rows(void) {
175 // direction 175 // direction
176 176
177 // unselect on teensy 177 // unselect on teensy
178 setPinInput(B0); 178 gpio_set_pin_input(B0);
179 setPinInput(B1); 179 gpio_set_pin_input(B1);
180 setPinInput(B2); 180 gpio_set_pin_input(B2);
181 setPinInput(B3); 181 gpio_set_pin_input(B3);
182 setPinInput(D2); 182 gpio_set_pin_input(D2);
183 setPinInput(D3); 183 gpio_set_pin_input(D3);
184 setPinInput(C6); 184 gpio_set_pin_input(C6);
185} 185}
186 186
187static void select_row(uint8_t row) { 187static void select_row(uint8_t row) {
@@ -200,32 +200,32 @@ static void select_row(uint8_t row) {
200 // Output low(DDR:1, PORT:0) to select 200 // Output low(DDR:1, PORT:0) to select
201 switch (row) { 201 switch (row) {
202 case 7: 202 case 7:
203 setPinOutput(B0); 203 gpio_set_pin_output(B0);
204 writePinLow(B0); 204 gpio_write_pin_low(B0);
205 break; 205 break;
206 case 8: 206 case 8:
207 setPinOutput(B1); 207 gpio_set_pin_output(B1);
208 writePinLow(B1); 208 gpio_write_pin_low(B1);
209 break; 209 break;
210 case 9: 210 case 9:
211 setPinOutput(B2); 211 gpio_set_pin_output(B2);
212 writePinLow(B2); 212 gpio_write_pin_low(B2);
213 break; 213 break;
214 case 10: 214 case 10:
215 setPinOutput(B3); 215 gpio_set_pin_output(B3);
216 writePinLow(B3); 216 gpio_write_pin_low(B3);
217 break; 217 break;
218 case 11: 218 case 11:
219 setPinOutput(D2); 219 gpio_set_pin_output(D2);
220 writePinLow(D2); 220 gpio_write_pin_low(D2);
221 break; 221 break;
222 case 12: 222 case 12:
223 setPinOutput(D3); 223 gpio_set_pin_output(D3);
224 writePinLow(D3); 224 gpio_write_pin_low(D3);
225 break; 225 break;
226 case 13: 226 case 13:
227 setPinOutput(C6); 227 gpio_set_pin_output(C6);
228 writePinLow(C6); 228 gpio_write_pin_low(C6);
229 break; 229 break;
230 } 230 }
231 } 231 }
diff --git a/keyboards/bandominedoni/bandominedoni.c b/keyboards/bandominedoni/bandominedoni.c
index 2884e41c9c..76d9e6cb3b 100644
--- a/keyboards/bandominedoni/bandominedoni.c
+++ b/keyboards/bandominedoni/bandominedoni.c
@@ -70,14 +70,14 @@ led_config_t g_led_config = {
70 70
71#if defined(SPLIT_HAND_MATRIX_GRID) 71#if defined(SPLIT_HAND_MATRIX_GRID)
72static uint8_t peek_matrix_intersection(pin_t out_pin, pin_t in_pin) { 72static uint8_t peek_matrix_intersection(pin_t out_pin, pin_t in_pin) {
73 setPinInputHigh(in_pin); 73 gpio_set_pin_input_high(in_pin);
74 setPinOutput(out_pin); 74 gpio_set_pin_output(out_pin);
75 writePinLow(out_pin); 75 gpio_write_pin_low(out_pin);
76 // It's almost unnecessary, but wait until it's down to low, just in case. 76 // It's almost unnecessary, but wait until it's down to low, just in case.
77 wait_us(1); 77 wait_us(1);
78 uint8_t pin_state = readPin(in_pin); 78 uint8_t pin_state = gpio_read_pin(in_pin);
79 // Set out_pin to a setting that is less susceptible to noise. 79 // Set out_pin to a setting that is less susceptible to noise.
80 setPinInputHigh(out_pin); 80 gpio_set_pin_input_high(out_pin);
81 matrix_io_delay(); // Wait for the pull-up to go HIGH. 81 matrix_io_delay(); // Wait for the pull-up to go HIGH.
82 return pin_state; 82 return pin_state;
83} 83}
@@ -93,8 +93,8 @@ static enum { UNKNOWN, LEFT, RIGHT } hand_side = UNKNOWN;
93 if (hand_side == UNKNOWN) { 93 if (hand_side == UNKNOWN) {
94#if defined(SPLIT_HAND_PIN) 94#if defined(SPLIT_HAND_PIN)
95 // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand 95 // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand
96 setPinInput(SPLIT_HAND_PIN); 96 gpio_set_pin_input(SPLIT_HAND_PIN);
97 hand_side = readPin(SPLIT_HAND_PIN) ? LEFT : RIGHT; 97 hand_side = gpio_read_pin(SPLIT_HAND_PIN) ? LEFT : RIGHT;
98 return (hand_side == LEFT); 98 return (hand_side == LEFT);
99#elif defined(SPLIT_HAND_MATRIX_GRID) 99#elif defined(SPLIT_HAND_MATRIX_GRID)
100# ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT 100# ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT
diff --git a/keyboards/barleycorn_smd/matrix.c b/keyboards/barleycorn_smd/matrix.c
index d8880364b6..f64e8fcd7f 100644
--- a/keyboards/barleycorn_smd/matrix.c
+++ b/keyboards/barleycorn_smd/matrix.c
@@ -23,17 +23,17 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
23 23
24static void unselect_rows(void) { 24static void unselect_rows(void) {
25 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 25 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
26 setPinInputHigh(row_pins[x]); 26 gpio_set_pin_input_high(row_pins[x]);
27 } 27 }
28} 28}
29 29
30static void select_row(uint8_t row) { 30static void select_row(uint8_t row) {
31 setPinOutput(row_pins[row]); 31 gpio_set_pin_output(row_pins[row]);
32 writePinLow(row_pins[row]); 32 gpio_write_pin_low(row_pins[row]);
33} 33}
34 34
35static void unselect_row(uint8_t row) { 35static void unselect_row(uint8_t row) {
36 setPinInputHigh(row_pins[row]); 36 gpio_set_pin_input_high(row_pins[row]);
37} 37}
38 38
39static void init_pins(void) { 39static void init_pins(void) {
@@ -46,7 +46,7 @@ static void init_pins(void) {
46 46
47 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 47 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
48 if ( x < 8 ) { 48 if ( x < 8 ) {
49 setPinInputHigh(col_pins[x]); 49 gpio_set_pin_input_high(col_pins[x]);
50 } 50 }
51 } 51 }
52} 52}
@@ -111,7 +111,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
111 pin_state = port_expander_col_buffer[1] & (1 << 1); 111 pin_state = port_expander_col_buffer[1] & (1 << 1);
112 break; 112 break;
113 default : 113 default :
114 pin_state = readPin(col_pins[col_index]); 114 pin_state = gpio_read_pin(col_pins[col_index]);
115 } 115 }
116 116
117 // Populate the matrix row with the state of the col pin 117 // Populate the matrix row with the state of the col pin
diff --git a/keyboards/bastardkb/charybdis/charybdis.c b/keyboards/bastardkb/charybdis/charybdis.c
index c9f0e63172..0ee5c3eed9 100644
--- a/keyboards/bastardkb/charybdis/charybdis.c
+++ b/keyboards/bastardkb/charybdis/charybdis.c
@@ -371,12 +371,12 @@ void housekeeping_task_kb(void) {
371 371
372#if defined(KEYBOARD_bastardkb_charybdis_3x5_blackpill) || defined(KEYBOARD_bastardkb_charybdis_4x6_blackpill) 372#if defined(KEYBOARD_bastardkb_charybdis_3x5_blackpill) || defined(KEYBOARD_bastardkb_charybdis_4x6_blackpill)
373void keyboard_pre_init_kb(void) { 373void keyboard_pre_init_kb(void) {
374 setPinInputHigh(A0); 374 gpio_set_pin_input_high(A0);
375 keyboard_pre_init_user(); 375 keyboard_pre_init_user();
376} 376}
377 377
378void matrix_scan_kb(void) { 378void matrix_scan_kb(void) {
379 if (!readPin(A0)) { 379 if (!gpio_read_pin(A0)) {
380 reset_keyboard(); 380 reset_keyboard();
381 } 381 }
382 matrix_scan_user(); 382 matrix_scan_user();
diff --git a/keyboards/bear_face/v1/v1.c b/keyboards/bear_face/v1/v1.c
index f4960d9178..b64a63f0b4 100644
--- a/keyboards/bear_face/v1/v1.c
+++ b/keyboards/bear_face/v1/v1.c
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20void keyboard_pre_init_kb(void) { 20void keyboard_pre_init_kb(void) {
21 //Sets LED pin as output 21 //Sets LED pin as output
22 setPinOutput(F7); 22 gpio_set_pin_output(F7);
23 23
24 keyboard_pre_init_user(); 24 keyboard_pre_init_user();
25} 25}
@@ -28,7 +28,7 @@ bool led_update_kb(led_t led_state) {
28 // Caps Lock LED indicator toggling code here 28 // Caps Lock LED indicator toggling code here
29 bool res = led_update_user(led_state); 29 bool res = led_update_user(led_state);
30 if(res) { 30 if(res) {
31 writePin(F7, led_state.caps_lock); 31 gpio_write_pin(F7, led_state.caps_lock);
32 } 32 }
33 return res; 33 return res;
34} 34}
diff --git a/keyboards/bear_face/v2/v2.c b/keyboards/bear_face/v2/v2.c
index f4960d9178..b64a63f0b4 100644
--- a/keyboards/bear_face/v2/v2.c
+++ b/keyboards/bear_face/v2/v2.c
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20void keyboard_pre_init_kb(void) { 20void keyboard_pre_init_kb(void) {
21 //Sets LED pin as output 21 //Sets LED pin as output
22 setPinOutput(F7); 22 gpio_set_pin_output(F7);
23 23
24 keyboard_pre_init_user(); 24 keyboard_pre_init_user();
25} 25}
@@ -28,7 +28,7 @@ bool led_update_kb(led_t led_state) {
28 // Caps Lock LED indicator toggling code here 28 // Caps Lock LED indicator toggling code here
29 bool res = led_update_user(led_state); 29 bool res = led_update_user(led_state);
30 if(res) { 30 if(res) {
31 writePin(F7, led_state.caps_lock); 31 gpio_write_pin(F7, led_state.caps_lock);
32 } 32 }
33 return res; 33 return res;
34} 34}
diff --git a/keyboards/bioi/g60/g60.c b/keyboards/bioi/g60/g60.c
index 3b387b8760..3fdfef8897 100644
--- a/keyboards/bioi/g60/g60.c
+++ b/keyboards/bioi/g60/g60.c
@@ -15,14 +15,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
15#include "quantum.h" 15#include "quantum.h"
16 16
17void keyboard_pre_init_kb(void) { 17void keyboard_pre_init_kb(void) {
18 setPinOutput(F0); 18 gpio_set_pin_output(F0);
19 writePinHigh(F0); 19 gpio_write_pin_high(F0);
20 keyboard_pre_init_user(); 20 keyboard_pre_init_user();
21} 21}
22 22
23bool led_update_kb(led_t led_state) { 23bool led_update_kb(led_t led_state) {
24 if (led_update_user(led_state)) { 24 if (led_update_user(led_state)) {
25 writePin(F0, !led_state.caps_lock); 25 gpio_write_pin(F0, !led_state.caps_lock);
26 } 26 }
27 return true; 27 return true;
28} 28}
diff --git a/keyboards/bioi/morgan65/morgan65.c b/keyboards/bioi/morgan65/morgan65.c
index 3b387b8760..3fdfef8897 100644
--- a/keyboards/bioi/morgan65/morgan65.c
+++ b/keyboards/bioi/morgan65/morgan65.c
@@ -15,14 +15,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
15#include "quantum.h" 15#include "quantum.h"
16 16
17void keyboard_pre_init_kb(void) { 17void keyboard_pre_init_kb(void) {
18 setPinOutput(F0); 18 gpio_set_pin_output(F0);
19 writePinHigh(F0); 19 gpio_write_pin_high(F0);
20 keyboard_pre_init_user(); 20 keyboard_pre_init_user();
21} 21}
22 22
23bool led_update_kb(led_t led_state) { 23bool led_update_kb(led_t led_state) {
24 if (led_update_user(led_state)) { 24 if (led_update_user(led_state)) {
25 writePin(F0, !led_state.caps_lock); 25 gpio_write_pin(F0, !led_state.caps_lock);
26 } 26 }
27 return true; 27 return true;
28} 28}
diff --git a/keyboards/bioi/s65/s65.c b/keyboards/bioi/s65/s65.c
index 1bd6b84347..e632f31eeb 100644
--- a/keyboards/bioi/s65/s65.c
+++ b/keyboards/bioi/s65/s65.c
@@ -14,14 +14,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14
15#include "quantum.h" 15#include "quantum.h"
16void keyboard_pre_init_kb(void) { 16void keyboard_pre_init_kb(void) {
17 setPinOutput(F0); 17 gpio_set_pin_output(F0);
18 writePinHigh(F0); 18 gpio_write_pin_high(F0);
19 keyboard_pre_init_user(); 19 keyboard_pre_init_user();
20} 20}
21 21
22bool led_update_kb(led_t led_state) { 22bool led_update_kb(led_t led_state) {
23 if (led_update_user(led_state)) { 23 if (led_update_user(led_state)) {
24 writePin(F0, !led_state.caps_lock); 24 gpio_write_pin(F0, !led_state.caps_lock);
25 } 25 }
26 return true; 26 return true;
27} 27}
diff --git a/keyboards/blu/vimclutch/vimclutch.c b/keyboards/blu/vimclutch/vimclutch.c
index 5add11ee4f..6dc8cf765e 100644
--- a/keyboards/blu/vimclutch/vimclutch.c
+++ b/keyboards/blu/vimclutch/vimclutch.c
@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18 18
19void keyboard_pre_init_kb(void) 19void keyboard_pre_init_kb(void)
20{ 20{
21 setPinOutput(F4); 21 gpio_set_pin_output(F4);
22 setPinOutput(F5); 22 gpio_set_pin_output(F5);
23 23
24 keyboard_pre_init_user(); 24 keyboard_pre_init_user();
25}; 25};
diff --git a/keyboards/bobpad/bobpad.c b/keyboards/bobpad/bobpad.c
index 67b124ace2..83b4dbaad0 100644
--- a/keyboards/bobpad/bobpad.c
+++ b/keyboards/bobpad/bobpad.c
@@ -19,7 +19,7 @@
19bool led_update_kb(led_t led_state) { 19bool led_update_kb(led_t led_state) {
20 if (!led_update_user(led_state)) { return false; } 20 if (!led_update_user(led_state)) { return false; }
21 21
22 writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); 22 gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
23 return true; 23 return true;
24}; 24};
25 25
diff --git a/keyboards/bpiphany/ghost_squid/ghost_squid.c b/keyboards/bpiphany/ghost_squid/ghost_squid.c
index 3ecac66f7a..8ecced34e7 100644
--- a/keyboards/bpiphany/ghost_squid/ghost_squid.c
+++ b/keyboards/bpiphany/ghost_squid/ghost_squid.c
@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "ghost_squid.h" 18#include "ghost_squid.h"
19 19
20void keyboard_pre_init_kb(void) { 20void keyboard_pre_init_kb(void) {
21 setPinOutput(D0); 21 gpio_set_pin_output(D0);
22 writePinLow(D0); 22 gpio_write_pin_low(D0);
23 fn_led_off(); 23 fn_led_off();
24 24
25 keyboard_pre_init_user(); 25 keyboard_pre_init_user();
diff --git a/keyboards/bpiphany/ghost_squid/ghost_squid.h b/keyboards/bpiphany/ghost_squid/ghost_squid.h
index 63d3ea0d5e..a227a87602 100644
--- a/keyboards/bpiphany/ghost_squid/ghost_squid.h
+++ b/keyboards/bpiphany/ghost_squid/ghost_squid.h
@@ -19,5 +19,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20#include "quantum.h" 20#include "quantum.h"
21 21
22#define fn_led_on() writePinLow(D0) 22#define fn_led_on() gpio_write_pin_low(D0)
23#define fn_led_off() writePinHigh(D0) 23#define fn_led_off() gpio_write_pin_high(D0)
diff --git a/keyboards/bpiphany/ghost_squid/matrix.c b/keyboards/bpiphany/ghost_squid/matrix.c
index 802d365cb8..ae48f5fc94 100644
--- a/keyboards/bpiphany/ghost_squid/matrix.c
+++ b/keyboards/bpiphany/ghost_squid/matrix.c
@@ -55,22 +55,22 @@ void select_col(uint8_t col) {
55 55
56void matrix_init_custom(void) { 56void matrix_init_custom(void) {
57 /* Column output pins */ 57 /* Column output pins */
58 setPinOutput(D1); 58 gpio_set_pin_output(D1);
59 setPinOutput(D2); 59 gpio_set_pin_output(D2);
60 setPinOutput(D3); 60 gpio_set_pin_output(D3);
61 setPinOutput(D4); 61 gpio_set_pin_output(D4);
62 setPinOutput(D5); 62 gpio_set_pin_output(D5);
63 setPinOutput(D6); 63 gpio_set_pin_output(D6);
64 64
65 /* Row input pins */ 65 /* Row input pins */
66 writePinHigh(B0); 66 gpio_write_pin_high(B0);
67 writePinHigh(B1); 67 gpio_write_pin_high(B1);
68 writePinHigh(B2); 68 gpio_write_pin_high(B2);
69 writePinHigh(B3); 69 gpio_write_pin_high(B3);
70 writePinHigh(B4); 70 gpio_write_pin_high(B4);
71 writePinHigh(B5); 71 gpio_write_pin_high(B5);
72 writePinHigh(B6); 72 gpio_write_pin_high(B6);
73 writePinHigh(C2); 73 gpio_write_pin_high(C2);
74} 74}
75 75
76bool matrix_scan_custom(matrix_row_t current_matrix[]) { 76bool matrix_scan_custom(matrix_row_t current_matrix[]) {
diff --git a/keyboards/capsunlocked/cu75/cu75.c b/keyboards/capsunlocked/cu75/cu75.c
index f980b0d9e1..e04dd74bc8 100644
--- a/keyboards/capsunlocked/cu75/cu75.c
+++ b/keyboards/capsunlocked/cu75/cu75.c
@@ -20,12 +20,12 @@ void matrix_init_kb(void)
20 audio_init(); 20 audio_init();
21 PLAY_SONG(test_sound); 21 PLAY_SONG(test_sound);
22 // Fix port B5 22 // Fix port B5
23 setPinInput(B5); 23 gpio_set_pin_input(B5);
24 writePinHigh(B5); 24 gpio_write_pin_high(B5);
25#else 25#else
26 // If we're not using the audio pin, drive it low 26 // If we're not using the audio pin, drive it low
27 setPinOutput(C6); 27 gpio_set_pin_output(C6);
28 writePinLow(C6); 28 gpio_write_pin_low(C6);
29#endif 29#endif
30} 30}
31 31
diff --git a/keyboards/capsunlocked/cu80/v2/v2.c b/keyboards/capsunlocked/cu80/v2/v2.c
index e450082ba2..4e0e8cad76 100644
--- a/keyboards/capsunlocked/cu80/v2/v2.c
+++ b/keyboards/capsunlocked/cu80/v2/v2.c
@@ -3,7 +3,7 @@
3#include "quantum.h" 3#include "quantum.h"
4 4
5void matrix_init_kb(void) { 5void matrix_init_kb(void) {
6 setPinOutput(E6); 6 gpio_set_pin_output(E6);
7 matrix_init_user(); 7 matrix_init_user();
8} 8}
9 9
diff --git a/keyboards/centromere/centromere.c b/keyboards/centromere/centromere.c
index 8d46520e38..61b9e073f3 100644
--- a/keyboards/centromere/centromere.c
+++ b/keyboards/centromere/centromere.c
@@ -2,23 +2,23 @@
2 2
3void led_init(void) { 3void led_init(void) {
4#if MCU == atmega32u2 4#if MCU == atmega32u2
5 setPinOutput(C4); // Set red LED pin as output 5 gpio_set_pin_output(C4); // Set red LED pin as output
6 setPinOutput(C5); // Set blue LED pin as output 6 gpio_set_pin_output(C5); // Set blue LED pin as output
7 setPinOutput(D1); // Set green LED pin as output 7 gpio_set_pin_output(D1); // Set green LED pin as output
8 8
9 writePinHigh(C4); // Turn off red LED pin 9 gpio_write_pin_high(C4); // Turn off red LED pin
10 writePinHigh(C5); // Turn off blue LED pin 10 gpio_write_pin_high(C5); // Turn off blue LED pin
11 writePinHigh(D1); // Turn off green LED pin 11 gpio_write_pin_high(D1); // Turn off green LED pin
12 12
13#else 13#else
14 14
15 setPinOutput(F4); // Set red LED pin as output 15 gpio_set_pin_output(F4); // Set red LED pin as output
16 setPinOutput(F5); // Set blue LED pin as output 16 gpio_set_pin_output(F5); // Set blue LED pin as output
17 setPinOutput(D1); // Set green LED pin as output 17 gpio_set_pin_output(D1); // Set green LED pin as output
18 18
19 writePinHigh(F4); // Turn off red LED pin 19 gpio_write_pin_high(F4); // Turn off red LED pin
20 writePinHigh(F5); // Turn off blue LED pin 20 gpio_write_pin_high(F5); // Turn off blue LED pin
21 writePinHigh(D1); // Turn off green LED pin 21 gpio_write_pin_high(D1); // Turn off green LED pin
22 22
23#endif 23#endif
24 24
diff --git a/keyboards/centromere/centromere.h b/keyboards/centromere/centromere.h
index 078cdca07f..32c2ae6e16 100644
--- a/keyboards/centromere/centromere.h
+++ b/keyboards/centromere/centromere.h
@@ -3,21 +3,21 @@
3#include "quantum.h" 3#include "quantum.h"
4 4
5#if MCU == atmega32u2 5#if MCU == atmega32u2
6#define red_led_off writePinHigh(C5) 6#define red_led_off gpio_write_pin_high(C5)
7#define red_led_on writePinLow(C5) 7#define red_led_on gpio_write_pin_low(C5)
8#define blu_led_off writePinHigh(C4) 8#define blu_led_off gpio_write_pin_high(C4)
9#define blu_led_on writePinLow(C4) 9#define blu_led_on gpio_write_pin_low(C4)
10 10
11#else 11#else
12#define red_led_off writePinHigh(F5) 12#define red_led_off gpio_write_pin_high(F5)
13#define red_led_on writePinLow(F5) 13#define red_led_on gpio_write_pin_low(F5)
14#define blu_led_off writePinHigh(F4) 14#define blu_led_off gpio_write_pin_high(F4)
15#define blu_led_on writePinLow(F4) 15#define blu_led_on gpio_write_pin_low(F4)
16 16
17#endif 17#endif
18 18
19#define grn_led_off writePinHigh(D1) 19#define grn_led_off gpio_write_pin_high(D1)
20#define grn_led_on writePinLow(D1) 20#define grn_led_on gpio_write_pin_low(D1)
21 21
22#define set_led_off red_led_off; blu_led_off 22#define set_led_off red_led_off; blu_led_off
23#define set_led_red red_led_on; grn_led_off; blu_led_off 23#define set_led_red red_led_on; grn_led_off; blu_led_off
diff --git a/keyboards/cheshire/curiosity/curiosity.c b/keyboards/cheshire/curiosity/curiosity.c
index 9db2651e94..2813cff9b4 100644
--- a/keyboards/cheshire/curiosity/curiosity.c
+++ b/keyboards/cheshire/curiosity/curiosity.c
@@ -1,17 +1,17 @@
1#include "quantum.h" 1#include "quantum.h"
2 2
3void matrix_init_board(void){ 3void matrix_init_board(void){
4 setPinOutput(A8); 4 gpio_set_pin_output(A8);
5 setPinOutput(A9); 5 gpio_set_pin_output(A9);
6 setPinOutput(A10); 6 gpio_set_pin_output(A10);
7} 7}
8 8
9bool led_update_kb(led_t led_state) { 9bool led_update_kb(led_t led_state) {
10 bool runDefault = led_update_user(led_state); 10 bool runDefault = led_update_user(led_state);
11 if (runDefault) { 11 if (runDefault) {
12 writePin(A8, !led_state.num_lock); 12 gpio_write_pin(A8, !led_state.num_lock);
13 writePin(A9, !led_state.caps_lock); 13 gpio_write_pin(A9, !led_state.caps_lock);
14 writePin(A10, !led_state.scroll_lock); 14 gpio_write_pin(A10, !led_state.scroll_lock);
15 } 15 }
16 return runDefault; 16 return runDefault;
17} 17}
diff --git a/keyboards/cipulot/common/ec_switch_matrix.c b/keyboards/cipulot/common/ec_switch_matrix.c
index 845ef99d22..33123bd236 100644
--- a/keyboards/cipulot/common/ec_switch_matrix.c
+++ b/keyboards/cipulot/common/ec_switch_matrix.c
@@ -54,19 +54,19 @@ static adc_mux adcMux;
54void init_row(void) { 54void init_row(void) {
55 // Set all row pins as output and low 55 // Set all row pins as output and low
56 for (uint8_t idx = 0; idx < MATRIX_ROWS; idx++) { 56 for (uint8_t idx = 0; idx < MATRIX_ROWS; idx++) {
57 setPinOutput(row_pins[idx]); 57 gpio_set_pin_output(row_pins[idx]);
58 writePinLow(row_pins[idx]); 58 gpio_write_pin_low(row_pins[idx]);
59 } 59 }
60} 60}
61 61
62// Initialize the multiplexers 62// Initialize the multiplexers
63void init_amux(void) { 63void init_amux(void) {
64 for (uint8_t idx = 0; idx < AMUX_COUNT; idx++) { 64 for (uint8_t idx = 0; idx < AMUX_COUNT; idx++) {
65 setPinOutput(amux_en_pins[idx]); 65 gpio_set_pin_output(amux_en_pins[idx]);
66 writePinLow(amux_en_pins[idx]); 66 gpio_write_pin_low(amux_en_pins[idx]);
67 } 67 }
68 for (uint8_t idx = 0; idx < AMUX_SEL_PINS_COUNT; idx++) { 68 for (uint8_t idx = 0; idx < AMUX_SEL_PINS_COUNT; idx++) {
69 setPinOutput(amux_sel_pins[idx]); 69 gpio_set_pin_output(amux_sel_pins[idx]);
70 } 70 }
71} 71}
72 72
@@ -75,13 +75,13 @@ void select_amux_channel(uint8_t channel, uint8_t col) {
75 // Get the channel for the specified multiplexer 75 // Get the channel for the specified multiplexer
76 uint8_t ch = amux_n_col_channels[channel][col]; 76 uint8_t ch = amux_n_col_channels[channel][col];
77 // momentarily disable specified multiplexer 77 // momentarily disable specified multiplexer
78 writePinHigh(amux_en_pins[channel]); 78 gpio_write_pin_high(amux_en_pins[channel]);
79 // Select the multiplexer channel 79 // Select the multiplexer channel
80 for (uint8_t i = 0; i < AMUX_SEL_PINS_COUNT; i++) { 80 for (uint8_t i = 0; i < AMUX_SEL_PINS_COUNT; i++) {
81 writePin(amux_sel_pins[i], ch & (1 << i)); 81 gpio_write_pin(amux_sel_pins[i], ch & (1 << i));
82 } 82 }
83 // re enable specified multiplexer 83 // re enable specified multiplexer
84 writePinLow(amux_en_pins[channel]); 84 gpio_write_pin_low(amux_en_pins[channel]);
85} 85}
86 86
87// Disable all the unused multiplexers 87// Disable all the unused multiplexers
@@ -89,28 +89,28 @@ void disable_unused_amux(uint8_t channel) {
89 // disable all the other multiplexers apart from the current selected one 89 // disable all the other multiplexers apart from the current selected one
90 for (uint8_t idx = 0; idx < AMUX_COUNT; idx++) { 90 for (uint8_t idx = 0; idx < AMUX_COUNT; idx++) {
91 if (idx != channel) { 91 if (idx != channel) {
92 writePinHigh(amux_en_pins[idx]); 92 gpio_write_pin_high(amux_en_pins[idx]);
93 } 93 }
94 } 94 }
95} 95}
96// Discharge the peak hold capacitor 96// Discharge the peak hold capacitor
97void discharge_capacitor(void) { 97void discharge_capacitor(void) {
98#ifdef OPEN_DRAIN_SUPPORT 98#ifdef OPEN_DRAIN_SUPPORT
99 writePinLow(DISCHARGE_PIN); 99 gpio_write_pin_low(DISCHARGE_PIN);
100#else 100#else
101 writePinLow(DISCHARGE_PIN); 101 gpio_write_pin_low(DISCHARGE_PIN);
102 setPinOutput(DISCHARGE_PIN); 102 gpio_set_pin_output(DISCHARGE_PIN);
103#endif 103#endif
104} 104}
105 105
106// Charge the peak hold capacitor 106// Charge the peak hold capacitor
107void charge_capacitor(uint8_t row) { 107void charge_capacitor(uint8_t row) {
108#ifdef OPEN_DRAIN_SUPPORT 108#ifdef OPEN_DRAIN_SUPPORT
109 writePinHigh(DISCHARGE_PIN); 109 gpio_write_pin_high(DISCHARGE_PIN);
110#else 110#else
111 setPinInput(DISCHARGE_PIN); 111 gpio_set_pin_input(DISCHARGE_PIN);
112#endif 112#endif
113 writePinHigh(row_pins[row]); 113 gpio_write_pin_high(row_pins[row]);
114} 114}
115 115
116// Initialize the peripherals pins 116// Initialize the peripherals pins
@@ -123,11 +123,11 @@ int ec_init(void) {
123 adc_read(adcMux); 123 adc_read(adcMux);
124 124
125 // Initialize discharge pin as discharge mode 125 // Initialize discharge pin as discharge mode
126 writePinLow(DISCHARGE_PIN); 126 gpio_write_pin_low(DISCHARGE_PIN);
127#ifdef OPEN_DRAIN_SUPPORT 127#ifdef OPEN_DRAIN_SUPPORT
128 setPinOutputOpenDrain(DISCHARGE_PIN); 128 gpio_set_pin_output_open_drain(DISCHARGE_PIN);
129#else 129#else
130 setPinOutput(DISCHARGE_PIN); 130 gpio_set_pin_output(DISCHARGE_PIN);
131#endif 131#endif
132 132
133 // Initialize drive lines 133 // Initialize drive lines
@@ -212,7 +212,7 @@ uint16_t ec_readkey_raw(uint8_t channel, uint8_t row, uint8_t col) {
212 select_amux_channel(channel, col); 212 select_amux_channel(channel, col);
213 213
214 // Set the row pin to low state to avoid ghosting 214 // Set the row pin to low state to avoid ghosting
215 writePinLow(row_pins[row]); 215 gpio_write_pin_low(row_pins[row]);
216 216
217 ATOMIC_BLOCK_FORCEON { 217 ATOMIC_BLOCK_FORCEON {
218 // Set the row pin to high state and have capacitor charge 218 // Set the row pin to high state and have capacitor charge
diff --git a/keyboards/clueboard/2x1800/2019/2019.c b/keyboards/clueboard/2x1800/2019/2019.c
index 40032cd669..8b0ba6a71e 100644
--- a/keyboards/clueboard/2x1800/2019/2019.c
+++ b/keyboards/clueboard/2x1800/2019/2019.c
@@ -17,14 +17,14 @@
17 17
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 // Set our LED pins as output 19 // Set our LED pins as output
20 setPinOutput(D6); 20 gpio_set_pin_output(D6);
21 setPinOutput(B4); 21 gpio_set_pin_output(B4);
22 setPinOutput(B5); 22 gpio_set_pin_output(B5);
23 setPinOutput(B6); 23 gpio_set_pin_output(B6);
24 24
25 // Set our Tilt Sensor pins as input 25 // Set our Tilt Sensor pins as input
26 setPinInputHigh(SHAKE_PIN_A); 26 gpio_set_pin_input_high(SHAKE_PIN_A);
27 setPinInputHigh(SHAKE_PIN_B); 27 gpio_set_pin_input_high(SHAKE_PIN_B);
28 28
29 // Run the keymap level init 29 // Run the keymap level init
30 matrix_init_user(); 30 matrix_init_user();
@@ -43,12 +43,12 @@ void check_encoder_buttons(void) {
43 if (drawing_mode) { 43 if (drawing_mode) {
44 dprintf("Turning drawing mode off.\n"); 44 dprintf("Turning drawing mode off.\n");
45 drawing_mode = false; 45 drawing_mode = false;
46 writePinLow(D6); 46 gpio_write_pin_low(D6);
47 unregister_code(KC_BTN1); 47 unregister_code(KC_BTN1);
48 } else { 48 } else {
49 dprintf("Turning drawing mode on.\n"); 49 dprintf("Turning drawing mode on.\n");
50 drawing_mode = true; 50 drawing_mode = true;
51 writePinHigh(D6); 51 gpio_write_pin_high(D6);
52 register_code(KC_BTN1); 52 register_code(KC_BTN1);
53 } 53 }
54 } 54 }
@@ -65,7 +65,7 @@ void matrix_scan_kb(void) {
65#ifdef SHAKE_ENABLE 65#ifdef SHAKE_ENABLE
66 // Read the current state of the tilt sensor. It is physically 66 // Read the current state of the tilt sensor. It is physically
67 // impossible for both pins to register a low state at the same time. 67 // impossible for both pins to register a low state at the same time.
68 uint8_t tilt_read = (readPin(SHAKE_PIN_A) << 4) | readPin(SHAKE_PIN_B); 68 uint8_t tilt_read = (gpio_read_pin(SHAKE_PIN_A) << 4) | gpio_read_pin(SHAKE_PIN_B);
69 69
70 // Check to see if the tilt sensor has changed state since our last read 70 // Check to see if the tilt sensor has changed state since our last read
71 if (tilt_state != tilt_read) { 71 if (tilt_state != tilt_read) {
@@ -136,9 +136,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
136bool led_update_kb(led_t led_state) { 136bool led_update_kb(led_t led_state) {
137 bool res = led_update_user(led_state); 137 bool res = led_update_user(led_state);
138 if(res) { 138 if(res) {
139 writePin(B4, !led_state.num_lock); 139 gpio_write_pin(B4, !led_state.num_lock);
140 writePin(B5, !led_state.caps_lock); 140 gpio_write_pin(B5, !led_state.caps_lock);
141 writePin(B6, !led_state.scroll_lock); 141 gpio_write_pin(B6, !led_state.scroll_lock);
142 } 142 }
143 143
144 return res; 144 return res;
diff --git a/keyboards/clueboard/2x1800/2021/max7219.c b/keyboards/clueboard/2x1800/2021/max7219.c
index 81d26b9a51..849889a52e 100644
--- a/keyboards/clueboard/2x1800/2021/max7219.c
+++ b/keyboards/clueboard/2x1800/2021/max7219.c
@@ -206,8 +206,8 @@ void max7219_init(void) {
206 wait_ms(1500); 206 wait_ms(1500);
207 dprintf("max7219_init()\n"); 207 dprintf("max7219_init()\n");
208 208
209 setPinOutput(MAX7219_LOAD); 209 gpio_set_pin_output(MAX7219_LOAD);
210 writePinHigh(MAX7219_LOAD); 210 gpio_write_pin_high(MAX7219_LOAD);
211 spi_init(); 211 spi_init();
212 212
213 for (int i=0; i<MAX7219_CONTROLLERS; i++) { 213 for (int i=0; i<MAX7219_CONTROLLERS; i++) {
diff --git a/keyboards/clueboard/66/rev4/rev4.c b/keyboards/clueboard/66/rev4/rev4.c
index 75befc5230..25fe606aea 100644
--- a/keyboards/clueboard/66/rev4/rev4.c
+++ b/keyboards/clueboard/66/rev4/rev4.c
@@ -2,23 +2,23 @@
2 2
3void led_init_ports(void) { 3void led_init_ports(void) {
4 // Set our LED pins as output 4 // Set our LED pins as output
5 setPinOutput(B13); // LED1 5 gpio_set_pin_output(B13); // LED1
6 writePinLow(B13); 6 gpio_write_pin_low(B13);
7 setPinOutput(B14); // LED2 7 gpio_set_pin_output(B14); // LED2
8 writePinLow(B14); 8 gpio_write_pin_low(B14);
9 setPinOutput(A8); // LED3 9 gpio_set_pin_output(A8); // LED3
10 writePinLow(A8); 10 gpio_write_pin_low(A8);
11 setPinOutput(A0); // Capslock LED 11 gpio_set_pin_output(A0); // Capslock LED
12 writePinLow(A0); 12 gpio_write_pin_low(A0);
13} 13}
14 14
15bool led_update_kb(led_t led_state) { 15bool led_update_kb(led_t led_state) {
16 bool res = led_update_user(led_state); 16 bool res = led_update_user(led_state);
17 if(res) { 17 if(res) {
18 writePin(B13, led_state.num_lock); 18 gpio_write_pin(B13, led_state.num_lock);
19 writePin(A0, led_state.caps_lock); 19 gpio_write_pin(A0, led_state.caps_lock);
20 writePin(B14, led_state.caps_lock); 20 gpio_write_pin(B14, led_state.caps_lock);
21 writePin(A8, led_state.scroll_lock); 21 gpio_write_pin(A8, led_state.scroll_lock);
22 } 22 }
23 return res; 23 return res;
24} 24}
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) {
95 // set pins for pullups, Rts , power &etc. 95 // set pins for pullups, Rts , power &etc.
96 96
97 //print ("pins setup\n"); 97 //print ("pins setup\n");
98 setPinOutput(VCC_PIN); 98 gpio_set_pin_output(VCC_PIN);
99 writePinLow(VCC_PIN); 99 gpio_write_pin_low(VCC_PIN);
100 100
101#if ( HANDSPRING == 0) 101#if ( HANDSPRING == 0)
102 102
103#ifdef CY835 103#ifdef CY835
104 setPinOutput(GND_PIN); 104 gpio_set_pin_output(GND_PIN);
105 writePinLow(GND_PIN); 105 gpio_write_pin_low(GND_PIN);
106 106
107 setPinOutput(PULLDOWN_PIN); 107 gpio_set_pin_output(PULLDOWN_PIN);
108 writePinLow(PULLDOWN_PIN); 108 gpio_write_pin_low(PULLDOWN_PIN);
109#endif 109#endif
110 110
111 setPinInput(DCD_PIN); 111 gpio_set_pin_input(DCD_PIN);
112 setPinInput(RTS_PIN); 112 gpio_set_pin_input(RTS_PIN);
113#endif 113#endif
114 114
115/* check that the other side isn't powered up. 115/* check that the other side isn't powered up.
116 test=readPin(DCD_PIN); 116 test=gpio_read_pin(DCD_PIN);
117 xprintf("b%02X:", test); 117 xprintf("b%02X:", test);
118 test=readPin(RTS_PIN); 118 test=gpio_read_pin(RTS_PIN);
119 xprintf("%02X\n", test); 119 xprintf("%02X\n", test);
120*/ 120*/
121 121
@@ -128,16 +128,16 @@ uint8_t rts_reset(void) {
128// On boot, we keep rts as input, then switch roles here 128// On boot, we keep rts as input, then switch roles here
129// on leaving sleep, we toggle the same way 129// on leaving sleep, we toggle the same way
130 130
131 firstread=readPin(RTS_PIN); 131 firstread=gpio_read_pin(RTS_PIN);
132 // printf("r%02X:", firstread); 132 // printf("r%02X:", firstread);
133 133
134 setPinOutput(RTS_PIN); 134 gpio_set_pin_output(RTS_PIN);
135 135
136 if (firstread) { 136 if (firstread) {
137 writePinLow(RTS_PIN); 137 gpio_write_pin_low(RTS_PIN);
138 } 138 }
139 wait_ms(10); 139 wait_ms(10);
140 writePinHigh(RTS_PIN); 140 gpio_write_pin_high(RTS_PIN);
141 141
142 142
143/* the future is Arm 143/* the future is Arm
@@ -223,9 +223,9 @@ uint8_t handspring_handshake(void) {
223} 223}
224 224
225uint8_t handspring_reset(void) { 225uint8_t handspring_reset(void) {
226 writePinLow(VCC_PIN); 226 gpio_write_pin_low(VCC_PIN);
227 wait_ms(5); 227 wait_ms(5);
228 writePinHigh(VCC_PIN); 228 gpio_write_pin_high(VCC_PIN);
229 229
230 if ( handspring_handshake() ) { 230 if ( handspring_handshake() ) {
231 last_activity = timer_read(); 231 last_activity = timer_read();
@@ -249,7 +249,7 @@ void matrix_init(void)
249#endif 249#endif
250 250
251 print("power up\n"); 251 print("power up\n");
252 writePinHigh(VCC_PIN); 252 gpio_write_pin_high(VCC_PIN);
253 253
254 // wait for DCD strobe from keyboard - it will do this 254 // wait for DCD strobe from keyboard - it will do this
255 // up to 3 times, then the board needs the RTS toggled to try again 255 // up to 3 times, then the board needs the RTS toggled to try again
@@ -264,7 +264,7 @@ void matrix_init(void)
264 } 264 }
265 265
266#else /// Palm / HP device with DCD 266#else /// Palm / HP device with DCD
267 while( !readPin(DCD_PIN) ) {;} 267 while( !gpio_read_pin(DCD_PIN) ) {;}
268 print("dcd\n"); 268 print("dcd\n");
269 269
270 rts_reset(); // at this point the keyboard should think all is well. 270 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) {
79 79
80void matrix_init(void) { 80void matrix_init(void) {
81 //Set I/O as pull-up inputs to read states 81 //Set I/O as pull-up inputs to read states
82 setPinInputHigh(A0); 82 gpio_set_pin_input_high(A0);
83 setPinInputHigh(A1); 83 gpio_set_pin_input_high(A1);
84 setPinInputHigh(A2); 84 gpio_set_pin_input_high(A2);
85 setPinInputHigh(A3); 85 gpio_set_pin_input_high(A3);
86 setPinInputHigh(A4); 86 gpio_set_pin_input_high(A4);
87 setPinInputHigh(A5); 87 gpio_set_pin_input_high(A5);
88 setPinInputHigh(A6); 88 gpio_set_pin_input_high(A6);
89 setPinInputHigh(A7); 89 gpio_set_pin_input_high(A7);
90 setPinInputHigh(A8); 90 gpio_set_pin_input_high(A8);
91 setPinInputHigh(A9); 91 gpio_set_pin_input_high(A9);
92 setPinInputHigh(A10); 92 gpio_set_pin_input_high(A10);
93 setPinInputHigh(B3); 93 gpio_set_pin_input_high(B3);
94 setPinInputHigh(B4); 94 gpio_set_pin_input_high(B4);
95 setPinInputHigh(B5); 95 gpio_set_pin_input_high(B5);
96 setPinInputHigh(B6); 96 gpio_set_pin_input_high(B6);
97 setPinInputHigh(B7); 97 gpio_set_pin_input_high(B7);
98 setPinInputHigh(B8); 98 gpio_set_pin_input_high(B8);
99 setPinInputHigh(B9); 99 gpio_set_pin_input_high(B9);
100 setPinInputHigh(B11); 100 gpio_set_pin_input_high(B11);
101 setPinInputHigh(B12); 101 gpio_set_pin_input_high(B12);
102 setPinInputHigh(B13); 102 gpio_set_pin_input_high(B13);
103 setPinInputHigh(B14); 103 gpio_set_pin_input_high(B14);
104 setPinInputHigh(B15); 104 gpio_set_pin_input_high(B15);
105 105
106 memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); 106 memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
107 memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t)); 107 memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t));
@@ -207,7 +207,7 @@ uint8_t matrix_scan(void) {
207 matrix[3] = 0x00; 207 matrix[3] = 0x00;
208 } 208 }
209 //Special case for Shift 209 //Special case for Shift
210 if (readPin(B11) == 0) { matrix[3] |= 0x01; } 210 if (gpio_read_pin(B11) == 0) { matrix[3] |= 0x01; }
211 211
212 porta_buffer = 65535; 212 porta_buffer = 65535;
213 portb_buffer = 65535; 213 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/>.
34 34
35/* hard reset: low pulse for 500ms and after that HiZ for safety */ 35/* hard reset: low pulse for 500ms and after that HiZ for safety */
36#define XT_RESET() do { \ 36#define XT_RESET() do { \
37 writePinLow(XT_RST_PIN); \ 37 gpio_write_pin_low(XT_RST_PIN); \
38 setPinOutput(XT_RST_PIN); \ 38 gpio_set_pin_output(XT_RST_PIN); \
39 wait_ms(500); \ 39 wait_ms(500); \
40 setPinInput(XT_RST_PIN); \ 40 gpio_set_pin_input(XT_RST_PIN); \
41} while (0) 41} while (0)
42 42
43/* INT1 for falling edge of clock line */ 43/* 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.
43 43
44#define XT_DATA_IN() \ 44#define XT_DATA_IN() \
45 do { \ 45 do { \
46 setPinInput(XT_DATA_PIN); \ 46 gpio_set_pin_input(XT_DATA_PIN); \
47 writePinHigh(XT_DATA_PIN); \ 47 gpio_write_pin_high(XT_DATA_PIN); \
48 } while (0) 48 } while (0)
49 49
50#define XT_DATA_READ() readPin(XT_DATA_PIN) 50#define XT_DATA_READ() gpio_read_pin(XT_DATA_PIN)
51 51
52#define XT_DATA_LO() \ 52#define XT_DATA_LO() \
53 do { \ 53 do { \
54 writePinLow(XT_DATA_PIN); \ 54 gpio_write_pin_low(XT_DATA_PIN); \
55 setPinOutput(XT_DATA_PIN); \ 55 gpio_set_pin_output(XT_DATA_PIN); \
56 } while (0) 56 } while (0)
57 57
58#define XT_CLOCK_IN() \ 58#define XT_CLOCK_IN() \
59 do { \ 59 do { \
60 setPinInput(XT_CLOCK_PIN); \ 60 gpio_set_pin_input(XT_CLOCK_PIN); \
61 writePinHigh(XT_CLOCK_PIN); \ 61 gpio_write_pin_high(XT_CLOCK_PIN); \
62 } while (0) 62 } while (0)
63 63
64#define XT_CLOCK_READ() readPin(XT_CLOCK_PIN) 64#define XT_CLOCK_READ() gpio_read_pin(XT_CLOCK_PIN)
65 65
66#define XT_CLOCK_LO() \ 66#define XT_CLOCK_LO() \
67 do { \ 67 do { \
68 writePinLow(XT_CLOCK_PIN); \ 68 gpio_write_pin_low(XT_CLOCK_PIN); \
69 setPinOutput(XT_CLOCK_PIN); \ 69 gpio_set_pin_output(XT_CLOCK_PIN); \
70 } while (0) 70 } while (0)
71 71
72void xt_host_init(void); 72void xt_host_init(void);
diff --git a/keyboards/custommk/evo70_r2/matrix.c b/keyboards/custommk/evo70_r2/matrix.c
index 99c3428d80..5ee93a5c7d 100644
--- a/keyboards/custommk/evo70_r2/matrix.c
+++ b/keyboards/custommk/evo70_r2/matrix.c
@@ -10,7 +10,7 @@ void matrix_wait_for_pin(pin_t pin, uint8_t target_state) {
10 rtcnt_t start = chSysGetRealtimeCounterX(); 10 rtcnt_t start = chSysGetRealtimeCounterX();
11 rtcnt_t end = start + 5000; 11 rtcnt_t end = start + 5000;
12 while (chSysIsCounterWithinX(chSysGetRealtimeCounterX(), start, end)) { 12 while (chSysIsCounterWithinX(chSysGetRealtimeCounterX(), start, end)) {
13 if (readPin(pin) == target_state) { 13 if (gpio_read_pin(pin) == target_state) {
14 break; 14 break;
15 } 15 }
16 } 16 }
@@ -27,22 +27,22 @@ void matrix_wait_for_port(stm32_gpio_t *port, uint32_t target_bitmask) {
27} 27}
28 28
29void shift_pulse_clock(void) { 29void shift_pulse_clock(void) {
30 writePinHigh(COL_SHIFT_CLK_PIN); 30 gpio_write_pin_high(COL_SHIFT_CLK_PIN);
31 matrix_wait_for_pin(COL_SHIFT_CLK_PIN, 1); 31 matrix_wait_for_pin(COL_SHIFT_CLK_PIN, 1);
32 writePinLow(COL_SHIFT_CLK_PIN); 32 gpio_write_pin_low(COL_SHIFT_CLK_PIN);
33} 33}
34 34
35void matrix_init_custom(void) { 35void matrix_init_custom(void) {
36 //set all row pins as input with pullups 36 //set all row pins as input with pullups
37 for (int i = 0; i < MATRIX_ROWS; ++i) { 37 for (int i = 0; i < MATRIX_ROWS; ++i) {
38 writePinHigh(row_pins[i]); 38 gpio_write_pin_high(row_pins[i]);
39 setPinInputHigh(row_pins[i]); 39 gpio_set_pin_input_high(row_pins[i]);
40 } 40 }
41 41
42 //set all column pins high in ROW2COL matrix 42 //set all column pins high in ROW2COL matrix
43 setPinOutput(COL_SHIFT_IN_PIN); 43 gpio_set_pin_output(COL_SHIFT_IN_PIN);
44 setPinOutput(COL_SHIFT_CLK_PIN); 44 gpio_set_pin_output(COL_SHIFT_CLK_PIN);
45 writePinHigh(COL_SHIFT_IN_PIN); 45 gpio_write_pin_high(COL_SHIFT_IN_PIN);
46 matrix_wait_for_pin(COL_SHIFT_IN_PIN, 1); 46 matrix_wait_for_pin(COL_SHIFT_IN_PIN, 1);
47 47
48 for (int i = 0; i < MATRIX_COLS; ++i) { 48 for (int i = 0; i < MATRIX_COLS; ++i) {
@@ -54,13 +54,13 @@ void matrix_init_custom(void) {
54bool matrix_scan_custom(matrix_row_t current_matrix[]) { 54bool matrix_scan_custom(matrix_row_t current_matrix[]) {
55 static matrix_row_t temp_matrix[MATRIX_ROWS] = {0}; 55 static matrix_row_t temp_matrix[MATRIX_ROWS] = {0};
56 56
57 writePinLow(COL_SHIFT_IN_PIN); 57 gpio_write_pin_low(COL_SHIFT_IN_PIN);
58 matrix_wait_for_pin(COL_SHIFT_IN_PIN, 0); 58 matrix_wait_for_pin(COL_SHIFT_IN_PIN, 0);
59 59
60 // Setup the output column pin 60 // Setup the output column pin
61 shift_pulse_clock(); 61 shift_pulse_clock();
62 62
63 writePinHigh(COL_SHIFT_IN_PIN); 63 gpio_write_pin_high(COL_SHIFT_IN_PIN);
64 for (int current_col = 0; current_col < MATRIX_COLS; ++current_col) { 64 for (int current_col = 0; current_col < MATRIX_COLS; ++current_col) {
65 65
66 // Read the column ports 66 // Read the column ports
diff --git a/keyboards/cutie_club/wraith/wraith.c b/keyboards/cutie_club/wraith/wraith.c
index 799ac318e6..799648846c 100644
--- a/keyboards/cutie_club/wraith/wraith.c
+++ b/keyboards/cutie_club/wraith/wraith.c
@@ -16,7 +16,7 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 setPinOutput(B0); 19 gpio_set_pin_output(B0);
20 20
21 matrix_init_user(); 21 matrix_init_user();
22} 22}
diff --git a/keyboards/dark/magnum_ergo_1/magnum_ergo_1.c b/keyboards/dark/magnum_ergo_1/magnum_ergo_1.c
index 9125410df0..879d73e0f9 100644
--- a/keyboards/dark/magnum_ergo_1/magnum_ergo_1.c
+++ b/keyboards/dark/magnum_ergo_1/magnum_ergo_1.c
@@ -17,34 +17,34 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void keyoard_post_init_kb(void) { 19void keyoard_post_init_kb(void) {
20 setPinOutput(LED_CAPS_LOCK_PIN); 20 gpio_set_pin_output(LED_CAPS_LOCK_PIN);
21 setPinOutput(LED_INDICATOR_1); 21 gpio_set_pin_output(LED_INDICATOR_1);
22 setPinOutput(LED_INDICATOR_2); 22 gpio_set_pin_output(LED_INDICATOR_2);
23 setPinOutput(LED_INDICATOR_3); 23 gpio_set_pin_output(LED_INDICATOR_3);
24 setPinOutput(LED_INDICATOR_4); 24 gpio_set_pin_output(LED_INDICATOR_4);
25 setPinOutput(LED_INDICATOR_5); 25 gpio_set_pin_output(LED_INDICATOR_5);
26#ifndef LED_CAPS_LOCK_PIN 26#ifndef LED_CAPS_LOCK_PIN
27 writePin(LED_CAPS_LOCK_PIN, 0); 27 gpio_write_pin(LED_CAPS_LOCK_PIN, 0);
28#endif 28#endif
29 29
30#ifndef LED_INDICATOR_1 30#ifndef LED_INDICATOR_1
31 writePin(LED_INDICATOR_1, 0); 31 gpio_write_pin(LED_INDICATOR_1, 0);
32#endif 32#endif
33 33
34#ifndef LED_INDICATOR_2 34#ifndef LED_INDICATOR_2
35 writePin(LED_INDICATOR_2, 0); 35 gpio_write_pin(LED_INDICATOR_2, 0);
36#endif 36#endif
37 37
38#ifndef LED_INDICATOR_3 38#ifndef LED_INDICATOR_3
39 writePin(LED_INDICATOR_3, 0); 39 gpio_write_pin(LED_INDICATOR_3, 0);
40#endif 40#endif
41 41
42#ifndef LED_INDICATOR_4 42#ifndef LED_INDICATOR_4
43 writePin(LED_INDICATOR_4, 0); 43 gpio_write_pin(LED_INDICATOR_4, 0);
44#endif 44#endif
45 45
46#ifndef LED_INDICATOR_5 46#ifndef LED_INDICATOR_5
47 writePin(LED_INDICATOR_5, 0); 47 gpio_write_pin(LED_INDICATOR_5, 0);
48#endif 48#endif
49 keyboard_post_init_user(); 49 keyboard_post_init_user();
50} 50}
@@ -53,39 +53,39 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
53 switch (get_highest_layer(state)) { 53 switch (get_highest_layer(state)) {
54 case 1: 54 case 1:
55#ifdef LED_INDICATOR_4 55#ifdef LED_INDICATOR_4
56 writePin(LED_INDICATOR_4, 1); 56 gpio_write_pin(LED_INDICATOR_4, 1);
57#endif 57#endif
58 58
59#ifdef LED_INDICATOR_5 59#ifdef LED_INDICATOR_5
60 writePin(LED_INDICATOR_5, 1); 60 gpio_write_pin(LED_INDICATOR_5, 1);
61#endif 61#endif
62 break; 62 break;
63 case 2: 63 case 2:
64#ifdef LED_INDICATOR_1 64#ifdef LED_INDICATOR_1
65 writePin(LED_INDICATOR_1, 1); 65 gpio_write_pin(LED_INDICATOR_1, 1);
66#endif 66#endif
67#ifdef LED_INDICATOR_2 67#ifdef LED_INDICATOR_2
68 writePin(LED_INDICATOR_2, 1); 68 gpio_write_pin(LED_INDICATOR_2, 1);
69#endif 69#endif
70#ifdef LED_INDICATOR_3 70#ifdef LED_INDICATOR_3
71 writePin(LED_INDICATOR_3, 1); 71 gpio_write_pin(LED_INDICATOR_3, 1);
72#endif 72#endif
73 break; 73 break;
74 default: 74 default:
75#ifdef LED_INDICATOR_1 75#ifdef LED_INDICATOR_1
76 writePin(LED_INDICATOR_1, 0); 76 gpio_write_pin(LED_INDICATOR_1, 0);
77#endif 77#endif
78#ifdef LED_INDICATOR_2 78#ifdef LED_INDICATOR_2
79 writePin(LED_INDICATOR_2, 0); 79 gpio_write_pin(LED_INDICATOR_2, 0);
80#endif 80#endif
81#ifdef LED_INDICATOR_3 81#ifdef LED_INDICATOR_3
82 writePin(LED_INDICATOR_3, 0); 82 gpio_write_pin(LED_INDICATOR_3, 0);
83#endif 83#endif
84#ifdef LED_INDICATOR_4 84#ifdef LED_INDICATOR_4
85 writePin(LED_INDICATOR_4, 0); 85 gpio_write_pin(LED_INDICATOR_4, 0);
86#endif 86#endif
87#ifdef LED_INDICATOR_5 87#ifdef LED_INDICATOR_5
88 writePin(LED_INDICATOR_5, 0); 88 gpio_write_pin(LED_INDICATOR_5, 0);
89#endif 89#endif
90 break; 90 break;
91 } 91 }
diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c
index f21aeeb38d..00521bc2be 100644
--- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c
+++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c
@@ -132,9 +132,9 @@ void spi_init(void) {
132 is_initialised = true; 132 is_initialised = true;
133 133
134 // Try releasing special pins for a short time 134 // Try releasing special pins for a short time
135 setPinInput(SPI_SCK_PIN); 135 gpio_set_pin_input(SPI_SCK_PIN);
136 setPinInput(SPI_MOSI_PIN); 136 gpio_set_pin_input(SPI_MOSI_PIN);
137 setPinInput(SPI_MISO_PIN); 137 gpio_set_pin_input(SPI_MISO_PIN);
138 138
139 chThdSleepMilliseconds(10); 139 chThdSleepMilliseconds(10);
140 140
@@ -147,12 +147,12 @@ void spi_init(void) {
147#endif 147#endif
148 148
149void keyboard_pre_init_kb(void) { 149void keyboard_pre_init_kb(void) {
150 setPinOutput(C0); 150 gpio_set_pin_output(C0);
151 setPinOutput(C15); 151 gpio_set_pin_output(C15);
152 keyboard_pre_init_user(); 152 keyboard_pre_init_user();
153}; 153};
154void housekeeping_task_kb(void) { 154void housekeeping_task_kb(void) {
155 writePin(C15, keymap_config.no_gui); 155 gpio_write_pin(C15, keymap_config.no_gui);
156}; 156};
157 157
158bool process_record_kb(uint16_t keycode, keyrecord_t *record) { 158bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
diff --git a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c
index 20a46e343e..05c2be542b 100644
--- a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c
+++ b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c
@@ -133,9 +133,9 @@ void spi_init(void) {
133 is_initialised = true; 133 is_initialised = true;
134 134
135 // Try releasing special pins for a short time 135 // Try releasing special pins for a short time
136 setPinInput(SPI_SCK_PIN); 136 gpio_set_pin_input(SPI_SCK_PIN);
137 setPinInput(SPI_MOSI_PIN); 137 gpio_set_pin_input(SPI_MOSI_PIN);
138 setPinInput(SPI_MISO_PIN); 138 gpio_set_pin_input(SPI_MISO_PIN);
139 139
140 chThdSleepMilliseconds(10); 140 chThdSleepMilliseconds(10);
141 141
@@ -148,12 +148,12 @@ void spi_init(void) {
148#endif 148#endif
149 149
150void keyboard_pre_init_kb(void) { 150void keyboard_pre_init_kb(void) {
151 setPinOutput(C0); 151 gpio_set_pin_output(C0);
152 setPinOutput(C15); 152 gpio_set_pin_output(C15);
153 keyboard_pre_init_user(); 153 keyboard_pre_init_user();
154}; 154};
155void housekeeping_task_kb(void) { 155void housekeeping_task_kb(void) {
156 writePin(C15, keymap_config.no_gui); 156 gpio_write_pin(C15, keymap_config.no_gui);
157}; 157};
158 158
159bool process_record_kb(uint16_t keycode, keyrecord_t *record) { 159bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
diff --git a/keyboards/dekunukem/duckypad/duckypad.c b/keyboards/dekunukem/duckypad/duckypad.c
index 7e486c4550..b56f2d12e9 100644
--- a/keyboards/dekunukem/duckypad/duckypad.c
+++ b/keyboards/dekunukem/duckypad/duckypad.c
@@ -21,11 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21#include "quantum.h" 21#include "quantum.h"
22 22
23void keyboard_pre_init_kb(void) { 23void keyboard_pre_init_kb(void) {
24 setPinOutput(A0); 24 gpio_set_pin_output(A0);
25 writePinHigh(A0); 25 gpio_write_pin_high(A0);
26 writePinLow(A0); 26 gpio_write_pin_low(A0);
27 wait_ms(10); 27 wait_ms(10);
28 writePinHigh(A0); 28 gpio_write_pin_high(A0);
29 29
30 keyboard_pre_init_user(); 30 keyboard_pre_init_user();
31} 31}
diff --git a/keyboards/dichotomy/dichotomy.c b/keyboards/dichotomy/dichotomy.c
index 4301d9b67d..584151fdd3 100755
--- a/keyboards/dichotomy/dichotomy.c
+++ b/keyboards/dichotomy/dichotomy.c
@@ -60,13 +60,13 @@ bool pointing_device_task(void){
60} 60}
61 61
62void led_init(void) { 62void led_init(void) {
63 setPinOutput(D1); 63 gpio_set_pin_output(D1);
64 setPinOutput(F5); 64 gpio_set_pin_output(F5);
65 setPinOutput(F6); 65 gpio_set_pin_output(F6);
66 66
67 writePinHigh(D1); 67 gpio_write_pin_high(D1);
68 writePinHigh(F5); 68 gpio_write_pin_high(F5);
69 writePinHigh(F6); 69 gpio_write_pin_high(F6);
70} 70}
71 71
72 72
diff --git a/keyboards/dichotomy/dichotomy.h b/keyboards/dichotomy/dichotomy.h
index f62ed49aa0..5783bd637b 100755
--- a/keyboards/dichotomy/dichotomy.h
+++ b/keyboards/dichotomy/dichotomy.h
@@ -4,12 +4,12 @@
4#include "pointing_device.h" 4#include "pointing_device.h"
5#include "quantum.h" 5#include "quantum.h"
6 6
7#define red_led_off() writePinHigh(F6) 7#define red_led_off() gpio_write_pin_high(F6)
8#define red_led_on() writePinLow(F6) 8#define red_led_on() gpio_write_pin_low(F6)
9#define blu_led_off() writePinHigh(F5) 9#define blu_led_off() gpio_write_pin_high(F5)
10#define blu_led_on() writePinLow(F5) 10#define blu_led_on() gpio_write_pin_low(F5)
11#define grn_led_off() writePinHigh(D1) 11#define grn_led_off() gpio_write_pin_high(D1)
12#define grn_led_on() writePinLow(D1) 12#define grn_led_on() gpio_write_pin_low(D1)
13 13
14#define red_led(flag) if (flag) red_led_on(); else red_led_off() 14#define red_led(flag) if (flag) red_led_on(); else red_led_off()
15#define blu_led(flag) if (flag) blu_led_on(); else blu_led_off() 15#define blu_led(flag) if (flag) blu_led_on(); else blu_led_off()
diff --git a/keyboards/dinofizz/fnrow/v1/v1.c b/keyboards/dinofizz/fnrow/v1/v1.c
index d2a5cd7120..546051acfc 100644
--- a/keyboards/dinofizz/fnrow/v1/v1.c
+++ b/keyboards/dinofizz/fnrow/v1/v1.c
@@ -17,8 +17,8 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // Immediately set the LED pin as an output and set it ON 19 // Immediately set the LED pin as an output and set it ON
20 setPinOutput(A15); 20 gpio_set_pin_output(A15);
21 writePinHigh(A15); 21 gpio_write_pin_high(A15);
22 22
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
@@ -26,11 +26,11 @@ void keyboard_pre_init_kb(void) {
26void keyboard_post_init_kb(void) { 26void keyboard_post_init_kb(void) {
27 // Blink the LED so we know everything is running OK 27 // Blink the LED so we know everything is running OK
28 // Finish with LED OFF 28 // Finish with LED OFF
29 writePinLow(A15); 29 gpio_write_pin_low(A15);
30 wait_ms(100); 30 wait_ms(100);
31 writePinHigh(A15); 31 gpio_write_pin_high(A15);
32 wait_ms(100); 32 wait_ms(100);
33 writePinLow(A15); 33 gpio_write_pin_low(A15);
34 34
35 keyboard_post_init_user(); 35 keyboard_post_init_user();
36} 36}
diff --git a/keyboards/dk60/dk60.c b/keyboards/dk60/dk60.c
index 382404c032..5bc9d5cd5c 100644
--- a/keyboards/dk60/dk60.c
+++ b/keyboards/dk60/dk60.c
@@ -40,8 +40,8 @@ void matrix_init_kb(void) {
40} 40}
41 41
42void led_init_ports(void) { 42void led_init_ports(void) {
43 setPinOutput(E6); 43 gpio_set_pin_output(E6);
44 setPinOutput(F0); 44 gpio_set_pin_output(F0);
45} 45}
46 46
47void led_update_ports(led_t led_state) { 47void led_update_ports(led_t led_state) {
diff --git a/keyboards/dk60/dk60.h b/keyboards/dk60/dk60.h
index 05e790d525..e240687661 100644
--- a/keyboards/dk60/dk60.h
+++ b/keyboards/dk60/dk60.h
@@ -19,11 +19,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20#include "quantum.h" 20#include "quantum.h"
21 21
22inline void dk60_caps_led_on(void) { writePinHigh(E6); } 22inline void dk60_caps_led_on(void) { gpio_write_pin_high(E6); }
23inline void dk60_esc_led_on(void) { writePinHigh(F0); } 23inline void dk60_esc_led_on(void) { gpio_write_pin_high(F0); }
24 24
25inline void dk60_caps_led_off(void) { writePinLow(E6); } 25inline void dk60_caps_led_off(void) { gpio_write_pin_low(E6); }
26inline void dk60_esc_led_off(void) { writePinLow(F0); } 26inline void dk60_esc_led_off(void) { gpio_write_pin_low(F0); }
27 27
28inline void dk60_led_all_on(void) { 28inline void dk60_led_all_on(void) {
29 dk60_caps_led_on(); 29 dk60_caps_led_on();
diff --git a/keyboards/dm9records/lain/lain.c b/keyboards/dm9records/lain/lain.c
index cb8354e5c2..bdea60f90f 100644
--- a/keyboards/dm9records/lain/lain.c
+++ b/keyboards/dm9records/lain/lain.c
@@ -12,7 +12,7 @@ void lain_eeconfig_update_kb(void) { eeconfig_update_kb(lain_config.raw); }
12 12
13void lain_set_led(uint8_t no, bool flag) { 13void lain_set_led(uint8_t no, bool flag) {
14 led_states[no] = flag; 14 led_states[no] = flag;
15 writePin(leds[no], lain_config.led_enabled ? flag : false); 15 gpio_write_pin(leds[no], lain_config.led_enabled ? flag : false);
16} 16}
17 17
18void lain_enable_leds(bool flag) { 18void lain_enable_leds(bool flag) {
@@ -20,7 +20,7 @@ void lain_enable_leds(bool flag) {
20 lain_eeconfig_update_kb(); 20 lain_eeconfig_update_kb();
21 21
22 for (int i = 0; i < LED_NUM; i++) { 22 for (int i = 0; i < LED_NUM; i++) {
23 writePin(leds[i], lain_config.led_enabled ? led_states[i] : false); 23 gpio_write_pin(leds[i], lain_config.led_enabled ? led_states[i] : false);
24 } 24 }
25} 25}
26 26
@@ -28,7 +28,7 @@ void lain_enable_leds_toggle(void) { lain_enable_leds(!lain_config.led_enabled);
28 28
29void led_init_ports(void) { 29void led_init_ports(void) {
30 for (uint8_t i = 0; i < LED_NUM; i++) { 30 for (uint8_t i = 0; i < LED_NUM; i++) {
31 setPinOutput(leds[i]); 31 gpio_set_pin_output(leds[i]);
32 lain_set_led(leds[i], 0); 32 lain_set_led(leds[i], 0);
33 } 33 }
34} 34}
diff --git a/keyboards/doppelganger/doppelganger.c b/keyboards/doppelganger/doppelganger.c
index 9a9fc0679f..4a62fdf45f 100644
--- a/keyboards/doppelganger/doppelganger.c
+++ b/keyboards/doppelganger/doppelganger.c
@@ -16,30 +16,30 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 setPinOutput(C6); 19 gpio_set_pin_output(C6);
20 setPinOutput(B0); 20 gpio_set_pin_output(B0);
21} 21}
22 22
23bool led_update_kb(led_t led_state) { 23bool led_update_kb(led_t led_state) {
24 bool res = led_update_user(led_state); 24 bool res = led_update_user(led_state);
25 if (res) { 25 if (res) {
26 // writePin sets the pin high for 1 and low for 0. 26 // gpio_write_pin sets the pin high for 1 and low for 0.
27 // In this example the pins are inverted, setting 27 // In this example the pins are inverted, setting
28 // it low/0 turns it on, and high/1 turns the LED off. 28 // it low/0 turns it on, and high/1 turns the LED off.
29 // This behavior depends on whether the LED is between the pin 29 // This behavior depends on whether the LED is between the pin
30 // and VCC or the pin and GND. 30 // and VCC or the pin and GND.
31 writePin(C6, !led_state.caps_lock); 31 gpio_write_pin(C6, !led_state.caps_lock);
32 } 32 }
33 return res; 33 return res;
34} 34}
35 35
36__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { 36__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
37 writePin(B0, !(state & (1UL << 1))); 37 gpio_write_pin(B0, !(state & (1UL << 1)));
38 return state; 38 return state;
39} 39}
40 40
41// Override core logic as we reuse SPLIT_HAND_PIN within matrix pins 41// Override core logic as we reuse SPLIT_HAND_PIN within matrix pins
42bool is_keyboard_left(void) { 42bool is_keyboard_left(void) {
43 setPinInput(SPLIT_HAND_PIN); 43 gpio_set_pin_input(SPLIT_HAND_PIN);
44 return readPin(SPLIT_HAND_PIN); 44 return gpio_read_pin(SPLIT_HAND_PIN);
45} 45}
diff --git a/keyboards/dp60/matrix.c b/keyboards/dp60/matrix.c
index 22156745f1..998efd59fe 100644
--- a/keyboards/dp60/matrix.c
+++ b/keyboards/dp60/matrix.c
@@ -54,10 +54,10 @@ void matrix_scan_user(void) {}
54 54
55void matrix_init(void) 55void matrix_init(void)
56{ 56{
57 //setPinOutput(F0); 57 //gpio_set_pin_output(F0);
58 //writePinHigh(F0); 58 //gpio_write_pin_high(F0);
59 setPinOutput(B4); 59 gpio_set_pin_output(B4);
60 writePinLow(B4); 60 gpio_write_pin_low(B4);
61 61
62 init_cols(); 62 init_cols();
63 init_rows(); 63 init_rows();
@@ -123,20 +123,20 @@ void matrix_print(void)
123 */ 123 */
124static void init_rows(void) 124static void init_rows(void)
125{ 125{
126 setPinInputHigh(E6); 126 gpio_set_pin_input_high(E6);
127 setPinInputHigh(F6); 127 gpio_set_pin_input_high(F6);
128 setPinInputHigh(F7); 128 gpio_set_pin_input_high(F7);
129 setPinInputHigh(B7); 129 gpio_set_pin_input_high(B7);
130 setPinInputHigh(D4); 130 gpio_set_pin_input_high(D4);
131} 131}
132 132
133static uint8_t read_rows(void) 133static uint8_t read_rows(void)
134{ 134{
135 return ((readPin(E6) ? 0 : (1 << 0)) | 135 return ((gpio_read_pin(E6) ? 0 : (1 << 0)) |
136 (readPin(F6) ? 0 : (1 << 1)) | 136 (gpio_read_pin(F6) ? 0 : (1 << 1)) |
137 (readPin(F7) ? 0 : (1 << 2)) | 137 (gpio_read_pin(F7) ? 0 : (1 << 2)) |
138 (readPin(B7) ? 0 : (1 << 3)) | 138 (gpio_read_pin(B7) ? 0 : (1 << 3)) |
139 (readPin(D4) ? 0 : (1 << 4))); 139 (gpio_read_pin(D4) ? 0 : (1 << 4)));
140} 140}
141 141
142/* 142/*
@@ -164,104 +164,104 @@ static uint8_t read_rows(void)
164 */ 164 */
165static void init_cols(void) 165static void init_cols(void)
166{ 166{
167 setPinOutput(F0); 167 gpio_set_pin_output(F0);
168 setPinOutput(F1); 168 gpio_set_pin_output(F1);
169 setPinOutput(F4); 169 gpio_set_pin_output(F4);
170 setPinOutput(F5); 170 gpio_set_pin_output(F5);
171 171
172 setPinOutput(D2); 172 gpio_set_pin_output(D2);
173 setPinOutput(D3); 173 gpio_set_pin_output(D3);
174 setPinOutput(D5); 174 gpio_set_pin_output(D5);
175 setPinOutput(D6); 175 gpio_set_pin_output(D6);
176 176
177 unselect_cols(); 177 unselect_cols();
178} 178}
179 179
180static void unselect_cols(void) 180static void unselect_cols(void)
181{ 181{
182 writePinHigh(F0); 182 gpio_write_pin_high(F0);
183 writePinHigh(F1); 183 gpio_write_pin_high(F1);
184 writePinHigh(F4); 184 gpio_write_pin_high(F4);
185 writePinHigh(F5); 185 gpio_write_pin_high(F5);
186 186
187 writePinHigh(D2); 187 gpio_write_pin_high(D2);
188 writePinHigh(D3); 188 gpio_write_pin_high(D3);
189 writePinHigh(D5); 189 gpio_write_pin_high(D5);
190 writePinHigh(D6); 190 gpio_write_pin_high(D6);
191} 191}
192 192
193static void select_col(uint8_t col) { 193static void select_col(uint8_t col) {
194 194
195 switch (col) { 195 switch (col) {
196 case 0: 196 case 0:
197 writePinLow(F0); 197 gpio_write_pin_low(F0);
198 writePinLow(F1); 198 gpio_write_pin_low(F1);
199 writePinLow(F4); 199 gpio_write_pin_low(F4);
200 break; 200 break;
201 case 1: 201 case 1:
202 writePinHigh(F0); 202 gpio_write_pin_high(F0);
203 writePinLow(F1); 203 gpio_write_pin_low(F1);
204 writePinLow(F4); 204 gpio_write_pin_low(F4);
205 break; 205 break;
206 case 2: 206 case 2:
207 writePinLow(F0); 207 gpio_write_pin_low(F0);
208 writePinHigh(F1); 208 gpio_write_pin_high(F1);
209 writePinLow(F4); 209 gpio_write_pin_low(F4);
210 break; 210 break;
211 case 3: 211 case 3:
212 writePinHigh(F0); 212 gpio_write_pin_high(F0);
213 writePinHigh(F1); 213 gpio_write_pin_high(F1);
214 writePinLow(F4); 214 gpio_write_pin_low(F4);
215 break; 215 break;
216 case 4: 216 case 4:
217 writePinLow(F0); 217 gpio_write_pin_low(F0);
218 writePinLow(F1); 218 gpio_write_pin_low(F1);
219 writePinHigh(F4); 219 gpio_write_pin_high(F4);
220 break; 220 break;
221 case 5: 221 case 5:
222 writePinHigh(F0); 222 gpio_write_pin_high(F0);
223 writePinLow(F1); 223 gpio_write_pin_low(F1);
224 writePinHigh(F4); 224 gpio_write_pin_high(F4);
225 break; 225 break;
226 case 6: 226 case 6:
227 writePinLow(F0); 227 gpio_write_pin_low(F0);
228 writePinHigh(F1); 228 gpio_write_pin_high(F1);
229 writePinHigh(F4); 229 gpio_write_pin_high(F4);
230 break; 230 break;
231 case 7: 231 case 7:
232 writePinLow(D2); 232 gpio_write_pin_low(D2);
233 writePinLow(D3); 233 gpio_write_pin_low(D3);
234 writePinLow(D5); 234 gpio_write_pin_low(D5);
235 break; 235 break;
236 case 8: 236 case 8:
237 writePinHigh(D2); 237 gpio_write_pin_high(D2);
238 writePinLow(D3); 238 gpio_write_pin_low(D3);
239 writePinLow(D5); 239 gpio_write_pin_low(D5);
240 break; 240 break;
241 case 9: 241 case 9:
242 writePinLow(D2); 242 gpio_write_pin_low(D2);
243 writePinHigh(D3); 243 gpio_write_pin_high(D3);
244 writePinLow(D5); 244 gpio_write_pin_low(D5);
245 break; 245 break;
246 case 10: 246 case 10:
247 writePinHigh(D2); 247 gpio_write_pin_high(D2);
248 writePinHigh(D3); 248 gpio_write_pin_high(D3);
249 writePinLow(D5); 249 gpio_write_pin_low(D5);
250 break; 250 break;
251 case 11: 251 case 11:
252 writePinLow(D2); 252 gpio_write_pin_low(D2);
253 writePinLow(D3); 253 gpio_write_pin_low(D3);
254 writePinHigh(D5); 254 gpio_write_pin_high(D5);
255 break; 255 break;
256 case 12: 256 case 12:
257 writePinHigh(D2); 257 gpio_write_pin_high(D2);
258 writePinLow(D3); 258 gpio_write_pin_low(D3);
259 writePinHigh(D5); 259 gpio_write_pin_high(D5);
260 break; 260 break;
261 case 13: 261 case 13:
262 writePinLow(D2); 262 gpio_write_pin_low(D2);
263 writePinHigh(D3); 263 gpio_write_pin_high(D3);
264 writePinHigh(D5); 264 gpio_write_pin_high(D5);
265 break; 265 break;
266 } 266 }
267} 267}
diff --git a/keyboards/drop/lib/mux.c b/keyboards/drop/lib/mux.c
index 85a657544f..3941552686 100644
--- a/keyboards/drop/lib/mux.c
+++ b/keyboards/drop/lib/mux.c
@@ -22,8 +22,8 @@
22#define C2_B5_SENSE B0 22#define C2_B5_SENSE B0
23 23
24static inline void digital_write(pin_t pin, uint8_t level) { 24static inline void digital_write(pin_t pin, uint8_t level) {
25 setPinOutput(pin); 25 gpio_set_pin_output(pin);
26 writePin(pin, level); 26 gpio_write_pin(pin, level);
27} 27}
28 28
29uint16_t v_con_1 = 0; 29uint16_t v_con_1 = 0;
@@ -42,10 +42,10 @@ void keyboard_USB_enable(void) {
42 digital_write(SRC_1, 1); 42 digital_write(SRC_1, 1);
43 digital_write(SRC_2, 1); 43 digital_write(SRC_2, 1);
44 44
45 setPinInput(C1_A5_SENSE); 45 gpio_set_pin_input(C1_A5_SENSE);
46 setPinInput(C1_B5_SENSE); 46 gpio_set_pin_input(C1_B5_SENSE);
47 setPinInput(C2_A5_SENSE); 47 gpio_set_pin_input(C2_A5_SENSE);
48 setPinInput(C2_B5_SENSE); 48 gpio_set_pin_input(C2_B5_SENSE);
49 49
50 // reset hub 50 // reset hub
51 digital_write(HUB_RESET_N, 0); 51 digital_write(HUB_RESET_N, 0);
diff --git a/keyboards/duck/orion/v3/matrix.c b/keyboards/duck/orion/v3/matrix.c
index f392b9b190..1dd07a6567 100644
--- a/keyboards/duck/orion/v3/matrix.c
+++ b/keyboards/duck/orion/v3/matrix.c
@@ -56,13 +56,13 @@ void matrix_scan_user(void) {
56void indicator_init_ports(void) { 56void indicator_init_ports(void) {
57 57
58 // Num LED 58 // Num LED
59 setPinOutput(B4); 59 gpio_set_pin_output(B4);
60 60
61 // Caps Lock 61 // Caps Lock
62 setPinOutput(B0); 62 gpio_set_pin_output(B0);
63 63
64 // Scroll Lock 64 // Scroll Lock
65 setPinOutput(D7); 65 gpio_set_pin_output(D7);
66} 66}
67 67
68void matrix_init(void) { 68void matrix_init(void) {
diff --git a/keyboards/duck/orion/v3/v3.c b/keyboards/duck/orion/v3/v3.c
index 87e3cc0f37..c0ca9ddd06 100644
--- a/keyboards/duck/orion/v3/v3.c
+++ b/keyboards/duck/orion/v3/v3.c
@@ -31,9 +31,9 @@
31// of the Escape key. 31// of the Escape key.
32bool led_update_kb(led_t led_state) { 32bool led_update_kb(led_t led_state) {
33 if(led_update_user(led_state)) { 33 if(led_update_user(led_state)) {
34 writePin(B0, !led_state.caps_lock); 34 gpio_write_pin(B0, !led_state.caps_lock);
35 writePin(B4, !led_state.num_lock); 35 gpio_write_pin(B4, !led_state.num_lock);
36 writePin(D7, !led_state.scroll_lock); 36 gpio_write_pin(D7, !led_state.scroll_lock);
37 } 37 }
38 return true; 38 return true;
39} 39}
diff --git a/keyboards/dumbpad/v0x/v0x.c b/keyboards/dumbpad/v0x/v0x.c
index d7e3841d76..8625bb12c2 100644
--- a/keyboards/dumbpad/v0x/v0x.c
+++ b/keyboards/dumbpad/v0x/v0x.c
@@ -17,8 +17,8 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs 19 // Set LED IO as outputs
20 setPinOutput(LED_00); 20 gpio_set_pin_output(LED_00);
21 setPinOutput(LED_01); 21 gpio_set_pin_output(LED_01);
22 keyboard_pre_init_user(); 22 keyboard_pre_init_user();
23} 23}
24 24
@@ -27,16 +27,16 @@ bool shutdown_kb(bool jump_to_bootloader) {
27 return false; 27 return false;
28 } 28 }
29 // Shutdown LEDs 29 // Shutdown LEDs
30 writePinLow(LED_00); 30 gpio_write_pin_low(LED_00);
31 writePinLow(LED_01); 31 gpio_write_pin_low(LED_01);
32 return true; 32 return true;
33} 33}
34 34
35layer_state_t layer_state_set_kb(layer_state_t state) { 35layer_state_t layer_state_set_kb(layer_state_t state) {
36 // Layer LEDs act as binary indication of current layer 36 // Layer LEDs act as binary indication of current layer
37 uint8_t layer = get_highest_layer(state); 37 uint8_t layer = get_highest_layer(state);
38 writePin(LED_00, layer & 0b1); 38 gpio_write_pin(LED_00, layer & 0b1);
39 writePin(LED_01, (layer >> 1) & 0b1); 39 gpio_write_pin(LED_01, (layer >> 1) & 0b1);
40 return layer_state_set_user(state); 40 return layer_state_set_user(state);
41} 41}
42 42
@@ -49,11 +49,11 @@ void matrix_init_kb(void) {
49 // runs once when the firmware starts up 49 // runs once when the firmware starts up
50 uint8_t led_delay_ms = 80; 50 uint8_t led_delay_ms = 80;
51 for (int i = 0; i < 2; i++) { 51 for (int i = 0; i < 2; i++) {
52 writePinHigh(LED_00); 52 gpio_write_pin_high(LED_00);
53 writePinHigh(LED_01); 53 gpio_write_pin_high(LED_01);
54 wait_ms(led_delay_ms); 54 wait_ms(led_delay_ms);
55 writePinLow(LED_00); 55 gpio_write_pin_low(LED_00);
56 writePinLow(LED_01); 56 gpio_write_pin_low(LED_01);
57 if (i < 1) { 57 if (i < 1) {
58 wait_ms(led_delay_ms); 58 wait_ms(led_delay_ms);
59 } 59 }
diff --git a/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c b/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c
index d7e3841d76..8625bb12c2 100644
--- a/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c
+++ b/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c
@@ -17,8 +17,8 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs 19 // Set LED IO as outputs
20 setPinOutput(LED_00); 20 gpio_set_pin_output(LED_00);
21 setPinOutput(LED_01); 21 gpio_set_pin_output(LED_01);
22 keyboard_pre_init_user(); 22 keyboard_pre_init_user();
23} 23}
24 24
@@ -27,16 +27,16 @@ bool shutdown_kb(bool jump_to_bootloader) {
27 return false; 27 return false;
28 } 28 }
29 // Shutdown LEDs 29 // Shutdown LEDs
30 writePinLow(LED_00); 30 gpio_write_pin_low(LED_00);
31 writePinLow(LED_01); 31 gpio_write_pin_low(LED_01);
32 return true; 32 return true;
33} 33}
34 34
35layer_state_t layer_state_set_kb(layer_state_t state) { 35layer_state_t layer_state_set_kb(layer_state_t state) {
36 // Layer LEDs act as binary indication of current layer 36 // Layer LEDs act as binary indication of current layer
37 uint8_t layer = get_highest_layer(state); 37 uint8_t layer = get_highest_layer(state);
38 writePin(LED_00, layer & 0b1); 38 gpio_write_pin(LED_00, layer & 0b1);
39 writePin(LED_01, (layer >> 1) & 0b1); 39 gpio_write_pin(LED_01, (layer >> 1) & 0b1);
40 return layer_state_set_user(state); 40 return layer_state_set_user(state);
41} 41}
42 42
@@ -49,11 +49,11 @@ void matrix_init_kb(void) {
49 // runs once when the firmware starts up 49 // runs once when the firmware starts up
50 uint8_t led_delay_ms = 80; 50 uint8_t led_delay_ms = 80;
51 for (int i = 0; i < 2; i++) { 51 for (int i = 0; i < 2; i++) {
52 writePinHigh(LED_00); 52 gpio_write_pin_high(LED_00);
53 writePinHigh(LED_01); 53 gpio_write_pin_high(LED_01);
54 wait_ms(led_delay_ms); 54 wait_ms(led_delay_ms);
55 writePinLow(LED_00); 55 gpio_write_pin_low(LED_00);
56 writePinLow(LED_01); 56 gpio_write_pin_low(LED_01);
57 if (i < 1) { 57 if (i < 1) {
58 wait_ms(led_delay_ms); 58 wait_ms(led_delay_ms);
59 } 59 }
diff --git a/keyboards/dumbpad/v0x_right/v0x_right.c b/keyboards/dumbpad/v0x_right/v0x_right.c
index d7e3841d76..8625bb12c2 100644
--- a/keyboards/dumbpad/v0x_right/v0x_right.c
+++ b/keyboards/dumbpad/v0x_right/v0x_right.c
@@ -17,8 +17,8 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs 19 // Set LED IO as outputs
20 setPinOutput(LED_00); 20 gpio_set_pin_output(LED_00);
21 setPinOutput(LED_01); 21 gpio_set_pin_output(LED_01);
22 keyboard_pre_init_user(); 22 keyboard_pre_init_user();
23} 23}
24 24
@@ -27,16 +27,16 @@ bool shutdown_kb(bool jump_to_bootloader) {
27 return false; 27 return false;
28 } 28 }
29 // Shutdown LEDs 29 // Shutdown LEDs
30 writePinLow(LED_00); 30 gpio_write_pin_low(LED_00);
31 writePinLow(LED_01); 31 gpio_write_pin_low(LED_01);
32 return true; 32 return true;
33} 33}
34 34
35layer_state_t layer_state_set_kb(layer_state_t state) { 35layer_state_t layer_state_set_kb(layer_state_t state) {
36 // Layer LEDs act as binary indication of current layer 36 // Layer LEDs act as binary indication of current layer
37 uint8_t layer = get_highest_layer(state); 37 uint8_t layer = get_highest_layer(state);
38 writePin(LED_00, layer & 0b1); 38 gpio_write_pin(LED_00, layer & 0b1);
39 writePin(LED_01, (layer >> 1) & 0b1); 39 gpio_write_pin(LED_01, (layer >> 1) & 0b1);
40 return layer_state_set_user(state); 40 return layer_state_set_user(state);
41} 41}
42 42
@@ -49,11 +49,11 @@ void matrix_init_kb(void) {
49 // runs once when the firmware starts up 49 // runs once when the firmware starts up
50 uint8_t led_delay_ms = 80; 50 uint8_t led_delay_ms = 80;
51 for (int i = 0; i < 2; i++) { 51 for (int i = 0; i < 2; i++) {
52 writePinHigh(LED_00); 52 gpio_write_pin_high(LED_00);
53 writePinHigh(LED_01); 53 gpio_write_pin_high(LED_01);
54 wait_ms(led_delay_ms); 54 wait_ms(led_delay_ms);
55 writePinLow(LED_00); 55 gpio_write_pin_low(LED_00);
56 writePinLow(LED_01); 56 gpio_write_pin_low(LED_01);
57 if (i < 1) { 57 if (i < 1) {
58 wait_ms(led_delay_ms); 58 wait_ms(led_delay_ms);
59 } 59 }
diff --git a/keyboards/dumbpad/v1x/v1x.c b/keyboards/dumbpad/v1x/v1x.c
index 1022ad0605..cdbaff54aa 100644
--- a/keyboards/dumbpad/v1x/v1x.c
+++ b/keyboards/dumbpad/v1x/v1x.c
@@ -17,9 +17,9 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs 19 // Set LED IO as outputs
20 setPinOutput(LED_00); 20 gpio_set_pin_output(LED_00);
21 setPinOutput(LED_01); 21 gpio_set_pin_output(LED_01);
22 setPinOutput(LED_02); 22 gpio_set_pin_output(LED_02);
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
25 25
@@ -28,17 +28,17 @@ bool shutdown_kb(bool jump_to_bootloader) {
28 return false; 28 return false;
29 } 29 }
30 // Shutdown LEDs 30 // Shutdown LEDs
31 writePinLow(LED_00); 31 gpio_write_pin_low(LED_00);
32 writePinLow(LED_01); 32 gpio_write_pin_low(LED_01);
33 writePinLow(LED_02); 33 gpio_write_pin_low(LED_02);
34 return true; 34 return true;
35} 35}
36 36
37layer_state_t layer_state_set_kb(layer_state_t state) { 37layer_state_t layer_state_set_kb(layer_state_t state) {
38 // Layer LEDs act as binary indication of current layer 38 // Layer LEDs act as binary indication of current layer
39 uint8_t layer = get_highest_layer(state); 39 uint8_t layer = get_highest_layer(state);
40 writePin(LED_00, layer & 0b1); 40 gpio_write_pin(LED_00, layer & 0b1);
41 writePin(LED_01, (layer >> 1) & 0b1); 41 gpio_write_pin(LED_01, (layer >> 1) & 0b1);
42 return layer_state_set_user(state); 42 return layer_state_set_user(state);
43} 43}
44 44
@@ -51,13 +51,13 @@ void matrix_init_kb(void) {
51 // runs once when the firmware starts up 51 // runs once when the firmware starts up
52 uint8_t led_delay_ms = 80; 52 uint8_t led_delay_ms = 80;
53 for (int i = 0; i < 2; i++) { 53 for (int i = 0; i < 2; i++) {
54 writePinHigh(LED_00); 54 gpio_write_pin_high(LED_00);
55 writePinHigh(LED_01); 55 gpio_write_pin_high(LED_01);
56 writePinHigh(LED_02); 56 gpio_write_pin_high(LED_02);
57 wait_ms(led_delay_ms); 57 wait_ms(led_delay_ms);
58 writePinLow(LED_00); 58 gpio_write_pin_low(LED_00);
59 writePinLow(LED_01); 59 gpio_write_pin_low(LED_01);
60 writePinLow(LED_02); 60 gpio_write_pin_low(LED_02);
61 if (i < 1) { 61 if (i < 1) {
62 wait_ms(led_delay_ms); 62 wait_ms(led_delay_ms);
63 } 63 }
@@ -69,7 +69,7 @@ void matrix_init_kb(void) {
69bool led_update_kb(led_t led_state) { 69bool led_update_kb(led_t led_state) {
70 bool res = led_update_user(led_state); 70 bool res = led_update_user(led_state);
71 if(res) { 71 if(res) {
72 writePin(LED_02, !led_state.num_lock); 72 gpio_write_pin(LED_02, !led_state.num_lock);
73 } 73 }
74 return res; 74 return res;
75} 75}
diff --git a/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c b/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c
index 1022ad0605..cdbaff54aa 100644
--- a/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c
+++ b/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c
@@ -17,9 +17,9 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs 19 // Set LED IO as outputs
20 setPinOutput(LED_00); 20 gpio_set_pin_output(LED_00);
21 setPinOutput(LED_01); 21 gpio_set_pin_output(LED_01);
22 setPinOutput(LED_02); 22 gpio_set_pin_output(LED_02);
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
25 25
@@ -28,17 +28,17 @@ bool shutdown_kb(bool jump_to_bootloader) {
28 return false; 28 return false;
29 } 29 }
30 // Shutdown LEDs 30 // Shutdown LEDs
31 writePinLow(LED_00); 31 gpio_write_pin_low(LED_00);
32 writePinLow(LED_01); 32 gpio_write_pin_low(LED_01);
33 writePinLow(LED_02); 33 gpio_write_pin_low(LED_02);
34 return true; 34 return true;
35} 35}
36 36
37layer_state_t layer_state_set_kb(layer_state_t state) { 37layer_state_t layer_state_set_kb(layer_state_t state) {
38 // Layer LEDs act as binary indication of current layer 38 // Layer LEDs act as binary indication of current layer
39 uint8_t layer = get_highest_layer(state); 39 uint8_t layer = get_highest_layer(state);
40 writePin(LED_00, layer & 0b1); 40 gpio_write_pin(LED_00, layer & 0b1);
41 writePin(LED_01, (layer >> 1) & 0b1); 41 gpio_write_pin(LED_01, (layer >> 1) & 0b1);
42 return layer_state_set_user(state); 42 return layer_state_set_user(state);
43} 43}
44 44
@@ -51,13 +51,13 @@ void matrix_init_kb(void) {
51 // runs once when the firmware starts up 51 // runs once when the firmware starts up
52 uint8_t led_delay_ms = 80; 52 uint8_t led_delay_ms = 80;
53 for (int i = 0; i < 2; i++) { 53 for (int i = 0; i < 2; i++) {
54 writePinHigh(LED_00); 54 gpio_write_pin_high(LED_00);
55 writePinHigh(LED_01); 55 gpio_write_pin_high(LED_01);
56 writePinHigh(LED_02); 56 gpio_write_pin_high(LED_02);
57 wait_ms(led_delay_ms); 57 wait_ms(led_delay_ms);
58 writePinLow(LED_00); 58 gpio_write_pin_low(LED_00);
59 writePinLow(LED_01); 59 gpio_write_pin_low(LED_01);
60 writePinLow(LED_02); 60 gpio_write_pin_low(LED_02);
61 if (i < 1) { 61 if (i < 1) {
62 wait_ms(led_delay_ms); 62 wait_ms(led_delay_ms);
63 } 63 }
@@ -69,7 +69,7 @@ void matrix_init_kb(void) {
69bool led_update_kb(led_t led_state) { 69bool led_update_kb(led_t led_state) {
70 bool res = led_update_user(led_state); 70 bool res = led_update_user(led_state);
71 if(res) { 71 if(res) {
72 writePin(LED_02, !led_state.num_lock); 72 gpio_write_pin(LED_02, !led_state.num_lock);
73 } 73 }
74 return res; 74 return res;
75} 75}
diff --git a/keyboards/dumbpad/v1x_right/v1x_right.c b/keyboards/dumbpad/v1x_right/v1x_right.c
index 1022ad0605..cdbaff54aa 100644
--- a/keyboards/dumbpad/v1x_right/v1x_right.c
+++ b/keyboards/dumbpad/v1x_right/v1x_right.c
@@ -17,9 +17,9 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs 19 // Set LED IO as outputs
20 setPinOutput(LED_00); 20 gpio_set_pin_output(LED_00);
21 setPinOutput(LED_01); 21 gpio_set_pin_output(LED_01);
22 setPinOutput(LED_02); 22 gpio_set_pin_output(LED_02);
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
25 25
@@ -28,17 +28,17 @@ bool shutdown_kb(bool jump_to_bootloader) {
28 return false; 28 return false;
29 } 29 }
30 // Shutdown LEDs 30 // Shutdown LEDs
31 writePinLow(LED_00); 31 gpio_write_pin_low(LED_00);
32 writePinLow(LED_01); 32 gpio_write_pin_low(LED_01);
33 writePinLow(LED_02); 33 gpio_write_pin_low(LED_02);
34 return true; 34 return true;
35} 35}
36 36
37layer_state_t layer_state_set_kb(layer_state_t state) { 37layer_state_t layer_state_set_kb(layer_state_t state) {
38 // Layer LEDs act as binary indication of current layer 38 // Layer LEDs act as binary indication of current layer
39 uint8_t layer = get_highest_layer(state); 39 uint8_t layer = get_highest_layer(state);
40 writePin(LED_00, layer & 0b1); 40 gpio_write_pin(LED_00, layer & 0b1);
41 writePin(LED_01, (layer >> 1) & 0b1); 41 gpio_write_pin(LED_01, (layer >> 1) & 0b1);
42 return layer_state_set_user(state); 42 return layer_state_set_user(state);
43} 43}
44 44
@@ -51,13 +51,13 @@ void matrix_init_kb(void) {
51 // runs once when the firmware starts up 51 // runs once when the firmware starts up
52 uint8_t led_delay_ms = 80; 52 uint8_t led_delay_ms = 80;
53 for (int i = 0; i < 2; i++) { 53 for (int i = 0; i < 2; i++) {
54 writePinHigh(LED_00); 54 gpio_write_pin_high(LED_00);
55 writePinHigh(LED_01); 55 gpio_write_pin_high(LED_01);
56 writePinHigh(LED_02); 56 gpio_write_pin_high(LED_02);
57 wait_ms(led_delay_ms); 57 wait_ms(led_delay_ms);
58 writePinLow(LED_00); 58 gpio_write_pin_low(LED_00);
59 writePinLow(LED_01); 59 gpio_write_pin_low(LED_01);
60 writePinLow(LED_02); 60 gpio_write_pin_low(LED_02);
61 if (i < 1) { 61 if (i < 1) {
62 wait_ms(led_delay_ms); 62 wait_ms(led_delay_ms);
63 } 63 }
@@ -69,7 +69,7 @@ void matrix_init_kb(void) {
69bool led_update_kb(led_t led_state) { 69bool led_update_kb(led_t led_state) {
70 bool res = led_update_user(led_state); 70 bool res = led_update_user(led_state);
71 if(res) { 71 if(res) {
72 writePin(LED_02, !led_state.num_lock); 72 gpio_write_pin(LED_02, !led_state.num_lock);
73 } 73 }
74 return res; 74 return res;
75} 75}
diff --git a/keyboards/dumbpad/v3x/v3x.c b/keyboards/dumbpad/v3x/v3x.c
index 89f13684f2..181e9d4a0d 100644
--- a/keyboards/dumbpad/v3x/v3x.c
+++ b/keyboards/dumbpad/v3x/v3x.c
@@ -48,9 +48,9 @@ led_config_t g_led_config = {{// Key Matrix to LED Index
48 48
49void keyboard_pre_init_kb(void) { 49void keyboard_pre_init_kb(void) {
50 // Set LED IO as outputs 50 // Set LED IO as outputs
51 setPinOutput(LED_00); 51 gpio_set_pin_output(LED_00);
52 setPinOutput(LED_01); 52 gpio_set_pin_output(LED_01);
53 setPinOutput(LED_02); 53 gpio_set_pin_output(LED_02);
54 keyboard_pre_init_user(); 54 keyboard_pre_init_user();
55} 55}
56 56
@@ -59,17 +59,17 @@ bool shutdown_kb(bool jump_to_bootloader) {
59 return false; 59 return false;
60 } 60 }
61 // Shutdown LEDs 61 // Shutdown LEDs
62 writePinLow(LED_00); 62 gpio_write_pin_low(LED_00);
63 writePinLow(LED_01); 63 gpio_write_pin_low(LED_01);
64 writePinLow(LED_02); 64 gpio_write_pin_low(LED_02);
65 return true; 65 return true;
66} 66}
67 67
68layer_state_t layer_state_set_kb(layer_state_t state) { 68layer_state_t layer_state_set_kb(layer_state_t state) {
69 // Layer LEDs act as binary indication of current layer 69 // Layer LEDs act as binary indication of current layer
70 uint8_t layer = get_highest_layer(state); 70 uint8_t layer = get_highest_layer(state);
71 writePin(LED_00, layer & 0b1); 71 gpio_write_pin(LED_00, layer & 0b1);
72 writePin(LED_01, (layer >> 1) & 0b1); 72 gpio_write_pin(LED_01, (layer >> 1) & 0b1);
73 uprintf("%d string", layer); 73 uprintf("%d string", layer);
74 return layer_state_set_user(state); 74 return layer_state_set_user(state);
75} 75}
@@ -83,13 +83,13 @@ void matrix_init_kb(void) {
83 // runs once when the firmware starts up 83 // runs once when the firmware starts up
84 uint8_t led_delay_ms = 80; 84 uint8_t led_delay_ms = 80;
85 for (int i = 0; i < 2; i++) { 85 for (int i = 0; i < 2; i++) {
86 writePinHigh(LED_00); 86 gpio_write_pin_high(LED_00);
87 writePinHigh(LED_01); 87 gpio_write_pin_high(LED_01);
88 writePinHigh(LED_02); 88 gpio_write_pin_high(LED_02);
89 wait_ms(led_delay_ms); 89 wait_ms(led_delay_ms);
90 writePinLow(LED_00); 90 gpio_write_pin_low(LED_00);
91 writePinLow(LED_01); 91 gpio_write_pin_low(LED_01);
92 writePinLow(LED_02); 92 gpio_write_pin_low(LED_02);
93 if (i < 1) { 93 if (i < 1) {
94 wait_ms(led_delay_ms); 94 wait_ms(led_delay_ms);
95 } 95 }
@@ -101,6 +101,6 @@ void matrix_init_kb(void) {
101bool led_update_kb(led_t led_state) { 101bool led_update_kb(led_t led_state) {
102 if (!led_update_user(led_state)) return false; 102 if (!led_update_user(led_state)) return false;
103 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here 103 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
104 writePin(LED_02, !led_state.num_lock); 104 gpio_write_pin(LED_02, !led_state.num_lock);
105 return true; 105 return true;
106} 106}
diff --git a/keyboards/durgod/dgk6x/dgk6x.c b/keyboards/durgod/dgk6x/dgk6x.c
index b7f1da778d..4db54859de 100644
--- a/keyboards/durgod/dgk6x/dgk6x.c
+++ b/keyboards/durgod/dgk6x/dgk6x.c
@@ -18,22 +18,22 @@
18 18
19/* Private Functions */ 19/* Private Functions */
20void off_all_leds(void) { 20void off_all_leds(void) {
21 writePinHigh(LED_CAPS_LOCK_PIN); 21 gpio_write_pin_high(LED_CAPS_LOCK_PIN);
22 writePinHigh(LED_WIN_LOCK_PIN); 22 gpio_write_pin_high(LED_WIN_LOCK_PIN);
23 writePinHigh(LED_MR_LOCK_PIN); 23 gpio_write_pin_high(LED_MR_LOCK_PIN);
24} 24}
25 25
26void on_all_leds(void) { 26void on_all_leds(void) {
27 writePinLow(LED_CAPS_LOCK_PIN); 27 gpio_write_pin_low(LED_CAPS_LOCK_PIN);
28 writePinLow(LED_WIN_LOCK_PIN); 28 gpio_write_pin_low(LED_WIN_LOCK_PIN);
29 writePinLow(LED_MR_LOCK_PIN); 29 gpio_write_pin_low(LED_MR_LOCK_PIN);
30} 30}
31 31
32/* WinLock and MR LEDs are non-standard. Need to override led init */ 32/* WinLock and MR LEDs are non-standard. Need to override led init */
33void led_init_ports(void) { 33void led_init_ports(void) {
34 setPinOutput(LED_CAPS_LOCK_PIN); 34 gpio_set_pin_output(LED_CAPS_LOCK_PIN);
35 setPinOutput(LED_WIN_LOCK_PIN); 35 gpio_set_pin_output(LED_WIN_LOCK_PIN);
36 setPinOutput(LED_MR_LOCK_PIN); 36 gpio_set_pin_output(LED_MR_LOCK_PIN);
37 off_all_leds(); 37 off_all_leds();
38} 38}
39 39
@@ -44,7 +44,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
44 case GU_TOGG: 44 case GU_TOGG:
45 if (record->event.pressed) { 45 if (record->event.pressed) {
46 // Toggle LED on key press 46 // Toggle LED on key press
47 togglePin(LED_WIN_LOCK_PIN); 47 gpio_toggle_pin(LED_WIN_LOCK_PIN);
48 } 48 }
49 break; 49 break;
50 } 50 }
diff --git a/keyboards/durgod/k310/k310.c b/keyboards/durgod/k310/k310.c
index a88100be20..7879b13f4e 100644
--- a/keyboards/durgod/k310/k310.c
+++ b/keyboards/durgod/k310/k310.c
@@ -22,33 +22,33 @@
22/* Private Functions */ 22/* Private Functions */
23void off_all_leds(void) { 23void off_all_leds(void) {
24#ifdef LED_NUM_LOCK_PIN 24#ifdef LED_NUM_LOCK_PIN
25 writePinHigh(LED_NUM_LOCK_PIN); 25 gpio_write_pin_high(LED_NUM_LOCK_PIN);
26#endif 26#endif
27 writePinHigh(LED_CAPS_LOCK_PIN); 27 gpio_write_pin_high(LED_CAPS_LOCK_PIN);
28 writePinHigh(LED_SCROLL_LOCK_PIN); 28 gpio_write_pin_high(LED_SCROLL_LOCK_PIN);
29 writePinHigh(LED_WIN_LOCK_PIN); 29 gpio_write_pin_high(LED_WIN_LOCK_PIN);
30 writePinHigh(LED_MR_LOCK_PIN); 30 gpio_write_pin_high(LED_MR_LOCK_PIN);
31} 31}
32 32
33void on_all_leds(void) { 33void on_all_leds(void) {
34#ifdef LED_NUM_LOCK_PIN 34#ifdef LED_NUM_LOCK_PIN
35 writePinLow(LED_NUM_LOCK_PIN); 35 gpio_write_pin_low(LED_NUM_LOCK_PIN);
36#endif 36#endif
37 writePinLow(LED_CAPS_LOCK_PIN); 37 gpio_write_pin_low(LED_CAPS_LOCK_PIN);
38 writePinLow(LED_SCROLL_LOCK_PIN); 38 gpio_write_pin_low(LED_SCROLL_LOCK_PIN);
39 writePinLow(LED_WIN_LOCK_PIN); 39 gpio_write_pin_low(LED_WIN_LOCK_PIN);
40 writePinLow(LED_MR_LOCK_PIN); 40 gpio_write_pin_low(LED_MR_LOCK_PIN);
41} 41}
42 42
43/* WinLock and MR LEDs are non-standard. Need to override led init */ 43/* WinLock and MR LEDs are non-standard. Need to override led init */
44void led_init_ports(void) { 44void led_init_ports(void) {
45#ifdef LED_NUM_LOCK_PIN 45#ifdef LED_NUM_LOCK_PIN
46 setPinOutput(LED_NUM_LOCK_PIN); 46 gpio_set_pin_output(LED_NUM_LOCK_PIN);
47#endif 47#endif
48 setPinOutput(LED_CAPS_LOCK_PIN); 48 gpio_set_pin_output(LED_CAPS_LOCK_PIN);
49 setPinOutput(LED_SCROLL_LOCK_PIN); 49 gpio_set_pin_output(LED_SCROLL_LOCK_PIN);
50 setPinOutput(LED_WIN_LOCK_PIN); 50 gpio_set_pin_output(LED_WIN_LOCK_PIN);
51 setPinOutput(LED_MR_LOCK_PIN); 51 gpio_set_pin_output(LED_MR_LOCK_PIN);
52 off_all_leds(); 52 off_all_leds();
53} 53}
54 54
@@ -58,7 +58,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
58 case GU_TOGG: 58 case GU_TOGG:
59 if (record->event.pressed) { 59 if (record->event.pressed) {
60 // Toggle LED on key press 60 // Toggle LED on key press
61 togglePin(LED_WIN_LOCK_PIN); 61 gpio_toggle_pin(LED_WIN_LOCK_PIN);
62 } 62 }
63 break; 63 break;
64 } 64 }
@@ -75,7 +75,7 @@ static void hardware_reset_cb(void *arg) {
75#endif 75#endif
76 76
77void keyboard_pre_init_kb(void) { 77void keyboard_pre_init_kb(void) {
78 setPinInputHigh(HARDWARE_RESET_PIN); 78 gpio_set_pin_input_high(HARDWARE_RESET_PIN);
79 79
80#ifndef HW_RESET_PIN_DISABLED 80#ifndef HW_RESET_PIN_DISABLED
81 /* Jump to bootloader when the hardware reset button is pressed */ 81 /* Jump to bootloader when the hardware reset button is pressed */
@@ -83,7 +83,7 @@ void keyboard_pre_init_kb(void) {
83 palSetPadCallback(PAL_PORT(HARDWARE_RESET_PIN), PAL_PAD(HARDWARE_RESET_PIN), hardware_reset_cb, NULL); 83 palSetPadCallback(PAL_PORT(HARDWARE_RESET_PIN), PAL_PAD(HARDWARE_RESET_PIN), hardware_reset_cb, NULL);
84 84
85 /* The interrupt is edge-triggered so check that it's not already pressed */ 85 /* The interrupt is edge-triggered so check that it's not already pressed */
86 if (!readPin(HARDWARE_RESET_PIN)) { 86 if (!gpio_read_pin(HARDWARE_RESET_PIN)) {
87 bootloader_jump(); 87 bootloader_jump();
88 } 88 }
89#endif 89#endif
diff --git a/keyboards/durgod/k320/k320.c b/keyboards/durgod/k320/k320.c
index c1b9701d7b..0a544fe318 100644
--- a/keyboards/durgod/k320/k320.c
+++ b/keyboards/durgod/k320/k320.c
@@ -22,33 +22,33 @@
22/* Private Functions */ 22/* Private Functions */
23void off_all_leds(void) { 23void off_all_leds(void) {
24#ifdef LED_NUM_LOCK_PIN 24#ifdef LED_NUM_LOCK_PIN
25 writePinHigh(LED_NUM_LOCK_PIN); 25 gpio_write_pin_high(LED_NUM_LOCK_PIN);
26#endif 26#endif
27 writePinHigh(LED_CAPS_LOCK_PIN); 27 gpio_write_pin_high(LED_CAPS_LOCK_PIN);
28 writePinHigh(LED_SCROLL_LOCK_PIN); 28 gpio_write_pin_high(LED_SCROLL_LOCK_PIN);
29 writePinHigh(LED_WIN_LOCK_PIN); 29 gpio_write_pin_high(LED_WIN_LOCK_PIN);
30 writePinHigh(LED_MR_LOCK_PIN); 30 gpio_write_pin_high(LED_MR_LOCK_PIN);
31} 31}
32 32
33void on_all_leds(void) { 33void on_all_leds(void) {
34#ifdef LED_NUM_LOCK_PIN 34#ifdef LED_NUM_LOCK_PIN
35 writePinLow(LED_NUM_LOCK_PIN); 35 gpio_write_pin_low(LED_NUM_LOCK_PIN);
36#endif 36#endif
37 writePinLow(LED_CAPS_LOCK_PIN); 37 gpio_write_pin_low(LED_CAPS_LOCK_PIN);
38 writePinLow(LED_SCROLL_LOCK_PIN); 38 gpio_write_pin_low(LED_SCROLL_LOCK_PIN);
39 writePinLow(LED_WIN_LOCK_PIN); 39 gpio_write_pin_low(LED_WIN_LOCK_PIN);
40 writePinLow(LED_MR_LOCK_PIN); 40 gpio_write_pin_low(LED_MR_LOCK_PIN);
41} 41}
42 42
43/* WinLock and MR LEDs are non-standard. Need to override led init */ 43/* WinLock and MR LEDs are non-standard. Need to override led init */
44void led_init_ports(void) { 44void led_init_ports(void) {
45#ifdef LED_NUM_LOCK_PIN 45#ifdef LED_NUM_LOCK_PIN
46 setPinOutput(LED_NUM_LOCK_PIN); 46 gpio_set_pin_output(LED_NUM_LOCK_PIN);
47#endif 47#endif
48 setPinOutput(LED_CAPS_LOCK_PIN); 48 gpio_set_pin_output(LED_CAPS_LOCK_PIN);
49 setPinOutput(LED_SCROLL_LOCK_PIN); 49 gpio_set_pin_output(LED_SCROLL_LOCK_PIN);
50 setPinOutput(LED_WIN_LOCK_PIN); 50 gpio_set_pin_output(LED_WIN_LOCK_PIN);
51 setPinOutput(LED_MR_LOCK_PIN); 51 gpio_set_pin_output(LED_MR_LOCK_PIN);
52 off_all_leds(); 52 off_all_leds();
53} 53}
54 54
@@ -58,7 +58,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
58 case GU_TOGG: 58 case GU_TOGG:
59 if (record->event.pressed) { 59 if (record->event.pressed) {
60 // Toggle LED on key press 60 // Toggle LED on key press
61 togglePin(LED_WIN_LOCK_PIN); 61 gpio_toggle_pin(LED_WIN_LOCK_PIN);
62 } 62 }
63 break; 63 break;
64 } 64 }
@@ -75,7 +75,7 @@ static void hardware_reset_cb(void *arg) {
75#endif 75#endif
76 76
77void keyboard_pre_init_kb(void) { 77void keyboard_pre_init_kb(void) {
78 setPinInputHigh(HARDWARE_RESET_PIN); 78 gpio_set_pin_input_high(HARDWARE_RESET_PIN);
79 79
80#ifndef HW_RESET_PIN_DISABLED 80#ifndef HW_RESET_PIN_DISABLED
81 /* Jump to bootloader when the hardware reset button is pressed */ 81 /* Jump to bootloader when the hardware reset button is pressed */
@@ -83,7 +83,7 @@ void keyboard_pre_init_kb(void) {
83 palSetPadCallback(PAL_PORT(HARDWARE_RESET_PIN), PAL_PAD(HARDWARE_RESET_PIN), hardware_reset_cb, NULL); 83 palSetPadCallback(PAL_PORT(HARDWARE_RESET_PIN), PAL_PAD(HARDWARE_RESET_PIN), hardware_reset_cb, NULL);
84 84
85 /* The interrupt is edge-triggered so check that it's not already pressed */ 85 /* The interrupt is edge-triggered so check that it's not already pressed */
86 if (!readPin(HARDWARE_RESET_PIN)) { 86 if (!gpio_read_pin(HARDWARE_RESET_PIN)) {
87 bootloader_jump(); 87 bootloader_jump();
88 } 88 }
89#endif 89#endif
diff --git a/keyboards/dztech/bocc/bocc.c b/keyboards/dztech/bocc/bocc.c
index fc2eb8d6eb..646a7861f8 100644
--- a/keyboards/dztech/bocc/bocc.c
+++ b/keyboards/dztech/bocc/bocc.c
@@ -16,14 +16,14 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 setPinOutput(E6); 19 gpio_set_pin_output(E6);
20 matrix_init_user(); 20 matrix_init_user();
21} 21}
22 22
23bool led_update_kb(led_t led_state) { 23bool led_update_kb(led_t led_state) {
24 bool res = led_update_user(led_state); 24 bool res = led_update_user(led_state);
25 if(res) { 25 if(res) {
26 writePin(E6, !led_state.caps_lock); 26 gpio_write_pin(E6, !led_state.caps_lock);
27 } 27 }
28 return res; 28 return res;
29} 29}
diff --git a/keyboards/ealdin/quadrant/quadrant.c b/keyboards/ealdin/quadrant/quadrant.c
index f98cafd750..23be00b96f 100644
--- a/keyboards/ealdin/quadrant/quadrant.c
+++ b/keyboards/ealdin/quadrant/quadrant.c
@@ -54,14 +54,14 @@ bool encoder_update_kb(uint8_t index, bool clockwise) {
54} 54}
55 55
56void keyboard_pre_init_kb(void) { 56void keyboard_pre_init_kb(void) {
57 setPinOutput(F0); 57 gpio_set_pin_output(F0);
58 58
59 keyboard_pre_init_user(); 59 keyboard_pre_init_user();
60} 60}
61 61
62bool led_update_kb(led_t led_state) { 62bool led_update_kb(led_t led_state) {
63 if (led_update_user(led_state)) { 63 if (led_update_user(led_state)) {
64 writePin(F0, led_state.caps_lock); 64 gpio_write_pin(F0, led_state.caps_lock);
65 } 65 }
66 return true; 66 return true;
67} 67}
diff --git a/keyboards/edda/edda.c b/keyboards/edda/edda.c
index 38d1d5ddab..b5f169abe6 100644
--- a/keyboards/edda/edda.c
+++ b/keyboards/edda/edda.c
@@ -18,32 +18,32 @@ void keyboard_pre_init_kb(void) {
18 keyboard_pre_init_user(); 18 keyboard_pre_init_user();
19 19
20 // Set our LED pins as output 20 // Set our LED pins as output
21 setPinOutput(B2); 21 gpio_set_pin_output(B2);
22 setPinOutput(B1); 22 gpio_set_pin_output(B1);
23 setPinOutput(B0); 23 gpio_set_pin_output(B0);
24} 24}
25 25
26__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { 26__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
27 switch (get_highest_layer(state)) { 27 switch (get_highest_layer(state)) {
28 case 1: 28 case 1:
29 writePin(B2, 1); 29 gpio_write_pin(B2, 1);
30 writePin(B1, 0); 30 gpio_write_pin(B1, 0);
31 writePin(B0, 0); 31 gpio_write_pin(B0, 0);
32 break; 32 break;
33 case 2: 33 case 2:
34 writePin(B2, 1); 34 gpio_write_pin(B2, 1);
35 writePin(B1, 1); 35 gpio_write_pin(B1, 1);
36 writePin(B0, 0); 36 gpio_write_pin(B0, 0);
37 break; 37 break;
38 case 3: 38 case 3:
39 writePin(B2, 1); 39 gpio_write_pin(B2, 1);
40 writePin(B1, 1); 40 gpio_write_pin(B1, 1);
41 writePin(B0, 1); 41 gpio_write_pin(B0, 1);
42 break; 42 break;
43 default: // for any other layers, or the default layer 43 default: // for any other layers, or the default layer
44 writePin(B2, 0); 44 gpio_write_pin(B2, 0);
45 writePin(B1, 0); 45 gpio_write_pin(B1, 0);
46 writePin(B0, 0); 46 gpio_write_pin(B0, 0);
47 break; 47 break;
48 } 48 }
49 return state; 49 return state;
diff --git a/keyboards/enviousdesign/commissions/mini1800/mini1800.c b/keyboards/enviousdesign/commissions/mini1800/mini1800.c
index f35be22d13..86757dab8a 100644
--- a/keyboards/enviousdesign/commissions/mini1800/mini1800.c
+++ b/keyboards/enviousdesign/commissions/mini1800/mini1800.c
@@ -3,15 +3,15 @@
3#include "quantum.h" 3#include "quantum.h"
4 4
5void matrix_init_user(void) { 5void matrix_init_user(void) {
6 setPinOutput(GP9); //init gpio 6 gpio_set_pin_output(GP9); //init gpio
7 writePinLow(GP9); 7 gpio_write_pin_low(GP9);
8 setPinOutput(GP11); //init and turn off inverted power led 8 gpio_set_pin_output(GP11); //init and turn off inverted power led
9 writePinHigh(GP11); 9 gpio_write_pin_high(GP11);
10} 10}
11 11
12//layer, capslock and numlock 12//layer, capslock and numlock
13layer_state_t layer_state_set_user(layer_state_t state) { 13layer_state_t layer_state_set_user(layer_state_t state) {
14 writePin(GP9, layer_state_cmp(state, 1)); 14 gpio_write_pin(GP9, layer_state_cmp(state, 1));
15 return state; 15 return state;
16} 16}
17 17
diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c
index 9013c0785f..4d1645943b 100644
--- a/keyboards/ergodox_ez/matrix.c
+++ b/keyboards/ergodox_ez/matrix.c
@@ -130,12 +130,12 @@ static void init_cols(void) {
130 // not needed, already done as part of init_mcp23018() 130 // not needed, already done as part of init_mcp23018()
131 131
132 // init on teensy 132 // init on teensy
133 setPinInputHigh(F0); 133 gpio_set_pin_input_high(F0);
134 setPinInputHigh(F1); 134 gpio_set_pin_input_high(F1);
135 setPinInputHigh(F4); 135 gpio_set_pin_input_high(F4);
136 setPinInputHigh(F5); 136 gpio_set_pin_input_high(F5);
137 setPinInputHigh(F6); 137 gpio_set_pin_input_high(F6);
138 setPinInputHigh(F7); 138 gpio_set_pin_input_high(F7);
139} 139}
140 140
141static matrix_row_t read_cols(uint8_t row) { 141static matrix_row_t read_cols(uint8_t row) {
@@ -176,13 +176,13 @@ static void unselect_rows(void) {
176 // direction 176 // direction
177 177
178 // unselect on teensy 178 // unselect on teensy
179 setPinInput(B0); 179 gpio_set_pin_input(B0);
180 setPinInput(B1); 180 gpio_set_pin_input(B1);
181 setPinInput(B2); 181 gpio_set_pin_input(B2);
182 setPinInput(B3); 182 gpio_set_pin_input(B3);
183 setPinInput(D2); 183 gpio_set_pin_input(D2);
184 setPinInput(D3); 184 gpio_set_pin_input(D3);
185 setPinInput(C6); 185 gpio_set_pin_input(C6);
186} 186}
187 187
188static void select_row(uint8_t row) { 188static void select_row(uint8_t row) {
@@ -200,32 +200,32 @@ static void select_row(uint8_t row) {
200 // Output low(DDR:1, PORT:0) to select 200 // Output low(DDR:1, PORT:0) to select
201 switch (row) { 201 switch (row) {
202 case 7: 202 case 7:
203 setPinOutput(B0); 203 gpio_set_pin_output(B0);
204 writePinLow(B0); 204 gpio_write_pin_low(B0);
205 break; 205 break;
206 case 8: 206 case 8:
207 setPinOutput(B1); 207 gpio_set_pin_output(B1);
208 writePinLow(B1); 208 gpio_write_pin_low(B1);
209 break; 209 break;
210 case 9: 210 case 9:
211 setPinOutput(B2); 211 gpio_set_pin_output(B2);
212 writePinLow(B2); 212 gpio_write_pin_low(B2);
213 break; 213 break;
214 case 10: 214 case 10:
215 setPinOutput(B3); 215 gpio_set_pin_output(B3);
216 writePinLow(B3); 216 gpio_write_pin_low(B3);
217 break; 217 break;
218 case 11: 218 case 11:
219 setPinOutput(D2); 219 gpio_set_pin_output(D2);
220 writePinLow(D2); 220 gpio_write_pin_low(D2);
221 break; 221 break;
222 case 12: 222 case 12:
223 setPinOutput(D3); 223 gpio_set_pin_output(D3);
224 writePinLow(D3); 224 gpio_write_pin_low(D3);
225 break; 225 break;
226 case 13: 226 case 13:
227 setPinOutput(C6); 227 gpio_set_pin_output(C6);
228 writePinLow(C6); 228 gpio_write_pin_low(C6);
229 break; 229 break;
230 } 230 }
231 } 231 }
diff --git a/keyboards/evyd13/gh80_3700/gh80_3700.c b/keyboards/evyd13/gh80_3700/gh80_3700.c
index 617de50d5d..6d903e48e1 100644
--- a/keyboards/evyd13/gh80_3700/gh80_3700.c
+++ b/keyboards/evyd13/gh80_3700/gh80_3700.c
@@ -16,22 +16,22 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void led_init_ports(void) { 18void led_init_ports(void) {
19 setPinOutput(E6); 19 gpio_set_pin_output(E6);
20 setPinOutput(B1); 20 gpio_set_pin_output(B1);
21 setPinOutput(D0); 21 gpio_set_pin_output(D0);
22 setPinOutput(D1); 22 gpio_set_pin_output(D1);
23 setPinOutput(F0); 23 gpio_set_pin_output(F0);
24 24
25 writePinHigh(E6); 25 gpio_write_pin_high(E6);
26 writePinHigh(B1); 26 gpio_write_pin_high(B1);
27 writePinHigh(D0); 27 gpio_write_pin_high(D0);
28 writePinHigh(D1); 28 gpio_write_pin_high(D1);
29 writePinHigh(F0); 29 gpio_write_pin_high(F0);
30} 30}
31 31
32bool led_update_kb(led_t led_state) { 32bool led_update_kb(led_t led_state) {
33 if(led_update_user(led_state)) { 33 if(led_update_user(led_state)) {
34 writePin(E6, !led_state.num_lock); 34 gpio_write_pin(E6, !led_state.num_lock);
35 } 35 }
36 36
37 return true; 37 return true;
diff --git a/keyboards/evyd13/gud70/gud70.c b/keyboards/evyd13/gud70/gud70.c
index f9b5050ea7..5c40045521 100644
--- a/keyboards/evyd13/gud70/gud70.c
+++ b/keyboards/evyd13/gud70/gud70.c
@@ -17,6 +17,6 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // Enable top LED 19 // Enable top LED
20 setPinOutput(B3); 20 gpio_set_pin_output(B3);
21 writePinLow(B3); 21 gpio_write_pin_low(B3);
22} 22}
diff --git a/keyboards/evyd13/pockettype/pockettype.c b/keyboards/evyd13/pockettype/pockettype.c
index b9aee69496..7e372363fa 100644
--- a/keyboards/evyd13/pockettype/pockettype.c
+++ b/keyboards/evyd13/pockettype/pockettype.c
@@ -17,20 +17,20 @@
17 17
18void led_init_ports(void) { 18void led_init_ports(void) {
19 // * Enable LED anodes (Vbus pin is replaced by B0 on some boards) 19 // * Enable LED anodes (Vbus pin is replaced by B0 on some boards)
20 setPinOutput(B0); 20 gpio_set_pin_output(B0);
21 writePinHigh(B0); 21 gpio_write_pin_high(B0);
22 22
23 // * Set our LED pins as output and high 23 // * Set our LED pins as output and high
24 setPinOutput(F5); 24 gpio_set_pin_output(F5);
25 writePinHigh(F5); 25 gpio_write_pin_high(F5);
26 26
27 setPinOutput(F4); 27 gpio_set_pin_output(F4);
28 writePinLow(F4); 28 gpio_write_pin_low(F4);
29} 29}
30 30
31bool led_update_kb(led_t led_state) { 31bool led_update_kb(led_t led_state) {
32 if(led_update_user(led_state)) { 32 if(led_update_user(led_state)) {
33 writePin(F5, !led_state.caps_lock); 33 gpio_write_pin(F5, !led_state.caps_lock);
34 } 34 }
35 35
36 return true; 36 return true;
diff --git a/keyboards/evyd13/wasdat/matrix.c b/keyboards/evyd13/wasdat/matrix.c
index ae4bb6cb3a..b83f2b900a 100644
--- a/keyboards/evyd13/wasdat/matrix.c
+++ b/keyboards/evyd13/wasdat/matrix.c
@@ -46,7 +46,7 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
46 */ 46 */
47static void select_col(uint8_t col) { 47static void select_col(uint8_t col) {
48 if (col_pins[col] != NO_PIN) { 48 if (col_pins[col] != NO_PIN) {
49 writePinLow(col_pins[col]); 49 gpio_write_pin_low(col_pins[col]);
50 } else { 50 } else {
51 sn74x138_set_addr(13 - col); 51 sn74x138_set_addr(13 - col);
52 } 52 }
@@ -54,8 +54,8 @@ static void select_col(uint8_t col) {
54 54
55static void unselect_col(uint8_t col) { 55static void unselect_col(uint8_t col) {
56 if (col_pins[col] != NO_PIN) { 56 if (col_pins[col] != NO_PIN) {
57 setPinOutput(col_pins[col]); 57 gpio_set_pin_output(col_pins[col]);
58 writePinHigh(col_pins[col]); 58 gpio_write_pin_high(col_pins[col]);
59 } else { 59 } else {
60 sn74x138_set_addr(0); 60 sn74x138_set_addr(0);
61 } 61 }
@@ -65,8 +65,8 @@ static void unselect_cols(void) {
65 // Native 65 // Native
66 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 66 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
67 if (col_pins[x] != NO_PIN) { 67 if (col_pins[x] != NO_PIN) {
68 setPinOutput(col_pins[x]); 68 gpio_set_pin_output(col_pins[x]);
69 writePinHigh(col_pins[x]); 69 gpio_write_pin_high(col_pins[x]);
70 } 70 }
71 } 71 }
72 72
@@ -77,7 +77,7 @@ static void unselect_cols(void) {
77static void init_pins(void) { 77static void init_pins(void) {
78 unselect_cols(); 78 unselect_cols();
79 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 79 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
80 setPinInputHigh(row_pins[x]); 80 gpio_set_pin_input_high(row_pins[x]);
81 } 81 }
82} 82}
83 83
@@ -94,7 +94,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
94 matrix_row_t last_row_value = current_matrix[row_index]; 94 matrix_row_t last_row_value = current_matrix[row_index];
95 95
96 // Check row pin state 96 // Check row pin state
97 if (readPin(row_pins[row_index]) == 0) { 97 if (gpio_read_pin(row_pins[row_index]) == 0) {
98 // Pin LO, set col bit 98 // Pin LO, set col bit
99 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); 99 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
100 } else { 100 } else {
diff --git a/keyboards/evyd13/wasdat_code/matrix.c b/keyboards/evyd13/wasdat_code/matrix.c
index d392a31d7c..5c3f119158 100644
--- a/keyboards/evyd13/wasdat_code/matrix.c
+++ b/keyboards/evyd13/wasdat_code/matrix.c
@@ -48,7 +48,7 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
48 */ 48 */
49static void select_col(uint8_t col) { 49static void select_col(uint8_t col) {
50 if (col_pins[col] != NO_PIN) { 50 if (col_pins[col] != NO_PIN) {
51 writePinLow(col_pins[col]); 51 gpio_write_pin_low(col_pins[col]);
52 } else { 52 } else {
53 sn74x138_set_addr((col == 6) ? 7 : 15 - col); 53 sn74x138_set_addr((col == 6) ? 7 : 15 - col);
54 sn74x138_set_enabled(true); 54 sn74x138_set_enabled(true);
@@ -57,8 +57,8 @@ static void select_col(uint8_t col) {
57 57
58static void unselect_col(uint8_t col) { 58static void unselect_col(uint8_t col) {
59 if (col_pins[col] != NO_PIN) { 59 if (col_pins[col] != NO_PIN) {
60 setPinOutput(col_pins[col]); 60 gpio_set_pin_output(col_pins[col]);
61 writePinHigh(col_pins[col]); 61 gpio_write_pin_high(col_pins[col]);
62 } else { 62 } else {
63 sn74x138_set_enabled(false); 63 sn74x138_set_enabled(false);
64 } 64 }
@@ -68,8 +68,8 @@ static void unselect_cols(void) {
68 // Native 68 // Native
69 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 69 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
70 if (col_pins[x] != NO_PIN) { 70 if (col_pins[x] != NO_PIN) {
71 setPinOutput(col_pins[x]); 71 gpio_set_pin_output(col_pins[x]);
72 writePinHigh(col_pins[x]); 72 gpio_write_pin_high(col_pins[x]);
73 } 73 }
74 } 74 }
75 75
@@ -80,7 +80,7 @@ static void unselect_cols(void) {
80static void init_pins(void) { 80static void init_pins(void) {
81 unselect_cols(); 81 unselect_cols();
82 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 82 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
83 setPinInputHigh(row_pins[x]); 83 gpio_set_pin_input_high(row_pins[x]);
84 } 84 }
85} 85}
86 86
@@ -97,7 +97,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
97 matrix_row_t last_row_value = current_matrix[row_index]; 97 matrix_row_t last_row_value = current_matrix[row_index];
98 98
99 // Check row pin state 99 // Check row pin state
100 if (readPin(row_pins[row_index]) == 0) { 100 if (gpio_read_pin(row_pins[row_index]) == 0) {
101 // Pin LO, set col bit 101 // Pin LO, set col bit
102 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); 102 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
103 } else { 103 } else {
diff --git a/keyboards/exclusive/e6v2/oe/oe.c b/keyboards/exclusive/e6v2/oe/oe.c
index 6869a52c97..b15fa32ab0 100644
--- a/keyboards/exclusive/e6v2/oe/oe.c
+++ b/keyboards/exclusive/e6v2/oe/oe.c
@@ -1,15 +1,15 @@
1#include "quantum.h" 1#include "quantum.h"
2 2
3void led_init_ports(void) { 3void led_init_ports(void) {
4 setPinOutput(B2); 4 gpio_set_pin_output(B2);
5 setPinOutput(B6); 5 gpio_set_pin_output(B6);
6} 6}
7 7
8bool led_update_kb(led_t led_state) { 8bool led_update_kb(led_t led_state) {
9 bool res = led_update_user(led_state); 9 bool res = led_update_user(led_state);
10 if(res) { 10 if(res) {
11 writePin(B2, !led_state.caps_lock); 11 gpio_write_pin(B2, !led_state.caps_lock);
12 writePin(B6, led_state.raw == 0); 12 gpio_write_pin(B6, led_state.raw == 0);
13 } 13 }
14 return res; 14 return res;
15} 15}
diff --git a/keyboards/exclusive/e85/hotswap/hotswap.c b/keyboards/exclusive/e85/hotswap/hotswap.c
index a6d50b1f77..18ca30b44c 100644
--- a/keyboards/exclusive/e85/hotswap/hotswap.c
+++ b/keyboards/exclusive/e85/hotswap/hotswap.c
@@ -17,16 +17,16 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 setPinOutput(C7); 20 gpio_set_pin_output(C7);
21 setPinOutput(B5); 21 gpio_set_pin_output(B5);
22 22
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
25 25
26bool led_update_kb(led_t led_state) { 26bool led_update_kb(led_t led_state) {
27 if (led_update_user(led_state)) { 27 if (led_update_user(led_state)) {
28 writePin(C7, led_state.caps_lock); 28 gpio_write_pin(C7, led_state.caps_lock);
29 writePin(B5, led_state.scroll_lock); 29 gpio_write_pin(B5, led_state.scroll_lock);
30 } 30 }
31 return true; 31 return true;
32} 32}
diff --git a/keyboards/exclusive/e85/soldered/soldered.c b/keyboards/exclusive/e85/soldered/soldered.c
index 81ae1f00ce..bdee95c26c 100644
--- a/keyboards/exclusive/e85/soldered/soldered.c
+++ b/keyboards/exclusive/e85/soldered/soldered.c
@@ -17,16 +17,16 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 setPinOutput(C7); 20 gpio_set_pin_output(C7);
21 setPinOutput(B5); 21 gpio_set_pin_output(B5);
22 22
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
25 25
26bool led_update_kb(led_t led_state) { 26bool led_update_kb(led_t led_state) {
27 if (led_update_user(led_state)) { 27 if (led_update_user(led_state)) {
28 writePin(C7, led_state.caps_lock); 28 gpio_write_pin(C7, led_state.caps_lock);
29 writePin(B5, led_state.scroll_lock); 29 gpio_write_pin(B5, led_state.scroll_lock);
30 } 30 }
31 return true; 31 return true;
32} 32}
diff --git a/keyboards/ferris/0_1/matrix.c b/keyboards/ferris/0_1/matrix.c
index 154a275d7a..a3e2bebba6 100644
--- a/keyboards/ferris/0_1/matrix.c
+++ b/keyboards/ferris/0_1/matrix.c
@@ -182,8 +182,8 @@ static void init_cols(void) {
182 pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_MCU; 182 pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_MCU;
183 for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) { 183 for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) {
184 pin_t pin = matrix_col_pins_mcu[pin_index]; 184 pin_t pin = matrix_col_pins_mcu[pin_index];
185 setPinInput(pin); 185 gpio_set_pin_input(pin);
186 writePinHigh(pin); 186 gpio_write_pin_high(pin);
187 } 187 }
188} 188}
189 189
@@ -194,7 +194,7 @@ static matrix_row_t read_cols(uint8_t row) {
194 // For each col... 194 // For each col...
195 for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) { 195 for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) {
196 // Select the col pin to read (active low) 196 // Select the col pin to read (active low)
197 uint8_t pin_state = readPin(matrix_col_pins_mcu[col_index]); 197 uint8_t pin_state = gpio_read_pin(matrix_col_pins_mcu[col_index]);
198 198
199 // Populate the matrix row with the state of the col pin 199 // Populate the matrix row with the state of the col pin
200 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 200 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -229,8 +229,8 @@ static void unselect_rows(void) {
229 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU; 229 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU;
230 for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) { 230 for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) {
231 pin_t pin = matrix_row_pins_mcu[pin_index]; 231 pin_t pin = matrix_row_pins_mcu[pin_index];
232 setPinInput(pin); 232 gpio_set_pin_input(pin);
233 writePinLow(pin); 233 gpio_write_pin_low(pin);
234 } 234 }
235} 235}
236 236
@@ -239,8 +239,8 @@ static void select_row(uint8_t row) {
239 // select on atmega32u4 239 // select on atmega32u4
240 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU; 240 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU;
241 pin_t pin = matrix_row_pins_mcu[row]; 241 pin_t pin = matrix_row_pins_mcu[row];
242 setPinOutput(pin); 242 gpio_set_pin_output(pin);
243 writePinLow(pin); 243 gpio_write_pin_low(pin);
244 } else { 244 } else {
245 // select on mcp23017 245 // select on mcp23017
246 if (mcp23017_status) { // if there was an error 246 if (mcp23017_status) { // if there was an error
diff --git a/keyboards/ferris/0_2/matrix.c b/keyboards/ferris/0_2/matrix.c
index 41b100b659..74fab717a1 100644
--- a/keyboards/ferris/0_2/matrix.c
+++ b/keyboards/ferris/0_2/matrix.c
@@ -173,7 +173,7 @@ static matrix_row_t read_cols(uint8_t row) {
173 // For each col... 173 // For each col...
174 for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) { 174 for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) {
175 // Select the col pin to read (active low) 175 // Select the col pin to read (active low)
176 uint8_t pin_state = readPin(matrix_col_pins_mcu[col_index]); 176 uint8_t pin_state = gpio_read_pin(matrix_col_pins_mcu[col_index]);
177 177
178 // Populate the matrix row with the state of the col pin 178 // Populate the matrix row with the state of the col pin
179 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 179 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -199,7 +199,7 @@ static matrix_row_t read_cols(uint8_t row) {
199 199
200static void unselect_row(uint8_t row) { 200static void unselect_row(uint8_t row) {
201 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU; 201 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU;
202 setPinInputHigh(matrix_row_pins_mcu[row]); 202 gpio_set_pin_input_high(matrix_row_pins_mcu[row]);
203} 203}
204 204
205static void unselect_rows(void) { 205static void unselect_rows(void) {
@@ -211,14 +211,14 @@ static void unselect_rows(void) {
211 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU; 211 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU;
212 for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) { 212 for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) {
213 pin_t pin = matrix_row_pins_mcu[pin_index]; 213 pin_t pin = matrix_row_pins_mcu[pin_index];
214 setPinInputHigh(pin); 214 gpio_set_pin_input_high(pin);
215 } 215 }
216} 216}
217static void unselect_cols(void) { 217static void unselect_cols(void) {
218 pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_MCU; 218 pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_MCU;
219 for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) { 219 for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) {
220 pin_t pin = matrix_col_pins_mcu[pin_index]; 220 pin_t pin = matrix_col_pins_mcu[pin_index];
221 setPinInputHigh(pin); 221 gpio_set_pin_input_high(pin);
222 } 222 }
223} 223}
224 224
@@ -227,8 +227,8 @@ static void select_row(uint8_t row) {
227 // select on MCU 227 // select on MCU
228 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU; 228 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU;
229 pin_t pin = matrix_row_pins_mcu[row]; 229 pin_t pin = matrix_row_pins_mcu[row];
230 setPinOutput(pin); 230 gpio_set_pin_output(pin);
231 writePinLow(pin); 231 gpio_write_pin_low(pin);
232 } else { 232 } else {
233 // select on mcp23017 233 // select on mcp23017
234 if (mcp23017_status) { // if there was an error 234 if (mcp23017_status) { // if there was an error
diff --git a/keyboards/fjlabs/bolsa65/bolsa65.c b/keyboards/fjlabs/bolsa65/bolsa65.c
index 1c65ca1a3d..669404192c 100644
--- a/keyboards/fjlabs/bolsa65/bolsa65.c
+++ b/keyboards/fjlabs/bolsa65/bolsa65.c
@@ -15,14 +15,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
15 15
16void matrix_init_kb(void) { 16void matrix_init_kb(void) {
17 // Initialize indicator LEDs to output 17 // Initialize indicator LEDs to output
18 setPinOutput(F7); // Caps 18 gpio_set_pin_output(F7); // Caps
19 matrix_init_user(); 19 matrix_init_user();
20} 20}
21 21
22bool led_update_kb(led_t led_state) { 22bool led_update_kb(led_t led_state) {
23 bool res = led_update_user(led_state); 23 bool res = led_update_user(led_state);
24 if(res) { 24 if(res) {
25 writePin(F7, led_state.caps_lock); 25 gpio_write_pin(F7, led_state.caps_lock);
26 } 26 }
27 return res; 27 return res;
28} 28}
diff --git a/keyboards/flx/virgo/virgo.c b/keyboards/flx/virgo/virgo.c
index 5260e15322..2f875531d0 100644
--- a/keyboards/flx/virgo/virgo.c
+++ b/keyboards/flx/virgo/virgo.c
@@ -20,15 +20,15 @@ void matrix_init_kb(void) {
20 // put your keyboard start-up code here 20 // put your keyboard start-up code here
21 // runs once when the firmware starts up 21 // runs once when the firmware starts up
22 22
23 setPinOutput(E6); 23 gpio_set_pin_output(E6);
24 setPinOutput(B2); 24 gpio_set_pin_output(B2);
25 matrix_init_user(); 25 matrix_init_user();
26} 26}
27 27
28bool led_update_kb(led_t led_state) { 28bool led_update_kb(led_t led_state) {
29 if(led_update_user(led_state)) { 29 if(led_update_user(led_state)) {
30 writePin(E6, !led_state.caps_lock); 30 gpio_write_pin(E6, !led_state.caps_lock);
31 writePin(B2, !led_state.scroll_lock); 31 gpio_write_pin(B2, !led_state.scroll_lock);
32 } 32 }
33 return true; 33 return true;
34} 34}
diff --git a/keyboards/gboards/gergoplex/matrix.c b/keyboards/gboards/gergoplex/matrix.c
index 9abe9a83b3..3ea6a13385 100644
--- a/keyboards/gboards/gergoplex/matrix.c
+++ b/keyboards/gboards/gergoplex/matrix.c
@@ -168,7 +168,7 @@ void matrix_print(void) {
168// Remember this means ROWS 168// Remember this means ROWS
169static void init_cols(void) { 169static void init_cols(void) {
170 for (uint8_t col = 0; col < MATRIX_COLS; col++) { 170 for (uint8_t col = 0; col < MATRIX_COLS; col++) {
171 setPinInputHigh(col_pins[col]); 171 gpio_set_pin_input_high(col_pins[col]);
172 } 172 }
173} 173}
174 174
@@ -195,8 +195,8 @@ static void unselect_rows(void) {
195 // the other row bits high, and it's not changing to a different direction 195 // the other row bits high, and it's not changing to a different direction
196 196
197 for (uint8_t row = 0; row < MATRIX_ROWS_PER_SIDE; row++) { 197 for (uint8_t row = 0; row < MATRIX_ROWS_PER_SIDE; row++) {
198 setPinInput(row_pins[row]); 198 gpio_set_pin_input(row_pins[row]);
199 writePinLow(row_pins[row]); 199 gpio_write_pin_low(row_pins[row]);
200 } 200 }
201} 201}
202 202
@@ -211,7 +211,7 @@ static void select_row(uint8_t row) {
211 211
212 } 212 }
213 } else { 213 } else {
214 setPinOutput(row_pins[row - MATRIX_ROWS_PER_SIDE]); 214 gpio_set_pin_output(row_pins[row - MATRIX_ROWS_PER_SIDE]);
215 writePinLow(row_pins[row - MATRIX_ROWS_PER_SIDE]); 215 gpio_write_pin_low(row_pins[row - MATRIX_ROWS_PER_SIDE]);
216 } 216 }
217} 217}
diff --git a/keyboards/geistmaschine/macropod/matrix.c b/keyboards/geistmaschine/macropod/matrix.c
index 98796133f1..5cd35b47d4 100644
--- a/keyboards/geistmaschine/macropod/matrix.c
+++ b/keyboards/geistmaschine/macropod/matrix.c
@@ -38,7 +38,7 @@ void pca9555_setup(void) {
38 38
39void matrix_init_custom(void) { 39void matrix_init_custom(void) {
40 // Encoder pushbutton on the MCU is connected to PD2 40 // Encoder pushbutton on the MCU is connected to PD2
41 setPinInputHigh(D2); 41 gpio_set_pin_input_high(D2);
42 pca9555_setup(); 42 pca9555_setup();
43} 43}
44 44
@@ -79,7 +79,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
79 } 79 }
80 80
81 // Shift pin states by 1 to make room for the switch connected to the MCU, then OR them together and invert (as QMK uses inverted logic compared to the electrical levels) 81 // Shift pin states by 1 to make room for the switch connected to the MCU, then OR them together and invert (as QMK uses inverted logic compared to the electrical levels)
82 matrix_row_t data = ~(pin_states << 1 | readPin(D2)); 82 matrix_row_t data = ~(pin_states << 1 | gpio_read_pin(D2));
83 83
84 bool changed = current_matrix[0] != data; 84 bool changed = current_matrix[0] != data;
85 current_matrix[0] = data; 85 current_matrix[0] = data;
diff --git a/keyboards/geonworks/ee_at/ee_at.c b/keyboards/geonworks/ee_at/ee_at.c
index b2e6320851..099fbf315d 100644
--- a/keyboards/geonworks/ee_at/ee_at.c
+++ b/keyboards/geonworks/ee_at/ee_at.c
@@ -17,14 +17,14 @@
17 17
18void led_init_ports(void) { 18void led_init_ports(void) {
19 // Set our LED pins as open drain outputs 19 // Set our LED pins as open drain outputs
20 setPinOutputOpenDrain(LED_CAPS_LOCK_PIN); 20 gpio_set_pin_output_open_drain(LED_CAPS_LOCK_PIN);
21 setPinOutputOpenDrain(LED_NUM_LOCK_PIN); 21 gpio_set_pin_output_open_drain(LED_NUM_LOCK_PIN);
22 setPinOutputOpenDrain(LED_SCROLL_LOCK_PIN); 22 gpio_set_pin_output_open_drain(LED_SCROLL_LOCK_PIN);
23 setPinOutputOpenDrain(LED_KANA_PIN); 23 gpio_set_pin_output_open_drain(LED_KANA_PIN);
24 setPinOutputOpenDrain(A14); 24 gpio_set_pin_output_open_drain(A14);
25} 25}
26 26
27layer_state_t layer_state_set_kb(layer_state_t state) { 27layer_state_t layer_state_set_kb(layer_state_t state) {
28 writePin(A14, !layer_state_cmp(state, 1)); 28 gpio_write_pin(A14, !layer_state_cmp(state, 1));
29 return layer_state_set_user(state); 29 return layer_state_set_user(state);
30} 30}
diff --git a/keyboards/geonworks/w1_at/w1_at.c b/keyboards/geonworks/w1_at/w1_at.c
index 9858561bc5..114574455b 100644
--- a/keyboards/geonworks/w1_at/w1_at.c
+++ b/keyboards/geonworks/w1_at/w1_at.c
@@ -17,14 +17,14 @@
17 17
18void led_init_ports(void) { 18void led_init_ports(void) {
19 // Set our LED pins as open drain outputs 19 // Set our LED pins as open drain outputs
20 setPinOutputOpenDrain(LED_CAPS_LOCK_PIN); 20 gpio_set_pin_output_open_drain(LED_CAPS_LOCK_PIN);
21 setPinOutputOpenDrain(LED_NUM_LOCK_PIN); 21 gpio_set_pin_output_open_drain(LED_NUM_LOCK_PIN);
22 setPinOutputOpenDrain(LED_SCROLL_LOCK_PIN); 22 gpio_set_pin_output_open_drain(LED_SCROLL_LOCK_PIN);
23 setPinOutputOpenDrain(LED_KANA_PIN); 23 gpio_set_pin_output_open_drain(LED_KANA_PIN);
24 setPinOutputOpenDrain(A14); 24 gpio_set_pin_output_open_drain(A14);
25} 25}
26 26
27layer_state_t layer_state_set_kb(layer_state_t state) { 27layer_state_t layer_state_set_kb(layer_state_t state) {
28 writePin(A14, !layer_state_cmp(state, 1)); 28 gpio_write_pin(A14, !layer_state_cmp(state, 1));
29 return layer_state_set_user(state); 29 return layer_state_set_user(state);
30} 30}
diff --git a/keyboards/gh60/revc/revc.h b/keyboards/gh60/revc/revc.h
index 0ddc9aa344..e42c370562 100644
--- a/keyboards/gh60/revc/revc.h
+++ b/keyboards/gh60/revc/revc.h
@@ -12,14 +12,14 @@
12 * B2 Capslock LED 12 * B2 Capslock LED
13 * B0 not connected 13 * B0 not connected
14 */ 14 */
15static inline void gh60_caps_led_on(void) { setPinOutput(B2); writePinLow(B2); } 15static inline void gh60_caps_led_on(void) { gpio_set_pin_output(B2); gpio_write_pin_low(B2); }
16static inline void gh60_poker_leds_on(void) { setPinOutput(F4); writePinLow(F4); } 16static inline void gh60_poker_leds_on(void) { gpio_set_pin_output(F4); gpio_write_pin_low(F4); }
17static inline void gh60_fn_led_on(void) { setPinOutput(F5); writePinLow(F5); } 17static inline void gh60_fn_led_on(void) { gpio_set_pin_output(F5); gpio_write_pin_low(F5); }
18static inline void gh60_esc_led_on(void) { setPinOutput(F6); writePinLow(F6); } 18static inline void gh60_esc_led_on(void) { gpio_set_pin_output(F6); gpio_write_pin_low(F6); }
19static inline void gh60_wasd_leds_on(void) { setPinOutput(F7); writePinLow(F7); } 19static inline void gh60_wasd_leds_on(void) { gpio_set_pin_output(F7); gpio_write_pin_low(F7); }
20 20
21static inline void gh60_caps_led_off(void) { setPinInput(B2); } 21static inline void gh60_caps_led_off(void) { gpio_set_pin_input(B2); }
22static inline void gh60_poker_leds_off(void) { setPinInput(F4); } 22static inline void gh60_poker_leds_off(void) { gpio_set_pin_input(F4); }
23static inline void gh60_fn_led_off(void) { setPinInput(F5); } 23static inline void gh60_fn_led_off(void) { gpio_set_pin_input(F5); }
24static inline void gh60_esc_led_off(void) { setPinInput(F6); } 24static inline void gh60_esc_led_off(void) { gpio_set_pin_input(F6); }
25static inline void gh60_wasd_leds_off(void) { setPinInput(F7); } 25static inline void gh60_wasd_leds_off(void) { gpio_set_pin_input(F7); }
diff --git a/keyboards/ghs/rar/rar.c b/keyboards/ghs/rar/rar.c
index 481a2a0c41..591932c99c 100644
--- a/keyboards/ghs/rar/rar.c
+++ b/keyboards/ghs/rar/rar.c
@@ -18,8 +18,8 @@
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 // Set our LED pins as output. 20 // Set our LED pins as output.
21 setPinOutput(B1); 21 gpio_set_pin_output(B1);
22 setPinOutput(B3); 22 gpio_set_pin_output(B3);
23 23
24 keyboard_pre_init_user(); 24 keyboard_pre_init_user();
25} 25}
@@ -28,8 +28,8 @@ bool led_update_kb(led_t led_state) {
28 bool res = led_update_user(led_state); 28 bool res = led_update_user(led_state);
29 29
30 if (res) { 30 if (res) {
31 writePin(B1, led_state.caps_lock); 31 gpio_write_pin(B1, led_state.caps_lock);
32 writePin(B3, led_state.scroll_lock); 32 gpio_write_pin(B3, led_state.scroll_lock);
33 } 33 }
34 34
35 return res; 35 return res;
diff --git a/keyboards/gl516/a52gl/matrix.c b/keyboards/gl516/a52gl/matrix.c
index af13768b08..1e2948f716 100644
--- a/keyboards/gl516/a52gl/matrix.c
+++ b/keyboards/gl516/a52gl/matrix.c
@@ -21,37 +21,37 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
21 21
22static void select_row(uint8_t row) 22static void select_row(uint8_t row)
23{ 23{
24 setPinOutput(row_pins[row]); 24 gpio_set_pin_output(row_pins[row]);
25 writePinLow(row_pins[row]); 25 gpio_write_pin_low(row_pins[row]);
26} 26}
27 27
28static void unselect_row(uint8_t row) 28static void unselect_row(uint8_t row)
29{ 29{
30 setPinInputHigh(row_pins[row]); 30 gpio_set_pin_input_high(row_pins[row]);
31} 31}
32 32
33static void unselect_rows(void) 33static void unselect_rows(void)
34{ 34{
35 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 35 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
36 setPinInputHigh(row_pins[x]); 36 gpio_set_pin_input_high(row_pins[x]);
37 } 37 }
38} 38}
39 39
40static void select_col(uint8_t col) 40static void select_col(uint8_t col)
41{ 41{
42 setPinOutput(col_pins[col]); 42 gpio_set_pin_output(col_pins[col]);
43 writePinLow(col_pins[col]); 43 gpio_write_pin_low(col_pins[col]);
44} 44}
45 45
46static void unselect_col(uint8_t col) 46static void unselect_col(uint8_t col)
47{ 47{
48 setPinInputHigh(col_pins[col]); 48 gpio_set_pin_input_high(col_pins[col]);
49} 49}
50 50
51static void unselect_cols(void) 51static void unselect_cols(void)
52{ 52{
53 for(uint8_t x = 0; x < MATRIX_COLS; x++) { 53 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
54 setPinInputHigh(col_pins[x]); 54 gpio_set_pin_input_high(col_pins[x]);
55 } 55 }
56} 56}
57 57
@@ -59,10 +59,10 @@ static void init_pins(void) {
59 unselect_rows(); 59 unselect_rows();
60 unselect_cols(); 60 unselect_cols();
61 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 61 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
62 setPinInputHigh(col_pins[x]); 62 gpio_set_pin_input_high(col_pins[x]);
63 } 63 }
64 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 64 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
65 setPinInputHigh(row_pins[x]); 65 gpio_set_pin_input_high(row_pins[x]);
66 } 66 }
67} 67}
68 68
@@ -82,7 +82,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
82 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 82 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
83 83
84 // Select the col pin to read (active low) 84 // Select the col pin to read (active low)
85 uint8_t pin_state = readPin(col_pins[col_index]); 85 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
86 86
87 // Populate the matrix row with the state of the col pin 87 // Populate the matrix row with the state of the col pin
88 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 88 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -110,7 +110,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
110 matrix_row_t last_row_value = current_matrix[tmp]; 110 matrix_row_t last_row_value = current_matrix[tmp];
111 111
112 // Check row pin state 112 // Check row pin state
113 if (readPin(row_pins[row_index]) == 0) 113 if (gpio_read_pin(row_pins[row_index]) == 0)
114 { 114 {
115 // Pin LO, set col bit 115 // Pin LO, set col bit
116 current_matrix[tmp] |= (MATRIX_ROW_SHIFTER << current_col); 116 current_matrix[tmp] |= (MATRIX_ROW_SHIFTER << current_col);
diff --git a/keyboards/gl516/j73gl/matrix.c b/keyboards/gl516/j73gl/matrix.c
index af13768b08..1e2948f716 100644
--- a/keyboards/gl516/j73gl/matrix.c
+++ b/keyboards/gl516/j73gl/matrix.c
@@ -21,37 +21,37 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
21 21
22static void select_row(uint8_t row) 22static void select_row(uint8_t row)
23{ 23{
24 setPinOutput(row_pins[row]); 24 gpio_set_pin_output(row_pins[row]);
25 writePinLow(row_pins[row]); 25 gpio_write_pin_low(row_pins[row]);
26} 26}
27 27
28static void unselect_row(uint8_t row) 28static void unselect_row(uint8_t row)
29{ 29{
30 setPinInputHigh(row_pins[row]); 30 gpio_set_pin_input_high(row_pins[row]);
31} 31}
32 32
33static void unselect_rows(void) 33static void unselect_rows(void)
34{ 34{
35 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 35 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
36 setPinInputHigh(row_pins[x]); 36 gpio_set_pin_input_high(row_pins[x]);
37 } 37 }
38} 38}
39 39
40static void select_col(uint8_t col) 40static void select_col(uint8_t col)
41{ 41{
42 setPinOutput(col_pins[col]); 42 gpio_set_pin_output(col_pins[col]);
43 writePinLow(col_pins[col]); 43 gpio_write_pin_low(col_pins[col]);
44} 44}
45 45
46static void unselect_col(uint8_t col) 46static void unselect_col(uint8_t col)
47{ 47{
48 setPinInputHigh(col_pins[col]); 48 gpio_set_pin_input_high(col_pins[col]);
49} 49}
50 50
51static void unselect_cols(void) 51static void unselect_cols(void)
52{ 52{
53 for(uint8_t x = 0; x < MATRIX_COLS; x++) { 53 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
54 setPinInputHigh(col_pins[x]); 54 gpio_set_pin_input_high(col_pins[x]);
55 } 55 }
56} 56}
57 57
@@ -59,10 +59,10 @@ static void init_pins(void) {
59 unselect_rows(); 59 unselect_rows();
60 unselect_cols(); 60 unselect_cols();
61 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 61 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
62 setPinInputHigh(col_pins[x]); 62 gpio_set_pin_input_high(col_pins[x]);
63 } 63 }
64 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 64 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
65 setPinInputHigh(row_pins[x]); 65 gpio_set_pin_input_high(row_pins[x]);
66 } 66 }
67} 67}
68 68
@@ -82,7 +82,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
82 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 82 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
83 83
84 // Select the col pin to read (active low) 84 // Select the col pin to read (active low)
85 uint8_t pin_state = readPin(col_pins[col_index]); 85 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
86 86
87 // Populate the matrix row with the state of the col pin 87 // Populate the matrix row with the state of the col pin
88 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 88 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -110,7 +110,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
110 matrix_row_t last_row_value = current_matrix[tmp]; 110 matrix_row_t last_row_value = current_matrix[tmp];
111 111
112 // Check row pin state 112 // Check row pin state
113 if (readPin(row_pins[row_index]) == 0) 113 if (gpio_read_pin(row_pins[row_index]) == 0)
114 { 114 {
115 // Pin LO, set col bit 115 // Pin LO, set col bit
116 current_matrix[tmp] |= (MATRIX_ROW_SHIFTER << current_col); 116 current_matrix[tmp] |= (MATRIX_ROW_SHIFTER << current_col);
diff --git a/keyboards/gl516/n51gl/matrix.c b/keyboards/gl516/n51gl/matrix.c
index af13768b08..1e2948f716 100644
--- a/keyboards/gl516/n51gl/matrix.c
+++ b/keyboards/gl516/n51gl/matrix.c
@@ -21,37 +21,37 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
21 21
22static void select_row(uint8_t row) 22static void select_row(uint8_t row)
23{ 23{
24 setPinOutput(row_pins[row]); 24 gpio_set_pin_output(row_pins[row]);
25 writePinLow(row_pins[row]); 25 gpio_write_pin_low(row_pins[row]);
26} 26}
27 27
28static void unselect_row(uint8_t row) 28static void unselect_row(uint8_t row)
29{ 29{
30 setPinInputHigh(row_pins[row]); 30 gpio_set_pin_input_high(row_pins[row]);
31} 31}
32 32
33static void unselect_rows(void) 33static void unselect_rows(void)
34{ 34{
35 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 35 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
36 setPinInputHigh(row_pins[x]); 36 gpio_set_pin_input_high(row_pins[x]);
37 } 37 }
38} 38}
39 39
40static void select_col(uint8_t col) 40static void select_col(uint8_t col)
41{ 41{
42 setPinOutput(col_pins[col]); 42 gpio_set_pin_output(col_pins[col]);
43 writePinLow(col_pins[col]); 43 gpio_write_pin_low(col_pins[col]);
44} 44}
45 45
46static void unselect_col(uint8_t col) 46static void unselect_col(uint8_t col)
47{ 47{
48 setPinInputHigh(col_pins[col]); 48 gpio_set_pin_input_high(col_pins[col]);
49} 49}
50 50
51static void unselect_cols(void) 51static void unselect_cols(void)
52{ 52{
53 for(uint8_t x = 0; x < MATRIX_COLS; x++) { 53 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
54 setPinInputHigh(col_pins[x]); 54 gpio_set_pin_input_high(col_pins[x]);
55 } 55 }
56} 56}
57 57
@@ -59,10 +59,10 @@ static void init_pins(void) {
59 unselect_rows(); 59 unselect_rows();
60 unselect_cols(); 60 unselect_cols();
61 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 61 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
62 setPinInputHigh(col_pins[x]); 62 gpio_set_pin_input_high(col_pins[x]);
63 } 63 }
64 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 64 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
65 setPinInputHigh(row_pins[x]); 65 gpio_set_pin_input_high(row_pins[x]);
66 } 66 }
67} 67}
68 68
@@ -82,7 +82,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
82 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 82 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
83 83
84 // Select the col pin to read (active low) 84 // Select the col pin to read (active low)
85 uint8_t pin_state = readPin(col_pins[col_index]); 85 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
86 86
87 // Populate the matrix row with the state of the col pin 87 // Populate the matrix row with the state of the col pin
88 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 88 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -110,7 +110,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
110 matrix_row_t last_row_value = current_matrix[tmp]; 110 matrix_row_t last_row_value = current_matrix[tmp];
111 111
112 // Check row pin state 112 // Check row pin state
113 if (readPin(row_pins[row_index]) == 0) 113 if (gpio_read_pin(row_pins[row_index]) == 0)
114 { 114 {
115 // Pin LO, set col bit 115 // Pin LO, set col bit
116 current_matrix[tmp] |= (MATRIX_ROW_SHIFTER << current_col); 116 current_matrix[tmp] |= (MATRIX_ROW_SHIFTER << current_col);
diff --git a/keyboards/glenpickle/chimera_ortho_plus/chimera_ortho_plus.c b/keyboards/glenpickle/chimera_ortho_plus/chimera_ortho_plus.c
index 6f32d1fb55..b75fff9634 100644
--- a/keyboards/glenpickle/chimera_ortho_plus/chimera_ortho_plus.c
+++ b/keyboards/glenpickle/chimera_ortho_plus/chimera_ortho_plus.c
@@ -9,7 +9,6 @@ void led_init(void) {
9 gpio_write_pin_high(CHIMERA_ORTHO_PLUS_RED_LED_PIN); 9 gpio_write_pin_high(CHIMERA_ORTHO_PLUS_RED_LED_PIN);
10} 10}
11 11
12
13void matrix_init_kb(void) { 12void matrix_init_kb(void) {
14 // put your keyboard start-up code here 13 // put your keyboard start-up code here
15 // runs once when the firmware starts up 14 // runs once when the firmware starts up
diff --git a/keyboards/gmmk/gmmk2/p96/ansi/ansi.c b/keyboards/gmmk/gmmk2/p96/ansi/ansi.c
index d60b9e2254..5b2b5893f7 100644
--- a/keyboards/gmmk/gmmk2/p96/ansi/ansi.c
+++ b/keyboards/gmmk/gmmk2/p96/ansi/ansi.c
@@ -317,9 +317,9 @@ void spi_init(void) {
317 is_initialised = true; 317 is_initialised = true;
318 318
319 // Try releasing special pins for a short time 319 // Try releasing special pins for a short time
320 setPinInput(SPI_SCK_PIN); 320 gpio_set_pin_input(SPI_SCK_PIN);
321 setPinInput(SPI_MOSI_PIN); 321 gpio_set_pin_input(SPI_MOSI_PIN);
322 setPinInput(SPI_MISO_PIN); 322 gpio_set_pin_input(SPI_MISO_PIN);
323 323
324 chThdSleepMilliseconds(10); 324 chThdSleepMilliseconds(10);
325 325
diff --git a/keyboards/gmmk/gmmk2/p96/iso/iso.c b/keyboards/gmmk/gmmk2/p96/iso/iso.c
index af2ee17c4a..9a5c357307 100644
--- a/keyboards/gmmk/gmmk2/p96/iso/iso.c
+++ b/keyboards/gmmk/gmmk2/p96/iso/iso.c
@@ -313,9 +313,9 @@ void spi_init(void) {
313 is_initialised = true; 313 is_initialised = true;
314 314
315 // Try releasing special pins for a short time 315 // Try releasing special pins for a short time
316 setPinInput(SPI_SCK_PIN); 316 gpio_set_pin_input(SPI_SCK_PIN);
317 setPinInput(SPI_MOSI_PIN); 317 gpio_set_pin_input(SPI_MOSI_PIN);
318 setPinInput(SPI_MISO_PIN); 318 gpio_set_pin_input(SPI_MISO_PIN);
319 319
320 chThdSleepMilliseconds(10); 320 chThdSleepMilliseconds(10);
321 321
diff --git a/keyboards/gmmk/numpad/matrix.c b/keyboards/gmmk/numpad/matrix.c
index 68d4ab6524..4ec41bdb73 100644
--- a/keyboards/gmmk/numpad/matrix.c
+++ b/keyboards/gmmk/numpad/matrix.c
@@ -21,27 +21,27 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
21 21
22static inline void setPinOutput_writeLow(pin_t pin) { 22static inline void setPinOutput_writeLow(pin_t pin) {
23 ATOMIC_BLOCK_FORCEON { 23 ATOMIC_BLOCK_FORCEON {
24 setPinOutput(pin); 24 gpio_set_pin_output(pin);
25 writePinLow(pin); 25 gpio_write_pin_low(pin);
26 } 26 }
27} 27}
28 28
29static inline void setPinOutput_writeHigh(pin_t pin) { 29static inline void setPinOutput_writeHigh(pin_t pin) {
30 ATOMIC_BLOCK_FORCEON { 30 ATOMIC_BLOCK_FORCEON {
31 setPinOutput(pin); 31 gpio_set_pin_output(pin);
32 writePinHigh(pin); 32 gpio_write_pin_high(pin);
33 } 33 }
34} 34}
35 35
36static inline void setPinInputHigh_atomic(pin_t pin) { 36static inline void setPinInputHigh_atomic(pin_t pin) {
37 ATOMIC_BLOCK_FORCEON { 37 ATOMIC_BLOCK_FORCEON {
38 setPinInputHigh(pin); 38 gpio_set_pin_input_high(pin);
39 } 39 }
40} 40}
41 41
42static inline uint8_t readMatrixPin(pin_t pin) { 42static inline uint8_t readMatrixPin(pin_t pin) {
43 if (pin != NO_PIN) { 43 if (pin != NO_PIN) {
44 return readPin(pin); 44 return gpio_read_pin(pin);
45 } else { 45 } else {
46 return 1; 46 return 1;
47 } 47 }
diff --git a/keyboards/gmmk/numpad/numpad.c b/keyboards/gmmk/numpad/numpad.c
index 5a2bbdb1f6..cdbc4b871a 100644
--- a/keyboards/gmmk/numpad/numpad.c
+++ b/keyboards/gmmk/numpad/numpad.c
@@ -111,8 +111,8 @@ led_config_t g_led_config = {{
111 111
112void keyboard_pre_init_user(void) { 112void keyboard_pre_init_user(void) {
113 wait_ms(2000); 113 wait_ms(2000);
114 setPinOutput(AW20216S_PW_EN_PIN); 114 gpio_set_pin_output(AW20216S_PW_EN_PIN);
115 writePinHigh(AW20216S_PW_EN_PIN); 115 gpio_write_pin_high(AW20216S_PW_EN_PIN);
116} 116}
117# endif 117# endif
118 118
diff --git a/keyboards/gray_studio/think65/solder/solder.c b/keyboards/gray_studio/think65/solder/solder.c
index f97a005218..84267b9db0 100644
--- a/keyboards/gray_studio/think65/solder/solder.c
+++ b/keyboards/gray_studio/think65/solder/solder.c
@@ -24,13 +24,13 @@ void matrix_init_kb(void) {
24 // put your keyboard start-up code here 24 // put your keyboard start-up code here
25 // runs once when the firmware starts up 25 // runs once when the firmware starts up
26 26
27 setPinOutput(C7); 27 gpio_set_pin_output(C7);
28 matrix_init_user(); 28 matrix_init_user();
29} 29}
30 30
31bool led_update_kb(led_t led_state) { 31bool led_update_kb(led_t led_state) {
32 if(led_update_user(led_state)) { 32 if(led_update_user(led_state)) {
33 writePin(C7, !led_state.caps_lock); 33 gpio_write_pin(C7, !led_state.caps_lock);
34 } 34 }
35 return true; 35 return true;
36} 36}
diff --git a/keyboards/halfcliff/matrix.c b/keyboards/halfcliff/matrix.c
index 99598dc1b7..ad3ad6ba09 100644
--- a/keyboards/halfcliff/matrix.c
+++ b/keyboards/halfcliff/matrix.c
@@ -52,13 +52,13 @@ void matrix_print(void) {}
52 52
53static inline void setPinOutput_writeLow(pin_t pin) { 53static inline void setPinOutput_writeLow(pin_t pin) {
54 ATOMIC_BLOCK_FORCEON { 54 ATOMIC_BLOCK_FORCEON {
55 setPinOutput(pin); 55 gpio_set_pin_output(pin);
56 writePinLow(pin); 56 gpio_write_pin_low(pin);
57 } 57 }
58} 58}
59 59
60static inline void setPinInputHigh_atomic(pin_t pin) { 60static inline void setPinInputHigh_atomic(pin_t pin) {
61 ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } 61 ATOMIC_BLOCK_FORCEON { gpio_set_pin_input_high(pin); }
62} 62}
63 63
64// matrix code 64// matrix code
@@ -83,7 +83,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
83 // For each col... 83 // For each col...
84 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 84 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
85 // Select the col pin to read (active low) 85 // Select the col pin to read (active low)
86 uint8_t pin_state = readPin(col_pins[col_index]); 86 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
87 87
88 // Populate the matrix row with the state of the col pin 88 // Populate the matrix row with the state of the col pin
89 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 89 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -138,7 +138,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
138 matrix_row_t current_row_value = last_row_value; 138 matrix_row_t current_row_value = last_row_value;
139 139
140 // Check row pin state 140 // Check row pin state
141 if (readPin(row_pins[row_index]) == 0) { 141 if (gpio_read_pin(row_pins[row_index]) == 0) {
142 // Pin LO, set col bit 142 // Pin LO, set col bit
143 current_row_value |= (MATRIX_ROW_SHIFTER << current_col); 143 current_row_value |= (MATRIX_ROW_SHIFTER << current_col);
144 } else { 144 } else {
diff --git a/keyboards/handwired/2x5keypad/2x5keypad.c b/keyboards/handwired/2x5keypad/2x5keypad.c
index 873c579a17..cbd4c519b0 100644
--- a/keyboards/handwired/2x5keypad/2x5keypad.c
+++ b/keyboards/handwired/2x5keypad/2x5keypad.c
@@ -5,21 +5,21 @@ void matrix_init_kb(void)
5{ 5{
6 matrix_init_user(); 6 matrix_init_user();
7 7
8 setPinOutput(RED_LED); 8 gpio_set_pin_output(RED_LED);
9 setPinOutput(BLUE_LED); 9 gpio_set_pin_output(BLUE_LED);
10 setPinOutput(GREEN_LED); 10 gpio_set_pin_output(GREEN_LED);
11} 11}
12 12
13 13
14 14
15void turn_off_leds(void) 15void turn_off_leds(void)
16{ 16{
17 writePinLow(RED_LED); 17 gpio_write_pin_low(RED_LED);
18 writePinLow(BLUE_LED); 18 gpio_write_pin_low(BLUE_LED);
19 writePinLow(GREEN_LED); 19 gpio_write_pin_low(GREEN_LED);
20} 20}
21 21
22void turn_on_led(pin_t pin) 22void turn_on_led(pin_t pin)
23{ 23{
24 writePinHigh(pin); 24 gpio_write_pin_high(pin);
25} 25}
diff --git a/keyboards/handwired/aek64/aek64.c b/keyboards/handwired/aek64/aek64.c
index 0646d308d0..130d014616 100644
--- a/keyboards/handwired/aek64/aek64.c
+++ b/keyboards/handwired/aek64/aek64.c
@@ -24,13 +24,13 @@ void keyboard_pre_init_user(void) {
24 // Call the keyboard pre init code. 24 // Call the keyboard pre init code.
25 25
26 // Set our LED pins as output 26 // Set our LED pins as output
27 setPinOutput(C3); 27 gpio_set_pin_output(C3);
28} 28}
29 29
30void matrix_init_kb(void) { 30void matrix_init_kb(void) {
31 31
32 // Flash the led 1 sec on startup. 32 // Flash the led 1 sec on startup.
33 writePinHigh(C3); 33 gpio_write_pin_high(C3);
34 wait_ms(1000); 34 wait_ms(1000);
35 writePinLow(C3); 35 gpio_write_pin_low(C3);
36} 36}
diff --git a/keyboards/handwired/battleship_gamepad/battleship_gamepad.c b/keyboards/handwired/battleship_gamepad/battleship_gamepad.c
index 048500da8c..cccc03a287 100644
--- a/keyboards/handwired/battleship_gamepad/battleship_gamepad.c
+++ b/keyboards/handwired/battleship_gamepad/battleship_gamepad.c
@@ -24,5 +24,5 @@ joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = {
24 24
25/* joystick button code (thumbstick pressed) */ 25/* joystick button code (thumbstick pressed) */
26void keyboard_pre_init_kb(void) { 26void keyboard_pre_init_kb(void) {
27 setPinInputHigh(F6); 27 gpio_set_pin_input_high(F6);
28} 28}
diff --git a/keyboards/handwired/colorlice/colorlice.c b/keyboards/handwired/colorlice/colorlice.c
index 736db8d465..ede3fba82f 100644
--- a/keyboards/handwired/colorlice/colorlice.c
+++ b/keyboards/handwired/colorlice/colorlice.c
@@ -55,14 +55,14 @@ void suspend_wakeup_init_kb(void)
55bool led_update_kb(led_t led_state) { 55bool led_update_kb(led_t led_state) {
56 bool res = led_update_user(led_state); 56 bool res = led_update_user(led_state);
57 if(res) { 57 if(res) {
58 // writePin sets the pin high for 1 and low for 0. 58 // gpio_write_pin sets the pin high for 1 and low for 0.
59 // In this example the pins are inverted, setting 59 // In this example the pins are inverted, setting
60 // it low/0 turns it on, and high/1 turns the LED off. 60 // it low/0 turns it on, and high/1 turns the LED off.
61 // This behavior depends on whether the LED is between the pin 61 // This behavior depends on whether the LED is between the pin
62 // and VCC or the pin and GND. 62 // and VCC or the pin and GND.
63 writePin(B2, !led_state.num_lock); 63 gpio_write_pin(B2, !led_state.num_lock);
64 writePin(C6, !led_state.caps_lock); 64 gpio_write_pin(C6, !led_state.caps_lock);
65 writePin(B7, !led_state.scroll_lock); 65 gpio_write_pin(B7, !led_state.scroll_lock);
66 } 66 }
67 return res; 67 return res;
68} 68}
diff --git a/keyboards/handwired/dqz11n1g/matrix.c b/keyboards/handwired/dqz11n1g/matrix.c
index 398f961aa5..49b3c2da81 100644
--- a/keyboards/handwired/dqz11n1g/matrix.c
+++ b/keyboards/handwired/dqz11n1g/matrix.c
@@ -25,7 +25,7 @@ static void unselect_rows(void);
25void matrix_init_custom(void) { 25void matrix_init_custom(void) {
26 /* initialize row pins */ 26 /* initialize row pins */
27 for (uint8_t row = 0; row < MATRIX_ROWS; row++) { 27 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
28 setPinOutput(row_pins[row]); 28 gpio_set_pin_output(row_pins[row]);
29 } 29 }
30 unselect_rows(); 30 unselect_rows();
31 31
@@ -47,20 +47,20 @@ void matrix_init_custom(void) {
47 spi_start(slavePin, lsbFirst, mode, divisor); 47 spi_start(slavePin, lsbFirst, mode, divisor);
48 48
49 /* Initialize pin controlling the shift register's SH/~LD pin */ 49 /* Initialize pin controlling the shift register's SH/~LD pin */
50 setPinOutput(ROW_SHIFT_PIN); 50 gpio_set_pin_output(ROW_SHIFT_PIN);
51} 51}
52 52
53static void select_row(uint8_t row) { 53static void select_row(uint8_t row) {
54 pin_t pin = row_pins[row]; 54 pin_t pin = row_pins[row];
55 if (pin != NO_PIN) { 55 if (pin != NO_PIN) {
56 writePinHigh(pin); 56 gpio_write_pin_high(pin);
57 } 57 }
58} 58}
59 59
60static void unselect_row(uint8_t row) { 60static void unselect_row(uint8_t row) {
61 pin_t pin = row_pins[row]; 61 pin_t pin = row_pins[row];
62 if (pin != NO_PIN) { 62 if (pin != NO_PIN) {
63 writePinLow(pin); 63 gpio_write_pin_low(pin);
64 } 64 }
65} 65}
66 66
@@ -75,12 +75,12 @@ bool matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
75 matrix_row_t current_row_value = 0; 75 matrix_row_t current_row_value = 0;
76 76
77 /* Set shift register SH/~LD pin to "load" mode */ 77 /* Set shift register SH/~LD pin to "load" mode */
78 writePinLow(ROW_SHIFT_PIN); 78 gpio_write_pin_low(ROW_SHIFT_PIN);
79 select_row(current_row); 79 select_row(current_row);
80 matrix_output_select_delay(); 80 matrix_output_select_delay();
81 81
82 /* Set shift register SH/~LD pin to "shift" mode */ 82 /* Set shift register SH/~LD pin to "shift" mode */
83 writePinHigh(ROW_SHIFT_PIN); 83 gpio_write_pin_high(ROW_SHIFT_PIN);
84 84
85 /* For each octet of columns... */ 85 /* For each octet of columns... */
86 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index += 8) { 86 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index += 8) {
diff --git a/keyboards/handwired/evk/v1_3/v1_3.c b/keyboards/handwired/evk/v1_3/v1_3.c
index 7c68893968..a568ba3f86 100644
--- a/keyboards/handwired/evk/v1_3/v1_3.c
+++ b/keyboards/handwired/evk/v1_3/v1_3.c
@@ -23,22 +23,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
23// runs once when the firmware starts up 23// runs once when the firmware starts up
24void matrix_init_kb(void) { 24void matrix_init_kb(void) {
25 // Set the LEDs pins 25 // Set the LEDs pins
26 setPinOutput(D5); // Layer 1 Status LED 26 gpio_set_pin_output(D5); // Layer 1 Status LED
27 27
28 matrix_init_user(); 28 matrix_init_user();
29} 29}
30 30
31// Set LED based on layer 31// Set LED based on layer
32__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { 32__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
33 writePin(D5, layer_state_cmp(state, 1)); 33 gpio_write_pin(D5, layer_state_cmp(state, 1));
34 return state; 34 return state;
35} 35}
36 36
37bool led_update_kb(led_t led_state) { 37bool led_update_kb(led_t led_state) {
38 bool res = led_update_user(led_state); 38 bool res = led_update_user(led_state);
39 if (res) { 39 if (res) {
40 // writePin sets the pin high for 1 and low for 0. 40 // gpio_write_pin sets the pin high for 1 and low for 0.
41 writePin(D4, led_state.caps_lock); 41 gpio_write_pin(D4, led_state.caps_lock);
42 } 42 }
43 return res; 43 return res;
44} 44}
diff --git a/keyboards/handwired/jopr/jopr.c b/keyboards/handwired/jopr/jopr.c
index e6d6f05dd2..cb155ecb4b 100644
--- a/keyboards/handwired/jopr/jopr.c
+++ b/keyboards/handwired/jopr/jopr.c
@@ -1,7 +1,7 @@
1#include "quantum.h" 1#include "quantum.h"
2 2
3void led_init_ports(void) { 3void led_init_ports(void) {
4 setPinOutput(F0); 4 gpio_set_pin_output(F0);
5 setPinOutput(F1); 5 gpio_set_pin_output(F1);
6 setPinOutput(F4); 6 gpio_set_pin_output(F4);
7} \ No newline at end of file 7} \ No newline at end of file
diff --git a/keyboards/handwired/jotanck/jotanck.c b/keyboards/handwired/jotanck/jotanck.c
index c0b54bb64d..6a982d2fcf 100644
--- a/keyboards/handwired/jotanck/jotanck.c
+++ b/keyboards/handwired/jotanck/jotanck.c
@@ -17,8 +17,8 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 setPinOutput(JOTANCK_LED1); 20 gpio_set_pin_output(JOTANCK_LED1);
21 setPinOutput(JOTANCK_LED2); 21 gpio_set_pin_output(JOTANCK_LED2);
22 22
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
diff --git a/keyboards/handwired/jotpad16/jotpad16.c b/keyboards/handwired/jotpad16/jotpad16.c
index 02b4daafd6..7acb31b0df 100644
--- a/keyboards/handwired/jotpad16/jotpad16.c
+++ b/keyboards/handwired/jotpad16/jotpad16.c
@@ -1,8 +1,8 @@
1#include "quantum.h" 1#include "quantum.h"
2 2
3void keyboard_pre_init_kb(void) { 3void keyboard_pre_init_kb(void) {
4 setPinOutput(JOTPAD16_LED1); 4 gpio_set_pin_output(JOTPAD16_LED1);
5 setPinOutput(JOTPAD16_LED2); 5 gpio_set_pin_output(JOTPAD16_LED2);
6 6
7 keyboard_pre_init_user(); 7 keyboard_pre_init_user();
8} 8}
diff --git a/keyboards/handwired/jtallbean/split_65/split_65.c b/keyboards/handwired/jtallbean/split_65/split_65.c
index d408f5577b..b75b12137f 100644
--- a/keyboards/handwired/jtallbean/split_65/split_65.c
+++ b/keyboards/handwired/jtallbean/split_65/split_65.c
@@ -25,8 +25,8 @@ void matrix_init_kb(void) {
25 // runs once when the firmware starts up 25 // runs once when the firmware starts up
26 26
27 // Set our LED pins as output 27 // Set our LED pins as output
28 setPinOutput(B0); 28 gpio_set_pin_output(B0);
29 writePinLow(B0); 29 gpio_write_pin_low(B0);
30 30
31 matrix_init_user(); 31 matrix_init_user();
32} 32}
@@ -36,8 +36,8 @@ bool led_update_kb(led_t led_state) {
36 36
37 bool res = led_update_user(led_state); 37 bool res = led_update_user(led_state);
38 if(res) { 38 if(res) {
39 // writePin sets the pin high for 1 and low for 0. 39 // gpio_write_pin sets the pin high for 1 and low for 0.
40 writePin(B0, led_state.caps_lock); 40 gpio_write_pin(B0, led_state.caps_lock);
41 } 41 }
42 return res; 42 return res;
43} 43}
diff --git a/keyboards/handwired/lagrange/lagrange.c b/keyboards/handwired/lagrange/lagrange.c
index 0c76512c57..4b80752518 100644
--- a/keyboards/handwired/lagrange/lagrange.c
+++ b/keyboards/handwired/lagrange/lagrange.c
@@ -35,7 +35,7 @@ bool is_keyboard_master(void) {
35 static int8_t is_master = -1; 35 static int8_t is_master = -1;
36 36
37 if (is_master < 0) { 37 if (is_master < 0) {
38 while (readPin(SPI_SS_PIN)) { 38 while (gpio_read_pin(SPI_SS_PIN)) {
39 if (USB_Device_IsAddressSet()) { 39 if (USB_Device_IsAddressSet()) {
40 is_master = 1; 40 is_master = 1;
41 return is_master; 41 return is_master;
@@ -53,7 +53,7 @@ bool is_keyboard_master(void) {
53} 53}
54 54
55void keyboard_pre_init_kb(void) { 55void keyboard_pre_init_kb(void) {
56 setPinInputHigh(SPI_SS_PIN); 56 gpio_set_pin_input_high(SPI_SS_PIN);
57 57
58 keyboard_pre_init_user(); 58 keyboard_pre_init_user();
59} 59}
diff --git a/keyboards/handwired/lagrange/transport.c b/keyboards/handwired/lagrange/transport.c
index ec91cff306..3ff2e9f409 100644
--- a/keyboards/handwired/lagrange/transport.c
+++ b/keyboards/handwired/lagrange/transport.c
@@ -53,7 +53,7 @@ bool shake_hands(bool master) {
53 * alignment. */ 53 * alignment. */
54 54
55 if (master) { 55 if (master) {
56 writePinLow(SPI_SS_PIN); 56 gpio_write_pin_low(SPI_SS_PIN);
57 } 57 }
58 58
59 for (i = 0 ; i < 8 ; i += 1) { 59 for (i = 0 ; i < 8 ; i += 1) {
@@ -64,7 +64,7 @@ bool shake_hands(bool master) {
64 } 64 }
65 65
66 if (master) { 66 if (master) {
67 writePinHigh(SPI_SS_PIN); 67 gpio_write_pin_high(SPI_SS_PIN);
68 } 68 }
69 } while (i < 8); 69 } while (i < 8);
70 70
@@ -176,8 +176,8 @@ void transport_master_init(void) {
176 * above depends on it and the SPI master driver won't do it 176 * above depends on it and the SPI master driver won't do it
177 * before we call spi_start(). */ 177 * before we call spi_start(). */
178 178
179 writePinHigh(SPI_SS_PIN); 179 gpio_write_pin_high(SPI_SS_PIN);
180 setPinOutput(SPI_SS_PIN); 180 gpio_set_pin_output(SPI_SS_PIN);
181 181
182 spi_init(); 182 spi_init();
183 183
@@ -195,10 +195,10 @@ void transport_slave_init(void) {
195 * they're asserted making the MISO pin an output on both ends and 195 * they're asserted making the MISO pin an output on both ends and
196 * leading to potential shorts. */ 196 * leading to potential shorts. */
197 197
198 setPinInputHigh(SPI_SS_PIN); 198 gpio_set_pin_input_high(SPI_SS_PIN);
199 setPinInput(SPI_SCK_PIN); 199 gpio_set_pin_input(SPI_SCK_PIN);
200 setPinInput(SPI_MOSI_PIN); 200 gpio_set_pin_input(SPI_MOSI_PIN);
201 setPinOutput(SPI_MISO_PIN); 201 gpio_set_pin_output(SPI_MISO_PIN);
202 202
203 SPCR = _BV(SPE); 203 SPCR = _BV(SPE);
204 204
diff --git a/keyboards/handwired/owlet60/matrix.c b/keyboards/handwired/owlet60/matrix.c
index b233dd7a52..43895468e9 100644
--- a/keyboards/handwired/owlet60/matrix.c
+++ b/keyboards/handwired/owlet60/matrix.c
@@ -129,19 +129,19 @@ void matrix_print(void)
129// uses standard row code 129// uses standard row code
130static void select_row(uint8_t row) 130static void select_row(uint8_t row)
131{ 131{
132 setPinOutput(row_pins[row]); 132 gpio_set_pin_output(row_pins[row]);
133 writePinLow(row_pins[row]); 133 gpio_write_pin_low(row_pins[row]);
134} 134}
135 135
136static void unselect_row(uint8_t row) 136static void unselect_row(uint8_t row)
137{ 137{
138 setPinInputHigh(row_pins[row]); 138 gpio_set_pin_input_high(row_pins[row]);
139} 139}
140 140
141static void unselect_rows(void) 141static void unselect_rows(void)
142{ 142{
143 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 143 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
144 setPinInputHigh(row_pins[x]); 144 gpio_set_pin_input_high(row_pins[x]);
145 } 145 }
146} 146}
147 147
@@ -149,10 +149,10 @@ static void init_pins(void) { // still need some fixing, this might not work
149 unselect_rows(); // with the loop 149 unselect_rows(); // with the loop
150 /* 150 /*
151 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 151 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
152 setPinInputHigh(col_pins[x]); 152 gpio_set_pin_input_high(col_pins[x]);
153 } 153 }
154 */ 154 */
155 setPinInputHigh(dat_pin); 155 gpio_set_pin_input_high(dat_pin);
156} 156}
157 157
158static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) 158static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
@@ -173,7 +173,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
173 // Select the col pin to read (active low) 173 // Select the col pin to read (active low)
174 select_col_analog(col_index); 174 select_col_analog(col_index);
175 wait_us(30); 175 wait_us(30);
176 uint8_t pin_state = readPin(dat_pin); 176 uint8_t pin_state = gpio_read_pin(dat_pin);
177 177
178 // Populate the matrix row with the state of the col pin 178 // Populate the matrix row with the state of the col pin
179 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); 179 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
@@ -201,8 +201,8 @@ void matrix_init(void) {
201 201
202 matrix_init_kb(); 202 matrix_init_kb();
203 203
204 setPinInput(D5); 204 gpio_set_pin_input(D5);
205 setPinInput(B0); 205 gpio_set_pin_input(B0);
206} 206}
207 207
208// modified for per col read matrix scan 208// modified for per col read matrix scan
@@ -273,27 +273,27 @@ static void select_col_analog(uint8_t col) {
273 273
274static void mux_pin_control(const uint8_t binary[]) { 274static void mux_pin_control(const uint8_t binary[]) {
275 // set pin0 275 // set pin0
276 setPinOutput(col_select_pins[0]); 276 gpio_set_pin_output(col_select_pins[0]);
277 if(binary[2] == 0) { 277 if(binary[2] == 0) {
278 writePinLow(col_select_pins[0]); 278 gpio_write_pin_low(col_select_pins[0]);
279 } 279 }
280 else { 280 else {
281 writePinHigh(col_select_pins[0]); 281 gpio_write_pin_high(col_select_pins[0]);
282 } 282 }
283 // set pin1 283 // set pin1
284 setPinOutput(col_select_pins[1]); 284 gpio_set_pin_output(col_select_pins[1]);
285 if(binary[1] == 0) { 285 if(binary[1] == 0) {
286 writePinLow(col_select_pins[1]); 286 gpio_write_pin_low(col_select_pins[1]);
287 } 287 }
288 else { 288 else {
289 writePinHigh(col_select_pins[1]); 289 gpio_write_pin_high(col_select_pins[1]);
290 } 290 }
291 // set pin2 291 // set pin2
292 setPinOutput(col_select_pins[2]); 292 gpio_set_pin_output(col_select_pins[2]);
293 if(binary[0] == 0) { 293 if(binary[0] == 0) {
294 writePinLow(col_select_pins[2]); 294 gpio_write_pin_low(col_select_pins[2]);
295 } 295 }
296 else { 296 else {
297 writePinHigh(col_select_pins[2]); 297 gpio_write_pin_high(col_select_pins[2]);
298 } 298 }
299} 299}
diff --git a/keyboards/handwired/prime_exl_plus/prime_exl_plus.c b/keyboards/handwired/prime_exl_plus/prime_exl_plus.c
index cc7f5de31e..1865b6c502 100644
--- a/keyboards/handwired/prime_exl_plus/prime_exl_plus.c
+++ b/keyboards/handwired/prime_exl_plus/prime_exl_plus.c
@@ -17,22 +17,22 @@
17 17
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 // set CapsLock LED to output and low 19 // set CapsLock LED to output and low
20 setPinOutput(B0); 20 gpio_set_pin_output(B0);
21 writePinLow(B0); 21 gpio_write_pin_low(B0);
22 // set NumLock LED to output and low 22 // set NumLock LED to output and low
23 setPinOutput(B1); 23 gpio_set_pin_output(B1);
24 writePinLow(B1); 24 gpio_write_pin_low(B1);
25 // set ScrollLock LED to output and low 25 // set ScrollLock LED to output and low
26 setPinOutput(B2); 26 gpio_set_pin_output(B2);
27 writePinLow(B2); 27 gpio_write_pin_low(B2);
28} 28}
29 29
30bool led_update_kb(led_t led_state) { 30bool led_update_kb(led_t led_state) {
31 bool res = led_update_user(led_state); 31 bool res = led_update_user(led_state);
32 if(res) { 32 if(res) {
33 writePin(B1, led_state.num_lock); 33 gpio_write_pin(B1, led_state.num_lock);
34 writePin(B0, led_state.caps_lock); 34 gpio_write_pin(B0, led_state.caps_lock);
35 //writePin(B2, led_state.scroll_lock); 35 //gpio_write_pin(B2, led_state.scroll_lock);
36 } 36 }
37 return res; 37 return res;
38} 38}
@@ -41,9 +41,9 @@ bool led_update_kb(led_t led_state) {
41layer_state_t layer_state_set_kb(layer_state_t state) 41layer_state_t layer_state_set_kb(layer_state_t state)
42{ 42{
43 if (get_highest_layer(state) == 1) { 43 if (get_highest_layer(state) == 1) {
44 writePinHigh(B2); 44 gpio_write_pin_high(B2);
45 } else { 45 } else {
46 writePinLow(B2); 46 gpio_write_pin_low(B2);
47 } 47 }
48 return layer_state_set_user(state); 48 return layer_state_set_user(state);
49} 49}
diff --git a/keyboards/handwired/retro_refit/retro_refit.c b/keyboards/handwired/retro_refit/retro_refit.c
index f23ef1fd40..b62d94d741 100644
--- a/keyboards/handwired/retro_refit/retro_refit.c
+++ b/keyboards/handwired/retro_refit/retro_refit.c
@@ -15,9 +15,9 @@ void matrix_init_kb(void) {
15bool led_update_kb(led_t led_state) { 15bool led_update_kb(led_t led_state) {
16 bool res = led_update_user(led_state); 16 bool res = led_update_user(led_state);
17 if(res) { 17 if(res) {
18 writePin(D0, !led_state.caps_lock); 18 gpio_write_pin(D0, !led_state.caps_lock);
19 writePin(D1, !led_state.num_lock); 19 gpio_write_pin(D1, !led_state.num_lock);
20 writePin(C6, !led_state.scroll_lock); 20 gpio_write_pin(C6, !led_state.scroll_lock);
21 21
22 } 22 }
23 return res; 23 return res;
diff --git a/keyboards/handwired/selene/selene.c b/keyboards/handwired/selene/selene.c
index a3702ce02e..b0924c06f4 100644
--- a/keyboards/handwired/selene/selene.c
+++ b/keyboards/handwired/selene/selene.c
@@ -18,9 +18,9 @@
18#include "selene.h" 18#include "selene.h"
19 19
20void matrix_init_kb(void){ 20void matrix_init_kb(void){
21 setPinOutput(NUM_LOCK_PIN); 21 gpio_set_pin_output(NUM_LOCK_PIN);
22 setPinOutput(CAPS_LOCK_PIN); 22 gpio_set_pin_output(CAPS_LOCK_PIN);
23 setPinOutput(SCROLL_LOCK_PIN); 23 gpio_set_pin_output(SCROLL_LOCK_PIN);
24} 24}
25 25
26void keyboard_post_init_user(void) { 26void keyboard_post_init_user(void) {
@@ -30,9 +30,9 @@ void keyboard_post_init_user(void) {
30bool led_update_kb(led_t led_state) { 30bool led_update_kb(led_t led_state) {
31 bool res = led_update_user(led_state); 31 bool res = led_update_user(led_state);
32 if(res) { 32 if(res) {
33 writePin(NUM_LOCK_PIN, led_state.num_lock); 33 gpio_write_pin(NUM_LOCK_PIN, led_state.num_lock);
34 writePin(CAPS_LOCK_PIN, led_state.caps_lock); 34 gpio_write_pin(CAPS_LOCK_PIN, led_state.caps_lock);
35 writePin(SCROLL_LOCK_PIN, led_state.scroll_lock); 35 gpio_write_pin(SCROLL_LOCK_PIN, led_state.scroll_lock);
36 } 36 }
37 return res; 37 return res;
38} 38}
diff --git a/keyboards/handwired/sono1/sono1.c b/keyboards/handwired/sono1/sono1.c
index d19f188a19..449289a1e9 100644
--- a/keyboards/handwired/sono1/sono1.c
+++ b/keyboards/handwired/sono1/sono1.c
@@ -18,17 +18,17 @@
18 18
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 /* LED pins setup */ 20 /* LED pins setup */
21 setPinOutput(LED_KANA_PIN); 21 gpio_set_pin_output(LED_KANA_PIN);
22 setPinOutput(LED_CAPS_LOCK_PIN); 22 gpio_set_pin_output(LED_CAPS_LOCK_PIN);
23 setPinOutput(LED_CTRL_XFER_PIN); 23 gpio_set_pin_output(LED_CTRL_XFER_PIN);
24 setPinOutput(LED_NUM_LOCK_PIN); 24 gpio_set_pin_output(LED_NUM_LOCK_PIN);
25 setPinOutput(LED_KB_LOCK_PIN); 25 gpio_set_pin_output(LED_KB_LOCK_PIN);
26 26
27 writePinHigh(LED_KANA_PIN); 27 gpio_write_pin_high(LED_KANA_PIN);
28 writePinHigh(LED_CAPS_LOCK_PIN); 28 gpio_write_pin_high(LED_CAPS_LOCK_PIN);
29 writePinHigh(LED_CTRL_XFER_PIN); 29 gpio_write_pin_high(LED_CTRL_XFER_PIN);
30 writePinHigh(LED_NUM_LOCK_PIN); 30 gpio_write_pin_high(LED_NUM_LOCK_PIN);
31 writePinHigh(LED_KB_LOCK_PIN); 31 gpio_write_pin_high(LED_KB_LOCK_PIN);
32 32
33 matrix_init_user(); 33 matrix_init_user();
34} 34}
@@ -36,9 +36,9 @@ void matrix_init_kb(void) {
36bool led_update_kb(led_t led_state) { 36bool led_update_kb(led_t led_state) {
37 bool res = led_update_user(led_state); 37 bool res = led_update_user(led_state);
38 if(res) { 38 if(res) {
39 writePin(LED_NUM_LOCK_PIN, !led_state.num_lock); 39 gpio_write_pin(LED_NUM_LOCK_PIN, !led_state.num_lock);
40 writePin(LED_CAPS_LOCK_PIN, !led_state.caps_lock); 40 gpio_write_pin(LED_CAPS_LOCK_PIN, !led_state.caps_lock);
41 writePin(LED_CTRL_XFER_PIN, !led_state.scroll_lock); 41 gpio_write_pin(LED_CTRL_XFER_PIN, !led_state.scroll_lock);
42 } 42 }
43 return res; 43 return res;
44} 44}
diff --git a/keyboards/handwired/symmetric70_proto/debug_config.h b/keyboards/handwired/symmetric70_proto/debug_config.h
index cba99e402f..5a575eb479 100644
--- a/keyboards/handwired/symmetric70_proto/debug_config.h
+++ b/keyboards/handwired/symmetric70_proto/debug_config.h
@@ -8,23 +8,23 @@
8#include <gpio.h> 8#include <gpio.h>
9 9
10static inline void setDebugPinOutput_Low(void) { 10static inline void setDebugPinOutput_Low(void) {
11 setPinOutput(MATRIX_DEBUG_PIN); 11 gpio_set_pin_output(MATRIX_DEBUG_PIN);
12 writePinLow(MATRIX_DEBUG_PIN); 12 gpio_write_pin_low(MATRIX_DEBUG_PIN);
13} 13}
14 14
15#define MATRIX_DEBUG_PIN_INIT() setDebugPinOutput_Low() 15#define MATRIX_DEBUG_PIN_INIT() setDebugPinOutput_Low()
16 16
17#ifdef MATRIX_DEBUG_SCAN 17#ifdef MATRIX_DEBUG_SCAN
18# define MATRIX_DEBUG_SCAN_START() writePinHigh(MATRIX_DEBUG_PIN) 18# define MATRIX_DEBUG_SCAN_START() gpio_write_pin_high(MATRIX_DEBUG_PIN)
19# define MATRIX_DEBUG_SCAN_END() writePinLow(MATRIX_DEBUG_PIN) 19# define MATRIX_DEBUG_SCAN_END() gpio_write_pin_low(MATRIX_DEBUG_PIN)
20#else 20#else
21# define MATRIX_DEBUG_SCAN_START() 21# define MATRIX_DEBUG_SCAN_START()
22# define MATRIX_DEBUG_SCAN_END() 22# define MATRIX_DEBUG_SCAN_END()
23#endif 23#endif
24 24
25#ifdef MATRIX_DEBUG_DELAY 25#ifdef MATRIX_DEBUG_DELAY
26# define MATRIX_DEBUG_DELAY_START() writePinHigh(MATRIX_DEBUG_PIN) 26# define MATRIX_DEBUG_DELAY_START() gpio_write_pin_high(MATRIX_DEBUG_PIN)
27# define MATRIX_DEBUG_DELAY_END() writePinLow(MATRIX_DEBUG_PIN) 27# define MATRIX_DEBUG_DELAY_END() gpio_write_pin_low(MATRIX_DEBUG_PIN)
28#else 28#else
29# define MATRIX_DEBUG_DELAY_START() 29# define MATRIX_DEBUG_DELAY_START()
30# define MATRIX_DEBUG_DELAY_END() 30# define MATRIX_DEBUG_DELAY_END()
diff --git a/keyboards/handwired/symmetric70_proto/matrix_debug/matrix.c b/keyboards/handwired/symmetric70_proto/matrix_debug/matrix.c
index d6fcb0f793..786c1b4a73 100644
--- a/keyboards/handwired/symmetric70_proto/matrix_debug/matrix.c
+++ b/keyboards/handwired/symmetric70_proto/matrix_debug/matrix.c
@@ -62,13 +62,13 @@ extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
62 62
63static inline void setPinOutput_writeLow(pin_t pin) { 63static inline void setPinOutput_writeLow(pin_t pin) {
64 ATOMIC_BLOCK_FORCEON { 64 ATOMIC_BLOCK_FORCEON {
65 setPinOutput(pin); 65 gpio_set_pin_output(pin);
66 writePinLow(pin); 66 gpio_write_pin_low(pin);
67 } 67 }
68} 68}
69 69
70static inline void setPinInputHigh_atomic(pin_t pin) { 70static inline void setPinInputHigh_atomic(pin_t pin) {
71 ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } 71 ATOMIC_BLOCK_FORCEON { gpio_set_pin_input_high(pin); }
72} 72}
73 73
74// matrix code 74// matrix code
@@ -80,7 +80,7 @@ static void init_pins(void) {
80 for (int col = 0; col < MATRIX_COLS; col++) { 80 for (int col = 0; col < MATRIX_COLS; col++) {
81 pin_t pin = direct_pins[row][col]; 81 pin_t pin = direct_pins[row][col];
82 if (pin != NO_PIN) { 82 if (pin != NO_PIN) {
83 setPinInputHigh(pin); 83 gpio_set_pin_input_high(pin);
84 } 84 }
85 } 85 }
86 } 86 }
@@ -93,7 +93,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
93 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 93 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
94 pin_t pin = direct_pins[current_row][col_index]; 94 pin_t pin = direct_pins[current_row][col_index];
95 if (pin != NO_PIN) { 95 if (pin != NO_PIN) {
96 current_row_value |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); 96 current_row_value |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
97 } 97 }
98 } 98 }
99 99
@@ -120,8 +120,8 @@ static void unselect_rows(void) {
120 120
121static void init_pins(void) { 121static void init_pins(void) {
122# ifdef MATRIX_MUL_SELECT 122# ifdef MATRIX_MUL_SELECT
123 setPinOutput(MATRIX_MUL_SELECT); 123 gpio_set_pin_output(MATRIX_MUL_SELECT);
124 writePinLow(MATRIX_MUL_SELECT); 124 gpio_write_pin_low(MATRIX_MUL_SELECT);
125# endif 125# endif
126 unselect_rows(); 126 unselect_rows();
127 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 127 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
@@ -141,10 +141,10 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
141 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 141 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
142 // Select the col pin to read (active low) 142 // Select the col pin to read (active low)
143# ifdef MATRIX_MUL_SELECT 143# ifdef MATRIX_MUL_SELECT
144 writePin(MATRIX_MUL_SELECT, col_sel[col_index]); 144 gpio_write_pin(MATRIX_MUL_SELECT, col_sel[col_index]);
145 waitInputPinDelay(); 145 waitInputPinDelay();
146# endif 146# endif
147 uint8_t pin_state = readPin(col_pins[col_index]); 147 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
148 148
149 // Populate the matrix row with the state of the col pin 149 // Populate the matrix row with the state of the col pin
150 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 150 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -160,7 +160,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
160 is_pressed = false; 160 is_pressed = false;
161 for (uint8_t i = 0; i < ARRAY_SIZE(delay_ports); i++) { 161 for (uint8_t i = 0; i < ARRAY_SIZE(delay_ports); i++) {
162# ifdef MATRIX_IO_DELAY_MULSEL 162# ifdef MATRIX_IO_DELAY_MULSEL
163 writePin(MATRIX_MUL_SELECT, delay_sel[i]); 163 gpio_write_pin(MATRIX_MUL_SELECT, delay_sel[i]);
164 waitInputPinDelay(); 164 waitInputPinDelay();
165# endif 165# endif
166 is_pressed |= ((readPort(delay_ports[i]) & delay_masks[i]) != delay_masks[i]); 166 is_pressed |= ((readPort(delay_ports[i]) & delay_masks[i]) != delay_masks[i]);
@@ -174,10 +174,10 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
174 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 174 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
175 MATRIX_DEBUG_DELAY_START(); 175 MATRIX_DEBUG_DELAY_START();
176# ifdef MATRIX_MUL_SELECT 176# ifdef MATRIX_MUL_SELECT
177 writePin(MATRIX_MUL_SELECT, col_sel[col_index]); 177 gpio_write_pin(MATRIX_MUL_SELECT, col_sel[col_index]);
178 waitInputPinDelay(); 178 waitInputPinDelay();
179# endif 179# endif
180 while (readPin(col_pins[col_index]) == 0) { 180 while (gpio_read_pin(col_pins[col_index]) == 0) {
181 } 181 }
182 MATRIX_DEBUG_DELAY_END(); 182 MATRIX_DEBUG_DELAY_END();
183 } 183 }
@@ -193,10 +193,10 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
193 MATRIX_DEBUG_DELAY_END(); 193 MATRIX_DEBUG_DELAY_END();
194 MATRIX_DEBUG_DELAY_START(); 194 MATRIX_DEBUG_DELAY_START();
195# ifdef MATRIX_MUL_SELECT 195# ifdef MATRIX_MUL_SELECT
196 writePin(MATRIX_MUL_SELECT, col_sel[col_index]); 196 gpio_write_pin(MATRIX_MUL_SELECT, col_sel[col_index]);
197 waitInputPinDelay(); 197 waitInputPinDelay();
198# endif 198# endif
199 state |= (readPin(col_pins[col_index]) == 0); 199 state |= (gpio_read_pin(col_pins[col_index]) == 0);
200 } 200 }
201 MATRIX_DEBUG_DELAY_END(); 201 MATRIX_DEBUG_DELAY_END();
202 } while (state); 202 } while (state);
@@ -250,7 +250,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
250 matrix_row_t current_row_value = last_row_value; 250 matrix_row_t current_row_value = last_row_value;
251 251
252 // Check row pin state 252 // Check row pin state
253 if (readPin(row_pins[row_index]) == 0) { 253 if (gpio_read_pin(row_pins[row_index]) == 0) {
254 // Pin LO, set col bit 254 // Pin LO, set col bit
255 current_row_value |= (MATRIX_ROW_SHIFTER << current_col); 255 current_row_value |= (MATRIX_ROW_SHIFTER << current_col);
256 key_pressed = true; 256 key_pressed = true;
diff --git a/keyboards/handwired/symmetric70_proto/matrix_fast/matrix_extension_74hc15x.c b/keyboards/handwired/symmetric70_proto/matrix_fast/matrix_extension_74hc15x.c
index 202454a221..25ecc668e5 100644
--- a/keyboards/handwired/symmetric70_proto/matrix_fast/matrix_extension_74hc15x.c
+++ b/keyboards/handwired/symmetric70_proto/matrix_fast/matrix_extension_74hc15x.c
@@ -51,9 +51,9 @@ static const pin_t sel_pins[] = { MATRIX_EXT_74HC15x };
51LOCAL_FUNC ALWAYS_INLINE void select74HC15x(uint8_t devid); 51LOCAL_FUNC ALWAYS_INLINE void select74HC15x(uint8_t devid);
52LOCAL_FUNC 52LOCAL_FUNC
53void select74HC15x(uint8_t devid) { 53void select74HC15x(uint8_t devid) {
54 writePin(sel_pins[0], devid&1); 54 gpio_write_pin(sel_pins[0], devid&1);
55#if defined(MATRIX_EXTENSION_74HC153) 55#if defined(MATRIX_EXTENSION_74HC153)
56 writePin(sel_pins[1], devid&2); 56 gpio_write_pin(sel_pins[1], devid&2);
57#endif 57#endif
58} 58}
59 59
@@ -67,7 +67,7 @@ LOCAL_FUNC port_width_t readPortMultiplexer(uint8_t devid, pin_t port) {
67#define readMatrixPort(dev, port) \ 67#define readMatrixPort(dev, port) \
68 ((dev) == MCU_GPIO)? readPort(port): (IS_74HC15x(dev))? readPortMultiplexer((dev)-MCU_GPIOa, port):0 68 ((dev) == MCU_GPIO)? readPort(port): (IS_74HC15x(dev))? readPortMultiplexer((dev)-MCU_GPIOa, port):0
69 69
70#define INIT_74HC15X(x) setPinOutput(x); writePinLow(x); 70#define INIT_74HC15X(x) gpio_set_pin_output(x); gpio_write_pin_low(x);
71LOCAL_FUNC 71LOCAL_FUNC
72void init_74hc15x(void) { 72void init_74hc15x(void) {
73 MAP(INIT_74HC15X, MATRIX_EXT_74HC15x) 73 MAP(INIT_74HC15X, MATRIX_EXT_74HC15x)
diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c
index 24263fa832..dbacb1685c 100644
--- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c
+++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c
@@ -16,10 +16,10 @@
16 16
17#include "tractyl_manuform.h" 17#include "tractyl_manuform.h"
18 18
19void keyboard_pre_init_sub(void) { setPinInputHigh(A0); } 19void keyboard_pre_init_sub(void) { gpio_set_pin_input_high(A0); }
20 20
21void matrix_scan_sub_kb(void) { 21void matrix_scan_sub_kb(void) {
22 if (!readPin(A0)) { 22 if (!gpio_read_pin(A0)) {
23 reset_keyboard(); 23 reset_keyboard();
24 } 24 }
25} 25}
@@ -44,7 +44,7 @@ __attribute__((weak)) void bootmagic_scan(void) {
44 } 44 }
45#endif 45#endif
46 46
47 if (matrix_get_row(row) & (1 << col) || !readPin(A0)) { 47 if (matrix_get_row(row) & (1 << col) || !gpio_read_pin(A0)) {
48 eeconfig_disable(); 48 eeconfig_disable();
49 bootloader_jump(); 49 bootloader_jump();
50 } 50 }
@@ -53,9 +53,9 @@ __attribute__((weak)) void bootmagic_scan(void) {
53 53
54#ifdef USB_VBUS_PIN 54#ifdef USB_VBUS_PIN
55bool usb_vbus_state(void) { 55bool usb_vbus_state(void) {
56 setPinInputLow(USB_VBUS_PIN); 56 gpio_set_pin_input_low(USB_VBUS_PIN);
57 wait_us(5); 57 wait_us(5);
58 return readPin(USB_VBUS_PIN); 58 return gpio_read_pin(USB_VBUS_PIN);
59} 59}
60#endif 60#endif
61 61
diff --git a/keyboards/handwired/traveller/traveller.c b/keyboards/handwired/traveller/traveller.c
index 91c6f603b1..f18a64ca86 100644
--- a/keyboards/handwired/traveller/traveller.c
+++ b/keyboards/handwired/traveller/traveller.c
@@ -11,8 +11,8 @@ void matrix_init_kb(void) {
11#endif 11#endif
12 12
13 // Turn status LED on 13 // Turn status LED on
14 setPinOutput(C7); 14 gpio_set_pin_output(C7);
15 writePinHigh(C7); 15 gpio_write_pin_high(C7);
16 16
17 matrix_init_user(); 17 matrix_init_user();
18} 18}
diff --git a/keyboards/handwired/woodpad/woodpad.c b/keyboards/handwired/woodpad/woodpad.c
index 71bc0ba71e..92b3131e7b 100644
--- a/keyboards/handwired/woodpad/woodpad.c
+++ b/keyboards/handwired/woodpad/woodpad.c
@@ -17,14 +17,14 @@
17#include "woodpad.h" 17#include "woodpad.h"
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 setPinOutput(F7); 20 gpio_set_pin_output(F7);
21 keyboard_pre_init_user(); 21 keyboard_pre_init_user();
22} 22}
23 23
24inline void numlock_led_on(void) { 24inline void numlock_led_on(void) {
25 writePinHigh(F7); 25 gpio_write_pin_high(F7);
26} 26}
27 27
28inline void numlock_led_off(void) { 28inline void numlock_led_off(void) {
29 writePinLow(F7); 29 gpio_write_pin_low(F7);
30} 30}
diff --git a/keyboards/handwired/z150/z150.c b/keyboards/handwired/z150/z150.c
index a887a95bfd..ab6709eed7 100644
--- a/keyboards/handwired/z150/z150.c
+++ b/keyboards/handwired/z150/z150.c
@@ -17,13 +17,13 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 setPinOutput(NUM_LOCK_LED_PIN); 20 gpio_set_pin_output(NUM_LOCK_LED_PIN);
21 setPinOutput(CAPS_LOCK_LED_PIN); 21 gpio_set_pin_output(CAPS_LOCK_LED_PIN);
22 setPinOutput(SCROLL_LOCK_LED_PIN); 22 gpio_set_pin_output(SCROLL_LOCK_LED_PIN);
23 23
24 writePinLow(NUM_LOCK_LED_PIN); 24 gpio_write_pin_low(NUM_LOCK_LED_PIN);
25 writePinLow(CAPS_LOCK_LED_PIN); 25 gpio_write_pin_low(CAPS_LOCK_LED_PIN);
26 writePinLow(SCROLL_LOCK_LED_PIN); 26 gpio_write_pin_low(SCROLL_LOCK_LED_PIN);
27 27
28 matrix_init_user(); 28 matrix_init_user();
29} 29}
@@ -31,9 +31,9 @@ void matrix_init_kb(void) {
31bool led_update_kb(led_t led_state) { 31bool led_update_kb(led_t led_state) {
32 bool res = led_update_user(led_state); 32 bool res = led_update_user(led_state);
33 if(res) { 33 if(res) {
34 writePin(NUM_LOCK_LED_PIN, !led_state.num_lock); 34 gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock);
35 writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock); 35 gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock);
36 writePin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock); 36 gpio_write_pin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock);
37 } 37 }
38 return res; 38 return res;
39} 39}
diff --git a/keyboards/hardwareabstraction/handwire/handwire.c b/keyboards/hardwareabstraction/handwire/handwire.c
index 4981e703e4..d5ebd6ac13 100644
--- a/keyboards/hardwareabstraction/handwire/handwire.c
+++ b/keyboards/hardwareabstraction/handwire/handwire.c
@@ -28,7 +28,7 @@ enum custom_keycodes{
28 28
29// Documentation: custom_quantum_functions.md 29// Documentation: custom_quantum_functions.md
30void keyboard_post_init_kb(void){ 30void keyboard_post_init_kb(void){
31 setPinOutput(BUZZER_PIN); 31 gpio_set_pin_output(BUZZER_PIN);
32 keyboard_post_init_user(); 32 keyboard_post_init_user();
33} 33}
34 34
@@ -36,7 +36,7 @@ void housekeeping_task_kb(void){
36 if(buzzer_on){ 36 if(buzzer_on){
37 if(buzzer_active && timer_elapsed(buzzer_timer) > buzzer_dwell){ 37 if(buzzer_active && timer_elapsed(buzzer_timer) > buzzer_dwell){
38 buzzer_active = false; 38 buzzer_active = false;
39 writePinLow(BUZZER_PIN); 39 gpio_write_pin_low(BUZZER_PIN);
40 } 40 }
41 } 41 }
42 housekeeping_task_user(); 42 housekeeping_task_user();
@@ -50,7 +50,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
50 if(!buzzer_active){ 50 if(!buzzer_active){
51 buzzer_active = true; 51 buzzer_active = true;
52 buzzer_timer = timer_read(); 52 buzzer_timer = timer_read();
53 writePinHigh(BUZZER_PIN); 53 gpio_write_pin_high(BUZZER_PIN);
54 } 54 }
55 } 55 }
56 56
@@ -94,10 +94,10 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
94 if(buzzer_on == true){ 94 if(buzzer_on == true){
95 buzzer_active = true; 95 buzzer_active = true;
96 buzzer_timer = timer_read(); 96 buzzer_timer = timer_read();
97 writePinHigh(BUZZER_PIN); 97 gpio_write_pin_high(BUZZER_PIN);
98 } 98 }
99 else{ 99 else{
100 writePinLow(BUZZER_PIN); 100 gpio_write_pin_low(BUZZER_PIN);
101 } 101 }
102 break; 102 break;
103 103
diff --git a/keyboards/hazel/bad_wings/matrix.c b/keyboards/hazel/bad_wings/matrix.c
index 8a56a927c1..4a05e132f7 100644
--- a/keyboards/hazel/bad_wings/matrix.c
+++ b/keyboards/hazel/bad_wings/matrix.c
@@ -48,11 +48,11 @@ bool sr_74hc595_spi_start(void) {
48 48
49bool sr_74hc595_spi_send_byte(uint8_t data) { 49bool sr_74hc595_spi_send_byte(uint8_t data) {
50 sr_74hc595_spi_start(); 50 sr_74hc595_spi_start();
51 writePinLow(SHIFTREG_MATRIX_COL_CS); 51 gpio_write_pin_low(SHIFTREG_MATRIX_COL_CS);
52 matrix_io_delay(); 52 matrix_io_delay();
53 spi_write(data); 53 spi_write(data);
54 matrix_io_delay(); 54 matrix_io_delay();
55 writePinHigh(SHIFTREG_MATRIX_COL_CS); 55 gpio_write_pin_high(SHIFTREG_MATRIX_COL_CS);
56 sr_74hc595_spi_stop(); 56 sr_74hc595_spi_stop();
57 return true; 57 return true;
58} 58}
@@ -82,12 +82,12 @@ void matrix_init_custom(void) {
82 // Set up the initial states for all the row pins 82 // Set up the initial states for all the row pins
83 for (int r = 0; r < SHIFTREG_ROWS; r++) { 83 for (int r = 0; r < SHIFTREG_ROWS; r++) {
84 // Note: This needs to use the internal pull down resistors, and atmegas do *not* support that 84 // Note: This needs to use the internal pull down resistors, and atmegas do *not* support that
85 setPinInputLow(rowPinsSR[r]); 85 gpio_set_pin_input_low(rowPinsSR[r]);
86 } 86 }
87 87
88 // Set the CS to low by default, and specify as an output pin 88 // Set the CS to low by default, and specify as an output pin
89 writePinHigh(SHIFTREG_MATRIX_COL_CS); // should be high when using SPI? 89 gpio_write_pin_high(SHIFTREG_MATRIX_COL_CS); // should be high when using SPI?
90 setPinOutput(SHIFTREG_MATRIX_COL_CS); 90 gpio_set_pin_output(SHIFTREG_MATRIX_COL_CS);
91 91
92 // Since it's the init, deactivate all the columns. We'll activate once we get to the matrix scan 92 // Since it's the init, deactivate all the columns. We'll activate once we get to the matrix scan
93 clearColumns(); 93 clearColumns();
@@ -116,7 +116,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
116 matrix_io_delay(); 116 matrix_io_delay();
117 117
118 for (int r = 0; r < SHIFTREG_ROWS; r++) { 118 for (int r = 0; r < SHIFTREG_ROWS; r++) {
119 current_matrix[r] |= ((readPin(rowPinsSR[r]) ? 1 : 0) << c); 119 current_matrix[r] |= ((gpio_read_pin(rowPinsSR[r]) ? 1 : 0) << c);
120 } 120 }
121 } 121 }
122 122
diff --git a/keyboards/heliar/wm1_hotswap/wm1_hotswap.c b/keyboards/heliar/wm1_hotswap/wm1_hotswap.c
index 846729a3f0..d2d10b0b1f 100644
--- a/keyboards/heliar/wm1_hotswap/wm1_hotswap.c
+++ b/keyboards/heliar/wm1_hotswap/wm1_hotswap.c
@@ -19,20 +19,20 @@
19 19
20void keyboard_pre_init_kb(void) 20void keyboard_pre_init_kb(void)
21{ 21{
22 setPinOutput(D7); 22 gpio_set_pin_output(D7);
23 writePinHigh(D7); 23 gpio_write_pin_high(D7);
24 setPinOutput(D6); 24 gpio_set_pin_output(D6);
25 writePinHigh(D6); 25 gpio_write_pin_high(D6);
26 setPinOutput(D4); 26 gpio_set_pin_output(D4);
27 writePinHigh(D4); 27 gpio_write_pin_high(D4);
28} 28}
29 29
30bool led_update_kb(led_t led_state) { 30bool led_update_kb(led_t led_state) {
31 31
32 if (led_update_user(led_state)){ 32 if (led_update_user(led_state)){
33 writePin(D7, !led_state.num_lock); 33 gpio_write_pin(D7, !led_state.num_lock);
34 writePin(D6, !led_state.caps_lock); 34 gpio_write_pin(D6, !led_state.caps_lock);
35 writePin(D4, !led_state.scroll_lock); 35 gpio_write_pin(D4, !led_state.scroll_lock);
36 } 36 }
37 37
38 return true; 38 return true;
diff --git a/keyboards/hhkb/yang/matrix.c b/keyboards/hhkb/yang/matrix.c
index c82c77bed3..d82aaf5a0c 100644
--- a/keyboards/hhkb/yang/matrix.c
+++ b/keyboards/hhkb/yang/matrix.c
@@ -34,12 +34,12 @@ uint8_t power_save_level;
34 34
35static uint32_t matrix_last_modified = 0; 35static uint32_t matrix_last_modified = 0;
36 36
37static inline void key_strobe_high(void) { writePinLow(B6); } 37static inline void key_strobe_high(void) { gpio_write_pin_low(B6); }
38static inline void key_strobe_low(void) { writePinHigh(B6); } 38static inline void key_strobe_low(void) { gpio_write_pin_high(B6); }
39static inline bool key_state(void) { return readPin(D7); } 39static inline bool key_state(void) { return gpio_read_pin(D7); }
40static inline void key_prev_on(void) { writePinHigh(B7); } 40static inline void key_prev_on(void) { gpio_write_pin_high(B7); }
41static inline void key_prev_off(void) { writePinLow(B7); } 41static inline void key_prev_off(void) { gpio_write_pin_low(B7); }
42static inline bool key_power_state(void) { return !readPin(D6); } 42static inline bool key_power_state(void) { return !gpio_read_pin(D6); }
43 43
44static inline void suspend_power_down_longer(void) { 44static inline void suspend_power_down_longer(void) {
45 uint8_t times = 60; 45 uint8_t times = 60;
@@ -52,8 +52,8 @@ void matrix_power_up(void) {
52 DDRB = 0xFF; 52 DDRB = 0xFF;
53 PORTB = 0x40; 53 PORTB = 0x40;
54 // switch MOS FET on 54 // switch MOS FET on
55 setPinOutput(D6); 55 gpio_set_pin_output(D6);
56 writePinLow(D6); 56 gpio_write_pin_low(D6);
57} 57}
58 58
59void matrix_power_down(void) { 59void matrix_power_down(void) {
@@ -62,8 +62,8 @@ void matrix_power_down(void) {
62 DDRB = 0x00; 62 DDRB = 0x00;
63 PORTB = 0xFF; 63 PORTB = 0xFF;
64 // switch MOS FET off 64 // switch MOS FET off
65 setPinOutput(D6); 65 gpio_set_pin_output(D6);
66 writePinHigh(D6); 66 gpio_write_pin_high(D6);
67} 67}
68 68
69static inline void key_select_row(uint8_t row) { PORTB = (PORTB & 0b11111000) | ((row)&0b111); } 69static inline void key_select_row(uint8_t row) { PORTB = (PORTB & 0b11111000) | ((row)&0b111); }
diff --git a/keyboards/hhkb/yang/yang.c b/keyboards/hhkb/yang/yang.c
index 548f0dd734..3aba711b1f 100644
--- a/keyboards/hhkb/yang/yang.c
+++ b/keyboards/hhkb/yang/yang.c
@@ -21,13 +21,13 @@ extern uint8_t power_save_level;
21void hhkb_led_on(uint8_t led) { 21void hhkb_led_on(uint8_t led) {
22 switch (led) { 22 switch (led) {
23 case 1: 23 case 1:
24 writePinHigh(F4); 24 gpio_write_pin_high(F4);
25 break; 25 break;
26 case 2: 26 case 2:
27 writePinHigh(F2); 27 gpio_write_pin_high(F2);
28 break; 28 break;
29 case 3: 29 case 3:
30 writePinHigh(F0); 30 gpio_write_pin_high(F0);
31 break; 31 break;
32 } 32 }
33} 33}
@@ -35,55 +35,55 @@ void hhkb_led_on(uint8_t led) {
35void hhkb_led_off(uint8_t led) { 35void hhkb_led_off(uint8_t led) {
36 switch (led) { 36 switch (led) {
37 case 1: 37 case 1:
38 writePinLow(F4); 38 gpio_write_pin_low(F4);
39 break; 39 break;
40 case 2: 40 case 2:
41 writePinLow(F2); 41 gpio_write_pin_low(F2);
42 break; 42 break;
43 case 3: 43 case 3:
44 writePinLow(F0); 44 gpio_write_pin_low(F0);
45 break; 45 break;
46 } 46 }
47} 47}
48 48
49void keyboard_pre_init_kb(void) { 49void keyboard_pre_init_kb(void) {
50 // BT power up 50 // BT power up
51 setPinOutput(D5); 51 gpio_set_pin_output(D5);
52 writePinLow(D5); 52 gpio_write_pin_low(D5);
53 53
54 // Row selectors 54 // Row selectors
55 setPinOutput(B0); 55 gpio_set_pin_output(B0);
56 setPinOutput(B1); 56 gpio_set_pin_output(B1);
57 setPinOutput(B2); 57 gpio_set_pin_output(B2);
58 58
59 // Col selectors 59 // Col selectors
60 setPinOutput(B3); 60 gpio_set_pin_output(B3);
61 setPinOutput(B4); 61 gpio_set_pin_output(B4);
62 setPinOutput(B5); 62 gpio_set_pin_output(B5);
63 63
64 // Key strobe 64 // Key strobe
65 setPinOutput(B6); 65 gpio_set_pin_output(B6);
66 writePinHigh(B6); 66 gpio_write_pin_high(B6);
67 67
68 // Key: input with pull-up 68 // Key: input with pull-up
69 setPinInputHigh(D7); 69 gpio_set_pin_input_high(D7);
70 70
71 // Unused pins on Pro2 ANSI 71 // Unused pins on Pro2 ANSI
72 // Input with pull up to save power 72 // Input with pull up to save power
73 setPinInputHigh(C6); 73 gpio_set_pin_input_high(C6);
74 setPinInputHigh(C7); 74 gpio_set_pin_input_high(C7);
75 75
76 // LED pin configuration 76 // LED pin configuration
77 setPinOutput(F0); 77 gpio_set_pin_output(F0);
78 setPinOutput(F1); 78 gpio_set_pin_output(F1);
79 setPinOutput(F4); 79 gpio_set_pin_output(F4);
80 writePinLow(F0); 80 gpio_write_pin_low(F0);
81 writePinLow(F1); 81 gpio_write_pin_low(F1);
82 writePinLow(F4); 82 gpio_write_pin_low(F4);
83 83
84 // Turn on switch PCB 84 // Turn on switch PCB
85 setPinOutput(D6); 85 gpio_set_pin_output(D6);
86 writePinLow(D6); 86 gpio_write_pin_low(D6);
87 87
88 keyboard_pre_init_user(); 88 keyboard_pre_init_user();
89} 89}
@@ -93,7 +93,7 @@ void suspend_power_down_kb(void) {
93 // Disable UART TX to avoid current leakage 93 // Disable UART TX to avoid current leakage
94 UCSR1B &= ~_BV(TXEN1); 94 UCSR1B &= ~_BV(TXEN1);
95 // Power down BLE module 95 // Power down BLE module
96 writePinHigh(D5); 96 gpio_write_pin_high(D5);
97 } 97 }
98 98
99 suspend_power_down_user(); 99 suspend_power_down_user();
@@ -101,7 +101,7 @@ void suspend_power_down_kb(void) {
101 101
102void suspend_wakeup_init_kb(void) { 102void suspend_wakeup_init_kb(void) {
103 // Power up BLE module 103 // Power up BLE module
104 writePinLow(D5); 104 gpio_write_pin_low(D5);
105 // Enable UART TX 105 // Enable UART TX
106 UCSR1B |= _BV(TXEN1); 106 UCSR1B |= _BV(TXEN1);
107 107
@@ -111,8 +111,8 @@ void suspend_wakeup_init_kb(void) {
111layer_state_t layer_state_set_kb(layer_state_t state) { 111layer_state_t layer_state_set_kb(layer_state_t state) {
112 state = layer_state_set_user(state); 112 state = layer_state_set_user(state);
113 113
114 writePin(F1, IS_LAYER_ON_STATE(state, 1)); 114 gpio_write_pin(F1, IS_LAYER_ON_STATE(state, 1));
115 writePin(F0, IS_LAYER_ON_STATE(state, 2)); 115 gpio_write_pin(F0, IS_LAYER_ON_STATE(state, 2));
116 116
117 return state; 117 return state;
118} 118}
diff --git a/keyboards/hineybush/h10/h10.c b/keyboards/hineybush/h10/h10.c
index 81f5bdfbf2..2170a8b2d7 100644
--- a/keyboards/hineybush/h10/h10.c
+++ b/keyboards/hineybush/h10/h10.c
@@ -23,12 +23,12 @@
23void matrix_init_kb(void) { 23void matrix_init_kb(void) {
24 // put your keyboard start-up code here 24 // put your keyboard start-up code here
25 // runs once when the firmware starts up 25 // runs once when the firmware starts up
26 setPinOutput(F7); 26 gpio_set_pin_output(F7);
27} 27}
28 28
29bool led_update_kb(led_t led_state) { 29bool led_update_kb(led_t led_state) {
30 if(led_update_user(led_state)) { 30 if(led_update_user(led_state)) {
31 writePin(F7, !led_state.num_lock); 31 gpio_write_pin(F7, !led_state.num_lock);
32 } 32 }
33 return true; 33 return true;
34} 34}
diff --git a/keyboards/hineybush/h60/h60.c b/keyboards/hineybush/h60/h60.c
index 4373157996..472b99d8ba 100644
--- a/keyboards/hineybush/h60/h60.c
+++ b/keyboards/hineybush/h60/h60.c
@@ -19,12 +19,12 @@
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 // put your keyboard start-up code here 20 // put your keyboard start-up code here
21 // runs once when the firmware starts up 21 // runs once when the firmware starts up
22 setPinOutput(C6); 22 gpio_set_pin_output(C6);
23} 23}
24 24
25bool led_update_kb(led_t led_state) { 25bool led_update_kb(led_t led_state) {
26 if(led_update_user(led_state)) { 26 if(led_update_user(led_state)) {
27 writePin(C6, !led_state.caps_lock); 27 gpio_write_pin(C6, !led_state.caps_lock);
28 } 28 }
29 return true; 29 return true;
30} 30}
diff --git a/keyboards/hineybush/h87a/h87a.c b/keyboards/hineybush/h87a/h87a.c
index bf4213a200..f2d0c62813 100644
--- a/keyboards/hineybush/h87a/h87a.c
+++ b/keyboards/hineybush/h87a/h87a.c
@@ -18,15 +18,15 @@
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 // put your keyboard start-up code here 19 // put your keyboard start-up code here
20 // runs once when the firmware starts up 20 // runs once when the firmware starts up
21 setPinOutput(D5); 21 gpio_set_pin_output(D5);
22 setPinOutput(E6); 22 gpio_set_pin_output(E6);
23 matrix_init_user(); 23 matrix_init_user();
24} 24}
25 25
26bool led_update_kb(led_t led_state) { 26bool led_update_kb(led_t led_state) {
27 if(led_update_user(led_state)) { 27 if(led_update_user(led_state)) {
28 writePin(D5, !led_state.caps_lock); 28 gpio_write_pin(D5, !led_state.caps_lock);
29 writePin(E6, !led_state.scroll_lock); 29 gpio_write_pin(E6, !led_state.scroll_lock);
30 } 30 }
31 return true; 31 return true;
32} 32}
diff --git a/keyboards/hineybush/h88/h88.c b/keyboards/hineybush/h88/h88.c
index 9abeccd1d5..a916609d75 100644
--- a/keyboards/hineybush/h88/h88.c
+++ b/keyboards/hineybush/h88/h88.c
@@ -18,15 +18,15 @@
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 // put your keyboard start-up code here 19 // put your keyboard start-up code here
20 // runs once when the firmware starts up 20 // runs once when the firmware starts up
21 setPinOutput(D5); 21 gpio_set_pin_output(D5);
22 setPinOutput(E6); 22 gpio_set_pin_output(E6);
23 matrix_init_user(); 23 matrix_init_user();
24} 24}
25 25
26bool led_update_kb(led_t led_state) { 26bool led_update_kb(led_t led_state) {
27 if(led_update_user(led_state)) { 27 if(led_update_user(led_state)) {
28 writePin(D5, !led_state.caps_lock); 28 gpio_write_pin(D5, !led_state.caps_lock);
29 writePin(E6, !led_state.scroll_lock); 29 gpio_write_pin(E6, !led_state.scroll_lock);
30 } 30 }
31 return true; 31 return true;
32} 32}
diff --git a/keyboards/hineybush/hbcp/matrix.c b/keyboards/hineybush/hbcp/matrix.c
index 69ae6ab7b7..c4cfc9edb3 100644
--- a/keyboards/hineybush/hbcp/matrix.c
+++ b/keyboards/hineybush/hbcp/matrix.c
@@ -27,11 +27,11 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan
27// matrix code 27// matrix code
28 28
29 void select_row(uint8_t row) { 29 void select_row(uint8_t row) {
30 setPinOutput(row_pins[row]); 30 gpio_set_pin_output(row_pins[row]);
31 writePinLow(row_pins[row]); 31 gpio_write_pin_low(row_pins[row]);
32} 32}
33 33
34 void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } 34 void unselect_row(uint8_t row) { gpio_set_pin_input_high(row_pins[row]); }
35 35
36 bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { 36 bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
37 // Store last value of row prior to reading 37 // Store last value of row prior to reading
@@ -47,7 +47,7 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan
47 // For each col... 47 // For each col...
48 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 48 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
49 // Select the col pin to read (active low) 49 // Select the col pin to read (active low)
50 uint8_t pin_state = readPin(col_pins[col_index]); 50 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
51 51
52 // Populate the matrix row with the state of the col pin 52 // Populate the matrix row with the state of the col pin
53 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 53 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -60,11 +60,11 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan
60} 60}
61 61
62 void select_col(uint8_t col) { 62 void select_col(uint8_t col) {
63 setPinOutput(col_pins[col]); 63 gpio_set_pin_output(col_pins[col]);
64 writePinLow(col_pins[col]); 64 gpio_write_pin_low(col_pins[col]);
65} 65}
66 66
67 void unselect_col(uint8_t col) { setPinInputHigh(col_pins[col]); } 67 void unselect_col(uint8_t col) { gpio_set_pin_input_high(col_pins[col]); }
68 68
69 bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 69 bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
70 bool matrix_changed = false; 70 bool matrix_changed = false;
@@ -79,7 +79,7 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan
79 matrix_row_t last_row_value = current_matrix[row_index]; 79 matrix_row_t last_row_value = current_matrix[row_index];
80 80
81 // Check row pin state 81 // Check row pin state
82 if (readPin(row_pins[row_index]) == 0) { 82 if (gpio_read_pin(row_pins[row_index]) == 0) {
83 // Pin LO, set col bit 83 // Pin LO, set col bit
84 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); 84 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
85 } 85 }
@@ -98,13 +98,13 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan
98 98
99 void unselect_rows(void) { 99 void unselect_rows(void) {
100 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 100 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
101 setPinInputHigh(row_pins[x]); 101 gpio_set_pin_input_high(row_pins[x]);
102 } 102 }
103} 103}
104 104
105 void unselect_cols(void) { 105 void unselect_cols(void) {
106 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 106 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
107 setPinInputHigh(col_pins[x]); 107 gpio_set_pin_input_high(col_pins[x]);
108 } 108 }
109} 109}
110 110
diff --git a/keyboards/hineybush/physix/physix.c b/keyboards/hineybush/physix/physix.c
index c118b30d2e..cd920a72b3 100644
--- a/keyboards/hineybush/physix/physix.c
+++ b/keyboards/hineybush/physix/physix.c
@@ -24,8 +24,8 @@
24void matrix_init_kb(void) { 24void matrix_init_kb(void) {
25 // put your keyboard start-up code here 25 // put your keyboard start-up code here
26 // runs once when the firmware starts up 26 // runs once when the firmware starts up
27 setPinOutput(D3); 27 gpio_set_pin_output(D3);
28 setPinOutput(D5); 28 gpio_set_pin_output(D5);
29 matrix_init_user(); 29 matrix_init_user();
30} 30}
31 31
@@ -33,13 +33,13 @@ bool led_update_kb(led_t led_state) {
33 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here 33 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
34 bool res = led_update_user(led_state); 34 bool res = led_update_user(led_state);
35 if(res) { 35 if(res) {
36 // writePin sets the pin high for 1 and low for 0. 36 // gpio_write_pin sets the pin high for 1 and low for 0.
37 // In this example the pins are inverted, setting 37 // In this example the pins are inverted, setting
38 // it low/0 turns it on, and high/1 turns the LED off. 38 // it low/0 turns it on, and high/1 turns the LED off.
39 // This behavior depends on whether the LED is between the pin 39 // This behavior depends on whether the LED is between the pin
40 // and VCC or the pin and GND. 40 // and VCC or the pin and GND.
41 writePin(D3, led_state.caps_lock); 41 gpio_write_pin(D3, led_state.caps_lock);
42 writePin(D5, led_state.scroll_lock); 42 gpio_write_pin(D5, led_state.scroll_lock);
43 } 43 }
44 return res; 44 return res;
45 return led_update_user(led_state); 45 return led_update_user(led_state);
diff --git a/keyboards/ibm/model_m/ashpil_usbc/ashpil_usbc.c b/keyboards/ibm/model_m/ashpil_usbc/ashpil_usbc.c
index 92b577635c..8bdcfe070a 100644
--- a/keyboards/ibm/model_m/ashpil_usbc/ashpil_usbc.c
+++ b/keyboards/ibm/model_m/ashpil_usbc/ashpil_usbc.c
@@ -18,19 +18,19 @@
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 /* Setting status LEDs pins to output and +5V (off) */ 20 /* Setting status LEDs pins to output and +5V (off) */
21 setPinOutput(D5); 21 gpio_set_pin_output(D5);
22 setPinOutput(D6); 22 gpio_set_pin_output(D6);
23 setPinOutput(D7); 23 gpio_set_pin_output(D7);
24 writePinHigh(D5); 24 gpio_write_pin_high(D5);
25 writePinHigh(D6); 25 gpio_write_pin_high(D6);
26 writePinHigh(D7); 26 gpio_write_pin_high(D7);
27} 27}
28 28
29bool led_update_kb(led_t led_state) { 29bool led_update_kb(led_t led_state) {
30 if(led_update_user(led_state)) { 30 if(led_update_user(led_state)) {
31 writePin(D5, !led_state.num_lock); 31 gpio_write_pin(D5, !led_state.num_lock);
32 writePin(D6, !led_state.caps_lock); 32 gpio_write_pin(D6, !led_state.caps_lock);
33 writePin(D7, !led_state.scroll_lock); 33 gpio_write_pin(D7, !led_state.scroll_lock);
34 } 34 }
35 return true; 35 return true;
36} 36}
diff --git a/keyboards/ibm/model_m/modelh/modelh.c b/keyboards/ibm/model_m/modelh/modelh.c
index 5384b37338..4bf3d12e6a 100644
--- a/keyboards/ibm/model_m/modelh/modelh.c
+++ b/keyboards/ibm/model_m/modelh/modelh.c
@@ -18,8 +18,8 @@
18 18
19 19
20void keyboard_pre_init_kb(void) { 20void keyboard_pre_init_kb(void) {
21 setPinOutput(MODELH_STATUS_LED); 21 gpio_set_pin_output(MODELH_STATUS_LED);
22 writePin(MODELH_STATUS_LED, 0); 22 gpio_write_pin(MODELH_STATUS_LED, 0);
23 23
24 keyboard_pre_init_user(); 24 keyboard_pre_init_user();
25} 25}
diff --git a/keyboards/ibm/model_m/mschwingen/matrix.c b/keyboards/ibm/model_m/mschwingen/matrix.c
index 85df5e5d6f..ae032a00a0 100644
--- a/keyboards/ibm/model_m/mschwingen/matrix.c
+++ b/keyboards/ibm/model_m/mschwingen/matrix.c
@@ -31,15 +31,15 @@ static uint16_t row_bits[MATRIX_ROWS] = {
31static const pin_t col_pins[MATRIX_COLS] = {D1, D4, D7, B4, F7, F6, F5, F4}; 31static const pin_t col_pins[MATRIX_COLS] = {D1, D4, D7, B4, F7, F6, F5, F4};
32 32
33static void select_col(uint8_t col) { 33static void select_col(uint8_t col) {
34 setPinOutput(col_pins[col]); 34 gpio_set_pin_output(col_pins[col]);
35 writePinLow(col_pins[col]); 35 gpio_write_pin_low(col_pins[col]);
36} 36}
37 37
38static void unselect_col(uint8_t col) { setPinInputHigh(col_pins[col]); } 38static void unselect_col(uint8_t col) { gpio_set_pin_input_high(col_pins[col]); }
39 39
40static void unselect_cols(void) { 40static void unselect_cols(void) {
41 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 41 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
42 setPinInputHigh(col_pins[x]); 42 gpio_set_pin_input_high(col_pins[x]);
43 } 43 }
44} 44}
45 45
@@ -51,8 +51,8 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
51 select_col(current_col); 51 select_col(current_col);
52 matrix_io_delay(); 52 matrix_io_delay();
53 53
54 writePinLow(SR_LOAD_PIN); 54 gpio_write_pin_low(SR_LOAD_PIN);
55 writePinHigh(SR_LOAD_PIN); 55 gpio_write_pin_high(SR_LOAD_PIN);
56 56
57 row_data = spi_read() << 8; 57 row_data = spi_read() << 8;
58 row_data |= spi_read(); 58 row_data |= spi_read();
diff --git a/keyboards/ibm/model_m/mschwingen/mschwingen.c b/keyboards/ibm/model_m/mschwingen/mschwingen.c
index 6a8a0ec8fc..7112ab63a5 100644
--- a/keyboards/ibm/model_m/mschwingen/mschwingen.c
+++ b/keyboards/ibm/model_m/mschwingen/mschwingen.c
@@ -74,12 +74,12 @@ void sleep_led_toggle(void) {}
74 74
75void sleep_led_disable(void) { 75void sleep_led_disable(void) {
76 suspend_active = false; 76 suspend_active = false;
77 writePinHigh(MODELM_STATUS_LED); 77 gpio_write_pin_high(MODELM_STATUS_LED);
78} 78}
79 79
80void sleep_led_enable(void) { 80void sleep_led_enable(void) {
81 suspend_active = true; 81 suspend_active = true;
82 writePinLow(MODELM_STATUS_LED); 82 gpio_write_pin_low(MODELM_STATUS_LED);
83#ifdef KEYBOARD_ibm_model_m_mschwingen_led_ws2812 83#ifdef KEYBOARD_ibm_model_m_mschwingen_led_ws2812
84 led[0] = black; 84 led[0] = black;
85 led[1] = black; 85 led[1] = black;
@@ -94,15 +94,15 @@ void keyboard_pre_init_kb(void) {
94 ws2812_setleds(led, RGBLIGHT_LED_COUNT); 94 ws2812_setleds(led, RGBLIGHT_LED_COUNT);
95#else 95#else
96 /* Set status LEDs pins to output and Low (on) */ 96 /* Set status LEDs pins to output and Low (on) */
97 setPinOutput(MODELM_LED_CAPSLOCK); 97 gpio_set_pin_output(MODELM_LED_CAPSLOCK);
98 setPinOutput(MODELM_LED_SCROLLOCK); 98 gpio_set_pin_output(MODELM_LED_SCROLLOCK);
99 setPinOutput(MODELM_LED_NUMLOCK); 99 gpio_set_pin_output(MODELM_LED_NUMLOCK);
100 writePinLow(MODELM_LED_CAPSLOCK); 100 gpio_write_pin_low(MODELM_LED_CAPSLOCK);
101 writePinLow(MODELM_LED_SCROLLOCK); 101 gpio_write_pin_low(MODELM_LED_SCROLLOCK);
102 writePinLow(MODELM_LED_NUMLOCK); 102 gpio_write_pin_low(MODELM_LED_NUMLOCK);
103#endif 103#endif
104 setPinOutput(MODELM_STATUS_LED); 104 gpio_set_pin_output(MODELM_STATUS_LED);
105 writePinHigh(MODELM_STATUS_LED); 105 gpio_write_pin_high(MODELM_STATUS_LED);
106 _delay_ms(50); 106 _delay_ms(50);
107#ifdef UART_DEBUG 107#ifdef UART_DEBUG
108 uart_init(115200); 108 uart_init(115200);
@@ -110,10 +110,10 @@ void keyboard_pre_init_kb(void) {
110 uprintf("\r\nHello world!\r\n"); 110 uprintf("\r\nHello world!\r\n");
111#endif 111#endif
112 112
113 setPinOutput(SR_LOAD_PIN); 113 gpio_set_pin_output(SR_LOAD_PIN);
114 setPinOutput(SR_CLK_PIN); 114 gpio_set_pin_output(SR_CLK_PIN);
115 setPinOutput(SR_DOUT_PIN); // MOSI - unused 115 gpio_set_pin_output(SR_DOUT_PIN); // MOSI - unused
116 writePinLow(SR_CLK_PIN); 116 gpio_write_pin_low(SR_CLK_PIN);
117} 117}
118 118
119#ifdef KEYBOARD_ibm_model_m_mschwingen_led_ws2812 119#ifdef KEYBOARD_ibm_model_m_mschwingen_led_ws2812
@@ -187,9 +187,9 @@ bool led_update_kb(led_t led_state) {
187 dprintf("LED Update: %d %d %d", led_state.num_lock, led_state.caps_lock, led_state.scroll_lock); 187 dprintf("LED Update: %d %d %d", led_state.num_lock, led_state.caps_lock, led_state.scroll_lock);
188 188
189 if (led_update_user(led_state)) { 189 if (led_update_user(led_state)) {
190 if (!isRecording) writePin(MODELM_LED_NUMLOCK, !led_state.num_lock); 190 if (!isRecording) gpio_write_pin(MODELM_LED_NUMLOCK, !led_state.num_lock);
191 writePin(MODELM_LED_CAPSLOCK, !led_state.caps_lock); 191 gpio_write_pin(MODELM_LED_CAPSLOCK, !led_state.caps_lock);
192 writePin(MODELM_LED_SCROLLOCK, !led_state.scroll_lock); 192 gpio_write_pin(MODELM_LED_SCROLLOCK, !led_state.scroll_lock);
193 } 193 }
194 return true; 194 return true;
195} 195}
@@ -198,7 +198,7 @@ void update_layer_leds(void) {
198 if (isRecording && timer_elapsed(blink_cycle_timer) > 150) { 198 if (isRecording && timer_elapsed(blink_cycle_timer) > 150) {
199 blink_state = !blink_state; 199 blink_state = !blink_state;
200 blink_cycle_timer = timer_read(); 200 blink_cycle_timer = timer_read();
201 writePin(MODELM_LED_NUMLOCK, blink_state); 201 gpio_write_pin(MODELM_LED_NUMLOCK, blink_state);
202 } 202 }
203} 203}
204 204
diff --git a/keyboards/ibm/model_m/teensypp/teensypp.c b/keyboards/ibm/model_m/teensypp/teensypp.c
index fa8669dc81..aac85424bf 100644
--- a/keyboards/ibm/model_m/teensypp/teensypp.c
+++ b/keyboards/ibm/model_m/teensypp/teensypp.c
@@ -17,20 +17,20 @@
17 17
18void led_init_ports(void) { 18void led_init_ports(void) {
19 /* Setting status LEDs pins to output and +5V (off) */ 19 /* Setting status LEDs pins to output and +5V (off) */
20 setPinOutput(B4); 20 gpio_set_pin_output(B4);
21 setPinOutput(B5); 21 gpio_set_pin_output(B5);
22 setPinOutput(B6); 22 gpio_set_pin_output(B6);
23 writePinHigh(B4); 23 gpio_write_pin_high(B4);
24 writePinHigh(B5); 24 gpio_write_pin_high(B5);
25 writePinHigh(B6); 25 gpio_write_pin_high(B6);
26} 26}
27 27
28bool led_update_kb(led_t led_state) { 28bool led_update_kb(led_t led_state) {
29 bool res = led_update_user(led_state); 29 bool res = led_update_user(led_state);
30 if(res) { 30 if(res) {
31 writePin(B4, !led_state.num_lock); 31 gpio_write_pin(B4, !led_state.num_lock);
32 writePin(B6, !led_state.caps_lock); 32 gpio_write_pin(B6, !led_state.caps_lock);
33 writePin(B5, !led_state.scroll_lock); 33 gpio_write_pin(B5, !led_state.scroll_lock);
34 } 34 }
35 return res; 35 return res;
36} 36}
diff --git a/keyboards/ibm/model_m/yugo_m/yugo_m.c b/keyboards/ibm/model_m/yugo_m/yugo_m.c
index 542043d5dc..a725a3657b 100644
--- a/keyboards/ibm/model_m/yugo_m/yugo_m.c
+++ b/keyboards/ibm/model_m/yugo_m/yugo_m.c
@@ -17,9 +17,9 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // Set our LED pins as output 19 // Set our LED pins as output
20 setPinOutput(A2); 20 gpio_set_pin_output(A2);
21 setPinOutput(A1); 21 gpio_set_pin_output(A1);
22 setPinOutput(A0); 22 gpio_set_pin_output(A0);
23 23
24 keyboard_pre_init_user(); 24 keyboard_pre_init_user();
25} 25}
@@ -27,9 +27,9 @@ void keyboard_pre_init_kb(void) {
27bool led_update_kb(led_t led_state) { 27bool led_update_kb(led_t led_state) {
28 bool res = led_update_user(led_state); 28 bool res = led_update_user(led_state);
29 if(res) { 29 if(res) {
30 writePin(A2, !led_state.num_lock); 30 gpio_write_pin(A2, !led_state.num_lock);
31 writePin(A1, !led_state.caps_lock); 31 gpio_write_pin(A1, !led_state.caps_lock);
32 writePin(A0, !led_state.scroll_lock); 32 gpio_write_pin(A0, !led_state.scroll_lock);
33 } 33 }
34 return res; 34 return res;
35} 35}
diff --git a/keyboards/idb/idb_60/idb_60.c b/keyboards/idb/idb_60/idb_60.c
index 1ca4b8796f..77485a4273 100644
--- a/keyboards/idb/idb_60/idb_60.c
+++ b/keyboards/idb/idb_60/idb_60.c
@@ -1,24 +1,24 @@
1#include "idb_60.h" 1#include "idb_60.h"
2 2
3void keyboard_pre_init_kb(void) { 3void keyboard_pre_init_kb(void) {
4 setPinOutput(C4); 4 gpio_set_pin_output(C4);
5 setPinOutput(C5); 5 gpio_set_pin_output(C5);
6} 6}
7 7
8inline void _idb_60_caps_led_on(void) { 8inline void _idb_60_caps_led_on(void) {
9 writePinLow(C5); 9 gpio_write_pin_low(C5);
10} 10}
11 11
12inline void _idb_60_fn_led_on(void) { 12inline void _idb_60_fn_led_on(void) {
13 writePinLow(C4); 13 gpio_write_pin_low(C4);
14} 14}
15 15
16inline void _idb_60_caps_led_off(void) { 16inline void _idb_60_caps_led_off(void) {
17 writePinHigh(C5); 17 gpio_write_pin_high(C5);
18} 18}
19 19
20inline void _idb_60_fn_led_off(void) { 20inline void _idb_60_fn_led_off(void) {
21 writePinHigh(C4); 21 gpio_write_pin_high(C4);
22} 22}
23 23
24// Capslock LED indicator 24// Capslock LED indicator
diff --git a/keyboards/ilumkb/volcano660/volcano660.c b/keyboards/ilumkb/volcano660/volcano660.c
index d6c004987e..5e6d67c9ba 100644
--- a/keyboards/ilumkb/volcano660/volcano660.c
+++ b/keyboards/ilumkb/volcano660/volcano660.c
@@ -16,18 +16,18 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 setPinOutput(D0); 19 gpio_set_pin_output(D0);
20 setPinOutput(D1); 20 gpio_set_pin_output(D1);
21 setPinOutput(D2); 21 gpio_set_pin_output(D2);
22 matrix_init_user(); 22 matrix_init_user();
23} 23}
24 24
25bool led_update_kb(led_t led_state) { 25bool led_update_kb(led_t led_state) {
26 bool res = led_update_user(led_state); 26 bool res = led_update_user(led_state);
27 if(res) { 27 if(res) {
28 writePin(D0, !led_state.num_lock); 28 gpio_write_pin(D0, !led_state.num_lock);
29 writePin(D2, !led_state.caps_lock); 29 gpio_write_pin(D2, !led_state.caps_lock);
30 writePin(D1, !led_state.scroll_lock); 30 gpio_write_pin(D1, !led_state.scroll_lock);
31 31
32 } 32 }
33 return res; 33 return res;
diff --git a/keyboards/ingrained/matrix.c b/keyboards/ingrained/matrix.c
index 3ba9d8dcf3..92b024cdc2 100644
--- a/keyboards/ingrained/matrix.c
+++ b/keyboards/ingrained/matrix.c
@@ -180,8 +180,8 @@ static void init_cols(void) {
180 pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_MCU; 180 pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_MCU;
181 for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) { 181 for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) {
182 pin_t pin = matrix_col_pins_mcu[pin_index]; 182 pin_t pin = matrix_col_pins_mcu[pin_index];
183 setPinInput(pin); 183 gpio_set_pin_input(pin);
184 writePinHigh(pin); 184 gpio_write_pin_high(pin);
185 } 185 }
186} 186}
187 187
@@ -192,7 +192,7 @@ static matrix_row_t read_cols(uint8_t row) {
192 // For each col... 192 // For each col...
193 for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) { 193 for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) {
194 // Select the col pin to read (active low) 194 // Select the col pin to read (active low)
195 uint8_t pin_state = readPin(matrix_col_pins_mcu[col_index]); 195 uint8_t pin_state = gpio_read_pin(matrix_col_pins_mcu[col_index]);
196 196
197 // Populate the matrix row with the state of the col pin 197 // Populate the matrix row with the state of the col pin
198 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 198 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -227,8 +227,8 @@ static void unselect_rows(void) {
227 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU; 227 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU;
228 for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) { 228 for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) {
229 pin_t pin = matrix_row_pins_mcu[pin_index]; 229 pin_t pin = matrix_row_pins_mcu[pin_index];
230 setPinInput(pin); 230 gpio_set_pin_input(pin);
231 writePinLow(pin); 231 gpio_write_pin_low(pin);
232 } 232 }
233} 233}
234 234
@@ -237,8 +237,8 @@ static void select_row(uint8_t row) {
237 // select on atmega32u4 237 // select on atmega32u4
238 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU; 238 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_MCU;
239 pin_t pin = matrix_row_pins_mcu[row]; 239 pin_t pin = matrix_row_pins_mcu[row];
240 setPinOutput(pin); 240 gpio_set_pin_output(pin);
241 writePinLow(pin); 241 gpio_write_pin_low(pin);
242 } else { 242 } else {
243 // select on mcp23017 243 // select on mcp23017
244 if (mcp23017_status) { // if there was an error 244 if (mcp23017_status) { // if there was an error
diff --git a/keyboards/input_club/k_type/is31fl3733-dual.c b/keyboards/input_club/k_type/is31fl3733-dual.c
index 9e1e6b57f7..fab898dce4 100644
--- a/keyboards/input_club/k_type/is31fl3733-dual.c
+++ b/keyboards/input_club/k_type/is31fl3733-dual.c
@@ -128,8 +128,8 @@ void is31fl3733_write_pwm_buffer(uint8_t bus, uint8_t index) {
128 128
129void is31fl3733_init_drivers(void) { 129void is31fl3733_init_drivers(void) {
130#if defined(IS31FL3733_SDB_PIN) 130#if defined(IS31FL3733_SDB_PIN)
131 setPinOutput(IS31FL3733_SDB_PIN); 131 gpio_set_pin_output(IS31FL3733_SDB_PIN);
132 writePinHigh(IS31FL3733_SDB_PIN); 132 gpio_write_pin_high(IS31FL3733_SDB_PIN);
133#endif 133#endif
134 134
135 i2c_init(&I2CD1, I2C1_SCL_PIN, I2C1_SDA_PIN); 135 i2c_init(&I2CD1, I2C1_SCL_PIN, I2C1_SDA_PIN);
diff --git a/keyboards/jae/j01/j01.c b/keyboards/jae/j01/j01.c
index 95f3e9b042..4d3f8ced46 100644
--- a/keyboards/jae/j01/j01.c
+++ b/keyboards/jae/j01/j01.c
@@ -26,12 +26,12 @@ void matrix_init_kb(void) {
26 // runs once when the firmware starts up 26 // runs once when the firmware starts up
27 27
28 matrix_init_user(); 28 matrix_init_user();
29 setPinOutput(E6); 29 gpio_set_pin_output(E6);
30} 30}
31 31
32bool led_update_kb(led_t led_state) { 32bool led_update_kb(led_t led_state) {
33 if(led_update_user(led_state)) { 33 if(led_update_user(led_state)) {
34 writePin(E6, !led_state.caps_lock); 34 gpio_write_pin(E6, !led_state.caps_lock);
35 } 35 }
36 36
37 return true; 37 return true;
diff --git a/keyboards/jels/jels88/jels88.c b/keyboards/jels/jels88/jels88.c
index 8e9c12aced..ceb187ab17 100644
--- a/keyboards/jels/jels88/jels88.c
+++ b/keyboards/jels/jels88/jels88.c
@@ -23,16 +23,16 @@
23#define SCROLL_LED D4 23#define SCROLL_LED D4
24 24
25void keyboard_pre_init_kb(void) { 25void keyboard_pre_init_kb(void) {
26 setPinOutput(CAPS_LED); 26 gpio_set_pin_output(CAPS_LED);
27 setPinOutput(SCROLL_LED); 27 gpio_set_pin_output(SCROLL_LED);
28 keyboard_pre_init_user(); 28 keyboard_pre_init_user();
29} 29}
30 30
31bool led_update_kb(led_t led_state) { 31bool led_update_kb(led_t led_state) {
32 bool res = led_update_user(led_state); 32 bool res = led_update_user(led_state);
33 if (res) { 33 if (res) {
34 writePin(CAPS_LED, led_state.caps_lock); 34 gpio_write_pin(CAPS_LED, led_state.caps_lock);
35 writePin(SCROLL_LED, led_state.scroll_lock); 35 gpio_write_pin(SCROLL_LED, led_state.scroll_lock);
36 } 36 }
37 return res; 37 return res;
38} 38}
diff --git a/keyboards/jian/nsrev2/config.h b/keyboards/jian/nsrev2/config.h
index 7df400367f..48d76bd8a3 100644
--- a/keyboards/jian/nsrev2/config.h
+++ b/keyboards/jian/nsrev2/config.h
@@ -57,33 +57,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
57// (Doesn't work on mac. There is no num lock, so it will be always off and lit) 57// (Doesn't work on mac. There is no num lock, so it will be always off and lit)
58 58
59#ifdef NUM_NMOSFET 59#ifdef NUM_NMOSFET
60#define RESET_NUM_LOCK_LED() writePinLow(NUM_LOCK_LED_PIN) 60#define RESET_NUM_LOCK_LED() gpio_write_pin_low(NUM_LOCK_LED_PIN)
61#ifdef NUM_INVERT 61#ifdef NUM_INVERT
62#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock) 62#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock)
63#else 63#else
64#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock) 64#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock)
65#endif // NUM_INVERT 65#endif // NUM_INVERT
66#else 66#else
67#define RESET_NUM_LOCK_LED() writePinHigh(NUM_LOCK_LED_PIN) 67#define RESET_NUM_LOCK_LED() gpio_write_pin_high(NUM_LOCK_LED_PIN)
68#ifdef NUM_INVERT 68#ifdef NUM_INVERT
69#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock) 69#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock)
70#else 70#else
71#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock) 71#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock)
72#endif // NUM_INVERT 72#endif // NUM_INVERT
73#endif // NUM_NMOSFET 73#endif // NUM_NMOSFET
74 74
75#ifdef CAPS_NMOSFET 75#ifdef CAPS_NMOSFET
76#define RESET_CAPS_LOCK_LED() writePinLow(CAPS_LOCK_LED_PIN) 76#define RESET_CAPS_LOCK_LED() gpio_write_pin_low(CAPS_LOCK_LED_PIN)
77#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock) 77#define UPDATE_CAPS_LOCK_LED() gpio_write_pin(CAPS_LOCK_LED_PIN, led_state.caps_lock)
78#else 78#else
79#define RESET_CAPS_LOCK_LED() writePinHigh(CAPS_LOCK_LED_PIN) 79#define RESET_CAPS_LOCK_LED() gpio_write_pin_high(CAPS_LOCK_LED_PIN)
80#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock) 80#define UPDATE_CAPS_LOCK_LED() gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock)
81#endif // CAPS_NMOSFET 81#endif // CAPS_NMOSFET
82 82
83#ifdef SCROLL_NMOSFET 83#ifdef SCROLL_NMOSFET
84#define RESET_SCROLL_LOCK_LED() writePinLow(SCROLL_LOCK_LED_PIN) 84#define RESET_SCROLL_LOCK_LED() gpio_write_pin_low(SCROLL_LOCK_LED_PIN)
85#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock) 85#define UPDATE_SCROLL_LOCK_LED() gpio_write_pin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock)
86#else 86#else
87#define RESET_SCROLL_LOCK_LED() writePinHigh(SCROLL_LOCK_LED_PIN) 87#define RESET_SCROLL_LOCK_LED() gpio_write_pin_high(SCROLL_LOCK_LED_PIN)
88#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock) 88#define UPDATE_SCROLL_LOCK_LED() gpio_write_pin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock)
89#endif // SCROLL_NMOSFET 89#endif // SCROLL_NMOSFET
diff --git a/keyboards/jian/nsrev2/nsrev2.c b/keyboards/jian/nsrev2/nsrev2.c
index 1b65d4f016..50883ff211 100644
--- a/keyboards/jian/nsrev2/nsrev2.c
+++ b/keyboards/jian/nsrev2/nsrev2.c
@@ -36,15 +36,15 @@ void suspend_wakeup_init_kb(void) {
36void led_init_kb(void) 36void led_init_kb(void)
37{ 37{
38#ifdef NUM_LOCK_LED_PIN 38#ifdef NUM_LOCK_LED_PIN
39 setPinOutput(NUM_LOCK_LED_PIN); 39 gpio_set_pin_output(NUM_LOCK_LED_PIN);
40 RESET_NUM_LOCK_LED(); 40 RESET_NUM_LOCK_LED();
41#endif // NUM_LOCK_LED_PIN 41#endif // NUM_LOCK_LED_PIN
42#ifdef CAPS_LOCK_LED_PIN 42#ifdef CAPS_LOCK_LED_PIN
43 setPinOutput(CAPS_LOCK_LED_PIN); 43 gpio_set_pin_output(CAPS_LOCK_LED_PIN);
44 RESET_CAPS_LOCK_LED(); 44 RESET_CAPS_LOCK_LED();
45#endif // CAPS_LOCK_LED_PIN 45#endif // CAPS_LOCK_LED_PIN
46#ifdef SCROLL_LOCK_LED_PIN 46#ifdef SCROLL_LOCK_LED_PIN
47 setPinOutput(SCROLL_LOCK_LED_PIN); 47 gpio_set_pin_output(SCROLL_LOCK_LED_PIN);
48 RESET_SCROLL_LOCK_LED(); 48 RESET_SCROLL_LOCK_LED();
49#endif // SCROLL_LOCK_LED_PIN 49#endif // SCROLL_LOCK_LED_PIN
50} 50}
diff --git a/keyboards/jian/rev1/config.h b/keyboards/jian/rev1/config.h
index fcdf59f044..7ee2effd51 100644
--- a/keyboards/jian/rev1/config.h
+++ b/keyboards/jian/rev1/config.h
@@ -39,35 +39,35 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
39// (Doesn't work on mac. There is no num lock, so it will be always off and lit) 39// (Doesn't work on mac. There is no num lock, so it will be always off and lit)
40 40
41#ifdef NUM_NMOSFET 41#ifdef NUM_NMOSFET
42#define RESET_NUM_LOCK_LED() writePinLow(NUM_LOCK_LED_PIN) 42#define RESET_NUM_LOCK_LED() gpio_write_pin_low(NUM_LOCK_LED_PIN)
43#ifdef NUM_INVERT 43#ifdef NUM_INVERT
44#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock) 44#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock)
45#else 45#else
46#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock) 46#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock)
47#endif // NUM_INVERT 47#endif // NUM_INVERT
48#else 48#else
49#define RESET_NUM_LOCK_LED() writePinHigh(NUM_LOCK_LED_PIN) 49#define RESET_NUM_LOCK_LED() gpio_write_pin_high(NUM_LOCK_LED_PIN)
50#ifdef NUM_INVERT 50#ifdef NUM_INVERT
51#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock) 51#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock)
52#else 52#else
53#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock) 53#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock)
54#endif // NUM_INVERT 54#endif // NUM_INVERT
55#endif // NUM_NMOSFET 55#endif // NUM_NMOSFET
56 56
57#ifdef CAPS_NMOSFET 57#ifdef CAPS_NMOSFET
58#define RESET_CAPS_LOCK_LED() writePinLow(CAPS_LOCK_LED_PIN) 58#define RESET_CAPS_LOCK_LED() gpio_write_pin_low(CAPS_LOCK_LED_PIN)
59#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock) 59#define UPDATE_CAPS_LOCK_LED() gpio_write_pin(CAPS_LOCK_LED_PIN, led_state.caps_lock)
60#else 60#else
61#define RESET_CAPS_LOCK_LED() writePinHigh(CAPS_LOCK_LED_PIN) 61#define RESET_CAPS_LOCK_LED() gpio_write_pin_high(CAPS_LOCK_LED_PIN)
62#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock) 62#define UPDATE_CAPS_LOCK_LED() gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock)
63#endif // CAPS_NMOSFET 63#endif // CAPS_NMOSFET
64 64
65#ifdef SCROLL_NMOSFET 65#ifdef SCROLL_NMOSFET
66#define RESET_SCROLL_LOCK_LED() writePinLow(SCROLL_LOCK_LED_PIN) 66#define RESET_SCROLL_LOCK_LED() gpio_write_pin_low(SCROLL_LOCK_LED_PIN)
67#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock) 67#define UPDATE_SCROLL_LOCK_LED() gpio_write_pin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock)
68#else 68#else
69#define RESET_SCROLL_LOCK_LED() writePinHigh(SCROLL_LOCK_LED_PIN) 69#define RESET_SCROLL_LOCK_LED() gpio_write_pin_high(SCROLL_LOCK_LED_PIN)
70#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock) 70#define UPDATE_SCROLL_LOCK_LED() gpio_write_pin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock)
71#endif // SCROLL_NMOSFET 71#endif // SCROLL_NMOSFET
72 72
73#define RGBLIGHT_TIMER 73#define RGBLIGHT_TIMER
diff --git a/keyboards/jian/rev1/rev1.c b/keyboards/jian/rev1/rev1.c
index 1b77aa53c4..1563c40916 100644
--- a/keyboards/jian/rev1/rev1.c
+++ b/keyboards/jian/rev1/rev1.c
@@ -36,15 +36,15 @@ void suspend_wakeup_init_kb(void) {
36void led_init_kb(void) 36void led_init_kb(void)
37{ 37{
38#ifdef NUM_LOCK_LED_PIN 38#ifdef NUM_LOCK_LED_PIN
39 setPinOutput(NUM_LOCK_LED_PIN); 39 gpio_set_pin_output(NUM_LOCK_LED_PIN);
40 RESET_NUM_LOCK_LED(); 40 RESET_NUM_LOCK_LED();
41#endif // NUM_LOCK_LED_PIN 41#endif // NUM_LOCK_LED_PIN
42#ifdef CAPS_LOCK_LED_PIN 42#ifdef CAPS_LOCK_LED_PIN
43 setPinOutput(CAPS_LOCK_LED_PIN); 43 gpio_set_pin_output(CAPS_LOCK_LED_PIN);
44 RESET_CAPS_LOCK_LED(); 44 RESET_CAPS_LOCK_LED();
45#endif // CAPS_LOCK_LED_PIN 45#endif // CAPS_LOCK_LED_PIN
46#ifdef SCROLL_LOCK_LED_PIN 46#ifdef SCROLL_LOCK_LED_PIN
47 setPinOutput(SCROLL_LOCK_LED_PIN); 47 gpio_set_pin_output(SCROLL_LOCK_LED_PIN);
48 RESET_SCROLL_LOCK_LED(); 48 RESET_SCROLL_LOCK_LED();
49#endif // SCROLL_LOCK_LED_PIN 49#endif // SCROLL_LOCK_LED_PIN
50} 50}
diff --git a/keyboards/jian/rev2/config.h b/keyboards/jian/rev2/config.h
index 091605665e..33ba0ecbc5 100644
--- a/keyboards/jian/rev2/config.h
+++ b/keyboards/jian/rev2/config.h
@@ -45,33 +45,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
45// (Doesn't work on mac. There is no num lock, so it will be always off and lit) 45// (Doesn't work on mac. There is no num lock, so it will be always off and lit)
46 46
47#ifdef NUM_NMOSFET 47#ifdef NUM_NMOSFET
48#define RESET_NUM_LOCK_LED() writePinLow(NUM_LOCK_LED_PIN) 48#define RESET_NUM_LOCK_LED() gpio_write_pin_low(NUM_LOCK_LED_PIN)
49#ifdef NUM_INVERT 49#ifdef NUM_INVERT
50#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock) 50#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock)
51#else 51#else
52#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock) 52#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock)
53#endif // NUM_INVERT 53#endif // NUM_INVERT
54#else 54#else
55#define RESET_NUM_LOCK_LED() writePinHigh(NUM_LOCK_LED_PIN) 55#define RESET_NUM_LOCK_LED() gpio_write_pin_high(NUM_LOCK_LED_PIN)
56#ifdef NUM_INVERT 56#ifdef NUM_INVERT
57#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock) 57#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock)
58#else 58#else
59#define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock) 59#define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock)
60#endif // NUM_INVERT 60#endif // NUM_INVERT
61#endif // NUM_NMOSFET 61#endif // NUM_NMOSFET
62 62
63#ifdef CAPS_NMOSFET 63#ifdef CAPS_NMOSFET
64#define RESET_CAPS_LOCK_LED() writePinLow(CAPS_LOCK_LED_PIN) 64#define RESET_CAPS_LOCK_LED() gpio_write_pin_low(CAPS_LOCK_LED_PIN)
65#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock) 65#define UPDATE_CAPS_LOCK_LED() gpio_write_pin(CAPS_LOCK_LED_PIN, led_state.caps_lock)
66#else 66#else
67#define RESET_CAPS_LOCK_LED() writePinHigh(CAPS_LOCK_LED_PIN) 67#define RESET_CAPS_LOCK_LED() gpio_write_pin_high(CAPS_LOCK_LED_PIN)
68#define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock) 68#define UPDATE_CAPS_LOCK_LED() gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock)
69#endif // CAPS_NMOSFET 69#endif // CAPS_NMOSFET
70 70
71#ifdef SCROLL_NMOSFET 71#ifdef SCROLL_NMOSFET
72#define RESET_SCROLL_LOCK_LED() writePinLow(SCROLL_LOCK_LED_PIN) 72#define RESET_SCROLL_LOCK_LED() gpio_write_pin_low(SCROLL_LOCK_LED_PIN)
73#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock) 73#define UPDATE_SCROLL_LOCK_LED() gpio_write_pin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock)
74#else 74#else
75#define RESET_SCROLL_LOCK_LED() writePinHigh(SCROLL_LOCK_LED_PIN) 75#define RESET_SCROLL_LOCK_LED() gpio_write_pin_high(SCROLL_LOCK_LED_PIN)
76#define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock) 76#define UPDATE_SCROLL_LOCK_LED() gpio_write_pin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock)
77#endif // SCROLL_NMOSFET 77#endif // SCROLL_NMOSFET
diff --git a/keyboards/jian/rev2/rev2.c b/keyboards/jian/rev2/rev2.c
index 1b65d4f016..50883ff211 100644
--- a/keyboards/jian/rev2/rev2.c
+++ b/keyboards/jian/rev2/rev2.c
@@ -36,15 +36,15 @@ void suspend_wakeup_init_kb(void) {
36void led_init_kb(void) 36void led_init_kb(void)
37{ 37{
38#ifdef NUM_LOCK_LED_PIN 38#ifdef NUM_LOCK_LED_PIN
39 setPinOutput(NUM_LOCK_LED_PIN); 39 gpio_set_pin_output(NUM_LOCK_LED_PIN);
40 RESET_NUM_LOCK_LED(); 40 RESET_NUM_LOCK_LED();
41#endif // NUM_LOCK_LED_PIN 41#endif // NUM_LOCK_LED_PIN
42#ifdef CAPS_LOCK_LED_PIN 42#ifdef CAPS_LOCK_LED_PIN
43 setPinOutput(CAPS_LOCK_LED_PIN); 43 gpio_set_pin_output(CAPS_LOCK_LED_PIN);
44 RESET_CAPS_LOCK_LED(); 44 RESET_CAPS_LOCK_LED();
45#endif // CAPS_LOCK_LED_PIN 45#endif // CAPS_LOCK_LED_PIN
46#ifdef SCROLL_LOCK_LED_PIN 46#ifdef SCROLL_LOCK_LED_PIN
47 setPinOutput(SCROLL_LOCK_LED_PIN); 47 gpio_set_pin_output(SCROLL_LOCK_LED_PIN);
48 RESET_SCROLL_LOCK_LED(); 48 RESET_SCROLL_LOCK_LED();
49#endif // SCROLL_LOCK_LED_PIN 49#endif // SCROLL_LOCK_LED_PIN
50} 50}
diff --git a/keyboards/jones/v03/matrix.c b/keyboards/jones/v03/matrix.c
index 445c1acdc0..5663f1a8fc 100644
--- a/keyboards/jones/v03/matrix.c
+++ b/keyboards/jones/v03/matrix.c
@@ -22,24 +22,24 @@ static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
22static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; 22static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
23 23
24static void select_row(uint8_t row) { 24static void select_row(uint8_t row) {
25 setPinOutput(row_pins[row]); 25 gpio_set_pin_output(row_pins[row]);
26 writePinLow(row_pins[row]); 26 gpio_write_pin_low(row_pins[row]);
27} 27}
28 28
29static void unselect_row(uint8_t row) { 29static void unselect_row(uint8_t row) {
30 setPinInputHigh(row_pins[row]); 30 gpio_set_pin_input_high(row_pins[row]);
31} 31}
32 32
33static void unselect_rows(void) { 33static void unselect_rows(void) {
34 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 34 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
35 setPinInputHigh(row_pins[x]); 35 gpio_set_pin_input_high(row_pins[x]);
36 } 36 }
37} 37}
38 38
39static void init_pins(void) { 39static void init_pins(void) {
40 unselect_rows(); 40 unselect_rows();
41 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 41 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
42 setPinInputHigh(col_pins[x]); 42 gpio_set_pin_input_high(col_pins[x]);
43 } 43 }
44} 44}
45 45
@@ -60,7 +60,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
60 // skip reading when index equals (= pin itself) 60 // skip reading when index equals (= pin itself)
61 if (col_index != current_row) { 61 if (col_index != current_row) {
62 // Check col pin pin_state 62 // Check col pin pin_state
63 if (readPin(col_pins[col_index]) == 0) { 63 if (gpio_read_pin(col_pins[col_index]) == 0) {
64 // Pin LO, set col bit 64 // Pin LO, set col bit
65 current_matrix[current_row] |= (ROW_SHIFTER << col_index); 65 current_matrix[current_row] |= (ROW_SHIFTER << col_index);
66 } else { 66 } else {
diff --git a/keyboards/jones/v03_1/matrix.c b/keyboards/jones/v03_1/matrix.c
index 445c1acdc0..5663f1a8fc 100644
--- a/keyboards/jones/v03_1/matrix.c
+++ b/keyboards/jones/v03_1/matrix.c
@@ -22,24 +22,24 @@ static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
22static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; 22static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
23 23
24static void select_row(uint8_t row) { 24static void select_row(uint8_t row) {
25 setPinOutput(row_pins[row]); 25 gpio_set_pin_output(row_pins[row]);
26 writePinLow(row_pins[row]); 26 gpio_write_pin_low(row_pins[row]);
27} 27}
28 28
29static void unselect_row(uint8_t row) { 29static void unselect_row(uint8_t row) {
30 setPinInputHigh(row_pins[row]); 30 gpio_set_pin_input_high(row_pins[row]);
31} 31}
32 32
33static void unselect_rows(void) { 33static void unselect_rows(void) {
34 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 34 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
35 setPinInputHigh(row_pins[x]); 35 gpio_set_pin_input_high(row_pins[x]);
36 } 36 }
37} 37}
38 38
39static void init_pins(void) { 39static void init_pins(void) {
40 unselect_rows(); 40 unselect_rows();
41 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 41 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
42 setPinInputHigh(col_pins[x]); 42 gpio_set_pin_input_high(col_pins[x]);
43 } 43 }
44} 44}
45 45
@@ -60,7 +60,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
60 // skip reading when index equals (= pin itself) 60 // skip reading when index equals (= pin itself)
61 if (col_index != current_row) { 61 if (col_index != current_row) {
62 // Check col pin pin_state 62 // Check col pin pin_state
63 if (readPin(col_pins[col_index]) == 0) { 63 if (gpio_read_pin(col_pins[col_index]) == 0) {
64 // Pin LO, set col bit 64 // Pin LO, set col bit
65 current_matrix[current_row] |= (ROW_SHIFTER << col_index); 65 current_matrix[current_row] |= (ROW_SHIFTER << col_index);
66 } else { 66 } else {
diff --git a/keyboards/joshajohnson/hub16/matrix.c b/keyboards/joshajohnson/hub16/matrix.c
index 0fe1d41dad..26222cf15a 100644
--- a/keyboards/joshajohnson/hub16/matrix.c
+++ b/keyboards/joshajohnson/hub16/matrix.c
@@ -31,22 +31,22 @@ extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
31extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values 31extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
32 32
33static void select_row(uint8_t row) { 33static void select_row(uint8_t row) {
34 setPinOutput(row_pins[row]); 34 gpio_set_pin_output(row_pins[row]);
35 writePinLow(row_pins[row]); 35 gpio_write_pin_low(row_pins[row]);
36} 36}
37 37
38static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } 38static void unselect_row(uint8_t row) { gpio_set_pin_input_high(row_pins[row]); }
39 39
40static void unselect_rows(void) { 40static void unselect_rows(void) {
41 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 41 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
42 setPinInputHigh(row_pins[x]); 42 gpio_set_pin_input_high(row_pins[x]);
43 } 43 }
44} 44}
45 45
46static void init_pins(void) { 46static void init_pins(void) {
47 unselect_rows(); 47 unselect_rows();
48 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 48 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
49 setPinInputHigh(col_pins[x]); 49 gpio_set_pin_input_high(col_pins[x]);
50 } 50 }
51} 51}
52 52
@@ -64,7 +64,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
64 // For each col... 64 // For each col...
65 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 65 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
66 // Select the col pin to read (active low) 66 // Select the col pin to read (active low)
67 uint8_t pin_state = readPin(col_pins[col_index]); 67 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
68 68
69 // Populate the matrix row with the state of the col pin 69 // Populate the matrix row with the state of the col pin
70 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 70 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -79,8 +79,8 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
79 79
80void matrix_init_custom(void) { 80void matrix_init_custom(void) {
81 // initialize key pins 81 // initialize key pins
82 setPinInput(SWITCH_1); 82 gpio_set_pin_input(SWITCH_1);
83 setPinInput(SWITCH_2); 83 gpio_set_pin_input(SWITCH_2);
84 init_pins(); 84 init_pins();
85} 85}
86 86
@@ -112,8 +112,8 @@ static bool read_encoder_switches(matrix_row_t current_matrix[], uint8_t current
112 bool btn_2_rise = 0; 112 bool btn_2_rise = 0;
113 btn_1_array <<= 1; 113 btn_1_array <<= 1;
114 btn_2_array <<= 1; 114 btn_2_array <<= 1;
115 btn_1_array |= readPin(SWITCH_1); 115 btn_1_array |= gpio_read_pin(SWITCH_1);
116 btn_2_array |= readPin(SWITCH_2); 116 btn_2_array |= gpio_read_pin(SWITCH_2);
117 (btn_1_array == 0b01111111) ? (btn_1_rise = 1) : (btn_1_rise = 0); 117 (btn_1_array == 0b01111111) ? (btn_1_rise = 1) : (btn_1_rise = 0);
118 (btn_2_array == 0b01111111) ? (btn_2_rise = 1) : (btn_2_rise = 0); 118 (btn_2_array == 0b01111111) ? (btn_2_rise = 1) : (btn_2_rise = 0);
119 119
diff --git a/keyboards/jukaie/jk01/jk01.c b/keyboards/jukaie/jk01/jk01.c
index 913e77a55e..3c6daabf02 100644
--- a/keyboards/jukaie/jk01/jk01.c
+++ b/keyboards/jukaie/jk01/jk01.c
@@ -132,9 +132,9 @@ void spi_init(void) {
132 is_initialised = true; 132 is_initialised = true;
133 133
134 // Try releasing special pins for a short time 134 // Try releasing special pins for a short time
135 setPinInput(SPI_SCK_PIN); 135 gpio_set_pin_input(SPI_SCK_PIN);
136 setPinInput(SPI_MOSI_PIN); 136 gpio_set_pin_input(SPI_MOSI_PIN);
137 setPinInput(SPI_MISO_PIN); 137 gpio_set_pin_input(SPI_MISO_PIN);
138 138
139 chThdSleepMilliseconds(10); 139 chThdSleepMilliseconds(10);
140 140
@@ -147,12 +147,12 @@ void spi_init(void) {
147#endif 147#endif
148 148
149void keyboard_pre_init_kb(void) { 149void keyboard_pre_init_kb(void) {
150 setPinOutput(C0); 150 gpio_set_pin_output(C0);
151 setPinOutput(C15); 151 gpio_set_pin_output(C15);
152 keyboard_pre_init_user(); 152 keyboard_pre_init_user();
153}; 153};
154void housekeeping_task_kb(void) { 154void housekeeping_task_kb(void) {
155 writePin(C15, keymap_config.no_gui); 155 gpio_write_pin(C15, keymap_config.no_gui);
156}; 156};
157 157
158bool process_record_user(uint16_t keycode, keyrecord_t *record) { 158bool process_record_user(uint16_t keycode, keyrecord_t *record) {
diff --git a/keyboards/kabedon/kabedon980/kabedon980.c b/keyboards/kabedon/kabedon980/kabedon980.c
index 0614972f5e..7024a2eaa9 100644
--- a/keyboards/kabedon/kabedon980/kabedon980.c
+++ b/keyboards/kabedon/kabedon980/kabedon980.c
@@ -2,7 +2,7 @@
2 2
3 bool led_update_kb(led_t led_state) { 3 bool led_update_kb(led_t led_state) {
4 if (led_update_user(led_state)) { 4 if (led_update_user(led_state)) {
5 writePin(E6, !led_state.caps_lock); 5 gpio_write_pin(E6, !led_state.caps_lock);
6 } 6 }
7 return true; 7 return true;
8} 8}
diff --git a/keyboards/kagizaraya/chidori/board.c b/keyboards/kagizaraya/chidori/board.c
index 2834f7625b..07bdcf165e 100644
--- a/keyboards/kagizaraya/chidori/board.c
+++ b/keyboards/kagizaraya/chidori/board.c
@@ -60,8 +60,8 @@ static board_interface_t* get_interface(board_info_t* board) {
60static void board_set_master_led(board_info_t* board, uint8_t led_index, bool status) { 60static void board_set_master_led(board_info_t* board, uint8_t led_index, bool status) {
61 pin_t pin = board->led_pins[led_index]; 61 pin_t pin = board->led_pins[led_index];
62 board->led_status[led_index] = status; 62 board->led_status[led_index] = status;
63 setPinOutput(pin); 63 gpio_set_pin_output(pin);
64 status ? writePinHigh(pin) : writePinLow(pin); 64 status ? gpio_write_pin_high(pin) : gpio_write_pin_low(pin);
65} 65}
66 66
67static void board_set_slave_led(board_info_t* board, uint8_t led_index, bool status) { 67static void board_set_slave_led(board_info_t* board, uint8_t led_index, bool status) {
@@ -254,18 +254,18 @@ static bool board_read_cols_on_slave_row(board_info_t* board, matrix_row_t curre
254// Functions for master board 254// Functions for master board
255// 255//
256static void board_select_master_row(board_info_t* board, uint8_t board_row) { 256static void board_select_master_row(board_info_t* board, uint8_t board_row) {
257 setPinOutput(board->row_pins[board_row]); 257 gpio_set_pin_output(board->row_pins[board_row]);
258 writePinLow(board->row_pins[board_row]); 258 gpio_write_pin_low(board->row_pins[board_row]);
259} 259}
260 260
261static void board_unselect_master_row(board_info_t* board, uint8_t board_row) { setPinInputHigh(board->row_pins[board_row]); } 261static void board_unselect_master_row(board_info_t* board, uint8_t board_row) { gpio_set_pin_input_high(board->row_pins[board_row]); }
262 262
263static void board_unselect_master_rows(board_info_t* board) { 263static void board_unselect_master_rows(board_info_t* board) {
264 if (!board) { 264 if (!board) {
265 return; 265 return;
266 } 266 }
267 for (uint8_t x = 0; x < NUM_ROWS; x++) { 267 for (uint8_t x = 0; x < NUM_ROWS; x++) {
268 setPinInput(board->row_pins[x]); 268 gpio_set_pin_input(board->row_pins[x]);
269 } 269 }
270} 270}
271 271
@@ -281,7 +281,7 @@ static bool board_read_cols_on_master_row(board_info_t* board, matrix_row_t curr
281 wait_us(30); 281 wait_us(30);
282 282
283 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 283 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
284 uint8_t pin_state = readPin(board->col_pins[col_index]); 284 uint8_t pin_state = gpio_read_pin(board->col_pins[col_index]);
285 current_matrix[row] |= pin_state ? 0 : (1 << col_index); 285 current_matrix[row] |= pin_state ? 0 : (1 << col_index);
286 } 286 }
287 board_unselect_master_row(board, board_row); 287 board_unselect_master_row(board, board_row);
@@ -295,7 +295,7 @@ static void board_master_init(void) {
295 return; 295 return;
296 } 296 }
297 for (uint8_t x = 0; x < NUM_COLS; x++) { 297 for (uint8_t x = 0; x < NUM_COLS; x++) {
298 setPinInputHigh(board->col_pins[x]); 298 gpio_set_pin_input_high(board->col_pins[x]);
299 } 299 }
300 board->initialized = true; 300 board->initialized = true;
301} 301}
diff --git a/keyboards/kakunpc/angel64/alpha/matrix.c b/keyboards/kakunpc/angel64/alpha/matrix.c
index 5d731b1068..ff2b8a801e 100644
--- a/keyboards/kakunpc/angel64/alpha/matrix.c
+++ b/keyboards/kakunpc/angel64/alpha/matrix.c
@@ -105,37 +105,37 @@ void matrix_print(void)
105 105
106static void select_row(uint8_t row) 106static void select_row(uint8_t row)
107{ 107{
108 setPinOutput(row_pins[row]); 108 gpio_set_pin_output(row_pins[row]);
109 writePinLow(row_pins[row]); 109 gpio_write_pin_low(row_pins[row]);
110} 110}
111 111
112static void unselect_row(uint8_t row) 112static void unselect_row(uint8_t row)
113{ 113{
114 setPinInputHigh(row_pins[row]); 114 gpio_set_pin_input_high(row_pins[row]);
115} 115}
116 116
117static void unselect_rows(void) 117static void unselect_rows(void)
118{ 118{
119 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 119 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
120 setPinInputHigh(row_pins[x]); 120 gpio_set_pin_input_high(row_pins[x]);
121 } 121 }
122} 122}
123 123
124static void select_col(uint8_t col) 124static void select_col(uint8_t col)
125{ 125{
126 setPinOutput(col_pins[col]); 126 gpio_set_pin_output(col_pins[col]);
127 writePinLow(col_pins[col]); 127 gpio_write_pin_low(col_pins[col]);
128} 128}
129 129
130static void unselect_col(uint8_t col) 130static void unselect_col(uint8_t col)
131{ 131{
132 setPinInputHigh(col_pins[col]); 132 gpio_set_pin_input_high(col_pins[col]);
133} 133}
134 134
135static void unselect_cols(void) 135static void unselect_cols(void)
136{ 136{
137 for(uint8_t x = 0; x < MATRIX_COLS; x++) { 137 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
138 setPinInputHigh(col_pins[x]); 138 gpio_set_pin_input_high(col_pins[x]);
139 } 139 }
140} 140}
141 141
@@ -143,10 +143,10 @@ static void init_pins(void) {
143 unselect_rows(); 143 unselect_rows();
144 unselect_cols(); 144 unselect_cols();
145 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 145 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
146 setPinInputHigh(col_pins[x]); 146 gpio_set_pin_input_high(col_pins[x]);
147 } 147 }
148 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 148 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
149 setPinInputHigh(row_pins[x]); 149 gpio_set_pin_input_high(row_pins[x]);
150 } 150 }
151} 151}
152 152
@@ -166,7 +166,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
166 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 166 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
167 167
168 // Select the col pin to read (active low) 168 // Select the col pin to read (active low)
169 uint8_t pin_state = readPin(col_pins[col_index]); 169 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
170 170
171 // Populate the matrix row with the state of the col pin 171 // Populate the matrix row with the state of the col pin
172 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); 172 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
@@ -194,7 +194,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
194 matrix_row_t last_row_value = current_matrix[tmp]; 194 matrix_row_t last_row_value = current_matrix[tmp];
195 195
196 // Check row pin state 196 // Check row pin state
197 if (readPin(row_pins[row_index]) == 0) 197 if (gpio_read_pin(row_pins[row_index]) == 0)
198 { 198 {
199 // Pin LO, set col bit 199 // Pin LO, set col bit
200 current_matrix[tmp] |= (ROW_SHIFTER << current_col); 200 current_matrix[tmp] |= (ROW_SHIFTER << current_col);
diff --git a/keyboards/kakunpc/angel64/rev1/matrix.c b/keyboards/kakunpc/angel64/rev1/matrix.c
index 5d731b1068..ff2b8a801e 100644
--- a/keyboards/kakunpc/angel64/rev1/matrix.c
+++ b/keyboards/kakunpc/angel64/rev1/matrix.c
@@ -105,37 +105,37 @@ void matrix_print(void)
105 105
106static void select_row(uint8_t row) 106static void select_row(uint8_t row)
107{ 107{
108 setPinOutput(row_pins[row]); 108 gpio_set_pin_output(row_pins[row]);
109 writePinLow(row_pins[row]); 109 gpio_write_pin_low(row_pins[row]);
110} 110}
111 111
112static void unselect_row(uint8_t row) 112static void unselect_row(uint8_t row)
113{ 113{
114 setPinInputHigh(row_pins[row]); 114 gpio_set_pin_input_high(row_pins[row]);
115} 115}
116 116
117static void unselect_rows(void) 117static void unselect_rows(void)
118{ 118{
119 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 119 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
120 setPinInputHigh(row_pins[x]); 120 gpio_set_pin_input_high(row_pins[x]);
121 } 121 }
122} 122}
123 123
124static void select_col(uint8_t col) 124static void select_col(uint8_t col)
125{ 125{
126 setPinOutput(col_pins[col]); 126 gpio_set_pin_output(col_pins[col]);
127 writePinLow(col_pins[col]); 127 gpio_write_pin_low(col_pins[col]);
128} 128}
129 129
130static void unselect_col(uint8_t col) 130static void unselect_col(uint8_t col)
131{ 131{
132 setPinInputHigh(col_pins[col]); 132 gpio_set_pin_input_high(col_pins[col]);
133} 133}
134 134
135static void unselect_cols(void) 135static void unselect_cols(void)
136{ 136{
137 for(uint8_t x = 0; x < MATRIX_COLS; x++) { 137 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
138 setPinInputHigh(col_pins[x]); 138 gpio_set_pin_input_high(col_pins[x]);
139 } 139 }
140} 140}
141 141
@@ -143,10 +143,10 @@ static void init_pins(void) {
143 unselect_rows(); 143 unselect_rows();
144 unselect_cols(); 144 unselect_cols();
145 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 145 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
146 setPinInputHigh(col_pins[x]); 146 gpio_set_pin_input_high(col_pins[x]);
147 } 147 }
148 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 148 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
149 setPinInputHigh(row_pins[x]); 149 gpio_set_pin_input_high(row_pins[x]);
150 } 150 }
151} 151}
152 152
@@ -166,7 +166,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
166 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 166 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
167 167
168 // Select the col pin to read (active low) 168 // Select the col pin to read (active low)
169 uint8_t pin_state = readPin(col_pins[col_index]); 169 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
170 170
171 // Populate the matrix row with the state of the col pin 171 // Populate the matrix row with the state of the col pin
172 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); 172 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
@@ -194,7 +194,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
194 matrix_row_t last_row_value = current_matrix[tmp]; 194 matrix_row_t last_row_value = current_matrix[tmp];
195 195
196 // Check row pin state 196 // Check row pin state
197 if (readPin(row_pins[row_index]) == 0) 197 if (gpio_read_pin(row_pins[row_index]) == 0)
198 { 198 {
199 // Pin LO, set col bit 199 // Pin LO, set col bit
200 current_matrix[tmp] |= (ROW_SHIFTER << current_col); 200 current_matrix[tmp] |= (ROW_SHIFTER << current_col);
diff --git a/keyboards/kakunpc/choc_taro/matrix.c b/keyboards/kakunpc/choc_taro/matrix.c
index 4547f1a047..20cdf9de85 100644
--- a/keyboards/kakunpc/choc_taro/matrix.c
+++ b/keyboards/kakunpc/choc_taro/matrix.c
@@ -28,32 +28,32 @@ static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
28static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; 28static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
29 29
30static void select_row(uint8_t row) { 30static void select_row(uint8_t row) {
31 setPinOutput(row_pins[row]); 31 gpio_set_pin_output(row_pins[row]);
32 writePinLow(row_pins[row]); 32 gpio_write_pin_low(row_pins[row]);
33} 33}
34 34
35static void unselect_row(uint8_t row) { 35static void unselect_row(uint8_t row) {
36 setPinInputHigh(row_pins[row]); 36 gpio_set_pin_input_high(row_pins[row]);
37} 37}
38 38
39static void unselect_rows(void) { 39static void unselect_rows(void) {
40 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 40 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
41 setPinInputHigh(row_pins[x]); 41 gpio_set_pin_input_high(row_pins[x]);
42 } 42 }
43} 43}
44 44
45static void select_col(uint8_t col) { 45static void select_col(uint8_t col) {
46 setPinOutput(col_pins[col]); 46 gpio_set_pin_output(col_pins[col]);
47 writePinLow(col_pins[col]); 47 gpio_write_pin_low(col_pins[col]);
48} 48}
49 49
50static void unselect_col(uint8_t col) { 50static void unselect_col(uint8_t col) {
51 setPinInputHigh(col_pins[col]); 51 gpio_set_pin_input_high(col_pins[col]);
52} 52}
53 53
54static void unselect_cols(void) { 54static void unselect_cols(void) {
55 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 55 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
56 setPinInputHigh(col_pins[x]); 56 gpio_set_pin_input_high(col_pins[x]);
57 } 57 }
58} 58}
59 59
@@ -62,11 +62,11 @@ static void init_pins(void) {
62 unselect_cols(); 62 unselect_cols();
63 63
64 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 64 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
65 setPinInputHigh(col_pins[x]); 65 gpio_set_pin_input_high(col_pins[x]);
66 } 66 }
67 67
68 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 68 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
69 setPinInputHigh(row_pins[x]); 69 gpio_set_pin_input_high(row_pins[x]);
70 } 70 }
71} 71}
72 72
@@ -85,7 +85,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
85 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 85 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
86 86
87 // Select the col pin to read (active low) 87 // Select the col pin to read (active low)
88 uint8_t pin_state = readPin(col_pins[col_index]); 88 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
89 89
90 // Populate the matrix row with the state of the col pin 90 // Populate the matrix row with the state of the col pin
91 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); 91 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
@@ -111,7 +111,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
111 matrix_row_t last_row_value = current_matrix[tmp]; 111 matrix_row_t last_row_value = current_matrix[tmp];
112 112
113 // Check row pin state 113 // Check row pin state
114 if (readPin(row_pins[row_index]) == 0) { 114 if (gpio_read_pin(row_pins[row_index]) == 0) {
115 // Pin LO, set col bit 115 // Pin LO, set col bit
116 current_matrix[tmp] |= (ROW_SHIFTER << current_col); 116 current_matrix[tmp] |= (ROW_SHIFTER << current_col);
117 } else { 117 } else {
diff --git a/keyboards/kakunpc/thedogkeyboard/matrix.c b/keyboards/kakunpc/thedogkeyboard/matrix.c
index 5d731b1068..ff2b8a801e 100644
--- a/keyboards/kakunpc/thedogkeyboard/matrix.c
+++ b/keyboards/kakunpc/thedogkeyboard/matrix.c
@@ -105,37 +105,37 @@ void matrix_print(void)
105 105
106static void select_row(uint8_t row) 106static void select_row(uint8_t row)
107{ 107{
108 setPinOutput(row_pins[row]); 108 gpio_set_pin_output(row_pins[row]);
109 writePinLow(row_pins[row]); 109 gpio_write_pin_low(row_pins[row]);
110} 110}
111 111
112static void unselect_row(uint8_t row) 112static void unselect_row(uint8_t row)
113{ 113{
114 setPinInputHigh(row_pins[row]); 114 gpio_set_pin_input_high(row_pins[row]);
115} 115}
116 116
117static void unselect_rows(void) 117static void unselect_rows(void)
118{ 118{
119 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 119 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
120 setPinInputHigh(row_pins[x]); 120 gpio_set_pin_input_high(row_pins[x]);
121 } 121 }
122} 122}
123 123
124static void select_col(uint8_t col) 124static void select_col(uint8_t col)
125{ 125{
126 setPinOutput(col_pins[col]); 126 gpio_set_pin_output(col_pins[col]);
127 writePinLow(col_pins[col]); 127 gpio_write_pin_low(col_pins[col]);
128} 128}
129 129
130static void unselect_col(uint8_t col) 130static void unselect_col(uint8_t col)
131{ 131{
132 setPinInputHigh(col_pins[col]); 132 gpio_set_pin_input_high(col_pins[col]);
133} 133}
134 134
135static void unselect_cols(void) 135static void unselect_cols(void)
136{ 136{
137 for(uint8_t x = 0; x < MATRIX_COLS; x++) { 137 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
138 setPinInputHigh(col_pins[x]); 138 gpio_set_pin_input_high(col_pins[x]);
139 } 139 }
140} 140}
141 141
@@ -143,10 +143,10 @@ static void init_pins(void) {
143 unselect_rows(); 143 unselect_rows();
144 unselect_cols(); 144 unselect_cols();
145 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 145 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
146 setPinInputHigh(col_pins[x]); 146 gpio_set_pin_input_high(col_pins[x]);
147 } 147 }
148 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 148 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
149 setPinInputHigh(row_pins[x]); 149 gpio_set_pin_input_high(row_pins[x]);
150 } 150 }
151} 151}
152 152
@@ -166,7 +166,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
166 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 166 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
167 167
168 // Select the col pin to read (active low) 168 // Select the col pin to read (active low)
169 uint8_t pin_state = readPin(col_pins[col_index]); 169 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
170 170
171 // Populate the matrix row with the state of the col pin 171 // Populate the matrix row with the state of the col pin
172 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); 172 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
@@ -194,7 +194,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
194 matrix_row_t last_row_value = current_matrix[tmp]; 194 matrix_row_t last_row_value = current_matrix[tmp];
195 195
196 // Check row pin state 196 // Check row pin state
197 if (readPin(row_pins[row_index]) == 0) 197 if (gpio_read_pin(row_pins[row_index]) == 0)
198 { 198 {
199 // Pin LO, set col bit 199 // Pin LO, set col bit
200 current_matrix[tmp] |= (ROW_SHIFTER << current_col); 200 current_matrix[tmp] |= (ROW_SHIFTER << current_col);
diff --git a/keyboards/kbdfans/bella/soldered/soldered.c b/keyboards/kbdfans/bella/soldered/soldered.c
index 65809c3c2f..bfe9f8f5d4 100755
--- a/keyboards/kbdfans/bella/soldered/soldered.c
+++ b/keyboards/kbdfans/bella/soldered/soldered.c
@@ -15,14 +15,14 @@
15 */ 15 */
16#include "quantum.h" 16#include "quantum.h"
17void matrix_init_kb(void) { 17void matrix_init_kb(void) {
18 setPinOutput(E6); 18 gpio_set_pin_output(E6);
19 matrix_init_user(); 19 matrix_init_user();
20} 20}
21 21
22bool led_update_kb(led_t led_state) { 22bool led_update_kb(led_t led_state) {
23 bool res = led_update_user(led_state); 23 bool res = led_update_user(led_state);
24 if(res) { 24 if(res) {
25 writePin(E6, !led_state.caps_lock); 25 gpio_write_pin(E6, !led_state.caps_lock);
26 } 26 }
27 return res; 27 return res;
28} 28}
diff --git a/keyboards/kbdfans/kbd19x/kbd19x.h b/keyboards/kbdfans/kbd19x/kbd19x.h
index 33bebeb882..e4453f438d 100644
--- a/keyboards/kbdfans/kbd19x/kbd19x.h
+++ b/keyboards/kbdfans/kbd19x/kbd19x.h
@@ -20,11 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20#include "quantum.h" 20#include "quantum.h"
21#include "led.h" 21#include "led.h"
22 22
23inline void kbd19x_caps_led_on(void) { writePinHigh(LED_CAPS_LOCK_PIN); } 23inline void kbd19x_caps_led_on(void) { gpio_write_pin_high(LED_CAPS_LOCK_PIN); }
24inline void kbd19x_caps_led_off(void) { writePinLow(LED_CAPS_LOCK_PIN); } 24inline void kbd19x_caps_led_off(void) { gpio_write_pin_low(LED_CAPS_LOCK_PIN); }
25 25
26inline void kbd19x_sclk_led_on(void) { writePinHigh(LED_SCROLL_LOCK_PIN); } 26inline void kbd19x_sclk_led_on(void) { gpio_write_pin_high(LED_SCROLL_LOCK_PIN); }
27inline void kbd19x_sclk_led_off(void) { writePinLow(LED_SCROLL_LOCK_PIN); } 27inline void kbd19x_sclk_led_off(void) { gpio_write_pin_low(LED_SCROLL_LOCK_PIN); }
28 28
29inline void kbd19x_nmlk_led_on(void) { writePinHigh(LED_NUM_LOCK_PIN); } 29inline void kbd19x_nmlk_led_on(void) { gpio_write_pin_high(LED_NUM_LOCK_PIN); }
30inline void kbd19x_nmlk_led_off(void) { writePinLow(LED_NUM_LOCK_PIN); } 30inline void kbd19x_nmlk_led_off(void) { gpio_write_pin_low(LED_NUM_LOCK_PIN); }
diff --git a/keyboards/kbdfans/kbd8x/kbd8x.h b/keyboards/kbdfans/kbd8x/kbd8x.h
index a0a1ac7390..a7d72904cb 100644
--- a/keyboards/kbdfans/kbd8x/kbd8x.h
+++ b/keyboards/kbdfans/kbd8x/kbd8x.h
@@ -19,11 +19,11 @@
19#include "led.h" 19#include "led.h"
20 20
21// Functions for setting LEDs on toggle keys 21// Functions for setting LEDs on toggle keys
22inline void caps_led_on(void) { writePinHigh(LED_CAPS_LOCK_PIN); } 22inline void caps_led_on(void) { gpio_write_pin_high(LED_CAPS_LOCK_PIN); }
23inline void caps_led_off(void) { writePinLow(LED_CAPS_LOCK_PIN); } 23inline void caps_led_off(void) { gpio_write_pin_low(LED_CAPS_LOCK_PIN); }
24 24
25inline void num_led_on(void) { writePinHigh(LED_NUM_LOCK_PIN); } 25inline void num_led_on(void) { gpio_write_pin_high(LED_NUM_LOCK_PIN); }
26inline void num_led_off(void) { writePinLow(LED_NUM_LOCK_PIN); } 26inline void num_led_off(void) { gpio_write_pin_low(LED_NUM_LOCK_PIN); }
27 27
28inline void scroll_led_on(void) { writePinHigh(LED_SCROLL_LOCK_PIN); } 28inline void scroll_led_on(void) { gpio_write_pin_high(LED_SCROLL_LOCK_PIN); }
29inline void scroll_led_off(void) { writePinLow(LED_SCROLL_LOCK_PIN); } 29inline void scroll_led_off(void) { gpio_write_pin_low(LED_SCROLL_LOCK_PIN); }
diff --git a/keyboards/kbdfans/maja_soldered/maja_soldered.c b/keyboards/kbdfans/maja_soldered/maja_soldered.c
index c774027780..41d80e2cc8 100755
--- a/keyboards/kbdfans/maja_soldered/maja_soldered.c
+++ b/keyboards/kbdfans/maja_soldered/maja_soldered.c
@@ -16,14 +16,14 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 setPinOutput(D4); 19 gpio_set_pin_output(D4);
20 matrix_init_user(); 20 matrix_init_user();
21} 21}
22 22
23bool led_update_kb(led_t led_state) { 23bool led_update_kb(led_t led_state) {
24 bool res = led_update_user(led_state); 24 bool res = led_update_user(led_state);
25 if(res) { 25 if(res) {
26 writePin(D4, !led_state.caps_lock); 26 gpio_write_pin(D4, !led_state.caps_lock);
27 } 27 }
28 return res; 28 return res;
29} 29}
diff --git a/keyboards/kbdfans/niu_mini/niu_mini.c b/keyboards/kbdfans/niu_mini/niu_mini.c
index 02b2ca6590..1bde1ba5d0 100644
--- a/keyboards/kbdfans/niu_mini/niu_mini.c
+++ b/keyboards/kbdfans/niu_mini/niu_mini.c
@@ -12,8 +12,8 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
12 12
13void matrix_init_kb(void) { 13void matrix_init_kb(void) {
14 // Turn status LED on 14 // Turn status LED on
15 setPinOutput(E6); 15 gpio_set_pin_output(E6);
16 writePinHigh(E6); 16 gpio_write_pin_high(E6);
17 17
18 matrix_init_user(); 18 matrix_init_user();
19} 19}
diff --git a/keyboards/kbdfans/phaseone/phaseone.c b/keyboards/kbdfans/phaseone/phaseone.c
index ded75ac8ed..a44e501109 100644
--- a/keyboards/kbdfans/phaseone/phaseone.c
+++ b/keyboards/kbdfans/phaseone/phaseone.c
@@ -17,5 +17,5 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 setPinOutput(D4); 20 gpio_set_pin_output(D4);
21} 21}
diff --git a/keyboards/kbdmania/kmac/kmac.c b/keyboards/kbdmania/kmac/kmac.c
index 29f7091084..c3f06349d8 100644
--- a/keyboards/kbdmania/kmac/kmac.c
+++ b/keyboards/kbdmania/kmac/kmac.c
@@ -19,11 +19,11 @@
19#define WASD_MASK 0b10 19#define WASD_MASK 0b10
20 20
21void backlight_init_ports(void) { 21void backlight_init_ports(void) {
22 setPinOutput(B1); 22 gpio_set_pin_output(B1);
23 setPinOutput(B2); 23 gpio_set_pin_output(B2);
24 setPinOutput(B3); 24 gpio_set_pin_output(B3);
25 setPinOutput(B4); 25 gpio_set_pin_output(B4);
26 setPinOutput(D7); 26 gpio_set_pin_output(D7);
27} 27}
28 28
29/* Backlight pin configuration 29/* Backlight pin configuration
@@ -36,21 +36,21 @@ void backlight_init_ports(void) {
36void backlight_set(uint8_t level) { 36void backlight_set(uint8_t level) {
37 // F-row 37 // F-row
38 if (level & F_ROW_MASK) { 38 if (level & F_ROW_MASK) {
39 writePinHigh(B1); 39 gpio_write_pin_high(B1);
40 } else { 40 } else {
41 writePinLow(B1); 41 gpio_write_pin_low(B1);
42 } 42 }
43 43
44 // WASD 44 // WASD
45 if (level & WASD_MASK) { 45 if (level & WASD_MASK) {
46 writePinLow(B2); 46 gpio_write_pin_low(B2);
47 writePinLow(B3); 47 gpio_write_pin_low(B3);
48 writePinLow(B4); 48 gpio_write_pin_low(B4);
49 writePinLow(D7); 49 gpio_write_pin_low(D7);
50 } else { 50 } else {
51 writePinHigh(B2); 51 gpio_write_pin_high(B2);
52 writePinHigh(B3); 52 gpio_write_pin_high(B3);
53 writePinHigh(B4); 53 gpio_write_pin_high(B4);
54 writePinHigh(D7); 54 gpio_write_pin_high(D7);
55 } 55 }
56} 56}
diff --git a/keyboards/kbdmania/kmac/matrix.c b/keyboards/kbdmania/kmac/matrix.c
index 1843d19fd2..ea149c49ad 100644
--- a/keyboards/kbdmania/kmac/matrix.c
+++ b/keyboards/kbdmania/kmac/matrix.c
@@ -94,8 +94,8 @@ void matrix_print(void) {
94 */ 94 */
95static void unselect_cols(void) { 95static void unselect_cols(void) {
96 for (uint8_t x = 0; x < 6; x++) { 96 for (uint8_t x = 0; x < 6; x++) {
97 setPinOutput(col_pins[x]); 97 gpio_set_pin_output(col_pins[x]);
98 writePinLow(col_pins[x]); 98 gpio_write_pin_low(col_pins[x]);
99 } 99 }
100} 100}
101 101
@@ -103,13 +103,13 @@ static void select_col(uint8_t col) {
103 if (col < 16) { 103 if (col < 16) {
104 uint8_t c = col + 8; 104 uint8_t c = col + 8;
105 105
106 writePin(B6, c & 0b10000); 106 gpio_write_pin(B6, c & 0b10000);
107 writePin(C6, c & 0b01000); 107 gpio_write_pin(C6, c & 0b01000);
108 writePin(C7, c & 0b00100); 108 gpio_write_pin(C7, c & 0b00100);
109 writePin(F1, c & 0b00010); 109 gpio_write_pin(F1, c & 0b00010);
110 writePin(F0, c & 0b00001); 110 gpio_write_pin(F0, c & 0b00001);
111 } else { 111 } else {
112 writePinHigh(B5); 112 gpio_write_pin_high(B5);
113 } 113 }
114} 114}
115 115
@@ -122,10 +122,10 @@ static void select_col(uint8_t col) {
122static void init_pins(void) { 122static void init_pins(void) {
123 unselect_cols(); 123 unselect_cols();
124 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 124 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
125 setPinInputHigh(row_pins[x]); 125 gpio_set_pin_input_high(row_pins[x]);
126 } 126 }
127 127
128 setPinInputHigh(E2); 128 gpio_set_pin_input_high(E2);
129} 129}
130 130
131static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 131static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
@@ -143,7 +143,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
143 // Check row pin state 143 // Check row pin state
144 // Use the otherwise unused row: 3, col: 0 for caps lock 144 // Use the otherwise unused row: 3, col: 0 for caps lock
145 if (row_index == 3 && current_col == 0) { 145 if (row_index == 3 && current_col == 0) {
146 if (readPin(E2) == 0) { 146 if (gpio_read_pin(E2) == 0) {
147 // Pin LO, set col bit 147 // Pin LO, set col bit
148 current_matrix[row_index] |= (ROW_SHIFTER << current_col); 148 current_matrix[row_index] |= (ROW_SHIFTER << current_col);
149 } else { 149 } else {
@@ -151,7 +151,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
151 current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); 151 current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
152 } 152 }
153 } else { 153 } else {
154 if (readPin(row_pins[row_index]) == 0) { 154 if (gpio_read_pin(row_pins[row_index]) == 0) {
155 // Pin HI, clear col bit 155 // Pin HI, clear col bit
156 current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); 156 current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
157 } else { 157 } else {
diff --git a/keyboards/kbdmania/kmac_pad/kmac_pad.c b/keyboards/kbdmania/kmac_pad/kmac_pad.c
index 3de2cb711e..064502710f 100644
--- a/keyboards/kbdmania/kmac_pad/kmac_pad.c
+++ b/keyboards/kbdmania/kmac_pad/kmac_pad.c
@@ -23,7 +23,7 @@ void keyboard_pre_init_kb(void) {
23 * FN Pin PB3 23 * FN Pin PB3
24 * PAD Pin PB1 24 * PAD Pin PB1
25 */ 25 */
26 setPinOutput(B3); 26 gpio_set_pin_output(B3);
27 setPinOutput(B1); 27 gpio_set_pin_output(B1);
28 keyboard_pre_init_user(); 28 keyboard_pre_init_user();
29} 29}
diff --git a/keyboards/kbdmania/kmac_pad/matrix.c b/keyboards/kbdmania/kmac_pad/matrix.c
index ad7919e33c..1fe0502311 100644
--- a/keyboards/kbdmania/kmac_pad/matrix.c
+++ b/keyboards/kbdmania/kmac_pad/matrix.c
@@ -30,13 +30,13 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
30 */ 30 */
31static void unselect_cols(void) { 31static void unselect_cols(void) {
32 for (uint8_t col = 0; col < MATRIX_COLS; col++) { 32 for (uint8_t col = 0; col < MATRIX_COLS; col++) {
33 setPinOutput(col_pins[col]); 33 gpio_set_pin_output(col_pins[col]);
34 writePinLow(col_pins[col]); 34 gpio_write_pin_low(col_pins[col]);
35 } 35 }
36} 36}
37 37
38static void select_col(uint8_t col) { 38static void select_col(uint8_t col) {
39 writePinHigh(col_pins[col]); 39 gpio_write_pin_high(col_pins[col]);
40} 40}
41 41
42static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 42static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
@@ -50,7 +50,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
50 if (current_col == 0) { 50 if (current_col == 0) {
51 51
52 matrix_row_t last_row_value = current_matrix[0]; 52 matrix_row_t last_row_value = current_matrix[0];
53 if (readPin(row_pins[0]) == 0) { 53 if (gpio_read_pin(row_pins[0]) == 0) {
54 // Pin LO, set col bit 54 // Pin LO, set col bit
55 current_matrix[0] |= (1 << current_col); 55 current_matrix[0] |= (1 << current_col);
56 } else { 56 } else {
@@ -68,7 +68,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
68 for (uint8_t row_index = 1; row_index < MATRIX_ROWS; row_index++) { 68 for (uint8_t row_index = 1; row_index < MATRIX_ROWS; row_index++) {
69 69
70 matrix_row_t last_row_value = current_matrix[row_index]; 70 matrix_row_t last_row_value = current_matrix[row_index];
71 if (readPin(row_pins[row_index]) == 0) { 71 if (gpio_read_pin(row_pins[row_index]) == 0) {
72 // Pin HI, clear col bit 72 // Pin HI, clear col bit
73 current_matrix[row_index] &= ~(1 << current_col); 73 current_matrix[row_index] &= ~(1 << current_col);
74 } else { 74 } else {
@@ -95,7 +95,7 @@ void matrix_init_custom(void) {
95 95
96 // initialize key pins 96 // initialize key pins
97 for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) { 97 for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) {
98 setPinInputHigh(row_pins[row_index]); 98 gpio_set_pin_input_high(row_pins[row_index]);
99 } 99 }
100} 100}
101 101
diff --git a/keyboards/kc60/kc60.c b/keyboards/kc60/kc60.c
index 22ce217b52..143148a224 100644
--- a/keyboards/kc60/kc60.c
+++ b/keyboards/kc60/kc60.c
@@ -2,8 +2,8 @@
2 2
3void led_update_ports(led_t led_state) { 3void led_update_ports(led_t led_state) {
4 if (led_state.caps_lock) { 4 if (led_state.caps_lock) {
5 setPinOutput(B2); 5 gpio_set_pin_output(B2);
6 } else { 6 } else {
7 setPinInput(B2); 7 gpio_set_pin_input(B2);
8 } 8 }
9} 9}
diff --git a/keyboards/kc60se/kc60se.c b/keyboards/kc60se/kc60se.c
index 660b9201b3..a7d60079b2 100644
--- a/keyboards/kc60se/kc60se.c
+++ b/keyboards/kc60se/kc60se.c
@@ -17,13 +17,13 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void matrix_init_kb(void){ 19void matrix_init_kb(void){
20 setPinOutput(B2); 20 gpio_set_pin_output(B2);
21} 21}
22 22
23bool led_update_kb(led_t led_state) { 23bool led_update_kb(led_t led_state) {
24 bool res = led_update_user(led_state); 24 bool res = led_update_user(led_state);
25 if(res) { 25 if(res) {
26 writePin(B2, !led_state.caps_lock); 26 gpio_write_pin(B2, !led_state.caps_lock);
27 } 27 }
28 return res; 28 return res;
29} 29}
diff --git a/keyboards/keebio/kbo5000/rev1/rev1.c b/keyboards/keebio/kbo5000/rev1/rev1.c
index 45443becbe..8aa227deba 100644
--- a/keyboards/keebio/kbo5000/rev1/rev1.c
+++ b/keyboards/keebio/kbo5000/rev1/rev1.c
@@ -2,14 +2,14 @@
2#include "split_util.h" 2#include "split_util.h"
3 3
4void matrix_init_kb(void) { 4void matrix_init_kb(void) {
5 setPinOutput(CAPS_LOCK_LED_PIN); 5 gpio_set_pin_output(CAPS_LOCK_LED_PIN);
6 matrix_init_user(); 6 matrix_init_user();
7} 7}
8 8
9bool led_update_kb(led_t led_state) { 9bool led_update_kb(led_t led_state) {
10 // Only update if left half 10 // Only update if left half
11 if (isLeftHand && led_update_user(led_state)) { 11 if (isLeftHand && led_update_user(led_state)) {
12 writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock); 12 gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock);
13 } 13 }
14 return true; 14 return true;
15} 15}
diff --git a/keyboards/keebio/quefrency/rev2/rev2.c b/keyboards/keebio/quefrency/rev2/rev2.c
index a3bc2ca1ef..f0320597f7 100644
--- a/keyboards/keebio/quefrency/rev2/rev2.c
+++ b/keyboards/keebio/quefrency/rev2/rev2.c
@@ -2,14 +2,14 @@
2#include "split_util.h" 2#include "split_util.h"
3 3
4void matrix_init_kb(void) { 4void matrix_init_kb(void) {
5 setPinOutput(CAPS_LOCK_LED_PIN); 5 gpio_set_pin_output(CAPS_LOCK_LED_PIN);
6 matrix_init_user(); 6 matrix_init_user();
7} 7}
8 8
9bool led_update_kb(led_t led_state) { 9bool led_update_kb(led_t led_state) {
10 // Only update if left half 10 // Only update if left half
11 if (isLeftHand && led_update_user(led_state)) { 11 if (isLeftHand && led_update_user(led_state)) {
12 writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock); 12 gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock);
13 } 13 }
14 return true; 14 return true;
15} 15}
diff --git a/keyboards/keebio/quefrency/rev3/rev3.c b/keyboards/keebio/quefrency/rev3/rev3.c
index d3ada3076f..74d68723f5 100644
--- a/keyboards/keebio/quefrency/rev3/rev3.c
+++ b/keyboards/keebio/quefrency/rev3/rev3.c
@@ -18,14 +18,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "split_util.h" 18#include "split_util.h"
19 19
20void matrix_init_kb(void) { 20void matrix_init_kb(void) {
21 setPinOutput(CAPS_LOCK_LED_PIN); 21 gpio_set_pin_output(CAPS_LOCK_LED_PIN);
22 matrix_init_user(); 22 matrix_init_user();
23} 23}
24 24
25bool led_update_kb(led_t led_state) { 25bool led_update_kb(led_t led_state) {
26 // Only update if left half 26 // Only update if left half
27 if (led_update_user(led_state) && isLeftHand) { 27 if (led_update_user(led_state) && isLeftHand) {
28 writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock); 28 gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock);
29 } 29 }
30 return true; 30 return true;
31} 31}
diff --git a/keyboards/keebio/sinc/sinc.c b/keyboards/keebio/sinc/sinc.c
index d50eb82019..c1ebd1a206 100644
--- a/keyboards/keebio/sinc/sinc.c
+++ b/keyboards/keebio/sinc/sinc.c
@@ -22,7 +22,7 @@ bool led_update_kb(led_t led_state) {
22 if (!led_update_user(led_state)) { return false; } 22 if (!led_update_user(led_state)) { return false; }
23 // Only update if left half 23 // Only update if left half
24 if (isLeftHand && led_update_user(led_state)) { 24 if (isLeftHand && led_update_user(led_state)) {
25 writePin(LED_CAPS_LOCK_PIN, !led_state.caps_lock); 25 gpio_write_pin(LED_CAPS_LOCK_PIN, !led_state.caps_lock);
26 } 26 }
27 return true; 27 return true;
28} 28}
diff --git a/keyboards/keychron/c2_pro/matrix.c b/keyboards/keychron/c2_pro/matrix.c
index 8c954c73d0..7d5b3e4e79 100644
--- a/keyboards/keychron/c2_pro/matrix.c
+++ b/keyboards/keychron/c2_pro/matrix.c
@@ -43,27 +43,27 @@ pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
43 43
44static inline void setPinOutput_writeLow(pin_t pin) { 44static inline void setPinOutput_writeLow(pin_t pin) {
45 ATOMIC_BLOCK_FORCEON { 45 ATOMIC_BLOCK_FORCEON {
46 setPinOutput(pin); 46 gpio_set_pin_output(pin);
47 writePinLow(pin); 47 gpio_write_pin_low(pin);
48 } 48 }
49} 49}
50 50
51static inline void setPinOutput_writeHigh(pin_t pin) { 51static inline void setPinOutput_writeHigh(pin_t pin) {
52 ATOMIC_BLOCK_FORCEON { 52 ATOMIC_BLOCK_FORCEON {
53 setPinOutput(pin); 53 gpio_set_pin_output(pin);
54 writePinHigh(pin); 54 gpio_write_pin_high(pin);
55 } 55 }
56} 56}
57 57
58static inline void setPinInput_high(pin_t pin) { 58static inline void setPinInput_high(pin_t pin) {
59 ATOMIC_BLOCK_FORCEON { 59 ATOMIC_BLOCK_FORCEON {
60 setPinInputHigh(pin); 60 gpio_set_pin_input_high(pin);
61 } 61 }
62} 62}
63 63
64static inline uint8_t readMatrixPin(pin_t pin) { 64static inline uint8_t readMatrixPin(pin_t pin) {
65 if (pin != NO_PIN) { 65 if (pin != NO_PIN) {
66 return readPin(pin); 66 return gpio_read_pin(pin);
67 } else { 67 } else {
68 return 1; 68 return 1;
69 } 69 }
@@ -81,13 +81,13 @@ static void HC595_output(SIZE_T data, uint8_t bit) {
81 ATOMIC_BLOCK_FORCEON { 81 ATOMIC_BLOCK_FORCEON {
82 for (uint8_t i = 0; i < (SHIFT_COL_END - SHIFT_COL_START + 1); i++) { 82 for (uint8_t i = 0; i < (SHIFT_COL_END - SHIFT_COL_START + 1); i++) {
83 if (data & 0x1) { 83 if (data & 0x1) {
84 writePinHigh(HC595_DS); 84 gpio_write_pin_high(HC595_DS);
85 } else { 85 } else {
86 writePinLow(HC595_DS); 86 gpio_write_pin_low(HC595_DS);
87 } 87 }
88 writePinHigh(HC595_SHCP); 88 gpio_write_pin_high(HC595_SHCP);
89 HC595_delay(n); 89 HC595_delay(n);
90 writePinLow(HC595_SHCP); 90 gpio_write_pin_low(HC595_SHCP);
91 HC595_delay(n); 91 HC595_delay(n);
92 if (bit) { 92 if (bit) {
93 break; 93 break;
@@ -95,9 +95,9 @@ static void HC595_output(SIZE_T data, uint8_t bit) {
95 data = data >> 1; 95 data = data >> 1;
96 } 96 }
97 } 97 }
98 writePinHigh(HC595_STCP); 98 gpio_write_pin_high(HC595_STCP);
99 HC595_delay(n); 99 HC595_delay(n);
100 writePinLow(HC595_STCP); 100 gpio_write_pin_low(HC595_STCP);
101 HC595_delay(n); 101 HC595_delay(n);
102 } 102 }
103} 103}
@@ -175,9 +175,9 @@ static void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t curre
175} 175}
176 176
177void matrix_init_custom(void) { 177void matrix_init_custom(void) {
178 setPinOutput(HC595_DS); 178 gpio_set_pin_output(HC595_DS);
179 setPinOutput(HC595_STCP); 179 gpio_set_pin_output(HC595_STCP);
180 setPinOutput(HC595_SHCP); 180 gpio_set_pin_output(HC595_SHCP);
181 181
182 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 182 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
183 if (row_pins[x] != NO_PIN) { 183 if (row_pins[x] != NO_PIN) {
diff --git a/keyboards/keychron/q10/matrix.c b/keyboards/keychron/q10/matrix.c
index 2c2d2ccc37..b772fd7889 100644
--- a/keyboards/keychron/q10/matrix.c
+++ b/keyboards/keychron/q10/matrix.c
@@ -36,27 +36,27 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
36 36
37static inline void setPinOutput_writeLow(pin_t pin) { 37static inline void setPinOutput_writeLow(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 setPinOutput(pin); 39 gpio_set_pin_output(pin);
40 writePinLow(pin); 40 gpio_write_pin_low(pin);
41 } 41 }
42} 42}
43 43
44static inline void setPinOutput_writeHigh(pin_t pin) { 44static inline void setPinOutput_writeHigh(pin_t pin) {
45 ATOMIC_BLOCK_FORCEON { 45 ATOMIC_BLOCK_FORCEON {
46 setPinOutput(pin); 46 gpio_set_pin_output(pin);
47 writePinHigh(pin); 47 gpio_write_pin_high(pin);
48 } 48 }
49} 49}
50 50
51static inline void setPinInputHigh_atomic(pin_t pin) { 51static inline void setPinInputHigh_atomic(pin_t pin) {
52 ATOMIC_BLOCK_FORCEON { 52 ATOMIC_BLOCK_FORCEON {
53 setPinInputHigh(pin); 53 gpio_set_pin_input_high(pin);
54 } 54 }
55} 55}
56 56
57static inline uint8_t readMatrixPin(pin_t pin) { 57static inline uint8_t readMatrixPin(pin_t pin) {
58 if (pin != NO_PIN) { 58 if (pin != NO_PIN) {
59 return readPin(pin); 59 return gpio_read_pin(pin);
60 } else { 60 } else {
61 return 1; 61 return 1;
62 } 62 }
diff --git a/keyboards/keychron/q11/q11.c b/keyboards/keychron/q11/q11.c
index f643113ea3..8d018e2a63 100755
--- a/keyboards/keychron/q11/q11.c
+++ b/keyboards/keychron/q11/q11.c
@@ -130,12 +130,12 @@ void keyboard_post_init_kb(void) {
130 // and disable USB connectivity when the ADC value exceeds 1000, 130 // and disable USB connectivity when the ADC value exceeds 1000,
131 // to avoid affecting the serial usart communication between the left hand and the right hand. 131 // to avoid affecting the serial usart communication between the left hand and the right hand.
132 if (is_keyboard_left()) { 132 if (is_keyboard_left()) {
133 setPinOutput(A0); 133 gpio_set_pin_output(A0);
134 writePinHigh(A0); 134 gpio_write_pin_high(A0);
135 } else { 135 } else {
136 if ((analogReadPin_my(B0) > 1000) || (analogReadPin_my(B1) > 1000)) { 136 if ((analogReadPin_my(B0) > 1000) || (analogReadPin_my(B1) > 1000)) {
137 setPinInput(A11); 137 gpio_set_pin_input(A11);
138 setPinInput(A12); 138 gpio_set_pin_input(A12);
139 } 139 }
140 } 140 }
141 141
diff --git a/keyboards/keychron/q12/matrix.c b/keyboards/keychron/q12/matrix.c
index cf8361bd23..9d5e9c4d39 100644
--- a/keyboards/keychron/q12/matrix.c
+++ b/keyboards/keychron/q12/matrix.c
@@ -36,27 +36,27 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
36 36
37static inline void setPinOutput_writeLow(pin_t pin) { 37static inline void setPinOutput_writeLow(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 setPinOutput(pin); 39 gpio_set_pin_output(pin);
40 writePinLow(pin); 40 gpio_write_pin_low(pin);
41 } 41 }
42} 42}
43 43
44static inline void setPinOutput_writeHigh(pin_t pin) { 44static inline void setPinOutput_writeHigh(pin_t pin) {
45 ATOMIC_BLOCK_FORCEON { 45 ATOMIC_BLOCK_FORCEON {
46 setPinOutput(pin); 46 gpio_set_pin_output(pin);
47 writePinHigh(pin); 47 gpio_write_pin_high(pin);
48 } 48 }
49} 49}
50 50
51static inline void setPinInputHigh_atomic(pin_t pin) { 51static inline void setPinInputHigh_atomic(pin_t pin) {
52 ATOMIC_BLOCK_FORCEON { 52 ATOMIC_BLOCK_FORCEON {
53 setPinInputHigh(pin); 53 gpio_set_pin_input_high(pin);
54 } 54 }
55} 55}
56 56
57static inline uint8_t readMatrixPin(pin_t pin) { 57static inline uint8_t readMatrixPin(pin_t pin) {
58 if (pin != NO_PIN) { 58 if (pin != NO_PIN) {
59 return readPin(pin); 59 return gpio_read_pin(pin);
60 } else { 60 } else {
61 return 1; 61 return 1;
62 } 62 }
diff --git a/keyboards/keychron/q1v2/matrix.c b/keyboards/keychron/q1v2/matrix.c
index 2bdf4bdec7..8e01bdb73e 100644
--- a/keyboards/keychron/q1v2/matrix.c
+++ b/keyboards/keychron/q1v2/matrix.c
@@ -36,27 +36,27 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
36 36
37static inline void setPinOutput_writeLow(pin_t pin) { 37static inline void setPinOutput_writeLow(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 setPinOutput(pin); 39 gpio_set_pin_output(pin);
40 writePinLow(pin); 40 gpio_write_pin_low(pin);
41 } 41 }
42} 42}
43 43
44static inline void setPinOutput_writeHigh(pin_t pin) { 44static inline void setPinOutput_writeHigh(pin_t pin) {
45 ATOMIC_BLOCK_FORCEON { 45 ATOMIC_BLOCK_FORCEON {
46 setPinOutput(pin); 46 gpio_set_pin_output(pin);
47 writePinHigh(pin); 47 gpio_write_pin_high(pin);
48 } 48 }
49} 49}
50 50
51static inline void setPinInputHigh_atomic(pin_t pin) { 51static inline void setPinInputHigh_atomic(pin_t pin) {
52 ATOMIC_BLOCK_FORCEON { 52 ATOMIC_BLOCK_FORCEON {
53 setPinInputHigh(pin); 53 gpio_set_pin_input_high(pin);
54 } 54 }
55} 55}
56 56
57static inline uint8_t readMatrixPin(pin_t pin) { 57static inline uint8_t readMatrixPin(pin_t pin) {
58 if (pin != NO_PIN) { 58 if (pin != NO_PIN) {
59 return readPin(pin); 59 return gpio_read_pin(pin);
60 } else { 60 } else {
61 return 1; 61 return 1;
62 } 62 }
diff --git a/keyboards/keychron/q3/matrix.c b/keyboards/keychron/q3/matrix.c
index 188156789b..25b3f6ed4e 100644
--- a/keyboards/keychron/q3/matrix.c
+++ b/keyboards/keychron/q3/matrix.c
@@ -36,27 +36,27 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
36 36
37static inline void setPinOutput_writeLow(pin_t pin) { 37static inline void setPinOutput_writeLow(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 setPinOutput(pin); 39 gpio_set_pin_output(pin);
40 writePinLow(pin); 40 gpio_write_pin_low(pin);
41 } 41 }
42} 42}
43 43
44static inline void setPinOutput_writeHigh(pin_t pin) { 44static inline void setPinOutput_writeHigh(pin_t pin) {
45 ATOMIC_BLOCK_FORCEON { 45 ATOMIC_BLOCK_FORCEON {
46 setPinOutput(pin); 46 gpio_set_pin_output(pin);
47 writePinHigh(pin); 47 gpio_write_pin_high(pin);
48 } 48 }
49} 49}
50 50
51static inline void setPinInputHigh_atomic(pin_t pin) { 51static inline void setPinInputHigh_atomic(pin_t pin) {
52 ATOMIC_BLOCK_FORCEON { 52 ATOMIC_BLOCK_FORCEON {
53 setPinInputHigh(pin); 53 gpio_set_pin_input_high(pin);
54 } 54 }
55} 55}
56 56
57static inline uint8_t readMatrixPin(pin_t pin) { 57static inline uint8_t readMatrixPin(pin_t pin) {
58 if (pin != NO_PIN) { 58 if (pin != NO_PIN) {
59 return readPin(pin); 59 return gpio_read_pin(pin);
60 } else { 60 } else {
61 return 1; 61 return 1;
62 } 62 }
diff --git a/keyboards/keychron/q5/matrix.c b/keyboards/keychron/q5/matrix.c
index 4809b20677..e7f69d9821 100644
--- a/keyboards/keychron/q5/matrix.c
+++ b/keyboards/keychron/q5/matrix.c
@@ -36,27 +36,27 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
36 36
37static inline void setPinOutput_writeLow(pin_t pin) { 37static inline void setPinOutput_writeLow(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 setPinOutput(pin); 39 gpio_set_pin_output(pin);
40 writePinLow(pin); 40 gpio_write_pin_low(pin);
41 } 41 }
42} 42}
43 43
44static inline void setPinOutput_writeHigh(pin_t pin) { 44static inline void setPinOutput_writeHigh(pin_t pin) {
45 ATOMIC_BLOCK_FORCEON { 45 ATOMIC_BLOCK_FORCEON {
46 setPinOutput(pin); 46 gpio_set_pin_output(pin);
47 writePinHigh(pin); 47 gpio_write_pin_high(pin);
48 } 48 }
49} 49}
50 50
51static inline void setPinInputHigh_atomic(pin_t pin) { 51static inline void setPinInputHigh_atomic(pin_t pin) {
52 ATOMIC_BLOCK_FORCEON { 52 ATOMIC_BLOCK_FORCEON {
53 setPinInputHigh(pin); 53 gpio_set_pin_input_high(pin);
54 } 54 }
55} 55}
56 56
57static inline uint8_t readMatrixPin(pin_t pin) { 57static inline uint8_t readMatrixPin(pin_t pin) {
58 if (pin != NO_PIN) { 58 if (pin != NO_PIN) {
59 return readPin(pin); 59 return gpio_read_pin(pin);
60 } else { 60 } else {
61 return 1; 61 return 1;
62 } 62 }
diff --git a/keyboards/keychron/q6/matrix.c b/keyboards/keychron/q6/matrix.c
index c59b229cfa..95e00405b4 100644
--- a/keyboards/keychron/q6/matrix.c
+++ b/keyboards/keychron/q6/matrix.c
@@ -48,27 +48,27 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
48 48
49static inline void setPinOutput_writeLow(pin_t pin) { 49static inline void setPinOutput_writeLow(pin_t pin) {
50 ATOMIC_BLOCK_FORCEON { 50 ATOMIC_BLOCK_FORCEON {
51 setPinOutput(pin); 51 gpio_set_pin_output(pin);
52 writePinLow(pin); 52 gpio_write_pin_low(pin);
53 } 53 }
54} 54}
55 55
56static inline void setPinOutput_writeHigh(pin_t pin) { 56static inline void setPinOutput_writeHigh(pin_t pin) {
57 ATOMIC_BLOCK_FORCEON { 57 ATOMIC_BLOCK_FORCEON {
58 setPinOutput(pin); 58 gpio_set_pin_output(pin);
59 writePinHigh(pin); 59 gpio_write_pin_high(pin);
60 } 60 }
61} 61}
62 62
63static inline void setPinInputHigh_atomic(pin_t pin) { 63static inline void setPinInputHigh_atomic(pin_t pin) {
64 ATOMIC_BLOCK_FORCEON { 64 ATOMIC_BLOCK_FORCEON {
65 setPinInputHigh(pin); 65 gpio_set_pin_input_high(pin);
66 } 66 }
67} 67}
68 68
69static inline uint8_t readMatrixPin(pin_t pin) { 69static inline uint8_t readMatrixPin(pin_t pin) {
70 if (pin != NO_PIN) { 70 if (pin != NO_PIN) {
71 return readPin(pin); 71 return gpio_read_pin(pin);
72 } else { 72 } else {
73 return 1; 73 return 1;
74 } 74 }
diff --git a/keyboards/keychron/q65/matrix.c b/keyboards/keychron/q65/matrix.c
index 206e301226..c9f9888689 100644
--- a/keyboards/keychron/q65/matrix.c
+++ b/keyboards/keychron/q65/matrix.c
@@ -36,32 +36,32 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
36 36
37static inline void writePinLow_atomic(pin_t pin) { 37static inline void writePinLow_atomic(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 writePinLow(pin); 39 gpio_write_pin_low(pin);
40 } 40 }
41} 41}
42 42
43static inline void writePinHigh_atomic(pin_t pin) { 43static inline void writePinHigh_atomic(pin_t pin) {
44 ATOMIC_BLOCK_FORCEON { 44 ATOMIC_BLOCK_FORCEON {
45 writePinHigh(pin); 45 gpio_write_pin_high(pin);
46 } 46 }
47} 47}
48 48
49static inline void setPinOutput_writeLow(pin_t pin) { 49static inline void setPinOutput_writeLow(pin_t pin) {
50 ATOMIC_BLOCK_FORCEON { 50 ATOMIC_BLOCK_FORCEON {
51 setPinOutput(pin); 51 gpio_set_pin_output(pin);
52 writePinLow(pin); 52 gpio_write_pin_low(pin);
53 } 53 }
54} 54}
55 55
56static inline void setPinInputHigh_atomic(pin_t pin) { 56static inline void setPinInputHigh_atomic(pin_t pin) {
57 ATOMIC_BLOCK_FORCEON { 57 ATOMIC_BLOCK_FORCEON {
58 setPinInputHigh(pin); 58 gpio_set_pin_input_high(pin);
59 } 59 }
60} 60}
61 61
62static inline uint8_t readMatrixPin(pin_t pin) { 62static inline uint8_t readMatrixPin(pin_t pin) {
63 if (pin != NO_PIN) { 63 if (pin != NO_PIN) {
64 return readPin(pin); 64 return gpio_read_pin(pin);
65 } else { 65 } else {
66 return 1; 66 return 1;
67 } 67 }
@@ -76,20 +76,20 @@ static void shiftOut(uint8_t dataOut) {
76 for (uint8_t i = 0; i < 8; i++) { 76 for (uint8_t i = 0; i < 8; i++) {
77 compiler_barrier(); 77 compiler_barrier();
78 if (dataOut & 0x1) { 78 if (dataOut & 0x1) {
79 writePinHigh(DATA_PIN); 79 gpio_write_pin_high(DATA_PIN);
80 } else { 80 } else {
81 writePinLow(DATA_PIN); 81 gpio_write_pin_low(DATA_PIN);
82 } 82 }
83 dataOut = dataOut >> 1; 83 dataOut = dataOut >> 1;
84 compiler_barrier(); 84 compiler_barrier();
85 writePinHigh(CLOCK_PIN); 85 gpio_write_pin_high(CLOCK_PIN);
86 small_delay(); 86 small_delay();
87 writePinLow(CLOCK_PIN); 87 gpio_write_pin_low(CLOCK_PIN);
88 } 88 }
89 compiler_barrier(); 89 compiler_barrier();
90 writePinHigh(LATCH_PIN); 90 gpio_write_pin_high(LATCH_PIN);
91 small_delay(); 91 small_delay();
92 writePinLow(LATCH_PIN); 92 gpio_write_pin_low(LATCH_PIN);
93 compiler_barrier(); 93 compiler_barrier();
94 } 94 }
95} 95}
@@ -98,18 +98,18 @@ static void shiftout_single(uint8_t data) {
98 ATOMIC_BLOCK_FORCEON { 98 ATOMIC_BLOCK_FORCEON {
99 compiler_barrier(); 99 compiler_barrier();
100 if (data & 0x1) { 100 if (data & 0x1) {
101 writePinHigh(DATA_PIN); 101 gpio_write_pin_high(DATA_PIN);
102 } else { 102 } else {
103 writePinLow(DATA_PIN); 103 gpio_write_pin_low(DATA_PIN);
104 } 104 }
105 compiler_barrier(); 105 compiler_barrier();
106 writePinHigh(CLOCK_PIN); 106 gpio_write_pin_high(CLOCK_PIN);
107 small_delay(); 107 small_delay();
108 writePinLow(CLOCK_PIN); 108 gpio_write_pin_low(CLOCK_PIN);
109 compiler_barrier(); 109 compiler_barrier();
110 writePinHigh(LATCH_PIN); 110 gpio_write_pin_high(LATCH_PIN);
111 small_delay(); 111 small_delay();
112 writePinLow(LATCH_PIN); 112 gpio_write_pin_low(LATCH_PIN);
113 compiler_barrier(); 113 compiler_barrier();
114 } 114 }
115} 115}
@@ -165,13 +165,13 @@ static void unselect_cols(void) {
165} 165}
166 166
167static void matrix_init_pins(void) { 167static void matrix_init_pins(void) {
168 setPinOutput(DATA_PIN); 168 gpio_set_pin_output(DATA_PIN);
169 setPinOutput(CLOCK_PIN); 169 gpio_set_pin_output(CLOCK_PIN);
170 setPinOutput(LATCH_PIN); 170 gpio_set_pin_output(LATCH_PIN);
171#ifdef MATRIX_UNSELECT_DRIVE_HIGH 171#ifdef MATRIX_UNSELECT_DRIVE_HIGH
172 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 172 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
173 if (col_pins[x] != NO_PIN) { 173 if (col_pins[x] != NO_PIN) {
174 setPinOutput(col_pins[x]); 174 gpio_set_pin_output(col_pins[x]);
175 } 175 }
176 } 176 }
177#endif 177#endif
diff --git a/keyboards/keychron/v1/matrix.c b/keyboards/keychron/v1/matrix.c
index 7b9136d490..32d9cfdbb0 100644
--- a/keyboards/keychron/v1/matrix.c
+++ b/keyboards/keychron/v1/matrix.c
@@ -36,27 +36,27 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
36 36
37static inline void setPinOutput_writeLow(pin_t pin) { 37static inline void setPinOutput_writeLow(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 setPinOutput(pin); 39 gpio_set_pin_output(pin);
40 writePinLow(pin); 40 gpio_write_pin_low(pin);
41 } 41 }
42} 42}
43 43
44static inline void setPinOutput_writeHigh(pin_t pin) { 44static inline void setPinOutput_writeHigh(pin_t pin) {
45 ATOMIC_BLOCK_FORCEON { 45 ATOMIC_BLOCK_FORCEON {
46 setPinOutput(pin); 46 gpio_set_pin_output(pin);
47 writePinHigh(pin); 47 gpio_write_pin_high(pin);
48 } 48 }
49} 49}
50 50
51static inline void setPinInputHigh_atomic(pin_t pin) { 51static inline void setPinInputHigh_atomic(pin_t pin) {
52 ATOMIC_BLOCK_FORCEON { 52 ATOMIC_BLOCK_FORCEON {
53 setPinInputHigh(pin); 53 gpio_set_pin_input_high(pin);
54 } 54 }
55} 55}
56 56
57static inline uint8_t readMatrixPin(pin_t pin) { 57static inline uint8_t readMatrixPin(pin_t pin) {
58 if (pin != NO_PIN) { 58 if (pin != NO_PIN) {
59 return readPin(pin); 59 return gpio_read_pin(pin);
60 } else { 60 } else {
61 return 1; 61 return 1;
62 } 62 }
@@ -71,20 +71,20 @@ static void shiftOut(uint8_t dataOut) {
71 for (uint8_t i = 0; i < 8; i++) { 71 for (uint8_t i = 0; i < 8; i++) {
72 compiler_barrier(); 72 compiler_barrier();
73 if (dataOut & 0x1) { 73 if (dataOut & 0x1) {
74 writePinHigh(DATA_PIN); 74 gpio_write_pin_high(DATA_PIN);
75 } else { 75 } else {
76 writePinLow(DATA_PIN); 76 gpio_write_pin_low(DATA_PIN);
77 } 77 }
78 dataOut = dataOut >> 1; 78 dataOut = dataOut >> 1;
79 compiler_barrier(); 79 compiler_barrier();
80 writePinHigh(CLOCK_PIN); 80 gpio_write_pin_high(CLOCK_PIN);
81 small_delay(); 81 small_delay();
82 writePinLow(CLOCK_PIN); 82 gpio_write_pin_low(CLOCK_PIN);
83 } 83 }
84 compiler_barrier(); 84 compiler_barrier();
85 writePinHigh(LATCH_PIN); 85 gpio_write_pin_high(LATCH_PIN);
86 small_delay(); 86 small_delay();
87 writePinLow(LATCH_PIN); 87 gpio_write_pin_low(LATCH_PIN);
88 compiler_barrier(); 88 compiler_barrier();
89 } 89 }
90} 90}
@@ -93,18 +93,18 @@ static void shiftOut_single(uint8_t data) {
93 ATOMIC_BLOCK_FORCEON { 93 ATOMIC_BLOCK_FORCEON {
94 compiler_barrier(); 94 compiler_barrier();
95 if (data & 0x1) { 95 if (data & 0x1) {
96 writePinHigh(DATA_PIN); 96 gpio_write_pin_high(DATA_PIN);
97 } else { 97 } else {
98 writePinLow(DATA_PIN); 98 gpio_write_pin_low(DATA_PIN);
99 } 99 }
100 compiler_barrier(); 100 compiler_barrier();
101 writePinHigh(CLOCK_PIN); 101 gpio_write_pin_high(CLOCK_PIN);
102 small_delay(); 102 small_delay();
103 writePinLow(CLOCK_PIN); 103 gpio_write_pin_low(CLOCK_PIN);
104 compiler_barrier(); 104 compiler_barrier();
105 writePinHigh(LATCH_PIN); 105 gpio_write_pin_high(LATCH_PIN);
106 small_delay(); 106 small_delay();
107 writePinLow(LATCH_PIN); 107 gpio_write_pin_low(LATCH_PIN);
108 compiler_barrier(); 108 compiler_barrier();
109 } 109 }
110} 110}
@@ -156,13 +156,13 @@ static void unselect_cols(void) {
156} 156}
157 157
158static void matrix_init_pins(void) { 158static void matrix_init_pins(void) {
159 setPinOutput(DATA_PIN); 159 gpio_set_pin_output(DATA_PIN);
160 setPinOutput(CLOCK_PIN); 160 gpio_set_pin_output(CLOCK_PIN);
161 setPinOutput(LATCH_PIN); 161 gpio_set_pin_output(LATCH_PIN);
162#ifdef MATRIX_UNSELECT_DRIVE_HIGH 162#ifdef MATRIX_UNSELECT_DRIVE_HIGH
163 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 163 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
164 if (col_pins[x] != NO_PIN) { 164 if (col_pins[x] != NO_PIN) {
165 setPinOutput(col_pins[x]); 165 gpio_set_pin_output(col_pins[x]);
166 } 166 }
167 } 167 }
168#endif 168#endif
diff --git a/keyboards/keychron/v10/matrix.c b/keyboards/keychron/v10/matrix.c
index 87cda1774a..bb6504fa78 100644
--- a/keyboards/keychron/v10/matrix.c
+++ b/keyboards/keychron/v10/matrix.c
@@ -36,27 +36,27 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
36 36
37static inline void setPinOutput_writeLow(pin_t pin) { 37static inline void setPinOutput_writeLow(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 setPinOutput(pin); 39 gpio_set_pin_output(pin);
40 writePinLow(pin); 40 gpio_write_pin_low(pin);
41 } 41 }
42} 42}
43 43
44static inline void setPinOutput_writeHigh(pin_t pin) { 44static inline void setPinOutput_writeHigh(pin_t pin) {
45 ATOMIC_BLOCK_FORCEON { 45 ATOMIC_BLOCK_FORCEON {
46 setPinOutput(pin); 46 gpio_set_pin_output(pin);
47 writePinHigh(pin); 47 gpio_write_pin_high(pin);
48 } 48 }
49} 49}
50 50
51static inline void setPinInputHigh_atomic(pin_t pin) { 51static inline void setPinInputHigh_atomic(pin_t pin) {
52 ATOMIC_BLOCK_FORCEON { 52 ATOMIC_BLOCK_FORCEON {
53 setPinInputHigh(pin); 53 gpio_set_pin_input_high(pin);
54 } 54 }
55} 55}
56 56
57static inline uint8_t readMatrixPin(pin_t pin) { 57static inline uint8_t readMatrixPin(pin_t pin) {
58 if (pin != NO_PIN) { 58 if (pin != NO_PIN) {
59 return readPin(pin); 59 return gpio_read_pin(pin);
60 } else { 60 } else {
61 return 1; 61 return 1;
62 } 62 }
@@ -70,34 +70,34 @@ static void shiftOut(uint16_t dataOut) {
70 ATOMIC_BLOCK_FORCEON { 70 ATOMIC_BLOCK_FORCEON {
71 for (uint8_t i = 0; i < PIN_USED_74HC595; i++) { 71 for (uint8_t i = 0; i < PIN_USED_74HC595; i++) {
72 if (dataOut & 0x1) { 72 if (dataOut & 0x1) {
73 writePinHigh(DATA_PIN_74HC595); 73 gpio_write_pin_high(DATA_PIN_74HC595);
74 } else { 74 } else {
75 writePinLow(DATA_PIN_74HC595); 75 gpio_write_pin_low(DATA_PIN_74HC595);
76 } 76 }
77 dataOut = dataOut >> 1; 77 dataOut = dataOut >> 1;
78 writePinHigh(CLOCK_PIN_74HC595); 78 gpio_write_pin_high(CLOCK_PIN_74HC595);
79 small_delay(2); 79 small_delay(2);
80 writePinLow(CLOCK_PIN_74HC595); 80 gpio_write_pin_low(CLOCK_PIN_74HC595);
81 } 81 }
82 writePinHigh(LATCH_PIN_74HC595); 82 gpio_write_pin_high(LATCH_PIN_74HC595);
83 small_delay(2); 83 small_delay(2);
84 writePinLow(LATCH_PIN_74HC595); 84 gpio_write_pin_low(LATCH_PIN_74HC595);
85 } 85 }
86} 86}
87 87
88static void shiftOut_single(uint8_t data) { 88static void shiftOut_single(uint8_t data) {
89 ATOMIC_BLOCK_FORCEON { 89 ATOMIC_BLOCK_FORCEON {
90 if (data & 0x1) { 90 if (data & 0x1) {
91 writePinHigh(DATA_PIN_74HC595); 91 gpio_write_pin_high(DATA_PIN_74HC595);
92 } else { 92 } else {
93 writePinLow(DATA_PIN_74HC595); 93 gpio_write_pin_low(DATA_PIN_74HC595);
94 } 94 }
95 writePinHigh(CLOCK_PIN_74HC595); 95 gpio_write_pin_high(CLOCK_PIN_74HC595);
96 small_delay(2); 96 small_delay(2);
97 writePinLow(CLOCK_PIN_74HC595); 97 gpio_write_pin_low(CLOCK_PIN_74HC595);
98 writePinHigh(LATCH_PIN_74HC595); 98 gpio_write_pin_high(LATCH_PIN_74HC595);
99 small_delay(2); 99 small_delay(2);
100 writePinLow(LATCH_PIN_74HC595); 100 gpio_write_pin_low(LATCH_PIN_74HC595);
101 } 101 }
102} 102}
103 103
@@ -149,13 +149,13 @@ static void unselect_cols(void) {
149} 149}
150 150
151static void matrix_init_pins(void) { 151static void matrix_init_pins(void) {
152 setPinOutput(DATA_PIN_74HC595); 152 gpio_set_pin_output(DATA_PIN_74HC595);
153 setPinOutput(CLOCK_PIN_74HC595); 153 gpio_set_pin_output(CLOCK_PIN_74HC595);
154 setPinOutput(LATCH_PIN_74HC595); 154 gpio_set_pin_output(LATCH_PIN_74HC595);
155#ifdef MATRIX_UNSELECT_DRIVE_HIGH 155#ifdef MATRIX_UNSELECT_DRIVE_HIGH
156 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 156 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
157 if (col_pins[x] != NO_PIN) { 157 if (col_pins[x] != NO_PIN) {
158 setPinOutput(col_pins[x]); 158 gpio_set_pin_output(col_pins[x]);
159 } 159 }
160 } 160 }
161#endif 161#endif
diff --git a/keyboards/keychron/v3/matrix.c b/keyboards/keychron/v3/matrix.c
index c0c39d5b5f..5ee860afd2 100644
--- a/keyboards/keychron/v3/matrix.c
+++ b/keyboards/keychron/v3/matrix.c
@@ -36,27 +36,27 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
36 36
37static inline void setPinOutput_writeLow(pin_t pin) { 37static inline void setPinOutput_writeLow(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 setPinOutput(pin); 39 gpio_set_pin_output(pin);
40 writePinLow(pin); 40 gpio_write_pin_low(pin);
41 } 41 }
42} 42}
43 43
44static inline void setPinOutput_writeHigh(pin_t pin) { 44static inline void setPinOutput_writeHigh(pin_t pin) {
45 ATOMIC_BLOCK_FORCEON { 45 ATOMIC_BLOCK_FORCEON {
46 setPinOutput(pin); 46 gpio_set_pin_output(pin);
47 writePinHigh(pin); 47 gpio_write_pin_high(pin);
48 } 48 }
49} 49}
50 50
51static inline void setPinInputHigh_atomic(pin_t pin) { 51static inline void setPinInputHigh_atomic(pin_t pin) {
52 ATOMIC_BLOCK_FORCEON { 52 ATOMIC_BLOCK_FORCEON {
53 setPinInputHigh(pin); 53 gpio_set_pin_input_high(pin);
54 } 54 }
55} 55}
56 56
57static inline uint8_t readMatrixPin(pin_t pin) { 57static inline uint8_t readMatrixPin(pin_t pin) {
58 if (pin != NO_PIN) { 58 if (pin != NO_PIN) {
59 return readPin(pin); 59 return gpio_read_pin(pin);
60 } else { 60 } else {
61 return 1; 61 return 1;
62 } 62 }
@@ -71,20 +71,20 @@ static void shiftOut(uint8_t dataOut) {
71 for (uint8_t i = 0; i < 8; i++) { 71 for (uint8_t i = 0; i < 8; i++) {
72 compiler_barrier(); 72 compiler_barrier();
73 if (dataOut & 0x1) { 73 if (dataOut & 0x1) {
74 writePinHigh(DATA_PIN); 74 gpio_write_pin_high(DATA_PIN);
75 } else { 75 } else {
76 writePinLow(DATA_PIN); 76 gpio_write_pin_low(DATA_PIN);
77 } 77 }
78 dataOut = dataOut >> 1; 78 dataOut = dataOut >> 1;
79 compiler_barrier(); 79 compiler_barrier();
80 writePinHigh(CLOCK_PIN); 80 gpio_write_pin_high(CLOCK_PIN);
81 small_delay(); 81 small_delay();
82 writePinLow(CLOCK_PIN); 82 gpio_write_pin_low(CLOCK_PIN);
83 } 83 }
84 compiler_barrier(); 84 compiler_barrier();
85 writePinHigh(LATCH_PIN); 85 gpio_write_pin_high(LATCH_PIN);
86 small_delay(); 86 small_delay();
87 writePinLow(LATCH_PIN); 87 gpio_write_pin_low(LATCH_PIN);
88 compiler_barrier(); 88 compiler_barrier();
89 } 89 }
90} 90}
@@ -93,18 +93,18 @@ static void shiftOut_single(uint8_t data) {
93 ATOMIC_BLOCK_FORCEON { 93 ATOMIC_BLOCK_FORCEON {
94 compiler_barrier(); 94 compiler_barrier();
95 if (data & 0x1) { 95 if (data & 0x1) {
96 writePinHigh(DATA_PIN); 96 gpio_write_pin_high(DATA_PIN);
97 } else { 97 } else {
98 writePinLow(DATA_PIN); 98 gpio_write_pin_low(DATA_PIN);
99 } 99 }
100 compiler_barrier(); 100 compiler_barrier();
101 writePinHigh(CLOCK_PIN); 101 gpio_write_pin_high(CLOCK_PIN);
102 small_delay(); 102 small_delay();
103 writePinLow(CLOCK_PIN); 103 gpio_write_pin_low(CLOCK_PIN);
104 compiler_barrier(); 104 compiler_barrier();
105 writePinHigh(LATCH_PIN); 105 gpio_write_pin_high(LATCH_PIN);
106 small_delay(); 106 small_delay();
107 writePinLow(LATCH_PIN); 107 gpio_write_pin_low(LATCH_PIN);
108 compiler_barrier(); 108 compiler_barrier();
109 } 109 }
110} 110}
@@ -156,13 +156,13 @@ static void unselect_cols(void) {
156} 156}
157 157
158static void matrix_init_pins(void) { 158static void matrix_init_pins(void) {
159 setPinOutput(DATA_PIN); 159 gpio_set_pin_output(DATA_PIN);
160 setPinOutput(CLOCK_PIN); 160 gpio_set_pin_output(CLOCK_PIN);
161 setPinOutput(LATCH_PIN); 161 gpio_set_pin_output(LATCH_PIN);
162#ifdef MATRIX_UNSELECT_DRIVE_HIGH 162#ifdef MATRIX_UNSELECT_DRIVE_HIGH
163 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 163 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
164 if (col_pins[x] != NO_PIN) { 164 if (col_pins[x] != NO_PIN) {
165 setPinOutput(col_pins[x]); 165 gpio_set_pin_output(col_pins[x]);
166 } 166 }
167 } 167 }
168#endif 168#endif
diff --git a/keyboards/keychron/v5/matrix.c b/keyboards/keychron/v5/matrix.c
index fc3a1c4c2c..255201af12 100644
--- a/keyboards/keychron/v5/matrix.c
+++ b/keyboards/keychron/v5/matrix.c
@@ -36,27 +36,27 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
36 36
37static inline void setPinOutput_writeLow(pin_t pin) { 37static inline void setPinOutput_writeLow(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 setPinOutput(pin); 39 gpio_set_pin_output(pin);
40 writePinLow(pin); 40 gpio_write_pin_low(pin);
41 } 41 }
42} 42}
43 43
44static inline void setPinOutput_writeHigh(pin_t pin) { 44static inline void setPinOutput_writeHigh(pin_t pin) {
45 ATOMIC_BLOCK_FORCEON { 45 ATOMIC_BLOCK_FORCEON {
46 setPinOutput(pin); 46 gpio_set_pin_output(pin);
47 writePinHigh(pin); 47 gpio_write_pin_high(pin);
48 } 48 }
49} 49}
50 50
51static inline void setPinInputHigh_atomic(pin_t pin) { 51static inline void setPinInputHigh_atomic(pin_t pin) {
52 ATOMIC_BLOCK_FORCEON { 52 ATOMIC_BLOCK_FORCEON {
53 setPinInputHigh(pin); 53 gpio_set_pin_input_high(pin);
54 } 54 }
55} 55}
56 56
57static inline uint8_t readMatrixPin(pin_t pin) { 57static inline uint8_t readMatrixPin(pin_t pin) {
58 if (pin != NO_PIN) { 58 if (pin != NO_PIN) {
59 return readPin(pin); 59 return gpio_read_pin(pin);
60 } else { 60 } else {
61 return 1; 61 return 1;
62 } 62 }
@@ -71,20 +71,20 @@ static void shiftOut(uint8_t dataOut) {
71 for (uint8_t i = 0; i < 8; i++) { 71 for (uint8_t i = 0; i < 8; i++) {
72 compiler_barrier(); 72 compiler_barrier();
73 if (dataOut & 0x1) { 73 if (dataOut & 0x1) {
74 writePinHigh(DATA_PIN); 74 gpio_write_pin_high(DATA_PIN);
75 } else { 75 } else {
76 writePinLow(DATA_PIN); 76 gpio_write_pin_low(DATA_PIN);
77 } 77 }
78 dataOut = dataOut >> 1; 78 dataOut = dataOut >> 1;
79 compiler_barrier(); 79 compiler_barrier();
80 writePinHigh(CLOCK_PIN); 80 gpio_write_pin_high(CLOCK_PIN);
81 small_delay(); 81 small_delay();
82 writePinLow(CLOCK_PIN); 82 gpio_write_pin_low(CLOCK_PIN);
83 } 83 }
84 compiler_barrier(); 84 compiler_barrier();
85 writePinHigh(LATCH_PIN); 85 gpio_write_pin_high(LATCH_PIN);
86 small_delay(); 86 small_delay();
87 writePinLow(LATCH_PIN); 87 gpio_write_pin_low(LATCH_PIN);
88 compiler_barrier(); 88 compiler_barrier();
89 } 89 }
90} 90}
@@ -93,18 +93,18 @@ static void shiftOut_single(uint8_t data) {
93 ATOMIC_BLOCK_FORCEON { 93 ATOMIC_BLOCK_FORCEON {
94 compiler_barrier(); 94 compiler_barrier();
95 if (data & 0x1) { 95 if (data & 0x1) {
96 writePinHigh(DATA_PIN); 96 gpio_write_pin_high(DATA_PIN);
97 } else { 97 } else {
98 writePinLow(DATA_PIN); 98 gpio_write_pin_low(DATA_PIN);
99 } 99 }
100 compiler_barrier(); 100 compiler_barrier();
101 writePinHigh(CLOCK_PIN); 101 gpio_write_pin_high(CLOCK_PIN);
102 small_delay(); 102 small_delay();
103 writePinLow(CLOCK_PIN); 103 gpio_write_pin_low(CLOCK_PIN);
104 compiler_barrier(); 104 compiler_barrier();
105 writePinHigh(LATCH_PIN); 105 gpio_write_pin_high(LATCH_PIN);
106 small_delay(); 106 small_delay();
107 writePinLow(LATCH_PIN); 107 gpio_write_pin_low(LATCH_PIN);
108 compiler_barrier(); 108 compiler_barrier();
109 } 109 }
110} 110}
@@ -156,13 +156,13 @@ static void unselect_cols(void) {
156} 156}
157 157
158static void matrix_init_pins(void) { 158static void matrix_init_pins(void) {
159 setPinOutput(DATA_PIN); 159 gpio_set_pin_output(DATA_PIN);
160 setPinOutput(CLOCK_PIN); 160 gpio_set_pin_output(CLOCK_PIN);
161 setPinOutput(LATCH_PIN); 161 gpio_set_pin_output(LATCH_PIN);
162#ifdef MATRIX_UNSELECT_DRIVE_HIGH 162#ifdef MATRIX_UNSELECT_DRIVE_HIGH
163 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 163 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
164 if (col_pins[x] != NO_PIN) { 164 if (col_pins[x] != NO_PIN) {
165 setPinOutput(col_pins[x]); 165 gpio_set_pin_output(col_pins[x]);
166 } 166 }
167 } 167 }
168#endif 168#endif
diff --git a/keyboards/keychron/v6/matrix.c b/keyboards/keychron/v6/matrix.c
index 87cda1774a..bb6504fa78 100644
--- a/keyboards/keychron/v6/matrix.c
+++ b/keyboards/keychron/v6/matrix.c
@@ -36,27 +36,27 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
36 36
37static inline void setPinOutput_writeLow(pin_t pin) { 37static inline void setPinOutput_writeLow(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 setPinOutput(pin); 39 gpio_set_pin_output(pin);
40 writePinLow(pin); 40 gpio_write_pin_low(pin);
41 } 41 }
42} 42}
43 43
44static inline void setPinOutput_writeHigh(pin_t pin) { 44static inline void setPinOutput_writeHigh(pin_t pin) {
45 ATOMIC_BLOCK_FORCEON { 45 ATOMIC_BLOCK_FORCEON {
46 setPinOutput(pin); 46 gpio_set_pin_output(pin);
47 writePinHigh(pin); 47 gpio_write_pin_high(pin);
48 } 48 }
49} 49}
50 50
51static inline void setPinInputHigh_atomic(pin_t pin) { 51static inline void setPinInputHigh_atomic(pin_t pin) {
52 ATOMIC_BLOCK_FORCEON { 52 ATOMIC_BLOCK_FORCEON {
53 setPinInputHigh(pin); 53 gpio_set_pin_input_high(pin);
54 } 54 }
55} 55}
56 56
57static inline uint8_t readMatrixPin(pin_t pin) { 57static inline uint8_t readMatrixPin(pin_t pin) {
58 if (pin != NO_PIN) { 58 if (pin != NO_PIN) {
59 return readPin(pin); 59 return gpio_read_pin(pin);
60 } else { 60 } else {
61 return 1; 61 return 1;
62 } 62 }
@@ -70,34 +70,34 @@ static void shiftOut(uint16_t dataOut) {
70 ATOMIC_BLOCK_FORCEON { 70 ATOMIC_BLOCK_FORCEON {
71 for (uint8_t i = 0; i < PIN_USED_74HC595; i++) { 71 for (uint8_t i = 0; i < PIN_USED_74HC595; i++) {
72 if (dataOut & 0x1) { 72 if (dataOut & 0x1) {
73 writePinHigh(DATA_PIN_74HC595); 73 gpio_write_pin_high(DATA_PIN_74HC595);
74 } else { 74 } else {
75 writePinLow(DATA_PIN_74HC595); 75 gpio_write_pin_low(DATA_PIN_74HC595);
76 } 76 }
77 dataOut = dataOut >> 1; 77 dataOut = dataOut >> 1;
78 writePinHigh(CLOCK_PIN_74HC595); 78 gpio_write_pin_high(CLOCK_PIN_74HC595);
79 small_delay(2); 79 small_delay(2);
80 writePinLow(CLOCK_PIN_74HC595); 80 gpio_write_pin_low(CLOCK_PIN_74HC595);
81 } 81 }
82 writePinHigh(LATCH_PIN_74HC595); 82 gpio_write_pin_high(LATCH_PIN_74HC595);
83 small_delay(2); 83 small_delay(2);
84 writePinLow(LATCH_PIN_74HC595); 84 gpio_write_pin_low(LATCH_PIN_74HC595);
85 } 85 }
86} 86}
87 87
88static void shiftOut_single(uint8_t data) { 88static void shiftOut_single(uint8_t data) {
89 ATOMIC_BLOCK_FORCEON { 89 ATOMIC_BLOCK_FORCEON {
90 if (data & 0x1) { 90 if (data & 0x1) {
91 writePinHigh(DATA_PIN_74HC595); 91 gpio_write_pin_high(DATA_PIN_74HC595);
92 } else { 92 } else {
93 writePinLow(DATA_PIN_74HC595); 93 gpio_write_pin_low(DATA_PIN_74HC595);
94 } 94 }
95 writePinHigh(CLOCK_PIN_74HC595); 95 gpio_write_pin_high(CLOCK_PIN_74HC595);
96 small_delay(2); 96 small_delay(2);
97 writePinLow(CLOCK_PIN_74HC595); 97 gpio_write_pin_low(CLOCK_PIN_74HC595);
98 writePinHigh(LATCH_PIN_74HC595); 98 gpio_write_pin_high(LATCH_PIN_74HC595);
99 small_delay(2); 99 small_delay(2);
100 writePinLow(LATCH_PIN_74HC595); 100 gpio_write_pin_low(LATCH_PIN_74HC595);
101 } 101 }
102} 102}
103 103
@@ -149,13 +149,13 @@ static void unselect_cols(void) {
149} 149}
150 150
151static void matrix_init_pins(void) { 151static void matrix_init_pins(void) {
152 setPinOutput(DATA_PIN_74HC595); 152 gpio_set_pin_output(DATA_PIN_74HC595);
153 setPinOutput(CLOCK_PIN_74HC595); 153 gpio_set_pin_output(CLOCK_PIN_74HC595);
154 setPinOutput(LATCH_PIN_74HC595); 154 gpio_set_pin_output(LATCH_PIN_74HC595);
155#ifdef MATRIX_UNSELECT_DRIVE_HIGH 155#ifdef MATRIX_UNSELECT_DRIVE_HIGH
156 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 156 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
157 if (col_pins[x] != NO_PIN) { 157 if (col_pins[x] != NO_PIN) {
158 setPinOutput(col_pins[x]); 158 gpio_set_pin_output(col_pins[x]);
159 } 159 }
160 } 160 }
161#endif 161#endif
diff --git a/keyboards/keyhive/honeycomb/honeycomb.c b/keyboards/keyhive/honeycomb/honeycomb.c
index 6acc649e0d..b890ee08bf 100755
--- a/keyboards/keyhive/honeycomb/honeycomb.c
+++ b/keyboards/keyhive/honeycomb/honeycomb.c
@@ -60,12 +60,12 @@ bool pointing_device_task(void){
60} 60}
61 61
62void led_init(void) { 62void led_init(void) {
63 setPinOutput(D1); 63 gpio_set_pin_output(D1);
64 writePinHigh(D1); 64 gpio_write_pin_high(D1);
65 setPinOutput(F4); 65 gpio_set_pin_output(F4);
66 writePinHigh(F4); 66 gpio_write_pin_high(F4);
67 setPinOutput(F5); 67 gpio_set_pin_output(F5);
68 writePinHigh(F5); 68 gpio_write_pin_high(F5);
69} 69}
70 70
71void matrix_init_kb(void) { 71void matrix_init_kb(void) {
diff --git a/keyboards/keyhive/honeycomb/honeycomb.h b/keyboards/keyhive/honeycomb/honeycomb.h
index 0418dee767..3551e4a3af 100755
--- a/keyboards/keyhive/honeycomb/honeycomb.h
+++ b/keyboards/keyhive/honeycomb/honeycomb.h
@@ -2,12 +2,12 @@
2 2
3#include "quantum.h" 3#include "quantum.h"
4 4
5#define RED_LED_OFF() writePinHigh(F6) 5#define RED_LED_OFF() gpio_write_pin_high(F6)
6#define RED_LED_ON() writePinLow(F6) 6#define RED_LED_ON() gpio_write_pin_low(F6)
7#define BLU_LED_OFF() writePinHigh(F5) 7#define BLU_LED_OFF() gpio_write_pin_high(F5)
8#define BLU_LED_ON() writePinLow(F5) 8#define BLU_LED_ON() gpio_write_pin_low(F5)
9#define GRN_LED_OFF() writePinHigh(D1) 9#define GRN_LED_OFF() gpio_write_pin_high(D1)
10#define GRN_LED_ON() writePinLow(D1) 10#define GRN_LED_ON() gpio_write_pin_low(D1)
11 11
12#define SET_LED_OFF (RED_LED_OFF(); GRN_LED_OFF(); BLU_LED_OFF(); ) 12#define SET_LED_OFF (RED_LED_OFF(); GRN_LED_OFF(); BLU_LED_OFF(); )
13#define SET_LED_RED (RED_LED_ON(); GRN_LED_OFF(); BLU_LED_OFF(); ) 13#define SET_LED_RED (RED_LED_ON(); GRN_LED_OFF(); BLU_LED_OFF(); )
diff --git a/keyboards/keyhive/lattice60/lattice60.c b/keyboards/keyhive/lattice60/lattice60.c
index 7a5450a678..ab5f1880d5 100644
--- a/keyboards/keyhive/lattice60/lattice60.c
+++ b/keyboards/keyhive/lattice60/lattice60.c
@@ -21,8 +21,8 @@
21 21
22void keyboard_pre_init_kb(void){ 22void keyboard_pre_init_kb(void){
23 //init the LED pins as outputs 23 //init the LED pins as outputs
24 setPinOutput(LED1_PIN); 24 gpio_set_pin_output(LED1_PIN);
25 setPinOutput(LED2_PIN); 25 gpio_set_pin_output(LED2_PIN);
26 //call any user initialization code 26 //call any user initialization code
27 keyboard_pre_init_user(); 27 keyboard_pre_init_user();
28} 28}
@@ -31,7 +31,7 @@ bool led_update_kb(led_t led_state) {
31 bool res = led_update_user(led_state); 31 bool res = led_update_user(led_state);
32 if(res){ 32 if(res){
33 //write the CAPS LOCK state on LED1 33 //write the CAPS LOCK state on LED1
34 writePin(LED1_PIN, led_state.caps_lock); 34 gpio_write_pin(LED1_PIN, led_state.caps_lock);
35 } 35 }
36 return res; 36 return res;
37} 37}
diff --git a/keyboards/keyhive/navi10/rev0/rev0.c b/keyboards/keyhive/navi10/rev0/rev0.c
index 1eefa5cd91..d8c0e81348 100644
--- a/keyboards/keyhive/navi10/rev0/rev0.c
+++ b/keyboards/keyhive/navi10/rev0/rev0.c
@@ -20,9 +20,9 @@ void matrix_init_kb(void) {
20 // runs once when the firmware starts up 20 // runs once when the firmware starts up
21 21
22 //set the indicator LED pin to Output 22 //set the indicator LED pin to Output
23 setPinOutput(B5); 23 gpio_set_pin_output(B5);
24 //set HIGH for off. 24 //set HIGH for off.
25 writePinHigh(B5); 25 gpio_write_pin_high(B5);
26 26
27 //call any user functions 27 //call any user functions
28 matrix_init_user(); 28 matrix_init_user();
diff --git a/keyboards/keyhive/navi10/rev2/rev2.c b/keyboards/keyhive/navi10/rev2/rev2.c
index 1eefa5cd91..d8c0e81348 100644
--- a/keyboards/keyhive/navi10/rev2/rev2.c
+++ b/keyboards/keyhive/navi10/rev2/rev2.c
@@ -20,9 +20,9 @@ void matrix_init_kb(void) {
20 // runs once when the firmware starts up 20 // runs once when the firmware starts up
21 21
22 //set the indicator LED pin to Output 22 //set the indicator LED pin to Output
23 setPinOutput(B5); 23 gpio_set_pin_output(B5);
24 //set HIGH for off. 24 //set HIGH for off.
25 writePinHigh(B5); 25 gpio_write_pin_high(B5);
26 26
27 //call any user functions 27 //call any user functions
28 matrix_init_user(); 28 matrix_init_user();
diff --git a/keyboards/keyhive/navi10/rev3/rev3.c b/keyboards/keyhive/navi10/rev3/rev3.c
index 1eefa5cd91..d8c0e81348 100644
--- a/keyboards/keyhive/navi10/rev3/rev3.c
+++ b/keyboards/keyhive/navi10/rev3/rev3.c
@@ -20,9 +20,9 @@ void matrix_init_kb(void) {
20 // runs once when the firmware starts up 20 // runs once when the firmware starts up
21 21
22 //set the indicator LED pin to Output 22 //set the indicator LED pin to Output
23 setPinOutput(B5); 23 gpio_set_pin_output(B5);
24 //set HIGH for off. 24 //set HIGH for off.
25 writePinHigh(B5); 25 gpio_write_pin_high(B5);
26 26
27 //call any user functions 27 //call any user functions
28 matrix_init_user(); 28 matrix_init_user();
diff --git a/keyboards/kin80/blackpill103/blackpill103.c b/keyboards/kin80/blackpill103/blackpill103.c
index e06ad44748..b532a72869 100644
--- a/keyboards/kin80/blackpill103/blackpill103.c
+++ b/keyboards/kin80/blackpill103/blackpill103.c
@@ -18,8 +18,8 @@
18 18
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 /* LED pins setup */ 20 /* LED pins setup */
21 setPinOutput(LED4_PIN); 21 gpio_set_pin_output(LED4_PIN);
22 writePinLow(LED4_PIN); 22 gpio_write_pin_low(LED4_PIN);
23 23
24 matrix_init_user(); 24 matrix_init_user();
25} 25}
diff --git a/keyboards/kin80/blackpill401/blackpill401.c b/keyboards/kin80/blackpill401/blackpill401.c
index e06ad44748..b532a72869 100644
--- a/keyboards/kin80/blackpill401/blackpill401.c
+++ b/keyboards/kin80/blackpill401/blackpill401.c
@@ -18,8 +18,8 @@
18 18
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 /* LED pins setup */ 20 /* LED pins setup */
21 setPinOutput(LED4_PIN); 21 gpio_set_pin_output(LED4_PIN);
22 writePinLow(LED4_PIN); 22 gpio_write_pin_low(LED4_PIN);
23 23
24 matrix_init_user(); 24 matrix_init_user();
25} 25}
diff --git a/keyboards/kin80/blackpill411/blackpill411.c b/keyboards/kin80/blackpill411/blackpill411.c
index 012a434e41..21e4b91705 100644
--- a/keyboards/kin80/blackpill411/blackpill411.c
+++ b/keyboards/kin80/blackpill411/blackpill411.c
@@ -18,8 +18,8 @@
18 18
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 /* LED pins setup */ 20 /* LED pins setup */
21 setPinOutput(LED4_PIN); 21 gpio_set_pin_output(LED4_PIN);
22 writePinLow(LED4_PIN); 22 gpio_write_pin_low(LED4_PIN);
23 23
24 matrix_init_user(); 24 matrix_init_user();
25} 25}
diff --git a/keyboards/kin80/micro/micro.c b/keyboards/kin80/micro/micro.c
index e06ad44748..b532a72869 100644
--- a/keyboards/kin80/micro/micro.c
+++ b/keyboards/kin80/micro/micro.c
@@ -18,8 +18,8 @@
18 18
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 /* LED pins setup */ 20 /* LED pins setup */
21 setPinOutput(LED4_PIN); 21 gpio_set_pin_output(LED4_PIN);
22 writePinLow(LED4_PIN); 22 gpio_write_pin_low(LED4_PIN);
23 23
24 matrix_init_user(); 24 matrix_init_user();
25} 25}
diff --git a/keyboards/kinesis/kint36/kint36.c b/keyboards/kinesis/kint36/kint36.c
index b3ae9b570c..c6f399d6dc 100644
--- a/keyboards/kinesis/kint36/kint36.c
+++ b/keyboards/kinesis/kint36/kint36.c
@@ -22,6 +22,6 @@ void matrix_init_kb(void) {
22 matrix_init_user(); 22 matrix_init_user();
23 23
24 // Turn on the Teensy 3.6 Power LED: 24 // Turn on the Teensy 3.6 Power LED:
25 setPinOutput(LED_POWER); 25 gpio_set_pin_output(LED_POWER);
26 writePinHigh(LED_POWER); 26 gpio_write_pin_high(LED_POWER);
27} 27}
diff --git a/keyboards/kinesis/kint41/kint41.c b/keyboards/kinesis/kint41/kint41.c
index 6d339497ee..8f8f7dfc59 100644
--- a/keyboards/kinesis/kint41/kint41.c
+++ b/keyboards/kinesis/kint41/kint41.c
@@ -22,8 +22,8 @@ void matrix_init_kb(void) {
22 matrix_init_user(); 22 matrix_init_user();
23 23
24 // Turn on the Teensy 4.x Power LED: 24 // Turn on the Teensy 4.x Power LED:
25 setPinOutput(LED_POWER); 25 gpio_set_pin_output(LED_POWER);
26 writePinHigh(LED_POWER); 26 gpio_write_pin_high(LED_POWER);
27} 27}
28 28
29// delay_inline sleeps for |cycles| (e.g. sleeping for F_CPU will sleep 1s). 29// delay_inline sleeps for |cycles| (e.g. sleeping for F_CPU will sleep 1s).
diff --git a/keyboards/kinesis/kintlc/kintlc.c b/keyboards/kinesis/kintlc/kintlc.c
index 9623d04fe0..6904adc6ad 100644
--- a/keyboards/kinesis/kintlc/kintlc.c
+++ b/keyboards/kinesis/kintlc/kintlc.c
@@ -22,6 +22,6 @@ void matrix_init_kb(void) {
22 matrix_init_user(); 22 matrix_init_user();
23 23
24 // Turn on the Teensy LC Power LED: 24 // Turn on the Teensy LC Power LED:
25 setPinOutput(LED_POWER); 25 gpio_set_pin_output(LED_POWER);
26 writePinHigh(LED_POWER); 26 gpio_write_pin_high(LED_POWER);
27} 27}
diff --git a/keyboards/kinesis/kintwin/kintwin.c b/keyboards/kinesis/kintwin/kintwin.c
index 0e2e7a5792..e0c3ab4880 100644
--- a/keyboards/kinesis/kintwin/kintwin.c
+++ b/keyboards/kinesis/kintwin/kintwin.c
@@ -8,22 +8,22 @@ void matrix_init_kb(void) {
8 uint8_t led_delay_ms = 80; 8 uint8_t led_delay_ms = 80;
9 9
10 /* LED pins setup */ 10 /* LED pins setup */
11 setPinOutput(LED_CAPS_LOCK_PIN); 11 gpio_set_pin_output(LED_CAPS_LOCK_PIN);
12 writePinLow(LED_CAPS_LOCK_PIN); 12 gpio_write_pin_low(LED_CAPS_LOCK_PIN);
13 13
14 wait_ms(led_delay_ms); 14 wait_ms(led_delay_ms);
15 setPinOutput(LED_NUM_LOCK_PIN); 15 gpio_set_pin_output(LED_NUM_LOCK_PIN);
16 writePinLow(LED_NUM_LOCK_PIN); 16 gpio_write_pin_low(LED_NUM_LOCK_PIN);
17 wait_ms(led_delay_ms); 17 wait_ms(led_delay_ms);
18 18
19 setPinOutput(LED_SCROLL_LOCK_PIN); 19 gpio_set_pin_output(LED_SCROLL_LOCK_PIN);
20 writePinLow(LED_SCROLL_LOCK_PIN); 20 gpio_write_pin_low(LED_SCROLL_LOCK_PIN);
21 wait_ms(led_delay_ms); 21 wait_ms(led_delay_ms);
22 22
23 setPinOutput(LED_COMPOSE_PIN); 23 gpio_set_pin_output(LED_COMPOSE_PIN);
24 writePinLow(LED_COMPOSE_PIN); 24 gpio_write_pin_low(LED_COMPOSE_PIN);
25 wait_ms(led_delay_ms); 25 wait_ms(led_delay_ms);
26 writePinHigh(LED_COMPOSE_PIN); 26 gpio_write_pin_high(LED_COMPOSE_PIN);
27 27
28 matrix_init_user(); 28 matrix_init_user();
29} \ No newline at end of file 29} \ No newline at end of file
diff --git a/keyboards/kinesis/nguyenvietyen/matrix.c b/keyboards/kinesis/nguyenvietyen/matrix.c
index 4e4ca6f55c..06b57c7c0b 100644
--- a/keyboards/kinesis/nguyenvietyen/matrix.c
+++ b/keyboards/kinesis/nguyenvietyen/matrix.c
@@ -8,10 +8,10 @@ static matrix_row_t read_row(uint8_t row) {
8 8
9 // keypad and program buttons 9 // keypad and program buttons
10 if (row == 12) { 10 if (row == 12) {
11 return ~(readPin(B4) | (readPin(B5) << 1) | 0b11111100); 11 return ~(gpio_read_pin(B4) | (gpio_read_pin(B5) << 1) | 0b11111100);
12 } 12 }
13 13
14 return ~(readPin(B6) | readPin(B2) << 1 | readPin(B3) << 2 | readPin(B1) << 3 | readPin(F7) << 4 | readPin(F6) << 5 | readPin(F5) << 6 | readPin(F4) << 7); 14 return ~(gpio_read_pin(B6) | gpio_read_pin(B2) << 1 | gpio_read_pin(B3) << 2 | gpio_read_pin(B1) << 3 | gpio_read_pin(F7) << 4 | gpio_read_pin(F6) << 5 | gpio_read_pin(F5) << 6 | gpio_read_pin(F4) << 7);
15} 15}
16 16
17static void unselect_rows(void) { 17static void unselect_rows(void) {
@@ -26,24 +26,24 @@ static void select_rows(uint8_t row) {
26 26
27void matrix_init_custom(void) { 27void matrix_init_custom(void) {
28 // output low (multiplexers) 28 // output low (multiplexers)
29 setPinOutput(D0); 29 gpio_set_pin_output(D0);
30 setPinOutput(D1); 30 gpio_set_pin_output(D1);
31 setPinOutput(D2); 31 gpio_set_pin_output(D2);
32 setPinOutput(D3); 32 gpio_set_pin_output(D3);
33 33
34 // input with pullup (matrix) 34 // input with pullup (matrix)
35 setPinInputHigh(B6); 35 gpio_set_pin_input_high(B6);
36 setPinInputHigh(B2); 36 gpio_set_pin_input_high(B2);
37 setPinInputHigh(B3); 37 gpio_set_pin_input_high(B3);
38 setPinInputHigh(B1); 38 gpio_set_pin_input_high(B1);
39 setPinInputHigh(F7); 39 gpio_set_pin_input_high(F7);
40 setPinInputHigh(F6); 40 gpio_set_pin_input_high(F6);
41 setPinInputHigh(F5); 41 gpio_set_pin_input_high(F5);
42 setPinInputHigh(F4); 42 gpio_set_pin_input_high(F4);
43 43
44 // input with pullup (program and keypad buttons) 44 // input with pullup (program and keypad buttons)
45 setPinInputHigh(B4); 45 gpio_set_pin_input_high(B4);
46 setPinInputHigh(B5); 46 gpio_set_pin_input_high(B5);
47 47
48 // initialize row and col 48 // initialize row and col
49 unselect_rows(); 49 unselect_rows();
diff --git a/keyboards/kkatano/wallaby/wallaby.c b/keyboards/kkatano/wallaby/wallaby.c
index 4d619bec8e..de2583903b 100644
--- a/keyboards/kkatano/wallaby/wallaby.c
+++ b/keyboards/kkatano/wallaby/wallaby.c
@@ -18,8 +18,8 @@
18 18
19bool led_update_kb(led_t led_state) { 19bool led_update_kb(led_t led_state) {
20 if (led_update_user(led_state)) { 20 if (led_update_user(led_state)) {
21 writePin(B6, led_state.caps_lock); 21 gpio_write_pin(B6, led_state.caps_lock);
22 writePin(B7, led_state.scroll_lock); 22 gpio_write_pin(B7, led_state.scroll_lock);
23 } 23 }
24 return true; 24 return true;
25} 25}
diff --git a/keyboards/kkatano/yurei/yurei.c b/keyboards/kkatano/yurei/yurei.c
index 457a6ce48c..283726a884 100644
--- a/keyboards/kkatano/yurei/yurei.c
+++ b/keyboards/kkatano/yurei/yurei.c
@@ -18,8 +18,8 @@
18 18
19bool led_update_kb(led_t led_state) { 19bool led_update_kb(led_t led_state) {
20 if (led_update_user(led_state)) { 20 if (led_update_user(led_state)) {
21 writePin(B6, led_state.caps_lock); 21 gpio_write_pin(B6, led_state.caps_lock);
22 writePin(B7, led_state.scroll_lock); 22 gpio_write_pin(B7, led_state.scroll_lock);
23 } 23 }
24 return true; 24 return true;
25} 25}
diff --git a/keyboards/kopibeng/mnk88/mnk88.c b/keyboards/kopibeng/mnk88/mnk88.c
index cb53d31579..efe32f8bfd 100644
--- a/keyboards/kopibeng/mnk88/mnk88.c
+++ b/keyboards/kopibeng/mnk88/mnk88.c
@@ -18,8 +18,8 @@
18 18
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 20
21 setPinOutput(LED_CAPS_LOCK_PIN); 21 gpio_set_pin_output(LED_CAPS_LOCK_PIN);
22 setPinOutput(LED_SCROLL_LOCK_PIN); 22 gpio_set_pin_output(LED_SCROLL_LOCK_PIN);
23 23
24 matrix_init_user(); 24 matrix_init_user();
25} 25}
@@ -29,8 +29,8 @@ bool led_update_kb(led_t led_state) {
29 bool res = led_update_user(led_state); 29 bool res = led_update_user(led_state);
30 30
31 if(res) { 31 if(res) {
32 writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); 32 gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
33 writePin(LED_SCROLL_LOCK_PIN, led_state.scroll_lock); 33 gpio_write_pin(LED_SCROLL_LOCK_PIN, led_state.scroll_lock);
34 } 34 }
35 return res; 35 return res;
36} 36}
diff --git a/keyboards/kopibeng/typ65/typ65.c b/keyboards/kopibeng/typ65/typ65.c
index 246a8c13af..53af0ba97d 100644
--- a/keyboards/kopibeng/typ65/typ65.c
+++ b/keyboards/kopibeng/typ65/typ65.c
@@ -17,9 +17,9 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void keyboard_pre_init_kb (void) { 19void keyboard_pre_init_kb (void) {
20 setPinOutput(INDICATOR_0); 20 gpio_set_pin_output(INDICATOR_0);
21 setPinOutput(INDICATOR_1); 21 gpio_set_pin_output(INDICATOR_1);
22 setPinOutput(INDICATOR_2); 22 gpio_set_pin_output(INDICATOR_2);
23 23
24 keyboard_pre_init_user(); 24 keyboard_pre_init_user();
25} 25}
@@ -27,41 +27,41 @@ void keyboard_pre_init_kb (void) {
27__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { 27__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
28 switch (get_highest_layer(state)) { 28 switch (get_highest_layer(state)) {
29 case 1: 29 case 1:
30 writePinHigh(INDICATOR_0); 30 gpio_write_pin_high(INDICATOR_0);
31 writePinLow(INDICATOR_1); 31 gpio_write_pin_low(INDICATOR_1);
32 writePinLow(INDICATOR_2); 32 gpio_write_pin_low(INDICATOR_2);
33 break; 33 break;
34 case 2: 34 case 2:
35 writePinLow(INDICATOR_0); 35 gpio_write_pin_low(INDICATOR_0);
36 writePinHigh(INDICATOR_1); 36 gpio_write_pin_high(INDICATOR_1);
37 writePinLow(INDICATOR_2); 37 gpio_write_pin_low(INDICATOR_2);
38 break; 38 break;
39 case 3: 39 case 3:
40 writePinLow(INDICATOR_0); 40 gpio_write_pin_low(INDICATOR_0);
41 writePinLow(INDICATOR_1); 41 gpio_write_pin_low(INDICATOR_1);
42 writePinHigh(INDICATOR_2); 42 gpio_write_pin_high(INDICATOR_2);
43 break; 43 break;
44 default: 44 default:
45 writePinHigh(INDICATOR_0); 45 gpio_write_pin_high(INDICATOR_0);
46 writePinHigh(INDICATOR_1); 46 gpio_write_pin_high(INDICATOR_1);
47 writePinHigh(INDICATOR_2); 47 gpio_write_pin_high(INDICATOR_2);
48 break; 48 break;
49 } 49 }
50 return state; 50 return state;
51} 51}
52 52
53void suspend_power_down_kb(void) { 53void suspend_power_down_kb(void) {
54 writePinLow(INDICATOR_0); 54 gpio_write_pin_low(INDICATOR_0);
55 writePinLow(INDICATOR_1); 55 gpio_write_pin_low(INDICATOR_1);
56 writePinLow(INDICATOR_2); 56 gpio_write_pin_low(INDICATOR_2);
57 57
58 suspend_power_down_user(); 58 suspend_power_down_user();
59} 59}
60 60
61void suspend_wakeup_init_kb(void) { 61void suspend_wakeup_init_kb(void) {
62 writePinHigh(INDICATOR_0); 62 gpio_write_pin_high(INDICATOR_0);
63 writePinHigh(INDICATOR_1); 63 gpio_write_pin_high(INDICATOR_1);
64 writePinHigh(INDICATOR_2); 64 gpio_write_pin_high(INDICATOR_2);
65 65
66 suspend_wakeup_init_user(); 66 suspend_wakeup_init_user();
67} \ No newline at end of file 67} \ No newline at end of file
diff --git a/keyboards/kopibeng/xt8x/xt8x.c b/keyboards/kopibeng/xt8x/xt8x.c
index 870a075e5b..2c4f246b6a 100644
--- a/keyboards/kopibeng/xt8x/xt8x.c
+++ b/keyboards/kopibeng/xt8x/xt8x.c
@@ -19,9 +19,9 @@
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 // Initialize indicator LEDs to output 20 // Initialize indicator LEDs to output
21 21
22 setPinOutput(LED_CAPS_LOCK_PIN); // Caps 22 gpio_set_pin_output(LED_CAPS_LOCK_PIN); // Caps
23 setPinOutput(LED_SCROLL_LOCK_PIN); // Scroll lock 23 gpio_set_pin_output(LED_SCROLL_LOCK_PIN); // Scroll lock
24 setPinOutput(INDICATOR_PIN_0); // Layer indicator on F13 24 gpio_set_pin_output(INDICATOR_PIN_0); // Layer indicator on F13
25 25
26 matrix_init_user(); 26 matrix_init_user();
27} 27}
@@ -31,13 +31,13 @@ bool led_update_kb(led_t led_state) {
31 bool res = led_update_user(led_state); 31 bool res = led_update_user(led_state);
32 32
33 if(res) { 33 if(res) {
34 writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); 34 gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
35 writePin(LED_SCROLL_LOCK_PIN, led_state.scroll_lock); 35 gpio_write_pin(LED_SCROLL_LOCK_PIN, led_state.scroll_lock);
36 } 36 }
37 return res; 37 return res;
38} 38}
39 39
40__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { 40__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
41 writePin(INDICATOR_PIN_0, layer_state_cmp(state, 1)); 41 gpio_write_pin(INDICATOR_PIN_0, layer_state_cmp(state, 1));
42 return state; 42 return state;
43} 43}
diff --git a/keyboards/ktec/ergodone/ergodox_compat.h b/keyboards/ktec/ergodone/ergodox_compat.h
index de6ee4a211..b566e6cc94 100644
--- a/keyboards/ktec/ergodone/ergodox_compat.h
+++ b/keyboards/ktec/ergodone/ergodox_compat.h
@@ -15,12 +15,12 @@
15#endif 15#endif
16#define LED_BRIGHTNESS_LO 15 16#define LED_BRIGHTNESS_LO 15
17#define LED_BRIGHTNESS_HI 255 17#define LED_BRIGHTNESS_HI 255
18static inline void ergodox_right_led_1_off(void) { setPinOutput(LED_NUM_LOCK_PIN); writePin(LED_NUM_LOCK_PIN, 0); } 18static inline void ergodox_right_led_1_off(void) { gpio_set_pin_output(LED_NUM_LOCK_PIN); gpio_write_pin(LED_NUM_LOCK_PIN, 0); }
19static inline void ergodox_right_led_1_on(void) { setPinOutput(LED_NUM_LOCK_PIN); writePin(LED_NUM_LOCK_PIN, 1); } 19static inline void ergodox_right_led_1_on(void) { gpio_set_pin_output(LED_NUM_LOCK_PIN); gpio_write_pin(LED_NUM_LOCK_PIN, 1); }
20static inline void ergodox_right_led_2_off(void) { setPinOutput(LED_CAPS_LOCK_PIN); writePin(LED_CAPS_LOCK_PIN, 0); } 20static inline void ergodox_right_led_2_off(void) { gpio_set_pin_output(LED_CAPS_LOCK_PIN); gpio_write_pin(LED_CAPS_LOCK_PIN, 0); }
21static inline void ergodox_right_led_2_on(void) { setPinOutput(LED_CAPS_LOCK_PIN); writePin(LED_CAPS_LOCK_PIN, 1); } 21static inline void ergodox_right_led_2_on(void) { gpio_set_pin_output(LED_CAPS_LOCK_PIN); gpio_write_pin(LED_CAPS_LOCK_PIN, 1); }
22static inline void ergodox_right_led_3_off(void) { setPinOutput(LED_SCROLL_LOCK_PIN); writePin(LED_SCROLL_LOCK_PIN, 0); } 22static inline void ergodox_right_led_3_off(void) { gpio_set_pin_output(LED_SCROLL_LOCK_PIN); gpio_write_pin(LED_SCROLL_LOCK_PIN, 0); }
23static inline void ergodox_right_led_3_on(void) { setPinOutput(LED_SCROLL_LOCK_PIN); writePin(LED_SCROLL_LOCK_PIN, 1); } 23static inline void ergodox_right_led_3_on(void) { gpio_set_pin_output(LED_SCROLL_LOCK_PIN); gpio_write_pin(LED_SCROLL_LOCK_PIN, 1); }
24static inline void ergodox_right_led_on(uint8_t l) { 24static inline void ergodox_right_led_on(uint8_t l) {
25 switch (l) { 25 switch (l) {
26 case 1: 26 case 1:
@@ -51,8 +51,8 @@ static inline void ergodox_right_led_off(uint8_t l) {
51 break; 51 break;
52 } 52 }
53} 53}
54static inline void ergodox_board_led_off(void) { setPinOutput(D5); writePin(D5, !ERGODOX_BOARD_LED_ON_STATE); } 54static inline void ergodox_board_led_off(void) { gpio_set_pin_output(D5); gpio_write_pin(D5, !ERGODOX_BOARD_LED_ON_STATE); }
55static inline void ergodox_board_led_on(void) { setPinOutput(D5); writePin(D5, ERGODOX_BOARD_LED_ON_STATE); } 55static inline void ergodox_board_led_on(void) { gpio_set_pin_output(D5); gpio_write_pin(D5, ERGODOX_BOARD_LED_ON_STATE); }
56static inline void ergodox_led_all_on(void) { 56static inline void ergodox_led_all_on(void) {
57 ergodox_right_led_1_on(); 57 ergodox_right_led_1_on();
58 ergodox_right_led_2_on(); 58 ergodox_right_led_2_on();
diff --git a/keyboards/ktec/ergodone/matrix.c b/keyboards/ktec/ergodone/matrix.c
index a9a517f2f1..f034e1f2db 100644
--- a/keyboards/ktec/ergodone/matrix.c
+++ b/keyboards/ktec/ergodone/matrix.c
@@ -82,13 +82,13 @@ static void expander_scan(void) {
82 */ 82 */
83static void init_cols(void) { 83static void init_cols(void) {
84 // Pro Micro 84 // Pro Micro
85 setPinInputHigh(E6); 85 gpio_set_pin_input_high(E6);
86 setPinInputHigh(D2); 86 gpio_set_pin_input_high(D2);
87 setPinInputHigh(D3); 87 gpio_set_pin_input_high(D3);
88 setPinInputHigh(D4); 88 gpio_set_pin_input_high(D4);
89 setPinInputHigh(D7); 89 gpio_set_pin_input_high(D7);
90 setPinInputHigh(C6); 90 gpio_set_pin_input_high(C6);
91 setPinInputHigh(B4); 91 gpio_set_pin_input_high(B4);
92 92
93 // Expander 93 // Expander
94 expander_init_cols(); 94 expander_init_cols();
@@ -97,13 +97,13 @@ static void init_cols(void) {
97static matrix_row_t read_cols(void) { 97static matrix_row_t read_cols(void) {
98 // clang-format off 98 // clang-format off
99 return expander_read_row() | 99 return expander_read_row() |
100 (readPin(D3) ? 0 : (1<<6)) | 100 (gpio_read_pin(D3) ? 0 : (1<<6)) |
101 (readPin(D2) ? 0 : (1<<5)) | 101 (gpio_read_pin(D2) ? 0 : (1<<5)) |
102 (readPin(D4) ? 0 : (1<<4)) | 102 (gpio_read_pin(D4) ? 0 : (1<<4)) |
103 (readPin(C6) ? 0 : (1<<3)) | 103 (gpio_read_pin(C6) ? 0 : (1<<3)) |
104 (readPin(D7) ? 0 : (1<<2)) | 104 (gpio_read_pin(D7) ? 0 : (1<<2)) |
105 (readPin(E6) ? 0 : (1<<1)) | 105 (gpio_read_pin(E6) ? 0 : (1<<1)) |
106 (readPin(B4) ? 0 : (1<<0)) ; 106 (gpio_read_pin(B4) ? 0 : (1<<0)) ;
107 // clang-format on 107 // clang-format on
108} 108}
109 109
@@ -116,18 +116,18 @@ static matrix_row_t read_cols(void) {
116 */ 116 */
117static void unselect_rows(void) { 117static void unselect_rows(void) {
118 // Pro Micro 118 // Pro Micro
119 setPinInput(B1); 119 gpio_set_pin_input(B1);
120 setPinInput(B2); 120 gpio_set_pin_input(B2);
121 setPinInput(F4); 121 gpio_set_pin_input(F4);
122 setPinInput(F5); 122 gpio_set_pin_input(F5);
123 setPinInput(F6); 123 gpio_set_pin_input(F6);
124 setPinInput(F7); 124 gpio_set_pin_input(F7);
125 writePinLow(B1); 125 gpio_write_pin_low(B1);
126 writePinLow(B2); 126 gpio_write_pin_low(B2);
127 writePinLow(F4); 127 gpio_write_pin_low(F4);
128 writePinLow(F5); 128 gpio_write_pin_low(F5);
129 writePinLow(F6); 129 gpio_write_pin_low(F6);
130 writePinLow(F7); 130 gpio_write_pin_low(F7);
131 131
132 // Expander 132 // Expander
133 expander_unselect_rows(); 133 expander_unselect_rows();
@@ -137,28 +137,28 @@ static void unselect_row(uint8_t row) {
137 // Pro Micro 137 // Pro Micro
138 switch (row) { 138 switch (row) {
139 case 0: 139 case 0:
140 setPinInput(F4); 140 gpio_set_pin_input(F4);
141 writePinLow(F4); 141 gpio_write_pin_low(F4);
142 break; 142 break;
143 case 1: 143 case 1:
144 setPinInput(F5); 144 gpio_set_pin_input(F5);
145 writePinLow(F5); 145 gpio_write_pin_low(F5);
146 break; 146 break;
147 case 2: 147 case 2:
148 setPinInput(F6); 148 gpio_set_pin_input(F6);
149 writePinLow(F6); 149 gpio_write_pin_low(F6);
150 break; 150 break;
151 case 3: 151 case 3:
152 setPinInput(F7); 152 gpio_set_pin_input(F7);
153 writePinLow(F7); 153 gpio_write_pin_low(F7);
154 break; 154 break;
155 case 4: 155 case 4:
156 setPinInput(B1); 156 gpio_set_pin_input(B1);
157 writePinLow(B1); 157 gpio_write_pin_low(B1);
158 break; 158 break;
159 case 5: 159 case 5:
160 setPinInput(B2); 160 gpio_set_pin_input(B2);
161 writePinLow(B2); 161 gpio_write_pin_low(B2);
162 break; 162 break;
163 } 163 }
164 164
@@ -170,28 +170,28 @@ static void select_row(uint8_t row) {
170 // Pro Micro 170 // Pro Micro
171 switch (row) { 171 switch (row) {
172 case 0: 172 case 0:
173 setPinOutput(F4); 173 gpio_set_pin_output(F4);
174 writePinLow(F4); 174 gpio_write_pin_low(F4);
175 break; 175 break;
176 case 1: 176 case 1:
177 setPinOutput(F5); 177 gpio_set_pin_output(F5);
178 writePinLow(F5); 178 gpio_write_pin_low(F5);
179 break; 179 break;
180 case 2: 180 case 2:
181 setPinOutput(F6); 181 gpio_set_pin_output(F6);
182 writePinLow(F6); 182 gpio_write_pin_low(F6);
183 break; 183 break;
184 case 3: 184 case 3:
185 setPinOutput(F7); 185 gpio_set_pin_output(F7);
186 writePinLow(F7); 186 gpio_write_pin_low(F7);
187 break; 187 break;
188 case 4: 188 case 4:
189 setPinOutput(B1); 189 gpio_set_pin_output(B1);
190 writePinLow(B1); 190 gpio_write_pin_low(B1);
191 break; 191 break;
192 case 5: 192 case 5:
193 setPinOutput(B2); 193 gpio_set_pin_output(B2);
194 writePinLow(B2); 194 gpio_write_pin_low(B2);
195 break; 195 break;
196 } 196 }
197 197
diff --git a/keyboards/ktec/staryu/backlight_staryu.h b/keyboards/ktec/staryu/backlight_staryu.h
index 34511da5c1..aa0092c3c1 100644
--- a/keyboards/ktec/staryu/backlight_staryu.h
+++ b/keyboards/ktec/staryu/backlight_staryu.h
@@ -20,9 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20static inline void backlight_set_value(uint8_t index, uint8_t level) { 20static inline void backlight_set_value(uint8_t index, uint8_t level) {
21 static const uint8_t backlight_pins[] = BACKLIGHT_PINS; 21 static const uint8_t backlight_pins[] = BACKLIGHT_PINS;
22 if (level) { 22 if (level) {
23 setPinOutput(backlight_pins[index]); 23 gpio_set_pin_output(backlight_pins[index]);
24 } else { 24 } else {
25 setPinInput(backlight_pins[index]); 25 gpio_set_pin_input(backlight_pins[index]);
26 } 26 }
27} 27}
28 28
diff --git a/keyboards/kv/revt/revt.c b/keyboards/kv/revt/revt.c
index fba4582c26..df74ca626b 100644
--- a/keyboards/kv/revt/revt.c
+++ b/keyboards/kv/revt/revt.c
@@ -18,8 +18,8 @@
18 18
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 // Turn status LED on 20 // Turn status LED on
21 setPinOutput(C14); 21 gpio_set_pin_output(C14);
22 writePinHigh(C14); 22 gpio_write_pin_high(C14);
23 23
24 matrix_init_user(); 24 matrix_init_user();
25} 25}
diff --git a/keyboards/lazydesigners/dimple/staggered/staggered.c b/keyboards/lazydesigners/dimple/staggered/staggered.c
index b871868afa..c354283780 100644
--- a/keyboards/lazydesigners/dimple/staggered/staggered.c
+++ b/keyboards/lazydesigners/dimple/staggered/staggered.c
@@ -15,9 +15,9 @@
15 */ 15 */
16#include "staggered.h" 16#include "staggered.h"
17void dimple_led_on(void) { 17void dimple_led_on(void) {
18 writePinLow(E6); 18 gpio_write_pin_low(E6);
19 } 19 }
20 20
21 void dimple_led_off(void) { 21 void dimple_led_off(void) {
22 writePinHigh(E6); 22 gpio_write_pin_high(E6);
23 } 23 }
diff --git a/keyboards/lfkeyboards/lfk78/lfk78.c b/keyboards/lfkeyboards/lfk78/lfk78.c
index 50f1505050..3bf7c40d15 100644
--- a/keyboards/lfkeyboards/lfk78/lfk78.c
+++ b/keyboards/lfkeyboards/lfk78/lfk78.c
@@ -10,8 +10,8 @@ void matrix_init_kb(void) {
10 10
11#ifndef AUDIO_ENABLE 11#ifndef AUDIO_ENABLE
12 // If we're not using the audio pin, drive it low 12 // If we're not using the audio pin, drive it low
13 setPinOutput(C6); 13 gpio_set_pin_output(C6);
14 writePinLow(C6); 14 gpio_write_pin_low(C6);
15#endif 15#endif
16 16
17#ifdef WATCHDOG_ENABLE 17#ifdef WATCHDOG_ENABLE
diff --git a/keyboards/lfkeyboards/lfk87/lfk87.c b/keyboards/lfkeyboards/lfk87/lfk87.c
index 849f0ebcc5..480a44ea84 100644
--- a/keyboards/lfkeyboards/lfk87/lfk87.c
+++ b/keyboards/lfkeyboards/lfk87/lfk87.c
@@ -12,8 +12,8 @@ void matrix_init_kb(void)
12 matrix_init_user(); 12 matrix_init_user();
13#ifndef AUDIO_ENABLE 13#ifndef AUDIO_ENABLE
14 // If we're not using the audio pin, drive it low 14 // If we're not using the audio pin, drive it low
15 setPinOutput(C6); 15 gpio_set_pin_output(C6);
16 writePinLow(C6); 16 gpio_write_pin_low(C6);
17#endif 17#endif
18#ifdef WATCHDOG_ENABLE 18#ifdef WATCHDOG_ENABLE
19 // This is done after turning the layer LED red, if we're caught in a loop 19 // This is done after turning the layer LED red, if we're caught in a loop
diff --git a/keyboards/lfkeyboards/mini1800/mini1800.c b/keyboards/lfkeyboards/mini1800/mini1800.c
index 2ca87cfdb6..6ac615f871 100644
--- a/keyboards/lfkeyboards/mini1800/mini1800.c
+++ b/keyboards/lfkeyboards/mini1800/mini1800.c
@@ -13,8 +13,8 @@ void matrix_init_kb(void)
13 matrix_init_user(); 13 matrix_init_user();
14#ifndef AUDIO_ENABLE 14#ifndef AUDIO_ENABLE
15 // If we're not using the audio pin, drive it low 15 // If we're not using the audio pin, drive it low
16 setPinOutput(C6); 16 gpio_set_pin_output(C6);
17 writePinLow(C6); 17 gpio_write_pin_low(C6);
18#endif 18#endif
19 _delay_ms(500); 19 _delay_ms(500);
20#ifdef WATCHDOG_ENABLE 20#ifdef WATCHDOG_ENABLE
diff --git a/keyboards/lfkeyboards/smk65/revb/revb.c b/keyboards/lfkeyboards/smk65/revb/revb.c
index 8eb9b9afe2..f519b413b5 100644
--- a/keyboards/lfkeyboards/smk65/revb/revb.c
+++ b/keyboards/lfkeyboards/smk65/revb/revb.c
@@ -27,12 +27,12 @@ void matrix_init_kb(void)
27#ifdef AUDIO_ENABLE 27#ifdef AUDIO_ENABLE
28 // audio_init() sets PB5 to output and drives it low, which breaks our matrix 28 // audio_init() sets PB5 to output and drives it low, which breaks our matrix
29 // so reset PB5 to input 29 // so reset PB5 to input
30 setPinInput(B5); 30 gpio_set_pin_input(B5);
31 writePinHigh(B5); 31 gpio_write_pin_high(B5);
32#else 32#else
33 // If we're not using the audio pin, drive it low 33 // If we're not using the audio pin, drive it low
34 setPinOutput(C6); 34 gpio_set_pin_output(C6);
35 writePinLow(C6); 35 gpio_write_pin_low(C6);
36#endif 36#endif
37} 37}
38 38
diff --git a/keyboards/lz/erghost/matrix.c b/keyboards/lz/erghost/matrix.c
index 6b7d091cb7..dd9bb1e1ba 100644
--- a/keyboards/lz/erghost/matrix.c
+++ b/keyboards/lz/erghost/matrix.c
@@ -63,103 +63,103 @@ static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
63static void select_col(uint8_t col) { 63static void select_col(uint8_t col) {
64 switch (col) { 64 switch (col) {
65 case 0: 65 case 0:
66 writePinLow(B5); 66 gpio_write_pin_low(B5);
67 writePinLow(B7); 67 gpio_write_pin_low(B7);
68 writePinLow(F0); 68 gpio_write_pin_low(F0);
69 writePinHigh(B0); 69 gpio_write_pin_high(B0);
70 break; 70 break;
71 case 1: 71 case 1:
72 writePinLow(B5); 72 gpio_write_pin_low(B5);
73 writePinLow(B7); 73 gpio_write_pin_low(B7);
74 writePinHigh(F0); 74 gpio_write_pin_high(F0);
75 writePinHigh(B0); 75 gpio_write_pin_high(B0);
76 break; 76 break;
77 case 2: 77 case 2:
78 writePinLow(B5); 78 gpio_write_pin_low(B5);
79 writePinHigh(B7); 79 gpio_write_pin_high(B7);
80 writePinLow(F0); 80 gpio_write_pin_low(F0);
81 writePinHigh(B0); 81 gpio_write_pin_high(B0);
82 break; 82 break;
83 case 3: 83 case 3:
84 writePinLow(B5); 84 gpio_write_pin_low(B5);
85 writePinHigh(B7); 85 gpio_write_pin_high(B7);
86 writePinHigh(F0); 86 gpio_write_pin_high(F0);
87 writePinHigh(B0); 87 gpio_write_pin_high(B0);
88 break; 88 break;
89 case 4: 89 case 4:
90 writePinHigh(B5); 90 gpio_write_pin_high(B5);
91 writePinLow(B7); 91 gpio_write_pin_low(B7);
92 writePinLow(F0); 92 gpio_write_pin_low(F0);
93 writePinHigh(B0); 93 gpio_write_pin_high(B0);
94 break; 94 break;
95 case 5: 95 case 5:
96 writePinHigh(B5); 96 gpio_write_pin_high(B5);
97 writePinLow(B7); 97 gpio_write_pin_low(B7);
98 writePinHigh(F0); 98 gpio_write_pin_high(F0);
99 writePinHigh(B0); 99 gpio_write_pin_high(B0);
100 break; 100 break;
101 case 6: 101 case 6:
102 writePinHigh(B5); 102 gpio_write_pin_high(B5);
103 writePinHigh(B7); 103 gpio_write_pin_high(B7);
104 writePinLow(F0); 104 gpio_write_pin_low(F0);
105 writePinHigh(B0); 105 gpio_write_pin_high(B0);
106 break; 106 break;
107 case 7: 107 case 7:
108 writePinHigh(B5); 108 gpio_write_pin_high(B5);
109 writePinHigh(B7); 109 gpio_write_pin_high(B7);
110 writePinHigh(F0); 110 gpio_write_pin_high(F0);
111 writePinHigh(B0); 111 gpio_write_pin_high(B0);
112 break; 112 break;
113 case 8: 113 case 8:
114 writePinLow(B5); 114 gpio_write_pin_low(B5);
115 writePinLow(B7); 115 gpio_write_pin_low(B7);
116 writePinLow(F0); 116 gpio_write_pin_low(F0);
117 writePinHigh(F1); 117 gpio_write_pin_high(F1);
118 break; 118 break;
119 case 9: 119 case 9:
120 writePinLow(B5); 120 gpio_write_pin_low(B5);
121 writePinLow(B7); 121 gpio_write_pin_low(B7);
122 writePinHigh(F0); 122 gpio_write_pin_high(F0);
123 writePinHigh(F1); 123 gpio_write_pin_high(F1);
124 break; 124 break;
125 case 10: 125 case 10:
126 writePinLow(B5); 126 gpio_write_pin_low(B5);
127 writePinHigh(B7); 127 gpio_write_pin_high(B7);
128 writePinLow(F0); 128 gpio_write_pin_low(F0);
129 writePinHigh(F1); 129 gpio_write_pin_high(F1);
130 break; 130 break;
131 case 11: 131 case 11:
132 writePinLow(B5); 132 gpio_write_pin_low(B5);
133 writePinHigh(B7); 133 gpio_write_pin_high(B7);
134 writePinHigh(F0); 134 gpio_write_pin_high(F0);
135 writePinHigh(F1); 135 gpio_write_pin_high(F1);
136 break; 136 break;
137 case 12: 137 case 12:
138 writePinHigh(B5); 138 gpio_write_pin_high(B5);
139 writePinLow(B7); 139 gpio_write_pin_low(B7);
140 writePinLow(F0); 140 gpio_write_pin_low(F0);
141 writePinHigh(F1); 141 gpio_write_pin_high(F1);
142 break; 142 break;
143 case 13: 143 case 13:
144 writePinHigh(B5); 144 gpio_write_pin_high(B5);
145 writePinLow(B7); 145 gpio_write_pin_low(B7);
146 writePinHigh(F0); 146 gpio_write_pin_high(F0);
147 writePinHigh(F1); 147 gpio_write_pin_high(F1);
148 break; 148 break;
149 case 14: 149 case 14:
150 writePinHigh(B5); 150 gpio_write_pin_high(B5);
151 writePinHigh(B7); 151 gpio_write_pin_high(B7);
152 writePinHigh(F0); 152 gpio_write_pin_high(F0);
153 writePinHigh(F1); 153 gpio_write_pin_high(F1);
154 break; 154 break;
155 case 15: 155 case 15:
156 writePinHigh(B5); 156 gpio_write_pin_high(B5);
157 writePinHigh(B7); 157 gpio_write_pin_high(B7);
158 writePinLow(F0); 158 gpio_write_pin_low(F0);
159 writePinHigh(F1); 159 gpio_write_pin_high(F1);
160 break; 160 break;
161 case 16: 161 case 16:
162 writePinLow(E6); 162 gpio_write_pin_low(E6);
163 break; 163 break;
164 } 164 }
165} 165}
@@ -167,130 +167,130 @@ static void select_col(uint8_t col) {
167static void unselect_col(uint8_t col) { 167static void unselect_col(uint8_t col) {
168 switch (col) { 168 switch (col) {
169 case 0: 169 case 0:
170 writePinHigh(B5); 170 gpio_write_pin_high(B5);
171 writePinHigh(B7); 171 gpio_write_pin_high(B7);
172 writePinHigh(F0); 172 gpio_write_pin_high(F0);
173 writePinLow(B0); 173 gpio_write_pin_low(B0);
174 break; 174 break;
175 case 1: 175 case 1:
176 writePinHigh(B5); 176 gpio_write_pin_high(B5);
177 writePinHigh(B7); 177 gpio_write_pin_high(B7);
178 writePinLow(F0); 178 gpio_write_pin_low(F0);
179 writePinLow(B0); 179 gpio_write_pin_low(B0);
180 break; 180 break;
181 case 2: 181 case 2:
182 writePinHigh(B5); 182 gpio_write_pin_high(B5);
183 writePinLow(B7); 183 gpio_write_pin_low(B7);
184 writePinHigh(F0); 184 gpio_write_pin_high(F0);
185 writePinLow(B0); 185 gpio_write_pin_low(B0);
186 break; 186 break;
187 case 3: 187 case 3:
188 writePinHigh(B5); 188 gpio_write_pin_high(B5);
189 writePinLow(B7); 189 gpio_write_pin_low(B7);
190 writePinLow(F0); 190 gpio_write_pin_low(F0);
191 writePinLow(B0); 191 gpio_write_pin_low(B0);
192 break; 192 break;
193 case 4: 193 case 4:
194 writePinLow(B5); 194 gpio_write_pin_low(B5);
195 writePinHigh(B7); 195 gpio_write_pin_high(B7);
196 writePinHigh(F0); 196 gpio_write_pin_high(F0);
197 writePinLow(B0); 197 gpio_write_pin_low(B0);
198 break; 198 break;
199 case 5: 199 case 5:
200 writePinLow(B5); 200 gpio_write_pin_low(B5);
201 writePinHigh(B7); 201 gpio_write_pin_high(B7);
202 writePinLow(F0); 202 gpio_write_pin_low(F0);
203 writePinLow(B0); 203 gpio_write_pin_low(B0);
204 break; 204 break;
205 case 6: 205 case 6:
206 writePinLow(B5); 206 gpio_write_pin_low(B5);
207 writePinLow(B7); 207 gpio_write_pin_low(B7);
208 writePinHigh(F0); 208 gpio_write_pin_high(F0);
209 writePinLow(B0); 209 gpio_write_pin_low(B0);
210 break; 210 break;
211 case 7: 211 case 7:
212 writePinLow(B5); 212 gpio_write_pin_low(B5);
213 writePinLow(B7); 213 gpio_write_pin_low(B7);
214 writePinLow(F0); 214 gpio_write_pin_low(F0);
215 writePinLow(B0); 215 gpio_write_pin_low(B0);
216 break; 216 break;
217 case 8: 217 case 8:
218 writePinHigh(B5); 218 gpio_write_pin_high(B5);
219 writePinHigh(B7); 219 gpio_write_pin_high(B7);
220 writePinHigh(F0); 220 gpio_write_pin_high(F0);
221 writePinLow(F1); 221 gpio_write_pin_low(F1);
222 break; 222 break;
223 case 9: 223 case 9:
224 writePinHigh(B5); 224 gpio_write_pin_high(B5);
225 writePinHigh(B7); 225 gpio_write_pin_high(B7);
226 writePinLow(F0); 226 gpio_write_pin_low(F0);
227 writePinLow(F1); 227 gpio_write_pin_low(F1);
228 break; 228 break;
229 case 10: 229 case 10:
230 writePinHigh(B5); 230 gpio_write_pin_high(B5);
231 writePinLow(B7); 231 gpio_write_pin_low(B7);
232 writePinHigh(F0); 232 gpio_write_pin_high(F0);
233 writePinLow(F1); 233 gpio_write_pin_low(F1);
234 break; 234 break;
235 case 11: 235 case 11:
236 writePinHigh(B5); 236 gpio_write_pin_high(B5);
237 writePinLow(B7); 237 gpio_write_pin_low(B7);
238 writePinLow(F0); 238 gpio_write_pin_low(F0);
239 writePinLow(F1); 239 gpio_write_pin_low(F1);
240 break; 240 break;
241 case 12: 241 case 12:
242 writePinLow(B5); 242 gpio_write_pin_low(B5);
243 writePinHigh(B7); 243 gpio_write_pin_high(B7);
244 writePinHigh(F0); 244 gpio_write_pin_high(F0);
245 writePinLow(F1); 245 gpio_write_pin_low(F1);
246 break; 246 break;
247 case 13: 247 case 13:
248 writePinLow(B5); 248 gpio_write_pin_low(B5);
249 writePinHigh(B7); 249 gpio_write_pin_high(B7);
250 writePinLow(F0); 250 gpio_write_pin_low(F0);
251 writePinLow(F1); 251 gpio_write_pin_low(F1);
252 break; 252 break;
253 case 14: 253 case 14:
254 writePinLow(B5); 254 gpio_write_pin_low(B5);
255 writePinLow(B7); 255 gpio_write_pin_low(B7);
256 writePinLow(F0); 256 gpio_write_pin_low(F0);
257 writePinLow(F1); 257 gpio_write_pin_low(F1);
258 break; 258 break;
259 case 15: 259 case 15:
260 writePinLow(B5); 260 gpio_write_pin_low(B5);
261 writePinLow(B7); 261 gpio_write_pin_low(B7);
262 writePinHigh(F0); 262 gpio_write_pin_high(F0);
263 writePinLow(F1); 263 gpio_write_pin_low(F1);
264 break; 264 break;
265 case 16: 265 case 16:
266 writePinHigh(E6); 266 gpio_write_pin_high(E6);
267 break; 267 break;
268 } 268 }
269} 269}
270 270
271static void unselect_cols(void) { 271static void unselect_cols(void) {
272 //Native 272 //Native
273 writePinHigh(E6); 273 gpio_write_pin_high(E6);
274 274
275 //Demultiplexer 275 //Demultiplexer
276 writePinLow(B0); 276 gpio_write_pin_low(B0);
277 writePinLow(F1); 277 gpio_write_pin_low(F1);
278 writePinHigh(B5); 278 gpio_write_pin_high(B5);
279 writePinHigh(B7); 279 gpio_write_pin_high(B7);
280 writePinHigh(F0); 280 gpio_write_pin_high(F0);
281} 281}
282 282
283static void init_pins(void) { 283static void init_pins(void) {
284 unselect_cols(); 284 unselect_cols();
285 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 285 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
286 setPinInputHigh(row_pins[x]); 286 gpio_set_pin_input_high(row_pins[x]);
287 } 287 }
288 setPinOutput(B5); 288 gpio_set_pin_output(B5);
289 setPinOutput(B7); 289 gpio_set_pin_output(B7);
290 setPinOutput(F0); 290 gpio_set_pin_output(F0);
291 setPinOutput(B0); 291 gpio_set_pin_output(B0);
292 setPinOutput(F1); 292 gpio_set_pin_output(F1);
293 setPinOutput(E6); 293 gpio_set_pin_output(E6);
294} 294}
295 295
296static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 296static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
@@ -306,7 +306,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
306 matrix_row_t last_row_value = current_matrix[row_index]; 306 matrix_row_t last_row_value = current_matrix[row_index];
307 307
308 // Check row pin state 308 // Check row pin state
309 if (readPin(row_pins[row_index]) == 0) { 309 if (gpio_read_pin(row_pins[row_index]) == 0) {
310 // Pin LO, set col bit 310 // Pin LO, set col bit
311 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); 311 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
312 } else { 312 } else {
diff --git a/keyboards/machkeyboards/mach3/mach3.c b/keyboards/machkeyboards/mach3/mach3.c
index 2a417b0a02..948df5a066 100644
--- a/keyboards/machkeyboards/mach3/mach3.c
+++ b/keyboards/machkeyboards/mach3/mach3.c
@@ -35,8 +35,8 @@ led_config_t g_led_config = { {
35#endif 35#endif
36 36
37void keyboard_pre_init_kb(void) { 37void keyboard_pre_init_kb(void) {
38 setPinOutput(F5); 38 gpio_set_pin_output(F5);
39 writePinHigh(F5); 39 gpio_write_pin_high(F5);
40 40
41 keyboard_pre_init_user(); 41 keyboard_pre_init_user();
42} 42}
diff --git a/keyboards/macrocat/macrocat.c b/keyboards/macrocat/macrocat.c
index f00bb01410..0369a130dc 100644
--- a/keyboards/macrocat/macrocat.c
+++ b/keyboards/macrocat/macrocat.c
@@ -129,11 +129,11 @@ void encoder_triple_click(void) {
129void matrix_init_kb(void) { 129void matrix_init_kb(void) {
130 matrix_init_user(); 130 matrix_init_user();
131 131
132 setPinInputHigh(ENCODER_SWITCH); 132 gpio_set_pin_input_high(ENCODER_SWITCH);
133} 133}
134void matrix_scan_kb(void) { 134void matrix_scan_kb(void) {
135 matrix_scan_user(); 135 matrix_scan_user();
136 if (readPin(ENCODER_SWITCH)) { 136 if (gpio_read_pin(ENCODER_SWITCH)) {
137 if (encoder_pressed) { // release switch 137 if (encoder_pressed) { // release switch
138 encoder_pressed = 0; 138 encoder_pressed = 0;
139 encoder_press_combo += 1; 139 encoder_press_combo += 1;
diff --git a/keyboards/makeymakey/makeymakey.c b/keyboards/makeymakey/makeymakey.c
index 5b8edd4655..bfc8788375 100644
--- a/keyboards/makeymakey/makeymakey.c
+++ b/keyboards/makeymakey/makeymakey.c
@@ -26,7 +26,7 @@ void keyboard_post_init_kb(void) {
26 { 26 {
27 for(uint8_t col = 0; col < MATRIX_COLS; col++) 27 for(uint8_t col = 0; col < MATRIX_COLS; col++)
28 { 28 {
29 writePinLow(pins[row][col]); //Disable internal pull-up resistors 29 gpio_write_pin_low(pins[row][col]); //Disable internal pull-up resistors
30 } 30 }
31 } 31 }
32 32
@@ -35,8 +35,8 @@ void keyboard_post_init_kb(void) {
35 35
36void cycle_leds(void) { 36void cycle_leds(void) {
37 for(uint8_t i = 0; i < 3; i++) { 37 for(uint8_t i = 0; i < 3; i++) {
38 setPinInput(led_pins[i]); 38 gpio_set_pin_input(led_pins[i]);
39 writePinLow(led_pins[i]); 39 gpio_write_pin_low(led_pins[i]);
40 } 40 }
41 41
42 led_cycle_counter++; 42 led_cycle_counter++;
@@ -45,62 +45,62 @@ void cycle_leds(void) {
45 switch (led_cycle_counter) { 45 switch (led_cycle_counter) {
46 case 0: 46 case 0:
47 if (led_state[0]) { // Up Arrow 47 if (led_state[0]) { // Up Arrow
48 setPinInput(led_pins[0]); 48 gpio_set_pin_input(led_pins[0]);
49 writePinLow(led_pins[0]); 49 gpio_write_pin_low(led_pins[0]);
50 setPinOutput(led_pins[1]); 50 gpio_set_pin_output(led_pins[1]);
51 writePinHigh(led_pins[1]); 51 gpio_write_pin_high(led_pins[1]);
52 setPinOutput(led_pins[2]); 52 gpio_set_pin_output(led_pins[2]);
53 writePinLow(led_pins[2]); 53 gpio_write_pin_low(led_pins[2]);
54 } 54 }
55 break; 55 break;
56 case 1: 56 case 1:
57 if (led_state[1]) { // Down Arrow 57 if (led_state[1]) { // Down Arrow
58 setPinOutput(led_pins[0]); 58 gpio_set_pin_output(led_pins[0]);
59 writePinHigh(led_pins[0]); 59 gpio_write_pin_high(led_pins[0]);
60 setPinOutput(led_pins[1]); 60 gpio_set_pin_output(led_pins[1]);
61 writePinLow(led_pins[1]); 61 gpio_write_pin_low(led_pins[1]);
62 setPinInput(led_pins[2]); 62 gpio_set_pin_input(led_pins[2]);
63 writePinLow(led_pins[2]); 63 gpio_write_pin_low(led_pins[2]);
64 } 64 }
65 break; 65 break;
66 case 2: 66 case 2:
67 if (led_state[2]) { // Left Arrow 67 if (led_state[2]) { // Left Arrow
68 setPinOutput(led_pins[0]); 68 gpio_set_pin_output(led_pins[0]);
69 writePinLow(led_pins[0]); 69 gpio_write_pin_low(led_pins[0]);
70 setPinOutput(led_pins[1]); 70 gpio_set_pin_output(led_pins[1]);
71 writePinHigh(led_pins[1]); 71 gpio_write_pin_high(led_pins[1]);
72 setPinInput(led_pins[2]); 72 gpio_set_pin_input(led_pins[2]);
73 writePinLow(led_pins[2]); 73 gpio_write_pin_low(led_pins[2]);
74 } 74 }
75 break; 75 break;
76 case 3: 76 case 3:
77 if (led_state[3]) { // Right Arrow 77 if (led_state[3]) { // Right Arrow
78 setPinInput(led_pins[0]); 78 gpio_set_pin_input(led_pins[0]);
79 writePinLow(led_pins[0]); 79 gpio_write_pin_low(led_pins[0]);
80 setPinOutput(led_pins[1]); 80 gpio_set_pin_output(led_pins[1]);
81 writePinLow(led_pins[1]); 81 gpio_write_pin_low(led_pins[1]);
82 setPinOutput(led_pins[2]); 82 gpio_set_pin_output(led_pins[2]);
83 writePinHigh(led_pins[2]); 83 gpio_write_pin_high(led_pins[2]);
84 } 84 }
85 break; 85 break;
86 case 4: 86 case 4:
87 if (led_state[4]) { // Space 87 if (led_state[4]) { // Space
88 setPinOutput(led_pins[0]); 88 gpio_set_pin_output(led_pins[0]);
89 writePinLow(led_pins[0]); 89 gpio_write_pin_low(led_pins[0]);
90 setPinInput(led_pins[1]); 90 gpio_set_pin_input(led_pins[1]);
91 writePinLow(led_pins[1]); 91 gpio_write_pin_low(led_pins[1]);
92 setPinOutput(led_pins[2]); 92 gpio_set_pin_output(led_pins[2]);
93 writePinHigh(led_pins[2]); 93 gpio_write_pin_high(led_pins[2]);
94 } 94 }
95 break; 95 break;
96 case 5: 96 case 5:
97 if (led_state[5]) { // Right Click 97 if (led_state[5]) { // Right Click
98 setPinOutput(led_pins[0]); 98 gpio_set_pin_output(led_pins[0]);
99 writePinHigh(led_pins[0]); 99 gpio_write_pin_high(led_pins[0]);
100 setPinInput(led_pins[1]); 100 gpio_set_pin_input(led_pins[1]);
101 writePinLow(led_pins[1]); 101 gpio_write_pin_low(led_pins[1]);
102 setPinOutput(led_pins[2]); 102 gpio_set_pin_output(led_pins[2]);
103 writePinLow(led_pins[2]); 103 gpio_write_pin_low(led_pins[2]);
104 } 104 }
105 break; 105 break;
106 default: 106 default:
diff --git a/keyboards/mariorion_v25/mariorion_v25.c b/keyboards/mariorion_v25/mariorion_v25.c
index 7c57c29dfd..07a1999915 100644
--- a/keyboards/mariorion_v25/mariorion_v25.c
+++ b/keyboards/mariorion_v25/mariorion_v25.c
@@ -23,50 +23,50 @@ void matrix_init_kb(void) {
23 // put your keyboard start-up code here 23 // put your keyboard start-up code here
24 // runs once when the firmware starts up 24 // runs once when the firmware starts up
25 25
26 setPinOutput(INDICATOR_0); 26 gpio_set_pin_output(INDICATOR_0);
27 setPinOutput(INDICATOR_1); 27 gpio_set_pin_output(INDICATOR_1);
28 setPinOutput(INDICATOR_2); 28 gpio_set_pin_output(INDICATOR_2);
29 matrix_init_user(); 29 matrix_init_user();
30} 30}
31 31
32layer_state_t layer_state_set_kb(layer_state_t state) { 32layer_state_t layer_state_set_kb(layer_state_t state) {
33 switch (get_highest_layer(state)) { 33 switch (get_highest_layer(state)) {
34 case 1: 34 case 1:
35 writePinHigh(INDICATOR_0); 35 gpio_write_pin_high(INDICATOR_0);
36 writePinLow(INDICATOR_1); 36 gpio_write_pin_low(INDICATOR_1);
37 writePinLow(INDICATOR_2); 37 gpio_write_pin_low(INDICATOR_2);
38 break; 38 break;
39 case 2: 39 case 2:
40 writePinLow(INDICATOR_0); 40 gpio_write_pin_low(INDICATOR_0);
41 writePinHigh(INDICATOR_1); 41 gpio_write_pin_high(INDICATOR_1);
42 writePinLow(INDICATOR_2); 42 gpio_write_pin_low(INDICATOR_2);
43 break; 43 break;
44 case 3: 44 case 3:
45 writePinLow(INDICATOR_0); 45 gpio_write_pin_low(INDICATOR_0);
46 writePinLow(INDICATOR_1); 46 gpio_write_pin_low(INDICATOR_1);
47 writePinHigh(INDICATOR_2); 47 gpio_write_pin_high(INDICATOR_2);
48 break; 48 break;
49 default: 49 default:
50 writePinHigh(INDICATOR_0); 50 gpio_write_pin_high(INDICATOR_0);
51 writePinHigh(INDICATOR_1); 51 gpio_write_pin_high(INDICATOR_1);
52 writePinHigh(INDICATOR_2); 52 gpio_write_pin_high(INDICATOR_2);
53 break; 53 break;
54 } 54 }
55 return layer_state_set_user(state); 55 return layer_state_set_user(state);
56} 56}
57 57
58void suspend_power_down_kb(void) { 58void suspend_power_down_kb(void) {
59 writePinLow(INDICATOR_0); 59 gpio_write_pin_low(INDICATOR_0);
60 writePinLow(INDICATOR_1); 60 gpio_write_pin_low(INDICATOR_1);
61 writePinLow(INDICATOR_2); 61 gpio_write_pin_low(INDICATOR_2);
62 62
63 suspend_power_down_user(); 63 suspend_power_down_user();
64} 64}
65 65
66void suspend_wakeup_init_kb(void) { 66void suspend_wakeup_init_kb(void) {
67 writePinHigh(INDICATOR_0); 67 gpio_write_pin_high(INDICATOR_0);
68 writePinHigh(INDICATOR_1); 68 gpio_write_pin_high(INDICATOR_1);
69 writePinHigh(INDICATOR_2); 69 gpio_write_pin_high(INDICATOR_2);
70 70
71 suspend_wakeup_init_user(); 71 suspend_wakeup_init_user();
72} 72}
diff --git a/keyboards/marksard/leftover30/leftover30.c b/keyboards/marksard/leftover30/leftover30.c
index 6d8b64cd90..cea0de703a 100644
--- a/keyboards/marksard/leftover30/leftover30.c
+++ b/keyboards/marksard/leftover30/leftover30.c
@@ -22,16 +22,16 @@
22 22
23void keyboard_pre_init_user(void) { 23void keyboard_pre_init_user(void) {
24 /* Set CAPSLOCK indicator pin as output */ 24 /* Set CAPSLOCK indicator pin as output */
25 setPinOutput(D1); 25 gpio_set_pin_output(D1);
26 /* Set NUMLOCK indicator pin as output */ 26 /* Set NUMLOCK indicator pin as output */
27 setPinOutput(D2); 27 gpio_set_pin_output(D2);
28} 28}
29 29
30bool led_update_kb(led_t led_state) { 30bool led_update_kb(led_t led_state) {
31 bool res = led_update_user(led_state); 31 bool res = led_update_user(led_state);
32 if(res) { 32 if(res) {
33 writePin(D2, led_state.num_lock); 33 gpio_write_pin(D2, led_state.num_lock);
34 writePin(D1, led_state.caps_lock); 34 gpio_write_pin(D1, led_state.caps_lock);
35 } 35 }
36 return res; 36 return res;
37} 37}
diff --git a/keyboards/masterworks/classy_tkl/rev_a/rev_a.c b/keyboards/masterworks/classy_tkl/rev_a/rev_a.c
index 3a3446d7ae..6e01c217d2 100644
--- a/keyboards/masterworks/classy_tkl/rev_a/rev_a.c
+++ b/keyboards/masterworks/classy_tkl/rev_a/rev_a.c
@@ -26,8 +26,8 @@ void matrix_init_kb(void) {
26 // put your keyboard start-up code here 26 // put your keyboard start-up code here
27 // runs once when the firmware starts up 27 // runs once when the firmware starts up
28 28
29 setPinOutput(CAPS_PIN); 29 gpio_set_pin_output(CAPS_PIN);
30 setPinOutput(SCROLL_PIN); 30 gpio_set_pin_output(SCROLL_PIN);
31 31
32 matrix_init_user(); 32 matrix_init_user();
33} 33}
@@ -35,8 +35,8 @@ void matrix_init_kb(void) {
35bool led_update_kb(led_t led_state) { 35bool led_update_kb(led_t led_state) {
36 bool res = led_update_user(led_state); 36 bool res = led_update_user(led_state);
37 if(res) { 37 if(res) {
38 writePin(CAPS_PIN, led_state.caps_lock); 38 gpio_write_pin(CAPS_PIN, led_state.caps_lock);
39 writePin(SCROLL_PIN, led_state.scroll_lock); 39 gpio_write_pin(SCROLL_PIN, led_state.scroll_lock);
40 } 40 }
41 return res; 41 return res;
42} 42}
diff --git a/keyboards/matrix/cain_re/cain_re.c b/keyboards/matrix/cain_re/cain_re.c
index 5151f021ba..6dc24f2292 100644
--- a/keyboards/matrix/cain_re/cain_re.c
+++ b/keyboards/matrix/cain_re/cain_re.c
@@ -21,9 +21,9 @@
21 21
22void matrix_init_kb(void) 22void matrix_init_kb(void)
23{ 23{
24 setPinOutput(NUM_PIN); 24 gpio_set_pin_output(NUM_PIN);
25 setPinOutput(CAPS_PIN); 25 gpio_set_pin_output(CAPS_PIN);
26 setPinOutput(SCROLL_PIN); 26 gpio_set_pin_output(SCROLL_PIN);
27 27
28 matrix_init_user(); 28 matrix_init_user();
29} 29}
@@ -32,9 +32,9 @@ bool led_update_kb(led_t led_state)
32{ 32{
33 bool res = led_update_user(led_state); 33 bool res = led_update_user(led_state);
34 if (res) { 34 if (res) {
35 writePin(NUM_PIN, led_state.num_lock); 35 gpio_write_pin(NUM_PIN, led_state.num_lock);
36 writePin(CAPS_PIN, led_state.caps_lock); 36 gpio_write_pin(CAPS_PIN, led_state.caps_lock);
37 writePin(SCROLL_PIN, led_state.scroll_lock); 37 gpio_write_pin(SCROLL_PIN, led_state.scroll_lock);
38 } 38 }
39 return res; 39 return res;
40} 40}
diff --git a/keyboards/matrix/falcon/falcon.c b/keyboards/matrix/falcon/falcon.c
index 33d05a8a29..74677ab0d1 100644
--- a/keyboards/matrix/falcon/falcon.c
+++ b/keyboards/matrix/falcon/falcon.c
@@ -18,11 +18,11 @@
18void matrix_init_kb(void) 18void matrix_init_kb(void)
19{ 19{
20 // enable charge 20 // enable charge
21 setPinOutput(CHG_EN_PIN); 21 gpio_set_pin_output(CHG_EN_PIN);
22 writePinHigh(CHG_EN_PIN); 22 gpio_write_pin_high(CHG_EN_PIN);
23 23
24 // enable led power 24 // enable led power
25 setPinOutput(LED_POWER_PIN); 25 gpio_set_pin_output(LED_POWER_PIN);
26 writePinHigh(LED_POWER_PIN); 26 gpio_write_pin_high(LED_POWER_PIN);
27 27
28} 28}
diff --git a/keyboards/matrix/m12og/rev1/matrix.c b/keyboards/matrix/m12og/rev1/matrix.c
index c127aa35b9..3317abbe29 100644
--- a/keyboards/matrix/m12og/rev1/matrix.c
+++ b/keyboards/matrix/m12og/rev1/matrix.c
@@ -22,22 +22,22 @@ static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
22static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; 22static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
23 23
24static void select_col(uint8_t col) { 24static void select_col(uint8_t col) {
25 setPinOutput(col_pins[col]); 25 gpio_set_pin_output(col_pins[col]);
26 writePinHigh(col_pins[col]); 26 gpio_write_pin_high(col_pins[col]);
27} 27}
28 28
29static void unselect_col(uint8_t col) { setPinInputLow(col_pins[col]); } 29static void unselect_col(uint8_t col) { gpio_set_pin_input_low(col_pins[col]); }
30 30
31static void unselect_cols(void) { 31static void unselect_cols(void) {
32 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 32 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
33 setPinInputLow(col_pins[x]); 33 gpio_set_pin_input_low(col_pins[x]);
34 } 34 }
35} 35}
36 36
37static void init_pins(void) { 37static void init_pins(void) {
38 unselect_cols(); 38 unselect_cols();
39 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 39 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
40 setPinInputLow(row_pins[x]); 40 gpio_set_pin_input_low(row_pins[x]);
41 } 41 }
42} 42}
43 43
@@ -55,7 +55,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
55 matrix_row_t current_row_value = last_row_value; 55 matrix_row_t current_row_value = last_row_value;
56 56
57 // Check row pin state 57 // Check row pin state
58 if (readPin(row_pins[row_index]) != 0) { 58 if (gpio_read_pin(row_pins[row_index]) != 0) {
59 // Pin LO, set col bit 59 // Pin LO, set col bit
60 current_row_value |= (MATRIX_ROW_SHIFTER << current_col); 60 current_row_value |= (MATRIX_ROW_SHIFTER << current_col);
61 } else { 61 } else {
diff --git a/keyboards/matrix/m12og/rev1/rev1.c b/keyboards/matrix/m12og/rev1/rev1.c
index f517703c60..7506edc8e9 100644
--- a/keyboards/matrix/m12og/rev1/rev1.c
+++ b/keyboards/matrix/m12og/rev1/rev1.c
@@ -17,7 +17,7 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void board_init(void) { 19void board_init(void) {
20 writePinLow(A8); 20 gpio_write_pin_low(A8);
21} 21}
22 22
23void bootloader_jump(void) { 23void bootloader_jump(void) {
diff --git a/keyboards/matrix/m12og/rev2/rev2.c b/keyboards/matrix/m12og/rev2/rev2.c
index fb424b164f..bf6129c806 100644
--- a/keyboards/matrix/m12og/rev2/rev2.c
+++ b/keyboards/matrix/m12og/rev2/rev2.c
@@ -4,20 +4,20 @@
4 4
5#include "quantum.h" 5#include "quantum.h"
6 6
7void matrix_init_kb(void) { 7void matrix_init_user(void) {
8 setPinOutput(C6); 8 gpio_set_pin_output(C6);
9 setPinOutput(B2); 9 gpio_set_pin_output(B2);
10 setPinOutput(B1); 10 gpio_set_pin_output(B1);
11 11
12 matrix_init_user(); 12 matrix_init_user();
13} 13}
14 14
15bool led_update_kb(led_t led_state) { 15bool led_update_kb(led_t led_state) {
16 bool res = led_update_user(led_state); 16 bool res = led_update_user(led_state);
17 if (res) { 17 if (res) {
18 writePin(B1, !led_state.num_lock); 18 gpio_write_pin(B1, !led_state.num_lock);
19 writePin(C6, !led_state.caps_lock); 19 gpio_write_pin(C6, !led_state.caps_lock);
20 writePin(B2, !led_state.scroll_lock); 20 gpio_write_pin(B2, !led_state.scroll_lock);
21 } 21 }
22 return res; 22 return res;
23} 23}
diff --git a/keyboards/mc_76k/mc_76k.c b/keyboards/mc_76k/mc_76k.c
index 51e9d55406..44d2374b1c 100644
--- a/keyboards/mc_76k/mc_76k.c
+++ b/keyboards/mc_76k/mc_76k.c
@@ -17,18 +17,18 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void keyboard_pre_init_kb (void) { 19void keyboard_pre_init_kb (void) {
20 setPinOutput(D2); 20 gpio_set_pin_output(D2);
21} 21}
22 22
23bool led_update_kb(led_t led_state) { 23bool led_update_kb(led_t led_state) {
24 bool res = led_update_user(led_state); 24 bool res = led_update_user(led_state);
25 if(res) { 25 if(res) {
26 // writePin sets the pin high for 1 and low for 0. 26 // gpio_write_pin sets the pin high for 1 and low for 0.
27 // In this example the pins are inverted, setting 27 // In this example the pins are inverted, setting
28 // it low/0 turns it on, and high/1 turns the LED off. 28 // it low/0 turns it on, and high/1 turns the LED off.
29 // This behavior depends on whether the LED is between the pin 29 // This behavior depends on whether the LED is between the pin
30 // and VCC or the pin and GND. 30 // and VCC or the pin and GND.
31 writePin(D2, !led_state.caps_lock); 31 gpio_write_pin(D2, !led_state.caps_lock);
32 } 32 }
33 return res; 33 return res;
34} 34}
diff --git a/keyboards/mechlovin/adelais/standard_led/avr/rev1/matrix.c b/keyboards/mechlovin/adelais/standard_led/avr/rev1/matrix.c
index 864de5e660..c7807bbc90 100644
--- a/keyboards/mechlovin/adelais/standard_led/avr/rev1/matrix.c
+++ b/keyboards/mechlovin/adelais/standard_led/avr/rev1/matrix.c
@@ -37,7 +37,7 @@ static void init_pins(void) {
37 for (int col = 0; col < MATRIX_COLS; col++) { 37 for (int col = 0; col < MATRIX_COLS; col++) {
38 pin_t pin = direct_pins[row][col]; 38 pin_t pin = direct_pins[row][col];
39 if (pin != NO_PIN) { 39 if (pin != NO_PIN) {
40 setPinInputHigh(pin); 40 gpio_set_pin_input_high(pin);
41 } 41 }
42 } 42 }
43 } 43 }
@@ -50,7 +50,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
50 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 50 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
51 pin_t pin = direct_pins[current_row][col_index]; 51 pin_t pin = direct_pins[current_row][col_index];
52 if (pin != NO_PIN) { 52 if (pin != NO_PIN) {
53 current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); 53 current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
54 } 54 }
55 } 55 }
56 56
@@ -97,94 +97,94 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
97static void select_col(uint8_t col) { 97static void select_col(uint8_t col) {
98 switch (col) { 98 switch (col) {
99 case 0: 99 case 0:
100 writePinLow(F4); 100 gpio_write_pin_low(F4);
101 writePinLow(F1); 101 gpio_write_pin_low(F1);
102 writePinHigh(F0); 102 gpio_write_pin_high(F0);
103 writePinHigh(F5); 103 gpio_write_pin_high(F5);
104 break; 104 break;
105 case 1: 105 case 1:
106 writePinLow(F4); 106 gpio_write_pin_low(F4);
107 writePinHigh(F1); 107 gpio_write_pin_high(F1);
108 writePinLow(F0); 108 gpio_write_pin_low(F0);
109 writePinHigh(F5); 109 gpio_write_pin_high(F5);
110 break; 110 break;
111 case 2: 111 case 2:
112 writePinLow(F4); 112 gpio_write_pin_low(F4);
113 writePinHigh(F1); 113 gpio_write_pin_high(F1);
114 writePinHigh(F0); 114 gpio_write_pin_high(F0);
115 writePinHigh(F5); 115 gpio_write_pin_high(F5);
116 break; 116 break;
117 case 3: 117 case 3:
118 writePinHigh(F4); 118 gpio_write_pin_high(F4);
119 writePinLow(F1); 119 gpio_write_pin_low(F1);
120 writePinLow(F0); 120 gpio_write_pin_low(F0);
121 writePinHigh(F5); 121 gpio_write_pin_high(F5);
122 break; 122 break;
123 case 4: 123 case 4:
124 writePinHigh(F4); 124 gpio_write_pin_high(F4);
125 writePinLow(F1); 125 gpio_write_pin_low(F1);
126 writePinHigh(F0); 126 gpio_write_pin_high(F0);
127 writePinHigh(F5); 127 gpio_write_pin_high(F5);
128 break; 128 break;
129 case 5: 129 case 5:
130 writePinHigh(F4); 130 gpio_write_pin_high(F4);
131 writePinHigh(F1); 131 gpio_write_pin_high(F1);
132 writePinHigh(F0); 132 gpio_write_pin_high(F0);
133 writePinHigh(F5); 133 gpio_write_pin_high(F5);
134 break; 134 break;
135 case 6: 135 case 6:
136 writePinHigh(F4); 136 gpio_write_pin_high(F4);
137 writePinHigh(F1); 137 gpio_write_pin_high(F1);
138 writePinHigh(F0); 138 gpio_write_pin_high(F0);
139 writePinHigh(F6); 139 gpio_write_pin_high(F6);
140 break; 140 break;
141 case 7: 141 case 7:
142 writePinLow(F4); 142 gpio_write_pin_low(F4);
143 writePinLow(F1); 143 gpio_write_pin_low(F1);
144 writePinLow(F0); 144 gpio_write_pin_low(F0);
145 writePinHigh(F6); 145 gpio_write_pin_high(F6);
146 break; 146 break;
147 case 8: 147 case 8:
148 writePinLow(F4); 148 gpio_write_pin_low(F4);
149 writePinLow(F1); 149 gpio_write_pin_low(F1);
150 writePinHigh(F0); 150 gpio_write_pin_high(F0);
151 writePinHigh(F6); 151 gpio_write_pin_high(F6);
152 break; 152 break;
153 case 9: 153 case 9:
154 writePinLow(F4); 154 gpio_write_pin_low(F4);
155 writePinHigh(F1); 155 gpio_write_pin_high(F1);
156 writePinLow(F0); 156 gpio_write_pin_low(F0);
157 writePinHigh(F6); 157 gpio_write_pin_high(F6);
158 break; 158 break;
159 case 10: 159 case 10:
160 writePinLow(F4); 160 gpio_write_pin_low(F4);
161 writePinHigh(F1); 161 gpio_write_pin_high(F1);
162 writePinHigh(F0); 162 gpio_write_pin_high(F0);
163 writePinHigh(F6); 163 gpio_write_pin_high(F6);
164 break; 164 break;
165 case 11: 165 case 11:
166 writePinHigh(F4); 166 gpio_write_pin_high(F4);
167 writePinLow(F1); 167 gpio_write_pin_low(F1);
168 writePinLow(F0); 168 gpio_write_pin_low(F0);
169 writePinHigh(F6); 169 gpio_write_pin_high(F6);
170 break; 170 break;
171 case 12: 171 case 12:
172 writePinHigh(F4); 172 gpio_write_pin_high(F4);
173 writePinLow(F1); 173 gpio_write_pin_low(F1);
174 writePinHigh(F0); 174 gpio_write_pin_high(F0);
175 writePinHigh(F6); 175 gpio_write_pin_high(F6);
176 break; 176 break;
177 case 13: 177 case 13:
178 writePinHigh(F4); 178 gpio_write_pin_high(F4);
179 writePinHigh(F1); 179 gpio_write_pin_high(F1);
180 writePinLow(F0); 180 gpio_write_pin_low(F0);
181 writePinHigh(F6); 181 gpio_write_pin_high(F6);
182 break; 182 break;
183 case 14: 183 case 14:
184 writePinLow(F4); 184 gpio_write_pin_low(F4);
185 writePinLow(F1); 185 gpio_write_pin_low(F1);
186 writePinLow(F0); 186 gpio_write_pin_low(F0);
187 writePinHigh(F5); 187 gpio_write_pin_high(F5);
188 break; 188 break;
189 } 189 }
190} 190}
@@ -192,94 +192,94 @@ static void select_col(uint8_t col) {
192static void unselect_col(uint8_t col) { 192static void unselect_col(uint8_t col) {
193 switch (col) { 193 switch (col) {
194 case 0: 194 case 0:
195 writePinHigh(F4); 195 gpio_write_pin_high(F4);
196 writePinHigh(F1); 196 gpio_write_pin_high(F1);
197 writePinLow(F0); 197 gpio_write_pin_low(F0);
198 writePinLow(F5); 198 gpio_write_pin_low(F5);
199 break; 199 break;
200 case 1: 200 case 1:
201 writePinHigh(F4); 201 gpio_write_pin_high(F4);
202 writePinLow(F1); 202 gpio_write_pin_low(F1);
203 writePinHigh(F0); 203 gpio_write_pin_high(F0);
204 writePinLow(F5); 204 gpio_write_pin_low(F5);
205 break; 205 break;
206 case 2: 206 case 2:
207 writePinHigh(F4); 207 gpio_write_pin_high(F4);
208 writePinLow(F1); 208 gpio_write_pin_low(F1);
209 writePinLow(F0); 209 gpio_write_pin_low(F0);
210 writePinLow(F5); 210 gpio_write_pin_low(F5);
211 break; 211 break;
212 case 3: 212 case 3:
213 writePinLow(F4); 213 gpio_write_pin_low(F4);
214 writePinHigh(F1); 214 gpio_write_pin_high(F1);
215 writePinHigh(F0); 215 gpio_write_pin_high(F0);
216 writePinLow(F5); 216 gpio_write_pin_low(F5);
217 break; 217 break;
218 case 4: 218 case 4:
219 writePinLow(F4); 219 gpio_write_pin_low(F4);
220 writePinHigh(F1); 220 gpio_write_pin_high(F1);
221 writePinLow(F0); 221 gpio_write_pin_low(F0);
222 writePinLow(F5); 222 gpio_write_pin_low(F5);
223 break; 223 break;
224 case 5: 224 case 5:
225 writePinLow(F4); 225 gpio_write_pin_low(F4);
226 writePinLow(F1); 226 gpio_write_pin_low(F1);
227 writePinLow(F0); 227 gpio_write_pin_low(F0);
228 writePinLow(F5); 228 gpio_write_pin_low(F5);
229 break; 229 break;
230 case 6: 230 case 6:
231 writePinLow(F4); 231 gpio_write_pin_low(F4);
232 writePinLow(F1); 232 gpio_write_pin_low(F1);
233 writePinLow(F0); 233 gpio_write_pin_low(F0);
234 writePinLow(F6); 234 gpio_write_pin_low(F6);
235 break; 235 break;
236 case 7: 236 case 7:
237 writePinHigh(F4); 237 gpio_write_pin_high(F4);
238 writePinHigh(F1); 238 gpio_write_pin_high(F1);
239 writePinHigh(F0); 239 gpio_write_pin_high(F0);
240 writePinLow(F6); 240 gpio_write_pin_low(F6);
241 break; 241 break;
242 case 8: 242 case 8:
243 writePinHigh(F4); 243 gpio_write_pin_high(F4);
244 writePinHigh(F1); 244 gpio_write_pin_high(F1);
245 writePinLow(F0); 245 gpio_write_pin_low(F0);
246 writePinLow(F6); 246 gpio_write_pin_low(F6);
247 break; 247 break;
248 case 9: 248 case 9:
249 writePinHigh(F4); 249 gpio_write_pin_high(F4);
250 writePinLow(F1); 250 gpio_write_pin_low(F1);
251 writePinHigh(F0); 251 gpio_write_pin_high(F0);
252 writePinLow(F6); 252 gpio_write_pin_low(F6);
253 break; 253 break;
254 case 10: 254 case 10:
255 writePinHigh(F4); 255 gpio_write_pin_high(F4);
256 writePinLow(F1); 256 gpio_write_pin_low(F1);
257 writePinLow(F0); 257 gpio_write_pin_low(F0);
258 writePinLow(F6); 258 gpio_write_pin_low(F6);
259 break; 259 break;
260 case 11: 260 case 11:
261 writePinLow(F4); 261 gpio_write_pin_low(F4);
262 writePinHigh(F1); 262 gpio_write_pin_high(F1);
263 writePinHigh(F0); 263 gpio_write_pin_high(F0);
264 writePinLow(F6); 264 gpio_write_pin_low(F6);
265 break; 265 break;
266 case 12: 266 case 12:
267 writePinLow(F4); 267 gpio_write_pin_low(F4);
268 writePinHigh(F1); 268 gpio_write_pin_high(F1);
269 writePinLow(F0); 269 gpio_write_pin_low(F0);
270 writePinLow(F6); 270 gpio_write_pin_low(F6);
271 break; 271 break;
272 case 13: 272 case 13:
273 writePinLow(F4); 273 gpio_write_pin_low(F4);
274 writePinLow(F1); 274 gpio_write_pin_low(F1);
275 writePinHigh(F0); 275 gpio_write_pin_high(F0);
276 writePinLow(F6); 276 gpio_write_pin_low(F6);
277 break; 277 break;
278 case 14: 278 case 14:
279 writePinHigh(F4); 279 gpio_write_pin_high(F4);
280 writePinHigh(F1); 280 gpio_write_pin_high(F1);
281 writePinHigh(F0); 281 gpio_write_pin_high(F0);
282 writePinLow(F5); 282 gpio_write_pin_low(F5);
283 break; 283 break;
284 } 284 }
285} 285}
@@ -287,23 +287,23 @@ static void unselect_col(uint8_t col) {
287static void unselect_cols(void) { 287static void unselect_cols(void) {
288 288
289 //Demultiplexer 289 //Demultiplexer
290 writePinHigh(F0); 290 gpio_write_pin_high(F0);
291 writePinHigh(F1); 291 gpio_write_pin_high(F1);
292 writePinHigh(F4); 292 gpio_write_pin_high(F4);
293 writePinLow(F5); 293 gpio_write_pin_low(F5);
294 writePinLow(F6); 294 gpio_write_pin_low(F6);
295} 295}
296 296
297static void init_pins(void) { 297static void init_pins(void) {
298 unselect_cols(); 298 unselect_cols();
299 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 299 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
300 setPinInputHigh(row_pins[x]); 300 gpio_set_pin_input_high(row_pins[x]);
301 } 301 }
302 setPinOutput(F0); 302 gpio_set_pin_output(F0);
303 setPinOutput(F1); 303 gpio_set_pin_output(F1);
304 setPinOutput(F4); 304 gpio_set_pin_output(F4);
305 setPinOutput(F5); 305 gpio_set_pin_output(F5);
306 setPinOutput(F6); 306 gpio_set_pin_output(F6);
307} 307}
308 308
309static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 309static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
@@ -319,7 +319,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
319 matrix_row_t last_row_value = current_matrix[row_index]; 319 matrix_row_t last_row_value = current_matrix[row_index];
320 320
321 // Check row pin state 321 // Check row pin state
322 if (readPin(row_pins[row_index]) == 0) { 322 if (gpio_read_pin(row_pins[row_index]) == 0) {
323 // Pin LO, set col bit 323 // Pin LO, set col bit
324 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); 324 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
325 } else { 325 } else {
diff --git a/keyboards/mechlovin/hannah910/hannah910.c b/keyboards/mechlovin/hannah910/hannah910.c
index 0208e16348..c372c98ce0 100644
--- a/keyboards/mechlovin/hannah910/hannah910.c
+++ b/keyboards/mechlovin/hannah910/hannah910.c
@@ -16,17 +16,17 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void led_init_ports(void) { 18void led_init_ports(void) {
19 setPinOutput(B2); 19 gpio_set_pin_output(B2);
20 setPinOutput(D0); 20 gpio_set_pin_output(D0);
21 setPinOutput(D1); 21 gpio_set_pin_output(D1);
22 setPinOutput(D2); 22 gpio_set_pin_output(D2);
23 23
24} 24}
25 25
26bool led_update_kb(led_t led_state) { 26bool led_update_kb(led_t led_state) {
27 bool res = led_update_user(led_state); 27 bool res = led_update_user(led_state);
28 if(res) { 28 if(res) {
29 writePin(B2, led_state.caps_lock); 29 gpio_write_pin(B2, led_state.caps_lock);
30 } 30 }
31 return res; 31 return res;
32} 32}
@@ -35,22 +35,22 @@ layer_state_t layer_state_set_user(layer_state_t state)
35{ 35{
36 // if on layer 1, turn on D2 LED, otherwise off. 36 // if on layer 1, turn on D2 LED, otherwise off.
37 if (get_highest_layer(state) == 1) { 37 if (get_highest_layer(state) == 1) {
38 writePinHigh(D2); 38 gpio_write_pin_high(D2);
39 } else { 39 } else {
40 writePinLow(D2); 40 gpio_write_pin_low(D2);
41 } 41 }
42 // if on layer 2, turn on D1 LED, otherwise off. 42 // if on layer 2, turn on D1 LED, otherwise off.
43 if (get_highest_layer(state) == 2) { 43 if (get_highest_layer(state) == 2) {
44 writePinHigh(D1); 44 gpio_write_pin_high(D1);
45 } else { 45 } else {
46 writePinLow(D1); 46 gpio_write_pin_low(D1);
47 } 47 }
48 48
49 // if on layer 3, turn on D0 LED, otherwise off. 49 // if on layer 3, turn on D0 LED, otherwise off.
50 if (get_highest_layer(state) == 3) { 50 if (get_highest_layer(state) == 3) {
51 writePinHigh(D0); 51 gpio_write_pin_high(D0);
52 } else { 52 } else {
53 writePinLow(D0); 53 gpio_write_pin_low(D0);
54 } 54 }
55 55
56 return state; 56 return state;
diff --git a/keyboards/mechlovin/infinity87/rev2/matrix.c b/keyboards/mechlovin/infinity87/rev2/matrix.c
index 62a56f687c..16bee61ad0 100644
--- a/keyboards/mechlovin/infinity87/rev2/matrix.c
+++ b/keyboards/mechlovin/infinity87/rev2/matrix.c
@@ -37,7 +37,7 @@ static void init_pins(void) {
37 for (int col = 0; col < MATRIX_COLS; col++) { 37 for (int col = 0; col < MATRIX_COLS; col++) {
38 pin_t pin = direct_pins[row][col]; 38 pin_t pin = direct_pins[row][col];
39 if (pin != NO_PIN) { 39 if (pin != NO_PIN) {
40 setPinInputHigh(pin); 40 gpio_set_pin_input_high(pin);
41 } 41 }
42 } 42 }
43 } 43 }
@@ -50,7 +50,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
50 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 50 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
51 pin_t pin = direct_pins[current_row][col_index]; 51 pin_t pin = direct_pins[current_row][col_index];
52 if (pin != NO_PIN) { 52 if (pin != NO_PIN) {
53 current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); 53 current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
54 } 54 }
55 } 55 }
56 56
@@ -101,103 +101,103 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
101static void select_col(uint8_t col) { 101static void select_col(uint8_t col) {
102 switch (col) { 102 switch (col) {
103 case 0: 103 case 0:
104 writePinLow(B5); 104 gpio_write_pin_low(B5);
105 writePinLow(B7); 105 gpio_write_pin_low(B7);
106 writePinLow(F0); 106 gpio_write_pin_low(F0);
107 writePinHigh(B0); 107 gpio_write_pin_high(B0);
108 break; 108 break;
109 case 1: 109 case 1:
110 writePinLow(B5); 110 gpio_write_pin_low(B5);
111 writePinLow(B7); 111 gpio_write_pin_low(B7);
112 writePinHigh(F0); 112 gpio_write_pin_high(F0);
113 writePinHigh(B0); 113 gpio_write_pin_high(B0);
114 break; 114 break;
115 case 2: 115 case 2:
116 writePinLow(B5); 116 gpio_write_pin_low(B5);
117 writePinHigh(B7); 117 gpio_write_pin_high(B7);
118 writePinLow(F0); 118 gpio_write_pin_low(F0);
119 writePinHigh(B0); 119 gpio_write_pin_high(B0);
120 break; 120 break;
121 case 3: 121 case 3:
122 writePinLow(B5); 122 gpio_write_pin_low(B5);
123 writePinHigh(B7); 123 gpio_write_pin_high(B7);
124 writePinHigh(F0); 124 gpio_write_pin_high(F0);
125 writePinHigh(B0); 125 gpio_write_pin_high(B0);
126 break; 126 break;
127 case 4: 127 case 4:
128 writePinHigh(B5); 128 gpio_write_pin_high(B5);
129 writePinLow(B7); 129 gpio_write_pin_low(B7);
130 writePinLow(F0); 130 gpio_write_pin_low(F0);
131 writePinHigh(B0); 131 gpio_write_pin_high(B0);
132 break; 132 break;
133 case 5: 133 case 5:
134 writePinHigh(B5); 134 gpio_write_pin_high(B5);
135 writePinLow(B7); 135 gpio_write_pin_low(B7);
136 writePinHigh(F0); 136 gpio_write_pin_high(F0);
137 writePinHigh(B0); 137 gpio_write_pin_high(B0);
138 break; 138 break;
139 case 6: 139 case 6:
140 writePinHigh(B5); 140 gpio_write_pin_high(B5);
141 writePinHigh(B7); 141 gpio_write_pin_high(B7);
142 writePinLow(F0); 142 gpio_write_pin_low(F0);
143 writePinHigh(B0); 143 gpio_write_pin_high(B0);
144 break; 144 break;
145 case 7: 145 case 7:
146 writePinHigh(B5); 146 gpio_write_pin_high(B5);
147 writePinHigh(B7); 147 gpio_write_pin_high(B7);
148 writePinHigh(F0); 148 gpio_write_pin_high(F0);
149 writePinHigh(B0); 149 gpio_write_pin_high(B0);
150 break; 150 break;
151 case 8: 151 case 8:
152 writePinLow(B5); 152 gpio_write_pin_low(B5);
153 writePinLow(B7); 153 gpio_write_pin_low(B7);
154 writePinLow(F0); 154 gpio_write_pin_low(F0);
155 writePinHigh(F1); 155 gpio_write_pin_high(F1);
156 break; 156 break;
157 case 9: 157 case 9:
158 writePinLow(B5); 158 gpio_write_pin_low(B5);
159 writePinLow(B7); 159 gpio_write_pin_low(B7);
160 writePinHigh(F0); 160 gpio_write_pin_high(F0);
161 writePinHigh(F1); 161 gpio_write_pin_high(F1);
162 break; 162 break;
163 case 10: 163 case 10:
164 writePinLow(B5); 164 gpio_write_pin_low(B5);
165 writePinHigh(B7); 165 gpio_write_pin_high(B7);
166 writePinLow(F0); 166 gpio_write_pin_low(F0);
167 writePinHigh(F1); 167 gpio_write_pin_high(F1);
168 break; 168 break;
169 case 11: 169 case 11:
170 writePinLow(B5); 170 gpio_write_pin_low(B5);
171 writePinHigh(B7); 171 gpio_write_pin_high(B7);
172 writePinHigh(F0); 172 gpio_write_pin_high(F0);
173 writePinHigh(F1); 173 gpio_write_pin_high(F1);
174 break; 174 break;
175 case 12: 175 case 12:
176 writePinHigh(B5); 176 gpio_write_pin_high(B5);
177 writePinLow(B7); 177 gpio_write_pin_low(B7);
178 writePinLow(F0); 178 gpio_write_pin_low(F0);
179 writePinHigh(F1); 179 gpio_write_pin_high(F1);
180 break; 180 break;
181 case 13: 181 case 13:
182 writePinHigh(B5); 182 gpio_write_pin_high(B5);
183 writePinLow(B7); 183 gpio_write_pin_low(B7);
184 writePinHigh(F0); 184 gpio_write_pin_high(F0);
185 writePinHigh(F1); 185 gpio_write_pin_high(F1);
186 break; 186 break;
187 case 14: 187 case 14:
188 writePinHigh(B5); 188 gpio_write_pin_high(B5);
189 writePinHigh(B7); 189 gpio_write_pin_high(B7);
190 writePinHigh(F0); 190 gpio_write_pin_high(F0);
191 writePinHigh(F1); 191 gpio_write_pin_high(F1);
192 break; 192 break;
193 case 15: 193 case 15:
194 writePinHigh(B5); 194 gpio_write_pin_high(B5);
195 writePinHigh(B7); 195 gpio_write_pin_high(B7);
196 writePinLow(F0); 196 gpio_write_pin_low(F0);
197 writePinHigh(F1); 197 gpio_write_pin_high(F1);
198 break; 198 break;
199 case 16: 199 case 16:
200 writePinLow(E6); 200 gpio_write_pin_low(E6);
201 break; 201 break;
202 } 202 }
203} 203}
@@ -205,130 +205,130 @@ static void select_col(uint8_t col) {
205static void unselect_col(uint8_t col) { 205static void unselect_col(uint8_t col) {
206 switch (col) { 206 switch (col) {
207 case 0: 207 case 0:
208 writePinHigh(B5); 208 gpio_write_pin_high(B5);
209 writePinHigh(B7); 209 gpio_write_pin_high(B7);
210 writePinHigh(F0); 210 gpio_write_pin_high(F0);
211 writePinLow(B0); 211 gpio_write_pin_low(B0);
212 break; 212 break;
213 case 1: 213 case 1:
214 writePinHigh(B5); 214 gpio_write_pin_high(B5);
215 writePinHigh(B7); 215 gpio_write_pin_high(B7);
216 writePinLow(F0); 216 gpio_write_pin_low(F0);
217 writePinLow(B0); 217 gpio_write_pin_low(B0);
218 break; 218 break;
219 case 2: 219 case 2:
220 writePinHigh(B5); 220 gpio_write_pin_high(B5);
221 writePinLow(B7); 221 gpio_write_pin_low(B7);
222 writePinHigh(F0); 222 gpio_write_pin_high(F0);
223 writePinLow(B0); 223 gpio_write_pin_low(B0);
224 break; 224 break;
225 case 3: 225 case 3:
226 writePinHigh(B5); 226 gpio_write_pin_high(B5);
227 writePinLow(B7); 227 gpio_write_pin_low(B7);
228 writePinLow(F0); 228 gpio_write_pin_low(F0);
229 writePinLow(B0); 229 gpio_write_pin_low(B0);
230 break; 230 break;
231 case 4: 231 case 4:
232 writePinLow(B5); 232 gpio_write_pin_low(B5);
233 writePinHigh(B7); 233 gpio_write_pin_high(B7);
234 writePinHigh(F0); 234 gpio_write_pin_high(F0);
235 writePinLow(B0); 235 gpio_write_pin_low(B0);
236 break; 236 break;
237 case 5: 237 case 5:
238 writePinLow(B5); 238 gpio_write_pin_low(B5);
239 writePinHigh(B7); 239 gpio_write_pin_high(B7);
240 writePinLow(F0); 240 gpio_write_pin_low(F0);
241 writePinLow(B0); 241 gpio_write_pin_low(B0);
242 break; 242 break;
243 case 6: 243 case 6:
244 writePinLow(B5); 244 gpio_write_pin_low(B5);
245 writePinLow(B7); 245 gpio_write_pin_low(B7);
246 writePinHigh(F0); 246 gpio_write_pin_high(F0);
247 writePinLow(B0); 247 gpio_write_pin_low(B0);
248 break; 248 break;
249 case 7: 249 case 7:
250 writePinLow(B5); 250 gpio_write_pin_low(B5);
251 writePinLow(B7); 251 gpio_write_pin_low(B7);
252 writePinLow(F0); 252 gpio_write_pin_low(F0);
253 writePinLow(B0); 253 gpio_write_pin_low(B0);
254 break; 254 break;
255 case 8: 255 case 8:
256 writePinHigh(B5); 256 gpio_write_pin_high(B5);
257 writePinHigh(B7); 257 gpio_write_pin_high(B7);
258 writePinHigh(F0); 258 gpio_write_pin_high(F0);
259 writePinLow(F1); 259 gpio_write_pin_low(F1);
260 break; 260 break;
261 case 9: 261 case 9:
262 writePinHigh(B5); 262 gpio_write_pin_high(B5);
263 writePinHigh(B7); 263 gpio_write_pin_high(B7);
264 writePinLow(F0); 264 gpio_write_pin_low(F0);
265 writePinLow(F1); 265 gpio_write_pin_low(F1);
266 break; 266 break;
267 case 10: 267 case 10:
268 writePinHigh(B5); 268 gpio_write_pin_high(B5);
269 writePinLow(B7); 269 gpio_write_pin_low(B7);
270 writePinHigh(F0); 270 gpio_write_pin_high(F0);
271 writePinLow(F1); 271 gpio_write_pin_low(F1);
272 break; 272 break;
273 case 11: 273 case 11:
274 writePinHigh(B5); 274 gpio_write_pin_high(B5);
275 writePinLow(B7); 275 gpio_write_pin_low(B7);
276 writePinLow(F0); 276 gpio_write_pin_low(F0);
277 writePinLow(F1); 277 gpio_write_pin_low(F1);
278 break; 278 break;
279 case 12: 279 case 12:
280 writePinLow(B5); 280 gpio_write_pin_low(B5);
281 writePinHigh(B7); 281 gpio_write_pin_high(B7);
282 writePinHigh(F0); 282 gpio_write_pin_high(F0);
283 writePinLow(F1); 283 gpio_write_pin_low(F1);
284 break; 284 break;
285 case 13: 285 case 13:
286 writePinLow(B5); 286 gpio_write_pin_low(B5);
287 writePinHigh(B7); 287 gpio_write_pin_high(B7);
288 writePinLow(F0); 288 gpio_write_pin_low(F0);
289 writePinLow(F1); 289 gpio_write_pin_low(F1);
290 break; 290 break;
291 case 14: 291 case 14:
292 writePinLow(B5); 292 gpio_write_pin_low(B5);
293 writePinLow(B7); 293 gpio_write_pin_low(B7);
294 writePinLow(F0); 294 gpio_write_pin_low(F0);
295 writePinLow(F1); 295 gpio_write_pin_low(F1);
296 break; 296 break;
297 case 15: 297 case 15:
298 writePinLow(B5); 298 gpio_write_pin_low(B5);
299 writePinLow(B7); 299 gpio_write_pin_low(B7);
300 writePinHigh(F0); 300 gpio_write_pin_high(F0);
301 writePinLow(F1); 301 gpio_write_pin_low(F1);
302 break; 302 break;
303 case 16: 303 case 16:
304 writePinHigh(E6); 304 gpio_write_pin_high(E6);
305 break; 305 break;
306 } 306 }
307} 307}
308 308
309static void unselect_cols(void) { 309static void unselect_cols(void) {
310 //Native 310 //Native
311 writePinHigh(E6); 311 gpio_write_pin_high(E6);
312 312
313 //Demultiplexer 313 //Demultiplexer
314 writePinLow(B0); 314 gpio_write_pin_low(B0);
315 writePinLow(F1); 315 gpio_write_pin_low(F1);
316 writePinHigh(B5); 316 gpio_write_pin_high(B5);
317 writePinHigh(B7); 317 gpio_write_pin_high(B7);
318 writePinHigh(F0); 318 gpio_write_pin_high(F0);
319} 319}
320 320
321static void init_pins(void) { 321static void init_pins(void) {
322 unselect_cols(); 322 unselect_cols();
323 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 323 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
324 setPinInputHigh(row_pins[x]); 324 gpio_set_pin_input_high(row_pins[x]);
325 } 325 }
326 setPinOutput(B5); 326 gpio_set_pin_output(B5);
327 setPinOutput(B7); 327 gpio_set_pin_output(B7);
328 setPinOutput(F0); 328 gpio_set_pin_output(F0);
329 setPinOutput(B0); 329 gpio_set_pin_output(B0);
330 setPinOutput(F1); 330 gpio_set_pin_output(F1);
331 setPinOutput(E6); 331 gpio_set_pin_output(E6);
332} 332}
333 333
334static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 334static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
@@ -344,7 +344,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
344 matrix_row_t last_row_value = current_matrix[row_index]; 344 matrix_row_t last_row_value = current_matrix[row_index];
345 345
346 // Check row pin state 346 // Check row pin state
347 if (readPin(row_pins[row_index]) == 0) { 347 if (gpio_read_pin(row_pins[row_index]) == 0) {
348 // Pin LO, set col bit 348 // Pin LO, set col bit
349 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); 349 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
350 } else { 350 } else {
diff --git a/keyboards/mechlovin/infinity875/matrix.c b/keyboards/mechlovin/infinity875/matrix.c
index 62a56f687c..16bee61ad0 100644
--- a/keyboards/mechlovin/infinity875/matrix.c
+++ b/keyboards/mechlovin/infinity875/matrix.c
@@ -37,7 +37,7 @@ static void init_pins(void) {
37 for (int col = 0; col < MATRIX_COLS; col++) { 37 for (int col = 0; col < MATRIX_COLS; col++) {
38 pin_t pin = direct_pins[row][col]; 38 pin_t pin = direct_pins[row][col];
39 if (pin != NO_PIN) { 39 if (pin != NO_PIN) {
40 setPinInputHigh(pin); 40 gpio_set_pin_input_high(pin);
41 } 41 }
42 } 42 }
43 } 43 }
@@ -50,7 +50,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
50 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 50 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
51 pin_t pin = direct_pins[current_row][col_index]; 51 pin_t pin = direct_pins[current_row][col_index];
52 if (pin != NO_PIN) { 52 if (pin != NO_PIN) {
53 current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); 53 current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
54 } 54 }
55 } 55 }
56 56
@@ -101,103 +101,103 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
101static void select_col(uint8_t col) { 101static void select_col(uint8_t col) {
102 switch (col) { 102 switch (col) {
103 case 0: 103 case 0:
104 writePinLow(B5); 104 gpio_write_pin_low(B5);
105 writePinLow(B7); 105 gpio_write_pin_low(B7);
106 writePinLow(F0); 106 gpio_write_pin_low(F0);
107 writePinHigh(B0); 107 gpio_write_pin_high(B0);
108 break; 108 break;
109 case 1: 109 case 1:
110 writePinLow(B5); 110 gpio_write_pin_low(B5);
111 writePinLow(B7); 111 gpio_write_pin_low(B7);
112 writePinHigh(F0); 112 gpio_write_pin_high(F0);
113 writePinHigh(B0); 113 gpio_write_pin_high(B0);
114 break; 114 break;
115 case 2: 115 case 2:
116 writePinLow(B5); 116 gpio_write_pin_low(B5);
117 writePinHigh(B7); 117 gpio_write_pin_high(B7);
118 writePinLow(F0); 118 gpio_write_pin_low(F0);
119 writePinHigh(B0); 119 gpio_write_pin_high(B0);
120 break; 120 break;
121 case 3: 121 case 3:
122 writePinLow(B5); 122 gpio_write_pin_low(B5);
123 writePinHigh(B7); 123 gpio_write_pin_high(B7);
124 writePinHigh(F0); 124 gpio_write_pin_high(F0);
125 writePinHigh(B0); 125 gpio_write_pin_high(B0);
126 break; 126 break;
127 case 4: 127 case 4:
128 writePinHigh(B5); 128 gpio_write_pin_high(B5);
129 writePinLow(B7); 129 gpio_write_pin_low(B7);
130 writePinLow(F0); 130 gpio_write_pin_low(F0);
131 writePinHigh(B0); 131 gpio_write_pin_high(B0);
132 break; 132 break;
133 case 5: 133 case 5:
134 writePinHigh(B5); 134 gpio_write_pin_high(B5);
135 writePinLow(B7); 135 gpio_write_pin_low(B7);
136 writePinHigh(F0); 136 gpio_write_pin_high(F0);
137 writePinHigh(B0); 137 gpio_write_pin_high(B0);
138 break; 138 break;
139 case 6: 139 case 6:
140 writePinHigh(B5); 140 gpio_write_pin_high(B5);
141 writePinHigh(B7); 141 gpio_write_pin_high(B7);
142 writePinLow(F0); 142 gpio_write_pin_low(F0);
143 writePinHigh(B0); 143 gpio_write_pin_high(B0);
144 break; 144 break;
145 case 7: 145 case 7:
146 writePinHigh(B5); 146 gpio_write_pin_high(B5);
147 writePinHigh(B7); 147 gpio_write_pin_high(B7);
148 writePinHigh(F0); 148 gpio_write_pin_high(F0);
149 writePinHigh(B0); 149 gpio_write_pin_high(B0);
150 break; 150 break;
151 case 8: 151 case 8:
152 writePinLow(B5); 152 gpio_write_pin_low(B5);
153 writePinLow(B7); 153 gpio_write_pin_low(B7);
154 writePinLow(F0); 154 gpio_write_pin_low(F0);
155 writePinHigh(F1); 155 gpio_write_pin_high(F1);
156 break; 156 break;
157 case 9: 157 case 9:
158 writePinLow(B5); 158 gpio_write_pin_low(B5);
159 writePinLow(B7); 159 gpio_write_pin_low(B7);
160 writePinHigh(F0); 160 gpio_write_pin_high(F0);
161 writePinHigh(F1); 161 gpio_write_pin_high(F1);
162 break; 162 break;
163 case 10: 163 case 10:
164 writePinLow(B5); 164 gpio_write_pin_low(B5);
165 writePinHigh(B7); 165 gpio_write_pin_high(B7);
166 writePinLow(F0); 166 gpio_write_pin_low(F0);
167 writePinHigh(F1); 167 gpio_write_pin_high(F1);
168 break; 168 break;
169 case 11: 169 case 11:
170 writePinLow(B5); 170 gpio_write_pin_low(B5);
171 writePinHigh(B7); 171 gpio_write_pin_high(B7);
172 writePinHigh(F0); 172 gpio_write_pin_high(F0);
173 writePinHigh(F1); 173 gpio_write_pin_high(F1);
174 break; 174 break;
175 case 12: 175 case 12:
176 writePinHigh(B5); 176 gpio_write_pin_high(B5);
177 writePinLow(B7); 177 gpio_write_pin_low(B7);
178 writePinLow(F0); 178 gpio_write_pin_low(F0);
179 writePinHigh(F1); 179 gpio_write_pin_high(F1);
180 break; 180 break;
181 case 13: 181 case 13:
182 writePinHigh(B5); 182 gpio_write_pin_high(B5);
183 writePinLow(B7); 183 gpio_write_pin_low(B7);
184 writePinHigh(F0); 184 gpio_write_pin_high(F0);
185 writePinHigh(F1); 185 gpio_write_pin_high(F1);
186 break; 186 break;
187 case 14: 187 case 14:
188 writePinHigh(B5); 188 gpio_write_pin_high(B5);
189 writePinHigh(B7); 189 gpio_write_pin_high(B7);
190 writePinHigh(F0); 190 gpio_write_pin_high(F0);
191 writePinHigh(F1); 191 gpio_write_pin_high(F1);
192 break; 192 break;
193 case 15: 193 case 15:
194 writePinHigh(B5); 194 gpio_write_pin_high(B5);
195 writePinHigh(B7); 195 gpio_write_pin_high(B7);
196 writePinLow(F0); 196 gpio_write_pin_low(F0);
197 writePinHigh(F1); 197 gpio_write_pin_high(F1);
198 break; 198 break;
199 case 16: 199 case 16:
200 writePinLow(E6); 200 gpio_write_pin_low(E6);
201 break; 201 break;
202 } 202 }
203} 203}
@@ -205,130 +205,130 @@ static void select_col(uint8_t col) {
205static void unselect_col(uint8_t col) { 205static void unselect_col(uint8_t col) {
206 switch (col) { 206 switch (col) {
207 case 0: 207 case 0:
208 writePinHigh(B5); 208 gpio_write_pin_high(B5);
209 writePinHigh(B7); 209 gpio_write_pin_high(B7);
210 writePinHigh(F0); 210 gpio_write_pin_high(F0);
211 writePinLow(B0); 211 gpio_write_pin_low(B0);
212 break; 212 break;
213 case 1: 213 case 1:
214 writePinHigh(B5); 214 gpio_write_pin_high(B5);
215 writePinHigh(B7); 215 gpio_write_pin_high(B7);
216 writePinLow(F0); 216 gpio_write_pin_low(F0);
217 writePinLow(B0); 217 gpio_write_pin_low(B0);
218 break; 218 break;
219 case 2: 219 case 2:
220 writePinHigh(B5); 220 gpio_write_pin_high(B5);
221 writePinLow(B7); 221 gpio_write_pin_low(B7);
222 writePinHigh(F0); 222 gpio_write_pin_high(F0);
223 writePinLow(B0); 223 gpio_write_pin_low(B0);
224 break; 224 break;
225 case 3: 225 case 3:
226 writePinHigh(B5); 226 gpio_write_pin_high(B5);
227 writePinLow(B7); 227 gpio_write_pin_low(B7);
228 writePinLow(F0); 228 gpio_write_pin_low(F0);
229 writePinLow(B0); 229 gpio_write_pin_low(B0);
230 break; 230 break;
231 case 4: 231 case 4:
232 writePinLow(B5); 232 gpio_write_pin_low(B5);
233 writePinHigh(B7); 233 gpio_write_pin_high(B7);
234 writePinHigh(F0); 234 gpio_write_pin_high(F0);
235 writePinLow(B0); 235 gpio_write_pin_low(B0);
236 break; 236 break;
237 case 5: 237 case 5:
238 writePinLow(B5); 238 gpio_write_pin_low(B5);
239 writePinHigh(B7); 239 gpio_write_pin_high(B7);
240 writePinLow(F0); 240 gpio_write_pin_low(F0);
241 writePinLow(B0); 241 gpio_write_pin_low(B0);
242 break; 242 break;
243 case 6: 243 case 6:
244 writePinLow(B5); 244 gpio_write_pin_low(B5);
245 writePinLow(B7); 245 gpio_write_pin_low(B7);
246 writePinHigh(F0); 246 gpio_write_pin_high(F0);
247 writePinLow(B0); 247 gpio_write_pin_low(B0);
248 break; 248 break;
249 case 7: 249 case 7:
250 writePinLow(B5); 250 gpio_write_pin_low(B5);
251 writePinLow(B7); 251 gpio_write_pin_low(B7);
252 writePinLow(F0); 252 gpio_write_pin_low(F0);
253 writePinLow(B0); 253 gpio_write_pin_low(B0);
254 break; 254 break;
255 case 8: 255 case 8:
256 writePinHigh(B5); 256 gpio_write_pin_high(B5);
257 writePinHigh(B7); 257 gpio_write_pin_high(B7);
258 writePinHigh(F0); 258 gpio_write_pin_high(F0);
259 writePinLow(F1); 259 gpio_write_pin_low(F1);
260 break; 260 break;
261 case 9: 261 case 9:
262 writePinHigh(B5); 262 gpio_write_pin_high(B5);
263 writePinHigh(B7); 263 gpio_write_pin_high(B7);
264 writePinLow(F0); 264 gpio_write_pin_low(F0);
265 writePinLow(F1); 265 gpio_write_pin_low(F1);
266 break; 266 break;
267 case 10: 267 case 10:
268 writePinHigh(B5); 268 gpio_write_pin_high(B5);
269 writePinLow(B7); 269 gpio_write_pin_low(B7);
270 writePinHigh(F0); 270 gpio_write_pin_high(F0);
271 writePinLow(F1); 271 gpio_write_pin_low(F1);
272 break; 272 break;
273 case 11: 273 case 11:
274 writePinHigh(B5); 274 gpio_write_pin_high(B5);
275 writePinLow(B7); 275 gpio_write_pin_low(B7);
276 writePinLow(F0); 276 gpio_write_pin_low(F0);
277 writePinLow(F1); 277 gpio_write_pin_low(F1);
278 break; 278 break;
279 case 12: 279 case 12:
280 writePinLow(B5); 280 gpio_write_pin_low(B5);
281 writePinHigh(B7); 281 gpio_write_pin_high(B7);
282 writePinHigh(F0); 282 gpio_write_pin_high(F0);
283 writePinLow(F1); 283 gpio_write_pin_low(F1);
284 break; 284 break;
285 case 13: 285 case 13:
286 writePinLow(B5); 286 gpio_write_pin_low(B5);
287 writePinHigh(B7); 287 gpio_write_pin_high(B7);
288 writePinLow(F0); 288 gpio_write_pin_low(F0);
289 writePinLow(F1); 289 gpio_write_pin_low(F1);
290 break; 290 break;
291 case 14: 291 case 14:
292 writePinLow(B5); 292 gpio_write_pin_low(B5);
293 writePinLow(B7); 293 gpio_write_pin_low(B7);
294 writePinLow(F0); 294 gpio_write_pin_low(F0);
295 writePinLow(F1); 295 gpio_write_pin_low(F1);
296 break; 296 break;
297 case 15: 297 case 15:
298 writePinLow(B5); 298 gpio_write_pin_low(B5);
299 writePinLow(B7); 299 gpio_write_pin_low(B7);
300 writePinHigh(F0); 300 gpio_write_pin_high(F0);
301 writePinLow(F1); 301 gpio_write_pin_low(F1);
302 break; 302 break;
303 case 16: 303 case 16:
304 writePinHigh(E6); 304 gpio_write_pin_high(E6);
305 break; 305 break;
306 } 306 }
307} 307}
308 308
309static void unselect_cols(void) { 309static void unselect_cols(void) {
310 //Native 310 //Native
311 writePinHigh(E6); 311 gpio_write_pin_high(E6);
312 312
313 //Demultiplexer 313 //Demultiplexer
314 writePinLow(B0); 314 gpio_write_pin_low(B0);
315 writePinLow(F1); 315 gpio_write_pin_low(F1);
316 writePinHigh(B5); 316 gpio_write_pin_high(B5);
317 writePinHigh(B7); 317 gpio_write_pin_high(B7);
318 writePinHigh(F0); 318 gpio_write_pin_high(F0);
319} 319}
320 320
321static void init_pins(void) { 321static void init_pins(void) {
322 unselect_cols(); 322 unselect_cols();
323 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 323 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
324 setPinInputHigh(row_pins[x]); 324 gpio_set_pin_input_high(row_pins[x]);
325 } 325 }
326 setPinOutput(B5); 326 gpio_set_pin_output(B5);
327 setPinOutput(B7); 327 gpio_set_pin_output(B7);
328 setPinOutput(F0); 328 gpio_set_pin_output(F0);
329 setPinOutput(B0); 329 gpio_set_pin_output(B0);
330 setPinOutput(F1); 330 gpio_set_pin_output(F1);
331 setPinOutput(E6); 331 gpio_set_pin_output(E6);
332} 332}
333 333
334static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 334static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
@@ -344,7 +344,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
344 matrix_row_t last_row_value = current_matrix[row_index]; 344 matrix_row_t last_row_value = current_matrix[row_index];
345 345
346 // Check row pin state 346 // Check row pin state
347 if (readPin(row_pins[row_index]) == 0) { 347 if (gpio_read_pin(row_pins[row_index]) == 0) {
348 // Pin LO, set col bit 348 // Pin LO, set col bit
349 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); 349 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
350 } else { 350 } else {
diff --git a/keyboards/mechlovin/infinityce/infinityce.c b/keyboards/mechlovin/infinityce/infinityce.c
index 36f533fc2a..f1a9181a96 100644
--- a/keyboards/mechlovin/infinityce/infinityce.c
+++ b/keyboards/mechlovin/infinityce/infinityce.c
@@ -18,12 +18,12 @@
18 18
19void led_init_ports(void) { 19void led_init_ports(void) {
20 // * Set our LED pins as output 20 // * Set our LED pins as output
21 setPinOutput(B3); 21 gpio_set_pin_output(B3);
22} 22}
23bool led_update_kb(led_t led_state) { 23bool led_update_kb(led_t led_state) {
24 bool res = led_update_user(led_state); 24 bool res = led_update_user(led_state);
25 if(res) { 25 if(res) {
26 writePin(B3, led_state.caps_lock); 26 gpio_write_pin(B3, led_state.caps_lock);
27 rgblight_set_effect_range(1, 30); 27 rgblight_set_effect_range(1, 30);
28 if (led_state.scroll_lock) { 28 if (led_state.scroll_lock) {
29 rgblight_setrgb_at(255, 255, 255, 0); 29 rgblight_setrgb_at(255, 255, 255, 0);
diff --git a/keyboards/mechlovin/kanu/kanu.c b/keyboards/mechlovin/kanu/kanu.c
index 67bf8f88fb..8622a38a22 100644
--- a/keyboards/mechlovin/kanu/kanu.c
+++ b/keyboards/mechlovin/kanu/kanu.c
@@ -17,15 +17,15 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void led_init_ports(void) { 19void led_init_ports(void) {
20 setPinOutput(B2); 20 gpio_set_pin_output(B2);
21 setPinOutput(D0); 21 gpio_set_pin_output(D0);
22 setPinOutput(D1); 22 gpio_set_pin_output(D1);
23 setPinOutput(D2); 23 gpio_set_pin_output(D2);
24 24
25} 25}
26bool led_update_kb(led_t led_state) { 26bool led_update_kb(led_t led_state) {
27 if(led_update_user(led_state)) { 27 if(led_update_user(led_state)) {
28 writePin(B2, led_state.caps_lock); 28 gpio_write_pin(B2, led_state.caps_lock);
29 } 29 }
30 30
31 return true; 31 return true;
@@ -34,10 +34,10 @@ bool led_update_kb(led_t led_state) {
34__attribute__((weak)) 34__attribute__((weak))
35layer_state_t layer_state_set_user(layer_state_t state) { 35layer_state_t layer_state_set_user(layer_state_t state) {
36 // if on layer 1, turn on D2 LED, otherwise off. 36 // if on layer 1, turn on D2 LED, otherwise off.
37 writePin(D2, get_highest_layer(state) == 1); 37 gpio_write_pin(D2, get_highest_layer(state) == 1);
38 // if on layer 2, turn on D1 LED, otherwise off. 38 // if on layer 2, turn on D1 LED, otherwise off.
39 writePin(D1, get_highest_layer(state) == 2); 39 gpio_write_pin(D1, get_highest_layer(state) == 2);
40 // if on layer 3, turn on D0 LED, otherwise off. 40 // if on layer 3, turn on D0 LED, otherwise off.
41 writePin(D0, get_highest_layer(state) == 3); 41 gpio_write_pin(D0, get_highest_layer(state) == 3);
42 return state; 42 return state;
43} 43}
diff --git a/keyboards/mechlovin/kay65/kay65.c b/keyboards/mechlovin/kay65/kay65.c
index 591c618c6c..f59f23e13d 100644
--- a/keyboards/mechlovin/kay65/kay65.c
+++ b/keyboards/mechlovin/kay65/kay65.c
@@ -21,5 +21,5 @@ void keyboard_pre_init_user(void) {
21 // Call the keyboard pre init code. 21 // Call the keyboard pre init code.
22 22
23 // Set our LED pins as output 23 // Set our LED pins as output
24 setPinOutput(D7); 24 gpio_set_pin_output(D7);
25} 25}
diff --git a/keyboards/mechlovin/olly/bb/bb.c b/keyboards/mechlovin/olly/bb/bb.c
index dac77ff623..f9dcf211a1 100644
--- a/keyboards/mechlovin/olly/bb/bb.c
+++ b/keyboards/mechlovin/olly/bb/bb.c
@@ -17,19 +17,19 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void led_init_ports(void) { 19void led_init_ports(void) {
20 setPinOutput(C0); 20 gpio_set_pin_output(C0);
21 setPinOutput(D0); 21 gpio_set_pin_output(D0);
22 setPinOutput(D1); 22 gpio_set_pin_output(D1);
23 setPinOutput(C1); 23 gpio_set_pin_output(C1);
24 setPinOutput(C6); 24 gpio_set_pin_output(C6);
25} 25}
26 26
27__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { 27__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
28 writePin(D1, layer_state_cmp(state, 1)); 28 gpio_write_pin(D1, layer_state_cmp(state, 1));
29 writePin(D0, layer_state_cmp(state, 2)); 29 gpio_write_pin(D0, layer_state_cmp(state, 2));
30 writePin(C1, layer_state_cmp(state, 3)); 30 gpio_write_pin(C1, layer_state_cmp(state, 3));
31 writePin(C0, layer_state_cmp(state, 4)); 31 gpio_write_pin(C0, layer_state_cmp(state, 4));
32 writePin(C6, layer_state_cmp(state, 5)); 32 gpio_write_pin(C6, layer_state_cmp(state, 5));
33 33
34 return state; 34 return state;
35} 35}
diff --git a/keyboards/mechlovin/olly/bb/matrix.c b/keyboards/mechlovin/olly/bb/matrix.c
index e045299bae..ecb6cf9e74 100644
--- a/keyboards/mechlovin/olly/bb/matrix.c
+++ b/keyboards/mechlovin/olly/bb/matrix.c
@@ -67,109 +67,109 @@ static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
67static void select_col(uint8_t col) { 67static void select_col(uint8_t col) {
68 switch (col) { 68 switch (col) {
69 case 0: 69 case 0:
70 writePinLow(A0); 70 gpio_write_pin_low(A0);
71 writePinLow(A1); 71 gpio_write_pin_low(A1);
72 writePinLow(A2); 72 gpio_write_pin_low(A2);
73 writePinHigh(B4); 73 gpio_write_pin_high(B4);
74 break; 74 break;
75 case 1: 75 case 1:
76 writePinLow(A0); 76 gpio_write_pin_low(A0);
77 writePinLow(A1); 77 gpio_write_pin_low(A1);
78 writePinHigh(A2); 78 gpio_write_pin_high(A2);
79 writePinHigh(B4); 79 gpio_write_pin_high(B4);
80 break; 80 break;
81 case 2: 81 case 2:
82 writePinLow(A0); 82 gpio_write_pin_low(A0);
83 writePinHigh(A1); 83 gpio_write_pin_high(A1);
84 writePinLow(A2); 84 gpio_write_pin_low(A2);
85 writePinHigh(B4); 85 gpio_write_pin_high(B4);
86 break; 86 break;
87 case 3: 87 case 3:
88 writePinLow(A0); 88 gpio_write_pin_low(A0);
89 writePinHigh(A1); 89 gpio_write_pin_high(A1);
90 writePinHigh(A2); 90 gpio_write_pin_high(A2);
91 writePinHigh(B4); 91 gpio_write_pin_high(B4);
92 break; 92 break;
93 case 4: 93 case 4:
94 writePinHigh(A0); 94 gpio_write_pin_high(A0);
95 writePinLow(A1); 95 gpio_write_pin_low(A1);
96 writePinLow(A2); 96 gpio_write_pin_low(A2);
97 writePinHigh(B4); 97 gpio_write_pin_high(B4);
98 break; 98 break;
99 case 5: 99 case 5:
100 writePinHigh(A0); 100 gpio_write_pin_high(A0);
101 writePinLow(A1); 101 gpio_write_pin_low(A1);
102 writePinHigh(A2); 102 gpio_write_pin_high(A2);
103 writePinHigh(B4); 103 gpio_write_pin_high(B4);
104 break; 104 break;
105 case 6: 105 case 6:
106 writePinHigh(A0); 106 gpio_write_pin_high(A0);
107 writePinHigh(A1); 107 gpio_write_pin_high(A1);
108 writePinLow(A2); 108 gpio_write_pin_low(A2);
109 writePinHigh(B4); 109 gpio_write_pin_high(B4);
110 break; 110 break;
111 case 7: 111 case 7:
112 writePinHigh(A0); 112 gpio_write_pin_high(A0);
113 writePinHigh(A1); 113 gpio_write_pin_high(A1);
114 writePinHigh(A2); 114 gpio_write_pin_high(A2);
115 writePinHigh(B4); 115 gpio_write_pin_high(B4);
116 break; 116 break;
117 case 8: 117 case 8:
118 writePinHigh(A0); 118 gpio_write_pin_high(A0);
119 writePinHigh(A1); 119 gpio_write_pin_high(A1);
120 writePinHigh(A2); 120 gpio_write_pin_high(A2);
121 writePinHigh(C7); 121 gpio_write_pin_high(C7);
122 break; 122 break;
123 case 9: 123 case 9:
124 writePinLow(A0); 124 gpio_write_pin_low(A0);
125 writePinLow(A1); 125 gpio_write_pin_low(A1);
126 writePinLow(A2); 126 gpio_write_pin_low(A2);
127 writePinHigh(C7); 127 gpio_write_pin_high(C7);
128 break; 128 break;
129 case 10: 129 case 10:
130 writePinLow(A0); 130 gpio_write_pin_low(A0);
131 writePinLow(A1); 131 gpio_write_pin_low(A1);
132 writePinHigh(A2); 132 gpio_write_pin_high(A2);
133 writePinHigh(C7); 133 gpio_write_pin_high(C7);
134 break; 134 break;
135 case 11: 135 case 11:
136 writePinLow(A0); 136 gpio_write_pin_low(A0);
137 writePinHigh(A1); 137 gpio_write_pin_high(A1);
138 writePinLow(A2); 138 gpio_write_pin_low(A2);
139 writePinHigh(C7); 139 gpio_write_pin_high(C7);
140 break; 140 break;
141 case 12: 141 case 12:
142 writePinLow(A0); 142 gpio_write_pin_low(A0);
143 writePinHigh(A1); 143 gpio_write_pin_high(A1);
144 writePinHigh(A2); 144 gpio_write_pin_high(A2);
145 writePinHigh(C7); 145 gpio_write_pin_high(C7);
146 break; 146 break;
147 case 13: 147 case 13:
148 writePinHigh(A0); 148 gpio_write_pin_high(A0);
149 writePinLow(A1); 149 gpio_write_pin_low(A1);
150 writePinLow(A2); 150 gpio_write_pin_low(A2);
151 writePinHigh(C7); 151 gpio_write_pin_high(C7);
152 break; 152 break;
153 case 14: 153 case 14:
154 writePinHigh(A0); 154 gpio_write_pin_high(A0);
155 writePinLow(A1); 155 gpio_write_pin_low(A1);
156 writePinHigh(A2); 156 gpio_write_pin_high(A2);
157 writePinHigh(C7); 157 gpio_write_pin_high(C7);
158 break; 158 break;
159 case 15: 159 case 15:
160 writePinHigh(A0); 160 gpio_write_pin_high(A0);
161 writePinHigh(A1); 161 gpio_write_pin_high(A1);
162 writePinLow(A2); 162 gpio_write_pin_low(A2);
163 writePinHigh(C7); 163 gpio_write_pin_high(C7);
164 break; 164 break;
165 case 16: 165 case 16:
166 writePinLow(C2); 166 gpio_write_pin_low(C2);
167 break; 167 break;
168 case 17: 168 case 17:
169 writePinLow(C3); 169 gpio_write_pin_low(C3);
170 break; 170 break;
171 case 18: 171 case 18:
172 writePinLow(C5); 172 gpio_write_pin_low(C5);
173 break; 173 break;
174 } 174 }
175} 175}
@@ -177,140 +177,140 @@ static void select_col(uint8_t col) {
177static void unselect_col(uint8_t col) { 177static void unselect_col(uint8_t col) {
178 switch (col) { 178 switch (col) {
179 case 0: 179 case 0:
180 writePinHigh(A0); 180 gpio_write_pin_high(A0);
181 writePinHigh(A1); 181 gpio_write_pin_high(A1);
182 writePinHigh(A2); 182 gpio_write_pin_high(A2);
183 writePinLow(B4); 183 gpio_write_pin_low(B4);
184 break; 184 break;
185 case 1: 185 case 1:
186 writePinHigh(A0); 186 gpio_write_pin_high(A0);
187 writePinHigh(A1); 187 gpio_write_pin_high(A1);
188 writePinLow(A2); 188 gpio_write_pin_low(A2);
189 writePinLow(B4); 189 gpio_write_pin_low(B4);
190 break; 190 break;
191 case 2: 191 case 2:
192 writePinHigh(A0); 192 gpio_write_pin_high(A0);
193 writePinLow(A1); 193 gpio_write_pin_low(A1);
194 writePinHigh(A2); 194 gpio_write_pin_high(A2);
195 writePinLow(B4); 195 gpio_write_pin_low(B4);
196 break; 196 break;
197 case 3: 197 case 3:
198 writePinHigh(A0); 198 gpio_write_pin_high(A0);
199 writePinLow(A1); 199 gpio_write_pin_low(A1);
200 writePinLow(A2); 200 gpio_write_pin_low(A2);
201 writePinLow(B4); 201 gpio_write_pin_low(B4);
202 break; 202 break;
203 case 4: 203 case 4:
204 writePinLow(A0); 204 gpio_write_pin_low(A0);
205 writePinHigh(A1); 205 gpio_write_pin_high(A1);
206 writePinHigh(A2); 206 gpio_write_pin_high(A2);
207 writePinLow(B4); 207 gpio_write_pin_low(B4);
208 break; 208 break;
209 case 5: 209 case 5:
210 writePinLow(A0); 210 gpio_write_pin_low(A0);
211 writePinHigh(A1); 211 gpio_write_pin_high(A1);
212 writePinLow(A2); 212 gpio_write_pin_low(A2);
213 writePinLow(B4); 213 gpio_write_pin_low(B4);
214 break; 214 break;
215 case 6: 215 case 6:
216 writePinLow(A0); 216 gpio_write_pin_low(A0);
217 writePinLow(A1); 217 gpio_write_pin_low(A1);
218 writePinHigh(A2); 218 gpio_write_pin_high(A2);
219 writePinLow(B4); 219 gpio_write_pin_low(B4);
220 break; 220 break;
221 case 7: 221 case 7:
222 writePinLow(A0); 222 gpio_write_pin_low(A0);
223 writePinLow(A1); 223 gpio_write_pin_low(A1);
224 writePinLow(A2); 224 gpio_write_pin_low(A2);
225 writePinLow(B4); 225 gpio_write_pin_low(B4);
226 break; 226 break;
227 case 8: 227 case 8:
228 writePinLow(A0); 228 gpio_write_pin_low(A0);
229 writePinLow(A1); 229 gpio_write_pin_low(A1);
230 writePinLow(A2); 230 gpio_write_pin_low(A2);
231 writePinLow(C7); 231 gpio_write_pin_low(C7);
232 break; 232 break;
233 case 9: 233 case 9:
234 writePinHigh(A0); 234 gpio_write_pin_high(A0);
235 writePinHigh(A1); 235 gpio_write_pin_high(A1);
236 writePinHigh(A2); 236 gpio_write_pin_high(A2);
237 writePinLow(C7); 237 gpio_write_pin_low(C7);
238 break; 238 break;
239 case 10: 239 case 10:
240 writePinHigh(A0); 240 gpio_write_pin_high(A0);
241 writePinHigh(A1); 241 gpio_write_pin_high(A1);
242 writePinLow(A2); 242 gpio_write_pin_low(A2);
243 writePinLow(C7); 243 gpio_write_pin_low(C7);
244 break; 244 break;
245 case 11: 245 case 11:
246 writePinHigh(A0); 246 gpio_write_pin_high(A0);
247 writePinLow(A1); 247 gpio_write_pin_low(A1);
248 writePinHigh(A2); 248 gpio_write_pin_high(A2);
249 writePinLow(C7); 249 gpio_write_pin_low(C7);
250 break; 250 break;
251 case 12: 251 case 12:
252 writePinHigh(A0); 252 gpio_write_pin_high(A0);
253 writePinLow(A1); 253 gpio_write_pin_low(A1);
254 writePinLow(A2); 254 gpio_write_pin_low(A2);
255 writePinLow(C7); 255 gpio_write_pin_low(C7);
256 break; 256 break;
257 case 13: 257 case 13:
258 writePinLow(A0); 258 gpio_write_pin_low(A0);
259 writePinHigh(A1); 259 gpio_write_pin_high(A1);
260 writePinHigh(A2); 260 gpio_write_pin_high(A2);
261 writePinLow(C7); 261 gpio_write_pin_low(C7);
262 break; 262 break;
263 case 14: 263 case 14:
264 writePinLow(A0); 264 gpio_write_pin_low(A0);
265 writePinHigh(A1); 265 gpio_write_pin_high(A1);
266 writePinLow(A2); 266 gpio_write_pin_low(A2);
267 writePinLow(C7); 267 gpio_write_pin_low(C7);
268 break; 268 break;
269 case 15: 269 case 15:
270 writePinLow(A0); 270 gpio_write_pin_low(A0);
271 writePinLow(A1); 271 gpio_write_pin_low(A1);
272 writePinHigh(A2); 272 gpio_write_pin_high(A2);
273 writePinLow(C7); 273 gpio_write_pin_low(C7);
274 break; 274 break;
275 case 16: 275 case 16:
276 writePinHigh(C2); 276 gpio_write_pin_high(C2);
277 break; 277 break;
278 case 17: 278 case 17:
279 writePinHigh(C3); 279 gpio_write_pin_high(C3);
280 break; 280 break;
281 case 18: 281 case 18:
282 writePinHigh(C5); 282 gpio_write_pin_high(C5);
283 break; 283 break;
284 } 284 }
285} 285}
286 286
287static void unselect_cols(void) { 287static void unselect_cols(void) {
288 //Native 288 //Native
289 writePinHigh(C2); 289 gpio_write_pin_high(C2);
290 writePinHigh(C3); 290 gpio_write_pin_high(C3);
291 writePinHigh(C5); 291 gpio_write_pin_high(C5);
292 292
293 //Demultiplexer 293 //Demultiplexer
294 writePinLow(B4); 294 gpio_write_pin_low(B4);
295 writePinLow(C7); 295 gpio_write_pin_low(C7);
296 writePinHigh(A0); 296 gpio_write_pin_high(A0);
297 writePinHigh(A1); 297 gpio_write_pin_high(A1);
298 writePinHigh(A2); 298 gpio_write_pin_high(A2);
299} 299}
300 300
301static void init_pins(void) { 301static void init_pins(void) {
302 unselect_cols(); 302 unselect_cols();
303 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 303 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
304 setPinInputHigh(row_pins[x]); 304 gpio_set_pin_input_high(row_pins[x]);
305 } 305 }
306 setPinOutput(A0); 306 gpio_set_pin_output(A0);
307 setPinOutput(A1); 307 gpio_set_pin_output(A1);
308 setPinOutput(A2); 308 gpio_set_pin_output(A2);
309 setPinOutput(B4); 309 gpio_set_pin_output(B4);
310 setPinOutput(C7); 310 gpio_set_pin_output(C7);
311 setPinOutput(C2); 311 gpio_set_pin_output(C2);
312 setPinOutput(C3); 312 gpio_set_pin_output(C3);
313 setPinOutput(C5); 313 gpio_set_pin_output(C5);
314} 314}
315 315
316static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 316static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
@@ -326,7 +326,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
326 matrix_row_t last_row_value = current_matrix[row_index]; 326 matrix_row_t last_row_value = current_matrix[row_index];
327 327
328 // Check row pin state 328 // Check row pin state
329 if (readPin(row_pins[row_index]) == 0) { 329 if (gpio_read_pin(row_pins[row_index]) == 0) {
330 // Pin LO, set col bit 330 // Pin LO, set col bit
331 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); 331 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
332 } else { 332 } else {
diff --git a/keyboards/mechlovin/olly/jf/rev1/matrix.c b/keyboards/mechlovin/olly/jf/rev1/matrix.c
index 2abda55d0e..8d1f80ea71 100644
--- a/keyboards/mechlovin/olly/jf/rev1/matrix.c
+++ b/keyboards/mechlovin/olly/jf/rev1/matrix.c
@@ -37,7 +37,7 @@ static void init_pins(void) {
37 for (int col = 0; col < MATRIX_COLS; col++) { 37 for (int col = 0; col < MATRIX_COLS; col++) {
38 pin_t pin = direct_pins[row][col]; 38 pin_t pin = direct_pins[row][col];
39 if (pin != NO_PIN) { 39 if (pin != NO_PIN) {
40 setPinInputHigh(pin); 40 gpio_set_pin_input_high(pin);
41 } 41 }
42 } 42 }
43 } 43 }
@@ -50,7 +50,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
50 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 50 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
51 pin_t pin = direct_pins[current_row][col_index]; 51 pin_t pin = direct_pins[current_row][col_index];
52 if (pin != NO_PIN) { 52 if (pin != NO_PIN) {
53 current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); 53 current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
54 } 54 }
55 } 55 }
56 56
@@ -60,22 +60,22 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
60#elif (DIODE_DIRECTION == COL2ROW) 60#elif (DIODE_DIRECTION == COL2ROW)
61 61
62static void select_row(uint8_t row) { 62static void select_row(uint8_t row) {
63 setPinOutput(row_pins[row]); 63 gpio_set_pin_output(row_pins[row]);
64 writePinLow(row_pins[row]); 64 gpio_write_pin_low(row_pins[row]);
65} 65}
66 66
67static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } 67static void unselect_row(uint8_t row) { gpio_set_pin_input_high(row_pins[row]); }
68 68
69static void unselect_rows(void) { 69static void unselect_rows(void) {
70 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 70 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
71 setPinInputHigh(row_pins[x]); 71 gpio_set_pin_input_high(row_pins[x]);
72 } 72 }
73} 73}
74 74
75static void init_pins(void) { 75static void init_pins(void) {
76 unselect_rows(); 76 unselect_rows();
77 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 77 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
78 setPinInputHigh(col_pins[x]); 78 gpio_set_pin_input_high(col_pins[x]);
79 } 79 }
80} 80}
81 81
@@ -94,7 +94,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
94 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 94 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
95 95
96 // Select the col pin to read (active low) 96 // Select the col pin to read (active low)
97 uint8_t pin_state = readPin(col_pins[col_index]); 97 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
98 98
99 // Populate the matrix row with the state of the col pin 99 // Populate the matrix row with the state of the col pin
100 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 100 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -154,109 +154,109 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
154static void select_col(uint8_t col) { 154static void select_col(uint8_t col) {
155 switch (col) { 155 switch (col) {
156 case 0: 156 case 0:
157 writePinLow(A0); 157 gpio_write_pin_low(A0);
158 writePinLow(A1); 158 gpio_write_pin_low(A1);
159 writePinLow(A2); 159 gpio_write_pin_low(A2);
160 writePinHigh(B4); 160 gpio_write_pin_high(B4);
161 break; 161 break;
162 case 1: 162 case 1:
163 writePinLow(A0); 163 gpio_write_pin_low(A0);
164 writePinLow(A1); 164 gpio_write_pin_low(A1);
165 writePinHigh(A2); 165 gpio_write_pin_high(A2);
166 writePinHigh(B4); 166 gpio_write_pin_high(B4);
167 break; 167 break;
168 case 2: 168 case 2:
169 writePinLow(A0); 169 gpio_write_pin_low(A0);
170 writePinHigh(A1); 170 gpio_write_pin_high(A1);
171 writePinLow(A2); 171 gpio_write_pin_low(A2);
172 writePinHigh(B4); 172 gpio_write_pin_high(B4);
173 break; 173 break;
174 case 3: 174 case 3:
175 writePinLow(A0); 175 gpio_write_pin_low(A0);
176 writePinHigh(A1); 176 gpio_write_pin_high(A1);
177 writePinHigh(A2); 177 gpio_write_pin_high(A2);
178 writePinHigh(B4); 178 gpio_write_pin_high(B4);
179 break; 179 break;
180 case 4: 180 case 4:
181 writePinHigh(A0); 181 gpio_write_pin_high(A0);
182 writePinLow(A1); 182 gpio_write_pin_low(A1);
183 writePinLow(A2); 183 gpio_write_pin_low(A2);
184 writePinHigh(B4); 184 gpio_write_pin_high(B4);
185 break; 185 break;
186 case 5: 186 case 5:
187 writePinHigh(A0); 187 gpio_write_pin_high(A0);
188 writePinLow(A1); 188 gpio_write_pin_low(A1);
189 writePinHigh(A2); 189 gpio_write_pin_high(A2);
190 writePinHigh(B4); 190 gpio_write_pin_high(B4);
191 break; 191 break;
192 case 6: 192 case 6:
193 writePinHigh(A0); 193 gpio_write_pin_high(A0);
194 writePinHigh(A1); 194 gpio_write_pin_high(A1);
195 writePinLow(A2); 195 gpio_write_pin_low(A2);
196 writePinHigh(B4); 196 gpio_write_pin_high(B4);
197 break; 197 break;
198 case 7: 198 case 7:
199 writePinHigh(A0); 199 gpio_write_pin_high(A0);
200 writePinHigh(A1); 200 gpio_write_pin_high(A1);
201 writePinHigh(A2); 201 gpio_write_pin_high(A2);
202 writePinHigh(B4); 202 gpio_write_pin_high(B4);
203 break; 203 break;
204 case 8: 204 case 8:
205 writePinHigh(A0); 205 gpio_write_pin_high(A0);
206 writePinHigh(A1); 206 gpio_write_pin_high(A1);
207 writePinHigh(A2); 207 gpio_write_pin_high(A2);
208 writePinHigh(C7); 208 gpio_write_pin_high(C7);
209 break; 209 break;
210 case 9: 210 case 9:
211 writePinLow(A0); 211 gpio_write_pin_low(A0);
212 writePinLow(A1); 212 gpio_write_pin_low(A1);
213 writePinLow(A2); 213 gpio_write_pin_low(A2);
214 writePinHigh(C7); 214 gpio_write_pin_high(C7);
215 break; 215 break;
216 case 10: 216 case 10:
217 writePinLow(A0); 217 gpio_write_pin_low(A0);
218 writePinLow(A1); 218 gpio_write_pin_low(A1);
219 writePinHigh(A2); 219 gpio_write_pin_high(A2);
220 writePinHigh(C7); 220 gpio_write_pin_high(C7);
221 break; 221 break;
222 case 11: 222 case 11:
223 writePinLow(A0); 223 gpio_write_pin_low(A0);
224 writePinHigh(A1); 224 gpio_write_pin_high(A1);
225 writePinLow(A2); 225 gpio_write_pin_low(A2);
226 writePinHigh(C7); 226 gpio_write_pin_high(C7);
227 break; 227 break;
228 case 12: 228 case 12:
229 writePinLow(A0); 229 gpio_write_pin_low(A0);
230 writePinHigh(A1); 230 gpio_write_pin_high(A1);
231 writePinHigh(A2); 231 gpio_write_pin_high(A2);
232 writePinHigh(C7); 232 gpio_write_pin_high(C7);
233 break; 233 break;
234 case 13: 234 case 13:
235 writePinHigh(A0); 235 gpio_write_pin_high(A0);
236 writePinLow(A1); 236 gpio_write_pin_low(A1);
237 writePinLow(A2); 237 gpio_write_pin_low(A2);
238 writePinHigh(C7); 238 gpio_write_pin_high(C7);
239 break; 239 break;
240 case 14: 240 case 14:
241 writePinHigh(A0); 241 gpio_write_pin_high(A0);
242 writePinLow(A1); 242 gpio_write_pin_low(A1);
243 writePinHigh(A2); 243 gpio_write_pin_high(A2);
244 writePinHigh(C7); 244 gpio_write_pin_high(C7);
245 break; 245 break;
246 case 15: 246 case 15:
247 writePinHigh(A0); 247 gpio_write_pin_high(A0);
248 writePinHigh(A1); 248 gpio_write_pin_high(A1);
249 writePinLow(A2); 249 gpio_write_pin_low(A2);
250 writePinHigh(C7); 250 gpio_write_pin_high(C7);
251 break; 251 break;
252 case 16: 252 case 16:
253 writePinLow(C2); 253 gpio_write_pin_low(C2);
254 break; 254 break;
255 case 17: 255 case 17:
256 writePinLow(C3); 256 gpio_write_pin_low(C3);
257 break; 257 break;
258 case 18: 258 case 18:
259 writePinLow(C5); 259 gpio_write_pin_low(C5);
260 break; 260 break;
261 } 261 }
262} 262}
@@ -264,140 +264,140 @@ static void select_col(uint8_t col) {
264static void unselect_col(uint8_t col) { 264static void unselect_col(uint8_t col) {
265 switch (col) { 265 switch (col) {
266 case 0: 266 case 0:
267 writePinHigh(A0); 267 gpio_write_pin_high(A0);
268 writePinHigh(A1); 268 gpio_write_pin_high(A1);
269 writePinHigh(A2); 269 gpio_write_pin_high(A2);
270 writePinLow(B4); 270 gpio_write_pin_low(B4);
271 break; 271 break;
272 case 1: 272 case 1:
273 writePinHigh(A0); 273 gpio_write_pin_high(A0);
274 writePinHigh(A1); 274 gpio_write_pin_high(A1);
275 writePinLow(A2); 275 gpio_write_pin_low(A2);
276 writePinLow(B4); 276 gpio_write_pin_low(B4);
277 break; 277 break;
278 case 2: 278 case 2:
279 writePinHigh(A0); 279 gpio_write_pin_high(A0);
280 writePinLow(A1); 280 gpio_write_pin_low(A1);
281 writePinHigh(A2); 281 gpio_write_pin_high(A2);
282 writePinLow(B4); 282 gpio_write_pin_low(B4);
283 break; 283 break;
284 case 3: 284 case 3:
285 writePinHigh(A0); 285 gpio_write_pin_high(A0);
286 writePinLow(A1); 286 gpio_write_pin_low(A1);
287 writePinLow(A2); 287 gpio_write_pin_low(A2);
288 writePinLow(B4); 288 gpio_write_pin_low(B4);
289 break; 289 break;
290 case 4: 290 case 4:
291 writePinLow(A0); 291 gpio_write_pin_low(A0);
292 writePinHigh(A1); 292 gpio_write_pin_high(A1);
293 writePinHigh(A2); 293 gpio_write_pin_high(A2);
294 writePinLow(B4); 294 gpio_write_pin_low(B4);
295 break; 295 break;
296 case 5: 296 case 5:
297 writePinLow(A0); 297 gpio_write_pin_low(A0);
298 writePinHigh(A1); 298 gpio_write_pin_high(A1);
299 writePinLow(A2); 299 gpio_write_pin_low(A2);
300 writePinLow(B4); 300 gpio_write_pin_low(B4);
301 break; 301 break;
302 case 6: 302 case 6:
303 writePinLow(A0); 303 gpio_write_pin_low(A0);
304 writePinLow(A1); 304 gpio_write_pin_low(A1);
305 writePinHigh(A2); 305 gpio_write_pin_high(A2);
306 writePinLow(B4); 306 gpio_write_pin_low(B4);
307 break; 307 break;
308 case 7: 308 case 7:
309 writePinLow(A0); 309 gpio_write_pin_low(A0);
310 writePinLow(A1); 310 gpio_write_pin_low(A1);
311 writePinLow(A2); 311 gpio_write_pin_low(A2);
312 writePinLow(B4); 312 gpio_write_pin_low(B4);
313 break; 313 break;
314 case 8: 314 case 8:
315 writePinLow(A0); 315 gpio_write_pin_low(A0);
316 writePinLow(A1); 316 gpio_write_pin_low(A1);
317 writePinLow(A2); 317 gpio_write_pin_low(A2);
318 writePinLow(C7); 318 gpio_write_pin_low(C7);
319 break; 319 break;
320 case 9: 320 case 9:
321 writePinHigh(A0); 321 gpio_write_pin_high(A0);
322 writePinHigh(A1); 322 gpio_write_pin_high(A1);
323 writePinHigh(A2); 323 gpio_write_pin_high(A2);
324 writePinLow(C7); 324 gpio_write_pin_low(C7);
325 break; 325 break;
326 case 10: 326 case 10:
327 writePinHigh(A0); 327 gpio_write_pin_high(A0);
328 writePinHigh(A1); 328 gpio_write_pin_high(A1);
329 writePinLow(A2); 329 gpio_write_pin_low(A2);
330 writePinLow(C7); 330 gpio_write_pin_low(C7);
331 break; 331 break;
332 case 11: 332 case 11:
333 writePinHigh(A0); 333 gpio_write_pin_high(A0);
334 writePinLow(A1); 334 gpio_write_pin_low(A1);
335 writePinHigh(A2); 335 gpio_write_pin_high(A2);
336 writePinLow(C7); 336 gpio_write_pin_low(C7);
337 break; 337 break;
338 case 12: 338 case 12:
339 writePinHigh(A0); 339 gpio_write_pin_high(A0);
340 writePinLow(A1); 340 gpio_write_pin_low(A1);
341 writePinLow(A2); 341 gpio_write_pin_low(A2);
342 writePinLow(C7); 342 gpio_write_pin_low(C7);
343 break; 343 break;
344 case 13: 344 case 13:
345 writePinLow(A0); 345 gpio_write_pin_low(A0);
346 writePinHigh(A1); 346 gpio_write_pin_high(A1);
347 writePinHigh(A2); 347 gpio_write_pin_high(A2);
348 writePinLow(C7); 348 gpio_write_pin_low(C7);
349 break; 349 break;
350 case 14: 350 case 14:
351 writePinLow(A0); 351 gpio_write_pin_low(A0);
352 writePinHigh(A1); 352 gpio_write_pin_high(A1);
353 writePinLow(A2); 353 gpio_write_pin_low(A2);
354 writePinLow(C7); 354 gpio_write_pin_low(C7);
355 break; 355 break;
356 case 15: 356 case 15:
357 writePinLow(A0); 357 gpio_write_pin_low(A0);
358 writePinLow(A1); 358 gpio_write_pin_low(A1);
359 writePinHigh(A2); 359 gpio_write_pin_high(A2);
360 writePinLow(C7); 360 gpio_write_pin_low(C7);
361 break; 361 break;
362 case 16: 362 case 16:
363 writePinHigh(C2); 363 gpio_write_pin_high(C2);
364 break; 364 break;
365 case 17: 365 case 17:
366 writePinHigh(C3); 366 gpio_write_pin_high(C3);
367 break; 367 break;
368 case 18: 368 case 18:
369 writePinHigh(C5); 369 gpio_write_pin_high(C5);
370 break; 370 break;
371 } 371 }
372} 372}
373 373
374static void unselect_cols(void) { 374static void unselect_cols(void) {
375 //Native 375 //Native
376 writePinHigh(C2); 376 gpio_write_pin_high(C2);
377 writePinHigh(C3); 377 gpio_write_pin_high(C3);
378 writePinHigh(C5); 378 gpio_write_pin_high(C5);
379 379
380 //Demultiplexer 380 //Demultiplexer
381 writePinLow(B4); 381 gpio_write_pin_low(B4);
382 writePinLow(C7); 382 gpio_write_pin_low(C7);
383 writePinHigh(A0); 383 gpio_write_pin_high(A0);
384 writePinHigh(A1); 384 gpio_write_pin_high(A1);
385 writePinHigh(A2); 385 gpio_write_pin_high(A2);
386} 386}
387 387
388static void init_pins(void) { 388static void init_pins(void) {
389 unselect_cols(); 389 unselect_cols();
390 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 390 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
391 setPinInputHigh(row_pins[x]); 391 gpio_set_pin_input_high(row_pins[x]);
392 } 392 }
393 setPinOutput(A0); 393 gpio_set_pin_output(A0);
394 setPinOutput(A1); 394 gpio_set_pin_output(A1);
395 setPinOutput(A2); 395 gpio_set_pin_output(A2);
396 setPinOutput(B4); 396 gpio_set_pin_output(B4);
397 setPinOutput(C7); 397 gpio_set_pin_output(C7);
398 setPinOutput(C2); 398 gpio_set_pin_output(C2);
399 setPinOutput(C3); 399 gpio_set_pin_output(C3);
400 setPinOutput(C5); 400 gpio_set_pin_output(C5);
401} 401}
402 402
403static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 403static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
@@ -413,7 +413,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
413 matrix_row_t last_row_value = current_matrix[row_index]; 413 matrix_row_t last_row_value = current_matrix[row_index];
414 414
415 // Check row pin state 415 // Check row pin state
416 if (readPin(row_pins[row_index]) == 0) { 416 if (gpio_read_pin(row_pins[row_index]) == 0) {
417 // Pin LO, set col bit 417 // Pin LO, set col bit
418 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); 418 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
419 } else { 419 } else {
diff --git a/keyboards/mechlovin/olly/jf/rev1/rev1.c b/keyboards/mechlovin/olly/jf/rev1/rev1.c
index 3d18d7bb5a..591c28dd44 100644
--- a/keyboards/mechlovin/olly/jf/rev1/rev1.c
+++ b/keyboards/mechlovin/olly/jf/rev1/rev1.c
@@ -18,22 +18,22 @@
18 18
19 19
20void led_init_ports(void) { 20void led_init_ports(void) {
21 setPinOutput(C0); 21 gpio_set_pin_output(C0);
22 setPinOutput(D0); 22 gpio_set_pin_output(D0);
23 setPinOutput(D1); 23 gpio_set_pin_output(D1);
24 setPinOutput(C1); 24 gpio_set_pin_output(C1);
25 setPinOutput(C6); 25 gpio_set_pin_output(C6);
26 setPinOutput(B0); 26 gpio_set_pin_output(B0);
27 setPinOutput(B1); 27 gpio_set_pin_output(B1);
28 setPinOutput(B2); 28 gpio_set_pin_output(B2);
29} 29}
30 30
31layer_state_t layer_state_set_user(layer_state_t state) { 31layer_state_t layer_state_set_user(layer_state_t state) {
32 writePin(D1, layer_state_cmp(state, 1)); 32 gpio_write_pin(D1, layer_state_cmp(state, 1));
33 writePin(D0, layer_state_cmp(state, 2)); 33 gpio_write_pin(D0, layer_state_cmp(state, 2));
34 writePin(C1, layer_state_cmp(state, 3)); 34 gpio_write_pin(C1, layer_state_cmp(state, 3));
35 writePin(C0, layer_state_cmp(state, 4)); 35 gpio_write_pin(C0, layer_state_cmp(state, 4));
36 writePin(C6, layer_state_cmp(state, 5)); 36 gpio_write_pin(C6, layer_state_cmp(state, 5));
37 37
38 return state; 38 return state;
39} 39}
diff --git a/keyboards/mechlovin/olly/orion/orion.c b/keyboards/mechlovin/olly/orion/orion.c
index 9fc89a6d02..4dcc15cf77 100644
--- a/keyboards/mechlovin/olly/orion/orion.c
+++ b/keyboards/mechlovin/olly/orion/orion.c
@@ -22,20 +22,20 @@ void board_init(void) {
22} 22}
23 23
24void keyboard_pre_init_kb(void) { 24void keyboard_pre_init_kb(void) {
25 setPinOutput(B5); 25 gpio_set_pin_output(B5);
26 setPinOutput(B6); 26 gpio_set_pin_output(B6);
27 setPinOutput(B7); 27 gpio_set_pin_output(B7);
28 setPinOutput(B8); 28 gpio_set_pin_output(B8);
29 setPinOutput(B9); 29 gpio_set_pin_output(B9);
30 keyboard_pre_init_user(); 30 keyboard_pre_init_user();
31} 31}
32 32
33layer_state_t layer_state_set_kb(layer_state_t state) { 33layer_state_t layer_state_set_kb(layer_state_t state) {
34 state = layer_state_set_user(state); 34 state = layer_state_set_user(state);
35 writePin(B7, layer_state_cmp(state, 0)); 35 gpio_write_pin(B7, layer_state_cmp(state, 0));
36 writePin(B6, layer_state_cmp(state, 1)); 36 gpio_write_pin(B6, layer_state_cmp(state, 1));
37 writePin(B5, layer_state_cmp(state, 2)); 37 gpio_write_pin(B5, layer_state_cmp(state, 2));
38 writePin(B8, layer_state_cmp(state, 3)); 38 gpio_write_pin(B8, layer_state_cmp(state, 3));
39 writePin(B9, layer_state_cmp(state, 4)); 39 gpio_write_pin(B9, layer_state_cmp(state, 4));
40 return state; 40 return state;
41} 41}
diff --git a/keyboards/mechlovin/serratus/matrix.c b/keyboards/mechlovin/serratus/matrix.c
index 62a56f687c..16bee61ad0 100644
--- a/keyboards/mechlovin/serratus/matrix.c
+++ b/keyboards/mechlovin/serratus/matrix.c
@@ -37,7 +37,7 @@ static void init_pins(void) {
37 for (int col = 0; col < MATRIX_COLS; col++) { 37 for (int col = 0; col < MATRIX_COLS; col++) {
38 pin_t pin = direct_pins[row][col]; 38 pin_t pin = direct_pins[row][col];
39 if (pin != NO_PIN) { 39 if (pin != NO_PIN) {
40 setPinInputHigh(pin); 40 gpio_set_pin_input_high(pin);
41 } 41 }
42 } 42 }
43 } 43 }
@@ -50,7 +50,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
50 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 50 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
51 pin_t pin = direct_pins[current_row][col_index]; 51 pin_t pin = direct_pins[current_row][col_index];
52 if (pin != NO_PIN) { 52 if (pin != NO_PIN) {
53 current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); 53 current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
54 } 54 }
55 } 55 }
56 56
@@ -101,103 +101,103 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
101static void select_col(uint8_t col) { 101static void select_col(uint8_t col) {
102 switch (col) { 102 switch (col) {
103 case 0: 103 case 0:
104 writePinLow(B5); 104 gpio_write_pin_low(B5);
105 writePinLow(B7); 105 gpio_write_pin_low(B7);
106 writePinLow(F0); 106 gpio_write_pin_low(F0);
107 writePinHigh(B0); 107 gpio_write_pin_high(B0);
108 break; 108 break;
109 case 1: 109 case 1:
110 writePinLow(B5); 110 gpio_write_pin_low(B5);
111 writePinLow(B7); 111 gpio_write_pin_low(B7);
112 writePinHigh(F0); 112 gpio_write_pin_high(F0);
113 writePinHigh(B0); 113 gpio_write_pin_high(B0);
114 break; 114 break;
115 case 2: 115 case 2:
116 writePinLow(B5); 116 gpio_write_pin_low(B5);
117 writePinHigh(B7); 117 gpio_write_pin_high(B7);
118 writePinLow(F0); 118 gpio_write_pin_low(F0);
119 writePinHigh(B0); 119 gpio_write_pin_high(B0);
120 break; 120 break;
121 case 3: 121 case 3:
122 writePinLow(B5); 122 gpio_write_pin_low(B5);
123 writePinHigh(B7); 123 gpio_write_pin_high(B7);
124 writePinHigh(F0); 124 gpio_write_pin_high(F0);
125 writePinHigh(B0); 125 gpio_write_pin_high(B0);
126 break; 126 break;
127 case 4: 127 case 4:
128 writePinHigh(B5); 128 gpio_write_pin_high(B5);
129 writePinLow(B7); 129 gpio_write_pin_low(B7);
130 writePinLow(F0); 130 gpio_write_pin_low(F0);
131 writePinHigh(B0); 131 gpio_write_pin_high(B0);
132 break; 132 break;
133 case 5: 133 case 5:
134 writePinHigh(B5); 134 gpio_write_pin_high(B5);
135 writePinLow(B7); 135 gpio_write_pin_low(B7);
136 writePinHigh(F0); 136 gpio_write_pin_high(F0);
137 writePinHigh(B0); 137 gpio_write_pin_high(B0);
138 break; 138 break;
139 case 6: 139 case 6:
140 writePinHigh(B5); 140 gpio_write_pin_high(B5);
141 writePinHigh(B7); 141 gpio_write_pin_high(B7);
142 writePinLow(F0); 142 gpio_write_pin_low(F0);
143 writePinHigh(B0); 143 gpio_write_pin_high(B0);
144 break; 144 break;
145 case 7: 145 case 7:
146 writePinHigh(B5); 146 gpio_write_pin_high(B5);
147 writePinHigh(B7); 147 gpio_write_pin_high(B7);
148 writePinHigh(F0); 148 gpio_write_pin_high(F0);
149 writePinHigh(B0); 149 gpio_write_pin_high(B0);
150 break; 150 break;
151 case 8: 151 case 8:
152 writePinLow(B5); 152 gpio_write_pin_low(B5);
153 writePinLow(B7); 153 gpio_write_pin_low(B7);
154 writePinLow(F0); 154 gpio_write_pin_low(F0);
155 writePinHigh(F1); 155 gpio_write_pin_high(F1);
156 break; 156 break;
157 case 9: 157 case 9:
158 writePinLow(B5); 158 gpio_write_pin_low(B5);
159 writePinLow(B7); 159 gpio_write_pin_low(B7);
160 writePinHigh(F0); 160 gpio_write_pin_high(F0);
161 writePinHigh(F1); 161 gpio_write_pin_high(F1);
162 break; 162 break;
163 case 10: 163 case 10:
164 writePinLow(B5); 164 gpio_write_pin_low(B5);
165 writePinHigh(B7); 165 gpio_write_pin_high(B7);
166 writePinLow(F0); 166 gpio_write_pin_low(F0);
167 writePinHigh(F1); 167 gpio_write_pin_high(F1);
168 break; 168 break;
169 case 11: 169 case 11:
170 writePinLow(B5); 170 gpio_write_pin_low(B5);
171 writePinHigh(B7); 171 gpio_write_pin_high(B7);
172 writePinHigh(F0); 172 gpio_write_pin_high(F0);
173 writePinHigh(F1); 173 gpio_write_pin_high(F1);
174 break; 174 break;
175 case 12: 175 case 12:
176 writePinHigh(B5); 176 gpio_write_pin_high(B5);
177 writePinLow(B7); 177 gpio_write_pin_low(B7);
178 writePinLow(F0); 178 gpio_write_pin_low(F0);
179 writePinHigh(F1); 179 gpio_write_pin_high(F1);
180 break; 180 break;
181 case 13: 181 case 13:
182 writePinHigh(B5); 182 gpio_write_pin_high(B5);
183 writePinLow(B7); 183 gpio_write_pin_low(B7);
184 writePinHigh(F0); 184 gpio_write_pin_high(F0);
185 writePinHigh(F1); 185 gpio_write_pin_high(F1);
186 break; 186 break;
187 case 14: 187 case 14:
188 writePinHigh(B5); 188 gpio_write_pin_high(B5);
189 writePinHigh(B7); 189 gpio_write_pin_high(B7);
190 writePinHigh(F0); 190 gpio_write_pin_high(F0);
191 writePinHigh(F1); 191 gpio_write_pin_high(F1);
192 break; 192 break;
193 case 15: 193 case 15:
194 writePinHigh(B5); 194 gpio_write_pin_high(B5);
195 writePinHigh(B7); 195 gpio_write_pin_high(B7);
196 writePinLow(F0); 196 gpio_write_pin_low(F0);
197 writePinHigh(F1); 197 gpio_write_pin_high(F1);
198 break; 198 break;
199 case 16: 199 case 16:
200 writePinLow(E6); 200 gpio_write_pin_low(E6);
201 break; 201 break;
202 } 202 }
203} 203}
@@ -205,130 +205,130 @@ static void select_col(uint8_t col) {
205static void unselect_col(uint8_t col) { 205static void unselect_col(uint8_t col) {
206 switch (col) { 206 switch (col) {
207 case 0: 207 case 0:
208 writePinHigh(B5); 208 gpio_write_pin_high(B5);
209 writePinHigh(B7); 209 gpio_write_pin_high(B7);
210 writePinHigh(F0); 210 gpio_write_pin_high(F0);
211 writePinLow(B0); 211 gpio_write_pin_low(B0);
212 break; 212 break;
213 case 1: 213 case 1:
214 writePinHigh(B5); 214 gpio_write_pin_high(B5);
215 writePinHigh(B7); 215 gpio_write_pin_high(B7);
216 writePinLow(F0); 216 gpio_write_pin_low(F0);
217 writePinLow(B0); 217 gpio_write_pin_low(B0);
218 break; 218 break;
219 case 2: 219 case 2:
220 writePinHigh(B5); 220 gpio_write_pin_high(B5);
221 writePinLow(B7); 221 gpio_write_pin_low(B7);
222 writePinHigh(F0); 222 gpio_write_pin_high(F0);
223 writePinLow(B0); 223 gpio_write_pin_low(B0);
224 break; 224 break;
225 case 3: 225 case 3:
226 writePinHigh(B5); 226 gpio_write_pin_high(B5);
227 writePinLow(B7); 227 gpio_write_pin_low(B7);
228 writePinLow(F0); 228 gpio_write_pin_low(F0);
229 writePinLow(B0); 229 gpio_write_pin_low(B0);
230 break; 230 break;
231 case 4: 231 case 4:
232 writePinLow(B5); 232 gpio_write_pin_low(B5);
233 writePinHigh(B7); 233 gpio_write_pin_high(B7);
234 writePinHigh(F0); 234 gpio_write_pin_high(F0);
235 writePinLow(B0); 235 gpio_write_pin_low(B0);
236 break; 236 break;
237 case 5: 237 case 5:
238 writePinLow(B5); 238 gpio_write_pin_low(B5);
239 writePinHigh(B7); 239 gpio_write_pin_high(B7);
240 writePinLow(F0); 240 gpio_write_pin_low(F0);
241 writePinLow(B0); 241 gpio_write_pin_low(B0);
242 break; 242 break;
243 case 6: 243 case 6:
244 writePinLow(B5); 244 gpio_write_pin_low(B5);
245 writePinLow(B7); 245 gpio_write_pin_low(B7);
246 writePinHigh(F0); 246 gpio_write_pin_high(F0);
247 writePinLow(B0); 247 gpio_write_pin_low(B0);
248 break; 248 break;
249 case 7: 249 case 7:
250 writePinLow(B5); 250 gpio_write_pin_low(B5);
251 writePinLow(B7); 251 gpio_write_pin_low(B7);
252 writePinLow(F0); 252 gpio_write_pin_low(F0);
253 writePinLow(B0); 253 gpio_write_pin_low(B0);
254 break; 254 break;
255 case 8: 255 case 8:
256 writePinHigh(B5); 256 gpio_write_pin_high(B5);
257 writePinHigh(B7); 257 gpio_write_pin_high(B7);
258 writePinHigh(F0); 258 gpio_write_pin_high(F0);
259 writePinLow(F1); 259 gpio_write_pin_low(F1);
260 break; 260 break;
261 case 9: 261 case 9:
262 writePinHigh(B5); 262 gpio_write_pin_high(B5);
263 writePinHigh(B7); 263 gpio_write_pin_high(B7);
264 writePinLow(F0); 264 gpio_write_pin_low(F0);
265 writePinLow(F1); 265 gpio_write_pin_low(F1);
266 break; 266 break;
267 case 10: 267 case 10:
268 writePinHigh(B5); 268 gpio_write_pin_high(B5);
269 writePinLow(B7); 269 gpio_write_pin_low(B7);
270 writePinHigh(F0); 270 gpio_write_pin_high(F0);
271 writePinLow(F1); 271 gpio_write_pin_low(F1);
272 break; 272 break;
273 case 11: 273 case 11:
274 writePinHigh(B5); 274 gpio_write_pin_high(B5);
275 writePinLow(B7); 275 gpio_write_pin_low(B7);
276 writePinLow(F0); 276 gpio_write_pin_low(F0);
277 writePinLow(F1); 277 gpio_write_pin_low(F1);
278 break; 278 break;
279 case 12: 279 case 12:
280 writePinLow(B5); 280 gpio_write_pin_low(B5);
281 writePinHigh(B7); 281 gpio_write_pin_high(B7);
282 writePinHigh(F0); 282 gpio_write_pin_high(F0);
283 writePinLow(F1); 283 gpio_write_pin_low(F1);
284 break; 284 break;
285 case 13: 285 case 13:
286 writePinLow(B5); 286 gpio_write_pin_low(B5);
287 writePinHigh(B7); 287 gpio_write_pin_high(B7);
288 writePinLow(F0); 288 gpio_write_pin_low(F0);
289 writePinLow(F1); 289 gpio_write_pin_low(F1);
290 break; 290 break;
291 case 14: 291 case 14:
292 writePinLow(B5); 292 gpio_write_pin_low(B5);
293 writePinLow(B7); 293 gpio_write_pin_low(B7);
294 writePinLow(F0); 294 gpio_write_pin_low(F0);
295 writePinLow(F1); 295 gpio_write_pin_low(F1);
296 break; 296 break;
297 case 15: 297 case 15:
298 writePinLow(B5); 298 gpio_write_pin_low(B5);
299 writePinLow(B7); 299 gpio_write_pin_low(B7);
300 writePinHigh(F0); 300 gpio_write_pin_high(F0);
301 writePinLow(F1); 301 gpio_write_pin_low(F1);
302 break; 302 break;
303 case 16: 303 case 16:
304 writePinHigh(E6); 304 gpio_write_pin_high(E6);
305 break; 305 break;
306 } 306 }
307} 307}
308 308
309static void unselect_cols(void) { 309static void unselect_cols(void) {
310 //Native 310 //Native
311 writePinHigh(E6); 311 gpio_write_pin_high(E6);
312 312
313 //Demultiplexer 313 //Demultiplexer
314 writePinLow(B0); 314 gpio_write_pin_low(B0);
315 writePinLow(F1); 315 gpio_write_pin_low(F1);
316 writePinHigh(B5); 316 gpio_write_pin_high(B5);
317 writePinHigh(B7); 317 gpio_write_pin_high(B7);
318 writePinHigh(F0); 318 gpio_write_pin_high(F0);
319} 319}
320 320
321static void init_pins(void) { 321static void init_pins(void) {
322 unselect_cols(); 322 unselect_cols();
323 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 323 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
324 setPinInputHigh(row_pins[x]); 324 gpio_set_pin_input_high(row_pins[x]);
325 } 325 }
326 setPinOutput(B5); 326 gpio_set_pin_output(B5);
327 setPinOutput(B7); 327 gpio_set_pin_output(B7);
328 setPinOutput(F0); 328 gpio_set_pin_output(F0);
329 setPinOutput(B0); 329 gpio_set_pin_output(B0);
330 setPinOutput(F1); 330 gpio_set_pin_output(F1);
331 setPinOutput(E6); 331 gpio_set_pin_output(E6);
332} 332}
333 333
334static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 334static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
@@ -344,7 +344,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
344 matrix_row_t last_row_value = current_matrix[row_index]; 344 matrix_row_t last_row_value = current_matrix[row_index];
345 345
346 // Check row pin state 346 // Check row pin state
347 if (readPin(row_pins[row_index]) == 0) { 347 if (gpio_read_pin(row_pins[row_index]) == 0) {
348 // Pin LO, set col bit 348 // Pin LO, set col bit
349 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); 349 current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
350 } else { 350 } else {
diff --git a/keyboards/mechlovin/zed65/no_backlight/wearhaus66/wearhaus66.c b/keyboards/mechlovin/zed65/no_backlight/wearhaus66/wearhaus66.c
index 091373e387..a6942a2cb8 100644
--- a/keyboards/mechlovin/zed65/no_backlight/wearhaus66/wearhaus66.c
+++ b/keyboards/mechlovin/zed65/no_backlight/wearhaus66/wearhaus66.c
@@ -20,5 +20,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20void keyboard_pre_init_user(void) { 20void keyboard_pre_init_user(void) {
21 // Call the keyboard pre init code. 21 // Call the keyboard pre init code.
22 // Set our LED pins as output 22 // Set our LED pins as output
23 setPinOutput(B7); 23 gpio_set_pin_output(B7);
24} 24}
diff --git a/keyboards/mechwild/puckbuddy/puckbuddy.c b/keyboards/mechwild/puckbuddy/puckbuddy.c
index 5cf2d79b36..d386cf050e 100644
--- a/keyboards/mechwild/puckbuddy/puckbuddy.c
+++ b/keyboards/mechwild/puckbuddy/puckbuddy.c
@@ -21,7 +21,7 @@ uint16_t dpi_array[] = GLIDEPOINT_DPI_OPTIONS;
21void board_init(void) { 21void board_init(void) {
22 // B9 is configured as I2C1_SDA in the board file; that function must be 22 // B9 is configured as I2C1_SDA in the board file; that function must be
23 // disabled before using B7 as I2C1_SDA. 23 // disabled before using B7 as I2C1_SDA.
24 setPinInputHigh(B9); 24 gpio_set_pin_input_high(B9);
25} 25}
26 26
27#ifdef DYNAMIC_TAPPING_TERM_ENABLE 27#ifdef DYNAMIC_TAPPING_TERM_ENABLE
diff --git a/keyboards/mechwild/sugarglider/sugarglider.c b/keyboards/mechwild/sugarglider/sugarglider.c
index 76c6d29832..086294470e 100644
--- a/keyboards/mechwild/sugarglider/sugarglider.c
+++ b/keyboards/mechwild/sugarglider/sugarglider.c
@@ -19,14 +19,14 @@ uint16_t dpi_array[] = GLIDEPOINT_DPI_OPTIONS;
19void board_init(void) { 19void board_init(void) {
20 // B9 is configured as I2C1_SDA in the board file; that function must be 20 // B9 is configured as I2C1_SDA in the board file; that function must be
21 // disabled before using B7 as I2C1_SDA. 21 // disabled before using B7 as I2C1_SDA.
22 setPinInputHigh(B9); 22 gpio_set_pin_input_high(B9);
23 setPinOutput(B12); 23 gpio_set_pin_output(B12);
24 setPinOutput(B13); 24 gpio_set_pin_output(B13);
25 setPinOutput(B14); 25 gpio_set_pin_output(B14);
26 writePinLow(B12); 26 gpio_write_pin_low(B12);
27 writePinLow(B13); 27 gpio_write_pin_low(B13);
28 writePinLow(B14); 28 gpio_write_pin_low(B14);
29 setPinOutput(C13); 29 gpio_set_pin_output(C13);
30} 30}
31 31
32#ifdef DYNAMIC_TAPPING_TERM_ENABLE 32#ifdef DYNAMIC_TAPPING_TERM_ENABLE
@@ -110,10 +110,10 @@ bool encoder_update_kb(uint8_t index, bool clockwise) {
110bool led_update_kb(led_t led_state) { 110bool led_update_kb(led_t led_state) {
111 bool res = led_update_user(led_state); 111 bool res = led_update_user(led_state);
112 if(res) { 112 if(res) {
113 writePin(B12, led_state.num_lock); // Updates status LEDs 113 gpio_write_pin(B12, led_state.num_lock); // Updates status LEDs
114 writePin(B13, led_state.caps_lock); // Updates status LEDs 114 gpio_write_pin(B13, led_state.caps_lock); // Updates status LEDs
115 writePin(B14, led_state.scroll_lock); // Updates status LEDs 115 gpio_write_pin(B14, led_state.scroll_lock); // Updates status LEDs
116 writePin(C13, !led_state.caps_lock); // Updates status LEDs, this is the LED on the blackpill itself 116 gpio_write_pin(C13, !led_state.caps_lock); // Updates status LEDs, this is the LED on the blackpill itself
117 } 117 }
118 return res; 118 return res;
119} 119}
diff --git a/keyboards/mexsistor/ludmila/matrix.c b/keyboards/mexsistor/ludmila/matrix.c
index 5d27ec683f..fd197f366d 100644
--- a/keyboards/mexsistor/ludmila/matrix.c
+++ b/keyboards/mexsistor/ludmila/matrix.c
@@ -31,22 +31,22 @@ extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
31 31
32 32
33static void select_row(uint8_t row) { 33static void select_row(uint8_t row) {
34 setPinOutput(row_pins[row]); 34 gpio_set_pin_output(row_pins[row]);
35 writePinLow(row_pins[row]); 35 gpio_write_pin_low(row_pins[row]);
36} 36}
37 37
38static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } 38static void unselect_row(uint8_t row) { gpio_set_pin_input_high(row_pins[row]); }
39 39
40static void unselect_rows(void) { 40static void unselect_rows(void) {
41 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 41 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
42 setPinInputHigh(row_pins[x]); 42 gpio_set_pin_input_high(row_pins[x]);
43 } 43 }
44} 44}
45 45
46static void init_pins(void) { 46static void init_pins(void) {
47 unselect_rows(); 47 unselect_rows();
48 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 48 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
49 setPinInputHigh(col_pins[x]); 49 gpio_set_pin_input_high(col_pins[x]);
50 } 50 }
51} 51}
52 52
@@ -64,7 +64,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
64 // For each col... 64 // For each col...
65 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 65 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
66 // Select the col pin to read (active low) 66 // Select the col pin to read (active low)
67 uint8_t pin_state = readPin(col_pins[col_index]); 67 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
68 68
69 // Populate the matrix row with the state of the col pin 69 // Populate the matrix row with the state of the col pin
70 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 70 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
@@ -79,7 +79,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
79 79
80void matrix_init_custom(void) { 80void matrix_init_custom(void) {
81 // initialize key pins 81 // initialize key pins
82 setPinInput(ENC_SW); 82 gpio_set_pin_input(ENC_SW);
83 init_pins(); 83 init_pins();
84} 84}
85 85
@@ -108,7 +108,7 @@ static bool read_encoder_switches(matrix_row_t current_matrix[], uint8_t current
108 static uint8_t btn_1_array; 108 static uint8_t btn_1_array;
109 bool btn_1_pressed = 0; 109 bool btn_1_pressed = 0;
110 btn_1_array <<= 1; 110 btn_1_array <<= 1;
111 btn_1_array |= readPin(ENC_SW); 111 btn_1_array |= gpio_read_pin(ENC_SW);
112 (btn_1_array == 0b11111111) ? (btn_1_pressed = 1) : (btn_1_pressed = 0); 112 (btn_1_array == 0b11111111) ? (btn_1_pressed = 1) : (btn_1_pressed = 0);
113 113
114 // Populate the matrix row with the state of the encoder 114 // Populate the matrix row with the state of the encoder
diff --git a/keyboards/miiiw/blackio83/rev_0100/matrix.c b/keyboards/miiiw/blackio83/rev_0100/matrix.c
index ab252f919b..11a5aa97e6 100644
--- a/keyboards/miiiw/blackio83/rev_0100/matrix.c
+++ b/keyboards/miiiw/blackio83/rev_0100/matrix.c
@@ -34,7 +34,7 @@ static pin_t dip_switch_pad[] = DIP_SWITCH_PINS;
34 34
35void matrix_init_custom(void) { 35void matrix_init_custom(void) {
36 for (uint8_t row = 0; row < MATRIX_ROWS; row++) { 36 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
37 setPinInputLow(row_pins[row]); 37 gpio_set_pin_input_low(row_pins[row]);
38 } 38 }
39 39
40 shift_init(); 40 shift_init();
@@ -65,12 +65,12 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
65void matrix_power_up(void) { 65void matrix_power_up(void) {
66 for (uint8_t row = 0; row < MATRIX_ROWS; row++) { 66 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
67 palDisableLineEvent(row_pins[row]); 67 palDisableLineEvent(row_pins[row]);
68 setPinInputLow(row_pins[row]); 68 gpio_set_pin_input_low(row_pins[row]);
69 } 69 }
70 init_cols(); 70 init_cols();
71#ifdef DIP_SWITCH_PINS 71#ifdef DIP_SWITCH_PINS
72 for (uint8_t i = 1; i < NUMBER_OF_DIP_SWITCHES; i++) { 72 for (uint8_t i = 1; i < NUMBER_OF_DIP_SWITCHES; i++) {
73 setPinInputHigh(dip_switch_pad[i]); 73 gpio_set_pin_input_high(dip_switch_pad[i]);
74 } 74 }
75#endif 75#endif
76} 76}
@@ -78,12 +78,12 @@ void matrix_power_up(void) {
78void matrix_power_down(void) { 78void matrix_power_down(void) {
79 unselect_cols(); 79 unselect_cols();
80 for (uint8_t row = 0; row < MATRIX_ROWS; row++) { 80 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
81 setPinInputLow(row_pins[row]); 81 gpio_set_pin_input_low(row_pins[row]);
82 palEnableLineEvent(row_pins[row], PAL_EVENT_MODE_RISING_EDGE); 82 palEnableLineEvent(row_pins[row], PAL_EVENT_MODE_RISING_EDGE);
83 } 83 }
84#ifdef DIP_SWITCH_PINS 84#ifdef DIP_SWITCH_PINS
85 for (uint8_t i = 1; i < NUMBER_OF_DIP_SWITCHES; i++) { 85 for (uint8_t i = 1; i < NUMBER_OF_DIP_SWITCHES; i++) {
86 setPinInputLow(dip_switch_pad[i]); 86 gpio_set_pin_input_low(dip_switch_pad[i]);
87 } 87 }
88#endif 88#endif
89} 89}
@@ -91,7 +91,7 @@ void matrix_power_down(void) {
91static uint8_t read_rows(void) { 91static uint8_t read_rows(void) {
92 uint8_t row_value = 0; 92 uint8_t row_value = 0;
93 for(uint8_t row = 0; row < MATRIX_ROWS; row++) { 93 for(uint8_t row = 0; row < MATRIX_ROWS; row++) {
94 row_value |= (readPin(row_pins[row]) << row); 94 row_value |= (gpio_read_pin(row_pins[row]) << row);
95 } 95 }
96 return row_value; 96 return row_value;
97} 97}
@@ -100,15 +100,15 @@ static void init_cols(void) {
100 shift_writeAll(0); 100 shift_writeAll(0);
101 for(uint8_t col = 0; col < MATRIX_COLS; col++) { 101 for(uint8_t col = 0; col < MATRIX_COLS; col++) {
102 if(col_pins[col] < H0) { 102 if(col_pins[col] < H0) {
103 setPinOutput(col_pins[col]); 103 gpio_set_pin_output(col_pins[col]);
104 writePinLow(col_pins[col]); 104 gpio_write_pin_low(col_pins[col]);
105 } 105 }
106 } 106 }
107} 107}
108 108
109static void select_col(uint8_t col) { 109static void select_col(uint8_t col) {
110 if(col_pins[col] < H0){ 110 if(col_pins[col] < H0){
111 writePinHigh(col_pins[col]); 111 gpio_write_pin_high(col_pins[col]);
112 waitInputPinDelay(); 112 waitInputPinDelay();
113 waitInputPinDelay(); 113 waitInputPinDelay();
114 waitInputPinDelay(); 114 waitInputPinDelay();
@@ -122,7 +122,7 @@ static void select_col(uint8_t col) {
122 122
123static void unselect_col(uint8_t col) { 123static void unselect_col(uint8_t col) {
124 if(col_pins[col] < H0){ 124 if(col_pins[col] < H0){
125 writePinLow(col_pins[col]); 125 gpio_write_pin_low(col_pins[col]);
126 }else{ 126 }else{
127 shift_writePin(col_pins[col], 0); 127 shift_writePin(col_pins[col], 0);
128 } 128 }
@@ -132,8 +132,8 @@ static void unselect_cols(void) {
132 shift_writeAll(1); 132 shift_writeAll(1);
133 for(uint8_t col = 0; col < MATRIX_COLS; col++) { 133 for(uint8_t col = 0; col < MATRIX_COLS; col++) {
134 if(col_pins[col] < H0) { 134 if(col_pins[col] < H0) {
135 setPinOutput(col_pins[col]); 135 gpio_set_pin_output(col_pins[col]);
136 writePinHigh(col_pins[col]); 136 gpio_write_pin_high(col_pins[col]);
137 } 137 }
138 } 138 }
139} 139}
diff --git a/keyboards/miiiw/blackio83/rev_0100/rev_0100.c b/keyboards/miiiw/blackio83/rev_0100/rev_0100.c
index 7af6861f53..18f4c86510 100644
--- a/keyboards/miiiw/blackio83/rev_0100/rev_0100.c
+++ b/keyboards/miiiw/blackio83/rev_0100/rev_0100.c
@@ -49,25 +49,25 @@ void ws2812_poweron(void) {
49 if(p_setup) return; 49 if(p_setup) return;
50 p_setup = true; 50 p_setup = true;
51 s_init = false; 51 s_init = false;
52 setPinOutput(RGB_EN_PIN); 52 gpio_set_pin_output(RGB_EN_PIN);
53 writePinHigh(RGB_EN_PIN); 53 gpio_write_pin_high(RGB_EN_PIN);
54} 54}
55 55
56void ws2812_poweroff(void) { 56void ws2812_poweroff(void) {
57 if(!p_setup) return; 57 if(!p_setup) return;
58 p_setup = false; 58 p_setup = false;
59 setPinInputLow(WS2812_DI_PIN); 59 gpio_set_pin_input_low(WS2812_DI_PIN);
60 writePinLow(RGB_EN_PIN); 60 gpio_write_pin_low(RGB_EN_PIN);
61} 61}
62 62
63void keyboard_pre_init_kb() { 63void keyboard_pre_init_kb() {
64 keyboard_pre_init_user(); 64 keyboard_pre_init_user();
65 65
66 setPinInputLow(MWPROTO_STATUS_PIN); 66 gpio_set_pin_input_low(MWPROTO_STATUS_PIN);
67 setPinOutput(MWPROTO_WAKEUP_PIN); 67 gpio_set_pin_output(MWPROTO_WAKEUP_PIN);
68 writePinLow(MWPROTO_WAKEUP_PIN); 68 gpio_write_pin_low(MWPROTO_WAKEUP_PIN);
69 wait_ms(2); 69 wait_ms(2);
70 writePinHigh(MWPROTO_WAKEUP_PIN); 70 gpio_write_pin_high(MWPROTO_WAKEUP_PIN);
71 71
72 palSetLineMode(MWPROTO_TX_PIN, PAL_MODE_ALTERNATE(MWPROTO_TX_PAL_MODE) | PAL_OUTPUT_TYPE_OPENDRAIN); 72 palSetLineMode(MWPROTO_TX_PIN, PAL_MODE_ALTERNATE(MWPROTO_TX_PAL_MODE) | PAL_OUTPUT_TYPE_OPENDRAIN);
73 sdStart(&MWPROTO_DRIVER, &mwproto_uart_config); 73 sdStart(&MWPROTO_DRIVER, &mwproto_uart_config);
@@ -84,14 +84,14 @@ void keyboard_post_init_kb(void) {
84 "BUILD: " __DATE__ "\n" 84 "BUILD: " __DATE__ "\n"
85 ); /* clang-format on */ 85 ); /* clang-format on */
86 86
87 writePinLow(MWPROTO_WAKEUP_PIN); 87 gpio_write_pin_low(MWPROTO_WAKEUP_PIN);
88 wait_ms(50); 88 wait_ms(50);
89 sdPutI(&MWPROTO_DRIVER, 0xA5); 89 sdPutI(&MWPROTO_DRIVER, 0xA5);
90 sdPutI(&MWPROTO_DRIVER, 0x12); 90 sdPutI(&MWPROTO_DRIVER, 0x12);
91 sdPutI(&MWPROTO_DRIVER, 0x01); 91 sdPutI(&MWPROTO_DRIVER, 0x01);
92 sdPutI(&MWPROTO_DRIVER, 0x02); 92 sdPutI(&MWPROTO_DRIVER, 0x02);
93 sdPutI(&MWPROTO_DRIVER, 0xB4); 93 sdPutI(&MWPROTO_DRIVER, 0xB4);
94 writePinHigh(MWPROTO_WAKEUP_PIN); 94 gpio_write_pin_high(MWPROTO_WAKEUP_PIN);
95 95
96 ws2812_poweron(); 96 ws2812_poweron();
97 loop10hz_token = defer_exec(LOOP_10HZ_PERIOD, loop_10Hz, NULL); 97 loop10hz_token = defer_exec(LOOP_10HZ_PERIOD, loop_10Hz, NULL);
@@ -117,7 +117,7 @@ bool dip_switch_update_mask_kb(uint32_t state) {
117 usbDisconnectBus(&USB_DRIVER); 117 usbDisconnectBus(&USB_DRIVER);
118 usbStop(&USB_DRIVER); 118 usbStop(&USB_DRIVER);
119 shutdown_user(true); 119 shutdown_user(true);
120 setPinInputHigh(POWER_SWITCH_PIN); 120 gpio_set_pin_input_high(POWER_SWITCH_PIN);
121 palEnableLineEvent(POWER_SWITCH_PIN, PAL_EVENT_MODE_RISING_EDGE); 121 palEnableLineEvent(POWER_SWITCH_PIN, PAL_EVENT_MODE_RISING_EDGE);
122 POWER_EnterSleep(); 122 POWER_EnterSleep();
123 } 123 }
@@ -132,8 +132,8 @@ uint32_t loop_10Hz(uint32_t trigger_time, void *cb_arg) {
132 static uint32_t pmu_timer = 0; 132 static uint32_t pmu_timer = 0;
133 if(timer_elapsed32(pmu_timer) > 3000) { 133 if(timer_elapsed32(pmu_timer) > 3000) {
134 pmu_timer = timer_read32(); 134 pmu_timer = timer_read32();
135 writePinLow(MWPROTO_WAKEUP_PIN); 135 gpio_write_pin_low(MWPROTO_WAKEUP_PIN);
136 if(readPin(MWPROTO_STATUS_PIN)) 136 if(gpio_read_pin(MWPROTO_STATUS_PIN))
137 wait_us(500); 137 wait_us(500);
138 else 138 else
139 wait_us(1500); 139 wait_us(1500);
@@ -141,7 +141,7 @@ uint32_t loop_10Hz(uint32_t trigger_time, void *cb_arg) {
141 sdPutI(&MWPROTO_DRIVER, 0x28); 141 sdPutI(&MWPROTO_DRIVER, 0x28);
142 sdPutI(&MWPROTO_DRIVER, 0x00); 142 sdPutI(&MWPROTO_DRIVER, 0x00);
143 sdPutI(&MWPROTO_DRIVER, 0x8D); 143 sdPutI(&MWPROTO_DRIVER, 0x8D);
144 writePinHigh(MWPROTO_WAKEUP_PIN); 144 gpio_write_pin_high(MWPROTO_WAKEUP_PIN);
145 } 145 }
146 } 146 }
147 147
@@ -151,8 +151,8 @@ uint32_t loop_10Hz(uint32_t trigger_time, void *cb_arg) {
151 matrix[2] == 0 && matrix[3] == 0 && matrix[4] == 0 && matrix[5] == 0x201) { 151 matrix[2] == 0 && matrix[3] == 0 && matrix[4] == 0 && matrix[5] == 0x201) {
152 if(restore_tick++ > 50) { 152 if(restore_tick++ > 50) {
153 restore_tick = 0; 153 restore_tick = 0;
154 writePinLow(MWPROTO_WAKEUP_PIN); 154 gpio_write_pin_low(MWPROTO_WAKEUP_PIN);
155 if(readPin(MWPROTO_STATUS_PIN)) 155 if(gpio_read_pin(MWPROTO_STATUS_PIN))
156 wait_us(500); 156 wait_us(500);
157 else 157 else
158 wait_us(1500); 158 wait_us(1500);
@@ -161,7 +161,7 @@ uint32_t loop_10Hz(uint32_t trigger_time, void *cb_arg) {
161 sdPutI(&MWPROTO_DRIVER, 0x01); 161 sdPutI(&MWPROTO_DRIVER, 0x01);
162 sdPutI(&MWPROTO_DRIVER, 0x0F); 162 sdPutI(&MWPROTO_DRIVER, 0x0F);
163 sdPutI(&MWPROTO_DRIVER, 0xB4); 163 sdPutI(&MWPROTO_DRIVER, 0xB4);
164 writePinHigh(MWPROTO_WAKEUP_PIN); 164 gpio_write_pin_high(MWPROTO_WAKEUP_PIN);
165 wait_ms(50); 165 wait_ms(50);
166 eeconfig_init(); 166 eeconfig_init();
167 #ifdef RGB_MATRIX_ENABLE 167 #ifdef RGB_MATRIX_ENABLE
diff --git a/keyboards/miiiw/common/shift_register.c b/keyboards/miiiw/common/shift_register.c
index 2c9259180e..5f82fc6442 100644
--- a/keyboards/miiiw/common/shift_register.c
+++ b/keyboards/miiiw/common/shift_register.c
@@ -23,30 +23,30 @@ static uint8_t shift_values[SHR_SERIES_NUM] = {0};
23 23
24void shift_init(void) { 24void shift_init(void) {
25#ifdef SHR_OE_PIN 25#ifdef SHR_OE_PIN
26 setPinOutput(SHR_OE_PIN); 26 gpio_set_pin_output(SHR_OE_PIN);
27 writePinHigh(SHR_OE_PIN); 27 gpio_write_pin_high(SHR_OE_PIN);
28#endif 28#endif
29 setPinOutput(SHR_DATA_PIN); 29 gpio_set_pin_output(SHR_DATA_PIN);
30 setPinOutput(SHR_LATCH_PIN); 30 gpio_set_pin_output(SHR_LATCH_PIN);
31 setPinOutput(SHR_CLOCK_PIN); 31 gpio_set_pin_output(SHR_CLOCK_PIN);
32} 32}
33 33
34void shift_enable(void) { 34void shift_enable(void) {
35#ifdef SHR_OE_PIN 35#ifdef SHR_OE_PIN
36 writePinLow(SHR_OE_PIN); 36 gpio_write_pin_low(SHR_OE_PIN);
37#endif 37#endif
38 writePinLow(SHR_DATA_PIN); 38 gpio_write_pin_low(SHR_DATA_PIN);
39 writePinLow(SHR_LATCH_PIN); 39 gpio_write_pin_low(SHR_LATCH_PIN);
40 writePinLow(SHR_CLOCK_PIN); 40 gpio_write_pin_low(SHR_CLOCK_PIN);
41} 41}
42 42
43void shift_disable(void) { 43void shift_disable(void) {
44#ifdef SHR_OE_PIN 44#ifdef SHR_OE_PIN
45 writePinHigh(SHR_OE_PIN); 45 gpio_write_pin_high(SHR_OE_PIN);
46#endif 46#endif
47 writePinLow(SHR_DATA_PIN); 47 gpio_write_pin_low(SHR_DATA_PIN);
48 writePinLow(SHR_LATCH_PIN); 48 gpio_write_pin_low(SHR_LATCH_PIN);
49 writePinLow(SHR_CLOCK_PIN); 49 gpio_write_pin_low(SHR_CLOCK_PIN);
50} 50}
51 51
52void shift_writePin(pin_t pin, int level) { 52void shift_writePin(pin_t pin, int level) {
@@ -78,13 +78,13 @@ void shift_writeAll(int level) {
78 78
79static void shift_out(void) { 79static void shift_out(void) {
80 uint8_t n = SHR_SERIES_NUM; 80 uint8_t n = SHR_SERIES_NUM;
81 writePinLow(SHR_LATCH_PIN); 81 gpio_write_pin_low(SHR_LATCH_PIN);
82 while(n--){ 82 while(n--){
83 for (uint8_t i = 0; i < 8; i++) { 83 for (uint8_t i = 0; i < 8; i++) {
84 writePinLow(SHR_CLOCK_PIN); 84 gpio_write_pin_low(SHR_CLOCK_PIN);
85 writePin(SHR_DATA_PIN, shift_values[n] & (0x80 >> i)); 85 gpio_write_pin(SHR_DATA_PIN, shift_values[n] & (0x80 >> i));
86 writePinHigh(SHR_CLOCK_PIN); 86 gpio_write_pin_high(SHR_CLOCK_PIN);
87 } 87 }
88 } 88 }
89 writePinHigh(SHR_LATCH_PIN); 89 gpio_write_pin_high(SHR_LATCH_PIN);
90} 90}
diff --git a/keyboards/mlego/m48/m48.h b/keyboards/mlego/m48/m48.h
index 5acc5c4590..1d183bbd6d 100644
--- a/keyboards/mlego/m48/m48.h
+++ b/keyboards/mlego/m48/m48.h
@@ -21,18 +21,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21 21
22static inline void led_lwr(const bool on) { 22static inline void led_lwr(const bool on) {
23#ifdef LED_NUM_LOCK_PIN 23#ifdef LED_NUM_LOCK_PIN
24 writePin(LED_NUM_LOCK_PIN, on); 24 gpio_write_pin(LED_NUM_LOCK_PIN, on);
25#endif 25#endif
26} 26}
27 27
28static inline void led_rse(const bool on) { 28static inline void led_rse(const bool on) {
29#ifdef LED_SCROLL_LOCK_PIN 29#ifdef LED_SCROLL_LOCK_PIN
30 writePin(LED_SCROLL_LOCK_PIN, on); 30 gpio_write_pin(LED_SCROLL_LOCK_PIN, on);
31#endif 31#endif
32} 32}
33static inline void led_caps(const bool on) { 33static inline void led_caps(const bool on) {
34#ifdef LED_CAPS_LOCK_PIN 34#ifdef LED_CAPS_LOCK_PIN
35 writePin(LED_CAPS_LOCK_PIN, !on); 35 gpio_write_pin(LED_CAPS_LOCK_PIN, !on);
36#endif 36#endif
37} 37}
38 38
diff --git a/keyboards/mlego/m60/m60.h b/keyboards/mlego/m60/m60.h
index 13a56f3ff0..44245f5e1e 100644
--- a/keyboards/mlego/m60/m60.h
+++ b/keyboards/mlego/m60/m60.h
@@ -21,18 +21,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21 21
22static inline void led_lwr(const bool on) { 22static inline void led_lwr(const bool on) {
23#ifdef LED_NUM_LOCK_PIN 23#ifdef LED_NUM_LOCK_PIN
24 writePin(LED_NUM_LOCK_PIN, on); 24 gpio_write_pin(LED_NUM_LOCK_PIN, on);
25#endif 25#endif
26} 26}
27 27
28static inline void led_rse(const bool on) { 28static inline void led_rse(const bool on) {
29#ifdef LED_SCROLL_LOCK_PIN 29#ifdef LED_SCROLL_LOCK_PIN
30 writePin(LED_SCROLL_LOCK_PIN, on); 30 gpio_write_pin(LED_SCROLL_LOCK_PIN, on);
31#endif 31#endif
32} 32}
33static inline void led_caps(const bool on) { 33static inline void led_caps(const bool on) {
34#ifdef LED_CAPS_LOCK_PIN 34#ifdef LED_CAPS_LOCK_PIN
35 writePin(LED_CAPS_LOCK_PIN, !on); 35 gpio_write_pin(LED_CAPS_LOCK_PIN, !on);
36#endif 36#endif
37} 37}
38 38
diff --git a/keyboards/mlego/m60_split/m60_split.h b/keyboards/mlego/m60_split/m60_split.h
index 10be6662c4..203514244f 100644
--- a/keyboards/mlego/m60_split/m60_split.h
+++ b/keyboards/mlego/m60_split/m60_split.h
@@ -19,19 +19,19 @@
19 19
20static inline void led_lwr(const bool on) { 20static inline void led_lwr(const bool on) {
21#ifdef LED_NUM_LOCK_PIN 21#ifdef LED_NUM_LOCK_PIN
22 writePin(LED_NUM_LOCK_PIN, on); 22 gpio_write_pin(LED_NUM_LOCK_PIN, on);
23#endif 23#endif
24} 24}
25 25
26static inline void led_rse(const bool on) { 26static inline void led_rse(const bool on) {
27#ifdef LED_SCROLL_LOCK_PIN 27#ifdef LED_SCROLL_LOCK_PIN
28 writePin(LED_SCROLL_LOCK_PIN, on); 28 gpio_write_pin(LED_SCROLL_LOCK_PIN, on);
29#endif 29#endif
30} 30}
31 31
32static inline void led_caps(const bool on) { 32static inline void led_caps(const bool on) {
33#ifdef LED_CAPS_LOCK_PIN 33#ifdef LED_CAPS_LOCK_PIN
34 writePin(LED_CAPS_LOCK_PIN, !on); 34 gpio_write_pin(LED_CAPS_LOCK_PIN, !on);
35#endif 35#endif
36} 36}
37 37
diff --git a/keyboards/mlego/m65/m65.h b/keyboards/mlego/m65/m65.h
index 1c5589c111..0ce073cfc6 100644
--- a/keyboards/mlego/m65/m65.h
+++ b/keyboards/mlego/m65/m65.h
@@ -30,14 +30,14 @@ void set_led_toggle(const uint8_t, const bool);
30 30
31static inline void init_lwr_rse_led(void) { 31static inline void init_lwr_rse_led(void) {
32#if defined(LED_LWR_PIN) 32#if defined(LED_LWR_PIN)
33 setPinOutput(LED_LWR_PIN); 33 gpio_set_pin_output(LED_LWR_PIN);
34 writePin(LED_LWR_PIN, false); 34 gpio_write_pin(LED_LWR_PIN, false);
35 wait_ms(30); 35 wait_ms(30);
36#endif 36#endif
37 37
38#if defined(LED_RSE_PIN) 38#if defined(LED_RSE_PIN)
39 setPinOutput(LED_RSE_PIN); 39 gpio_set_pin_output(LED_RSE_PIN);
40 writePin(LED_RSE_PIN, false); 40 gpio_write_pin(LED_RSE_PIN, false);
41 wait_ms(30); 41 wait_ms(30);
42#endif 42#endif
43} 43}
@@ -46,9 +46,9 @@ static inline void led_lwr(const bool on) {
46#if defined(LED_LWR_PIN) 46#if defined(LED_LWR_PIN)
47 if ((PRODUCT_ID == 0x6064) || (PRODUCT_ID == 0x6065) || 47 if ((PRODUCT_ID == 0x6064) || (PRODUCT_ID == 0x6065) ||
48 (PRODUCT_ID == 0x6066) || (PRODUCT_ID == 0x6067)) { 48 (PRODUCT_ID == 0x6066) || (PRODUCT_ID == 0x6067)) {
49 writePin(LED_LWR_PIN, !on); 49 gpio_write_pin(LED_LWR_PIN, !on);
50 }else{ 50 }else{
51 writePin(LED_LWR_PIN, on); 51 gpio_write_pin(LED_LWR_PIN, on);
52 } 52 }
53#endif 53#endif
54} 54}
@@ -57,9 +57,9 @@ static inline void led_rse(const bool on) {
57#if defined(LED_RSE_PIN) 57#if defined(LED_RSE_PIN)
58 if ((PRODUCT_ID == 0x6064) || (PRODUCT_ID == 0x6065) || 58 if ((PRODUCT_ID == 0x6064) || (PRODUCT_ID == 0x6065) ||
59 (PRODUCT_ID == 0x6066) || (PRODUCT_ID == 0x6067)) { 59 (PRODUCT_ID == 0x6066) || (PRODUCT_ID == 0x6067)) {
60 writePin(LED_RSE_PIN, !on); 60 gpio_write_pin(LED_RSE_PIN, !on);
61 }else{ 61 }else{
62 writePin(LED_RSE_PIN, on); 62 gpio_write_pin(LED_RSE_PIN, on);
63 } 63 }
64#endif 64#endif
65} 65}
diff --git a/keyboards/mode/m65ha_alpha/m65ha_alpha.c b/keyboards/mode/m65ha_alpha/m65ha_alpha.c
index afb093058f..0d438b02de 100644
--- a/keyboards/mode/m65ha_alpha/m65ha_alpha.c
+++ b/keyboards/mode/m65ha_alpha/m65ha_alpha.c
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "quantum.h" 18#include "quantum.h"
19 19
20void board_init(void) { 20void board_init(void) {
21 setPinInput(B10); 21 gpio_set_pin_input(B10);
22} 22}
23 23
24void led_init_ports(void) { 24void led_init_ports(void) {
@@ -54,12 +54,12 @@ void led_init_ports(void) {
54bool led_update_kb(led_t led_state) { 54bool led_update_kb(led_t led_state) {
55 bool res = led_update_user(led_state); 55 bool res = led_update_user(led_state);
56 if(res) { 56 if(res) {
57 // writePin sets the pin high for 1 and low for 0. 57 // gpio_write_pin sets the pin high for 1 and low for 0.
58 // In this example the pins are inverted, setting 58 // In this example the pins are inverted, setting
59 // it low/0 turns it on, and high/1 turns the LED off. 59 // it low/0 turns it on, and high/1 turns the LED off.
60 // This behavior depends on whether the LED is between the pin 60 // This behavior depends on whether the LED is between the pin
61 // and VCC or the pin and GND. 61 // and VCC or the pin and GND.
62 writePin(LED_CAPS_LOCK_PIN, !led_state.caps_lock); 62 gpio_write_pin(LED_CAPS_LOCK_PIN, !led_state.caps_lock);
63 } 63 }
64 return res; 64 return res;
65} 65}
diff --git a/keyboards/mode/m65hi_alpha/m65hi_alpha.c b/keyboards/mode/m65hi_alpha/m65hi_alpha.c
index afb093058f..0d438b02de 100644
--- a/keyboards/mode/m65hi_alpha/m65hi_alpha.c
+++ b/keyboards/mode/m65hi_alpha/m65hi_alpha.c
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "quantum.h" 18#include "quantum.h"
19 19
20void board_init(void) { 20void board_init(void) {
21 setPinInput(B10); 21 gpio_set_pin_input(B10);
22} 22}
23 23
24void led_init_ports(void) { 24void led_init_ports(void) {
@@ -54,12 +54,12 @@ void led_init_ports(void) {
54bool led_update_kb(led_t led_state) { 54bool led_update_kb(led_t led_state) {
55 bool res = led_update_user(led_state); 55 bool res = led_update_user(led_state);
56 if(res) { 56 if(res) {
57 // writePin sets the pin high for 1 and low for 0. 57 // gpio_write_pin sets the pin high for 1 and low for 0.
58 // In this example the pins are inverted, setting 58 // In this example the pins are inverted, setting
59 // it low/0 turns it on, and high/1 turns the LED off. 59 // it low/0 turns it on, and high/1 turns the LED off.
60 // This behavior depends on whether the LED is between the pin 60 // This behavior depends on whether the LED is between the pin
61 // and VCC or the pin and GND. 61 // and VCC or the pin and GND.
62 writePin(LED_CAPS_LOCK_PIN, !led_state.caps_lock); 62 gpio_write_pin(LED_CAPS_LOCK_PIN, !led_state.caps_lock);
63 } 63 }
64 return res; 64 return res;
65} 65}
diff --git a/keyboards/mode/m65s/m65s.c b/keyboards/mode/m65s/m65s.c
index 954644310b..13f2ea40ff 100644
--- a/keyboards/mode/m65s/m65s.c
+++ b/keyboards/mode/m65s/m65s.c
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "quantum.h" 18#include "quantum.h"
19 19
20void board_init(void) { 20void board_init(void) {
21 setPinInput(B10); 21 gpio_set_pin_input(B10);
22} 22}
23 23
24void led_init_ports(void) { 24void led_init_ports(void) {
@@ -55,12 +55,12 @@ void led_init_ports(void) {
55bool led_update_kb(led_t led_state) { 55bool led_update_kb(led_t led_state) {
56 bool res = led_update_user(led_state); 56 bool res = led_update_user(led_state);
57 if(res) { 57 if(res) {
58 // writePin sets the pin high for 1 and low for 0. 58 // gpio_write_pin sets the pin high for 1 and low for 0.
59 // In this example the pins are inverted, setting 59 // In this example the pins are inverted, setting
60 // it low/0 turns it on, and high/1 turns the LED off. 60 // it low/0 turns it on, and high/1 turns the LED off.
61 // This behavior depends on whether the LED is between the pin 61 // This behavior depends on whether the LED is between the pin
62 // and VCC or the pin and GND. 62 // and VCC or the pin and GND.
63 writePin(LED_CAPS_LOCK_PIN, !led_state.caps_lock); 63 gpio_write_pin(LED_CAPS_LOCK_PIN, !led_state.caps_lock);
64 } 64 }
65 return res; 65 return res;
66} 66}
diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c
index 9a93a7d7d4..04a9f0ca96 100644
--- a/keyboards/monsgeek/m3/m3.c
+++ b/keyboards/monsgeek/m3/m3.c
@@ -136,15 +136,15 @@ enum __layers {
136}; 136};
137 137
138void matrix_init_kb(void) { 138void matrix_init_kb(void) {
139 setPinOutput(LED_MAC_OS_PIN); // LDE2 MAC\WIN 139 gpio_set_pin_output(LED_MAC_OS_PIN); // LDE2 MAC\WIN
140 writePinLow(LED_MAC_OS_PIN); 140 gpio_write_pin_low(LED_MAC_OS_PIN);
141 setPinOutput(LED_WIN_LOCK_PIN); // LED3 Win Lock 141 gpio_set_pin_output(LED_WIN_LOCK_PIN); // LED3 Win Lock
142 writePinLow(LED_WIN_LOCK_PIN); 142 gpio_write_pin_low(LED_WIN_LOCK_PIN);
143} 143}
144 144
145void housekeeping_task_kb(void){ 145void housekeeping_task_kb(void){
146 writePin(LED_MAC_OS_PIN, (get_highest_layer(default_layer_state) == 3)); 146 gpio_write_pin(LED_MAC_OS_PIN, (get_highest_layer(default_layer_state) == 3));
147 writePin(LED_WIN_LOCK_PIN, keymap_config.no_gui); 147 gpio_write_pin(LED_WIN_LOCK_PIN, keymap_config.no_gui);
148} 148}
149 149
150bool process_record_kb(uint16_t keycode, keyrecord_t* record) { 150bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
@@ -166,7 +166,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
166 return false; 166 return false;
167 case GU_TOGG: 167 case GU_TOGG:
168 if (record->event.pressed) { 168 if (record->event.pressed) {
169 writePin(LED_WIN_LOCK_PIN, !keymap_config.no_gui); 169 gpio_write_pin(LED_WIN_LOCK_PIN, !keymap_config.no_gui);
170 } 170 }
171 return true; 171 return true;
172 case RGB_TOG: 172 case RGB_TOG:
diff --git a/keyboards/monsgeek/m5/m5.c b/keyboards/monsgeek/m5/m5.c
index 822214a05c..3e1d752581 100644
--- a/keyboards/monsgeek/m5/m5.c
+++ b/keyboards/monsgeek/m5/m5.c
@@ -149,15 +149,15 @@ const snled27351_led_t PROGMEM g_snled27351_leds[SNLED27351_LED_COUNT] = {
149#endif 149#endif
150 150
151void keyboard_pre_init_kb(void) { 151void keyboard_pre_init_kb(void) {
152 setPinOutput(LED_WIN_LOCK_PIN); // LED3 Win Lock 152 gpio_set_pin_output(LED_WIN_LOCK_PIN); // LED3 Win Lock
153 writePinLow(LED_WIN_LOCK_PIN); 153 gpio_write_pin_low(LED_WIN_LOCK_PIN);
154 keyboard_pre_init_user(); 154 keyboard_pre_init_user();
155} 155}
156 156
157bool led_update_kb(led_t led_state) { 157bool led_update_kb(led_t led_state) {
158 bool res = led_update_user(led_state); 158 bool res = led_update_user(led_state);
159 if (res) { 159 if (res) {
160 writePin(LED_WIN_LOCK_PIN, keymap_config.no_gui); 160 gpio_write_pin(LED_WIN_LOCK_PIN, keymap_config.no_gui);
161 } 161 }
162 return res; 162 return res;
163} 163}
diff --git a/keyboards/monstargear/xo87/solderable/solderable.c b/keyboards/monstargear/xo87/solderable/solderable.c
index cb4da24a3a..56f3c524ea 100644
--- a/keyboards/monstargear/xo87/solderable/solderable.c
+++ b/keyboards/monstargear/xo87/solderable/solderable.c
@@ -23,28 +23,28 @@
23#define ledCapSP (80+8) 23#define ledCapSP (80+8)
24 24
25void backlight_init_ports(void) { 25void backlight_init_ports(void) {
26 setPinOutput(Lseg0); 26 gpio_set_pin_output(Lseg0);
27 setPinOutput(Lseg1); 27 gpio_set_pin_output(Lseg1);
28 setPinOutput(Lseg2); 28 gpio_set_pin_output(Lseg2);
29 setPinOutput(Lseg3); 29 gpio_set_pin_output(Lseg3);
30 setPinOutput(Lseg4); 30 gpio_set_pin_output(Lseg4);
31 setPinOutput(Lseg5); 31 gpio_set_pin_output(Lseg5);
32 setPinOutput(Lcom0); 32 gpio_set_pin_output(Lcom0);
33 setPinOutput(Lcom1); 33 gpio_set_pin_output(Lcom1);
34 setPinOutput(Lcom2); 34 gpio_set_pin_output(Lcom2);
35 setPinOutput(Lcom3); 35 gpio_set_pin_output(Lcom3);
36 setPinOutput(Lcom4); 36 gpio_set_pin_output(Lcom4);
37 setPinOutput(Lcom5); 37 gpio_set_pin_output(Lcom5);
38 setPinOutput(Lcom6); 38 gpio_set_pin_output(Lcom6);
39 setPinOutput(Lcom7); 39 gpio_set_pin_output(Lcom7);
40 setPinOutput(Lcom8); 40 gpio_set_pin_output(Lcom8);
41 setPinOutput(Lcom9); 41 gpio_set_pin_output(Lcom9);
42 setPinOutput(Lcom10); 42 gpio_set_pin_output(Lcom10);
43 setPinOutput(Lcom11); 43 gpio_set_pin_output(Lcom11);
44 setPinOutput(Lcom12); 44 gpio_set_pin_output(Lcom12);
45 setPinOutput(Lcom13); 45 gpio_set_pin_output(Lcom13);
46 setPinOutput(Lcom14); 46 gpio_set_pin_output(Lcom14);
47 setPinOutput(Lcom15); 47 gpio_set_pin_output(Lcom15);
48} 48}
49 49
50void backlight_set(uint8_t level) { 50void backlight_set(uint8_t level) {
@@ -54,22 +54,22 @@ void backlight_task(void) {
54 // This is a temporary workaround to get the status LEDs working until we can figure out the LED matrix 54 // This is a temporary workaround to get the status LEDs working until we can figure out the LED matrix
55 led_t host_leds = host_keyboard_led_state(); 55 led_t host_leds = host_keyboard_led_state();
56 if (host_leds.scroll_lock) { 56 if (host_leds.scroll_lock) {
57 writePinHigh(Lcom3); 57 gpio_write_pin_high(Lcom3);
58 writePinHigh(Lseg5); 58 gpio_write_pin_high(Lseg5);
59 } else { 59 } else {
60 writePinLow(Lcom3); 60 gpio_write_pin_low(Lcom3);
61 } 61 }
62 if (host_leds.num_lock) { 62 if (host_leds.num_lock) {
63 writePinHigh(Lcom7); 63 gpio_write_pin_high(Lcom7);
64 writePinHigh(Lseg5); 64 gpio_write_pin_high(Lseg5);
65 } else { 65 } else {
66 writePinLow(Lcom7); 66 gpio_write_pin_low(Lcom7);
67 } 67 }
68 if (host_leds.caps_lock) { 68 if (host_leds.caps_lock) {
69 writePinHigh(Lcom8); 69 gpio_write_pin_high(Lcom8);
70 writePinHigh(Lseg5); 70 gpio_write_pin_high(Lseg5);
71 } else { 71 } else {
72 writePinLow(Lcom8); 72 gpio_write_pin_low(Lcom8);
73 } 73 }
74} 74}
75 75
diff --git a/keyboards/neson_design/700e/700e.c b/keyboards/neson_design/700e/700e.c
index a9bcbee288..cdcd90d3e0 100644
--- a/keyboards/neson_design/700e/700e.c
+++ b/keyboards/neson_design/700e/700e.c
@@ -292,8 +292,8 @@ const is31fl3731_led_t PROGMEM g_is31fl3731_leds[IS31FL3731_LED_COUNT] = {
292 292
293void matrix_init_kb(void) 293void matrix_init_kb(void)
294{ 294{
295 setPinOutput(LED_CAPS_LOCK_PIN); 295 gpio_set_pin_output(LED_CAPS_LOCK_PIN);
296 writePinLow(LED_CAPS_LOCK_PIN); 296 gpio_write_pin_low(LED_CAPS_LOCK_PIN);
297 297
298 is31fl3731_init_drivers(); 298 is31fl3731_init_drivers();
299 299
@@ -363,7 +363,7 @@ bool led_update_kb(led_t led_state)
363{ 363{
364 bool res = led_update_user(led_state); 364 bool res = led_update_user(led_state);
365 if (res) { 365 if (res) {
366 writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); 366 gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
367 367
368 if (rgb_state.state != SELF_TESTING) { 368 if (rgb_state.state != SELF_TESTING) {
369 if (led_state.caps_lock) { 369 if (led_state.caps_lock) {
diff --git a/keyboards/neson_design/n6/n6.c b/keyboards/neson_design/n6/n6.c
index f257735acc..fc34400b1c 100644
--- a/keyboards/neson_design/n6/n6.c
+++ b/keyboards/neson_design/n6/n6.c
@@ -296,8 +296,8 @@ const is31fl3731_led_t PROGMEM g_is31fl3731_leds[IS31FL3731_LED_COUNT] = {
296 296
297void matrix_init_kb(void) 297void matrix_init_kb(void)
298{ 298{
299 setPinOutput(LED_CAPS_LOCK_PIN); 299 gpio_set_pin_output(LED_CAPS_LOCK_PIN);
300 writePinLow(LED_CAPS_LOCK_PIN); 300 gpio_write_pin_low(LED_CAPS_LOCK_PIN);
301 301
302 is31fl3731_init_drivers(); 302 is31fl3731_init_drivers();
303 303
@@ -358,7 +358,7 @@ bool led_update_kb(led_t led_state)
358{ 358{
359 bool res = led_update_user(led_state); 359 bool res = led_update_user(led_state);
360 if (res) { 360 if (res) {
361 writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); 361 gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
362 362
363 if (rgb_state.state != SELF_TESTING) { 363 if (rgb_state.state != SELF_TESTING) {
364 if (led_state.caps_lock) { 364 if (led_state.caps_lock) {
diff --git a/keyboards/nopunin10did/kastenwagen1840/kastenwagen1840.c b/keyboards/nopunin10did/kastenwagen1840/kastenwagen1840.c
index 01eb8f3903..995434bb2c 100644
--- a/keyboards/nopunin10did/kastenwagen1840/kastenwagen1840.c
+++ b/keyboards/nopunin10did/kastenwagen1840/kastenwagen1840.c
@@ -19,29 +19,29 @@
19#ifndef LAYER_LED_DISABLE 19#ifndef LAYER_LED_DISABLE
20 20
21void keyboard_pre_init_kb(void) { 21void keyboard_pre_init_kb(void) {
22 setPinOutput(LED_INDICATOR_TOP); 22 gpio_set_pin_output(LED_INDICATOR_TOP);
23 setPinOutput(LED_INDICATOR_MID); 23 gpio_set_pin_output(LED_INDICATOR_MID);
24 setPinOutput(LED_INDICATOR_BOT); 24 gpio_set_pin_output(LED_INDICATOR_BOT);
25 keyboard_pre_init_user(); 25 keyboard_pre_init_user();
26} 26}
27 27
28__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { 28__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
29 writePinHigh(LED_INDICATOR_TOP); 29 gpio_write_pin_high(LED_INDICATOR_TOP);
30 writePinHigh(LED_INDICATOR_MID); 30 gpio_write_pin_high(LED_INDICATOR_MID);
31 writePinHigh(LED_INDICATOR_BOT); 31 gpio_write_pin_high(LED_INDICATOR_BOT);
32 32
33 switch(get_highest_layer(state) % 4) { 33 switch(get_highest_layer(state) % 4) {
34 case 1: 34 case 1:
35 writePinLow(LED_INDICATOR_TOP); 35 gpio_write_pin_low(LED_INDICATOR_TOP);
36 writePinLow(LED_INDICATOR_MID); 36 gpio_write_pin_low(LED_INDICATOR_MID);
37 break; 37 break;
38 case 2: 38 case 2:
39 writePinLow(LED_INDICATOR_TOP); 39 gpio_write_pin_low(LED_INDICATOR_TOP);
40 writePinLow(LED_INDICATOR_BOT); 40 gpio_write_pin_low(LED_INDICATOR_BOT);
41 break; 41 break;
42 case 3: 42 case 3:
43 writePinLow(LED_INDICATOR_MID); 43 gpio_write_pin_low(LED_INDICATOR_MID);
44 writePinLow(LED_INDICATOR_BOT); 44 gpio_write_pin_low(LED_INDICATOR_BOT);
45 break; 45 break;
46 } 46 }
47 return state; 47 return state;
diff --git a/keyboards/nopunin10did/kastenwagen48/kastenwagen48.c b/keyboards/nopunin10did/kastenwagen48/kastenwagen48.c
index 01eb8f3903..995434bb2c 100644
--- a/keyboards/nopunin10did/kastenwagen48/kastenwagen48.c
+++ b/keyboards/nopunin10did/kastenwagen48/kastenwagen48.c
@@ -19,29 +19,29 @@
19#ifndef LAYER_LED_DISABLE 19#ifndef LAYER_LED_DISABLE
20 20
21void keyboard_pre_init_kb(void) { 21void keyboard_pre_init_kb(void) {
22 setPinOutput(LED_INDICATOR_TOP); 22 gpio_set_pin_output(LED_INDICATOR_TOP);
23 setPinOutput(LED_INDICATOR_MID); 23 gpio_set_pin_output(LED_INDICATOR_MID);
24 setPinOutput(LED_INDICATOR_BOT); 24 gpio_set_pin_output(LED_INDICATOR_BOT);
25 keyboard_pre_init_user(); 25 keyboard_pre_init_user();
26} 26}
27 27
28__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { 28__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
29 writePinHigh(LED_INDICATOR_TOP); 29 gpio_write_pin_high(LED_INDICATOR_TOP);
30 writePinHigh(LED_INDICATOR_MID); 30 gpio_write_pin_high(LED_INDICATOR_MID);
31 writePinHigh(LED_INDICATOR_BOT); 31 gpio_write_pin_high(LED_INDICATOR_BOT);
32 32
33 switch(get_highest_layer(state) % 4) { 33 switch(get_highest_layer(state) % 4) {
34 case 1: 34 case 1:
35 writePinLow(LED_INDICATOR_TOP); 35 gpio_write_pin_low(LED_INDICATOR_TOP);
36 writePinLow(LED_INDICATOR_MID); 36 gpio_write_pin_low(LED_INDICATOR_MID);
37 break; 37 break;
38 case 2: 38 case 2:
39 writePinLow(LED_INDICATOR_TOP); 39 gpio_write_pin_low(LED_INDICATOR_TOP);
40 writePinLow(LED_INDICATOR_BOT); 40 gpio_write_pin_low(LED_INDICATOR_BOT);
41 break; 41 break;
42 case 3: 42 case 3:
43 writePinLow(LED_INDICATOR_MID); 43 gpio_write_pin_low(LED_INDICATOR_MID);
44 writePinLow(LED_INDICATOR_BOT); 44 gpio_write_pin_low(LED_INDICATOR_BOT);
45 break; 45 break;
46 } 46 }
47 return state; 47 return state;
diff --git a/keyboards/novelkeys/nk65b/nk65b.c b/keyboards/novelkeys/nk65b/nk65b.c
index 370814aabd..369bab262f 100755
--- a/keyboards/novelkeys/nk65b/nk65b.c
+++ b/keyboards/novelkeys/nk65b/nk65b.c
@@ -24,8 +24,8 @@ void led_init_ports(void) {
24} 24}
25 25
26layer_state_t layer_state_set_kb(layer_state_t state) { 26layer_state_t layer_state_set_kb(layer_state_t state) {
27 writePin(A15, !layer_state_cmp(state, 1)); 27 gpio_write_pin(A15, !layer_state_cmp(state, 1));
28 writePin(B3, !layer_state_cmp(state, 2)); 28 gpio_write_pin(B3, !layer_state_cmp(state, 2));
29 return layer_state_set_user(state); 29 return layer_state_set_user(state);
30} 30}
31 31
diff --git a/keyboards/novelkeys/nk87b/nk87b.c b/keyboards/novelkeys/nk87b/nk87b.c
index a0686d5b09..125b5d7404 100644
--- a/keyboards/novelkeys/nk87b/nk87b.c
+++ b/keyboards/novelkeys/nk87b/nk87b.c
@@ -25,8 +25,8 @@ void led_init_ports(void) {
25} 25}
26 26
27layer_state_t layer_state_set_kb(layer_state_t state) { 27layer_state_t layer_state_set_kb(layer_state_t state) {
28 writePin(A3, !layer_state_cmp(state, 1)); 28 gpio_write_pin(A3, !layer_state_cmp(state, 1));
29 writePin(A4, !layer_state_cmp(state, 2)); 29 gpio_write_pin(A4, !layer_state_cmp(state, 2));
30 return layer_state_set_user(state); 30 return layer_state_set_user(state);
31} 31}
32 32
diff --git a/keyboards/noxary/220/220.c b/keyboards/noxary/220/220.c
index caeb13a799..c5affa4344 100644
--- a/keyboards/noxary/220/220.c
+++ b/keyboards/noxary/220/220.c
@@ -22,13 +22,13 @@
22void matrix_init_kb(void) { 22void matrix_init_kb(void) {
23 // put your keyboard start-up code here 23 // put your keyboard start-up code here
24 // runs once when the firmware starts up 24 // runs once when the firmware starts up
25 setPinOutput(C6); 25 gpio_set_pin_output(C6);
26 matrix_init_user(); 26 matrix_init_user();
27} 27}
28 28
29bool led_update_kb(led_t led_state) { 29bool led_update_kb(led_t led_state) {
30 if(led_update_user(led_state)) { 30 if(led_update_user(led_state)) {
31 writePin(C6, led_state.num_lock); 31 gpio_write_pin(C6, led_state.num_lock);
32 } 32 }
33 return true; 33 return true;
34} \ No newline at end of file 34} \ No newline at end of file
diff --git a/keyboards/noxary/268_2/268_2.c b/keyboards/noxary/268_2/268_2.c
index 60d54a681c..56b42d2343 100644
--- a/keyboards/noxary/268_2/268_2.c
+++ b/keyboards/noxary/268_2/268_2.c
@@ -18,13 +18,13 @@
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 // put your keyboard start-up code here 19 // put your keyboard start-up code here
20 // runs once when the firmware starts up 20 // runs once when the firmware starts up
21 setPinOutput(B0); 21 gpio_set_pin_output(B0);
22 matrix_init_user(); 22 matrix_init_user();
23} 23}
24 24
25bool led_update_kb(led_t led_state) { 25bool led_update_kb(led_t led_state) {
26 if(led_update_user(led_state)) { 26 if(led_update_user(led_state)) {
27 writePin(B0, led_state.caps_lock); 27 gpio_write_pin(B0, led_state.caps_lock);
28 } 28 }
29 return true; 29 return true;
30} 30}
diff --git a/keyboards/noxary/280/280.c b/keyboards/noxary/280/280.c
index 8bece8dee1..0f29df178f 100644
--- a/keyboards/noxary/280/280.c
+++ b/keyboards/noxary/280/280.c
@@ -23,15 +23,15 @@
23void matrix_init_kb(void) { 23void matrix_init_kb(void) {
24 // put your keyboard start-up code here 24 // put your keyboard start-up code here
25 // runs once when the firmware starts up 25 // runs once when the firmware starts up
26 setPinOutput(D5); 26 gpio_set_pin_output(D5);
27 setPinOutput(D0); 27 gpio_set_pin_output(D0);
28 matrix_init_user(); 28 matrix_init_user();
29} 29}
30 30
31bool led_update_kb(led_t led_state) { 31bool led_update_kb(led_t led_state) {
32 if(led_update_user(led_state)) { 32 if(led_update_user(led_state)) {
33 writePin(D5, led_state.caps_lock); 33 gpio_write_pin(D5, led_state.caps_lock);
34 writePin(D0, led_state.scroll_lock); 34 gpio_write_pin(D0, led_state.scroll_lock);
35 } 35 }
36 return true; 36 return true;
37} \ No newline at end of file 37} \ No newline at end of file
diff --git a/keyboards/noxary/x268/x268.c b/keyboards/noxary/x268/x268.c
index 54c37b2079..67d6dff89d 100644
--- a/keyboards/noxary/x268/x268.c
+++ b/keyboards/noxary/x268/x268.c
@@ -22,13 +22,13 @@
22void matrix_init_kb(void) { 22void matrix_init_kb(void) {
23 // put your keyboard start-up code here 23 // put your keyboard start-up code here
24 // runs once when the firmware starts up 24 // runs once when the firmware starts up
25 setPinOutput(B0); 25 gpio_set_pin_output(B0);
26 matrix_init_user(); 26 matrix_init_user();
27} 27}
28 28
29bool led_update_kb(led_t led_state) { 29bool led_update_kb(led_t led_state) {
30 if(led_update_user(led_state)) { 30 if(led_update_user(led_state)) {
31 writePin(B0, led_state.caps_lock); 31 gpio_write_pin(B0, led_state.caps_lock);
32 } 32 }
33 return true; 33 return true;
34} 34}
diff --git a/keyboards/nullbitsco/common/bitc_led.c b/keyboards/nullbitsco/common/bitc_led.c
index 64d7c7160a..8f91e665f8 100644
--- a/keyboards/nullbitsco/common/bitc_led.c
+++ b/keyboards/nullbitsco/common/bitc_led.c
@@ -18,17 +18,17 @@
18void set_bitc_LED(uint8_t mode) { 18void set_bitc_LED(uint8_t mode) {
19 switch(mode) { 19 switch(mode) {
20 case LED_ON: 20 case LED_ON:
21 setPinOutput(PIN_LED); 21 gpio_set_pin_output(PIN_LED);
22 writePin(PIN_LED, GPIO_STATE_HIGH); 22 gpio_write_pin(PIN_LED, GPIO_STATE_HIGH);
23 break; 23 break;
24 24
25 case LED_DIM: 25 case LED_DIM:
26 setPinInput(PIN_LED); 26 gpio_set_pin_input(PIN_LED);
27 break; 27 break;
28 28
29 case LED_OFF: 29 case LED_OFF:
30 setPinOutput(PIN_LED); 30 gpio_set_pin_output(PIN_LED);
31 writePin(PIN_LED, GPIO_STATE_LOW); 31 gpio_write_pin(PIN_LED, GPIO_STATE_LOW);
32 break; 32 break;
33 33
34 default: 34 default:
diff --git a/keyboards/nullbitsco/nibble/big_led.c b/keyboards/nullbitsco/nibble/big_led.c
index d66a808153..0e61b440b6 100644
--- a/keyboards/nullbitsco/nibble/big_led.c
+++ b/keyboards/nullbitsco/nibble/big_led.c
@@ -24,13 +24,13 @@ void set_big_LED_rgb(uint8_t r_mode, uint8_t g_mode, uint8_t b_mode) {
24void set_big_LED_r(uint8_t mode) { 24void set_big_LED_r(uint8_t mode) {
25 switch(mode) { 25 switch(mode) {
26 case LED_ON: 26 case LED_ON:
27 setPinOutput(BIG_LED_R_PIN); 27 gpio_set_pin_output(BIG_LED_R_PIN);
28 writePin(BIG_LED_R_PIN, GPIO_STATE_HIGH); 28 gpio_write_pin(BIG_LED_R_PIN, GPIO_STATE_HIGH);
29 break; 29 break;
30 30
31 case LED_OFF: 31 case LED_OFF:
32 setPinOutput(BIG_LED_R_PIN); 32 gpio_set_pin_output(BIG_LED_R_PIN);
33 writePin(BIG_LED_R_PIN, GPIO_STATE_LOW); 33 gpio_write_pin(BIG_LED_R_PIN, GPIO_STATE_LOW);
34 break; 34 break;
35 35
36 default: 36 default:
@@ -41,13 +41,13 @@ void set_big_LED_r(uint8_t mode) {
41void set_big_LED_g(uint8_t mode) { 41void set_big_LED_g(uint8_t mode) {
42 switch(mode) { 42 switch(mode) {
43 case LED_ON: 43 case LED_ON:
44 setPinOutput(BIG_LED_G_PIN); 44 gpio_set_pin_output(BIG_LED_G_PIN);
45 writePin(BIG_LED_G_PIN, GPIO_STATE_HIGH); 45 gpio_write_pin(BIG_LED_G_PIN, GPIO_STATE_HIGH);
46 break; 46 break;
47 47
48 case LED_OFF: 48 case LED_OFF:
49 setPinOutput(BIG_LED_G_PIN); 49 gpio_set_pin_output(BIG_LED_G_PIN);
50 writePin(BIG_LED_G_PIN, GPIO_STATE_LOW); 50 gpio_write_pin(BIG_LED_G_PIN, GPIO_STATE_LOW);
51 break; 51 break;
52 52
53 default: 53 default:
@@ -58,13 +58,13 @@ void set_big_LED_g(uint8_t mode) {
58void set_big_LED_b(uint8_t mode) { 58void set_big_LED_b(uint8_t mode) {
59 switch(mode) { 59 switch(mode) {
60 case LED_ON: 60 case LED_ON:
61 setPinOutput(BIG_LED_B_PIN); 61 gpio_set_pin_output(BIG_LED_B_PIN);
62 writePin(BIG_LED_B_PIN, GPIO_STATE_HIGH); 62 gpio_write_pin(BIG_LED_B_PIN, GPIO_STATE_HIGH);
63 break; 63 break;
64 64
65 case LED_OFF: 65 case LED_OFF:
66 setPinOutput(BIG_LED_B_PIN); 66 gpio_set_pin_output(BIG_LED_B_PIN);
67 writePin(BIG_LED_B_PIN, GPIO_STATE_LOW); 67 gpio_write_pin(BIG_LED_B_PIN, GPIO_STATE_LOW);
68 break; 68 break;
69 69
70 default: 70 default:
diff --git a/keyboards/nullbitsco/nibble/matrix.c b/keyboards/nullbitsco/nibble/matrix.c
index 6508b704e9..7ea5a6c470 100644
--- a/keyboards/nullbitsco/nibble/matrix.c
+++ b/keyboards/nullbitsco/nibble/matrix.c
@@ -27,17 +27,17 @@ static const uint8_t col_pins[MATRIX_MUX_COLS] = MATRIX_COL_MUX_PINS;
27static void init_pins(void) { 27static void init_pins(void) {
28 // Set cols to outputs, low 28 // Set cols to outputs, low
29 for (uint8_t pin = 0; pin < MATRIX_MUX_COLS; pin++) { 29 for (uint8_t pin = 0; pin < MATRIX_MUX_COLS; pin++) {
30 setPinOutput(col_pins[pin]); 30 gpio_set_pin_output(col_pins[pin]);
31 } 31 }
32 32
33 // Unselect cols 33 // Unselect cols
34 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) { 34 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) {
35 writePinLow(col_pins[bit]); 35 gpio_write_pin_low(col_pins[bit]);
36 } 36 }
37 37
38 // Set rows to input, pullup 38 // Set rows to input, pullup
39 for (uint8_t pin = 0; pin < MATRIX_ROWS; pin++) { 39 for (uint8_t pin = 0; pin < MATRIX_ROWS; pin++) {
40 setPinInputHigh(row_pins[pin]); 40 gpio_set_pin_input_high(row_pins[pin]);
41 } 41 }
42} 42}
43 43
@@ -45,7 +45,7 @@ static void select_col(uint8_t col)
45{ 45{
46 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) { 46 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) {
47 uint8_t state = (col & (0b1 << bit)) >> bit; 47 uint8_t state = (col & (0b1 << bit)) >> bit;
48 writePin(col_pins[bit], state); 48 gpio_write_pin(col_pins[bit], state);
49 } 49 }
50} 50}
51 51
@@ -60,7 +60,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
60 { 60 {
61 matrix_row_t last_row_value = current_matrix[row_index]; 61 matrix_row_t last_row_value = current_matrix[row_index];
62 62
63 if (!readPin(row_pins[row_index])) 63 if (!gpio_read_pin(row_pins[row_index]))
64 { 64 {
65 current_matrix[row_index] |= (COL_SHIFTER << current_col); 65 current_matrix[row_index] |= (COL_SHIFTER << current_col);
66 } 66 }
diff --git a/keyboards/nullbitsco/scramble/v1/v1.c b/keyboards/nullbitsco/scramble/v1/v1.c
index 4b5e8e3e67..3a85dce192 100644
--- a/keyboards/nullbitsco/scramble/v1/v1.c
+++ b/keyboards/nullbitsco/scramble/v1/v1.c
@@ -6,17 +6,17 @@
6void set_scramble_LED(uint8_t mode) { 6void set_scramble_LED(uint8_t mode) {
7 switch(mode) { 7 switch(mode) {
8 case LED_ON: 8 case LED_ON:
9 setPinOutput(PIN_LED); 9 gpio_set_pin_output(PIN_LED);
10 writePin(PIN_LED, GPIO_STATE_HIGH); 10 gpio_write_pin(PIN_LED, GPIO_STATE_HIGH);
11 break; 11 break;
12 12
13 case LED_DIM: 13 case LED_DIM:
14 setPinInput(PIN_LED); 14 gpio_set_pin_input(PIN_LED);
15 break; 15 break;
16 16
17 case LED_OFF: 17 case LED_OFF:
18 setPinOutput(PIN_LED); 18 gpio_set_pin_output(PIN_LED);
19 writePin(PIN_LED, GPIO_STATE_LOW); 19 gpio_write_pin(PIN_LED, GPIO_STATE_LOW);
20 break; 20 break;
21 21
22 default: 22 default:
diff --git a/keyboards/nullbitsco/snap/matrix.c b/keyboards/nullbitsco/snap/matrix.c
index 3cd3f5c37e..64b451641d 100644
--- a/keyboards/nullbitsco/snap/matrix.c
+++ b/keyboards/nullbitsco/snap/matrix.c
@@ -37,23 +37,23 @@ static uint8_t* col_pins = col_pins_left;
37static void init_pins(void) { 37static void init_pins(void) {
38 // Set cols to outputs, low 38 // Set cols to outputs, low
39 for (uint8_t pin = 0; pin < MATRIX_MUX_COLS; pin++) { 39 for (uint8_t pin = 0; pin < MATRIX_MUX_COLS; pin++) {
40 setPinOutput(col_pins[pin]); 40 gpio_set_pin_output(col_pins[pin]);
41 } 41 }
42 42
43 // Unselect cols 43 // Unselect cols
44 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) { 44 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) {
45 writePinLow(col_pins[bit]); 45 gpio_write_pin_low(col_pins[bit]);
46 } 46 }
47 47
48 // Set rows to input, pullup 48 // Set rows to input, pullup
49 for (uint8_t pin = 0; pin < ROWS_PER_HAND; pin++) { 49 for (uint8_t pin = 0; pin < ROWS_PER_HAND; pin++) {
50 setPinInputHigh(row_pins[pin]); 50 gpio_set_pin_input_high(row_pins[pin]);
51 } 51 }
52 52
53 // Set extended pin (only on right side) 53 // Set extended pin (only on right side)
54 if (!isLeftHand) { 54 if (!isLeftHand) {
55 // Set extended pin to input, pullup 55 // Set extended pin to input, pullup
56 setPinInputHigh(MATRIX_EXT_PIN_RIGHT); 56 gpio_set_pin_input_high(MATRIX_EXT_PIN_RIGHT);
57 } 57 }
58} 58}
59 59
@@ -61,7 +61,7 @@ static void select_col(uint8_t col) {
61 // Drive demux with correct column address 61 // Drive demux with correct column address
62 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) { 62 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) {
63 uint8_t state = (col & (0b1 << bit)) >> bit; 63 uint8_t state = (col & (0b1 << bit)) >> bit;
64 writePin(col_pins[bit], !state); 64 gpio_write_pin(col_pins[bit], !state);
65 } 65 }
66} 66}
67 67
@@ -71,7 +71,7 @@ static void read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
71 71
72 // Read each row sequentially 72 // Read each row sequentially
73 for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) { 73 for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) {
74 if (readPin(row_pins[row_index]) == 0) { 74 if (gpio_read_pin(row_pins[row_index]) == 0) {
75 current_matrix[row_index] |= (COL_SHIFTER << current_col); 75 current_matrix[row_index] |= (COL_SHIFTER << current_col);
76 } else { 76 } else {
77 current_matrix[row_index] &= ~(COL_SHIFTER << current_col); 77 current_matrix[row_index] &= ~(COL_SHIFTER << current_col);
@@ -82,7 +82,7 @@ static void read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
82static void read_ext_pin(matrix_row_t current_matrix[]) { 82static void read_ext_pin(matrix_row_t current_matrix[]) {
83 // Read the state of the extended matrix pin 83 // Read the state of the extended matrix pin
84 if (!isLeftHand) { 84 if (!isLeftHand) {
85 if (readPin(MATRIX_EXT_PIN_RIGHT) == 0) { 85 if (gpio_read_pin(MATRIX_EXT_PIN_RIGHT) == 0) {
86 current_matrix[EXT_PIN_ROW] |= (COL_SHIFTER << EXT_PIN_COL); 86 current_matrix[EXT_PIN_ROW] |= (COL_SHIFTER << EXT_PIN_COL);
87 } else { 87 } else {
88 current_matrix[EXT_PIN_ROW] &= ~(COL_SHIFTER << EXT_PIN_COL); 88 current_matrix[EXT_PIN_ROW] &= ~(COL_SHIFTER << EXT_PIN_COL);
diff --git a/keyboards/om60/matrix.c b/keyboards/om60/matrix.c
index b0e252ec45..837abcdca1 100644
--- a/keyboards/om60/matrix.c
+++ b/keyboards/om60/matrix.c
@@ -31,37 +31,37 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
31 31
32static void select_row(uint8_t row) 32static void select_row(uint8_t row)
33{ 33{
34 setPinOutput(row_pins[row]); 34 gpio_set_pin_output(row_pins[row]);
35 writePinLow(row_pins[row]); 35 gpio_write_pin_low(row_pins[row]);
36} 36}
37 37
38static void unselect_row(uint8_t row) 38static void unselect_row(uint8_t row)
39{ 39{
40 setPinInputHigh(row_pins[row]); 40 gpio_set_pin_input_high(row_pins[row]);
41} 41}
42 42
43static void unselect_rows(void) 43static void unselect_rows(void)
44{ 44{
45 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 45 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
46 setPinInputHigh(row_pins[x]); 46 gpio_set_pin_input_high(row_pins[x]);
47 } 47 }
48} 48}
49 49
50static void select_col(uint8_t col) 50static void select_col(uint8_t col)
51{ 51{
52 setPinOutput(col_pins[col]); 52 gpio_set_pin_output(col_pins[col]);
53 writePinLow(col_pins[col]); 53 gpio_write_pin_low(col_pins[col]);
54} 54}
55 55
56static void unselect_col(uint8_t col) 56static void unselect_col(uint8_t col)
57{ 57{
58 setPinInputHigh(col_pins[col]); 58 gpio_set_pin_input_high(col_pins[col]);
59} 59}
60 60
61static void unselect_cols(void) 61static void unselect_cols(void)
62{ 62{
63 for(uint8_t x = 0; x < MATRIX_COLS; x++) { 63 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
64 setPinInputHigh(col_pins[x]); 64 gpio_set_pin_input_high(col_pins[x]);
65 } 65 }
66} 66}
67 67
@@ -69,10 +69,10 @@ static void init_pins(void) {
69 unselect_rows(); 69 unselect_rows();
70 unselect_cols(); 70 unselect_cols();
71 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 71 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
72 setPinInputHigh(col_pins[x]); 72 gpio_set_pin_input_high(col_pins[x]);
73 } 73 }
74 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 74 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
75 setPinInputHigh(row_pins[x]); 75 gpio_set_pin_input_high(row_pins[x]);
76 } 76 }
77} 77}
78 78
@@ -92,7 +92,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
92 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 92 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
93 93
94 // Select the col pin to read (active low) 94 // Select the col pin to read (active low)
95 uint8_t pin_state = readPin(col_pins[col_index]); 95 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
96 96
97 // Populate the matrix row with the state of the col pin 97 // Populate the matrix row with the state of the col pin
98 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); 98 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
@@ -120,7 +120,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
120 matrix_row_t last_row_value = current_matrix[tmp]; 120 matrix_row_t last_row_value = current_matrix[tmp];
121 121
122 // Check row pin state 122 // Check row pin state
123 if (readPin(row_pins[row_index]) == 0) 123 if (gpio_read_pin(row_pins[row_index]) == 0)
124 { 124 {
125 // Pin LO, set col bit 125 // Pin LO, set col bit
126 current_matrix[tmp] |= (ROW_SHIFTER << current_col); 126 current_matrix[tmp] |= (ROW_SHIFTER << current_col);
diff --git a/keyboards/opendeck/32/rev1/rev1.c b/keyboards/opendeck/32/rev1/rev1.c
index 8b3f9c0222..ca05d12243 100644
--- a/keyboards/opendeck/32/rev1/rev1.c
+++ b/keyboards/opendeck/32/rev1/rev1.c
@@ -90,12 +90,12 @@ led_config_t g_led_config = {
90 90
91void keyboard_pre_init_kb(void) { 91void keyboard_pre_init_kb(void) {
92 // Light power LED 92 // Light power LED
93 setPinOutput(POWER_LED_PIN); 93 gpio_set_pin_output(POWER_LED_PIN);
94 writePinLow(POWER_LED_PIN); 94 gpio_write_pin_low(POWER_LED_PIN);
95 95
96 // We don't use this feature of the IS31FL3731 but it is electrically connected 96 // We don't use this feature of the IS31FL3731 but it is electrically connected
97 // Make sure not to drive it 97 // Make sure not to drive it
98 setPinInput(IS31FL3731_IRQ_PIN); 98 gpio_set_pin_input(IS31FL3731_IRQ_PIN);
99 99
100 keyboard_pre_init_user(); 100 keyboard_pre_init_user();
101} 101}
diff --git a/keyboards/ortho5by12/ortho5by12.c b/keyboards/ortho5by12/ortho5by12.c
index 29173749ae..d0d9ce9102 100644
--- a/keyboards/ortho5by12/ortho5by12.c
+++ b/keyboards/ortho5by12/ortho5by12.c
@@ -16,15 +16,15 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 setPinOutput(C4); 19 gpio_set_pin_output(C4);
20 setPinOutput(C5); 20 gpio_set_pin_output(C5);
21} 21}
22 22
23bool led_update_kb(led_t led_state) { 23bool led_update_kb(led_t led_state) {
24 bool res = led_update_user(led_state); 24 bool res = led_update_user(led_state);
25 if(res) { 25 if(res) {
26 writePin(C4, led_state.num_lock); 26 gpio_write_pin(C4, led_state.num_lock);
27 writePin(C5, led_state.caps_lock); 27 gpio_write_pin(C5, led_state.caps_lock);
28 } 28 }
29 return res; 29 return res;
30} 30}
diff --git a/keyboards/peej/lumberjack/lumberjack.c b/keyboards/peej/lumberjack/lumberjack.c
index 111092d579..fce14ac7de 100644
--- a/keyboards/peej/lumberjack/lumberjack.c
+++ b/keyboards/peej/lumberjack/lumberjack.c
@@ -17,8 +17,8 @@
17#include "lumberjack.h" 17#include "lumberjack.h"
18 18
19void keyboard_pre_init_kb() { 19void keyboard_pre_init_kb() {
20 setPinOutput(LED1); 20 gpio_set_pin_output(LED1);
21 setPinOutput(LED2); 21 gpio_set_pin_output(LED2);
22 22
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
diff --git a/keyboards/peej/rosaline/rosaline.c b/keyboards/peej/rosaline/rosaline.c
index df0594da44..0ebcb76660 100644
--- a/keyboards/peej/rosaline/rosaline.c
+++ b/keyboards/peej/rosaline/rosaline.c
@@ -17,13 +17,13 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19bool process_record_kb(uint16_t keycode, keyrecord_t *record) { 19bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
20 writePin(LED1, record->event.pressed); 20 gpio_write_pin(LED1, record->event.pressed);
21 21
22 return process_record_user(keycode, record); 22 return process_record_user(keycode, record);
23} 23}
24 24
25layer_state_t layer_state_set_kb(layer_state_t state) { 25layer_state_t layer_state_set_kb(layer_state_t state) {
26 writePin(LED2, state); 26 gpio_write_pin(LED2, state);
27 27
28 return layer_state_set_user(state); 28 return layer_state_set_user(state);
29} 29}
diff --git a/keyboards/percent/canoe_gen2/canoe_gen2.c b/keyboards/percent/canoe_gen2/canoe_gen2.c
index d174d01876..ea091c3474 100644
--- a/keyboards/percent/canoe_gen2/canoe_gen2.c
+++ b/keyboards/percent/canoe_gen2/canoe_gen2.c
@@ -18,15 +18,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "quantum.h" 18#include "quantum.h"
19 19
20void keyboard_pre_init_kb(void) { 20void keyboard_pre_init_kb(void) {
21 setPinOutput(E6); 21 gpio_set_pin_output(E6);
22 writePinHigh(E6); 22 gpio_write_pin_high(E6);
23 23
24 keyboard_pre_init_user(); 24 keyboard_pre_init_user();
25} 25}
26 26
27bool led_update_kb(led_t led_state) { 27bool led_update_kb(led_t led_state) {
28 if(led_update_user(led_state)) { 28 if(led_update_user(led_state)) {
29 writePin(E6, !led_state.caps_lock); 29 gpio_write_pin(E6, !led_state.caps_lock);
30 } 30 }
31 31
32 return true; 32 return true;
diff --git a/keyboards/pica40/rev2/rev2.c b/keyboards/pica40/rev2/rev2.c
index 2ee73dcc6b..0ba9a53734 100644
--- a/keyboards/pica40/rev2/rev2.c
+++ b/keyboards/pica40/rev2/rev2.c
@@ -11,7 +11,7 @@
11 11
12// custom handler that returns encoder B pin status from slave side 12// custom handler that returns encoder B pin status from slave side
13void encoder_sync_slave_handler(uint8_t in_buflen, const void *in_data, uint8_t out_buflen, void *out_data) { 13void encoder_sync_slave_handler(uint8_t in_buflen, const void *in_data, uint8_t out_buflen, void *out_data) {
14 *(uint8_t *)out_data = readPin(ENCODER_PIN_B) ? 1 : 0; 14 *(uint8_t *)out_data = gpio_read_pin(ENCODER_PIN_B) ? 1 : 0;
15} 15}
16 16
17void encoder_quadrature_init_pin(uint8_t index, bool pad_b) {} 17void encoder_quadrature_init_pin(uint8_t index, bool pad_b) {}
@@ -22,7 +22,7 @@ uint8_t encoder_quadrature_read_pin(uint8_t index, bool pad_b) {
22 transaction_rpc_recv(ENCODER_SYNC, sizeof(data), &data); 22 transaction_rpc_recv(ENCODER_SYNC, sizeof(data), &data);
23 return data; 23 return data;
24 } 24 }
25 return readPin(ENCODER_PIN_A) ? 1 : 0; 25 return gpio_read_pin(ENCODER_PIN_A) ? 1 : 0;
26} 26}
27 27
28#endif // ENCODER_ENABLE 28#endif // ENCODER_ENABLE
@@ -53,11 +53,11 @@ bool should_set_rgblight = false;
53#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_LAYERS) 53#endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_LAYERS)
54 54
55void keyboard_post_init_kb(void) { 55void keyboard_post_init_kb(void) {
56 setPinOutput(PICA40_RGB_POWER_PIN); 56 gpio_set_pin_output(PICA40_RGB_POWER_PIN);
57 57
58#ifdef ENCODER_ENABLE 58#ifdef ENCODER_ENABLE
59 setPinInputHigh(ENCODER_PIN_A); 59 gpio_set_pin_input_high(ENCODER_PIN_A);
60 setPinInputHigh(ENCODER_PIN_B); 60 gpio_set_pin_input_high(ENCODER_PIN_B);
61 transaction_register_rpc(ENCODER_SYNC, encoder_sync_slave_handler); 61 transaction_register_rpc(ENCODER_SYNC, encoder_sync_slave_handler);
62#endif // ENCODER_ENABLE 62#endif // ENCODER_ENABLE
63 63
@@ -113,9 +113,9 @@ void housekeeping_task_kb(void) {
113 should_set_rgblight = true; 113 should_set_rgblight = true;
114 114
115 if (is_layer_active) { 115 if (is_layer_active) {
116 writePinHigh(PICA40_RGB_POWER_PIN); 116 gpio_write_pin_high(PICA40_RGB_POWER_PIN);
117 } else { 117 } else {
118 writePinLow(PICA40_RGB_POWER_PIN); 118 gpio_write_pin_low(PICA40_RGB_POWER_PIN);
119 } 119 }
120 } 120 }
121 } 121 }
diff --git a/keyboards/planck/planck.c b/keyboards/planck/planck.c
index 660be55bab..9410b71a97 100644
--- a/keyboards/planck/planck.c
+++ b/keyboards/planck/planck.c
@@ -4,8 +4,8 @@ __attribute__ ((weak))
4void matrix_init_kb(void) { 4void matrix_init_kb(void) {
5 // Turn status LED on, with the exception of THK 5 // Turn status LED on, with the exception of THK
6 #if defined(__AVR_ATmega32U4__) 6 #if defined(__AVR_ATmega32U4__)
7 setPinOutput(E6); 7 gpio_set_pin_output(E6);
8 writePinHigh(E6); 8 gpio_write_pin_high(E6);
9 #endif 9 #endif
10 10
11 matrix_init_user(); 11 matrix_init_user();
diff --git a/keyboards/planck/rev6_drop/matrix.c b/keyboards/planck/rev6_drop/matrix.c
index d140356738..4d535fbb03 100644
--- a/keyboards/planck/rev6_drop/matrix.c
+++ b/keyboards/planck/rev6_drop/matrix.c
@@ -27,13 +27,13 @@ static matrix_row_t matrix_inverted[MATRIX_COLS];
27void matrix_init_custom(void) { 27void matrix_init_custom(void) {
28 // actual matrix setup - cols 28 // actual matrix setup - cols
29 for (int i = 0; i < MATRIX_COLS; i++) { 29 for (int i = 0; i < MATRIX_COLS; i++) {
30 setPinOutput(matrix_col_pins[i]); 30 gpio_set_pin_output(matrix_col_pins[i]);
31 writePinLow(matrix_col_pins[i]); 31 gpio_write_pin_low(matrix_col_pins[i]);
32 } 32 }
33 33
34 // rows 34 // rows
35 for (int i = 0; i < MATRIX_ROWS; i++) { 35 for (int i = 0; i < MATRIX_ROWS; i++) {
36 setPinInputLow(matrix_row_pins[i]); 36 gpio_set_pin_input_low(matrix_row_pins[i]);
37 } 37 }
38} 38}
39 39
@@ -45,18 +45,18 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
45 matrix_row_t data = 0; 45 matrix_row_t data = 0;
46 46
47 // strobe col 47 // strobe col
48 writePinHigh(matrix_col_pins[col]); 48 gpio_write_pin_high(matrix_col_pins[col]);
49 49
50 // need wait to settle pin state 50 // need wait to settle pin state
51 wait_us(20); 51 wait_us(20);
52 52
53 // read row data 53 // read row data
54 for (int row = 0; row < MATRIX_ROWS; row++) { 54 for (int row = 0; row < MATRIX_ROWS; row++) {
55 data |= (readPin(matrix_row_pins[row]) << row); 55 data |= (gpio_read_pin(matrix_row_pins[row]) << row);
56 } 56 }
57 57
58 // unstrobe col 58 // unstrobe col
59 writePinLow(matrix_col_pins[col]); 59 gpio_write_pin_low(matrix_col_pins[col]);
60 60
61 if (matrix_inverted[col] != data) { 61 if (matrix_inverted[col] != data) {
62 matrix_inverted[col] = data; 62 matrix_inverted[col] = data;
diff --git a/keyboards/planck/rev7/matrix.c b/keyboards/planck/rev7/matrix.c
index 8cadfa5e8d..777bd6a7fe 100644
--- a/keyboards/planck/rev7/matrix.c
+++ b/keyboards/planck/rev7/matrix.c
@@ -44,18 +44,18 @@ static matrix_row_t matrix_inverted[MATRIX_COLS];
44void matrix_init_custom(void) { 44void matrix_init_custom(void) {
45 // actual matrix setup - cols 45 // actual matrix setup - cols
46 for (int i = 0; i < MATRIX_COLS; i++) { 46 for (int i = 0; i < MATRIX_COLS; i++) {
47 setPinOutput(matrix_col_pins[i]); 47 gpio_set_pin_output(matrix_col_pins[i]);
48 writePinLow(matrix_col_pins[i]); 48 gpio_write_pin_low(matrix_col_pins[i]);
49 } 49 }
50 50
51 // rows 51 // rows
52 for (int i = 0; i < MATRIX_ROWS; i++) { 52 for (int i = 0; i < MATRIX_ROWS; i++) {
53 setPinInputLow(matrix_row_pins[i]); 53 gpio_set_pin_input_low(matrix_row_pins[i]);
54 } 54 }
55 55
56 // encoder A & B setup 56 // encoder A & B setup
57 setPinInputLow(B12); 57 gpio_set_pin_input_low(B12);
58 setPinInputLow(B13); 58 gpio_set_pin_input_low(B13);
59 59
60#ifndef PLANCK_WATCHDOG_DISABLE 60#ifndef PLANCK_WATCHDOG_DISABLE
61 wdgInit(); 61 wdgInit();
@@ -81,18 +81,18 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
81 matrix_row_t data = 0; 81 matrix_row_t data = 0;
82 82
83 // strobe col 83 // strobe col
84 writePinHigh(matrix_col_pins[col]); 84 gpio_write_pin_high(matrix_col_pins[col]);
85 85
86 // need wait to settle pin state 86 // need wait to settle pin state
87 wait_us(20); 87 wait_us(20);
88 88
89 // read row data 89 // read row data
90 for (int row = 0; row < MATRIX_ROWS; row++) { 90 for (int row = 0; row < MATRIX_ROWS; row++) {
91 data |= (readPin(matrix_row_pins[row]) << row); 91 data |= (gpio_read_pin(matrix_row_pins[row]) << row);
92 } 92 }
93 93
94 // unstrobe col 94 // unstrobe col
95 writePinLow(matrix_col_pins[col]); 95 gpio_write_pin_low(matrix_col_pins[col]);
96 96
97 if (matrix_inverted[col] != data) { 97 if (matrix_inverted[col] != data) {
98 matrix_inverted[col] = data; 98 matrix_inverted[col] = data;
@@ -113,11 +113,11 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
113 113
114uint8_t encoder_quadrature_read_pin(uint8_t index, bool pad_b) { 114uint8_t encoder_quadrature_read_pin(uint8_t index, bool pad_b) {
115 pin_t pin = pad_b ? B13: B12; 115 pin_t pin = pad_b ? B13: B12;
116 setPinInputHigh(pin); 116 gpio_set_pin_input_high(pin);
117 writePinLow(matrix_row_pins[index]); 117 gpio_write_pin_low(matrix_row_pins[index]);
118 wait_us(10); 118 wait_us(10);
119 uint8_t ret = readPin(pin) ? 1 : 0; 119 uint8_t ret = gpio_read_pin(pin) ? 1 : 0;
120 setPinInputLow(matrix_row_pins[index]); 120 gpio_set_pin_input_low(matrix_row_pins[index]);
121 setPinInputLow(pin); 121 gpio_set_pin_input_low(pin);
122 return ret; 122 return ret;
123} 123}
diff --git a/keyboards/pom_keyboards/tnln95/tnln95.c b/keyboards/pom_keyboards/tnln95/tnln95.c
index 12651327ea..b8ab8ff7a7 100644
--- a/keyboards/pom_keyboards/tnln95/tnln95.c
+++ b/keyboards/pom_keyboards/tnln95/tnln95.c
@@ -16,11 +16,11 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 setPinOutput(B1); 19 gpio_set_pin_output(B1);
20 setPinOutput(B2); 20 gpio_set_pin_output(B2);
21 /* I will add function to these later */ 21 /* I will add function to these later */
22 // setPinOutput(B3); 22 // gpio_set_pin_output(B3);
23 // setPinOutput(E2); 23 // gpio_set_pin_output(E2);
24 24
25 keyboard_pre_init_user(); 25 keyboard_pre_init_user();
26} 26}
@@ -28,8 +28,8 @@ void keyboard_pre_init_kb(void) {
28bool led_update_kb(led_t led_state) { 28bool led_update_kb(led_t led_state) {
29 bool res = led_update_user(led_state); 29 bool res = led_update_user(led_state);
30 if(res) { 30 if(res) {
31 writePin(B1, led_state.num_lock); 31 gpio_write_pin(B1, led_state.num_lock);
32 writePin(B2, led_state.caps_lock); 32 gpio_write_pin(B2, led_state.caps_lock);
33 } 33 }
34 return res; 34 return res;
35} 35}
diff --git a/keyboards/preonic/rev1/rev1.c b/keyboards/preonic/rev1/rev1.c
index eed51f2d84..8613da79ee 100644
--- a/keyboards/preonic/rev1/rev1.c
+++ b/keyboards/preonic/rev1/rev1.c
@@ -18,8 +18,8 @@
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 19
20 // Turn status LED on 20 // Turn status LED on
21 setPinOutput(E6); 21 gpio_set_pin_output(E6);
22 writePinHigh(E6); 22 gpio_write_pin_high(E6);
23 23
24 matrix_init_user(); 24 matrix_init_user();
25}; 25};
diff --git a/keyboards/preonic/rev2/rev2.c b/keyboards/preonic/rev2/rev2.c
index eed51f2d84..8613da79ee 100644
--- a/keyboards/preonic/rev2/rev2.c
+++ b/keyboards/preonic/rev2/rev2.c
@@ -18,8 +18,8 @@
18void matrix_init_kb(void) { 18void matrix_init_kb(void) {
19 19
20 // Turn status LED on 20 // Turn status LED on
21 setPinOutput(E6); 21 gpio_set_pin_output(E6);
22 writePinHigh(E6); 22 gpio_write_pin_high(E6);
23 23
24 matrix_init_user(); 24 matrix_init_user();
25}; 25};
diff --git a/keyboards/primekb/meridian/meridian.c b/keyboards/primekb/meridian/meridian.c
index c2f740dd14..585769e462 100644
--- a/keyboards/primekb/meridian/meridian.c
+++ b/keyboards/primekb/meridian/meridian.c
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20//Initialize B12 for in-switch caps lock 20//Initialize B12 for in-switch caps lock
21void keyboard_pre_init_kb(void){ 21void keyboard_pre_init_kb(void){
22 setPinOutput(B12); 22 gpio_set_pin_output(B12);
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
25 25
@@ -35,7 +35,7 @@ void keyboard_post_init_user(void) {
35bool led_update_kb(led_t led_state) { 35bool led_update_kb(led_t led_state) {
36 bool res = led_update_user(led_state); 36 bool res = led_update_user(led_state);
37 if (res) { 37 if (res) {
38 // writePin(B12, !led_state.caps_lock); //Un-comment this line to enable in-switch capslock indicator 38 // gpio_write_pin(B12, !led_state.caps_lock); //Un-comment this line to enable in-switch capslock indicator
39 if (led_state.caps_lock) { 39 if (led_state.caps_lock) {
40 rgblight_setrgb_at(0, 255, 0, 0); //green 40 rgblight_setrgb_at(0, 255, 0, 0); //green
41 } else { 41 } else {
diff --git a/keyboards/projectd/65/projectd_65_ansi/projectd_65_ansi.c b/keyboards/projectd/65/projectd_65_ansi/projectd_65_ansi.c
index e2a85a75c3..7d7989fdde 100644
--- a/keyboards/projectd/65/projectd_65_ansi/projectd_65_ansi.c
+++ b/keyboards/projectd/65/projectd_65_ansi/projectd_65_ansi.c
@@ -118,9 +118,9 @@ void spi_init(void) {
118 is_initialised = true; 118 is_initialised = true;
119 119
120 // Try releasing special pins for a short time 120 // Try releasing special pins for a short time
121 setPinInput(SPI_SCK_PIN); 121 gpio_set_pin_input(SPI_SCK_PIN);
122 setPinInput(SPI_MOSI_PIN); 122 gpio_set_pin_input(SPI_MOSI_PIN);
123 setPinInput(SPI_MISO_PIN); 123 gpio_set_pin_input(SPI_MISO_PIN);
124 124
125 chThdSleepMilliseconds(10); 125 chThdSleepMilliseconds(10);
126 126
diff --git a/keyboards/projectd/75/ansi/ansi.c b/keyboards/projectd/75/ansi/ansi.c
index f32bf369a9..8257cf39c2 100644
--- a/keyboards/projectd/75/ansi/ansi.c
+++ b/keyboards/projectd/75/ansi/ansi.c
@@ -134,9 +134,9 @@ void spi_init(void) {
134 is_initialised = true; 134 is_initialised = true;
135 135
136 // Try releasing special pins for a short time 136 // Try releasing special pins for a short time
137 setPinInput(SPI_SCK_PIN); 137 gpio_set_pin_input(SPI_SCK_PIN);
138 setPinInput(SPI_MOSI_PIN); 138 gpio_set_pin_input(SPI_MOSI_PIN);
139 setPinInput(SPI_MISO_PIN); 139 gpio_set_pin_input(SPI_MISO_PIN);
140 140
141 chThdSleepMilliseconds(10); 141 chThdSleepMilliseconds(10);
142 142
diff --git a/keyboards/projectkb/alice/alice.c b/keyboards/projectkb/alice/alice.c
index 5e5687f7e8..8ec5f16736 100644
--- a/keyboards/projectkb/alice/alice.c
+++ b/keyboards/projectkb/alice/alice.c
@@ -1,9 +1,9 @@
1#include "quantum.h" 1#include "quantum.h"
2 2
3void keyboard_pre_init_kb(void) { 3void keyboard_pre_init_kb(void) {
4 setPinOutput(INDICATOR_PIN_0); 4 gpio_set_pin_output(INDICATOR_PIN_0);
5 setPinOutput(INDICATOR_PIN_1); 5 gpio_set_pin_output(INDICATOR_PIN_1);
6 setPinOutput(INDICATOR_PIN_2); 6 gpio_set_pin_output(INDICATOR_PIN_2);
7 7
8 keyboard_pre_init_user(); 8 keyboard_pre_init_user();
9} 9}
@@ -12,9 +12,9 @@ void keyboard_pre_init_kb(void) {
12bool led_update_kb(led_t led_state) { 12bool led_update_kb(led_t led_state) {
13 bool runDefault = led_update_user(led_state); 13 bool runDefault = led_update_user(led_state);
14 if (runDefault) { 14 if (runDefault) {
15 writePin(INDICATOR_PIN_0, !led_state.num_lock); 15 gpio_write_pin(INDICATOR_PIN_0, !led_state.num_lock);
16 writePin(INDICATOR_PIN_1, !led_state.caps_lock); 16 gpio_write_pin(INDICATOR_PIN_1, !led_state.caps_lock);
17 writePin(INDICATOR_PIN_2, !led_state.scroll_lock); 17 gpio_write_pin(INDICATOR_PIN_2, !led_state.scroll_lock);
18 } 18 }
19 return runDefault; 19 return runDefault;
20} 20}
diff --git a/keyboards/protozoa/event_horizon/event_horizon.c b/keyboards/protozoa/event_horizon/event_horizon.c
index 544d7c32b2..a8977a0e03 100644
--- a/keyboards/protozoa/event_horizon/event_horizon.c
+++ b/keyboards/protozoa/event_horizon/event_horizon.c
@@ -17,5 +17,5 @@
17 17
18void led_init_ports(void) { 18void led_init_ports(void) {
19 // Set our LED pins as open drain outputs 19 // Set our LED pins as open drain outputs
20 setPinOutputOpenDrain(LED_CAPS_LOCK_PIN); 20 gpio_set_pin_output_open_drain(LED_CAPS_LOCK_PIN);
21} 21}
diff --git a/keyboards/punk75/punk75.c b/keyboards/punk75/punk75.c
index aaabefb5aa..8d9d09d43c 100644
--- a/keyboards/punk75/punk75.c
+++ b/keyboards/punk75/punk75.c
@@ -18,7 +18,7 @@
18 18
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 // Set our LED pin as output 20 // Set our LED pin as output
21 setPinOutput(LED); 21 gpio_set_pin_output(LED);
22 22
23 matrix_init_user(); 23 matrix_init_user();
24} 24}
@@ -26,7 +26,7 @@ void matrix_init_kb(void) {
26bool led_update_kb(led_t led_state) { 26bool led_update_kb(led_t led_state) {
27 bool res = led_update_user(led_state); 27 bool res = led_update_user(led_state);
28 if(res) { 28 if(res) {
29 writePin(LED, !led_state.caps_lock); 29 gpio_write_pin(LED, !led_state.caps_lock);
30 } 30 }
31 return res; 31 return res;
32} 32}
diff --git a/keyboards/quad_h/lb75/lb75.c b/keyboards/quad_h/lb75/lb75.c
index 4c8e4f929b..ef716092b9 100644
--- a/keyboards/quad_h/lb75/lb75.c
+++ b/keyboards/quad_h/lb75/lb75.c
@@ -20,8 +20,8 @@ void matrix_init_kb(void) {
20 // put your keyboard start-up code here 20 // put your keyboard start-up code here
21 // runs once when the firmware starts up 21 // runs once when the firmware starts up
22 22
23 setPinOutput(B1); 23 gpio_set_pin_output(B1);
24 setPinOutput(B2); 24 gpio_set_pin_output(B2);
25 25
26 matrix_init_user(); 26 matrix_init_user();
27} 27}
@@ -30,8 +30,8 @@ bool led_update_kb(led_t led_state) {
30 bool res = led_update_user(led_state); 30 bool res = led_update_user(led_state);
31 31
32 if(res) { 32 if(res) {
33 writePin(B1, !led_state.caps_lock); 33 gpio_write_pin(B1, !led_state.caps_lock);
34 writePin(B2, !led_state.scroll_lock); 34 gpio_write_pin(B2, !led_state.scroll_lock);
35 } 35 }
36 36
37 return res; 37 return res;
diff --git a/keyboards/qvex/lynepad/lynepad.c b/keyboards/qvex/lynepad/lynepad.c
index cc69e12240..0e715e68bc 100644
--- a/keyboards/qvex/lynepad/lynepad.c
+++ b/keyboards/qvex/lynepad/lynepad.c
@@ -15,12 +15,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
15 15
16void keyboard_pre_init_kb(void) { 16void keyboard_pre_init_kb(void) {
17 // Encoder pins 17 // Encoder pins
18 setPinInput(PIN_TW_SW); 18 gpio_set_pin_input(PIN_TW_SW);
19 setPinInput(PIN_RJ_SW); 19 gpio_set_pin_input(PIN_RJ_SW);
20 setPinInput(PIN_RJ_DIR_A); 20 gpio_set_pin_input(PIN_RJ_DIR_A);
21 setPinInput(PIN_RJ_DIR_C); 21 gpio_set_pin_input(PIN_RJ_DIR_C);
22 setPinInput(PIN_RJ_DIR_B); 22 gpio_set_pin_input(PIN_RJ_DIR_B);
23 setPinInput(PIN_RJ_DIR_D); 23 gpio_set_pin_input(PIN_RJ_DIR_D);
24 24
25 keyboard_pre_init_user(); 25 keyboard_pre_init_user();
26} 26}
@@ -40,18 +40,18 @@ int16_t enc2RightPrev = 1;
40 40
41void matrix_scan_kb(void) { 41void matrix_scan_kb(void) {
42 enc1CenterPrev = enc1Center; 42 enc1CenterPrev = enc1Center;
43 enc1Center = readPin(PIN_TW_SW); 43 enc1Center = gpio_read_pin(PIN_TW_SW);
44 44
45 enc2CenterPrev = enc2Center; 45 enc2CenterPrev = enc2Center;
46 enc2Center = readPin(PIN_RJ_SW); 46 enc2Center = gpio_read_pin(PIN_RJ_SW);
47 enc2UpPrev = enc2Up; 47 enc2UpPrev = enc2Up;
48 enc2Up = readPin(PIN_RJ_DIR_A); 48 enc2Up = gpio_read_pin(PIN_RJ_DIR_A);
49 enc2DownPrev = enc2Down; 49 enc2DownPrev = enc2Down;
50 enc2Down = readPin(PIN_RJ_DIR_C); 50 enc2Down = gpio_read_pin(PIN_RJ_DIR_C);
51 enc2LeftPrev = enc2Left; 51 enc2LeftPrev = enc2Left;
52 enc2Left = readPin(PIN_RJ_DIR_B); 52 enc2Left = gpio_read_pin(PIN_RJ_DIR_B);
53 enc2RightPrev = enc2Right; 53 enc2RightPrev = enc2Right;
54 enc2Right = readPin(PIN_RJ_DIR_D); 54 enc2Right = gpio_read_pin(PIN_RJ_DIR_D);
55 55
56 // Ensure any user customizations are called (for some reason this wasn't happening by default) 56 // Ensure any user customizations are called (for some reason this wasn't happening by default)
57 matrix_scan_user(); 57 matrix_scan_user();
diff --git a/keyboards/qvex/lynepad2/matrix.c b/keyboards/qvex/lynepad2/matrix.c
index 89c56b8d40..23b22cdb69 100644
--- a/keyboards/qvex/lynepad2/matrix.c
+++ b/keyboards/qvex/lynepad2/matrix.c
@@ -24,31 +24,31 @@ extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
24extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values 24extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
25 25
26static void select_row(uint8_t row) { 26static void select_row(uint8_t row) {
27 setPinOutput(row_pins[row]); 27 gpio_set_pin_output(row_pins[row]);
28 writePinLow(row_pins[row]); 28 gpio_write_pin_low(row_pins[row]);
29} 29}
30 30
31static void unselect_row(uint8_t row) { 31static void unselect_row(uint8_t row) {
32 setPinInputHigh(row_pins[row]); 32 gpio_set_pin_input_high(row_pins[row]);
33} 33}
34 34
35static void unselect_rows(void) { 35static void unselect_rows(void) {
36 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 36 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
37 setPinInputHigh(row_pins[x]); 37 gpio_set_pin_input_high(row_pins[x]);
38 } 38 }
39} 39}
40 40
41static void init_pins(void) { 41static void init_pins(void) {
42 unselect_rows(); 42 unselect_rows();
43 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 43 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
44 setPinInputHigh(col_pins[x]); 44 gpio_set_pin_input_high(col_pins[x]);
45 } 45 }
46 setPinInputHigh(PIN_JU); 46 gpio_set_pin_input_high(PIN_JU);
47 setPinInputHigh(PIN_JD); 47 gpio_set_pin_input_high(PIN_JD);
48 setPinInputHigh(PIN_JL); 48 gpio_set_pin_input_high(PIN_JL);
49 setPinInputHigh(PIN_JR); 49 gpio_set_pin_input_high(PIN_JR);
50 setPinInputHigh(PIN_JC); 50 gpio_set_pin_input_high(PIN_JC);
51 setPinInputHigh(PIN_TC); 51 gpio_set_pin_input_high(PIN_TC);
52} 52}
53 53
54static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { 54static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
@@ -62,7 +62,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
62 wait_us(30); 62 wait_us(30);
63 63
64 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 64 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
65 uint8_t pin_state = readPin(col_pins[col_index]); 65 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
66 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 66 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
67 } 67 }
68 68
@@ -78,16 +78,16 @@ static bool read_encoder_switches(matrix_row_t current_matrix[]) {
78 current_matrix[3] = 0; 78 current_matrix[3] = 0;
79 current_matrix[4] = 0; 79 current_matrix[4] = 0;
80 80
81 current_matrix[4] |= !readPin(PIN_TC) ? (1 << 1) : 0; 81 current_matrix[4] |= !gpio_read_pin(PIN_TC) ? (1 << 1) : 0;
82 82
83 if (!readPin(PIN_JC)) { 83 if (!gpio_read_pin(PIN_JC)) {
84 if (!readPin(PIN_JU)) { 84 if (!gpio_read_pin(PIN_JU)) {
85 current_matrix[3] |= (1 << 0); 85 current_matrix[3] |= (1 << 0);
86 } else if (!readPin(PIN_JD)) { 86 } else if (!gpio_read_pin(PIN_JD)) {
87 current_matrix[3] |= (1 << 1); 87 current_matrix[3] |= (1 << 1);
88 } else if (!readPin(PIN_JL)) { 88 } else if (!gpio_read_pin(PIN_JL)) {
89 current_matrix[3] |= (1 << 2); 89 current_matrix[3] |= (1 << 2);
90 } else if (!readPin(PIN_JR)) { 90 } else if (!gpio_read_pin(PIN_JR)) {
91 current_matrix[3] |= (1 << 3); 91 current_matrix[3] |= (1 << 3);
92 } else { 92 } else {
93 current_matrix[4] |= (1 << 0); 93 current_matrix[4] |= (1 << 0);
diff --git a/keyboards/rart/rartlite/rartlite.c b/keyboards/rart/rartlite/rartlite.c
index 691c68253e..f0ca27151e 100644
--- a/keyboards/rart/rartlite/rartlite.c
+++ b/keyboards/rart/rartlite/rartlite.c
@@ -15,12 +15,12 @@
15#include "quantum.h" 15#include "quantum.h"
16 16
17void keyboard_pre_init_kb(void) { 17void keyboard_pre_init_kb(void) {
18 setPinOutput(B1); 18 gpio_set_pin_output(B1);
19 19
20 keyboard_pre_init_user(); 20 keyboard_pre_init_user();
21} 21}
22 22
23layer_state_t layer_state_set_kb(layer_state_t state) { 23layer_state_t layer_state_set_kb(layer_state_t state) {
24 writePin(B1, layer_state_cmp(state, 1)); 24 gpio_write_pin(B1, layer_state_cmp(state, 1));
25 return layer_state_set_user(state); 25 return layer_state_set_user(state);
26} 26}
diff --git a/keyboards/rate/pistachio_pro/matrix.c b/keyboards/rate/pistachio_pro/matrix.c
index bb962c76e2..f235c65f56 100644
--- a/keyboards/rate/pistachio_pro/matrix.c
+++ b/keyboards/rate/pistachio_pro/matrix.c
@@ -22,13 +22,13 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
22 22
23static inline void setPinOutput_writeLow(pin_t pin) { 23static inline void setPinOutput_writeLow(pin_t pin) {
24 ATOMIC_BLOCK_FORCEON { 24 ATOMIC_BLOCK_FORCEON {
25 setPinOutput(pin); 25 gpio_set_pin_output(pin);
26 writePinLow(pin); 26 gpio_write_pin_low(pin);
27 } 27 }
28} 28}
29 29
30static inline void setPinInputHigh_atomic(pin_t pin) { 30static inline void setPinInputHigh_atomic(pin_t pin) {
31 ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } 31 ATOMIC_BLOCK_FORCEON { gpio_set_pin_input_high(pin); }
32} 32}
33 33
34static void select_row(uint8_t row) { 34static void select_row(uint8_t row) {
@@ -81,7 +81,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
81 // For each col... 81 // For each col...
82 for (uint8_t col_index = 0; col_index < MATRIX_COLS / 2; col_index++) { 82 for (uint8_t col_index = 0; col_index < MATRIX_COLS / 2; col_index++) {
83 // Check row pin state 83 // Check row pin state
84 if (readPin(col_pins[col_index])) { 84 if (gpio_read_pin(col_pins[col_index])) {
85 // Pin HI, clear col bit 85 // Pin HI, clear col bit
86 current_matrix[current_row] &= ~(MATRIX_ROW_SHIFTER << col_index); 86 current_matrix[current_row] &= ~(MATRIX_ROW_SHIFTER << col_index);
87 } else { 87 } else {
@@ -109,7 +109,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
109 matrix_row_t last_row_value = current_matrix[row_index]; 109 matrix_row_t last_row_value = current_matrix[row_index];
110 110
111 // Check row pin state 111 // Check row pin state
112 if (readPin(row_pins[row_index])) { 112 if (gpio_read_pin(row_pins[row_index])) {
113 // Pin HI, clear col bit 113 // Pin HI, clear col bit
114 current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << ( current_col + MATRIX_COLS/2)); 114 current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << ( current_col + MATRIX_COLS/2));
115 } else { 115 } else {
diff --git a/keyboards/redox/wireless/wireless.c b/keyboards/redox/wireless/wireless.c
index 30cefd9f4e..a82afbf603 100644
--- a/keyboards/redox/wireless/wireless.c
+++ b/keyboards/redox/wireless/wireless.c
@@ -18,15 +18,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "wireless.h" 18#include "wireless.h"
19 19
20void led_init(void) { 20void led_init(void) {
21 setPinOutput(D0); 21 gpio_set_pin_output(D0);
22 setPinOutput(D1); 22 gpio_set_pin_output(D1);
23 setPinOutput(F4); 23 gpio_set_pin_output(F4);
24 setPinOutput(F5); 24 gpio_set_pin_output(F5);
25 25
26 writePinHigh(D0); 26 gpio_write_pin_high(D0);
27 writePinHigh(D1); 27 gpio_write_pin_high(D1);
28 writePinHigh(F4); 28 gpio_write_pin_high(F4);
29 writePinHigh(F5); 29 gpio_write_pin_high(F5);
30} 30}
31 31
32 32
diff --git a/keyboards/redox/wireless/wireless.h b/keyboards/redox/wireless/wireless.h
index a0ba09aff3..f752e0b13f 100644
--- a/keyboards/redox/wireless/wireless.h
+++ b/keyboards/redox/wireless/wireless.h
@@ -19,14 +19,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20#include "quantum.h" 20#include "quantum.h"
21 21
22#define red_led_off writePinHigh(F5) 22#define red_led_off gpio_write_pin_high(F5)
23#define red_led_on writePinLow(F5) 23#define red_led_on gpio_write_pin_low(F5)
24#define blu_led_off writePinHigh(F4) 24#define blu_led_off gpio_write_pin_high(F4)
25#define blu_led_on writePinLow(F4) 25#define blu_led_on gpio_write_pin_low(F4)
26#define grn_led_off writePinHigh(D1) 26#define grn_led_off gpio_write_pin_high(D1)
27#define grn_led_on writePinLow(D1) 27#define grn_led_on gpio_write_pin_low(D1)
28#define wht_led_off writePinHigh(D0) 28#define wht_led_off gpio_write_pin_high(D0)
29#define wht_led_on writePinLow(D0) 29#define wht_led_on gpio_write_pin_low(D0)
30 30
31#define set_led_off red_led_off; grn_led_off; blu_led_off; wht_led_off 31#define set_led_off red_led_off; grn_led_off; blu_led_off; wht_led_off
32#define set_led_red red_led_on; grn_led_off; blu_led_off; wht_led_off 32#define set_led_red red_led_on; grn_led_off; blu_led_off; wht_led_off
diff --git a/keyboards/redscarf_i/redscarf_i.c b/keyboards/redscarf_i/redscarf_i.c
index fac3e245fb..949bc362ad 100644
--- a/keyboards/redscarf_i/redscarf_i.c
+++ b/keyboards/redscarf_i/redscarf_i.c
@@ -18,19 +18,19 @@
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 // initialize top row leds 20 // initialize top row leds
21 setPinOutput(F7); 21 gpio_set_pin_output(F7);
22 setPinOutput(F6); 22 gpio_set_pin_output(F6);
23 setPinOutput(F5); 23 gpio_set_pin_output(F5);
24 // and then turn them off 24 // and then turn them off
25 writePinHigh(F7); 25 gpio_write_pin_high(F7);
26 writePinHigh(F6); 26 gpio_write_pin_high(F6);
27 writePinHigh(F5); 27 gpio_write_pin_high(F5);
28} 28}
29 29
30bool led_update_kb(led_t led_state) { 30bool led_update_kb(led_t led_state) {
31 bool res = led_update_user(led_state); 31 bool res = led_update_user(led_state);
32 if(res) { 32 if(res) {
33 writePin(F7, !led_state.num_lock); 33 gpio_write_pin(F7, !led_state.num_lock);
34 } 34 }
35 return res; 35 return res;
36} 36}
@@ -38,16 +38,16 @@ bool led_update_kb(led_t led_state) {
38layer_state_t layer_state_set_kb(layer_state_t state) { 38layer_state_t layer_state_set_kb(layer_state_t state) {
39 switch (get_highest_layer(state)) { 39 switch (get_highest_layer(state)) {
40 case 1: 40 case 1:
41 writePinHigh(F6); 41 gpio_write_pin_high(F6);
42 writePinLow(F5); 42 gpio_write_pin_low(F5);
43 break; 43 break;
44 case 2: 44 case 2:
45 writePinLow(F6); 45 gpio_write_pin_low(F6);
46 writePinHigh(F5); 46 gpio_write_pin_high(F5);
47 break; 47 break;
48 default: 48 default:
49 writePinHigh(F6); 49 gpio_write_pin_high(F6);
50 writePinHigh(F5); 50 gpio_write_pin_high(F5);
51 break; 51 break;
52 } 52 }
53 return state; 53 return state;
diff --git a/keyboards/redscarf_iiplus/verb/matrix.c b/keyboards/redscarf_iiplus/verb/matrix.c
index 391a923f16..886704f9ef 100755
--- a/keyboards/redscarf_iiplus/verb/matrix.c
+++ b/keyboards/redscarf_iiplus/verb/matrix.c
@@ -114,7 +114,7 @@ static void init_pins(void) {
114 for (int col = 0; col < MATRIX_COLS; col++) { 114 for (int col = 0; col < MATRIX_COLS; col++) {
115 pin_t pin = direct_pins[row][col]; 115 pin_t pin = direct_pins[row][col];
116 if (pin != NO_PIN) { 116 if (pin != NO_PIN) {
117 setPinInputHigh(pin); 117 gpio_set_pin_input_high(pin);
118 } 118 }
119 } 119 }
120 } 120 }
@@ -127,7 +127,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
127 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 127 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
128 pin_t pin = direct_pins[current_row][col_index]; 128 pin_t pin = direct_pins[current_row][col_index];
129 if (pin != NO_PIN) { 129 if (pin != NO_PIN) {
130 current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index); 130 current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (ROW_SHIFTER << col_index);
131 } 131 }
132 } 132 }
133 133
@@ -150,27 +150,27 @@ static void select_row(uint8_t col)
150{ 150{
151 switch (col) { 151 switch (col) {
152 case 0: 152 case 0:
153 writePinLow(B0); 153 gpio_write_pin_low(B0);
154 writePinLow(B1); 154 gpio_write_pin_low(B1);
155 writePinLow(B2); 155 gpio_write_pin_low(B2);
156 break; 156 break;
157 case 1: 157 case 1:
158 writePinLow(B0); 158 gpio_write_pin_low(B0);
159 writePinLow(B1); 159 gpio_write_pin_low(B1);
160 break; 160 break;
161 case 2: 161 case 2:
162 writePinLow(B0); 162 gpio_write_pin_low(B0);
163 writePinLow(B2); 163 gpio_write_pin_low(B2);
164 break; 164 break;
165 case 3: 165 case 3:
166 writePinLow(B0); 166 gpio_write_pin_low(B0);
167 break; 167 break;
168 case 4: 168 case 4:
169 writePinLow(B1); 169 gpio_write_pin_low(B1);
170 writePinLow(B2); 170 gpio_write_pin_low(B2);
171 break; 171 break;
172 case 5: 172 case 5:
173 writePinLow(B1); 173 gpio_write_pin_low(B1);
174 break; 174 break;
175 } 175 }
176} 176}
@@ -179,46 +179,46 @@ static void unselect_row(uint8_t col)
179{ 179{
180 switch (col) { 180 switch (col) {
181 case 0: 181 case 0:
182 writePinHigh(B0); 182 gpio_write_pin_high(B0);
183 writePinHigh(B1); 183 gpio_write_pin_high(B1);
184 writePinHigh(B2); 184 gpio_write_pin_high(B2);
185 break; 185 break;
186 case 1: 186 case 1:
187 writePinHigh(B0); 187 gpio_write_pin_high(B0);
188 writePinHigh(B1); 188 gpio_write_pin_high(B1);
189 break; 189 break;
190 case 2: 190 case 2:
191 writePinHigh(B0); 191 gpio_write_pin_high(B0);
192 writePinHigh(B2); 192 gpio_write_pin_high(B2);
193 break; 193 break;
194 case 3: 194 case 3:
195 writePinHigh(B0); 195 gpio_write_pin_high(B0);
196 break; 196 break;
197 case 4: 197 case 4:
198 writePinHigh(B1); 198 gpio_write_pin_high(B1);
199 writePinHigh(B2); 199 gpio_write_pin_high(B2);
200 break; 200 break;
201 case 5: 201 case 5:
202 writePinHigh(B1); 202 gpio_write_pin_high(B1);
203 break; 203 break;
204 } 204 }
205} 205}
206 206
207static void unselect_rows(void) 207static void unselect_rows(void)
208{ 208{
209 setPinOutput(B0); 209 gpio_set_pin_output(B0);
210 setPinOutput(B1); 210 gpio_set_pin_output(B1);
211 setPinOutput(B2); 211 gpio_set_pin_output(B2);
212 // make all pins high to select Y7, nothing is connected to that (otherwise the first row will act weird) 212 // make all pins high to select Y7, nothing is connected to that (otherwise the first row will act weird)
213 writePinHigh(B0); 213 gpio_write_pin_high(B0);
214 writePinHigh(B1); 214 gpio_write_pin_high(B1);
215 writePinHigh(B2); 215 gpio_write_pin_high(B2);
216} 216}
217 217
218static void init_pins(void) { 218static void init_pins(void) {
219 unselect_rows(); 219 unselect_rows();
220 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 220 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
221 setPinInputHigh(col_pins[x]); 221 gpio_set_pin_input_high(col_pins[x]);
222 } 222 }
223} 223}
224 224
@@ -238,7 +238,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
238 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 238 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
239 239
240 // Select the col pin to read (active low) 240 // Select the col pin to read (active low)
241 uint8_t pin_state = readPin(col_pins[col_index]); 241 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
242 242
243 // Populate the matrix row with the state of the col pin 243 // Populate the matrix row with the state of the col pin
244 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); 244 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
@@ -254,26 +254,26 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
254 254
255static void select_col(uint8_t col) 255static void select_col(uint8_t col)
256{ 256{
257 setPinOutput(col_pins[col]); 257 gpio_set_pin_output(col_pins[col]);
258 writePinLow(col_pins[col]); 258 gpio_write_pin_low(col_pins[col]);
259} 259}
260 260
261static void unselect_col(uint8_t col) 261static void unselect_col(uint8_t col)
262{ 262{
263 setPinInputHigh(col_pins[col]); 263 gpio_set_pin_input_high(col_pins[col]);
264} 264}
265 265
266static void unselect_cols(void) 266static void unselect_cols(void)
267{ 267{
268 for(uint8_t x = 0; x < MATRIX_COLS; x++) { 268 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
269 setPinInputHigh(col_pins[x]); 269 gpio_set_pin_input_high(col_pins[x]);
270 } 270 }
271} 271}
272 272
273static void init_pins(void) { 273static void init_pins(void) {
274 unselect_cols(); 274 unselect_cols();
275 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 275 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
276 setPinInputHigh(row_pins[x]); 276 gpio_set_pin_input_high(row_pins[x]);
277 } 277 }
278} 278}
279 279
@@ -293,7 +293,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
293 matrix_row_t last_row_value = current_matrix[row_index]; 293 matrix_row_t last_row_value = current_matrix[row_index];
294 294
295 // Check row pin state 295 // Check row pin state
296 if (readPin(row_pins[row_index]) == 0) 296 if (gpio_read_pin(row_pins[row_index]) == 0)
297 { 297 {
298 // Pin LO, set col bit 298 // Pin LO, set col bit
299 current_matrix[row_index] |= (ROW_SHIFTER << current_col); 299 current_matrix[row_index] |= (ROW_SHIFTER << current_col);
diff --git a/keyboards/redscarf_iiplus/verc/matrix.c b/keyboards/redscarf_iiplus/verc/matrix.c
index 391a923f16..886704f9ef 100755
--- a/keyboards/redscarf_iiplus/verc/matrix.c
+++ b/keyboards/redscarf_iiplus/verc/matrix.c
@@ -114,7 +114,7 @@ static void init_pins(void) {
114 for (int col = 0; col < MATRIX_COLS; col++) { 114 for (int col = 0; col < MATRIX_COLS; col++) {
115 pin_t pin = direct_pins[row][col]; 115 pin_t pin = direct_pins[row][col];
116 if (pin != NO_PIN) { 116 if (pin != NO_PIN) {
117 setPinInputHigh(pin); 117 gpio_set_pin_input_high(pin);
118 } 118 }
119 } 119 }
120 } 120 }
@@ -127,7 +127,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
127 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 127 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
128 pin_t pin = direct_pins[current_row][col_index]; 128 pin_t pin = direct_pins[current_row][col_index];
129 if (pin != NO_PIN) { 129 if (pin != NO_PIN) {
130 current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index); 130 current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (ROW_SHIFTER << col_index);
131 } 131 }
132 } 132 }
133 133
@@ -150,27 +150,27 @@ static void select_row(uint8_t col)
150{ 150{
151 switch (col) { 151 switch (col) {
152 case 0: 152 case 0:
153 writePinLow(B0); 153 gpio_write_pin_low(B0);
154 writePinLow(B1); 154 gpio_write_pin_low(B1);
155 writePinLow(B2); 155 gpio_write_pin_low(B2);
156 break; 156 break;
157 case 1: 157 case 1:
158 writePinLow(B0); 158 gpio_write_pin_low(B0);
159 writePinLow(B1); 159 gpio_write_pin_low(B1);
160 break; 160 break;
161 case 2: 161 case 2:
162 writePinLow(B0); 162 gpio_write_pin_low(B0);
163 writePinLow(B2); 163 gpio_write_pin_low(B2);
164 break; 164 break;
165 case 3: 165 case 3:
166 writePinLow(B0); 166 gpio_write_pin_low(B0);
167 break; 167 break;
168 case 4: 168 case 4:
169 writePinLow(B1); 169 gpio_write_pin_low(B1);
170 writePinLow(B2); 170 gpio_write_pin_low(B2);
171 break; 171 break;
172 case 5: 172 case 5:
173 writePinLow(B1); 173 gpio_write_pin_low(B1);
174 break; 174 break;
175 } 175 }
176} 176}
@@ -179,46 +179,46 @@ static void unselect_row(uint8_t col)
179{ 179{
180 switch (col) { 180 switch (col) {
181 case 0: 181 case 0:
182 writePinHigh(B0); 182 gpio_write_pin_high(B0);
183 writePinHigh(B1); 183 gpio_write_pin_high(B1);
184 writePinHigh(B2); 184 gpio_write_pin_high(B2);
185 break; 185 break;
186 case 1: 186 case 1:
187 writePinHigh(B0); 187 gpio_write_pin_high(B0);
188 writePinHigh(B1); 188 gpio_write_pin_high(B1);
189 break; 189 break;
190 case 2: 190 case 2:
191 writePinHigh(B0); 191 gpio_write_pin_high(B0);
192 writePinHigh(B2); 192 gpio_write_pin_high(B2);
193 break; 193 break;
194 case 3: 194 case 3:
195 writePinHigh(B0); 195 gpio_write_pin_high(B0);
196 break; 196 break;
197 case 4: 197 case 4:
198 writePinHigh(B1); 198 gpio_write_pin_high(B1);
199 writePinHigh(B2); 199 gpio_write_pin_high(B2);
200 break; 200 break;
201 case 5: 201 case 5:
202 writePinHigh(B1); 202 gpio_write_pin_high(B1);
203 break; 203 break;
204 } 204 }
205} 205}
206 206
207static void unselect_rows(void) 207static void unselect_rows(void)
208{ 208{
209 setPinOutput(B0); 209 gpio_set_pin_output(B0);
210 setPinOutput(B1); 210 gpio_set_pin_output(B1);
211 setPinOutput(B2); 211 gpio_set_pin_output(B2);
212 // make all pins high to select Y7, nothing is connected to that (otherwise the first row will act weird) 212 // make all pins high to select Y7, nothing is connected to that (otherwise the first row will act weird)
213 writePinHigh(B0); 213 gpio_write_pin_high(B0);
214 writePinHigh(B1); 214 gpio_write_pin_high(B1);
215 writePinHigh(B2); 215 gpio_write_pin_high(B2);
216} 216}
217 217
218static void init_pins(void) { 218static void init_pins(void) {
219 unselect_rows(); 219 unselect_rows();
220 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 220 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
221 setPinInputHigh(col_pins[x]); 221 gpio_set_pin_input_high(col_pins[x]);
222 } 222 }
223} 223}
224 224
@@ -238,7 +238,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
238 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 238 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
239 239
240 // Select the col pin to read (active low) 240 // Select the col pin to read (active low)
241 uint8_t pin_state = readPin(col_pins[col_index]); 241 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
242 242
243 // Populate the matrix row with the state of the col pin 243 // Populate the matrix row with the state of the col pin
244 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); 244 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
@@ -254,26 +254,26 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
254 254
255static void select_col(uint8_t col) 255static void select_col(uint8_t col)
256{ 256{
257 setPinOutput(col_pins[col]); 257 gpio_set_pin_output(col_pins[col]);
258 writePinLow(col_pins[col]); 258 gpio_write_pin_low(col_pins[col]);
259} 259}
260 260
261static void unselect_col(uint8_t col) 261static void unselect_col(uint8_t col)
262{ 262{
263 setPinInputHigh(col_pins[col]); 263 gpio_set_pin_input_high(col_pins[col]);
264} 264}
265 265
266static void unselect_cols(void) 266static void unselect_cols(void)
267{ 267{
268 for(uint8_t x = 0; x < MATRIX_COLS; x++) { 268 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
269 setPinInputHigh(col_pins[x]); 269 gpio_set_pin_input_high(col_pins[x]);
270 } 270 }
271} 271}
272 272
273static void init_pins(void) { 273static void init_pins(void) {
274 unselect_cols(); 274 unselect_cols();
275 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 275 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
276 setPinInputHigh(row_pins[x]); 276 gpio_set_pin_input_high(row_pins[x]);
277 } 277 }
278} 278}
279 279
@@ -293,7 +293,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
293 matrix_row_t last_row_value = current_matrix[row_index]; 293 matrix_row_t last_row_value = current_matrix[row_index];
294 294
295 // Check row pin state 295 // Check row pin state
296 if (readPin(row_pins[row_index]) == 0) 296 if (gpio_read_pin(row_pins[row_index]) == 0)
297 { 297 {
298 // Pin LO, set col bit 298 // Pin LO, set col bit
299 current_matrix[row_index] |= (ROW_SHIFTER << current_col); 299 current_matrix[row_index] |= (ROW_SHIFTER << current_col);
diff --git a/keyboards/redscarf_iiplus/verd/matrix.c b/keyboards/redscarf_iiplus/verd/matrix.c
index b2046db2ce..133898b652 100644
--- a/keyboards/redscarf_iiplus/verd/matrix.c
+++ b/keyboards/redscarf_iiplus/verd/matrix.c
@@ -114,7 +114,7 @@ static void init_pins(void) {
114 for (int col = 0; col < MATRIX_COLS; col++) { 114 for (int col = 0; col < MATRIX_COLS; col++) {
115 pin_t pin = direct_pins[row][col]; 115 pin_t pin = direct_pins[row][col];
116 if (pin != NO_PIN) { 116 if (pin != NO_PIN) {
117 setPinInputHigh(pin); 117 gpio_set_pin_input_high(pin);
118 } 118 }
119 } 119 }
120 } 120 }
@@ -127,7 +127,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
127 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 127 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
128 pin_t pin = direct_pins[current_row][col_index]; 128 pin_t pin = direct_pins[current_row][col_index];
129 if (pin != NO_PIN) { 129 if (pin != NO_PIN) {
130 current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index); 130 current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (ROW_SHIFTER << col_index);
131 } 131 }
132 } 132 }
133 133
@@ -150,27 +150,27 @@ static void select_row(uint8_t col)
150{ 150{
151 switch (col) { 151 switch (col) {
152 case 0: 152 case 0:
153 writePinLow(B0); 153 gpio_write_pin_low(B0);
154 writePinLow(B1); 154 gpio_write_pin_low(B1);
155 writePinLow(B2); 155 gpio_write_pin_low(B2);
156 break; 156 break;
157 case 1: 157 case 1:
158 writePinLow(B0); 158 gpio_write_pin_low(B0);
159 writePinLow(B1); 159 gpio_write_pin_low(B1);
160 break; 160 break;
161 case 2: 161 case 2:
162 writePinLow(B0); 162 gpio_write_pin_low(B0);
163 writePinLow(B2); 163 gpio_write_pin_low(B2);
164 break; 164 break;
165 case 3: 165 case 3:
166 writePinLow(B0); 166 gpio_write_pin_low(B0);
167 break; 167 break;
168 case 4: 168 case 4:
169 writePinLow(B1); 169 gpio_write_pin_low(B1);
170 writePinLow(B2); 170 gpio_write_pin_low(B2);
171 break; 171 break;
172 case 5: 172 case 5:
173 writePinLow(B1); 173 gpio_write_pin_low(B1);
174 break; 174 break;
175 } 175 }
176} 176}
@@ -179,46 +179,46 @@ static void unselect_row(uint8_t col)
179{ 179{
180 switch (col) { 180 switch (col) {
181 case 0: 181 case 0:
182 writePinHigh(B0); 182 gpio_write_pin_high(B0);
183 writePinHigh(B1); 183 gpio_write_pin_high(B1);
184 writePinHigh(B2); 184 gpio_write_pin_high(B2);
185 break; 185 break;
186 case 1: 186 case 1:
187 writePinHigh(B0); 187 gpio_write_pin_high(B0);
188 writePinHigh(B1); 188 gpio_write_pin_high(B1);
189 break; 189 break;
190 case 2: 190 case 2:
191 writePinHigh(B0); 191 gpio_write_pin_high(B0);
192 writePinHigh(B2); 192 gpio_write_pin_high(B2);
193 break; 193 break;
194 case 3: 194 case 3:
195 writePinHigh(B0); 195 gpio_write_pin_high(B0);
196 break; 196 break;
197 case 4: 197 case 4:
198 writePinHigh(B1); 198 gpio_write_pin_high(B1);
199 writePinHigh(B2); 199 gpio_write_pin_high(B2);
200 break; 200 break;
201 case 5: 201 case 5:
202 writePinHigh(B1); 202 gpio_write_pin_high(B1);
203 break; 203 break;
204 } 204 }
205} 205}
206 206
207static void unselect_rows(void) 207static void unselect_rows(void)
208{ 208{
209 setPinOutput(B0); 209 gpio_set_pin_output(B0);
210 setPinOutput(B1); 210 gpio_set_pin_output(B1);
211 setPinOutput(B2); 211 gpio_set_pin_output(B2);
212 // make all pins high to select Y7, nothing is connected to that (otherwise the first row will act weird) 212 // make all pins high to select Y7, nothing is connected to that (otherwise the first row will act weird)
213 writePinHigh(B0); 213 gpio_write_pin_high(B0);
214 writePinHigh(B1); 214 gpio_write_pin_high(B1);
215 writePinHigh(B2); 215 gpio_write_pin_high(B2);
216} 216}
217 217
218static void init_pins(void) { 218static void init_pins(void) {
219 unselect_rows(); 219 unselect_rows();
220 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 220 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
221 setPinInputHigh(col_pins[x]); 221 gpio_set_pin_input_high(col_pins[x]);
222 } 222 }
223} 223}
224 224
@@ -238,7 +238,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
238 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 238 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
239 239
240 // Select the col pin to read (active low) 240 // Select the col pin to read (active low)
241 uint8_t pin_state = readPin(col_pins[col_index]); 241 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
242 242
243 // Populate the matrix row with the state of the col pin 243 // Populate the matrix row with the state of the col pin
244 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); 244 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
@@ -254,26 +254,26 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
254 254
255static void select_col(uint8_t col) 255static void select_col(uint8_t col)
256{ 256{
257 setPinOutput(col_pins[col]); 257 gpio_set_pin_output(col_pins[col]);
258 writePinLow(col_pins[col]); 258 gpio_write_pin_low(col_pins[col]);
259} 259}
260 260
261static void unselect_col(uint8_t col) 261static void unselect_col(uint8_t col)
262{ 262{
263 setPinInputHigh(col_pins[col]); 263 gpio_set_pin_input_high(col_pins[col]);
264} 264}
265 265
266static void unselect_cols(void) 266static void unselect_cols(void)
267{ 267{
268 for(uint8_t x = 0; x < MATRIX_COLS; x++) { 268 for(uint8_t x = 0; x < MATRIX_COLS; x++) {
269 setPinInputHigh(col_pins[x]); 269 gpio_set_pin_input_high(col_pins[x]);
270 } 270 }
271} 271}
272 272
273static void init_pins(void) { 273static void init_pins(void) {
274 unselect_cols(); 274 unselect_cols();
275 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 275 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
276 setPinInputHigh(row_pins[x]); 276 gpio_set_pin_input_high(row_pins[x]);
277 } 277 }
278} 278}
279 279
@@ -293,7 +293,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
293 matrix_row_t last_row_value = current_matrix[row_index]; 293 matrix_row_t last_row_value = current_matrix[row_index];
294 294
295 // Check row pin state 295 // Check row pin state
296 if (readPin(row_pins[row_index]) == 0) 296 if (gpio_read_pin(row_pins[row_index]) == 0)
297 { 297 {
298 // Pin LO, set col bit 298 // Pin LO, set col bit
299 current_matrix[row_index] |= (ROW_SHIFTER << current_col); 299 current_matrix[row_index] |= (ROW_SHIFTER << current_col);
diff --git a/keyboards/rmi_kb/wete/v1/v1.c b/keyboards/rmi_kb/wete/v1/v1.c
index 088ca3c6b7..34a0917468 100644
--- a/keyboards/rmi_kb/wete/v1/v1.c
+++ b/keyboards/rmi_kb/wete/v1/v1.c
@@ -18,17 +18,17 @@
18 18
19void keyboard_pre_init_user(void) { 19void keyboard_pre_init_user(void) {
20 // Initialize indicator LED pins 20 // Initialize indicator LED pins
21 setPinOutput(A14); // Num Lock 21 gpio_set_pin_output(A14); // Num Lock
22 setPinOutput(A15); // Scroll Lock 22 gpio_set_pin_output(A15); // Scroll Lock
23 setPinOutput(B3); // Caps Lock 23 gpio_set_pin_output(B3); // Caps Lock
24} 24}
25 25
26bool led_update_kb(led_t led_state) { 26bool led_update_kb(led_t led_state) {
27 bool res = led_update_user(led_state); 27 bool res = led_update_user(led_state);
28 if (res) { 28 if (res) {
29 writePin(A14, !led_state.num_lock); 29 gpio_write_pin(A14, !led_state.num_lock);
30 writePin(A15, !led_state.scroll_lock); 30 gpio_write_pin(A15, !led_state.scroll_lock);
31 writePin(B3, !led_state.caps_lock); 31 gpio_write_pin(B3, !led_state.caps_lock);
32 } 32 }
33 33
34 return res; 34 return res;
diff --git a/keyboards/rookiebwoy/neopad/rev1/rev1.c b/keyboards/rookiebwoy/neopad/rev1/rev1.c
index c8216f4e70..3b527794c0 100755
--- a/keyboards/rookiebwoy/neopad/rev1/rev1.c
+++ b/keyboards/rookiebwoy/neopad/rev1/rev1.c
@@ -17,8 +17,8 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs 19 // Set LED IO as outputs
20 setPinOutput(LED_00); 20 gpio_set_pin_output(LED_00);
21 setPinOutput(LED_01); 21 gpio_set_pin_output(LED_01);
22 keyboard_pre_init_user(); 22 keyboard_pre_init_user();
23} 23}
24 24
@@ -27,8 +27,8 @@ bool shutdown_kb(bool jump_to_bootloader) {
27 return false; 27 return false;
28 } 28 }
29 // Shutdown LEDs 29 // Shutdown LEDs
30 writePinLow(LED_00); 30 gpio_write_pin_low(LED_00);
31 writePinLow(LED_01); 31 gpio_write_pin_low(LED_01);
32 return true; 32 return true;
33} 33}
34 34
@@ -37,8 +37,8 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
37 37
38 // Layer LEDs act as binary indication of current layer 38 // Layer LEDs act as binary indication of current layer
39 uint8_t layer = get_highest_layer(state); 39 uint8_t layer = get_highest_layer(state);
40 writePin(LED_00, layer & 0b1); 40 gpio_write_pin(LED_00, layer & 0b1);
41 writePin(LED_01, (layer >> 1) & 0b1); 41 gpio_write_pin(LED_01, (layer >> 1) & 0b1);
42 return state; 42 return state;
43} 43}
44 44
@@ -51,11 +51,11 @@ void matrix_init_kb(void) {
51 // runs once when the firmware starts up 51 // runs once when the firmware starts up
52 uint8_t led_delay_ms = 80; 52 uint8_t led_delay_ms = 80;
53 for (int i = 0; i < 2; i++) { 53 for (int i = 0; i < 2; i++) {
54 writePinHigh(LED_00); 54 gpio_write_pin_high(LED_00);
55 writePinHigh(LED_01); 55 gpio_write_pin_high(LED_01);
56 wait_ms(led_delay_ms); 56 wait_ms(led_delay_ms);
57 writePinLow(LED_00); 57 gpio_write_pin_low(LED_00);
58 writePinLow(LED_01); 58 gpio_write_pin_low(LED_01);
59 if (i < 1) { 59 if (i < 1) {
60 wait_ms(led_delay_ms); 60 wait_ms(led_delay_ms);
61 } 61 }
diff --git a/keyboards/rubi/rubi.c b/keyboards/rubi/rubi.c
index b125ff34a5..89bf9caa6d 100644
--- a/keyboards/rubi/rubi.c
+++ b/keyboards/rubi/rubi.c
@@ -68,7 +68,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
68bool led_update_kb(led_t led_state) { 68bool led_update_kb(led_t led_state) {
69 bool res = led_update_user(led_state); 69 bool res = led_update_user(led_state);
70 if (res) { 70 if (res) {
71 writePin(C6, led_state.num_lock); 71 gpio_write_pin(C6, led_state.num_lock);
72 } 72 }
73 return true; 73 return true;
74} 74}
diff --git a/keyboards/ryanskidmore/rskeys100/matrix.c b/keyboards/ryanskidmore/rskeys100/matrix.c
index 2ab9eafd7f..53ad18ee48 100644
--- a/keyboards/ryanskidmore/rskeys100/matrix.c
+++ b/keyboards/ryanskidmore/rskeys100/matrix.c
@@ -30,16 +30,16 @@ static void shift_out_single(uint8_t value);
30static void shift_out(uint32_t value); 30static void shift_out(uint32_t value);
31 31
32void matrix_init_custom(void) { 32void matrix_init_custom(void) {
33 setPinInput(ROW_A); 33 gpio_set_pin_input(ROW_A);
34 setPinInput(ROW_B); 34 gpio_set_pin_input(ROW_B);
35 setPinInput(ROW_C); 35 gpio_set_pin_input(ROW_C);
36 setPinInput(ROW_D); 36 gpio_set_pin_input(ROW_D);
37 setPinInput(ROW_E); 37 gpio_set_pin_input(ROW_E);
38 setPinInput(ROW_F); 38 gpio_set_pin_input(ROW_F);
39 39
40 setPinOutput(SHR_DATA); 40 gpio_set_pin_output(SHR_DATA);
41 setPinOutput(SHR_LATCH); 41 gpio_set_pin_output(SHR_LATCH);
42 setPinOutput(SHR_CLOCK); 42 gpio_set_pin_output(SHR_CLOCK);
43} 43}
44 44
45bool matrix_scan_custom(matrix_row_t current_matrix[]) { 45bool matrix_scan_custom(matrix_row_t current_matrix[]) {
@@ -63,12 +63,12 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
63} 63}
64 64
65static uint8_t read_rows(void) { 65static uint8_t read_rows(void) {
66 return (readPin(ROW_F) << 5) 66 return (gpio_read_pin(ROW_F) << 5)
67 | (readPin(ROW_E) << 4) 67 | (gpio_read_pin(ROW_E) << 4)
68 | (readPin(ROW_D) << 3) 68 | (gpio_read_pin(ROW_D) << 3)
69 | (readPin(ROW_C) << 2) 69 | (gpio_read_pin(ROW_C) << 2)
70 | (readPin(ROW_B) << 1) 70 | (gpio_read_pin(ROW_B) << 1)
71 | (readPin(ROW_A) ); 71 | (gpio_read_pin(ROW_A) );
72} 72}
73 73
74static void select_col(uint8_t col) { 74static void select_col(uint8_t col) {
@@ -76,7 +76,7 @@ static void select_col(uint8_t col) {
76} 76}
77 77
78static void shift_out(uint32_t value) { 78static void shift_out(uint32_t value) {
79 writePinLow(SHR_LATCH); 79 gpio_write_pin_low(SHR_LATCH);
80 uint8_t first_byte = (value >> 16) & 0xFF; 80 uint8_t first_byte = (value >> 16) & 0xFF;
81 uint8_t second_byte = (value >> 8) & 0xFF; 81 uint8_t second_byte = (value >> 8) & 0xFF;
82 uint8_t third_byte = (uint8_t)(value & 0xFF); 82 uint8_t third_byte = (uint8_t)(value & 0xFF);
@@ -84,7 +84,7 @@ static void shift_out(uint32_t value) {
84 shift_out_single(first_byte); 84 shift_out_single(first_byte);
85 shift_out_single(second_byte); 85 shift_out_single(second_byte);
86 shift_out_single(third_byte); 86 shift_out_single(third_byte);
87 writePinHigh(SHR_LATCH); 87 gpio_write_pin_high(SHR_LATCH);
88 /* We delay here to prevent multiple consecutive keys being triggered with a single switch press */ 88 /* We delay here to prevent multiple consecutive keys being triggered with a single switch press */
89 _delay_us(10); 89 _delay_us(10);
90} 90}
@@ -92,9 +92,9 @@ static void shift_out(uint32_t value) {
92static void shift_out_single(uint8_t value) { 92static void shift_out_single(uint8_t value) {
93 for (uint8_t i = 0; i < 8; i++) { 93 for (uint8_t i = 0; i < 8; i++) {
94 if (value & 0b10000000) { 94 if (value & 0b10000000) {
95 writePinHigh(SHR_DATA); 95 gpio_write_pin_high(SHR_DATA);
96 } else { 96 } else {
97 writePinLow(SHR_DATA); 97 gpio_write_pin_low(SHR_DATA);
98 } 98 }
99 99
100 shift_pulse(); 100 shift_pulse();
@@ -103,6 +103,6 @@ static void shift_out_single(uint8_t value) {
103} 103}
104 104
105static inline void shift_pulse(void) { 105static inline void shift_pulse(void) {
106 writePinHigh(SHR_CLOCK); 106 gpio_write_pin_high(SHR_CLOCK);
107 writePinLow(SHR_CLOCK); 107 gpio_write_pin_low(SHR_CLOCK);
108} \ No newline at end of file 108} \ No newline at end of file
diff --git a/keyboards/sekigon/grs_70ec/ec_switch_matrix.c b/keyboards/sekigon/grs_70ec/ec_switch_matrix.c
index 9c474695a1..0583da79d7 100644
--- a/keyboards/sekigon/grs_70ec/ec_switch_matrix.c
+++ b/keyboards/sekigon/grs_70ec/ec_switch_matrix.c
@@ -29,35 +29,35 @@ _Static_assert(sizeof(mux_sel_pins) == 3, "invalid MUX_SEL_PINS");
29static ecsm_config_t config; 29static ecsm_config_t config;
30static uint16_t ecsm_sw_value[MATRIX_ROWS][MATRIX_COLS]; 30static uint16_t ecsm_sw_value[MATRIX_ROWS][MATRIX_COLS];
31 31
32static inline void discharge_capacitor(void) { setPinOutput(DISCHARGE_PIN); } 32static inline void discharge_capacitor(void) { gpio_set_pin_output(DISCHARGE_PIN); }
33static inline void charge_capacitor(uint8_t row) { 33static inline void charge_capacitor(uint8_t row) {
34 setPinInput(DISCHARGE_PIN); 34 gpio_set_pin_input(DISCHARGE_PIN);
35 writePinHigh(row_pins[row]); 35 gpio_write_pin_high(row_pins[row]);
36} 36}
37 37
38static inline void clear_all_row_pins(void) { 38static inline void clear_all_row_pins(void) {
39 for (int row = 0; row < sizeof(row_pins); row++) { 39 for (int row = 0; row < sizeof(row_pins); row++) {
40 writePinLow(row_pins[row]); 40 gpio_write_pin_low(row_pins[row]);
41 } 41 }
42} 42}
43 43
44static inline void init_mux_sel(void) { 44static inline void init_mux_sel(void) {
45 for (int idx = 0; idx < sizeof(mux_sel_pins); idx++) { 45 for (int idx = 0; idx < sizeof(mux_sel_pins); idx++) {
46 setPinOutput(mux_sel_pins[idx]); 46 gpio_set_pin_output(mux_sel_pins[idx]);
47 } 47 }
48} 48}
49 49
50static inline void select_mux(uint8_t col) { 50static inline void select_mux(uint8_t col) {
51 uint8_t ch = col_channels[col]; 51 uint8_t ch = col_channels[col];
52 writePin(mux_sel_pins[0], ch & 1); 52 gpio_write_pin(mux_sel_pins[0], ch & 1);
53 writePin(mux_sel_pins[1], ch & 2); 53 gpio_write_pin(mux_sel_pins[1], ch & 2);
54 writePin(mux_sel_pins[2], ch & 4); 54 gpio_write_pin(mux_sel_pins[2], ch & 4);
55} 55}
56 56
57static inline void init_row(void) { 57static inline void init_row(void) {
58 for (int idx = 0; idx < sizeof(row_pins); idx++) { 58 for (int idx = 0; idx < sizeof(row_pins); idx++) {
59 setPinOutput(row_pins[idx]); 59 gpio_set_pin_output(row_pins[idx]);
60 writePinLow(row_pins[idx]); 60 gpio_write_pin_low(row_pins[idx]);
61 } 61 }
62} 62}
63 63
@@ -67,8 +67,8 @@ int ecsm_init(ecsm_config_t const* const ecsm_config) {
67 config = *ecsm_config; 67 config = *ecsm_config;
68 68
69 // initialize discharge pin as discharge mode 69 // initialize discharge pin as discharge mode
70 writePinLow(DISCHARGE_PIN); 70 gpio_write_pin_low(DISCHARGE_PIN);
71 setPinOutput(DISCHARGE_PIN); 71 gpio_set_pin_output(DISCHARGE_PIN);
72 72
73 // set analog reference 73 // set analog reference
74 analogReference(ADC_REF_POWER); 74 analogReference(ADC_REF_POWER);
@@ -80,7 +80,7 @@ int ecsm_init(ecsm_config_t const* const ecsm_config) {
80 init_mux_sel(); 80 init_mux_sel();
81 81
82 // set discharge pin to charge mode 82 // set discharge pin to charge mode
83 setPinInput(DISCHARGE_PIN); 83 gpio_set_pin_input(DISCHARGE_PIN);
84 84
85 return 0; 85 return 0;
86} 86}
diff --git a/keyboards/sekigon/grs_70ec/grs_70ec.c b/keyboards/sekigon/grs_70ec/grs_70ec.c
index e855a80dcf..9f20e9784a 100644
--- a/keyboards/sekigon/grs_70ec/grs_70ec.c
+++ b/keyboards/sekigon/grs_70ec/grs_70ec.c
@@ -17,11 +17,11 @@
17#include "grs_70ec.h" 17#include "grs_70ec.h"
18 18
19void led_on(void) { 19void led_on(void) {
20 setPinOutput(D2); 20 gpio_set_pin_output(D2);
21 writePinHigh(D2); 21 gpio_write_pin_high(D2);
22} 22}
23 23
24void led_off(void) { writePinLow(D2); } 24void led_off(void) { gpio_write_pin_low(D2); }
25 25
26void keyboard_post_init_kb(void) { 26void keyboard_post_init_kb(void) {
27 led_on(); 27 led_on();
@@ -31,8 +31,8 @@ void keyboard_post_init_kb(void) {
31 31
32void keyboard_pre_init_kb(void) { 32void keyboard_pre_init_kb(void) {
33 // Turn on extern circuit 33 // Turn on extern circuit
34 setPinOutput(F7); 34 gpio_set_pin_output(F7);
35 writePinHigh(F7); 35 gpio_write_pin_high(F7);
36 36
37 keyboard_pre_init_user(); 37 keyboard_pre_init_user();
38} 38}
diff --git a/keyboards/sergiopoverony/creator_pro/creator_pro.c b/keyboards/sergiopoverony/creator_pro/creator_pro.c
index 55c0497df2..acb99fdfc7 100644
--- a/keyboards/sergiopoverony/creator_pro/creator_pro.c
+++ b/keyboards/sergiopoverony/creator_pro/creator_pro.c
@@ -19,15 +19,15 @@
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 matrix_init_user(); 20 matrix_init_user();
21/* led pins */ 21/* led pins */
22 setPinOutput(RED_LED); 22 gpio_set_pin_output(RED_LED);
23 setPinOutput(BLUE_LED); 23 gpio_set_pin_output(BLUE_LED);
24 setPinOutput(GREEN_LED); 24 gpio_set_pin_output(GREEN_LED);
25} 25}
26void turn_off_leds(void) { 26void turn_off_leds(void) {
27 writePinLow(RED_LED); 27 gpio_write_pin_low(RED_LED);
28 writePinLow(BLUE_LED); 28 gpio_write_pin_low(BLUE_LED);
29 writePinLow(GREEN_LED); 29 gpio_write_pin_low(GREEN_LED);
30} 30}
31void turn_on_led(pin_t pin) { 31void turn_on_led(pin_t pin) {
32 writePinHigh(pin); 32 gpio_write_pin_high(pin);
33} 33}
diff --git a/keyboards/skyloong/gk61/pro/pro.c b/keyboards/skyloong/gk61/pro/pro.c
index 06d9ce721d..49841b2ee5 100644
--- a/keyboards/skyloong/gk61/pro/pro.c
+++ b/keyboards/skyloong/gk61/pro/pro.c
@@ -213,14 +213,14 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
213 213
214void suspend_power_down_kb() { 214void suspend_power_down_kb() {
215# ifdef RGB_MATRIX_ENABLE 215# ifdef RGB_MATRIX_ENABLE
216 writePinLow(IS31FL3743A_SDB_PIN); 216 gpio_write_pin_low(IS31FL3743A_SDB_PIN);
217# endif 217# endif
218 suspend_power_down_user(); 218 suspend_power_down_user();
219} 219}
220 220
221void suspend_wakeup_init_kb() { 221void suspend_wakeup_init_kb() {
222# ifdef RGB_MATRIX_ENABLE 222# ifdef RGB_MATRIX_ENABLE
223 writePinHigh(IS31FL3743A_SDB_PIN); 223 gpio_write_pin_high(IS31FL3743A_SDB_PIN);
224# endif 224# endif
225 suspend_wakeup_init_user(); 225 suspend_wakeup_init_user();
226} 226}
diff --git a/keyboards/skyloong/gk61/pro_48/pro_48.c b/keyboards/skyloong/gk61/pro_48/pro_48.c
index c5758ffcf4..ff49f5d22f 100644
--- a/keyboards/skyloong/gk61/pro_48/pro_48.c
+++ b/keyboards/skyloong/gk61/pro_48/pro_48.c
@@ -149,12 +149,12 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
149 149
150 150
151void suspend_power_down_kb(void) { 151void suspend_power_down_kb(void) {
152 writePinLow(IS31FL3743A_SDB_PIN); 152 gpio_write_pin_low(IS31FL3743A_SDB_PIN);
153 suspend_power_down_user(); 153 suspend_power_down_user();
154} 154}
155 155
156void suspend_wakeup_init_kb(void) { 156void suspend_wakeup_init_kb(void) {
157 writePinHigh(IS31FL3743A_SDB_PIN); 157 gpio_write_pin_high(IS31FL3743A_SDB_PIN);
158 suspend_wakeup_init_user(); 158 suspend_wakeup_init_user();
159} 159}
160#endif 160#endif
diff --git a/keyboards/skyloong/gk61/v1/v1.c b/keyboards/skyloong/gk61/v1/v1.c
index 01e6b6c6ae..0e8b7691c3 100644
--- a/keyboards/skyloong/gk61/v1/v1.c
+++ b/keyboards/skyloong/gk61/v1/v1.c
@@ -102,13 +102,13 @@ const snled27351_led_t PROGMEM g_snled27351_leds[SNLED27351_LED_COUNT] = {
102#endif // RGB_MATRIX_ENABLE 102#endif // RGB_MATRIX_ENABLE
103 103
104void suspend_power_down_kb() { 104void suspend_power_down_kb() {
105 writePinLow(SNLED27351_SDB_PIN); 105 gpio_write_pin_low(SNLED27351_SDB_PIN);
106 106
107 suspend_power_down_user(); 107 suspend_power_down_user();
108} 108}
109 109
110void suspend_wakeup_init_kb() { 110void suspend_wakeup_init_kb() {
111 writePinHigh(SNLED27351_SDB_PIN); 111 gpio_write_pin_high(SNLED27351_SDB_PIN);
112 112
113 suspend_wakeup_init_user(); 113 suspend_wakeup_init_user();
114} 114}
diff --git a/keyboards/smithrune/iron165r2/iron165r2.c b/keyboards/smithrune/iron165r2/iron165r2.c
index 6f1606f89d..428494f408 100644
--- a/keyboards/smithrune/iron165r2/iron165r2.c
+++ b/keyboards/smithrune/iron165r2/iron165r2.c
@@ -17,8 +17,8 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void board_init(void) { 19void board_init(void) {
20 setPinInput(B6); 20 gpio_set_pin_input(B6);
21 setPinInput(B7); 21 gpio_set_pin_input(B7);
22#if defined (LINE_RGBS) 22#if defined (LINE_RGBS)
23 rgblight_set_effect_range(0,16); 23 rgblight_set_effect_range(0,16);
24#elif defined (RUNE_RGBS) 24#elif defined (RUNE_RGBS)
@@ -30,6 +30,6 @@ void board_init(void) {
30 30
31bool led_update_kb(led_t led_state) { 31bool led_update_kb(led_t led_state) {
32 bool res = led_update_user(led_state); 32 bool res = led_update_user(led_state);
33 if(res) writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); 33 if(res) gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
34 return res; 34 return res;
35} 35}
diff --git a/keyboards/sneakbox/aliceclone/aliceclone.c b/keyboards/sneakbox/aliceclone/aliceclone.c
index 9ddc198db8..74d19e515c 100644
--- a/keyboards/sneakbox/aliceclone/aliceclone.c
+++ b/keyboards/sneakbox/aliceclone/aliceclone.c
@@ -18,9 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "quantum.h" 18#include "quantum.h"
19 19
20void keyboard_pre_init_kb(void) { 20void keyboard_pre_init_kb(void) {
21 setPinOutput(D7); 21 gpio_set_pin_output(D7);
22 setPinOutput(D6); 22 gpio_set_pin_output(D6);
23 setPinOutput(D4); 23 gpio_set_pin_output(D4);
24 24
25 keyboard_pre_init_user(); 25 keyboard_pre_init_user();
26} 26}
@@ -28,9 +28,9 @@ void keyboard_pre_init_kb(void) {
28bool led_update_kb(led_t led_state) { 28bool led_update_kb(led_t led_state) {
29 bool res = led_update_user(led_state); 29 bool res = led_update_user(led_state);
30 if(res) { 30 if(res) {
31 writePin(D7, led_state.num_lock); 31 gpio_write_pin(D7, led_state.num_lock);
32 writePin(D6, led_state.caps_lock); 32 gpio_write_pin(D6, led_state.caps_lock);
33 writePin(D4, led_state.scroll_lock); 33 gpio_write_pin(D4, led_state.scroll_lock);
34 } 34 }
35 return res; 35 return res;
36} 36}
diff --git a/keyboards/snes_macropad/matrix.c b/keyboards/snes_macropad/matrix.c
index 28d036aca9..af7e3db951 100644
--- a/keyboards/snes_macropad/matrix.c
+++ b/keyboards/snes_macropad/matrix.c
@@ -36,48 +36,48 @@ static const int kbd_pin_map[] = {
36 36
37void matrix_init_custom(void) { 37void matrix_init_custom(void) {
38 // init snes controller 38 // init snes controller
39 setPinInputHigh(SNES_D0); 39 gpio_set_pin_input_high(SNES_D0);
40 // todo: look into protocol for other strange snes controllers that use D1 and IO 40 // todo: look into protocol for other strange snes controllers that use D1 and IO
41 // setPinInputHigh(SNES_D1); 41 // gpio_set_pin_input_high(SNES_D1);
42 // setPinInputHigh(SNES_IO); 42 // gpio_set_pin_input_high(SNES_IO);
43 setPinOutput(SNES_CLOCK); 43 gpio_set_pin_output(SNES_CLOCK);
44 setPinOutput(SNES_LATCH); 44 gpio_set_pin_output(SNES_LATCH);
45 writePinLow(SNES_CLOCK); 45 gpio_write_pin_low(SNES_CLOCK);
46 writePinLow(SNES_LATCH); 46 gpio_write_pin_low(SNES_LATCH);
47 47
48 // init rows 48 // init rows
49 setPinOutput(KBD_ROW0); 49 gpio_set_pin_output(KBD_ROW0);
50 setPinOutput(KBD_ROW1); 50 gpio_set_pin_output(KBD_ROW1);
51 setPinOutput(KBD_ROW2); 51 gpio_set_pin_output(KBD_ROW2);
52 writePinHigh(KBD_ROW0); 52 gpio_write_pin_high(KBD_ROW0);
53 writePinHigh(KBD_ROW1); 53 gpio_write_pin_high(KBD_ROW1);
54 writePinHigh(KBD_ROW2); 54 gpio_write_pin_high(KBD_ROW2);
55 55
56 // init columns 56 // init columns
57 setPinInputHigh(KBD_COL0); 57 gpio_set_pin_input_high(KBD_COL0);
58 setPinInputHigh(KBD_COL1); 58 gpio_set_pin_input_high(KBD_COL1);
59 setPinInputHigh(KBD_COL2); 59 gpio_set_pin_input_high(KBD_COL2);
60 setPinInputHigh(KBD_COL3); 60 gpio_set_pin_input_high(KBD_COL3);
61} 61}
62 62
63static matrix_row_t readRow(size_t row, int setupDelay) { 63static matrix_row_t readRow(size_t row, int setupDelay) {
64 const int pin = kbd_pin_map[row]; 64 const int pin = kbd_pin_map[row];
65 65
66 // select the row 66 // select the row
67 setPinOutput(pin); 67 gpio_set_pin_output(pin);
68 writePinLow(pin); 68 gpio_write_pin_low(pin);
69 wait_us(setupDelay); 69 wait_us(setupDelay);
70 70
71 // read the column data 71 // read the column data
72 const matrix_row_t ret = 72 const matrix_row_t ret =
73 (readPin(KBD_COL0) ? 0 : 1 << 0) 73 (gpio_read_pin(KBD_COL0) ? 0 : 1 << 0)
74 | (readPin(KBD_COL1) ? 0 : 1 << 1) 74 | (gpio_read_pin(KBD_COL1) ? 0 : 1 << 1)
75 | (readPin(KBD_COL2) ? 0 : 1 << 2) 75 | (gpio_read_pin(KBD_COL2) ? 0 : 1 << 2)
76 | (readPin(KBD_COL3) ? 0 : 1 << 3); 76 | (gpio_read_pin(KBD_COL3) ? 0 : 1 << 3);
77 77
78 // deselect the row 78 // deselect the row
79 setPinOutput(pin); 79 gpio_set_pin_output(pin);
80 writePinHigh(pin); 80 gpio_write_pin_high(pin);
81 81
82 return ret; 82 return ret;
83} 83}
@@ -103,7 +103,7 @@ static matrix_row_t getBits(uint16_t value, size_t bit0, size_t bit1, size_t bit
103static void readSnesController(matrix_row_t current_matrix[]) { 103static void readSnesController(matrix_row_t current_matrix[]) {
104 uint16_t controller = 0; 104 uint16_t controller = 0;
105 105
106 writePinHigh(SNES_LATCH); 106 gpio_write_pin_high(SNES_LATCH);
107 107
108 for (size_t bit = 0; bit < SNES_DATA_BITS; ++bit) { 108 for (size_t bit = 0; bit < SNES_DATA_BITS; ++bit) {
109 // Wait for shift register to setup the data line 109 // Wait for shift register to setup the data line
@@ -111,16 +111,16 @@ static void readSnesController(matrix_row_t current_matrix[]) {
111 111
112 // Shift accumulated data and read data pin 112 // Shift accumulated data and read data pin
113 controller <<= 1; 113 controller <<= 1;
114 controller |= readPin(SNES_D0) ? 0 : 1; 114 controller |= gpio_read_pin(SNES_D0) ? 0 : 1;
115 // todo: maybe read D1 and IO here too 115 // todo: maybe read D1 and IO here too
116 116
117 // Shift next bit in 117 // Shift next bit in
118 writePinHigh(SNES_CLOCK); 118 gpio_write_pin_high(SNES_CLOCK);
119 wait_us(SNES_CLOCK_PULSE_DURATION); 119 wait_us(SNES_CLOCK_PULSE_DURATION);
120 writePinLow(SNES_CLOCK); 120 gpio_write_pin_low(SNES_CLOCK);
121 } 121 }
122 122
123 writePinLow(SNES_LATCH); 123 gpio_write_pin_low(SNES_LATCH);
124 124
125 controller >>= 4; 125 controller >>= 4;
126 126
diff --git a/keyboards/splitkb/aurora/helix/rev1/rev1.c b/keyboards/splitkb/aurora/helix/rev1/rev1.c
index da24934eef..0a478a5c73 100644
--- a/keyboards/splitkb/aurora/helix/rev1/rev1.c
+++ b/keyboards/splitkb/aurora/helix/rev1/rev1.c
@@ -24,8 +24,8 @@ static enum { UNKNOWN, LEFT, RIGHT } hand_side = UNKNOWN;
24 if (hand_side == UNKNOWN) { 24 if (hand_side == UNKNOWN) {
25 #if defined(SPLIT_HAND_PIN) 25 #if defined(SPLIT_HAND_PIN)
26 // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand 26 // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand
27 setPinInput(SPLIT_HAND_PIN); 27 gpio_set_pin_input(SPLIT_HAND_PIN);
28 hand_side = readPin(SPLIT_HAND_PIN) ? LEFT : RIGHT; 28 hand_side = gpio_read_pin(SPLIT_HAND_PIN) ? LEFT : RIGHT;
29 return (hand_side == LEFT); 29 return (hand_side == LEFT);
30 #endif 30 #endif
31 hand_side = is_keyboard_master() ? LEFT : RIGHT; 31 hand_side = is_keyboard_master() ? LEFT : RIGHT;
diff --git a/keyboards/sthlmkb/lagom/matrix.c b/keyboards/sthlmkb/lagom/matrix.c
index 6a16722ad0..177cda2354 100644
--- a/keyboards/sthlmkb/lagom/matrix.c
+++ b/keyboards/sthlmkb/lagom/matrix.c
@@ -27,17 +27,17 @@ static const uint8_t col_pins[MATRIX_MUX_COLS] = MATRIX_COL_MUX_PINS;
27static void init_pins(void) { 27static void init_pins(void) {
28 // Set cols to outputs, low 28 // Set cols to outputs, low
29 for (uint8_t pin = 0; pin < MATRIX_MUX_COLS; pin++) { 29 for (uint8_t pin = 0; pin < MATRIX_MUX_COLS; pin++) {
30 setPinOutput(col_pins[pin]); 30 gpio_set_pin_output(col_pins[pin]);
31 } 31 }
32 32
33 // Unselect cols 33 // Unselect cols
34 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) { 34 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) {
35 writePinLow(col_pins[bit]); 35 gpio_write_pin_low(col_pins[bit]);
36 } 36 }
37 37
38 // Set rows to input, pullup 38 // Set rows to input, pullup
39 for (uint8_t pin = 0; pin < MATRIX_ROWS; pin++) { 39 for (uint8_t pin = 0; pin < MATRIX_ROWS; pin++) {
40 setPinInputHigh(row_pins[pin]); 40 gpio_set_pin_input_high(row_pins[pin]);
41 } 41 }
42} 42}
43 43
@@ -45,7 +45,7 @@ static void select_col(uint8_t col)
45{ 45{
46 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) { 46 for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) {
47 uint8_t state = (col & (0b1 << bit)) >> bit; 47 uint8_t state = (col & (0b1 << bit)) >> bit;
48 writePin(col_pins[bit], state); 48 gpio_write_pin(col_pins[bit], state);
49 } 49 }
50} 50}
51 51
@@ -60,7 +60,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
60 { 60 {
61 matrix_row_t last_row_value = current_matrix[row_index]; 61 matrix_row_t last_row_value = current_matrix[row_index];
62 62
63 if (!readPin(row_pins[row_index])) 63 if (!gpio_read_pin(row_pins[row_index]))
64 { 64 {
65 current_matrix[row_index] |= (COL_SHIFTER << current_col); 65 current_matrix[row_index] |= (COL_SHIFTER << current_col);
66 } 66 }
diff --git a/keyboards/strech/soulstone/soulstone.c b/keyboards/strech/soulstone/soulstone.c
index 4a951aff9d..e6457a5271 100644
--- a/keyboards/strech/soulstone/soulstone.c
+++ b/keyboards/strech/soulstone/soulstone.c
@@ -18,13 +18,13 @@
18 18
19// Prepare layer indicator LED 19// Prepare layer indicator LED
20void keyboard_post_init_kb(void) { 20void keyboard_post_init_kb(void) {
21 setPinOutput(LAYER_INDICATOR_LED_PIN); 21 gpio_set_pin_output(LAYER_INDICATOR_LED_PIN);
22 writePinLow(LAYER_INDICATOR_LED_PIN); 22 gpio_write_pin_low(LAYER_INDICATOR_LED_PIN);
23 keyboard_post_init_user(); 23 keyboard_post_init_user();
24} 24}
25 25
26// Function for layer indicator LED 26// Function for layer indicator LED
27layer_state_t layer_state_set_kb(layer_state_t state) { 27layer_state_t layer_state_set_kb(layer_state_t state) {
28 writePin(LAYER_INDICATOR_LED_PIN, !layer_state_cmp(state, 0)); 28 gpio_write_pin(LAYER_INDICATOR_LED_PIN, !layer_state_cmp(state, 0));
29 return layer_state_set_user(state); 29 return layer_state_set_user(state);
30} 30}
diff --git a/keyboards/switchplate/southpaw_65/southpaw_65.c b/keyboards/switchplate/southpaw_65/southpaw_65.c
index d75c9b101d..dfe3665928 100644
--- a/keyboards/switchplate/southpaw_65/southpaw_65.c
+++ b/keyboards/switchplate/southpaw_65/southpaw_65.c
@@ -16,7 +16,7 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 setPinOutput(B6); 19 gpio_set_pin_output(B6);
20 20
21 keyboard_pre_init_user(); 21 keyboard_pre_init_user();
22} 22}
@@ -24,7 +24,7 @@ void keyboard_pre_init_kb(void) {
24bool led_update_kb(led_t led_state) { 24bool led_update_kb(led_t led_state) {
25 bool res = led_update_user(led_state); 25 bool res = led_update_user(led_state);
26 if(res) { 26 if(res) {
27 writePin(B6, !led_state.caps_lock); 27 gpio_write_pin(B6, !led_state.caps_lock);
28 } 28 }
29 return res; 29 return res;
30} 30}
diff --git a/keyboards/switchplate/southpaw_fullsize/southpaw_fullsize.c b/keyboards/switchplate/southpaw_fullsize/southpaw_fullsize.c
index f631e1d95a..3d77e8722e 100644
--- a/keyboards/switchplate/southpaw_fullsize/southpaw_fullsize.c
+++ b/keyboards/switchplate/southpaw_fullsize/southpaw_fullsize.c
@@ -30,9 +30,9 @@ void matrix_init_kb(void) {
30 // runs once when the firmware starts up 30 // runs once when the firmware starts up
31 31
32 // D3 Numlock, D4 Capslock, D5 Scrlock 32 // D3 Numlock, D4 Capslock, D5 Scrlock
33 setPinOutput(INDICATOR_NUM); 33 gpio_set_pin_output(INDICATOR_NUM);
34 setPinOutput(INDICATOR_CAPS); 34 gpio_set_pin_output(INDICATOR_CAPS);
35 setPinOutput(INDICATOR_SCR); 35 gpio_set_pin_output(INDICATOR_SCR);
36 36
37 matrix_init_user(); 37 matrix_init_user();
38} 38}
@@ -42,9 +42,9 @@ bool led_update_kb(led_t led_state) {
42 bool res = led_update_user(led_state); 42 bool res = led_update_user(led_state);
43 if (res) 43 if (res)
44 { 44 {
45 writePin(INDICATOR_NUM, !led_state.num_lock); 45 gpio_write_pin(INDICATOR_NUM, !led_state.num_lock);
46 writePin(INDICATOR_CAPS, !led_state.caps_lock); 46 gpio_write_pin(INDICATOR_CAPS, !led_state.caps_lock);
47 writePin(INDICATOR_SCR, !led_state.scroll_lock); 47 gpio_write_pin(INDICATOR_SCR, !led_state.scroll_lock);
48 } 48 }
49 return res; 49 return res;
50} 50}
diff --git a/keyboards/team0110/p1800fl/p1800fl.c b/keyboards/team0110/p1800fl/p1800fl.c
index c82507ec27..9f47b8a5c4 100644
--- a/keyboards/team0110/p1800fl/p1800fl.c
+++ b/keyboards/team0110/p1800fl/p1800fl.c
@@ -19,9 +19,9 @@
19bool led_update_kb(led_t led_state) { 19bool led_update_kb(led_t led_state) {
20 bool res = led_update_user(led_state); 20 bool res = led_update_user(led_state);
21 if(res) { 21 if(res) {
22 writePin(D3, led_state.num_lock); 22 gpio_write_pin(D3, led_state.num_lock);
23 writePin(D5, led_state.caps_lock); 23 gpio_write_pin(D5, led_state.caps_lock);
24 writePin(C6, led_state.scroll_lock); 24 gpio_write_pin(C6, led_state.scroll_lock);
25 } 25 }
26 return res; 26 return res;
27} 27}
diff --git a/keyboards/technika/technika.c b/keyboards/technika/technika.c
index cc60debe9f..65dc9e0d31 100644
--- a/keyboards/technika/technika.c
+++ b/keyboards/technika/technika.c
@@ -18,9 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "quantum.h" 18#include "quantum.h"
19 19
20void keyboard_pre_init_kb(void) { 20void keyboard_pre_init_kb(void) {
21 setPinOutput(A15); 21 gpio_set_pin_output(A15);
22 setPinOutput(B3); 22 gpio_set_pin_output(B3);
23 setPinOutput(B4); 23 gpio_set_pin_output(B4);
24 24
25 keyboard_pre_init_user(); 25 keyboard_pre_init_user();
26} 26}
diff --git a/keyboards/telophase/telophase.c b/keyboards/telophase/telophase.c
index 334cc7697b..cea18abec5 100644
--- a/keyboards/telophase/telophase.c
+++ b/keyboards/telophase/telophase.c
@@ -18,12 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "telophase.h" 18#include "telophase.h"
19 19
20void led_init(void) { 20void led_init(void) {
21 setPinOutput(D1); 21 gpio_set_pin_output(D1);
22 setPinOutput(F4); 22 gpio_set_pin_output(F4);
23 setPinOutput(F5); 23 gpio_set_pin_output(F5);
24 writePinHigh(D1); 24 gpio_write_pin_high(D1);
25 writePinHigh(F4); 25 gpio_write_pin_high(F4);
26 writePinHigh(F5); 26 gpio_write_pin_high(F5);
27} 27}
28 28
29void matrix_init_kb(void) { 29void matrix_init_kb(void) {
diff --git a/keyboards/telophase/telophase.h b/keyboards/telophase/telophase.h
index 112ba79504..52771ce071 100644
--- a/keyboards/telophase/telophase.h
+++ b/keyboards/telophase/telophase.h
@@ -19,12 +19,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20#include "quantum.h" 20#include "quantum.h"
21 21
22#define red_led_off writePinHigh(F5) 22#define red_led_off gpio_write_pin_high(F5)
23#define red_led_on writePinLow(F5) 23#define red_led_on gpio_write_pin_low(F5)
24#define blu_led_off writePinHigh(F4) 24#define blu_led_off gpio_write_pin_high(F4)
25#define blu_led_on writePinLow(F4) 25#define blu_led_on gpio_write_pin_low(F4)
26#define grn_led_off writePinHigh(D1) 26#define grn_led_off gpio_write_pin_high(D1)
27#define grn_led_on writePinLow(D1) 27#define grn_led_on gpio_write_pin_low(D1)
28 28
29#define set_led_off red_led_off; grn_led_off; blu_led_off 29#define set_led_off red_led_off; grn_led_off; blu_led_off
30#define set_led_red red_led_on; grn_led_off; blu_led_off 30#define set_led_red red_led_on; grn_led_off; blu_led_off
diff --git a/keyboards/tkc/m0lly/m0lly.c b/keyboards/tkc/m0lly/m0lly.c
index 2f76952b1f..ceb03e4543 100644
--- a/keyboards/tkc/m0lly/m0lly.c
+++ b/keyboards/tkc/m0lly/m0lly.c
@@ -17,11 +17,11 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 setPinInputHigh(D0); 20 gpio_set_pin_input_high(D0);
21 setPinInputHigh(D1); 21 gpio_set_pin_input_high(D1);
22 22
23 setPinOutput(B7); 23 gpio_set_pin_output(B7);
24 writePinHigh(B7); 24 gpio_write_pin_high(B7);
25 25
26 keyboard_pre_init_user(); 26 keyboard_pre_init_user();
27} 27}
diff --git a/keyboards/tkc/osav2/osav2.c b/keyboards/tkc/osav2/osav2.c
index 51f4ac0e04..9966046486 100644
--- a/keyboards/tkc/osav2/osav2.c
+++ b/keyboards/tkc/osav2/osav2.c
@@ -16,18 +16,18 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 setPinOutput(C7); 19 gpio_set_pin_output(C7);
20 setPinOutput(C6); 20 gpio_set_pin_output(C6);
21 setPinOutput(B6); 21 gpio_set_pin_output(B6);
22 22
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
25 25
26bool led_update_kb(led_t led_state) { 26bool led_update_kb(led_t led_state) {
27 if (led_update_user(led_state)) { 27 if (led_update_user(led_state)) {
28 writePin(C7, led_state.num_lock); 28 gpio_write_pin(C7, led_state.num_lock);
29 writePin(C6, led_state.caps_lock); 29 gpio_write_pin(C6, led_state.caps_lock);
30 writePin(B6, led_state.scroll_lock); 30 gpio_write_pin(B6, led_state.scroll_lock);
31 } 31 }
32 return true; 32 return true;
33} 33}
diff --git a/keyboards/tkc/tkc1800/tkc1800.c b/keyboards/tkc/tkc1800/tkc1800.c
index b5b4cf0887..815c1d6208 100644
--- a/keyboards/tkc/tkc1800/tkc1800.c
+++ b/keyboards/tkc/tkc1800/tkc1800.c
@@ -16,11 +16,11 @@
16#include "quantum.h" 16#include "quantum.h"
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 setPinInputHigh(D0); 19 gpio_set_pin_input_high(D0);
20 setPinInputHigh(D1); 20 gpio_set_pin_input_high(D1);
21 21
22 setPinOutput(B7); 22 gpio_set_pin_output(B7);
23 writePinHigh(B7); 23 gpio_write_pin_high(B7);
24 24
25 keyboard_pre_init_user(); 25 keyboard_pre_init_user();
26} 26}
diff --git a/keyboards/torn/matrix.c b/keyboards/torn/matrix.c
index b674f21d57..64a808534c 100644
--- a/keyboards/torn/matrix.c
+++ b/keyboards/torn/matrix.c
@@ -30,15 +30,15 @@ static const mcp23018_pin_t secondary_row_pins[MATRIX_ROWS] = SECONDARY_RO
30static const mcp23018_pin_t secondary_col_pins[SPLIT_MATRIX_COLS] = SECONDARY_COL_PINS; 30static const mcp23018_pin_t secondary_col_pins[SPLIT_MATRIX_COLS] = SECONDARY_COL_PINS;
31 31
32static void select_row(uint8_t row) { 32static void select_row(uint8_t row) {
33 setPinOutput(row_pins[row]); 33 gpio_set_pin_output(row_pins[row]);
34 writePinLow(row_pins[row]); 34 gpio_write_pin_low(row_pins[row]);
35} 35}
36 36
37static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } 37static void unselect_row(uint8_t row) { gpio_set_pin_input_high(row_pins[row]); }
38 38
39static void unselect_rows(void) { 39static void unselect_rows(void) {
40 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 40 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
41 setPinInputHigh(row_pins[x]); 41 gpio_set_pin_input_high(row_pins[x]);
42 } 42 }
43} 43}
44 44
@@ -50,7 +50,7 @@ static void select_secondary_row(uint8_t row) {
50static void init_pins(void) { 50static void init_pins(void) {
51 unselect_rows(); 51 unselect_rows();
52 for (uint8_t x = 0; x < SPLIT_MATRIX_COLS; x++) { 52 for (uint8_t x = 0; x < SPLIT_MATRIX_COLS; x++) {
53 setPinInputHigh(col_pins[x]); 53 gpio_set_pin_input_high(col_pins[x]);
54 } 54 }
55} 55}
56 56
@@ -60,7 +60,7 @@ static matrix_row_t read_cols(void) {
60 // For each col... 60 // For each col...
61 for (uint8_t col_index = 0; col_index < SPLIT_MATRIX_COLS; col_index++) { 61 for (uint8_t col_index = 0; col_index < SPLIT_MATRIX_COLS; col_index++) {
62 // Select the col pin to read (active low) 62 // Select the col pin to read (active low)
63 uint8_t pin_state = readPin(col_pins[col_index]); 63 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
64 64
65 // Populate the matrix row with the state of the col pin 65 // Populate the matrix row with the state of the col pin
66 state |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 66 state |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
diff --git a/keyboards/touchpad/matrix.c b/keyboards/touchpad/matrix.c
index 7929e0969b..afe14cf542 100644
--- a/keyboards/touchpad/matrix.c
+++ b/keyboards/touchpad/matrix.c
@@ -127,32 +127,32 @@ void matrix_init(void) {
127 i2c_init(); 127 i2c_init();
128 128
129 //Motor enable 129 //Motor enable
130 setPinOutput(E6); 130 gpio_set_pin_output(E6);
131 //Motor PWM 131 //Motor PWM
132 setPinOutput(D7); 132 gpio_set_pin_output(D7);
133 133
134 //Power LED 134 //Power LED
135 setPinOutput(B7); 135 gpio_set_pin_output(B7);
136 writePinHigh(B7); 136 gpio_write_pin_high(B7);
137 137
138 //LEDs Columns 138 //LEDs Columns
139 setPinOutput(F7); 139 gpio_set_pin_output(F7);
140 setPinOutput(F6); 140 gpio_set_pin_output(F6);
141 setPinOutput(F5); 141 gpio_set_pin_output(F5);
142 setPinOutput(F4); 142 gpio_set_pin_output(F4);
143 setPinOutput(F1); 143 gpio_set_pin_output(F1);
144 setPinOutput(F0); 144 gpio_set_pin_output(F0);
145 145
146 //LEDs Rows 146 //LEDs Rows
147 setPinOutput(D6); 147 gpio_set_pin_output(D6);
148 setPinOutput(B4); 148 gpio_set_pin_output(B4);
149 setPinOutput(B5); 149 gpio_set_pin_output(B5);
150 setPinOutput(B6); 150 gpio_set_pin_output(B6);
151 setPinOutput(C6); 151 gpio_set_pin_output(C6);
152 setPinOutput(C7); 152 gpio_set_pin_output(C7);
153 153
154 //Capacitive Interrupt 154 //Capacitive Interrupt
155 setPinInput(D2); 155 gpio_set_pin_input(D2);
156 156
157 capSetup(); 157 capSetup();
158 writeDataToTS(0x06, 0x12); //Calibrate capacitive touch IC 158 writeDataToTS(0x06, 0x12); //Calibrate capacitive touch IC
@@ -208,7 +208,7 @@ void touchClearCurrentDetections(void) {
208 208
209//Check interrupt pin 209//Check interrupt pin
210uint8_t isTouchChangeDetected(void) { 210uint8_t isTouchChangeDetected(void) {
211 return !readPin(D2); 211 return !gpio_read_pin(D2);
212} 212}
213 213
214uint8_t matrix_scan(void) { 214uint8_t matrix_scan(void) {
@@ -232,34 +232,34 @@ uint8_t matrix_scan(void) {
232 for (uint8_t c = 0; c < 6; c++) { 232 for (uint8_t c = 0; c < 6; c++) {
233 for (uint8_t r = 0; r < 6; r++) { 233 for (uint8_t r = 0; r < 6; r++) {
234 switch (r) { 234 switch (r) {
235 case 0: writePin(D6, matrix_is_on(r, c)); break; 235 case 0: gpio_write_pin(D6, matrix_is_on(r, c)); break;
236 case 1: writePin(B4, matrix_is_on(r, c)); break; 236 case 1: gpio_write_pin(B4, matrix_is_on(r, c)); break;
237 case 2: writePin(B5, matrix_is_on(r, c)); break; 237 case 2: gpio_write_pin(B5, matrix_is_on(r, c)); break;
238 case 3: writePin(B6, matrix_is_on(r, c)); break; 238 case 3: gpio_write_pin(B6, matrix_is_on(r, c)); break;
239 case 4: writePin(C6, matrix_is_on(r, c)); break; 239 case 4: gpio_write_pin(C6, matrix_is_on(r, c)); break;
240 case 5: writePin(C7, matrix_is_on(r, c)); break; 240 case 5: gpio_write_pin(C7, matrix_is_on(r, c)); break;
241 } 241 }
242 242
243 switch (c) { 243 switch (c) {
244 case 0: writePin(F5, !matrix_is_on(r, c)); break; 244 case 0: gpio_write_pin(F5, !matrix_is_on(r, c)); break;
245 case 1: writePin(F4, !matrix_is_on(r, c)); break; 245 case 1: gpio_write_pin(F4, !matrix_is_on(r, c)); break;
246 case 2: writePin(F1, !matrix_is_on(r, c)); break; 246 case 2: gpio_write_pin(F1, !matrix_is_on(r, c)); break;
247 case 3: writePin(F0, !matrix_is_on(r, c)); break; 247 case 3: gpio_write_pin(F0, !matrix_is_on(r, c)); break;
248 case 4: writePin(F6, !matrix_is_on(r, c)); break; 248 case 4: gpio_write_pin(F6, !matrix_is_on(r, c)); break;
249 case 5: writePin(F7, !matrix_is_on(r, c)); break; 249 case 5: gpio_write_pin(F7, !matrix_is_on(r, c)); break;
250 } 250 }
251 } 251 }
252 } 252 }
253 253
254 if (vibrate == VIBRATE_LENGTH) { 254 if (vibrate == VIBRATE_LENGTH) {
255 writePinHigh(E6); 255 gpio_write_pin_high(E6);
256 writePinHigh(D7); 256 gpio_write_pin_high(D7);
257 vibrate--; 257 vibrate--;
258 } else if (vibrate > 0) { 258 } else if (vibrate > 0) {
259 vibrate--; 259 vibrate--;
260 } else if (vibrate == 0) { 260 } else if (vibrate == 0) {
261 writePinLow(D7); 261 gpio_write_pin_low(D7);
262 writePinLow(E6); 262 gpio_write_pin_low(E6);
263 } 263 }
264 264
265 matrix_scan_kb(); 265 matrix_scan_kb();
diff --git a/keyboards/tr60w/tr60w.c b/keyboards/tr60w/tr60w.c
index 2bc0648241..ebf48cb1c7 100644
--- a/keyboards/tr60w/tr60w.c
+++ b/keyboards/tr60w/tr60w.c
@@ -3,9 +3,9 @@
3bool led_update_kb(led_t led_state) { 3bool led_update_kb(led_t led_state) {
4 bool runDefault = led_update_user(led_state); 4 bool runDefault = led_update_user(led_state);
5 if (runDefault) { 5 if (runDefault) {
6 writePin(B1, !led_state.num_lock); 6 gpio_write_pin(B1, !led_state.num_lock);
7 writePin(B2, !led_state.caps_lock); 7 gpio_write_pin(B2, !led_state.caps_lock);
8 writePin(B3, !led_state.scroll_lock); 8 gpio_write_pin(B3, !led_state.scroll_lock);
9 } 9 }
10 return runDefault; 10 return runDefault;
11} 11}
diff --git a/keyboards/tzarc/djinn/djinn.c b/keyboards/tzarc/djinn/djinn.c
index 8d6e2ec92e..a104710b03 100644
--- a/keyboards/tzarc/djinn/djinn.c
+++ b/keyboards/tzarc/djinn/djinn.c
@@ -46,23 +46,23 @@ void keyboard_post_init_kb(void) {
46 memset(&kb_state, 0, sizeof(kb_state)); 46 memset(&kb_state, 0, sizeof(kb_state));
47 47
48 // Turn off increased current limits 48 // Turn off increased current limits
49 setPinOutput(RGB_CURR_1500mA_OK_PIN); 49 gpio_set_pin_output(RGB_CURR_1500mA_OK_PIN);
50 writePinLow(RGB_CURR_1500mA_OK_PIN); 50 gpio_write_pin_low(RGB_CURR_1500mA_OK_PIN);
51 setPinOutput(RGB_CURR_3000mA_OK_PIN); 51 gpio_set_pin_output(RGB_CURR_3000mA_OK_PIN);
52 writePinLow(RGB_CURR_3000mA_OK_PIN); 52 gpio_write_pin_low(RGB_CURR_3000mA_OK_PIN);
53 53
54 // Turn on the RGB 54 // Turn on the RGB
55 setPinOutput(RGB_POWER_ENABLE_PIN); 55 gpio_set_pin_output(RGB_POWER_ENABLE_PIN);
56 writePinHigh(RGB_POWER_ENABLE_PIN); 56 gpio_write_pin_high(RGB_POWER_ENABLE_PIN);
57 57
58#ifdef EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN 58#ifdef EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN
59 setPinOutput(EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN); 59 gpio_set_pin_output(EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN);
60 writePinHigh(EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN); 60 gpio_write_pin_high(EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN);
61#endif // EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN 61#endif // EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN
62 62
63 // Turn on the LCD 63 // Turn on the LCD
64 setPinOutput(LCD_POWER_ENABLE_PIN); 64 gpio_set_pin_output(LCD_POWER_ENABLE_PIN);
65 writePinHigh(LCD_POWER_ENABLE_PIN); 65 gpio_write_pin_high(LCD_POWER_ENABLE_PIN);
66 66
67 // Let the LCD get some power... 67 // Let the LCD get some power...
68 wait_ms(150); 68 wait_ms(150);
@@ -148,16 +148,16 @@ void housekeeping_task_kb(void) {
148 switch (current_setting) { 148 switch (current_setting) {
149 default: 149 default:
150 case USBPD_500MA: 150 case USBPD_500MA:
151 writePinLow(RGB_CURR_1500mA_OK_PIN); 151 gpio_write_pin_low(RGB_CURR_1500mA_OK_PIN);
152 writePinLow(RGB_CURR_3000mA_OK_PIN); 152 gpio_write_pin_low(RGB_CURR_3000mA_OK_PIN);
153 break; 153 break;
154 case USBPD_1500MA: 154 case USBPD_1500MA:
155 writePinHigh(RGB_CURR_1500mA_OK_PIN); 155 gpio_write_pin_high(RGB_CURR_1500mA_OK_PIN);
156 writePinLow(RGB_CURR_3000mA_OK_PIN); 156 gpio_write_pin_low(RGB_CURR_3000mA_OK_PIN);
157 break; 157 break;
158 case USBPD_3000MA: 158 case USBPD_3000MA:
159 writePinHigh(RGB_CURR_1500mA_OK_PIN); 159 gpio_write_pin_high(RGB_CURR_1500mA_OK_PIN);
160 writePinHigh(RGB_CURR_3000mA_OK_PIN); 160 gpio_write_pin_high(RGB_CURR_3000mA_OK_PIN);
161 break; 161 break;
162 } 162 }
163#else 163#else
@@ -166,12 +166,12 @@ void housekeeping_task_kb(void) {
166 default: 166 default:
167 case USBPD_500MA: 167 case USBPD_500MA:
168 case USBPD_1500MA: 168 case USBPD_1500MA:
169 writePinLow(RGB_CURR_1500mA_OK_PIN); 169 gpio_write_pin_low(RGB_CURR_1500mA_OK_PIN);
170 writePinLow(RGB_CURR_3000mA_OK_PIN); 170 gpio_write_pin_low(RGB_CURR_3000mA_OK_PIN);
171 break; 171 break;
172 case USBPD_3000MA: 172 case USBPD_3000MA:
173 writePinHigh(RGB_CURR_1500mA_OK_PIN); 173 gpio_write_pin_high(RGB_CURR_1500mA_OK_PIN);
174 writePinLow(RGB_CURR_3000mA_OK_PIN); 174 gpio_write_pin_low(RGB_CURR_3000mA_OK_PIN);
175 break; 175 break;
176 } 176 }
177#endif 177#endif
@@ -189,7 +189,7 @@ void housekeeping_task_kb(void) {
189 // Enable/disable RGB 189 // Enable/disable RGB
190 if (peripherals_on) { 190 if (peripherals_on) {
191 // Turn on RGB 191 // Turn on RGB
192 writePinHigh(RGB_POWER_ENABLE_PIN); 192 gpio_write_pin_high(RGB_POWER_ENABLE_PIN);
193 // Modify the RGB state if different to the LCD state 193 // Modify the RGB state if different to the LCD state
194 if (rgb_matrix_is_enabled() != peripherals_on) { 194 if (rgb_matrix_is_enabled() != peripherals_on) {
195 // Wait for a small amount of time to allow the RGB capacitors to charge, before enabling RGB output 195 // Wait for a small amount of time to allow the RGB capacitors to charge, before enabling RGB output
@@ -199,7 +199,7 @@ void housekeeping_task_kb(void) {
199 } 199 }
200 } else { 200 } else {
201 // Turn off RGB 201 // Turn off RGB
202 writePinLow(RGB_POWER_ENABLE_PIN); 202 gpio_write_pin_low(RGB_POWER_ENABLE_PIN);
203 // Disable the PWM output for the RGB 203 // Disable the PWM output for the RGB
204 if (rgb_matrix_is_enabled() != peripherals_on) { 204 if (rgb_matrix_is_enabled() != peripherals_on) {
205 rgb_matrix_disable_noeeprom(); 205 rgb_matrix_disable_noeeprom();
diff --git a/keyboards/tzarc/djinn/djinn_portscan_matrix.c b/keyboards/tzarc/djinn/djinn_portscan_matrix.c
index 63f480be27..3506f3b8ac 100644
--- a/keyboards/tzarc/djinn/djinn_portscan_matrix.c
+++ b/keyboards/tzarc/djinn/djinn_portscan_matrix.c
@@ -16,7 +16,7 @@ void matrix_wait_for_pin(pin_t pin, uint8_t target_state) {
16 rtcnt_t start = chSysGetRealtimeCounterX(); 16 rtcnt_t start = chSysGetRealtimeCounterX();
17 rtcnt_t end = start + 5000; 17 rtcnt_t end = start + 5000;
18 while (chSysIsCounterWithinX(chSysGetRealtimeCounterX(), start, end)) { 18 while (chSysIsCounterWithinX(chSysGetRealtimeCounterX(), start, end)) {
19 if (readPin(pin) == target_state) { 19 if (gpio_read_pin(pin) == target_state) {
20 break; 20 break;
21 } 21 }
22 } 22 }
@@ -36,10 +36,10 @@ static void dummy_vt_callback(virtual_timer_t *vtp, void *p) {}
36 36
37void matrix_init_custom(void) { 37void matrix_init_custom(void) {
38 for (int i = 0; i < MATRIX_ROWS; ++i) { 38 for (int i = 0; i < MATRIX_ROWS; ++i) {
39 setPinInputHigh(row_pins[i]); 39 gpio_set_pin_input_high(row_pins[i]);
40 } 40 }
41 for (int i = 0; i < MATRIX_COLS; ++i) { 41 for (int i = 0; i < MATRIX_COLS; ++i) {
42 setPinInputHigh(col_pins[i]); 42 gpio_set_pin_input_high(col_pins[i]);
43 } 43 }
44 44
45 // Start a virtual timer so we'll still get periodic wakeups, now that USB SOF doesn't wake up the main loop 45 // Start a virtual timer so we'll still get periodic wakeups, now that USB SOF doesn't wake up the main loop
@@ -56,8 +56,8 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
56 pin_t curr_col_pin = col_pins[current_col]; 56 pin_t curr_col_pin = col_pins[current_col];
57 57
58 // Setup the output column pin 58 // Setup the output column pin
59 setPinOutput(curr_col_pin); 59 gpio_set_pin_output(curr_col_pin);
60 writePinLow(curr_col_pin); 60 gpio_write_pin_low(curr_col_pin);
61 matrix_wait_for_pin(curr_col_pin, 0); 61 matrix_wait_for_pin(curr_col_pin, 0);
62 62
63 // Read the row ports 63 // Read the row ports
@@ -65,7 +65,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
65 uint32_t gpio_c = palReadPort(GPIOC); 65 uint32_t gpio_c = palReadPort(GPIOC);
66 66
67 // Unselect the row pin 67 // Unselect the row pin
68 setPinInputHigh(curr_col_pin); 68 gpio_set_pin_input_high(curr_col_pin);
69 69
70 // Construct the packed bitmask for the pins 70 // Construct the packed bitmask for the pins
71 uint32_t readback = ~(((gpio_b & GPIOB_BITMASK) >> GPIOB_OFFSET) | (((gpio_c & GPIOC_BITMASK) >> GPIOC_OFFSET) << GPIOB_COUNT)); 71 uint32_t readback = ~(((gpio_b & GPIOB_BITMASK) >> GPIOB_OFFSET) | (((gpio_c & GPIOC_BITMASK) >> GPIOC_OFFSET) << GPIOB_COUNT));
@@ -98,11 +98,11 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
98void matrix_wait_for_interrupt(void) { 98void matrix_wait_for_interrupt(void) {
99 // Set up row/col pins and attach callback 99 // Set up row/col pins and attach callback
100 for (int i = 0; i < ARRAY_SIZE(col_pins); ++i) { 100 for (int i = 0; i < ARRAY_SIZE(col_pins); ++i) {
101 setPinOutput(col_pins[i]); 101 gpio_set_pin_output(col_pins[i]);
102 writePinLow(col_pins[i]); 102 gpio_write_pin_low(col_pins[i]);
103 } 103 }
104 for (int i = 0; i < ARRAY_SIZE(row_pins); ++i) { 104 for (int i = 0; i < ARRAY_SIZE(row_pins); ++i) {
105 setPinInputHigh(row_pins[i]); 105 gpio_set_pin_input_high(row_pins[i]);
106 palEnableLineEvent(row_pins[i], PAL_EVENT_MODE_BOTH_EDGES); 106 palEnableLineEvent(row_pins[i], PAL_EVENT_MODE_BOTH_EDGES);
107 } 107 }
108 108
@@ -112,11 +112,11 @@ void matrix_wait_for_interrupt(void) {
112 // Now that the interrupt has woken us up, reset all the row/col pins back to defaults 112 // Now that the interrupt has woken us up, reset all the row/col pins back to defaults
113 for (int i = 0; i < ARRAY_SIZE(row_pins); ++i) { 113 for (int i = 0; i < ARRAY_SIZE(row_pins); ++i) {
114 palDisableLineEvent(row_pins[i]); 114 palDisableLineEvent(row_pins[i]);
115 writePinHigh(row_pins[i]); 115 gpio_write_pin_high(row_pins[i]);
116 setPinInputHigh(row_pins[i]); 116 gpio_set_pin_input_high(row_pins[i]);
117 } 117 }
118 for (int i = 0; i < ARRAY_SIZE(col_pins); ++i) { 118 for (int i = 0; i < ARRAY_SIZE(col_pins); ++i) {
119 writePinHigh(col_pins[i]); 119 gpio_write_pin_high(col_pins[i]);
120 setPinInputHigh(col_pins[i]); 120 gpio_set_pin_input_high(col_pins[i]);
121 } 121 }
122} 122}
diff --git a/keyboards/tzarc/ghoul/ghoul.c b/keyboards/tzarc/ghoul/ghoul.c
index a97399110c..bbd536dfdb 100644
--- a/keyboards/tzarc/ghoul/ghoul.c
+++ b/keyboards/tzarc/ghoul/ghoul.c
@@ -6,8 +6,8 @@
6 6
7void keyboard_post_init_kb(void) { 7void keyboard_post_init_kb(void) {
8 // Enable RGB current limiter and wait for a bit before allowing RGB to continue 8 // Enable RGB current limiter and wait for a bit before allowing RGB to continue
9 setPinOutput(RGB_ENABLE_PIN); 9 gpio_set_pin_output(RGB_ENABLE_PIN);
10 writePinHigh(RGB_ENABLE_PIN); 10 gpio_write_pin_high(RGB_ENABLE_PIN);
11 wait_ms(20); 11 wait_ms(20);
12 12
13 // Offload to the user func 13 // Offload to the user func
@@ -16,12 +16,12 @@ void keyboard_post_init_kb(void) {
16 16
17void matrix_init_custom(void) { 17void matrix_init_custom(void) {
18 // SPI Matrix 18 // SPI Matrix
19 setPinOutput(SPI_MATRIX_CHIP_SELECT_PIN); 19 gpio_set_pin_output(SPI_MATRIX_CHIP_SELECT_PIN);
20 writePinHigh(SPI_MATRIX_CHIP_SELECT_PIN); 20 gpio_write_pin_high(SPI_MATRIX_CHIP_SELECT_PIN);
21 spi_init(); 21 spi_init();
22 22
23 // Encoder pushbutton 23 // Encoder pushbutton
24 setPinInputLow(ENCODER_PUSHBUTTON_PIN); 24 gpio_set_pin_input_low(ENCODER_PUSHBUTTON_PIN);
25} 25}
26 26
27bool matrix_scan_custom(matrix_row_t current_matrix[]) { 27bool matrix_scan_custom(matrix_row_t current_matrix[]) {
@@ -33,7 +33,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
33 spi_stop(); 33 spi_stop();
34 34
35 // Read from the encoder pushbutton 35 // Read from the encoder pushbutton
36 temp_matrix[5] = readPin(ENCODER_PUSHBUTTON_PIN) ? 1 : 0; 36 temp_matrix[5] = gpio_read_pin(ENCODER_PUSHBUTTON_PIN) ? 1 : 0;
37 37
38 // Check if we've changed, return the last-read data 38 // Check if we've changed, return the last-read data
39 bool changed = memcmp(current_matrix, temp_matrix, sizeof(temp_matrix)) != 0; 39 bool changed = memcmp(current_matrix, temp_matrix, sizeof(temp_matrix)) != 0;
diff --git a/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/overnumpad_1xb.c b/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/overnumpad_1xb.c
index f0c1161cfe..f441285c9a 100644
--- a/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/overnumpad_1xb.c
+++ b/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/overnumpad_1xb.c
@@ -20,19 +20,19 @@ void keyboard_post_init_kb(void)
20{ 20{
21 // Led pins: 21 // Led pins:
22 // C12 is the left-most led, normally Num Lock, but on Spacesaver M it's Caps Lock. Configured in info.json 22 // C12 is the left-most led, normally Num Lock, but on Spacesaver M it's Caps Lock. Configured in info.json
23 setPinOutput(C11); // middle led, always off on Spacesaver M 23 gpio_set_pin_output(C11); // middle led, always off on Spacesaver M
24 writePin(C11, 0); 24 gpio_write_pin(C11, 0);
25 setPinOutput(C10); // right-most led, normally Scroll Lock, but on Spacesaver M indicates function layer 25 gpio_set_pin_output(C10); // right-most led, normally Scroll Lock, but on Spacesaver M indicates function layer
26} 26}
27 27
28 28
29layer_state_t layer_state_set_kb(layer_state_t state) { 29layer_state_t layer_state_set_kb(layer_state_t state) {
30 switch (get_highest_layer(state)) { 30 switch (get_highest_layer(state)) {
31 case 0: 31 case 0:
32 writePin(C10, 0); 32 gpio_write_pin(C10, 0);
33 break; 33 break;
34 default: 34 default:
35 writePin(C10, 1); 35 gpio_write_pin(C10, 1);
36 break; 36 break;
37 } 37 }
38 return layer_state_set_user(state); 38 return layer_state_set_user(state);
diff --git a/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/overnumpad_1xb.c b/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/overnumpad_1xb.c
index 517df0035a..bad0c76e43 100644
--- a/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/overnumpad_1xb.c
+++ b/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/overnumpad_1xb.c
@@ -20,18 +20,18 @@ void keyboard_post_init_kb(void)
20{ 20{
21 // Led pins: 21 // Led pins:
22 // C12 is the left-most led, normally Num Lock, but on Spacesaver M it's Caps Lock. Configured in info.json 22 // C12 is the left-most led, normally Num Lock, but on Spacesaver M it's Caps Lock. Configured in info.json
23 setPinOutput(C11); // middle led, always off on Spacesaver M 23 gpio_set_pin_output(C11); // middle led, always off on Spacesaver M
24 writePin(C11, 0); 24 gpio_write_pin(C11, 0);
25 setPinOutput(C10); // right-most led, normally Scroll Lock, but on Spacesaver M indicates function layer 25 gpio_set_pin_output(C10); // right-most led, normally Scroll Lock, but on Spacesaver M indicates function layer
26} 26}
27 27
28layer_state_t layer_state_set_kb(layer_state_t state) { 28layer_state_t layer_state_set_kb(layer_state_t state) {
29 switch (get_highest_layer(state)) { 29 switch (get_highest_layer(state)) {
30 case 0: 30 case 0:
31 writePin(C10, 0); 31 gpio_write_pin(C10, 0);
32 break; 32 break;
33 default: 33 default:
34 writePin(C10, 1); 34 gpio_write_pin(C10, 1);
35 break; 35 break;
36 } 36 }
37 return layer_state_set_user(state); 37 return layer_state_set_user(state);
diff --git a/keyboards/viktus/minne_topre/ec.c b/keyboards/viktus/minne_topre/ec.c
index edd5f9a31d..12ca8a3c80 100644
--- a/keyboards/viktus/minne_topre/ec.c
+++ b/keyboards/viktus/minne_topre/ec.c
@@ -48,35 +48,35 @@ _Static_assert(sizeof(mux_sel_pins) == 3, "invalid MUX_SEL_PINS");
48static ec_config_t config; 48static ec_config_t config;
49static uint16_t ec_sw_value[MATRIX_COLS][MATRIX_ROWS]; 49static uint16_t ec_sw_value[MATRIX_COLS][MATRIX_ROWS];
50 50
51static inline void discharge_capacitor(void) { setPinOutput(DISCHARGE_PIN); } 51static inline void discharge_capacitor(void) { gpio_set_pin_output(DISCHARGE_PIN); }
52static inline void charge_capacitor(uint8_t col) { 52static inline void charge_capacitor(uint8_t col) {
53 setPinInput(DISCHARGE_PIN); 53 gpio_set_pin_input(DISCHARGE_PIN);
54 writePinHigh(col_pins[col]); 54 gpio_write_pin_high(col_pins[col]);
55} 55}
56 56
57static inline void clear_all_col_pins(void) { 57static inline void clear_all_col_pins(void) {
58 for (int col = 0; col < sizeof(col_pins); col++) { 58 for (int col = 0; col < sizeof(col_pins); col++) {
59 writePinLow(col_pins[col]); 59 gpio_write_pin_low(col_pins[col]);
60 } 60 }
61} 61}
62 62
63void init_mux_sel(void) { 63void init_mux_sel(void) {
64 for (int idx = 0; idx < sizeof(mux_sel_pins); idx++) { 64 for (int idx = 0; idx < sizeof(mux_sel_pins); idx++) {
65 setPinOutput(mux_sel_pins[idx]); 65 gpio_set_pin_output(mux_sel_pins[idx]);
66 } 66 }
67} 67}
68 68
69void select_mux(uint8_t row) { 69void select_mux(uint8_t row) {
70 uint8_t ch = row_channels[row]; 70 uint8_t ch = row_channels[row];
71 writePin(mux_sel_pins[0], ch & 1); 71 gpio_write_pin(mux_sel_pins[0], ch & 1);
72 writePin(mux_sel_pins[1], ch & 2); 72 gpio_write_pin(mux_sel_pins[1], ch & 2);
73 writePin(mux_sel_pins[2], ch & 4); 73 gpio_write_pin(mux_sel_pins[2], ch & 4);
74} 74}
75 75
76void init_col(void) { 76void init_col(void) {
77 for (int idx = 0; idx < sizeof(col_pins); idx++) { 77 for (int idx = 0; idx < sizeof(col_pins); idx++) {
78 setPinOutput(col_pins[idx]); 78 gpio_set_pin_output(col_pins[idx]);
79 writePinLow(col_pins[idx]); 79 gpio_write_pin_low(col_pins[idx]);
80 } 80 }
81} 81}
82 82
@@ -85,8 +85,8 @@ void ec_init(ec_config_t const* const ec_config) {
85 config = *ec_config; 85 config = *ec_config;
86 86
87 // initialize discharge pin as discharge mode 87 // initialize discharge pin as discharge mode
88 writePinLow(DISCHARGE_PIN); 88 gpio_write_pin_low(DISCHARGE_PIN);
89 setPinOutput(DISCHARGE_PIN); 89 gpio_set_pin_output(DISCHARGE_PIN);
90 90
91 // set analog reference 91 // set analog reference
92 analogReference(ADC_REF_POWER); 92 analogReference(ADC_REF_POWER);
@@ -98,7 +98,7 @@ void ec_init(ec_config_t const* const ec_config) {
98 init_mux_sel(); 98 init_mux_sel();
99 99
100 // set discharge pin to charge mode 100 // set discharge pin to charge mode
101 setPinInput(DISCHARGE_PIN); 101 gpio_set_pin_input(DISCHARGE_PIN);
102} 102}
103 103
104uint16_t ec_readkey_raw(uint8_t col, uint8_t row) { 104uint16_t ec_readkey_raw(uint8_t col, uint8_t row) {
diff --git a/keyboards/viktus/osav2_numpad_topre/ec.c b/keyboards/viktus/osav2_numpad_topre/ec.c
index 93e698412a..f5890db50b 100644
--- a/keyboards/viktus/osav2_numpad_topre/ec.c
+++ b/keyboards/viktus/osav2_numpad_topre/ec.c
@@ -48,35 +48,35 @@ _Static_assert(sizeof(mux_sel_pins) == 3, "invalid MUX_SEL_PINS");
48static ec_config_t config; 48static ec_config_t config;
49static uint16_t ec_sw_value[MATRIX_COLS][MATRIX_ROWS]; 49static uint16_t ec_sw_value[MATRIX_COLS][MATRIX_ROWS];
50 50
51static inline void discharge_capacitor(void) { setPinOutput(DISCHARGE_PIN); } 51static inline void discharge_capacitor(void) { gpio_set_pin_output(DISCHARGE_PIN); }
52static inline void charge_capacitor(uint8_t col) { 52static inline void charge_capacitor(uint8_t col) {
53 setPinInput(DISCHARGE_PIN); 53 gpio_set_pin_input(DISCHARGE_PIN);
54 writePinHigh(col_pins[col]); 54 gpio_write_pin_high(col_pins[col]);
55} 55}
56 56
57static inline void clear_all_col_pins(void) { 57static inline void clear_all_col_pins(void) {
58 for (int col = 0; col < sizeof(col_pins); col++) { 58 for (int col = 0; col < sizeof(col_pins); col++) {
59 writePinLow(col_pins[col]); 59 gpio_write_pin_low(col_pins[col]);
60 } 60 }
61} 61}
62 62
63void init_mux_sel(void) { 63void init_mux_sel(void) {
64 for (int idx = 0; idx < sizeof(mux_sel_pins); idx++) { 64 for (int idx = 0; idx < sizeof(mux_sel_pins); idx++) {
65 setPinOutput(mux_sel_pins[idx]); 65 gpio_set_pin_output(mux_sel_pins[idx]);
66 } 66 }
67} 67}
68 68
69void select_mux(uint8_t row) { 69void select_mux(uint8_t row) {
70 uint8_t ch = row_channels[row]; 70 uint8_t ch = row_channels[row];
71 writePin(mux_sel_pins[0], ch & 1); 71 gpio_write_pin(mux_sel_pins[0], ch & 1);
72 writePin(mux_sel_pins[1], ch & 2); 72 gpio_write_pin(mux_sel_pins[1], ch & 2);
73 writePin(mux_sel_pins[2], ch & 4); 73 gpio_write_pin(mux_sel_pins[2], ch & 4);
74} 74}
75 75
76void init_col(void) { 76void init_col(void) {
77 for (int idx = 0; idx < sizeof(col_pins); idx++) { 77 for (int idx = 0; idx < sizeof(col_pins); idx++) {
78 setPinOutput(col_pins[idx]); 78 gpio_set_pin_output(col_pins[idx]);
79 writePinLow(col_pins[idx]); 79 gpio_write_pin_low(col_pins[idx]);
80 } 80 }
81} 81}
82 82
@@ -85,8 +85,8 @@ void ec_init(ec_config_t const* const ec_config) {
85 config = *ec_config; 85 config = *ec_config;
86 86
87 // initialize discharge pin as discharge mode 87 // initialize discharge pin as discharge mode
88 writePinLow(DISCHARGE_PIN); 88 gpio_write_pin_low(DISCHARGE_PIN);
89 setPinOutput(DISCHARGE_PIN); 89 gpio_set_pin_output(DISCHARGE_PIN);
90 90
91 // set analog reference 91 // set analog reference
92 analogReference(ADC_REF_POWER); 92 analogReference(ADC_REF_POWER);
@@ -98,7 +98,7 @@ void ec_init(ec_config_t const* const ec_config) {
98 init_mux_sel(); 98 init_mux_sel();
99 99
100 // set discharge pin to charge mode 100 // set discharge pin to charge mode
101 setPinInput(DISCHARGE_PIN); 101 gpio_set_pin_input(DISCHARGE_PIN);
102} 102}
103 103
104uint16_t ec_readkey_raw(uint8_t col, uint8_t row) { 104uint16_t ec_readkey_raw(uint8_t col, uint8_t row) {
diff --git a/keyboards/viktus/osav2_topre/ec.c b/keyboards/viktus/osav2_topre/ec.c
index 13d9fde654..702af681a2 100644
--- a/keyboards/viktus/osav2_topre/ec.c
+++ b/keyboards/viktus/osav2_topre/ec.c
@@ -48,35 +48,35 @@ _Static_assert(sizeof(mux_sel_pins) == 3, "invalid MUX_SEL_PINS");
48static ec_config_t config; 48static ec_config_t config;
49static uint16_t ec_sw_value[MATRIX_COLS][MATRIX_ROWS]; 49static uint16_t ec_sw_value[MATRIX_COLS][MATRIX_ROWS];
50 50
51static inline void discharge_capacitor(void) { setPinOutput(DISCHARGE_PIN); } 51static inline void discharge_capacitor(void) { gpio_set_pin_output(DISCHARGE_PIN); }
52static inline void charge_capacitor(uint8_t col) { 52static inline void charge_capacitor(uint8_t col) {
53 setPinInput(DISCHARGE_PIN); 53 gpio_set_pin_input(DISCHARGE_PIN);
54 writePinHigh(col_pins[col]); 54 gpio_write_pin_high(col_pins[col]);
55} 55}
56 56
57static inline void clear_all_col_pins(void) { 57static inline void clear_all_col_pins(void) {
58 for (int col = 0; col < sizeof(col_pins); col++) { 58 for (int col = 0; col < sizeof(col_pins); col++) {
59 writePinLow(col_pins[col]); 59 gpio_write_pin_low(col_pins[col]);
60 } 60 }
61} 61}
62 62
63void init_mux_sel(void) { 63void init_mux_sel(void) {
64 for (int idx = 0; idx < sizeof(mux_sel_pins); idx++) { 64 for (int idx = 0; idx < sizeof(mux_sel_pins); idx++) {
65 setPinOutput(mux_sel_pins[idx]); 65 gpio_set_pin_output(mux_sel_pins[idx]);
66 } 66 }
67} 67}
68 68
69void select_mux(uint8_t row) { 69void select_mux(uint8_t row) {
70 uint8_t ch = row_channels[row]; 70 uint8_t ch = row_channels[row];
71 writePin(mux_sel_pins[0], ch & 1); 71 gpio_write_pin(mux_sel_pins[0], ch & 1);
72 writePin(mux_sel_pins[1], ch & 2); 72 gpio_write_pin(mux_sel_pins[1], ch & 2);
73 writePin(mux_sel_pins[2], ch & 4); 73 gpio_write_pin(mux_sel_pins[2], ch & 4);
74} 74}
75 75
76void init_col(void) { 76void init_col(void) {
77 for (int idx = 0; idx < sizeof(col_pins); idx++) { 77 for (int idx = 0; idx < sizeof(col_pins); idx++) {
78 setPinOutput(col_pins[idx]); 78 gpio_set_pin_output(col_pins[idx]);
79 writePinLow(col_pins[idx]); 79 gpio_write_pin_low(col_pins[idx]);
80 } 80 }
81} 81}
82 82
@@ -85,8 +85,8 @@ void ec_init(ec_config_t const* const ec_config) {
85 config = *ec_config; 85 config = *ec_config;
86 86
87 // initialize discharge pin as discharge mode 87 // initialize discharge pin as discharge mode
88 writePinLow(DISCHARGE_PIN); 88 gpio_write_pin_low(DISCHARGE_PIN);
89 setPinOutput(DISCHARGE_PIN); 89 gpio_set_pin_output(DISCHARGE_PIN);
90 90
91 // set analog reference 91 // set analog reference
92 analogReference(ADC_REF_POWER); 92 analogReference(ADC_REF_POWER);
@@ -98,7 +98,7 @@ void ec_init(ec_config_t const* const ec_config) {
98 init_mux_sel(); 98 init_mux_sel();
99 99
100 // set discharge pin to charge mode 100 // set discharge pin to charge mode
101 setPinInput(DISCHARGE_PIN); 101 gpio_set_pin_input(DISCHARGE_PIN);
102} 102}
103 103
104uint16_t ec_readkey_raw(uint8_t col, uint8_t row) { 104uint16_t ec_readkey_raw(uint8_t col, uint8_t row) {
diff --git a/keyboards/viktus/sp111/matrix.c b/keyboards/viktus/sp111/matrix.c
index 35a1a740fc..5ead535593 100644
--- a/keyboards/viktus/sp111/matrix.c
+++ b/keyboards/viktus/sp111/matrix.c
@@ -33,22 +33,22 @@ static const pin_t col_pins[MATRIX_COLS] = {F5, F6, F7, C7, C6, B6, B5, D3,
33//_____REGULAR funcs____________________________________________________________ 33//_____REGULAR funcs____________________________________________________________
34 34
35static void select_row(uint8_t row) { 35static void select_row(uint8_t row) {
36 setPinOutput(row_pins[row]); 36 gpio_set_pin_output(row_pins[row]);
37 writePinLow(row_pins[row]); 37 gpio_write_pin_low(row_pins[row]);
38} 38}
39 39
40static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); } 40static void unselect_row(uint8_t row) { gpio_set_pin_input_high(row_pins[row]); }
41 41
42static void unselect_rows(void) { 42static void unselect_rows(void) {
43 for (uint8_t x = 0; x < MATRIX_ROWS / 2; x++) { 43 for (uint8_t x = 0; x < MATRIX_ROWS / 2; x++) {
44 setPinInputHigh(row_pins[x]); 44 gpio_set_pin_input_high(row_pins[x]);
45 } 45 }
46} 46}
47 47
48static void init_pins(void) { 48static void init_pins(void) {
49 unselect_rows(); 49 unselect_rows();
50 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 50 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
51 setPinInputHigh(col_pins[x]); 51 gpio_set_pin_input_high(col_pins[x]);
52 } 52 }
53} 53}
54 54
@@ -66,7 +66,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
66 // For each col... 66 // For each col...
67 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 67 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
68 // Select the col pin to read (active low) 68 // Select the col pin to read (active low)
69 uint8_t pin_state = readPin(col_pins[col_index]); 69 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
70 70
71 // Populate the matrix row with the state of the col pin 71 // Populate the matrix row with the state of the col pin
72 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); 72 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
diff --git a/keyboards/viktus/sp111/sp111.c b/keyboards/viktus/sp111/sp111.c
index 523666ed73..1626683804 100644
--- a/keyboards/viktus/sp111/sp111.c
+++ b/keyboards/viktus/sp111/sp111.c
@@ -17,16 +17,16 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // enable built in pullups to avoid timeouts when right hand not connected 19 // enable built in pullups to avoid timeouts when right hand not connected
20 setPinInputHigh(D0); 20 gpio_set_pin_input_high(D0);
21 setPinInputHigh(D1); 21 gpio_set_pin_input_high(D1);
22 22
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
25 25
26void matrix_init_kb(void) { 26void matrix_init_kb(void) {
27 setPinOutput(F0); 27 gpio_set_pin_output(F0);
28 setPinOutput(F1); 28 gpio_set_pin_output(F1);
29 setPinOutput(F4); 29 gpio_set_pin_output(F4);
30 30
31 matrix_init_user(); 31 matrix_init_user();
32} 32}
@@ -34,9 +34,9 @@ void matrix_init_kb(void) {
34bool led_update_kb(led_t led_state) { 34bool led_update_kb(led_t led_state) {
35 bool res = led_update_user(led_state); 35 bool res = led_update_user(led_state);
36 if (res) { 36 if (res) {
37 writePin(F0, led_state.num_lock); 37 gpio_write_pin(F0, led_state.num_lock);
38 writePin(F1, led_state.caps_lock); 38 gpio_write_pin(F1, led_state.caps_lock);
39 writePin(F4, led_state.scroll_lock); 39 gpio_write_pin(F4, led_state.scroll_lock);
40 } 40 }
41 return res; 41 return res;
42} 42}
diff --git a/keyboards/viktus/sp111_v2/sp111_v2.c b/keyboards/viktus/sp111_v2/sp111_v2.c
index 96a9aaa5fe..9d749ccbac 100644
--- a/keyboards/viktus/sp111_v2/sp111_v2.c
+++ b/keyboards/viktus/sp111_v2/sp111_v2.c
@@ -5,8 +5,8 @@
5 5
6void keyboard_pre_init_kb(void) { 6void keyboard_pre_init_kb(void) {
7 // enable built in pullups to avoid timeouts when right hand not connected 7 // enable built in pullups to avoid timeouts when right hand not connected
8 setPinInputHigh(D0); 8 gpio_set_pin_input_high(D0);
9 setPinInputHigh(D1); 9 gpio_set_pin_input_high(D1);
10 10
11 keyboard_pre_init_user(); 11 keyboard_pre_init_user();
12} 12}
diff --git a/keyboards/viktus/sp_mini/sp_mini.c b/keyboards/viktus/sp_mini/sp_mini.c
index ffae6c5c54..1554dd3469 100644
--- a/keyboards/viktus/sp_mini/sp_mini.c
+++ b/keyboards/viktus/sp_mini/sp_mini.c
@@ -18,8 +18,8 @@
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 // enable built in pullups to avoid timeouts when right hand not connected 20 // enable built in pullups to avoid timeouts when right hand not connected
21 setPinInputHigh(D0); 21 gpio_set_pin_input_high(D0);
22 setPinInputHigh(D1); 22 gpio_set_pin_input_high(D1);
23 23
24 keyboard_pre_init_user(); 24 keyboard_pre_init_user();
25} 25}
diff --git a/keyboards/viktus/styrka_topre/ec.c b/keyboards/viktus/styrka_topre/ec.c
index 078723f691..4a8ce5ca29 100644
--- a/keyboards/viktus/styrka_topre/ec.c
+++ b/keyboards/viktus/styrka_topre/ec.c
@@ -49,35 +49,35 @@ _Static_assert(sizeof(mux_sel_pins) == 3, "invalid MUX_SEL_PINS");
49static ec_config_t config; 49static ec_config_t config;
50static uint16_t ec_sw_value[MATRIX_COLS][MATRIX_ROWS]; 50static uint16_t ec_sw_value[MATRIX_COLS][MATRIX_ROWS];
51 51
52static inline void discharge_capacitor(void) { setPinOutput(DISCHARGE_PIN); } 52static inline void discharge_capacitor(void) { gpio_set_pin_output(DISCHARGE_PIN); }
53static inline void charge_capacitor(uint8_t col) { 53static inline void charge_capacitor(uint8_t col) {
54 setPinInput(DISCHARGE_PIN); 54 gpio_set_pin_input(DISCHARGE_PIN);
55 writePinHigh(col_pins[col]); 55 gpio_write_pin_high(col_pins[col]);
56} 56}
57 57
58static inline void clear_all_col_pins(void) { 58static inline void clear_all_col_pins(void) {
59 for (int col = 0; col < sizeof(col_pins); col++) { 59 for (int col = 0; col < sizeof(col_pins); col++) {
60 writePinLow(col_pins[col]); 60 gpio_write_pin_low(col_pins[col]);
61 } 61 }
62} 62}
63 63
64void init_mux_sel(void) { 64void init_mux_sel(void) {
65 for (int idx = 0; idx < sizeof(mux_sel_pins); idx++) { 65 for (int idx = 0; idx < sizeof(mux_sel_pins); idx++) {
66 setPinOutput(mux_sel_pins[idx]); 66 gpio_set_pin_output(mux_sel_pins[idx]);
67 } 67 }
68} 68}
69 69
70void select_mux(uint8_t row) { 70void select_mux(uint8_t row) {
71 uint8_t ch = row_channels[row]; 71 uint8_t ch = row_channels[row];
72 writePin(mux_sel_pins[0], ch & 1); 72 gpio_write_pin(mux_sel_pins[0], ch & 1);
73 writePin(mux_sel_pins[1], ch & 2); 73 gpio_write_pin(mux_sel_pins[1], ch & 2);
74 writePin(mux_sel_pins[2], ch & 4); 74 gpio_write_pin(mux_sel_pins[2], ch & 4);
75} 75}
76 76
77void init_col(void) { 77void init_col(void) {
78 for (int idx = 0; idx < sizeof(col_pins); idx++) { 78 for (int idx = 0; idx < sizeof(col_pins); idx++) {
79 setPinOutput(col_pins[idx]); 79 gpio_set_pin_output(col_pins[idx]);
80 writePinLow(col_pins[idx]); 80 gpio_write_pin_low(col_pins[idx]);
81 } 81 }
82} 82}
83 83
@@ -86,8 +86,8 @@ void ec_init(ec_config_t const* const ec_config) {
86 config = *ec_config; 86 config = *ec_config;
87 87
88 // initialize discharge pin as discharge mode 88 // initialize discharge pin as discharge mode
89 writePinLow(DISCHARGE_PIN); 89 gpio_write_pin_low(DISCHARGE_PIN);
90 setPinOutput(DISCHARGE_PIN); 90 gpio_set_pin_output(DISCHARGE_PIN);
91 91
92 // set analog reference 92 // set analog reference
93 analogReference(ADC_REF_POWER); 93 analogReference(ADC_REF_POWER);
@@ -99,7 +99,7 @@ void ec_init(ec_config_t const* const ec_config) {
99 init_mux_sel(); 99 init_mux_sel();
100 100
101 // set discharge pin to charge mode 101 // set discharge pin to charge mode
102 setPinInput(DISCHARGE_PIN); 102 gpio_set_pin_input(DISCHARGE_PIN);
103} 103}
104 104
105uint16_t ec_readkey_raw(uint8_t col, uint8_t row) { 105uint16_t ec_readkey_raw(uint8_t col, uint8_t row) {
diff --git a/keyboards/vitamins_included/rev2/rev2.c b/keyboards/vitamins_included/rev2/rev2.c
index d34cdb4fc1..e445a3da45 100644
--- a/keyboards/vitamins_included/rev2/rev2.c
+++ b/keyboards/vitamins_included/rev2/rev2.c
@@ -7,9 +7,9 @@ bool is_keyboard_left(void) {
7 return !is_keyboard_master(); 7 return !is_keyboard_master();
8 #elif defined(SPLIT_HAND_PIN) 8 #elif defined(SPLIT_HAND_PIN)
9 // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand 9 // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand
10 setPinInputHigh(SPLIT_HAND_PIN); 10 gpio_set_pin_input_high(SPLIT_HAND_PIN);
11 bool x = !readPin(SPLIT_HAND_PIN); 11 bool x = !gpio_read_pin(SPLIT_HAND_PIN);
12 setPinInput(SPLIT_HAND_PIN); 12 gpio_set_pin_input(SPLIT_HAND_PIN);
13 return x; 13 return x;
14 #elif defined(EE_HANDS) 14 #elif defined(EE_HANDS)
15 return eeprom_read_byte(EECONFIG_HANDEDNESS); 15 return eeprom_read_byte(EECONFIG_HANDEDNESS);
diff --git a/keyboards/westfoxtrot/cypher/rev1/rev1.c b/keyboards/westfoxtrot/cypher/rev1/rev1.c
index b6736f97a7..eeaa7b4a4c 100644
--- a/keyboards/westfoxtrot/cypher/rev1/rev1.c
+++ b/keyboards/westfoxtrot/cypher/rev1/rev1.c
@@ -18,14 +18,14 @@
18bool led_update_kb(led_t led_state) { 18bool led_update_kb(led_t led_state) {
19 bool res = led_update_user(led_state); 19 bool res = led_update_user(led_state);
20 if(res) { 20 if(res) {
21 // writePin sets the pin high for 1 and low for 0. 21 // gpio_write_pin sets the pin high for 1 and low for 0.
22 // In this example the pins are inverted, setting 22 // In this example the pins are inverted, setting
23 // it low/0 turns it on, and high/1 turns the LED off. 23 // it low/0 turns it on, and high/1 turns the LED off.
24 // This behavior depends on whether the LED is between the pin 24 // This behavior depends on whether the LED is between the pin
25 // and VCC or the pin and GND. 25 // and VCC or the pin and GND.
26 writePin(F4, led_state.num_lock); 26 gpio_write_pin(F4, led_state.num_lock);
27 writePin(F1, led_state.caps_lock); 27 gpio_write_pin(F1, led_state.caps_lock);
28 writePin(F5, led_state.scroll_lock); 28 gpio_write_pin(F5, led_state.scroll_lock);
29 } 29 }
30 return res; 30 return res;
31} 31}
diff --git a/keyboards/westfoxtrot/cypher/rev5/rev5.c b/keyboards/westfoxtrot/cypher/rev5/rev5.c
index 477e1298af..37ca9cf3c1 100644
--- a/keyboards/westfoxtrot/cypher/rev5/rev5.c
+++ b/keyboards/westfoxtrot/cypher/rev5/rev5.c
@@ -18,14 +18,14 @@
18bool led_update_kb(led_t led_state) { 18bool led_update_kb(led_t led_state) {
19 bool res = led_update_user(led_state); 19 bool res = led_update_user(led_state);
20 if(res) { 20 if(res) {
21 // writePin sets the pin high for 1 and low for 0. 21 // gpio_write_pin sets the pin high for 1 and low for 0.
22 // In this example the pins are inverted, setting 22 // In this example the pins are inverted, setting
23 // it low/0 turns it on, and high/1 turns the LED off. 23 // it low/0 turns it on, and high/1 turns the LED off.
24 // This behavior depends on whether the LED is between the pin 24 // This behavior depends on whether the LED is between the pin
25 // and VCC or the pin and GND. 25 // and VCC or the pin and GND.
26 writePin(D3, led_state.num_lock); 26 gpio_write_pin(D3, led_state.num_lock);
27 writePin(D5, led_state.caps_lock); 27 gpio_write_pin(D5, led_state.caps_lock);
28 writePin(D2, led_state.scroll_lock); 28 gpio_write_pin(D2, led_state.scroll_lock);
29 } 29 }
30 return res; 30 return res;
31} 31}
diff --git a/keyboards/westfoxtrot/prophet/prophet.c b/keyboards/westfoxtrot/prophet/prophet.c
index 4284fa81a6..3ef0a3f928 100644
--- a/keyboards/westfoxtrot/prophet/prophet.c
+++ b/keyboards/westfoxtrot/prophet/prophet.c
@@ -1,19 +1,19 @@
1#include "quantum.h" 1#include "quantum.h"
2 2
3void keyboard_pre_init_kb (void) { 3void keyboard_pre_init_kb (void) {
4 setPinOutput(B12); 4 gpio_set_pin_output(B12);
5 setPinOutput(B13); 5 gpio_set_pin_output(B13);
6} 6}
7 7
8bool led_update_kb(led_t led_state) { 8bool led_update_kb(led_t led_state) {
9 bool res = led_update_user(led_state); 9 bool res = led_update_user(led_state);
10 if(res) { 10 if(res) {
11 writePin(B13, led_state.caps_lock); 11 gpio_write_pin(B13, led_state.caps_lock);
12 } 12 }
13 return res; 13 return res;
14} 14}
15 15
16__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { 16__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
17 writePin(B12, layer_state_cmp(state, 1)); 17 gpio_write_pin(B12, layer_state_cmp(state, 1));
18 return state; 18 return state;
19} 19}
diff --git a/keyboards/wilba_tech/wt60_xt/wt60_xt.c b/keyboards/wilba_tech/wt60_xt/wt60_xt.c
index 87527e7edf..7c6a2fafc4 100644
--- a/keyboards/wilba_tech/wt60_xt/wt60_xt.c
+++ b/keyboards/wilba_tech/wt60_xt/wt60_xt.c
@@ -51,14 +51,14 @@ void eeconfig_init_kb(void) {
51#endif // AUDIO_CLICKY 51#endif // AUDIO_CLICKY
52 52
53void keyboard_pre_init_kb(void) { 53void keyboard_pre_init_kb(void) {
54 setPinOutput(F1); 54 gpio_set_pin_output(F1);
55 55
56 keyboard_pre_init_user(); 56 keyboard_pre_init_user();
57} 57}
58 58
59bool led_update_kb(led_t led_state) { 59bool led_update_kb(led_t led_state) {
60 if (led_update_user(led_state)) { 60 if (led_update_user(led_state)) {
61 writePin(F1, led_state.caps_lock); 61 gpio_write_pin(F1, led_state.caps_lock);
62 } 62 }
63 63
64#ifdef AUDIO_ENABLE 64#ifdef AUDIO_ENABLE
diff --git a/keyboards/wilba_tech/wt69_a/wt69_a.c b/keyboards/wilba_tech/wt69_a/wt69_a.c
index 718bb0d32f..842b62a4d1 100644
--- a/keyboards/wilba_tech/wt69_a/wt69_a.c
+++ b/keyboards/wilba_tech/wt69_a/wt69_a.c
@@ -17,14 +17,14 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void keyboard_pre_init_kb(void) { 19void keyboard_pre_init_kb(void) {
20 setPinOutput(F1); 20 gpio_set_pin_output(F1);
21 21
22 keyboard_pre_init_user(); 22 keyboard_pre_init_user();
23} 23}
24 24
25bool led_update_kb(led_t led_state) { 25bool led_update_kb(led_t led_state) {
26 if (led_update_user(led_state)) { 26 if (led_update_user(led_state)) {
27 writePin(F1, led_state.caps_lock); 27 gpio_write_pin(F1, led_state.caps_lock);
28 } 28 }
29 return true; 29 return true;
30} 30}
diff --git a/keyboards/wilba_tech/wt70_jb/wt70_jb.c b/keyboards/wilba_tech/wt70_jb/wt70_jb.c
index 7a879207d6..ae9b5dcbec 100644
--- a/keyboards/wilba_tech/wt70_jb/wt70_jb.c
+++ b/keyboards/wilba_tech/wt70_jb/wt70_jb.c
@@ -18,14 +18,14 @@
18bool g_first_execution = false; 18bool g_first_execution = false;
19 19
20void keyboard_pre_init_kb(void) { 20void keyboard_pre_init_kb(void) {
21 setPinOutput(F1); 21 gpio_set_pin_output(F1);
22 22
23 keyboard_pre_init_user(); 23 keyboard_pre_init_user();
24} 24}
25 25
26bool led_update_kb(led_t led_state) { 26bool led_update_kb(led_t led_state) {
27 if (led_update_user(led_state)) { 27 if (led_update_user(led_state)) {
28 writePin(F1, led_state.caps_lock); 28 gpio_write_pin(F1, led_state.caps_lock);
29 } 29 }
30 return true; 30 return true;
31} 31}
diff --git a/keyboards/wolfmarkclub/wm1/wm1.c b/keyboards/wolfmarkclub/wm1/wm1.c
index 370f9c7cfa..9c4fb090c8 100644
--- a/keyboards/wolfmarkclub/wm1/wm1.c
+++ b/keyboards/wolfmarkclub/wm1/wm1.c
@@ -6,17 +6,17 @@ void bootloader_jump(void) {
6} 6}
7 7
8void matrix_init_kb(void) { 8void matrix_init_kb(void) {
9 setPinOutput(B1); // Top Indicator LED 9 gpio_set_pin_output(B1); // Top Indicator LED
10 setPinOutput(B0); // Middle Indicator LED 10 gpio_set_pin_output(B0); // Middle Indicator LED
11 setPinOutput(C5); // Bottom Indicator LED 11 gpio_set_pin_output(C5); // Bottom Indicator LED
12 matrix_init_user(); 12 matrix_init_user();
13} 13}
14 14
15bool led_update_kb(led_t led_state) { 15bool led_update_kb(led_t led_state) {
16 if(led_update_user(led_state)) { 16 if(led_update_user(led_state)) {
17 writePin(B1, led_state.caps_lock); 17 gpio_write_pin(B1, led_state.caps_lock);
18 writePin(B0, led_state.num_lock); 18 gpio_write_pin(B0, led_state.num_lock);
19 writePin(C5, led_state.scroll_lock); 19 gpio_write_pin(C5, led_state.scroll_lock);
20 } 20 }
21 return true; 21 return true;
22} 22}
diff --git a/keyboards/work_louder/micro/matrix.c b/keyboards/work_louder/micro/matrix.c
index 743c788662..3cfbf17dad 100644
--- a/keyboards/work_louder/micro/matrix.c
+++ b/keyboards/work_louder/micro/matrix.c
@@ -22,27 +22,27 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
22 22
23static inline void setPinOutput_writeLow(pin_t pin) { 23static inline void setPinOutput_writeLow(pin_t pin) {
24 ATOMIC_BLOCK_FORCEON { 24 ATOMIC_BLOCK_FORCEON {
25 setPinOutput(pin); 25 gpio_set_pin_output(pin);
26 writePinLow(pin); 26 gpio_write_pin_low(pin);
27 } 27 }
28} 28}
29 29
30static inline void setPinOutput_writeHigh(pin_t pin) { 30static inline void setPinOutput_writeHigh(pin_t pin) {
31 ATOMIC_BLOCK_FORCEON { 31 ATOMIC_BLOCK_FORCEON {
32 setPinOutput(pin); 32 gpio_set_pin_output(pin);
33 writePinHigh(pin); 33 gpio_write_pin_high(pin);
34 } 34 }
35} 35}
36 36
37static inline void setPinInputHigh_atomic(pin_t pin) { 37static inline void setPinInputHigh_atomic(pin_t pin) {
38 ATOMIC_BLOCK_FORCEON { 38 ATOMIC_BLOCK_FORCEON {
39 setPinInputHigh(pin); 39 gpio_set_pin_input_high(pin);
40 } 40 }
41} 41}
42 42
43static inline uint8_t readMatrixPin(pin_t pin) { 43static inline uint8_t readMatrixPin(pin_t pin) {
44 if (pin != NO_PIN) { 44 if (pin != NO_PIN) {
45 return readPin(pin); 45 return gpio_read_pin(pin);
46 } else { 46 } else {
47 return 1; 47 return 1;
48 } 48 }
diff --git a/keyboards/work_louder/micro/micro.c b/keyboards/work_louder/micro/micro.c
index d845a62250..07ab92f7a7 100644
--- a/keyboards/work_louder/micro/micro.c
+++ b/keyboards/work_louder/micro/micro.c
@@ -49,29 +49,29 @@ bool encoder_update_kb(uint8_t index, bool clockwise) {
49#endif 49#endif
50 50
51void work_louder_micro_led_1_on(void) { 51void work_louder_micro_led_1_on(void) {
52 setPinOutput(WORK_LOUDER_LED_PIN_1); 52 gpio_set_pin_output(WORK_LOUDER_LED_PIN_1);
53 writePin(WORK_LOUDER_LED_PIN_1, true); 53 gpio_write_pin(WORK_LOUDER_LED_PIN_1, true);
54} 54}
55void work_louder_micro_led_2_on(void) { 55void work_louder_micro_led_2_on(void) {
56 setPinOutput(WORK_LOUDER_LED_PIN_2); 56 gpio_set_pin_output(WORK_LOUDER_LED_PIN_2);
57 writePin(WORK_LOUDER_LED_PIN_2, true); 57 gpio_write_pin(WORK_LOUDER_LED_PIN_2, true);
58} 58}
59void work_louder_micro_led_3_on(void) { 59void work_louder_micro_led_3_on(void) {
60 setPinOutput(WORK_LOUDER_LED_PIN_3); 60 gpio_set_pin_output(WORK_LOUDER_LED_PIN_3);
61 writePin(WORK_LOUDER_LED_PIN_3, true); 61 gpio_write_pin(WORK_LOUDER_LED_PIN_3, true);
62} 62}
63 63
64void work_louder_micro_led_1_off(void) { 64void work_louder_micro_led_1_off(void) {
65 setPinInput(WORK_LOUDER_LED_PIN_1); 65 gpio_set_pin_input(WORK_LOUDER_LED_PIN_1);
66 writePin(WORK_LOUDER_LED_PIN_1, false); 66 gpio_write_pin(WORK_LOUDER_LED_PIN_1, false);
67} 67}
68void work_louder_micro_led_2_off(void) { 68void work_louder_micro_led_2_off(void) {
69 setPinInput(WORK_LOUDER_LED_PIN_2); 69 gpio_set_pin_input(WORK_LOUDER_LED_PIN_2);
70 writePin(WORK_LOUDER_LED_PIN_2, false); 70 gpio_write_pin(WORK_LOUDER_LED_PIN_2, false);
71} 71}
72void work_louder_micro_led_3_off(void) { 72void work_louder_micro_led_3_off(void) {
73 setPinInput(WORK_LOUDER_LED_PIN_3); 73 gpio_set_pin_input(WORK_LOUDER_LED_PIN_3);
74 writePin(WORK_LOUDER_LED_PIN_3, false); 74 gpio_write_pin(WORK_LOUDER_LED_PIN_3, false);
75} 75}
76 76
77void work_louder_micro_led_all_on(void) { 77void work_louder_micro_led_all_on(void) {
diff --git a/keyboards/work_louder/work_board/work_board.c b/keyboards/work_louder/work_board/work_board.c
index 157504216d..975c7aa794 100644
--- a/keyboards/work_louder/work_board/work_board.c
+++ b/keyboards/work_louder/work_board/work_board.c
@@ -111,13 +111,13 @@ bool rgb_matrix_indicators_kb(void) {
111} 111}
112 112
113void keyboard_pre_init_kb(void) { 113void keyboard_pre_init_kb(void) {
114 setPinOutput(B2); 114 gpio_set_pin_output(B2);
115 setPinOutput(B3); 115 gpio_set_pin_output(B3);
116 setPinOutput(B7); 116 gpio_set_pin_output(B7);
117 117
118 writePinLow(B2); 118 gpio_write_pin_low(B2);
119 writePinLow(B3); 119 gpio_write_pin_low(B3);
120 writePinLow(B7); 120 gpio_write_pin_low(B7);
121 121
122 keyboard_pre_init_user(); 122 keyboard_pre_init_user();
123} 123}
diff --git a/keyboards/wsk/g4m3ralpha/g4m3ralpha.c b/keyboards/wsk/g4m3ralpha/g4m3ralpha.c
index fb9344a1bf..3c039a173f 100644
--- a/keyboards/wsk/g4m3ralpha/g4m3ralpha.c
+++ b/keyboards/wsk/g4m3ralpha/g4m3ralpha.c
@@ -18,12 +18,12 @@
18 18
19 19
20void matrix_init_kb(void) { 20void matrix_init_kb(void) {
21 setPinOutput(D3); 21 gpio_set_pin_output(D3);
22 writePinLow(D3); 22 gpio_write_pin_low(D3);
23 setPinOutput(D2); 23 gpio_set_pin_output(D2);
24 writePinLow(D2); 24 gpio_write_pin_low(D2);
25 setPinOutput(D0); 25 gpio_set_pin_output(D0);
26 writePinLow(D0); 26 gpio_write_pin_low(D0);
27 27
28 matrix_init_user(); 28 matrix_init_user();
29}; 29};
@@ -31,9 +31,9 @@ void matrix_init_kb(void) {
31bool led_update_kb(led_t led_state) { 31bool led_update_kb(led_t led_state) {
32 bool res = led_update_user(led_state); 32 bool res = led_update_user(led_state);
33 if(res) { 33 if(res) {
34 writePin(D3, led_state.num_lock); 34 gpio_write_pin(D3, led_state.num_lock);
35 writePin(D0, led_state.caps_lock); 35 gpio_write_pin(D0, led_state.caps_lock);
36 writePin(D2, led_state.scroll_lock); 36 gpio_write_pin(D2, led_state.scroll_lock);
37 } 37 }
38 return res; 38 return res;
39} 39}
diff --git a/keyboards/wuque/ikki68/ikki68.c b/keyboards/wuque/ikki68/ikki68.c
index a61ddf3a56..382ec00251 100644
--- a/keyboards/wuque/ikki68/ikki68.c
+++ b/keyboards/wuque/ikki68/ikki68.c
@@ -17,14 +17,14 @@
17#include "quantum.h" 17#include "quantum.h"
18 18
19void matrix_init_kb(void) { 19void matrix_init_kb(void) {
20 setPinOutput(C6); 20 gpio_set_pin_output(C6);
21 21
22 matrix_init_user(); 22 matrix_init_user();
23} 23}
24bool led_update_kb(led_t led_state) { 24bool led_update_kb(led_t led_state) {
25 bool res = led_update_user(led_state); 25 bool res = led_update_user(led_state);
26 if(res) { 26 if(res) {
27 writePin(C6, !led_state.caps_lock); 27 gpio_write_pin(C6, !led_state.caps_lock);
28 } 28 }
29 return res; 29 return res;
30} 30}
diff --git a/keyboards/xiudi/xd75/xd75.c b/keyboards/xiudi/xd75/xd75.c
index b016643572..47bfd6d3dd 100644
--- a/keyboards/xiudi/xd75/xd75.c
+++ b/keyboards/xiudi/xd75/xd75.c
@@ -29,40 +29,40 @@ void matrix_init_kb(void) {
29} 29}
30 30
31void capslock_led_init(void) { 31void capslock_led_init(void) {
32 setPinOutput(XD75_CAPSLOCK_LED); 32 gpio_set_pin_output(XD75_CAPSLOCK_LED);
33 capslock_led_off(); 33 capslock_led_off();
34} 34}
35 35
36void capslock_led_off(void) { 36void capslock_led_off(void) {
37 writePinHigh(XD75_CAPSLOCK_LED); 37 gpio_write_pin_high(XD75_CAPSLOCK_LED);
38} 38}
39 39
40void capslock_led_on(void) { 40void capslock_led_on(void) {
41 writePinLow(XD75_CAPSLOCK_LED); 41 gpio_write_pin_low(XD75_CAPSLOCK_LED);
42} 42}
43 43
44void gp100_led_init(void) { 44void gp100_led_init(void) {
45 setPinOutput(XD75_GP100_LED); 45 gpio_set_pin_output(XD75_GP100_LED);
46 gp100_led_off(); 46 gp100_led_off();
47} 47}
48 48
49void gp100_led_off(void) { 49void gp100_led_off(void) {
50 writePinHigh(XD75_GP100_LED); 50 gpio_write_pin_high(XD75_GP100_LED);
51} 51}
52 52
53void gp100_led_on(void) { 53void gp100_led_on(void) {
54 writePinLow(XD75_GP100_LED); 54 gpio_write_pin_low(XD75_GP100_LED);
55} 55}
56 56
57void gp103_led_init(void) { 57void gp103_led_init(void) {
58 setPinOutput(XD75_GP103_LED); 58 gpio_set_pin_output(XD75_GP103_LED);
59 gp103_led_off(); 59 gp103_led_off();
60} 60}
61 61
62void gp103_led_off(void) { 62void gp103_led_off(void) {
63 writePinLow(XD75_GP103_LED); 63 gpio_write_pin_low(XD75_GP103_LED);
64} 64}
65 65
66void gp103_led_on(void) { 66void gp103_led_on(void) {
67 writePinHigh(XD75_GP103_LED); 67 gpio_write_pin_high(XD75_GP103_LED);
68} 68}
diff --git a/keyboards/ydkb/grape/matrix.c b/keyboards/ydkb/grape/matrix.c
index 3e070f8d7d..49e55fe329 100644
--- a/keyboards/ydkb/grape/matrix.c
+++ b/keyboards/ydkb/grape/matrix.c
@@ -38,7 +38,7 @@ static void select_row(uint8_t row) {
38 38
39static void init_pins(void) { 39static void init_pins(void) {
40 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 40 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
41 setPinInputHigh(col_pins[x]); 41 gpio_set_pin_input_high(col_pins[x]);
42 } 42 }
43} 43}
44 44
@@ -60,7 +60,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
60 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 60 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
61 61
62 // Select the col pin to read (active low) 62 // Select the col pin to read (active low)
63 uint8_t pin_state = readPin(col_pins[col_index]); 63 uint8_t pin_state = gpio_read_pin(col_pins[col_index]);
64 64
65 // Populate the matrix row with the state of the col pin 65 // Populate the matrix row with the state of the col pin
66 current_matrix[current_row] |= pin_state ? 0 : (row_shifter << col_index); 66 current_matrix[current_row] |= pin_state ? 0 : (row_shifter << col_index);
diff --git a/keyboards/ydkb/yd68/yd68.c b/keyboards/ydkb/yd68/yd68.c
index 0e6d5b82d5..1054a8673e 100644
--- a/keyboards/ydkb/yd68/yd68.c
+++ b/keyboards/ydkb/yd68/yd68.c
@@ -17,20 +17,20 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 //Backlight LEDs Output Low 19 //Backlight LEDs Output Low
20 setPinOutput(D6); 20 gpio_set_pin_output(D6);
21 writePinLow(D6); 21 gpio_write_pin_low(D6);
22 22
23 //RGB power output low 23 //RGB power output low
24 setPinOutput(E2); 24 gpio_set_pin_output(E2);
25 writePinLow(E2); 25 gpio_write_pin_low(E2);
26 26
27 //Bluetooth power output high 27 //Bluetooth power output high
28 setPinOutput(B2); 28 gpio_set_pin_output(B2);
29 writePinLow(B2); 29 gpio_write_pin_low(B2);
30 30
31 //RGB data output low 31 //RGB data output low
32 setPinOutput(B3); 32 gpio_set_pin_output(B3);
33 writePinLow(B3); 33 gpio_write_pin_low(B3);
34 34
35 keyboard_pre_init_user(); 35 keyboard_pre_init_user();
36} 36}
diff --git a/keyboards/yiancardesigns/barleycorn/barleycorn.c b/keyboards/yiancardesigns/barleycorn/barleycorn.c
index 9bd5d84d2b..c73c1559c2 100644
--- a/keyboards/yiancardesigns/barleycorn/barleycorn.c
+++ b/keyboards/yiancardesigns/barleycorn/barleycorn.c
@@ -17,21 +17,21 @@
17 17
18void keyboard_pre_init_kb(void) { 18void keyboard_pre_init_kb(void) {
19 // Set our LED pins as output 19 // Set our LED pins as output
20 setPinOutput(B5); 20 gpio_set_pin_output(B5);
21 setPinOutput(C0); 21 gpio_set_pin_output(C0);
22 keyboard_pre_init_user(); 22 keyboard_pre_init_user();
23} 23}
24 24
25bool led_update_kb(led_t led_state) { 25bool led_update_kb(led_t led_state) {
26 bool res = led_update_user(led_state); 26 bool res = led_update_user(led_state);
27 if(res) { 27 if(res) {
28 // writePin sets the pin high for 1 and low for 0. 28 // gpio_write_pin sets the pin high for 1 and low for 0.
29 // In this example the pins are inverted, setting 29 // In this example the pins are inverted, setting
30 // it low/0 turns it on, and high/1 turns the LED off. 30 // it low/0 turns it on, and high/1 turns the LED off.
31 // This behavior depends on whether the LED is between the pin 31 // This behavior depends on whether the LED is between the pin
32 // and VCC or the pin and GND. 32 // and VCC or the pin and GND.
33 writePin(B5, led_state.caps_lock); 33 gpio_write_pin(B5, led_state.caps_lock);
34 writePin(C0, led_state.num_lock); 34 gpio_write_pin(C0, led_state.num_lock);
35 } 35 }
36 return res; 36 return res;
37} 37}
diff --git a/keyboards/yiancardesigns/barleycorn/matrix.c b/keyboards/yiancardesigns/barleycorn/matrix.c
index 008f096266..02fdb6c7b4 100644
--- a/keyboards/yiancardesigns/barleycorn/matrix.c
+++ b/keyboards/yiancardesigns/barleycorn/matrix.c
@@ -23,17 +23,17 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
23 23
24static void unselect_rows(void) { 24static void unselect_rows(void) {
25 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 25 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
26 setPinInputHigh(row_pins[x]); 26 gpio_set_pin_input_high(row_pins[x]);
27 } 27 }
28} 28}
29 29
30static void select_row(uint8_t row) { 30static void select_row(uint8_t row) {
31 setPinOutput(row_pins[row]); 31 gpio_set_pin_output(row_pins[row]);
32 writePinLow(row_pins[row]); 32 gpio_write_pin_low(row_pins[row]);
33} 33}
34 34
35static void unselect_row(uint8_t row) { 35static void unselect_row(uint8_t row) {
36 setPinInputHigh(row_pins[row]); 36 gpio_set_pin_input_high(row_pins[row]);
37} 37}
38 38
39static void init_pins(void) { 39static void init_pins(void) {
@@ -46,7 +46,7 @@ static void init_pins(void) {
46 46
47 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 47 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
48 if ( x < 8 ) { 48 if ( x < 8 ) {
49 setPinInputHigh(col_pins[x]); 49 gpio_set_pin_input_high(col_pins[x]);
50 } 50 }
51 } 51 }
52} 52}
@@ -111,7 +111,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
111 pin_state = port_expander_col_buffer[1] & (1 << 1); 111 pin_state = port_expander_col_buffer[1] & (1 << 1);
112 break; 112 break;
113 default : 113 default :
114 pin_state = readPin(col_pins[col_index]); 114 pin_state = gpio_read_pin(col_pins[col_index]);
115 } 115 }
116 116
117 // Populate the matrix row with the state of the col pin 117 // Populate the matrix row with the state of the col pin
diff --git a/keyboards/yiancardesigns/gingham/matrix.c b/keyboards/yiancardesigns/gingham/matrix.c
index 4e6319b52b..48719e14bc 100644
--- a/keyboards/yiancardesigns/gingham/matrix.c
+++ b/keyboards/yiancardesigns/gingham/matrix.c
@@ -23,17 +23,17 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
23 23
24static void unselect_rows(void) { 24static void unselect_rows(void) {
25 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 25 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
26 setPinInputHigh(row_pins[x]); 26 gpio_set_pin_input_high(row_pins[x]);
27 } 27 }
28} 28}
29 29
30static void select_row(uint8_t row) { 30static void select_row(uint8_t row) {
31 setPinOutput(row_pins[row]); 31 gpio_set_pin_output(row_pins[row]);
32 writePinLow(row_pins[row]); 32 gpio_write_pin_low(row_pins[row]);
33} 33}
34 34
35static void unselect_row(uint8_t row) { 35static void unselect_row(uint8_t row) {
36 setPinInputHigh(row_pins[row]); 36 gpio_set_pin_input_high(row_pins[row]);
37} 37}
38 38
39static void init_pins(void) { 39static void init_pins(void) {
@@ -46,7 +46,7 @@ static void init_pins(void) {
46 46
47 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 47 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
48 if ( (x > 0) && (x < 12) ) { 48 if ( (x > 0) && (x < 12) ) {
49 setPinInputHigh(col_pins[x]); 49 gpio_set_pin_input_high(col_pins[x]);
50 } 50 }
51 } 51 }
52} 52}
@@ -90,7 +90,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
90 pin_state = pin_state & (1 << 1); 90 pin_state = pin_state & (1 << 1);
91 break; 91 break;
92 default : 92 default :
93 pin_state = readPin(col_pins[col_index]); 93 pin_state = gpio_read_pin(col_pins[col_index]);
94 } 94 }
95 95
96 // Populate the matrix row with the state of the col pin 96 // Populate the matrix row with the state of the col pin
diff --git a/keyboards/yiancardesigns/seigaiha/matrix.c b/keyboards/yiancardesigns/seigaiha/matrix.c
index dc80c4becf..16041754eb 100644
--- a/keyboards/yiancardesigns/seigaiha/matrix.c
+++ b/keyboards/yiancardesigns/seigaiha/matrix.c
@@ -23,17 +23,17 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
23 23
24static void unselect_rows(void) { 24static void unselect_rows(void) {
25 for(uint8_t x = 0; x < MATRIX_ROWS; x++) { 25 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
26 setPinInputHigh(row_pins[x]); 26 gpio_set_pin_input_high(row_pins[x]);
27 } 27 }
28} 28}
29 29
30static void select_row(uint8_t row) { 30static void select_row(uint8_t row) {
31 setPinOutput(row_pins[row]); 31 gpio_set_pin_output(row_pins[row]);
32 writePinLow(row_pins[row]); 32 gpio_write_pin_low(row_pins[row]);
33} 33}
34 34
35static void unselect_row(uint8_t row) { 35static void unselect_row(uint8_t row) {
36 setPinInputHigh(row_pins[row]); 36 gpio_set_pin_input_high(row_pins[row]);
37} 37}
38 38
39static void init_pins(void) { 39static void init_pins(void) {
@@ -46,7 +46,7 @@ static void init_pins(void) {
46 46
47 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 47 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
48 if ( x < 10 ) { 48 if ( x < 10 ) {
49 setPinInputHigh(col_pins[x]); 49 gpio_set_pin_input_high(col_pins[x]);
50 } 50 }
51 } 51 }
52} 52}
@@ -96,7 +96,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
96 pin_state = port_expander_col_buffer & (1 << 4); 96 pin_state = port_expander_col_buffer & (1 << 4);
97 break; 97 break;
98 default : 98 default :
99 pin_state = readPin(col_pins[col_index]); 99 pin_state = gpio_read_pin(col_pins[col_index]);
100 } 100 }
101 101
102 // Populate the matrix row with the state of the col pin 102 // Populate the matrix row with the state of the col pin
diff --git a/keyboards/ymdk/yd60mq/yd60mq.c b/keyboards/ymdk/yd60mq/yd60mq.c
index 1a14040907..40c899c46f 100644
--- a/keyboards/ymdk/yd60mq/yd60mq.c
+++ b/keyboards/ymdk/yd60mq/yd60mq.c
@@ -2,20 +2,20 @@
2 2
3__attribute__((weak)) 3__attribute__((weak))
4void matrix_init_kb(void){ 4void matrix_init_kb(void){
5 setPinOutput(F4); 5 gpio_set_pin_output(F4);
6 writePinHigh(F4); 6 gpio_write_pin_high(F4);
7} 7}
8 8
9__attribute__((weak)) 9__attribute__((weak))
10bool led_update_kb(led_t led_state) { 10bool led_update_kb(led_t led_state) {
11 bool res = led_update_user(led_state); 11 bool res = led_update_user(led_state);
12 if (res) { 12 if (res) {
13 // writePin sets the pin high for 1 and low for 0. 13 // gpio_write_pin sets the pin high for 1 and low for 0.
14 // In this example the pins are inverted, setting 14 // In this example the pins are inverted, setting
15 // it low/0 turns it on, and high/1 turns the LED off. 15 // it low/0 turns it on, and high/1 turns the LED off.
16 // This behavior depends on whether the LED is between the pin 16 // This behavior depends on whether the LED is between the pin
17 // and VCC or the pin and GND. 17 // and VCC or the pin and GND.
18 writePin(F4, !led_state.caps_lock); 18 gpio_write_pin(F4, !led_state.caps_lock);
19 } 19 }
20 return res; 20 return res;
21} 21}
diff --git a/keyboards/zsa/moonlander/matrix.c b/keyboards/zsa/moonlander/matrix.c
index aa97d0721f..2c9edd417c 100644
--- a/keyboards/zsa/moonlander/matrix.c
+++ b/keyboards/zsa/moonlander/matrix.c
@@ -71,21 +71,21 @@ void matrix_init_custom(void) {
71 dprintf("matrix init\n"); 71 dprintf("matrix init\n");
72 // debug_matrix = true; 72 // debug_matrix = true;
73 // outputs 73 // outputs
74 setPinOutput(B10); 74 gpio_set_pin_output(B10);
75 setPinOutput(B11); 75 gpio_set_pin_output(B11);
76 setPinOutput(B12); 76 gpio_set_pin_output(B12);
77 setPinOutput(B13); 77 gpio_set_pin_output(B13);
78 setPinOutput(B14); 78 gpio_set_pin_output(B14);
79 setPinOutput(B15); 79 gpio_set_pin_output(B15);
80 80
81 // inputs 81 // inputs
82 setPinInputLow(A0); 82 gpio_set_pin_input_low(A0);
83 setPinInputLow(A1); 83 gpio_set_pin_input_low(A1);
84 setPinInputLow(A2); 84 gpio_set_pin_input_low(A2);
85 setPinInputLow(A3); 85 gpio_set_pin_input_low(A3);
86 setPinInputLow(A6); 86 gpio_set_pin_input_low(A6);
87 setPinInputLow(A7); 87 gpio_set_pin_input_low(A7);
88 setPinInputLow(B0); 88 gpio_set_pin_input_low(B0);
89 89
90 mcp23018_init(); 90 mcp23018_init();
91} 91}
@@ -117,12 +117,12 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
117 for (uint8_t row = 0; row <= ROWS_PER_HAND; row++) { 117 for (uint8_t row = 0; row <= ROWS_PER_HAND; row++) {
118 // strobe row 118 // strobe row
119 switch (row) { 119 switch (row) {
120 case 0: writePinHigh(B10); break; 120 case 0: gpio_write_pin_high(B10); break;
121 case 1: writePinHigh(B11); break; 121 case 1: gpio_write_pin_high(B11); break;
122 case 2: writePinHigh(B12); break; 122 case 2: gpio_write_pin_high(B12); break;
123 case 3: writePinHigh(B13); break; 123 case 3: gpio_write_pin_high(B13); break;
124 case 4: writePinHigh(B14); break; 124 case 4: gpio_write_pin_high(B14); break;
125 case 5: writePinHigh(B15); break; 125 case 5: gpio_write_pin_high(B15); break;
126 case 6: break; // Left hand has 6 rows 126 case 6: break; // Left hand has 6 rows
127 } 127 }
128 128
@@ -170,22 +170,22 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
170 } 170 }
171 // read col data 171 // read col data
172 data = ( 172 data = (
173 (readPin(A0) << 0 ) | 173 (gpio_read_pin(A0) << 0 ) |
174 (readPin(A1) << 1 ) | 174 (gpio_read_pin(A1) << 1 ) |
175 (readPin(A2) << 2 ) | 175 (gpio_read_pin(A2) << 2 ) |
176 (readPin(A3) << 3 ) | 176 (gpio_read_pin(A3) << 3 ) |
177 (readPin(A6) << 4 ) | 177 (gpio_read_pin(A6) << 4 ) |
178 (readPin(A7) << 5 ) | 178 (gpio_read_pin(A7) << 5 ) |
179 (readPin(B0) << 6 ) 179 (gpio_read_pin(B0) << 6 )
180 ); 180 );
181 // unstrobe row 181 // unstrobe row
182 switch (row) { 182 switch (row) {
183 case 0: writePinLow(B10); break; 183 case 0: gpio_write_pin_low(B10); break;
184 case 1: writePinLow(B11); break; 184 case 1: gpio_write_pin_low(B11); break;
185 case 2: writePinLow(B12); break; 185 case 2: gpio_write_pin_low(B12); break;
186 case 3: writePinLow(B13); break; 186 case 3: gpio_write_pin_low(B13); break;
187 case 4: writePinLow(B14); break; 187 case 4: gpio_write_pin_low(B14); break;
188 case 5: writePinLow(B15); break; 188 case 5: gpio_write_pin_low(B15); break;
189 case 6: break; 189 case 6: break;
190 } 190 }
191 191
diff --git a/keyboards/zsa/moonlander/moonlander.c b/keyboards/zsa/moonlander/moonlander.c
index dad795d315..02c64f4b96 100644
--- a/keyboards/zsa/moonlander/moonlander.c
+++ b/keyboards/zsa/moonlander/moonlander.c
@@ -95,13 +95,13 @@ static THD_FUNCTION(LEDThread, arg) {
95} 95}
96 96
97void keyboard_pre_init_kb(void) { 97void keyboard_pre_init_kb(void) {
98 setPinOutput(B5); 98 gpio_set_pin_output(B5);
99 setPinOutput(B4); 99 gpio_set_pin_output(B4);
100 setPinOutput(B3); 100 gpio_set_pin_output(B3);
101 101
102 writePinLow(B5); 102 gpio_write_pin_low(B5);
103 writePinLow(B4); 103 gpio_write_pin_low(B4);
104 writePinLow(B3); 104 gpio_write_pin_low(B3);
105 105
106 chThdCreateStatic(waLEDThread, sizeof(waLEDThread), NORMALPRIO - 16, LEDThread, NULL); 106 chThdCreateStatic(waLEDThread, sizeof(waLEDThread), NORMALPRIO - 16, LEDThread, NULL);
107 107
diff --git a/keyboards/zsa/moonlander/moonlander.h b/keyboards/zsa/moonlander/moonlander.h
index 0e5282c511..3e1f39ad96 100644
--- a/keyboards/zsa/moonlander/moonlander.h
+++ b/keyboards/zsa/moonlander/moonlander.h
@@ -26,9 +26,9 @@ extern bool mcp23018_leds[];
26 26
27#define MCP23018_DEFAULT_ADDRESS 0b0100000 27#define MCP23018_DEFAULT_ADDRESS 0b0100000
28 28
29#define ML_LED_1(status) writePin(B5, (bool)status) 29#define ML_LED_1(status) gpio_write_pin(B5, (bool)status)
30#define ML_LED_2(status) writePin(B4, (bool)status) 30#define ML_LED_2(status) gpio_write_pin(B4, (bool)status)
31#define ML_LED_3(status) writePin(B3, (bool)status) 31#define ML_LED_3(status) gpio_write_pin(B3, (bool)status)
32 32
33#define ML_LED_4(status) mcp23018_leds[0] = (bool)status 33#define ML_LED_4(status) mcp23018_leds[0] = (bool)status
34#define ML_LED_5(status) mcp23018_leds[1] = (bool)status 34#define ML_LED_5(status) mcp23018_leds[1] = (bool)status