root/platform/a570/lib.c

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

DEFINITIONS

This source file includes following definitions.
  1. shutdown
  2. debug_led
  3. get_flash_params_count
  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 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 
  20 #define LED_PR 0xc02200C4
  21 
  22 void debug_led(int state)
  23 {
  24     volatile long *p=(void*)LED_PR;
  25     if (state)
  26         p[0]=0x46;
  27     else
  28         p[0]=0x44;
  29 }
  30 
  31 
  32 int get_flash_params_count(void){
  33  return 111;
  34 }
  35 
  36 #define LED_BASE 0xc02200C0
  37 
  38 void camera_set_led(int led, int state, __attribute__ ((unused))int bright)
  39 
  40 {
  41   int leds[] = {12,16,4,8,4,0,4};
  42   if(led < 4 || led > 10 || led == 6) return;
  43   volatile long *p=(void*)LED_BASE + leds[led-4];
  44     if (state)
  45         p[0]=0x46;
  46     else
  47         p[0]=0x44;
  48 }
  49 
  50 void *vid_get_bitmap_active_buffer()
  51 {
  52     return (void*)(*(int*)0x7bc0);  // in sub_ffddcda8 for 100e
  53                                     // in sub_ffddce1c for 101a
  54 }
  55 
  56 void *vid_get_bitmap_active_palette() {
  57     return (void *)0x54360; // in sub_ffddcda8 for 100e
  58                             // in sub_ffddce1c for 101a 
  59 }
  60 
  61 int vid_get_palette_type() { return 1; }
  62 int vid_get_palette_size() { return 16*4; }

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