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 <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-10-24 22:02:29 -04:00
parent 6f5f2a3bc7
commit f723a3141e
1 changed files with 3 additions and 0 deletions

View File

@ -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
}