source: rtems/c/src/lib/libbsp/arm/lpc24xx/console/console-config.c @ 5aeed17

4.104.115
Last change on this file since 5aeed17 was 5aeed17, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 09/22/08 at 11:30:09

lpc24xx: new BSP

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup lpc24xx
5 *
6 * @brief Console configuration.
7 */
8
9/*
10 * Copyright (c) 2008
11 * Embedded Brains GmbH
12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
15 * rtems@embedded-brains.de
16 *
17 * The license and distribution terms for this file may be found in the file
18 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
19 */
20
21#include <libchip/serial.h>
22#include <libchip/ns16550.h>
23
24#include <bsp/lpc24xx.h>
25#include <bsp/irq.h>
26
27#define LPC24XX_UART_NUMBER 1
28
29static uint8_t lpc24xx_uart_register( uint32_t addr, uint8_t i)
30{
31  volatile uint32_t *reg = (volatile uint32_t *) addr;
32
33  return (uint8_t) reg [i];
34}
35
36static void lpc24xx_uart_set_register( uint32_t addr, uint8_t i, uint8_t val)
37{
38  volatile uint32_t *reg = (volatile uint32_t *) addr;
39
40  reg [i] = val;
41}
42
43unsigned long Console_Port_Count = LPC24XX_UART_NUMBER;
44
45rtems_device_minor_number  Console_Port_Minor = 0;
46
47console_data  Console_Port_Data [LPC24XX_UART_NUMBER];
48
49console_tbl Console_Port_Tbl [LPC24XX_UART_NUMBER] = {
50  {
51    .sDeviceName = "/dev/ttyS0",
52    .deviceType = SERIAL_NS16550,
53    .pDeviceFns = &ns16550_fns,
54    .deviceProbe = NULL,
55    .pDeviceFlow = NULL,
56    .ulMargin = 16,
57    .ulHysteresis = 8,
58    .pDeviceParams = (void *) 38400,
59    .ulCtrlPort1 = UART0_BASE_ADDR,
60    .ulCtrlPort2 = 0,
61    .ulDataPort = UART0_BASE_ADDR,
62    .getRegister = lpc24xx_uart_register,
63    .setRegister = lpc24xx_uart_set_register,
64    .getData = NULL,
65    .setData = NULL,
66    .ulClock = 57600000,
67    .ulIntVector = LPC24XX_IRQ_UART_0
68  }
69};
Note: See TracBrowser for help on using the repository browser.