Skip to content

Commit

Permalink
Add Kbuild option for loco deck LOCODECK_ALT_PIN_RESET
Browse files Browse the repository at this point in the history
Sets the loco deck reset pin to GPIO_IO4. Requires a accordingly
modified loco deck with a connection to GPIO_IO4.
  • Loading branch information
Thomas Izycki committed Dec 29, 2022
1 parent 92ea4e5 commit c6dc241
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/deck/drivers/src/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,15 @@ config DECK_LOCO
LOCO deck alternative IRQ and RESET pins(IO_2, IO_3) instead of
default (RX1, TX1), leaving UART1 free for use.

config LOCODECK_ALT_PIN_RESET
bool "Set pin GPIO_IO4 for reset on the LOCO deck"
default name
depends on DECK_LOCODECK_USE_ALT_PINS
help
Only works when LOCODECK_USE_ALT_PINS is set. For instance useful with
Loco + Lighhouse + Flow decks where IO_3 collides with the Flow deck.
Requires modified Loco deck with connection to GPIO_IO4.

config DECK_LOCO_NR_OF_ANCHORS
int "The number of anchors in use"
default 8
Expand Down
8 changes: 6 additions & 2 deletions src/deck/drivers/src/locodeck.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
#ifdef CONFIG_DECK_LOCODECK_USE_ALT_PINS
#define GPIO_PIN_IRQ DECK_GPIO_IO2

#ifndef LOCODECK_ALT_PIN_RESET
#ifndef CONFIG_LOCODECK_ALT_PIN_RESET
#define GPIO_PIN_RESET DECK_GPIO_IO3
#else
#define GPIO_PIN_RESET LOCODECK_ALT_PIN_RESET
#define GPIO_PIN_RESET DECK_GPIO_IO4
#endif

#define EXTI_PortSource EXTI_PortSourceGPIOB
Expand Down Expand Up @@ -570,7 +570,11 @@ static const DeckDriver dwm1000_deck = {
.name = "bcDWM1000",

#ifdef CONFIG_DECK_LOCODECK_USE_ALT_PINS
#ifndef CONFIG_LOCODECK_ALT_PIN_RESET
.usedGpio = DECK_USING_IO_1 | DECK_USING_IO_2 | DECK_USING_IO_3,
#else
.usedGpio = DECK_USING_IO_1 | DECK_USING_IO_2 | DECK_USING_IO_4,
#endif
#else
// (PC10/PC11 is UART1 TX/RX)
.usedGpio = DECK_USING_IO_1 | DECK_USING_PC10 | DECK_USING_PC11,
Expand Down

0 comments on commit c6dc241

Please sign in to comment.