From c4e1ca209bb0126530b6b2653ec99b2efad8923c Mon Sep 17 00:00:00 2001 From: Dan Green Date: Thu, 21 Dec 2023 12:01:10 -0800 Subject: [PATCH] Add more access to debug pins with C debug api. --- firmware/src/VCV_adaptor/rack.hpp | 2 ++ firmware/src/medium/debug_raw.h | 50 +++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/firmware/src/VCV_adaptor/rack.hpp b/firmware/src/VCV_adaptor/rack.hpp index 6cdf8a858..ddc8b4434 100644 --- a/firmware/src/VCV_adaptor/rack.hpp +++ b/firmware/src/VCV_adaptor/rack.hpp @@ -18,6 +18,8 @@ Directly including Rack headers other than rack.hpp in your plugin is unsupporte #define PRIVATE __attribute__((error("Using internal Rack function or symbol"))) #endif +#include "medium/debug_raw.h" + // #include "common.hpp" // #include "math.hpp" #include "string.hpp" diff --git a/firmware/src/medium/debug_raw.h b/firmware/src/medium/debug_raw.h index 38871f56d..a974cf244 100644 --- a/firmware/src/medium/debug_raw.h +++ b/firmware/src/medium/debug_raw.h @@ -11,3 +11,53 @@ static inline void DebugPin5Low() { volatile uint32_t *GPIOD_BSRR = (volatile uint32_t *)(0x50005018); *GPIOD_BSRR = (1 << (3 + 16)); } + +static inline void DebugPin4High() { + volatile uint32_t *GPIOE_BSRR = (volatile uint32_t *)(0x50006018); + *GPIOE_BSRR = (1 << 4); +} + +static inline void DebugPin4Low() { + volatile uint32_t *GPIOE_BSRR = (volatile uint32_t *)(0x50006018); + *GPIOE_BSRR = (1 << (4 + 16)); +} + +static inline void DebugPin3High() { + volatile uint32_t *GPIOG_BSRR = (volatile uint32_t *)(0x50008018); + *GPIOG_BSRR = (1 << 11); +} + +static inline void DebugPin3Low() { + volatile uint32_t *GPIOG_BSRR = (volatile uint32_t *)(0x50008018); + *GPIOG_BSRR = (1 << (11 + 16)); +} + +static inline void DebugPin2High() { + volatile uint32_t *GPIOE_BSRR = (volatile uint32_t *)(0x50006018); + *GPIOE_BSRR = (1 << 2); +} + +static inline void DebugPin2Low() { + volatile uint32_t *GPIOE_BSRR = (volatile uint32_t *)(0x50006018); + *GPIOE_BSRR = (1 << (2 + 16)); +} + +static inline void DebugPin1High() { + volatile uint32_t *GPIOA_BSRR = (volatile uint32_t *)(0x50002018); + *GPIOA_BSRR = (1 << 14); +} + +static inline void DebugPin1Low() { + volatile uint32_t *GPIOA_BSRR = (volatile uint32_t *)(0x50002018); + *GPIOA_BSRR = (1 << (14 + 16)); +} + +static inline void DebugPin0High() { + volatile uint32_t *GPIOB_BSRR = (volatile uint32_t *)(0x50003018); + *GPIOB_BSRR = (1 << 10); +} + +static inline void DebugPin0Low() { + volatile uint32_t *GPIOB_BSRR = (volatile uint32_t *)(0x50003018); + *GPIOB_BSRR = (1 << (10 + 16)); +}