root/platform/ixus90_sd790/lib.c

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

DEFINITIONS

This source file includes following definitions.
  1. shutdown
  2. debug_led
  3. debug_led_c
  4. camera_set_led
  5. JogDial_CW
  6. JogDial_CCW
  7. get_flash_params_count
  8. vid_get_palette_type
  9. vid_get_palette_size
  10. vid_get_bitmap_active_palette
  11. vid_get_bitmap_active_buffer

   1 #include "platform.h"
   2 #include "lolevel.h"
   3 #include "leds.h"
   4 
   5 void shutdown()
   6 {
   7     volatile long *p = (void*)0xc02200a0;
   8         
   9     asm(
  10          "MRS     R1, CPSR\n"
  11          "AND     R0, R1, #0x80\n"
  12          "ORR     R1, R1, #0x80\n"
  13          "MSR     CPSR_cf, R1\n"
  14          :::"r1","r0");
  15         
  16     *p = 0x44;
  17 
  18     while(1);
  19 }
  20 
  21 void debug_led(int state)
  22 {
  23         volatile long *p=(void*)LED_ORANGE;
  24         if (state)
  25         p[0]=0x46;
  26         else
  27         p[0]=0x44;
  28 }
  29 
  30 void debug_led_c(int color, int state)
  31 {
  32     volatile long *p;
  33         if (color==0)
  34                 p=(void*)LED_PR;
  35         else if (color==1)
  36                 p=(void*)LED_GREEN;
  37         else if (color==2)
  38                 p=(void*)LED_ORANGE;
  39         else
  40                 p=(void*)LED_AF;
  41 
  42     if (state)
  43         p[0]=0x46;
  44     else
  45         p[0]=0x44;
  46 }
  47 
  48 //  fe50 10-Aug-2008
  49 void camera_set_led(int led, int state, int bright)
  50 {
  51         // "brigth" not implemented
  52         // YELLOW not available
  53         // TIMER -> LED_AF
  54         int leds[] = {0x134,0x130,0x134,0x130,0xd4,0x3030,0x3030};  //  green=4 | (yellow) | (not used) | orange | blue | af beam | timer
  55 //      if(led < 4 || led > 10 || led == 6)  //  map to valid params;  no extra TIMER LED (is same as AF)
  56         volatile long *p=(void*)0xc0220000 + leds[(led-4)%sizeof(leds)];
  57         if (state)
  58                 p[0]=0x46;
  59         else
  60                 p[0]=0x44;
  61 }
  62 
  63 //void camera_set_led(int led, int state, int bright)
  64 //{
  65 //      static char led_table[5]={4,5,7,8,9};
  66 //      _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
  67 //}
  68 
  69 void JogDial_CW(void)
  70 {
  71         _PostLogicalEventForNotPowerType(0x874, 1);  // RotateJogDialRight
  72 }
  73 
  74 void JogDial_CCW(void)
  75 {
  76         _PostLogicalEventForNotPowerType(0x875, 1);  // RotateJogDialLeft
  77 }
  78 
  79 // 0x73 @ FF95D668
  80 int get_flash_params_count(void) { return 115; }
  81 
  82 // PTP display stuff
  83 // TODO type may not be correct
  84 int vid_get_palette_type() { return 1; }
  85 int vid_get_palette_size() { return 16*4; }
  86 
  87 void *vid_get_bitmap_active_palette() 
  88 {
  89     return (void *)0x3EF20;        //Found @ 0xff8eaf94 - Two refs to "BmpDDev"
  90 }
  91 
  92 void *vid_get_bitmap_active_buffer() 
  93 {
  94     return (void*)(*(int*)0x7EC8); //Found @ 0xff8eaf94 - Two refs to "BmpDDev"
  95 }

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