-
Notifications
You must be signed in to change notification settings - Fork 1
/
pi.h
56 lines (48 loc) · 2.04 KB
/
pi.h
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
#define BUS_PERIPHERAL_BASE 0x20000000
#define PERIPHERAL_RANGE 0x00300000
// Add this to a peripheral bus address to get the physical address
#define PERI_PHYS_OFFSET 0x5E000000
// Add this to a RAM address to get the L2 coherent physical address
#define RAM_PHYS_OFFSET 0x40000000
#ifndef PERIPHERAL_BASE
#define PERIPHERAL_BASE BUS_PERIPHERAL_BASE
#endif
#define ACCESS_PERI(offset) *((unsigned int volatile*)(PERIPHERAL_BASE + offset))
#define DMA0_CS ACCESS_PERI(0x007000)
#define DMA0_CONBLK_AD ACCESS_PERI(0x007004)
#define GPFSEL0 ACCESS_PERI(0x200000)
#define GPFSEL1 ACCESS_PERI(0x200004)
#define GPFSEL2 ACCESS_PERI(0x200008)
#define GPFSEL3 ACCESS_PERI(0x20000C)
#define GPFSEL4 ACCESS_PERI(0x200010)
#define GPSET0 ACCESS_PERI(0x20001C)
#define GPSET1 ACCESS_PERI(0x200020)
#define GPCLR0 ACCESS_PERI(0x200028)
#define GPCLR1 ACCESS_PERI(0x20002C)
#define GPLEV0 ACCESS_PERI(0x200034)
#define GPLEV1 ACCESS_PERI(0x200038)
#define GPEDS0 ACCESS_PERI(0x200040)
#define GPREN0 ACCESS_PERI(0x20004C)
#define GPFEN0 ACCESS_PERI(0x200058)
#define GPHEN0 ACCESS_PERI(0x200064)
#define GPLEN0 ACCESS_PERI(0x200070)
#define GPLEN1 ACCESS_PERI(0x200074)
#define GPAREN0 ACCESS_PERI(0x20007C)
#define GPAFEN0 ACCESS_PERI(0x200088)
#define GPPUD ACCESS_PERI(0x200094)
#define GPPUDCLK0 ACCESS_PERI(0x200098)
#define GPPUDCLK1 ACCESS_PERI(0x20009C)
#define PWM_CONTROL ACCESS_PERI(0x20C000)
#define PWM_STATUS ACCESS_PERI(0x20C004)
#define PWM_DMAC ACCESS_PERI(0x20C008)
#define PWM0_RANGE ACCESS_PERI(0x20C010)
#define PWM0_DATA ACCESS_PERI(0x20C014)
#define PWM_FIFO ACCESS_PERI(0x20C018)
#define PWM1_RANGE ACCESS_PERI(0x20C020)
#define PWM1_DATA ACCESS_PERI(0x20C024)
#define PWMCLK_CNTL ACCESS_PERI(0x1010A0)
#define PWMCLK_DIV ACCESS_PERI(0x1010A4)
#define INTEN1 ACCESS_PERI(0x00B210)
// In the manual this register is called "interrupt enable register 2"
#define INTEN2 ACCESS_PERI(0x00B214)
#define INTEN_BASIC ACCESS_PERI(0x00B218)