aboutsummaryrefslogtreecommitdiff
path: root/global.h
blob: 34867a170367752307b7f648093e6d8390f1aa1e (plain)
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
#ifndef GLOBAL_H
#define GLOBAL_H

// board type, raspi2
#define RASPI 2

// conditionally #define PERIF_BASE
#if RASPI == 4

#define PERIF_BASE 0xFE000000

#elif RASPI == 3 || RASPI == 2

#define PERIF_BASE 0x3F000000

#else // if RASPI == 1

#define PERIF_BASE 0x20000000

#endif

// GPIO_BASE is #define'd in terms of PERIF_BASE
// (as in sane kernels - like linux, not like in wiki.osdev codes...)
#define GPIO_BASE (PERIF_BASE + 0x200000)

// ARM control block
// called "base address for the ARM interrupt register" elsewhere
#define ARM_BASE (PERIF_BASE + 0xB000)

#endif // GLOBAL_H