root/platform/sx1/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 void vid_bitmap_refresh()
   5 {
   6  extern int enabled_refresh_physical_screen;
   7  enabled_refresh_physical_screen=1;
   8  _RefreshPhysicalScreen(1);
   9 }
  10 
  11 
  12 void shutdown()
  13 {
  14         volatile long *p = (void*)0xC022001C;    
  15         
  16         asm(
  17                 "MRS     R1, CPSR\n"
  18                 "AND     R0, R1, #0x80\n"
  19                 "ORR     R1, R1, #0x80\n"
  20                 "MSR     CPSR_cf, R1\n"
  21                 :::"r1","r0");
  22         
  23         *p = 0x44;  // power off.
  24         
  25         while(1);
  26 }
  27 
  28 #define LED_PR 0xC02200B4
  29 
  30 void debug_led(__attribute__ ((unused))int state)
  31 {
  32 // disable for now, since this is reportedly the AF LED. Someone find the DP please
  33 // *(int*)LED_PR=state ? 0x46 : 0x44;
  34 }
  35 
  36 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
  37  static char led_table[5]={4,5,7,8,9};
  38  _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
  39 }
  40 
  41 int get_flash_params_count(void){
  42  return 120; 
  43 }
  44 
  45 void JogDial_CW(void){
  46  _PostLogicalEventForNotPowerType(0x874, 1);  // RotateJogDialRight
  47 }
  48 
  49 void JogDial_CCW(void){
  50  _PostLogicalEventForNotPowerType(0x875, 1);  // RotateJogDialLeft
  51 }

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