mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-20 17:51:31 +08:00
lpc24xx/lpc17xx: lpc24xx_pin_set_function() keep LPC4088 W type pin in digital mode for non-analog function.
The problem wit incorrect switching of pins into analog mode manifestes on LPC4088 based board. LPC4088 implements pin P1.17 (ENET_MDIO) as new W type (digital pin with analog option). The pin was listed as D category on LPC1788 which does not have analog mode control bit. If analog option is not explicitly switched off on LPC4088 then the pin does not work as digital pin. Code tested on LPC1788 and no problems has been observed even that manual specifies the IOCON_ADMODE field as reserved and should be written as zero. But even RTEMS lpc24xx_gpio_config sets this bit unconditionally. Signed-off-by: Pavel Pisa <ppisa@pikron.com>
This commit is contained in:
committed by
Sebastian Huber
parent
bba3507723
commit
0a66c1266f
@@ -395,9 +395,14 @@ lpc24xx_pin_set_function(
|
||||
rtems_interrupt_enable(level);
|
||||
#else
|
||||
uint32_t iocon_extra = 0;
|
||||
uint32_t iocon_not_analog = IOCON_ADMODE;
|
||||
|
||||
/* TODO */
|
||||
switch (pin_range.fields.type) {
|
||||
case LPC17XX_PIN_TYPE_ADC:
|
||||
case LPC17XX_PIN_TYPE_DAC:
|
||||
iocon_not_analog = 0;
|
||||
break;
|
||||
case LPC17XX_PIN_TYPE_I2C_FAST_PLUS:
|
||||
iocon_extra |= IOCON_HS;
|
||||
break;
|
||||
@@ -408,7 +413,7 @@ lpc24xx_pin_set_function(
|
||||
break;
|
||||
}
|
||||
|
||||
*iocon = IOCON_FUNC(pin_range.fields.function) | iocon_extra;
|
||||
*iocon = IOCON_FUNC(pin_range.fields.function) | iocon_extra | iocon_not_analog;
|
||||
#endif
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
|
||||
Reference in New Issue
Block a user