root/platform/a640/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

   1 
   2 int get_flash_params_count(void){
   3  return 110;
   4 }
   5 
   6 void shutdown()
   7 {
   8     volatile long *p = (void*)0xc02200a0;
   9         
  10     asm(
  11          "MRS     R1, CPSR\n"
  12          "AND     R0, R1, #0x80\n"
  13          "ORR     R1, R1, #0x80\n"
  14          "MSR     CPSR_cf, R1\n"
  15          :::"r1","r0");
  16         
  17     *p = 0x44;
  18 
  19     while(1);
  20 }
  21 
  22 #define LED_PR 0xc0220084
  23 void debug_led(int state)
  24 {
  25     volatile long *p=(void*)LED_PR;
  26     if (state)
  27         p[0]=0x46;
  28     else
  29         p[0]=0x44;
  30 }
  31 
  32 #define LED_AF 0xc0220080
  33 void camera_set_led(int led, int state, __attribute__ ((unused))int bright)
  34 {
  35   int leds[] = {12,16,4,8,4,0,4};
  36   if(led < 4 || led > 10 || led == 6) return;
  37   volatile long *p=(void*)LED_AF + leds[led-4];
  38     if (state)
  39         p[0]=0x46;
  40     else
  41         p[0]=0x44;
  42 }

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