Skip to content

Commit

Permalink
ensure debug interface pins are not used for other functions
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow578 authored Apr 9, 2024
1 parent bcebf05 commit 90a6d5c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/checks/sanity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ static_assert(!has_duplicates(loose_pins), "Pins must not be duplicated");
static_assert(!has_duplicates(sdio_pins), "SDIO pins must not be duplicated");
static_assert(!containsAny(sdio_pins, loose_pins), "SDIO pins must not be reused");

// debug pins should not be used for something else
constexpr gpio::pin_t debug_pins[] = {
gpio::PA13, // JTMS / SWDIO
gpio::PA14, // JTCK / SWCLK
gpio::PA15, // JTDI
gpio::PB3, // JTDO
gpio::PB4, // NJTRST
};

static_assert(!containsAny(debug_pins, sdio_pins), "Debug interface pins must not be used");
static_assert(!containsAny(debug_pins, loose_pins), "Debug interface pins must not be used");


// SDIO pins must be valid for either 1-bit, 4-bit or 8-bit bus width
static_assert(sdio::bus_width == 1 || sdio::bus_width == 4 || sdio::bus_width == 8, "SDIO_PINS must be valid for bus width of 1, 4 or 8 bits");

Expand Down

0 comments on commit 90a6d5c

Please sign in to comment.