root/platform/sx110is/lib.c

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

DEFINITIONS

This source file includes following definitions.
  1. vid_bitmap_refresh
  2. shutdown
  3. debug_led
  4. camera_set_led
  5. get_flash_params_count
  6. JogDial_CW
  7. JogDial_CCW

   1 #include "platform.h"
   2 #include "lolevel.h"
   3 
   4 #define LED_PR  0xc02200C4
   5 #define LED_RED 0xc02200C8
   6 #define LED_GRN 0xc02200CC
   7 #define LED_PWR 0xc02200D0
   8 
   9 void vid_bitmap_refresh()
  10 {
  11  extern int enabled_refresh_physical_screen;
  12  enabled_refresh_physical_screen=1;
  13  _RefreshPhysicalScreen(1);
  14 }
  15 
  16 
  17 void shutdown()
  18 {
  19 
  20 /*
  21 ROM:FFC0CD8C                 LDR     R1, =0xC0220000
  22 ROM:FFC0CD90                 MOV     R0, #0x44
  23 ROM:FFC0CD94                 STR     R0, [R1,#0x54]
  24 ROM:FFC0CD98                 STR     R0, [R1,#0x4C]
  25 
  26 
  27 C0220000+54+4C=0xC02200A0
  28 
  29 */
  30 
  31         volatile long *p = (void*)0xC02200A0;    
  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 }
  44 
  45 
  46 void debug_led(int state)
  47 {
  48  *(int*)LED_PR=state ? 0x46 : 0x44;
  49  *(int*)LED_GRN=state ? 0x46 : 0x44;
  50 }
  51 
  52 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
  53  static char led_table[5]={4,5,7,8,9};
  54  _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
  55 }
  56 
  57 int get_flash_params_count(void){
  58  return 120; 
  59 }
  60 
  61 void JogDial_CW(void){
  62  _PostLogicalEventForNotPowerType(0x874, 1);  // RotateJogDialRight
  63 }
  64 
  65 void JogDial_CCW(void){
  66  _PostLogicalEventForNotPowerType(0x875, 1);  // RotateJogDialLeft
  67 }
  68 
  69 
  70 

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