mirror of https://github.com/ARMmbed/mbed-os.git
LPC546XX: Set the pin function to Digital mode
We cannot rely on the default value as a pin could be use for Analog purposes in which this bit is cleared Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>pull/6734/head
parent
b033a6e42e
commit
2670f790ce
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue