This source file includes following definitions.
- vid_bitmap_refresh
- shutdown
- get_flash_params_count
- camera_set_led
- debug_led
- JogDial_CW
- JogDial_CCW
- vid_get_viewport_fb
- vid_get_viewport_live_fb
- vid_get_viewport_fb_d
- vid_get_bitmap_fb
- vid_get_palette_type
- vid_get_palette_size
- vid_get_bitmap_active_buffer
- vid_get_bitmap_active_palette
1 #include "platform.h"
2 #include "lolevel.h"
3
4 #define LED_IO_G 0xC0220130
5 #define LED_IO_R 0xC0220134
6 #define LED_IO_Y 0xC0220134
7 #define LED_AF 0xC0223030
8
9
10
11
12 void vid_bitmap_refresh() {
13 extern int enabled_refresh_physical_screen;
14 extern int full_screen_refresh;
15
16
17
18
19 extern void _ScreenLock();
20 extern void _ScreenUnlock();
21
22 _ScreenLock();
23
24 enabled_refresh_physical_screen=1;
25 full_screen_refresh=3;
26
27 _ScreenUnlock();
28 }
29
30 void shutdown() {
31 volatile long *p = (void*)0xc022001C;
32
33 asm(
34 "MRS R1, CPSR\n"
35 "AND R0, R1, #0x80\n"
36 "ORR R1, R1, #0x80\n"
37 "MSR CPSR_cf, R1\n"
38 :::"r1","r0");
39
40 *p = 0x44;
41
42 while (1) {
43 asm volatile ("nop\n");
44 }
45 }
46
47 int get_flash_params_count(void) { return 0x94; }
48
49
50 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
51 return;
52 static char led_table[]={0,
53 1,
54 2,
55 3,
56
57 8,
58 9
59 };
60 if ((unsigned)led < sizeof(led_table)) {
61 _LEDDrive(led_table[led], state<=1 ? !state : state);
62 }
63 }
64
65 #define DEBUG_LED LED_IO_Y
66 void debug_led(int state)
67 {
68 * (int *) DEBUG_LED = state ? 0x46 : 0x44;
69 }
70
71
72 void JogDial_CW(void){
73
74 }
75
76 void JogDial_CCW(void){
77
78 }
79
80
81
82
83
84 extern char active_viewport_buffer;
85 extern void* viewport_buffers[];
86
87 void *vid_get_viewport_fb()
88 {
89
90 return viewport_buffers[0];
91 }
92
93 void *vid_get_viewport_live_fb()
94 {
95 if (camera_info.state.mode_video)
96 return viewport_buffers[0];
97
98
99 return viewport_buffers[(active_viewport_buffer)&3];
100 }
101
102 void *vid_get_viewport_fb_d()
103 {
104 extern char *viewport_fb_d;
105 return viewport_fb_d;
106 }
107
108 void *vid_get_bitmap_fb()
109 {
110 return (void*)0x40431000;
111 }
112
113
114
115
116
117 int vid_get_palette_type() { return 3; }
118 int vid_get_palette_size() { return 256 * 4; }
119
120 void *vid_get_bitmap_active_buffer()
121 {
122 return (void*)(*(int*)(0x556C+0x18));
123 }
124
125 void *vid_get_bitmap_active_palette() {
126 return (void*)(*(int*)(0x556C+0x2C));
127 }