12 #define FXLC95000_HDR_SIZE 4 15 #define FXLC95000_SAMPLE_OFFSET 16 18 #define FXLC95000_BUILD_ID_OFFSET 12 21 #define FXLC95000_BUILD_ID_SIZE 2 24 #define FXLC95000_BUILD_ID 0x36C2 27 #define FXLC95000_RESERVED_ID 0xFFFF 30 #define FXLC95000_PART_NUMBER_OFFSET 14 33 #define FXLC95000_PART_NUMBER_SIZE 2 36 #define FXLC95000_PART_NUMBER 0x5000 39 #define FXLC95000_I2C_ADDRESS 0x4C 42 #define FXLC95000_SET_ODR_CMD_HDR 0x02, 0x02, 0x03, 0x04 45 #define FXLC95000_SET_RESOLUTION_CMD_HDR 0x02, 0x02, 0x07, 0x01 48 #define FXLC95000_SET_RANGE_CMD_HDR 0x02, 0x02, 0x08, 0x01 51 #define FXLC95000_SST_ODR_PAYLOAD(x) (x & 0xFF000000) >> 24, (x & 0xFF0000) >> 16, (x & 0xFF00) >> 8, (x & 0xFF) 54 #define FXLC95000_ACCEL_RANGE_2G 0x40 57 #define FXLC95000_ACCEL_RANGE_4G 0x80 60 #define FXLC95000_ACCEL_RANGE_8G 0xC0 63 #define FXLC95000_ACCEL_RESOLUTION_10_BIT 0x0C 66 #define FXLC95000_ACCEL_RESOLUTION_12_BIT 0x08 69 #define FXLC95000_ACCEL_RESOLUTION_14_BIT 0x04 72 #define FXLC95000_ACCEL_RESOLUTION_16_BIT 0x00 74 static const uint8_t BootToFlash[] = {0x29, 0x00, 0xFF, 0xFF, 0xFF, 0xFF};
75 static const uint8_t GetDeviceInfoCmd[] = {0x00, 0x00};
76 static const uint8_t ConfigureMBoxCmd[] = {0x01, 0x02, 0x18, 0x14, 0x02, 0x03, 0x02, 0x02, 0x02, 0x01, 0x02, 0x00,
77 0x02, 0x05, 0x02, 0x04, 0x02, 0x07, 0x02, 0x06, 0x02, 0x09, 0x02, 0x08};
78 static const uint8_t QuickReadInterruptEnable[] = {0x01, 0x02, 0x38, 0x01, 0x01};
79 static const uint8_t QuickReadInterruptDisable[] = {0x01, 0x02, 0x38, 0x01, 0x00};
80 static const uint8_t StartDataCmd[] = {0x02, 0x02, 0x00, 0x01, 0x52};
81 static const uint8_t StopDataCmd[] = {0x02, 0x02, 0x00, 0x01, 0x51};
82 static const uint8_t ShutdownCmd[] = {0x02, 0x02, 0x00, 0x01, 0x50};
83 static const uint8_t UnprotectFlash[] = {0x40, 0x00};
84 static const uint8_t EraseMainFlashArray[] = {0x12, 0xC5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF};
85 static const uint8_t ProtectFlash[] = {0x38, 0x00};