-
Notifications
You must be signed in to change notification settings - Fork 7
/
lib.h
36 lines (25 loc) · 756 Bytes
/
lib.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
#ifndef LIB_H
#define LIB_H
#include "memio.h"
#define RPI1 1
#define RPI2 2
#define CORE_MASK 3
#define CORE0 0
#define CORE1 1
#define CORE2 2
#define CORE3 3
#define CORE1_STARTADDRESS 0x4000009C
#define CORE2_STARTADDRESS 0x400000AC
#define CORE3_STARTADDRESS 0x400000BC
//ACT LED is on GPIO47 (GPIO Function Select 4)
#define ENABLE_ACT_LED() ARM_GPIO_GPFSEL4 |= 1 << 21;
#define ACT_LED_ON() ARM_GPIO_GPSET1 |= 1 << 15;
#define ACT_LED_OFF() ARM_GPIO_GPCLR1 |= 1 << 15;
uint32_t get_core_number(void);
void start_core1(void (*func)(void));
void start_core2(void (*func)(void));
void start_core3(void (*func)(void));
void enable_JTAG(void);
uint32_t load32(uint32_t address);
void store32(uint32_t address, uint32_t value);
#endif //LIB_H