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