CHDK_DE Vorschauversion  Trunk Rev. 6014
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
lib.c-Dateireferenz
#include "platform.h"
#include "platform_palette.h"
#include "lolevel.h"
+ Include-Abhängigkeitsdiagramm für lib.c:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define LED_GREEN   0xC0220130
 
#define LED_ORANGE   0xC0220134
 
#define LED_AF   0xC0223030
 

Funktionen

char * camera_jpeg_count_str ()
 
void vid_bitmap_refresh ()
 
void shutdown ()
 
void debug_led (int state)
 
void camera_set_led (int led, int state, __attribute__((unused)) int bright)
 
int get_flash_params_count (void)
 
void vid_turn_off_updates ()
 
void vid_turn_on_updates ()
 
int vid_get_viewport_width ()
 
long vid_get_viewport_height ()
 
int vid_get_palette_type ()
 
int vid_get_palette_size ()
 
void * vid_get_bitmap_active_palette ()
 
void * vid_get_bitmap_active_buffer ()
 
void load_chdk_palette ()
 

Variablen

int enabled_refresh_physical_screen
 

Makro-Dokumentation

#define LED_AF   0xC0223030

Definiert in Zeile 7 der Datei lib.c.

#define LED_GREEN   0xC0220130

Definiert in Zeile 5 der Datei lib.c.

#define LED_ORANGE   0xC0220134

Definiert in Zeile 6 der Datei lib.c.

Dokumentation der Funktionen

char* camera_jpeg_count_str ( )

Definiert in Zeile 9 der Datei lib.c.

10 {
11  extern char jpeg_count_str[];
12  return jpeg_count_str;
13 }
void camera_set_led ( int  led,
int  state,
__attribute__((unused)) int  bright 
)

Definiert in Zeile 53 der Datei lib.c.

53  {
54  static char led_table[3]={0,1,9};
55  _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
56 }
void debug_led ( int  state)

Definiert in Zeile 46 der Datei lib.c.

47 {
48  *(int*)LED_ORANGE=state ? 0x46 : 0x44;
49 }
int get_flash_params_count ( void  )

Definiert in Zeile 58 der Datei lib.c.

58  {
59  return 120;
60 }
void load_chdk_palette ( )

Definiert in Zeile 103 der Datei lib.c.

104 {
105  extern char** palette_buffer_ptr;
106  extern int active_palette_buffer;
107 
108  if ((active_palette_buffer == 0) || (active_palette_buffer == 5)|| (active_palette_buffer == 8)) // Note : palette 4 (Canon Set Button Menu) colors conflict so not included here
109  {
110  int *pal = (int*)vid_get_bitmap_active_palette();
111  if (pal[CHDK_COLOR_BASE+0] != 0x33ADF62)
112  {
113  pal[CHDK_COLOR_BASE+0] = 0x33ADF62; // Red
114  pal[CHDK_COLOR_BASE+1] = 0x326EA40; // Dark Red
115  pal[CHDK_COLOR_BASE+2] = 0x34CD57F; // Light Red
116  pal[CHDK_COLOR_BASE+3] = 0x373BFAE; // Green
117  pal[CHDK_COLOR_BASE+4] = 0x34BD6CA; // Dark Green
118  pal[CHDK_COLOR_BASE+5] = 0x395AB95; // Light Green
119  pal[CHDK_COLOR_BASE+6] = 0x34766F0; // Blue
120  pal[CHDK_COLOR_BASE+7] = 0x31250F3; // Dark Blue
121  pal[CHDK_COLOR_BASE+8] = 0x37F408F; // Cyan
122  pal[CHDK_COLOR_BASE+9] = 0x3512D5B; // Magenta
123  pal[CHDK_COLOR_BASE+10] = 0x3A9A917; // Yellow
124  pal[CHDK_COLOR_BASE+11] = 0x3819137; // Dark Yellow
125  pal[CHDK_COLOR_BASE+12] = 0x3DED115; // Light Yellow
126  pal[CHDK_COLOR_BASE+13] = 0x0090000; // Transparent dark grey
127 
129  }
130  }
131 }
void shutdown ( )

Definiert in Zeile 29 der Datei lib.c.

30 {
31  volatile long *p = (void*)LED_AF;
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; // power off.
41 
42  while(1);
43 }
void vid_bitmap_refresh ( )

Definiert in Zeile 17 der Datei lib.c.

18 {
20 
21  *(int*)0x8BB0=3; // apparently not firmware specific (checked in 1.02c,1.03b,1.03c)
22  // set in three function called by RefreshPhysicalScreen
23 
25 
26 }
void* vid_get_bitmap_active_buffer ( )

Definiert in Zeile 93 der Datei lib.c.

94 {
95  return (void*)(*(int*)(0x53dc+0x18)); //"Add: %p Width : %ld Hight : %ld",
96  // 100e: sub_ff8f290c
97  // 101a, 102c: sub_ff8f2928
98  // 103b : sub_ff8f2934
99  // 103c : sub_ff8f2984
100 }
void* vid_get_bitmap_active_palette ( )

Definiert in Zeile 86 der Datei lib.c.

87 {
88  extern int active_palette_buffer;
89  extern char** palette_buffer_ptr;
90  return palette_buffer_ptr[active_palette_buffer]+8;
91 }
int vid_get_palette_size ( )

Definiert in Zeile 84 der Datei lib.c.

84 { return 256 * 4 ; } // 16*4 or 256*4
int vid_get_palette_type ( )

Definiert in Zeile 83 der Datei lib.c.

83 { return 3 ; } // 1,2,3,4,or 5
long vid_get_viewport_height ( )

Definiert in Zeile 77 der Datei lib.c.

78 {
79  return 240;
80 }
int vid_get_viewport_width ( )

Definiert in Zeile 72 der Datei lib.c.

73 {
74  return 360;
75 }
void vid_turn_off_updates ( )

Definiert in Zeile 62 der Datei lib.c.

63 {
64  _ScreenLock();
65 }
void vid_turn_on_updates ( )

Definiert in Zeile 67 der Datei lib.c.

68 {
70 }

Variablen-Dokumentation

int enabled_refresh_physical_screen