1 |
5 |
sergeykhbr |
#ifndef __SOCONFIG_H__
|
2 |
|
|
#define __SOCONFIG_H__
|
3 |
|
|
|
4 |
|
|
#include "stdtypes.h"
|
5 |
|
|
|
6 |
|
|
static const uint32 ADR_APBUART_BASE = 0x80000100;
|
7 |
|
|
static const uint32 ADR_IRQMP_BASE = 0x80000200;
|
8 |
|
|
static const uint32 ADR_GPTIMER_BASE = 0x80000300;
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
static const int32 TIMERS_TOTAL = 2;
|
12 |
|
|
|
13 |
|
|
// IRQ numbers:
|
14 |
|
|
static const int32 IRQ_IRQ_CONTROL = 0;// irqmp, has to be 0
|
15 |
|
|
static const int32 IRQ_DSU = IRQ_IRQ_CONTROL+1;
|
16 |
|
|
static const int32 IRQ_GNSS_ENGINE = IRQ_DSU+1;
|
17 |
|
|
static const int32 IRQ_UART_CFG = IRQ_GNSS_ENGINE+1;
|
18 |
|
|
static const int32 IRQ_TIMER = IRQ_UART_CFG+1;
|
19 |
|
|
static const int32 IRQ_TOTAL = IRQ_TIMER+1+(TIMERS_TOTAL-1);
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
static const uint32 UART_STATUS_DREADY = (1 << 0);
|
23 |
|
|
static const uint32 UART_STATUS_TSEMPTY = (1 << 1);
|
24 |
|
|
static const uint32 UART_STATUS_THEMPTY = (1 << 2);
|
25 |
|
|
static const uint32 UART_STATUS_BREAK = (1 << 3);
|
26 |
|
|
static const uint32 UART_STATUS_OVERFLOW = (1 << 4);
|
27 |
|
|
static const uint32 UART_STATUS_PARERR = (1 << 5);
|
28 |
|
|
static const uint32 UART_STATUS_FRAME = (1 << 6);
|
29 |
|
|
static const uint32 UART_STATUS_THALFFULL = (1 << 7); // half of fifo is full
|
30 |
|
|
static const uint32 UART_STATUS_RHALFFULL = (1 << 8);
|
31 |
|
|
static const uint32 UART_STATUS_TFULL = (1 << 9);
|
32 |
|
|
static const uint32 UART_STATUS_RFULL = (1 << 10);
|
33 |
|
|
|
34 |
|
|
static const uint32 UART_CTRL_DISABLE = 0x0;
|
35 |
|
|
static const uint32 UART_CTRL_ENABLE_RX = (1 << 0);
|
36 |
|
|
static const uint32 UART_CTRL_ENABLE_TX = (1 << 1);
|
37 |
|
|
static const uint32 UART_CTRL_RX_INT = (1 << 2);
|
38 |
|
|
static const uint32 UART_CTRL_TX_INT = (1 << 3);
|
39 |
|
|
static const uint32 UART_CTRL_PARSEL = (1 << 4);
|
40 |
|
|
//static const uint32 UART_CTRL_EVEN_PARITY = (1 << 5);
|
41 |
|
|
static const uint32 UART_CTRL_PAREN = (1 << 5);
|
42 |
|
|
//static const uint32 UART_CTRL_ODD_PARITY = (1 << 6);
|
43 |
|
|
static const uint32 UART_CTRL_FLOW_CONTROL = (1 << 6);
|
44 |
|
|
static const uint32 UART_CTRL_LOOP_BACK = (1 << 7);
|
45 |
|
|
static const uint32 UART_CTRL_EXTCLKENA = (1 << 8);
|
46 |
|
|
static const uint32 UART_CTRL_FIFO_TX_INT = (1 << 9);
|
47 |
|
|
static const uint32 UART_CTRL_FIFO_RX_INT = (1 << 10);
|
48 |
|
|
static const uint32 UART_CTRL_DEBUG = (1 << 11);
|
49 |
|
|
static const uint32 UART_CTRL_BREAK_IRQEN = (1 << 12);
|
50 |
|
|
static const uint32 UART_CTRL_DELAY_IRQEN = (1 << 13);
|
51 |
|
|
static const uint32 UART_CTRL_TSEMPTY_IRQEN = (1 << 14);
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
struct uart_fields
|
55 |
|
|
{
|
56 |
|
|
volatile int32 data;
|
57 |
|
|
volatile int32 status;
|
58 |
|
|
volatile int32 control;
|
59 |
|
|
volatile int32 scaler;
|
60 |
|
|
};
|
61 |
|
|
|
62 |
|
|
#endif
|