13 #define FXLC95000_HDR_SIZE 4 16 #define FXLC95000_SAMPLE_OFFSET 16 19 #define FXLC95000_BUILD_ID_OFFSET 12 22 #define FXLC95000_BUILD_ID_SIZE 2 25 #define FXLC95000_BUILD_ID 0x36C2 28 #define FXLC95000_RESERVED_ID 0xFFFF 31 #define FXLC95000_PART_NUMBER_OFFSET 14 34 #define FXLC95000_PART_NUMBER_SIZE 2 37 #define FXLC95000_PART_NUMBER 0x5000 40 #define FXLC95000_I2C_ADDRESS 0x4C 43 #define FXLC95000_SET_ODR_CMD_HDR 0x02, 0x02, 0x03, 0x04 46 #define FXLC95000_SET_RESOLUTION_CMD_HDR 0x02, 0x02, 0x07, 0x01 49 #define FXLC95000_SET_RANGE_CMD_HDR 0x02, 0x02, 0x08, 0x01 52 #define FXLC95000_SST_ODR_PAYLOAD(x) (x & 0xFF000000) >> 24, (x & 0xFF0000) >> 16, (x & 0xFF00) >> 8, (x & 0xFF) 55 #define FXLC95000_ACCEL_RANGE_2G 0x40 58 #define FXLC95000_ACCEL_RANGE_4G 0x80 61 #define FXLC95000_ACCEL_RANGE_8G 0xC0 64 #define FXLC95000_ACCEL_RESOLUTION_10_BIT 0x0C 67 #define FXLC95000_ACCEL_RESOLUTION_12_BIT 0x08 70 #define FXLC95000_ACCEL_RESOLUTION_14_BIT 0x04 73 #define FXLC95000_ACCEL_RESOLUTION_16_BIT 0x00 75 static const uint8_t BootToFlash[] = {0x29, 0x00, 0xFF, 0xFF, 0xFF, 0xFF};
76 static const uint8_t GetDeviceInfoCmd[] = {0x00, 0x00};
77 static const uint8_t ConfigureMBoxCmd[] = {0x01, 0x02, 0x18, 0x14, 0x02, 0x03, 0x02, 0x02, 0x02, 0x01, 0x02, 0x00,
78 0x02, 0x05, 0x02, 0x04, 0x02, 0x07, 0x02, 0x06, 0x02, 0x09, 0x02, 0x08};
79 static const uint8_t QuickReadInterruptEnable[] = {0x01, 0x02, 0x38, 0x01, 0x01};
80 static const uint8_t QuickReadInterruptDisable[] = {0x01, 0x02, 0x38, 0x01, 0x00};
81 static const uint8_t StartDataCmd[] = {0x02, 0x02, 0x00, 0x01, 0x52};
82 static const uint8_t StopDataCmd[] = {0x02, 0x02, 0x00, 0x01, 0x51};
83 static const uint8_t ShutdownCmd[] = {0x02, 0x02, 0x00, 0x01, 0x50};
84 static const uint8_t UnprotectFlash[] = {0x40, 0x00};
85 static const uint8_t EraseMainFlashArray[] = {0x12, 0xC5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF};
86 static const uint8_t ProtectFlash[] = {0x38, 0x00};