-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhw.h
More file actions
42 lines (34 loc) · 728 Bytes
/
hw.h
File metadata and controls
42 lines (34 loc) · 728 Bytes
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
#ifndef HW_H
#define HW_H
/*
* Address of memory bottom
*/
#define HEAP_START 0x50000
#define IRQ_MODE 0x12
#define SVC_MODE 0x13
#define SYS_MODE 0x1F
#define ENABLE_IRQ() \
asm("\tpush {r0}\n\t" \
"mrs r0,cpsr\n\t" \
"bic r0,r0,#0x80\n\t" \
"msr cpsr_c,r0\n\t" \
"pop {r0}" \
: \
: \
: "r0");
#define DISABLE_IRQ() \
asm("\tpush {r0}\n\t" \
"mrs r0,cpsr\n\t" \
"orr r0,r0,#0x80\n\t" \
"msr cpsr_c,r0\n\t" \
"pop {r0}" \
: \
: \
: "r0");
void enable_timer_irq();
void disable_timer_irq();
void set_tick_and_enable_timer();
void led_off();
void led_on();
void init_hw();
#endif