Daniel Schaefer 3c9f93321d fl16: use sleep_l pin to indicate only lid state
Let the keyboard figure out by itself whether the system is asleep by
looking at the USB connection state.

|            | USB Active      | USB Suspend     |
| Lid Open   | LED, keys       | No LED, keys    |
| Lid closed | No LED, no keys | No LED, no keys |

=> lid_open => keys registered
=> lid_open && !suspended => LEDs on

After waking from sleep, backlight does not turn back on.
Remove the custom backlight/sleep logic. Don't try to outsmart the core
quantum logic, let it handle the hard stuff. Our code just
suspends/wakes the keyboard.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
2025-06-18 14:05:17 +08:00

46 lines
1.1 KiB
C

// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "quantum.h"
#ifdef KEYBOARD_framework_ansi
#include "ansi.h"
#elif KEYBOARD_framework_iso
#include "iso.h"
#elif KEYBOARD_framework_jis
#include "jis.h"
#elif KEYBOARD_framework_numpad
#include "numpad.h"
#elif KEYBOARD_framework_macropad
#include "macropad.h"
#endif
enum framework_keycodes {
// Custom keycode to change screen modes (e.g. enable external screen)
KC_SCRN = SAFE_RANGE,
FN_LOCK,
KC_CPLT,
};
extern bool bios_mode;
extern bool is_suspended;
// Uncomment this to show hotkey mode with capslock LED and backlight
// hotkey mode on: capslock ON, RGB red
// hotkey mode off: capslock OFF, RGB white
//#define BIOS_HOTKEY_DEBUG
void set_bios_mode(bool val);
#define SLEEP_GPIO GP0
#define MUX_ENABLE_GPIO GP4
#define BOOT_DONE_GPIO GP5
// Pin SDB to enable the RGB controller
#ifdef PICO_FL16
// 22 only on RPi Pico because it doesn't have GP29
#define IS31FL3743A_ENABLE_GPIO GP22
#else
#define IS31FL3743A_ENABLE_GPIO GP29
#endif