[feature] Move files to seperate subfolder to make combining with existing userspace easier

This commit is contained in:
VeyPatch 2025-01-14 13:36:03 +01:00
commit 1764ca5f2f
46 changed files with 78 additions and 64 deletions

View file

@ -1,9 +1,6 @@
// Include the main display functions so we don't have to initialize the display again
#include "hlc_tft_display/hlc_tft_display.h"
// Include the QP api
#include "qp_surface.h"
// Add a font, this font is generated using the QP CLI tools (https://docs.qmk.fm/quantum_painter#quantum-painter-cli)
#include "graphics/thintel15.qff.h"

View file

@ -1 +0,0 @@
POST_CONFIG_H += $(USER_PATH)/hlc_cirque_trackpad/config.h

View file

@ -1,2 +0,0 @@
SRC += $(USER_PATH)/hlc_encoder/hlc_encoder.c
POST_CONFIG_H += $(USER_PATH)/hlc_encoder/config.h

View file

@ -1,19 +0,0 @@
SRC += $(USER_PATH)/hlc_tft_display/hlc_tft_display.c
POST_CONFIG_H += $(USER_PATH)/hlc_tft_display/config.h
# Fonts
SRC += $(USER_PATH)/hlc_tft_display/graphics/fonts/Retron2000-27.qff.c \
$(USER_PATH)/hlc_tft_display/graphics/fonts/Retron2000-underline-27.qff.c
# Numbers in image format
SRC += $(USER_PATH)/hlc_tft_display/graphics/numbers/0.qgf.c \
$(USER_PATH)/hlc_tft_display/graphics/numbers/1.qgf.c \
$(USER_PATH)/hlc_tft_display/graphics/numbers/2.qgf.c \
$(USER_PATH)/hlc_tft_display/graphics/numbers/3.qgf.c \
$(USER_PATH)/hlc_tft_display/graphics/numbers/4.qgf.c \
$(USER_PATH)/hlc_tft_display/graphics/numbers/5.qgf.c \
$(USER_PATH)/hlc_tft_display/graphics/numbers/6.qgf.c \
$(USER_PATH)/hlc_tft_display/graphics/numbers/7.qgf.c \
$(USER_PATH)/hlc_tft_display/graphics/numbers/8.qgf.c \
$(USER_PATH)/hlc_tft_display/graphics/numbers/9.qgf.c \
$(USER_PATH)/hlc_tft_display/graphics/numbers/undef.qgf.c

View file

@ -1,32 +1,2 @@
SRC += halcyon.c
# May need to be changed when adding more pointing devices
POINTING_DEVICE_ENABLE = yes
POINTING_DEVICE_DRIVER = cirque_pinnacle_spi
# May need to be changed when adding more displays
QUANTUM_PAINTER_ENABLE = yes
QUANTUM_PAINTER_DRIVERS += st7789_spi surface
BACKLIGHT_ENABLE = yes
BACKLIGHT_DRIVER = pwm
HALCONFDIR += $(USER_PATH)/halconf.h
ifdef HLC_ENCODER
include $(USER_PATH)/hlc_encoder/rules.mk
endif
ifdef HLC_TFT_DISPLAY
include $(USER_PATH)/hlc_tft_display/rules.mk
endif
ifdef HLC_CIRQUE_TRACKPAD
include $(USER_PATH)/hlc_cirque_trackpad/rules.mk
endif
HLC_OPTIONS := $(HLC_NONE) $(HLC_CIRQUE_TRACKPAD) $(HLC_ENCODER) $(HLC_TFT_DISPLAY)
ifeq ($(filter 1, $(HLC_OPTIONS)), )
$(error Halcyon_modules used but wrong or no module specified. Please specify one by adding `-e <module_name>=1` to your compile command where <module_name> can be: HLC_NONE, HLC_CIRQUE_TRACKPAD, HLC_ENCODER or HLC_TFT_DISPLAY)
endif
# Add this to your existing rules.mk if you have one
include $(USER_PATH)/splitkb/rules.mk

View file

