root/platform/a530/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 #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 
  23 #define LED_PR 0xc0220084
  24 void debug_led(int state)
  25 {
  26     volatile long *p=(void*)LED_PR;
  27     if (state)
  28         p[0]=0x46;
  29     else
  30         p[0]=0x44;
  31 }
  32 
  33 #define LED_AF 0xc0220080
  34 void camera_set_led(int led, int state, __attribute__ ((unused))int bright)
  35 {
  36   int leds[] = {12,16,4,8,4,0,4};
  37   if(led < 4 || led > 10 || led == 6) return;
  38   volatile long *p=(void*)LED_AF + leds[led-4];
  39     if (state)
  40         p[0]=0x46;
  41     else
  42         p[0]=0x44;
  43 }

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