This source file includes following definitions.
- shutdown
- debug_led
- camera_set_led
- get_flash_params_count
- vid_get_palette_type
- vid_get_palette_size
- vid_get_bitmap_active_palette
- vid_get_bitmap_active_buffer
1 #include "platform.h"
2 #include "leds.h"
3
4 void shutdown()
5 {
6 volatile long *p = (void*)0xc02200a0;
7
8 asm(
9 "MRS R1, CPSR\n"
10 "AND R0, R1, #0x80\n"
11 "ORR R1, R1, #0x80\n"
12 "MSR CPSR_cf, R1\n"
13 :::"r1","r0");
14
15 *p = 0x44;
16
17 while(1);
18 }
19
20
21 void debug_led(int state)
22 {
23 volatile long *p=(void*)LED_PR;
24 if (state)
25 p[0]=0x46;
26 else
27 p[0]=0x44;
28 }
29
30
31 void camera_set_led(int led, int state, __attribute__ ((unused))int bright)
32 {
33 int leds[] = {0xd0,0x134,0x138,0x134,0x130,0xd4,0x3030,0x3030};
34 if(led >= 3 && led <= 10 && led != 6)
35 {
36 volatile long *p=(void*)0xc0220000 + leds[(led-3)%sizeof(leds)];
37 if (state)
38 p[0]=0x46;
39 else
40 p[0]=0x44;
41 }
42 }
43
44
45 int get_flash_params_count(void){
46 return 0x73;
47 }
48
49
50 int vid_get_palette_type() { return 1; }
51 int vid_get_palette_size() { return 16*4; }
52
53 void *vid_get_bitmap_active_palette()
54 {
55 return (void *)0x3E9B0;
56 }
57
58 void *vid_get_bitmap_active_buffer()
59 {
60 return (void*)(*(int*)0x7ACC);
61 }