@ -1,11 +1,15 @@
// Copyright 2024 splitkb.com (support@splitkb.com)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include "halcyon.h"
#include "transactions.h"
#include "split_util.h"
#include "_wait.h"
__attribute__((weak)) void module_suspend_power_down_kb(void);
__attribute__((weak)) void module_suspend_wakeup_init_kb(void);
__attribute__((weak)) bool module_post_init_kb(void) {
return module_post_init_user();
}
@ -64,6 +68,18 @@ void module_sync_slave_handler(uint8_t initiator2target_buffer_size, const void*
}
}
void suspend_power_down_kb(void) {
module_suspend_power_down_kb();
suspend_power_down_user();
}
void suspend_wakeup_init_kb(void) {
module_suspend_wakeup_init_kb();
suspend_wakeup_init_user();
}
void keyboard_post_init_kb(void) {
// Register module sync split transaction
transaction_register_rpc(MODULE_SYNC, module_sync_slave_handler);

View file

@ -0,0 +1 @@
POST_CONFIG_H += $(USER_PATH)/splitkb/hlc_cirque_trackpad/config.h

View file

@ -0,0 +1,2 @@
SRC += $(USER_PATH)/splitkb/hlc_encoder/hlc_encoder.c
POST_CONFIG_H += $(USER_PATH)/splitkb/hlc_encoder/config.h

View file

@ -4,7 +4,6 @@
#include "halcyon.h"
#include "hlc_tft_display.h"
#include "qp_surface.h"
#include "hardware/structs/rosc.h"
// Fonts mono2
@ -244,16 +243,14 @@ void update_display(void) {
}
}
// Quantum function
void suspend_power_down_kb(void) {
// Called from halcyon.c
void module_suspend_power_down_kb(void) {
qp_power(lcd, false);
suspend_power_down_user();
}
// Quantum function
void suspend_wakeup_init_kb(void) {
// Called from halcyon.c
void module_suspend_wakeup_init_kb(void) {
qp_power(lcd, true);
suspend_wakeup_init_user();
}
// Called from halcyon.c

View file

@ -4,6 +4,7 @@
#pragma once
#include "qp.h"
#include "qp_surface.h"
// All values (including hue) are scaled to 0-255
#define HSV_SPLITKB 145, 235, 155

View file

@ -0,0 +1,19 @@
SRC += $(USER_PATH)/splitkb/hlc_tft_display/hlc_tft_display.c
POST_CONFIG_H += $(USER_PATH)/splitkb/hlc_tft_display/config.h
# Fonts
SRC += $(USER_PATH)/splitkb/hlc_tft_display/graphics/fonts/Retron2000-27.qff.c \
$(USER_PATH)/splitkb/hlc_tft_display/graphics/fonts/Retron2000-underline-27.qff.c
# Numbers in image format
SRC += $(USER_PATH)/splitkb/hlc_tft_display/graphics/numbers/0.qgf.c \
$(USER_PATH)/splitkb/hlc_tft_display/graphics/numbers/1.qgf.c \
$(USER_PATH)/splitkb/hlc_tft_display/graphics/numbers/2.qgf.c \
$(USER_PATH)/splitkb/hlc_tft_display/graphics/numbers/3.qgf.c \
$(USER_PATH)/splitkb/hlc_tft_display/graphics/numbers/4.qgf.c \
$(USER_PATH)/splitkb/hlc_tft_display/graphics/numbers/5.qgf.c \
$(USER_PATH)/splitkb/hlc_tft_display/graphics/numbers/6.qgf.c \
$(USER_PATH)/splitkb/hlc_tft_display/graphics/numbers/7.qgf.c \
$(USER_PATH)/splitkb/hlc_tft_display/graphics/numbers/8.qgf.c \
$(USER_PATH)/splitkb/hlc_tft_display/graphics/numbers/9.qgf.c \
$(USER_PATH)/splitkb/hlc_tft_display/graphics/numbers/undef.qgf.c

View file

@ -0,0 +1,33 @@
# May need to be changed when adding more pointing devices
POINTING_DEVICE_ENABLE = yes
POINTING_DEVICE_DRIVER = cirque_pinnacle_spi
# May need to be changed when adding more displays
QUANTUM_PAINTER_ENABLE = yes
QUANTUM_PAINTER_DRIVERS += st7789_spi surface
BACKLIGHT_ENABLE = yes
BACKLIGHT_DRIVER = pwm
VPATH += $(USER_PATH)/splitkb/
SRC += $(USER_PATH)/splitkb/halcyon.c
HALCONFDIR += $(USER_PATH)/splitkb/halconf.h
POST_CONFIG_H += $(USER_PATH)/splitkb/config.h
ifdef HLC_ENCODER
include $(USER_PATH)/splitkb/hlc_encoder/rules.mk
endif
ifdef HLC_TFT_DISPLAY
include $(USER_PATH)/splitkb/hlc_tft_display/rules.mk
endif
ifdef HLC_CIRQUE_TRACKPAD
include $(USER_PATH)/splitkb/hlc_cirque_trackpad/rules.mk
endif
HLC_OPTIONS := $(HLC_NONE) $(HLC_CIRQUE_TRACKPAD) $(HLC_ENCODER) $(HLC_TFT_DISPLAY)
ifeq ($(filter 1, $(HLC_OPTIONS)), )
$(error Halcyon_modules used but wrong or no module specified. Please specify one by adding `-e <module_name>=1` to your compile command where <module_name> can be: HLC_NONE, HLC_CIRQUE_TRACKPAD, HLC_ENCODER or HLC_TFT_DISPLAY)
endif