This source file includes following definitions.
- shutdown
- debug_led
- get_flash_params_count
- camera_set_led
1 #include "platform.h"
2
3
4
5
6
7
8
9
10 void shutdown()
11 {
12 volatile long *p = (void*)0xc02200a0;
13
14 asm(
15 "MRS R1, CPSR\n"
16 "AND R0, R1, #0x80\n"
17 "ORR R1, R1, #0x80\n"
18 "MSR CPSR_cf, R1\n"
19 :::"r1","r0");
20
21 *p = 0x44;
22
23 while(1);
24 }
25
26 #define LED_PR 0xC02200C4
27
28 void debug_led(int state)
29 {
30 volatile long *p=(void*)LED_PR;
31 if (state)
32 p[0]=0x46;
33 else
34 p[0]=0x44;
35 }
36
37
38 int get_flash_params_count(void){
39 return 110;
40 }
41
42 #define LED_BASE 0xC02200C0
43
44 void camera_set_led(int led, int state, __attribute__ ((unused))int bright)
45 {
46 int leds[] = {12,16,4,8,4,0,4};
47 if(led < 4 || led > 10 || led == 6) return;
48 volatile long *p=(void*)LED_BASE + leds[led-4];
49 if (state)
50 p[0]=0x46;
51 else
52 p[0]=0x44;
53 }