Changeset e9e5b92d in rtems


Ignore:
Timestamp:
Oct 12, 2012, 8:04:28 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
34d12d97
Parents:
4275124
git-author:
Sebastian Huber <sebastian.huber@…> (10/12/12 08:04:28)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/12/12 13:37:08)
Message:

bsp/lpc24xx: Evaluate LPC17XX pin type

New pin type LPC17XX_PIN_TYPE_OPEN_DRAIN.

Location:
c/src/lib/libbsp/arm/lpc24xx
Files:
2 edited

Legend:

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

    r4275124 re9e5b92d  
    241241  LPC17XX_PIN_TYPE_DAC,
    242242  LPC17XX_PIN_TYPE_I2C,
    243   LPC17XX_PIN_TYPE_I2C_FAST_PLUS
     243  LPC17XX_PIN_TYPE_I2C_FAST_PLUS,
     244  LPC17XX_PIN_TYPE_OPEN_DRAIN
    244245} lpc17xx_pin_type;
    245246
     
    11031104#define LPC24XX_PIN_USB_SCL_1\
    11041105  LPC24XX_PIN(1, 28, LPC24XX_PIN_FUNCTION_01, 1)
    1105 #define LPC24XX_PIN_USB_SDA_1\
    1106   LPC24XX_PIN(1, 29, LPC24XX_PIN_FUNCTION_01, 1)
     1106#define LPC24XX_PIN_USB_SDA_1 \
     1107  LPC24XX_PIN_WITH_TYPE( \
     1108    1, 29, LPC24XX_PIN_FUNCTION_01, 1, LPC17XX_PIN_TYPE_OPEN_DRAIN \
     1109  )
    11071110#define LPC24XX_PIN_USB_CONNECT_1\
    11081111  LPC24XX_PIN(2, 9, LPC24XX_PIN_FUNCTION_01, 1)
  • c/src/lib/libbsp/arm/lpc24xx/misc/io.c

    r4275124 re9e5b92d  
    395395    rtems_interrupt_enable(level);
    396396  #else
     397    uint32_t iocon_extra = 0;
     398
    397399    /* TODO */
    398     *iocon = IOCON_FUNC(pin_range.fields.function);
     400    switch (pin_range.fields.type) {
     401      case LPC17XX_PIN_TYPE_I2C_FAST_PLUS:
     402        iocon_extra |= IOCON_HS;
     403        break;
     404      case LPC17XX_PIN_TYPE_OPEN_DRAIN:
     405        iocon_extra |= IOCON_OD;
     406        break;
     407      default:
     408        break;
     409    }
     410
     411    *iocon = IOCON_FUNC(pin_range.fields.function) | iocon_extra;
    399412  #endif
    400413
Note: See TracChangeset for help on using the changeset viewer.