lotus: Add ifdef for pico variant

Pico doesn't expose all the pins so it'll be a bit different.
Just for prototyping.

Signed-off-by: Daniel Schaefer <git@danielschaefer.me>
This commit is contained in:
Daniel Schaefer 2023-01-07 13:34:25 +08:00
parent 8990a17d32
commit 4eb191c845
2 changed files with 20 additions and 5 deletions

View File

@ -5,6 +5,10 @@
#include <config_common.h>
// Prototype for Lotus with Raspberry Pi Pico
// SDB is mapped to GP22
#define PICO_LOTUS
// 18-digit serial number. Must be programmed at factory
// TODO: Figure out how to do that. Probably a script to compile qmk
#define SERIAL_NUMBER "FRALDLvvccxxxxxxxx"

View File

@ -6,13 +6,17 @@
#define MUX_ENABLE_GPIO GP4
#define BOOT_DONE_GPIO GP5
// SDB
// Pin SDB to enable the RGB controller
#ifdef PICO_LOTUS
// 22 only on RPi Pico because it doesn't have GP29
#define IS31FL3743A_ENABLE_GPIO GP22
//#define IS31FL3743A_ENABLE_GPIO GP29
#else
#define IS31FL3743A_ENABLE_GPIO GP29
#endif
void keyboard_post_init_kb(void) {
keyboard_post_init_user();
void keyboard_post_init_user(void) {
// Enable debug output
debug_enable = true;
debug_matrix = true;
@ -22,14 +26,21 @@ void keyboard_post_init_user(void) {
/**
* Hook into early keyboard initialization
*/
void keyboard_pre_init_user(void) {
void keyboard_pre_init_kb(void) {
keyboard_pre_init_user();
// Mark boot as done.
// Before this, when holding down both alt keys QSPI_SS is pulled low to put
// the RP2040 in bootloader mode during reset.
setPinOutput(BOOT_DONE_GPIO);
writePinHigh(BOOT_DONE_GPIO);
// TODO: Do we ever need to disable it to save power?
//// TODO: Do we ever need to disable it to save power?
#ifndef PICO_LOTUS
setPinOutput(MUX_ENABLE_GPIO);
writePinHigh(MUX_ENABLE_GPIO);
#endif
#ifdef RGB_MATRIX_ENABLE
//// TODO: Do we ever need to disable it to save power?
setPinOutput(IS31FL3743A_ENABLE_GPIO);