Changeset 0a66c126 in rtems


Ignore:
Timestamp:
Aug 16, 2014, 2:15:17 PM (6 years ago)
Author:
Pavel Pisa <ppisa@…>
Branches:
4.11, master
Children:
4407ee6
Parents:
bba3507
git-author:
Pavel Pisa <ppisa@…> (08/16/14 14:15:17)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/20/14 11:42:26)
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/lpc24xx/misc/io.c

    rbba3507 r0a66c126  
    396396  #else
    397397    uint32_t iocon_extra = 0;
     398    uint32_t iocon_not_analog = IOCON_ADMODE;
    398399
    399400    /* TODO */
    400401    switch (pin_range.fields.type) {
     402      case LPC17XX_PIN_TYPE_ADC:
     403      case LPC17XX_PIN_TYPE_DAC:
     404        iocon_not_analog = 0;
     405        break;
    401406      case LPC17XX_PIN_TYPE_I2C_FAST_PLUS:
    402407        iocon_extra |= IOCON_HS;
     
    409414    }
    410415
    411     *iocon = IOCON_FUNC(pin_range.fields.function) | iocon_extra;
     416    *iocon = IOCON_FUNC(pin_range.fields.function) | iocon_extra | iocon_not_analog;
    412417  #endif
    413418
Note: See TracChangeset for help on using the changeset viewer.