root/platform/sx100is/lib.c

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

DEFINITIONS

This source file includes following definitions.
  1. shutdown
  2. led_on
  3. led_off
  4. debug_led
  5. get_flash_params_count
  6. vid_get_palette_type
  7. vid_get_palette_size
  8. vid_get_bitmap_active_palette
  9. vid_get_bitmap_active_buffer

   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 #define LED_PR  0xc02200C4
  20 #define LED_RED 0xc02200C8
  21 #define LED_GRN 0xc02200CF
  22 #define LED_PWR 0xc02200D0
  23 
  24 void led_on(int led)
  25 {
  26     volatile long *p=(void*)0;
  27         switch (led) {
  28                 case 0:
  29                         p = (void*)LED_RED;
  30                         break;
  31                 case 1:
  32                         p = (void*)LED_GRN;
  33                         break;
  34                 case 2:
  35                         p = (void*)LED_PWR;
  36                         break;
  37                 case 3:
  38                         p = (void*)LED_PR;
  39                         break;
  40         }
  41         if(p) {
  42                 p[0] = 0x46;
  43         }
  44 }
  45 
  46 void led_off(int led)
  47 {
  48     volatile long *p=(void*)0;
  49         switch (led) {
  50                 case 0:
  51                         p = (void*)LED_RED;
  52                         break;
  53                 case 1:
  54                         p = (void*)LED_GRN;
  55                         break;
  56                 case 2:
  57                         p = (void*)LED_PWR;
  58                         break;
  59                 case 3:
  60                         p = (void*)LED_PR;
  61                         break;
  62         }
  63         if(p) {
  64                 p[0] = 0x44;
  65         }
  66 }
  67 
  68 void debug_led(int state)
  69 {
  70     volatile long *p=(void*)LED_PR;
  71     if (state)
  72         p[0]=0x46;
  73     else
  74         p[0]=0x44;
  75 }
  76 
  77 #define LED_AF 0xc02200C0
  78 
  79 int get_flash_params_count(void){
  80  return 114;
  81 }
  82 
  83 // PTP display stuff
  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 *)0x422f8;        //Found @ 0xffcd22b4 - Two refs to "BmpDDev"
  90 }
  91 
  92 void *vid_get_bitmap_active_buffer() 
  93 {
  94     return (void*)(*(int*)0x99a8); //Found @ 0xffcd22b4 - Two refs to "BmpDDev"
  95 }

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