Merge pull request #6734 from codeauroraforum/Fix_LPC54XXX_GPIO

LPC54XXX: Set the pin function to Digital mode
pull/6762/head
Cruz Monrreal 2018-04-26 20:17:07 -05:00 committed by GitHub
commit 4e1c04feba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -29,6 +29,9 @@ void pin_function(PinName pin, int function)
CLOCK_EnableClock(gpio_clocks[port_number]);
CLOCK_EnableClock(kCLOCK_Iocon);
/* Set the DIGIMODE bit */
IOCON->PIO[port_number][pin_number] |= IOCON_PIO_DIGIMODE_MASK;
reg = IOCON->PIO[port_number][pin_number];
reg = (reg & ~0x7) | (function & 0x7);
IOCON->PIO[port_number][pin_number] = reg;