diff options
Diffstat (limited to 'nuttx/arch/arm/src/lpc17xx/lpc178x_gpio.c')
-rwxr-xr-x | nuttx/arch/arm/src/lpc17xx/lpc178x_gpio.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc178x_gpio.c b/nuttx/arch/arm/src/lpc17xx/lpc178x_gpio.c index 2e72d7a22..11a22bed5 100755 --- a/nuttx/arch/arm/src/lpc17xx/lpc178x_gpio.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc178x_gpio.c @@ -132,7 +132,6 @@ const uint32_t g_intbase[GPIO_NPORTS] = * ****************************************************************************/ -#if 0 /* Not used */ static uint32_t lpc17_getioconmask(unsigned int port, unsigned int pin) { uint32_t typemask = IOCON_TYPE_D_MASK; @@ -207,7 +206,7 @@ static uint32_t lpc17_getioconmask(unsigned int port, unsigned int pin) return typemask; } -#endif + /**************************************************************************** * Name: lpc17_seti2cmode @@ -242,12 +241,15 @@ static void lpc17_setpinfunction(unsigned int port, unsigned int pin, { uint32_t regaddr; uint32_t regval; + uint32_t typemask; + typemask= lpc17_getioconmask(port,pin); regaddr = LPC17_IOCON_P(port, pin); regval = getreg32(regaddr); regval &= ~IOCON_FUNC_MASK; regval |= ((value << IOCON_FUNC_SHIFT) & IOCON_FUNC_MASK); + regval &= typemask; putreg32(regval, regaddr); } @@ -774,6 +776,10 @@ static int lpc17_configalternate(lpc17_pinset_t cfgset, unsigned int port, lpc17_setopendrain(port, pin); } + /* Set output slew rate */ + + lpc17_setslewmode(cfgset, port, pin); + /* Select the alternate pin */ lpc17_setpinfunction(port, pin, alt); |