• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#include "../sensor_common.hcs"
2root {
3    accel_mxc6655xa_chip_config : sensorConfig {
4        match_attr = "hdf_sensor_accel_mxc6655xa_driver";
5        sensorInfo :: sensorDeviceInfo {
6            sensorName = "accelerometer";
7            vendorName = "memsi_mxc6655xa"; // max string length is 16 bytes
8            sensorTypeId = 1; // enum SensorTypeTag
9            sensorId = 1; // user define sensor id
10            power = 230;
11            minDelay = 5000000; // nanosecond
12            maxDelay = 200000000; // nanosecond
13        }
14        sensorBusConfig :: sensorBusInfo {
15            busType = 0; // 0:i2c 1:spi
16            busNum = 5;
17            busAddr = 0x15;
18            regWidth = 1; // 1byte
19        }
20        sensorIdAttr :: sensorIdInfo {
21            chipName = "mxc6655xa";
22            chipIdRegister = 0x0f;
23            chipIdValue = 0x05;
24        }
25        sensorDirection {
26            direction = 1; // chip direction range of value:0-7
27            /* <sign> 1:negative  0:positive
28               <map> 0:AXIS_X  1:AXIS_Y  2:AXIS_Z
29            */
30            /* sign[AXIS_X], sign[AXIS_Y], sign[AXIS_Z], map[AXIS_X], map[AXIS_Y], map[AXIS_Z] */
31            convert = [
32                0, 0, 0, 0, 1, 2,
33                1, 0, 0, 1, 0, 2,
34                0, 0, 1, 0, 1, 2,
35                0, 1, 0, 1, 0, 2,
36                1, 0, 1, 0, 1, 2,
37                0, 0, 1, 1, 0, 2,
38                0, 1, 1, 0, 1, 2,
39                1, 1, 1, 1, 0, 2
40            ];
41        }
42        sensorRegConfig {
43            /*  regAddr: register address
44                value: config register value
45                len: size of value
46                mask: mask of value
47                delay: config register delay time (ms)
48                opsType: enum SensorOpsType 0-none 1-read 2-write 3-read_check 4-update_bit
49                calType: enum SensorBitCalType 0-none 1-set 2-revert 3-xor 4-left shift 5-right shift
50                shiftNum: shift bits
51                debug: 0-no debug 1-debug
52                save: 0-no save 1-save
53            */
54            /* regAddr, value, mask, len, delay, opsType, calType, shiftNum, debug, save */
55            initSeqConfig = [
56                0x7e,    0xb6, 0xff,   1,     5,       2,       0,        0,     0,    0,
57                0x7e,    0x10, 0xff,   1,     5,       2,       0,        0,     0,    0
58            ];
59            enableSeqConfig = [
60                0x7e,    0x11, 0xff,   1,     5,       2,       0,        0,     0,    0,
61                0x41,    0x03, 0xff,   1,     0,       2,       0,        0,     0,    0,
62                0x40,    0x08, 0xff,   1,     0,       2,       0,        0,     0,    0
63            ];
64            disableSeqConfig = [
65                0x7e,    0x10, 0xff,   1,     5,       2,       0,        0,     0,    0
66            ];
67        }
68    }
69}
70