From f723a3141e02d038c8f12aca477d3c38c8283f4a Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 24 Oct 2019 22:02:29 -0400 Subject: [PATCH] atsam: Allow PB4-PB7,PB10-PB12 to be used as gpio on sam4 A separate "sysio" register must be set in order to use some port B pins on the sam4 mcu. Signed-off-by: Kevin O'Connor --- src/atsam/gpio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/atsam/gpio.c b/src/atsam/gpio.c index 2af2bfc0..f3ad95ac 100644 --- a/src/atsam/gpio.c +++ b/src/atsam/gpio.c @@ -60,6 +60,9 @@ set_pull_up(Pio *regs, uint32_t bit, int32_t pull_up) regs->PIO_PUDR = bit; regs->PIO_PPDDR = bit; } + // Check if this pin is a "system IO pin" and disable if so + if (regs == PIOB && (bit & 0x1cf0)) + MATRIX->CCFG_SYSIO |= bit; #endif }