Ignore:
Timestamp:
May 19, 2011, 12:30:00 PM (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
db56ac79
Parents:
76134c5
Message:

2011-05-19 Sebastian Huber <sebastian.huber@…>

  • i2c/i2c-config.c: New file.
  • include/lcd.h: Removed EMC definitions.
  • misc/dma.c: Fixed initialization.
  • include/i2c.h, include/io.h, include/lpc-ethernet-config.h, include/lpc24xx.h, console/console-config.c, i2c/i2c.c, misc/io.c, misc/lcd.c, startup/bspstart.c, startup/bspstarthooks.c: New pin configuration API.
  • Makefile.am, preinstall.am: Update.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/lpc24xx/console/console-config.c

    r76134c5 rd74ed4a  
    88
    99/*
    10  * Copyright (c) 2008
    11  * Embedded Brains GmbH
    12  * Obere Lagerstr. 30
    13  * D-82178 Puchheim
    14  * Germany
    15  * rtems@embedded-brains.de
     10 * Copyright (c) 2008-2011 embedded brains GmbH.  All rights reserved.
     11 *
     12 *  embedded brains GmbH
     13 *  Obere Lagerstr. 30
     14 *  82178 Puchheim
     15 *  Germany
     16 *  <rtems@embedded-brains.de>
    1617 *
    1718 * The license and distribution terms for this file may be found in the file
     
    2526#include <bsp/lpc24xx.h>
    2627#include <bsp/irq.h>
     28#include <bsp/io.h>
    2729
    28 static uint8_t lpc24xx_uart_register(uint32_t addr, uint8_t i)
     30static uint8_t lpc24xx_uart_get_register(uint32_t addr, uint8_t i)
    2931{
    3032  volatile uint32_t *reg = (volatile uint32_t *) addr;
     
    3941  reg [i] = val;
    4042}
     43
     44#ifdef LPC24XX_CONFIG_UART_1
     45  static bool lpc24xx_uart_probe_1(int minor)
     46  {
     47    static const lpc24xx_pin_range pins [] = {
     48      LPC24XX_PIN_UART_1_TXD_P0_15,
     49      LPC24XX_PIN_UART_1_RXD_P0_16,
     50      LPC24XX_PIN_TERMINAL
     51    };
     52
     53    lpc24xx_module_enable(LPC24XX_MODULE_UART_1, LPC24XX_MODULE_CCLK);
     54    lpc24xx_pin_config(&pins [0], LPC24XX_PIN_SET_FUNCTION);
     55
     56    return true;
     57  }
     58#endif
     59
     60#ifdef LPC24XX_CONFIG_UART_2
     61  static bool lpc24xx_uart_probe_2(int minor)
     62  {
     63    static const lpc24xx_pin_range pins [] = {
     64      LPC24XX_PIN_UART_2_TXD_P0_10,
     65      LPC24XX_PIN_UART_2_RXD_P0_11,
     66      LPC24XX_PIN_TERMINAL
     67    };
     68
     69    lpc24xx_module_enable(LPC24XX_MODULE_UART_2, LPC24XX_MODULE_CCLK);
     70    lpc24xx_pin_config(&pins [0], LPC24XX_PIN_SET_FUNCTION);
     71
     72    return true;
     73  }
     74#endif
     75
     76#ifdef LPC24XX_CONFIG_UART_3
     77  static bool lpc24xx_uart_probe_3(int minor)
     78  {
     79    static const lpc24xx_pin_range pins [] = {
     80      LPC24XX_PIN_UART_3_TXD_P0_0,
     81      LPC24XX_PIN_UART_3_RXD_P0_1,
     82      LPC24XX_PIN_TERMINAL
     83    };
     84
     85    lpc24xx_module_enable(LPC24XX_MODULE_UART_3, LPC24XX_MODULE_CCLK);
     86    lpc24xx_pin_config(&pins [0], LPC24XX_PIN_SET_FUNCTION);
     87
     88    return true;
     89  }
     90#endif
    4191
    4292rtems_device_minor_number Console_Port_Minor = 0;
     
    56106      .ulCtrlPort2 = 0,
    57107      .ulDataPort = UART0_BASE_ADDR,
    58       .getRegister = lpc24xx_uart_register,
     108      .getRegister = lpc24xx_uart_get_register,
    59109      .setRegister = lpc24xx_uart_set_register,
    60110      .getData = NULL,
     
    69119      .deviceType = SERIAL_NS16550,
    70120      .pDeviceFns = &ns16550_fns,
    71       .deviceProbe = NULL,
     121      .deviceProbe = lpc24xx_uart_probe_1,
    72122      .pDeviceFlow = NULL,
    73123      .ulMargin = 16,
     
    77127      .ulCtrlPort2 = 0,
    78128      .ulDataPort = UART1_BASE_ADDR,
    79       .getRegister = lpc24xx_uart_register,
     129      .getRegister = lpc24xx_uart_get_register,
    80130      .setRegister = lpc24xx_uart_set_register,
    81131      .getData = NULL,
     
    90140      .deviceType = SERIAL_NS16550,
    91141      .pDeviceFns = &ns16550_fns,
    92       .deviceProbe = NULL,
     142      .deviceProbe = lpc24xx_uart_probe_2,
    93143      .pDeviceFlow = NULL,
    94144      .ulMargin = 16,
     
    98148      .ulCtrlPort2 = 0,
    99149      .ulDataPort = UART2_BASE_ADDR,
    100       .getRegister = lpc24xx_uart_register,
     150      .getRegister = lpc24xx_uart_get_register,
    101151      .setRegister = lpc24xx_uart_set_register,
    102152      .getData = NULL,
     
    111161      .deviceType = SERIAL_NS16550,
    112162      .pDeviceFns = &ns16550_fns,
    113       .deviceProbe = NULL,
     163      .deviceProbe = lpc24xx_uart_probe_3,
    114164      .pDeviceFlow = NULL,
    115165      .ulMargin = 16,
     
    119169      .ulCtrlPort2 = 0,
    120170      .ulDataPort = UART3_BASE_ADDR,
    121       .getRegister = lpc24xx_uart_register,
     171      .getRegister = lpc24xx_uart_get_register,
    122172      .setRegister = lpc24xx_uart_set_register,
    123173      .getData = NULL,
     
    129179};
    130180
    131 #define LPC24XX_UART_NUMBER \
     181#define LPC24XX_UART_COUNT \
    132182  (sizeof(Console_Port_Tbl) / sizeof(Console_Port_Tbl [0]))
    133183
    134 unsigned long Console_Port_Count = LPC24XX_UART_NUMBER;
     184unsigned long Console_Port_Count = LPC24XX_UART_COUNT;
    135185
    136 console_data Console_Port_Data [LPC24XX_UART_NUMBER];
     186console_data Console_Port_Data [LPC24XX_UART_COUNT];
Note: See TracChangeset for help on using the changeset viewer.