AwesomeStudioPedal
A programmable, multi-profile foot controller for DAWs, score readers, and studio automation
Loading...
Searching...
No Matches
nrf52840/include/builder_config.h
Go to the documentation of this file.
1#pragma once
2#include <cstdint>
3
4// ===================================================================
5// BUILDER CONFIGURATION — nRF52840 (Adafruit Feather nRF52840 Express)
6// Edit these values to match your hardware wiring, then rebuild.
7// Invalid combinations will produce a build error with a description.
8// ===================================================================
9
10// Number of profiles this build uses
11static constexpr uint8_t CONF_NUM_PROFILES = 7;
12
13// Profile-select LEDs wired. Maximum profiles = 2^n − 1.
14// 1 LED → up to 1 profile
15// 2 LEDs → up to 3 profiles
16// 3 LEDs → up to 7 profiles
17// 4 LEDs → up to 15 profiles
18// 5 LEDs → up to 31 profiles
19// 6 LEDs → up to 63 profiles
20static constexpr uint8_t CONF_NUM_SELECT_LEDS = 3;
21
22// Action buttons wired (A through Z, max 26)
23static constexpr uint8_t CONF_NUM_BUTTONS = 4;
24
25// GPIO pin assignments
26// Pin mapping (Feather nRF52840 Express):
27// D5=5, D6=6, D9=9, D10=10, D11=11, D12=12, A0=14, A1=15, A2=16, A3=17
28static constexpr uint8_t CONF_LED_BLUETOOTH = 5;
29static constexpr uint8_t CONF_LED_POWER = 6;
30static constexpr uint8_t CONF_LED_SELECT[] = { 9, 10, 11 }; // CONF_NUM_SELECT_LEDS entries
31static constexpr uint8_t CONF_BUTTON_SELECT = 12;
32static constexpr uint8_t CONF_BUTTON_PINS[] = { // CONF_NUM_BUTTONS entries
33 14, // A (A0)
34 15, // B (A1)
35 16, // C (A2)
36 17 // D (A3)
37};
38
39// ===================================================================
40// VALIDATION — build fails here if your configuration is invalid.
41// Read the message to understand what needs to change above.
42// ===================================================================
43
44static_assert(CONF_NUM_SELECT_LEDS >= 1 && CONF_NUM_SELECT_LEDS <= 6,
45 "CONF_NUM_SELECT_LEDS must be between 1 and 6.");
46
47static_assert(CONF_NUM_PROFILES >= 1 &&
48 CONF_NUM_PROFILES <= (1u << CONF_NUM_SELECT_LEDS) - 1u,
49 "CONF_NUM_PROFILES exceeds what your select LEDs can display. "
50 "Either reduce CONF_NUM_PROFILES or wire more select LEDs (CONF_NUM_SELECT_LEDS).");
51
52static_assert(CONF_NUM_BUTTONS >= 1 && CONF_NUM_BUTTONS <= 26,
53 "CONF_NUM_BUTTONS must be between 1 and 26 (A-Z).");