summaryrefslogtreecommitdiff
path: root/keyboards/cannonkeys/bluepill/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/cannonkeys/bluepill/keyboard.c')
-rw-r--r--keyboards/cannonkeys/bluepill/keyboard.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/keyboards/cannonkeys/bluepill/keyboard.c b/keyboards/cannonkeys/bluepill/keyboard.c
new file mode 100644
index 0000000000..865628eccd
--- /dev/null
+++ b/keyboards/cannonkeys/bluepill/keyboard.c
@@ -0,0 +1,30 @@
+#include "ch.h"
+#include "hal.h"
+#include "led_custom.h"
+#include "util.h"
+#include "quantum.h"
+
+#ifdef BOARD_GENERIC_STM32_F103
+#define LED_ON() do { palClearPad(GPIOC, 13) ;} while (0)
+#define LED_OFF() do { palSetPad(GPIOC, 13); } while (0)
+#define LED_TGL() do { palTogglePad(GPIOC, 13); } while (0)
+#endif
+
+void matrix_init_kb(void){
+ /* MOSI pin*/
+ palSetPadMode(GPIOB, 15, PAL_MODE_STM32_ALTERNATE_PUSHPULL);
+ LED_ON();
+ wait_ms(500);
+ LED_OFF();
+
+#ifdef RGBLIGHT_ENABLE
+ leds_init();
+#endif
+}
+
+void matrix_scan_kb(void)
+{
+ #ifdef RGBLIGHT_ENABLE
+ rgblight_task();
+ #endif
+}