root/platform/ixus960_sd950/lib.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. shutdown
  2. debug_led
  3. camera_set_led
  4. af_led
  5. newled
  6. orange_led
  7. green_led
  8. yellow_led
  9. timer_led
  10. get_flash_params_count
  11. vid_get_palette_type
  12. vid_get_palette_size
  13. vid_get_bitmap_active_palette
  14. vid_get_bitmap_active_buffer

   1 #include "platform.h"
   2 
   3 void shutdown()
   4 {
   5 volatile long *p = (void*)0xc02200a0;
   6  
   7 asm(
   8 "MRS     R1, CPSR\n"
   9 "AND     R0, R1, #0x80\n"
  10 "ORR     R1, R1, #0x80\n"
  11 "MSR     CPSR_cf, R1\n"
  12 :::"r1","r0");
  13  
  14 *p = 0x44;
  15 while(1);
  16 }
  17 #define LED_PR 0xC02200CC
  18 void debug_led(int state)
  19 {
  20 volatile long *p=(void*)LED_PR;
  21 if (state)
  22 p[0]=0x46;
  23 else
  24 p[0]=0x44;
  25 }
  26 #define LED_AF 0xc0223030
  27 void camera_set_led(int led, int state, __attribute__ ((unused))int bright)
  28 {
  29 int leds[] = {106,0,0,103,0,3940,0};
  30 if(led < 4 || led > 10 || led == 6) return;
  31 volatile long *p=(void*)LED_PR + leds[led-4];
  32 if (state)
  33 p[0]=0x46;
  34 else
  35 p[0]=0x44;
  36 }
  37 void af_led(int state)
  38 {
  39 volatile long *p=(void*)LED_AF;
  40 if (state)
  41 p[0]=0x46;
  42 else
  43 p[0]=0x44;
  44 }
  45 #define LED_ORANGE 0xc0220133
  46 void newled(int state)
  47 {
  48 volatile long *p=(void*)LED_ORANGE;
  49 if (state)
  50 p[0]=0x46;
  51 else
  52 p[0]=0x44;
  53 }
  54 void orange_led(int state)
  55 {
  56 volatile long *p=(void*)LED_ORANGE;
  57 if (state)
  58 p[0]=0x46;
  59 else
  60 p[0]=0x44;
  61 }
  62 #define LED_GREEN 0xc0220136
  63 void green_led(int state)
  64 {
  65 volatile long *p=(void*)LED_GREEN;
  66 if (state)
  67 p[0]=0x46;
  68 else
  69 p[0]=0x44;
  70 }
  71 #define LED_YELLOW 0xc02200D8
  72 void yellow_led(__attribute__ ((unused))int state)
  73 {
  74 }
  75 void timer_led(int state)
  76 {
  77 debug_led(state);
  78 }
  79 int get_flash_params_count(void){
  80 return 114; 
  81 }
  82 
  83 // PTP display stuff
  84 // TODO type may not be correct
  85 int vid_get_palette_type() { return 1; }
  86 int vid_get_palette_size() { return 16*4; }
  87 
  88 void *vid_get_bitmap_active_palette() 
  89 {
  90     return (void *)0x46384;        //Found @ 0xff8e736c - Two refs to "BmpDDev"
  91 }
  92 
  93 void *vid_get_bitmap_active_buffer() 
  94 {
  95     return (void*)(*(int*)0xD18C); //Found @ 0xff8e736c - Two refs to "BmpDDev"
  96 }
  97 

/* [<][>][^][v][top][bottom][index][help] */