Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for current/voltage measurement on Ghoul. #19630

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions keyboards/tzarc/ghoul/rev1/rp2040/config.h
Original file line number Diff line number Diff line change
@@ -28,8 +28,8 @@
#define RGB_ENABLE_PIN GP6

// ADC Configuration
#define ADC_RESOLUTION ? ? ? // ADC_CFGR1_RES_12BIT // TBD when RP2040 has analog support
#define ADC_SATURATION ? ? ? // ((1 << 12) - 1) // TBD when RP2040 has analog support
#define ADC_RESOLUTION 12
#define ADC_SATURATION ((1 << 12) - 1)
#define ADC_CURRENT_PIN GP26
#define ADC_VOLTAGE_PIN GP27

2 changes: 1 addition & 1 deletion keyboards/tzarc/ghoul/rev1/rp2040/halconf.h
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once

//#define HAL_USE_ADC TRUE
#define HAL_USE_ADC TRUE
#define HAL_USE_SPI TRUE

#include_next <halconf.h>
4 changes: 2 additions & 2 deletions keyboards/tzarc/ghoul/rev1/rp2040/mcuconf.h
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@
#include_next <mcuconf.h>

// Used for RGB
//#undef RP_ADC_USE_ADC1
//#define RP_ADC_USE_ADC1 TRUE
#undef RP_ADC_USE_ADC1
#define RP_ADC_USE_ADC1 TRUE

// Used for EEPROM
#undef RP_SPI_USE_SPI0
1 change: 0 additions & 1 deletion keyboards/tzarc/ghoul/rev1/stm32/rules.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
WS2812_DRIVER = pwm
SRC += analog.c
2 changes: 2 additions & 0 deletions keyboards/tzarc/ghoul/rules.mk
Original file line number Diff line number Diff line change
@@ -5,3 +5,5 @@ QUANTUM_PAINTER_DRIVERS = ssd1351_spi
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE

DEFAULT_FOLDER = tzarc/ghoul/rev1/stm32

SRC += analog.c