root/platform/ixus950_sd850/lib.c

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

DEFINITIONS

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

   1 #include "platform.h"
   2 
   3 int get_flash_params_count(void){
   4  return 111;
   5 }
   6 
   7 void shutdown()
   8 {
   9     volatile long *p = (void*)0xc02200a0;
  10         
  11     asm(
  12          "MRS     R1, CPSR\n"
  13          "AND     R0, R1, #0x80\n"
  14          "ORR     R1, R1, #0x80\n"
  15          "MSR     CPSR_cf, R1\n"
  16          :::"r1","r0");
  17         
  18     *p = 0x44;
  19 
  20     while(1);
  21 }
  22 //LED ports:
  23 //AF:           0xC02200C0
  24 //Print (blue): 0xC02200C4
  25 //Orange:               0xC02200C8
  26 //Gr//een:              0xC02200CC
  27 //Yellow:       0xC02200D0
  28 //Power (green):        0xC02200D4
  29 
  30 
  31 #define LED_PR 0xC02200C4
  32 
  33 void debug_led(int state)
  34 {
  35     volatile long *p=(void*)LED_PR;
  36     if (state)
  37         p[0]=0x46;
  38     else
  39         p[0]=0x44;
  40 }
  41 
  42 #define LED_BASE 0xC02200C0
  43 
  44 void camera_set_led(int led, int state, __attribute__ ((unused))int bright)
  45 
  46 {
  47   int leds[] = {12,16,-1,8,4,0,20}; // cannot quite figure, in which order they're supposed to be..
  48   if(led < 4 || led > 10 || led == 6) return;
  49   volatile long *p=(void*)LED_BASE + leds[led-4];
  50     if (state)
  51         p[0]=0x46;
  52     else
  53         p[0]=0x44;
  54 }
  55 
  56 void *vid_get_bitmap_active_buffer()
  57 {
  58     return (void*)(*(int*)0xa250);  // in sub_FFA2DE78 for 100c
  59 }
  60 
  61 void *vid_get_bitmap_active_palette() {
  62     return (void *)0x584e8;         // in sub_FFA2DE78 for 100c
  63 }
  64 
  65 int vid_get_palette_type() { return 1; }
  66 int vid_get_palette_size() { return 16*4; }

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