knobx1.h (1522B)
1 // (c) 2025 Binepad (@binpad) 2 // SPDX-License-Identifier: GPL-2.0-or-later 3 4 #pragma once 5 6 #include "quantum.h" 7 8 // PCB has a 1x2 matrix. Set the ROW0 to ground for faster direct pin access. 9 #define ROW0_PIN B8 10 11 #define IND1_LED A6 12 #define IND2_LED A5 13 #define IND3_LED A4 14 #define IND4_LED A3 15 16 // clang-format off 17 enum x1_keycodes { 18 X1_LAYER_SELECTOR_UP = QK_USER, 19 X1_LAYER_SELECTOR_DOWN 20 }; 21 // clang-format on 22 23 #define X1_LYRU X1_LAYER_SELECTOR_UP 24 #define X1_LYRD X1_LAYER_SELECTOR_DOWN 25 26 // clang-format off 27 static inline void x1_led_1(bool on) { gpio_write_pin(IND1_LED, on); } 28 static inline void x1_led_2(bool on) { gpio_write_pin(IND2_LED, on); } 29 static inline void x1_led_3(bool on) { gpio_write_pin(IND3_LED, on); } 30 static inline void x1_led_4(bool on) { gpio_write_pin(IND4_LED, on); } 31 static inline void x1_led_1_on(void) { gpio_write_pin_high(IND1_LED); } 32 static inline void x1_led_2_on(void) { gpio_write_pin_high(IND2_LED); } 33 static inline void x1_led_3_on(void) { gpio_write_pin_high(IND3_LED); } 34 static inline void x1_led_4_on(void) { gpio_write_pin_high(IND4_LED); } 35 static inline void x1_led_1_off(void) { gpio_write_pin_low(IND1_LED); } 36 static inline void x1_led_2_off(void) { gpio_write_pin_low(IND2_LED); } 37 static inline void x1_led_3_off(void) { gpio_write_pin_low(IND3_LED); } 38 static inline void x1_led_4_off(void) { gpio_write_pin_low(IND4_LED); } 39 // clang-format on 40 41 void x1_layer_led(uint8_t lyr); 42 bool process_x1_layer_up(keyrecord_t *record); 43 bool process_x1_layer_down(keyrecord_t *record);