Skip to content

Commit 2670f79

Browse files
committed
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 <[email protected]>
1 parent b033a6e commit 2670f79

File tree

1 file changed

+3
-0
lines changed
  • targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC

1 file changed

+3
-0
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/pinmap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ void pin_function(PinName pin, int function)
2929
CLOCK_EnableClock(gpio_clocks[port_number]);
3030
CLOCK_EnableClock(kCLOCK_Iocon);
3131

32+
/* Set the DIGIMODE bit */
33+
IOCON->PIO[port_number][pin_number] |= IOCON_PIO_DIGIMODE_MASK;
34+
3235
reg = IOCON->PIO[port_number][pin_number];
3336
reg = (reg & ~0x7) | (function & 0x7);
3437
IOCON->PIO[port_number][pin_number] = reg;

0 commit comments

Comments
 (0)