Skip to content

Commit

Permalink
Add more access to debug pins with C debug api.
Browse files Browse the repository at this point in the history
  • Loading branch information
danngreen committed Dec 21, 2023
1 parent 5d471af commit c4e1ca2
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions firmware/src/VCV_adaptor/rack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
50 changes: 50 additions & 0 deletions firmware/src/medium/debug_raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

0 comments on commit c4e1ca2

Please sign in to comment.