#ifndef _GSENSOR_MANAGE_H #define _GSENSOR_MANAGE_H #include "printf.h" #include "cpu.h" #include "device/iic.h" #include "asm/iic.h" #include "timer.h" #include "app_config.h" #include "event.h" #include "device_event.h" #include "system/includes.h" #define GRA_SEN_OFF 0 #define GRA_SEN_LO 1 #define GRA_SEN_MD 2 #define GRA_SEN_HI 3 extern unsigned char gravity_sensor_command(unsigned char w_chip_id, unsigned char register_address, unsigned char function_command); extern unsigned char _gravity_sensor_get_data(unsigned char w_chip_id, unsigned char r_chip_id, unsigned char register_address); typedef struct { unsigned char logo[20]; char (*gravity_sensor_check)(void); void (*gravity_sensor_init)(void); int (*gravity_sensor_sensity)(unsigned char gsid); // void (*gravity_sensor_interrupt)(void *pr); // int (*gravity_sensor_read)(unsigned char reg); // int (*gravity_sensor_wirte)(unsigned char reg, unsigned char reg_dat); } _G_SENSOR_INTERFACE; typedef struct gravity_sensor_device { struct device dev; _G_SENSOR_INTERFACE *gsensor_ops; } G_SENSOR_INTERFACE; struct gsensor_platform_data { const char *iic; }; extern G_SENSOR_INTERFACE gsensor_dev_begin[]; extern G_SENSOR_INTERFACE gsensor_dev_end[]; //G_SENSOR_INTERFACE gsensor_dev_begin[]; //G_SENSOR_INTERFACE gsensor_dev_end[]; #define REGISTER_GRAVITY_SENSOR(gSensor) \ static G_SENSOR_INTERFACE gSensor SEC_USED(.gsensor_dev) = { #define list_for_each_gsensor(c) \ for (c=gsensor_dev_begin; c