root/platform/ixus200_sd980/lib.c

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

DEFINITIONS

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

   1 #include "platform.h"
   2 #include "lolevel.h"
   3 
   4 extern int enabled_refresh_physical_screen;
   5 void vid_bitmap_refresh()
   6 {
   7         enabled_refresh_physical_screen=1;
   8         *(int*)0x1B2DC=3;//this is set somewhere in a function called by RefreshPhysicalScreen, should be easy to find
   9 
  10         _RefreshPhysicalScreen(1);
  11 }
  12 
  13 
  14 void shutdown()
  15 {
  16         volatile long *p = (void*)0xC022001C;
  17 
  18         asm(
  19                 "MRS     R1, CPSR\n"
  20                 "AND     R0, R1, #0x80\n"
  21                 "ORR     R1, R1, #0x80\n"
  22                 "MSR     CPSR_cf, R1\n"
  23                 :::"r1","r0");
  24 
  25         *p = 0x44;  // power off.
  26 
  27         while(1);
  28 }
  29 
  30 #define LED_PR 0xC0220130
  31 
  32 void debug_led(int state)
  33 {
  34  *(int*)LED_PR=state ? 0x46 : 0x44;
  35 }
  36 
  37 void ubasic_set_led(int led, int state, __attribute__ ((unused))int bright) {
  38  static char led_table[5]={4,5,7,8,9};
  39  _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
  40 }
  41 
  42 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
  43  static char led_table[5]={4,5,7,8,9};
  44  _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
  45 }
  46 
  47 int get_flash_params_count(void) 
  48 { 
  49         return 0x84;                           // Found @0xff979b5c
  50 }
  51 
  52 void JogDial_CW(void){
  53  _PostLogicalEventToUI(0x876, 2);  // RotateJogDialRight
  54 }
  55 
  56 void JogDial_CCW(void){
  57  _PostLogicalEventToUI(0x877, 2);  // RotateJogDialLeft
  58 }
  59 
  60 // Functions for PTP Live View system
  61 int vid_get_palette_type()                      { return 3 ; }
  62 int vid_get_palette_size()                      { return 256 * 4 ; }
  63 
  64 void *vid_get_bitmap_active_palette()
  65 {
  66     extern int active_palette_buffer;
  67     extern char** palette_buffer_ptr;
  68     return palette_buffer_ptr[active_palette_buffer]+8;
  69 }

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