root/platform/ixus860_sd870/lib.c

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

DEFINITIONS

This source file includes following definitions.
  1. shutdown
  2. debug_led
  3. camera_set_led
  4. get_flash_params_count

   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 
  16     while(1);
  17 }
  18 
  19 //  fe50 10-Aug-2008:  LED adresses on SD870: 
  20 #define LED_PR     0xC02200CC  //0
  21 #define LED_YELLOW 0xc02200D8  //+12  (???)
  22 #define LED_ORANGE 0xc0220133  //+103
  23 #define LED_GREEN  0xc0220136  //+106
  24 #define LED_AF     0xc0223030  //+12132
  25 
  26 void debug_led(int state)
  27 {
  28     volatile long *p=(void*)LED_PR;
  29     if (state)
  30         p[0]=0x46;
  31     else
  32         p[0]=0x44;
  33 }
  34 
  35 //  fe50 10-Aug-2008
  36 void camera_set_led(int led, int state, __attribute__ ((unused))int bright)
  37 {
  38         // "brigth" not implemented
  39         // YELLOW not available
  40         // TIMER -> LED_AF
  41         int leds[] = {106,12,0,103,0,12132,12132};  //  green | yellow | not used | orange | blue | af beam | timer
  42         if(led < 4 || led > 10 || led == 6) return; //  return on invalid params;  no extra TIMER LED (is same as AF)
  43         volatile long *p=(void*)LED_PR + leds[led-4];
  44         if (state)
  45                 p[0]=0x46;
  46         else
  47                 p[0]=0x44;
  48 }
  49 
  50 int get_flash_params_count(void){
  51  return 114; //???
  52 }

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