ISSDK  1.7
IoT Sensing Software Development Kit
fxlc95000.h
Go to the documentation of this file.
1 /**
2  * @file fxlc95000.h
3  * @brief The fxlc95000.h contains the FXLC95000L Digital Accelerometer command definitions and access macros.
4  * The commands and definitions are valid only when ISF1P195K GetAccelDataWithCI is running on FXLC95000.
5  * Refer to Section 2 of FXLC95000CL Data Sheet for details on ISF and associated ISF1P195K_SW_REFERENCE_RM for
6  * ISF1P195K software.
7  * @copyright Copyright (c) 2016, Freescale Semiconductor, Inc.
8  */
9 #ifndef FXLC95000_H_
10 #define FXLC95000_H_
11 
12 /*! @brief Size of fixed header bytes in sensor commands. */
13 #define FXLC95000_HDR_SIZE 4
14 
15 /*! @brief Time stamp and XYZ Data Register Offset. */
16 #define FXLC95000_SAMPLE_OFFSET 16
17 
18 /*! @brief Offset of 2-Byte ISF1.1_95k_Build_ID in Device Info Response. */
19 #define FXLC95000_BUILD_ID_OFFSET 12
20 
21 /*! @brief The FXLC95000 Size of ISF1.1_95k_Build_ID. */
22 #define FXLC95000_BUILD_ID_SIZE 2
23 
24 /*! @brief The FXLC95000 BCD encoded ISF1.1_95k_Build_ID. */
25 #define FXLC95000_BUILD_ID 0x36C2
26 
27 /*! @brief The FXLC95000 Reserved filed bytes. */
28 #define FXLC95000_RESERVED_ID 0xFFFF
29 
30 /*! @brief Offset of 2-Byte SA95000 Part Number in Device Info Response. */
31 #define FXLC95000_PART_NUMBER_OFFSET 14
32 
33 /*! @brief The FXLC95000 Size of Part Number. */
34 #define FXLC95000_PART_NUMBER_SIZE 2
35 
36 /*! @brief The FXLC95000 2-byte packed BCD encoded Part Number (BCD for Last 4 characters). */
37 #define FXLC95000_PART_NUMBER 0x5000
38 
39 /*! @brief The FXLC95000 I2C Slave Address */
40 #define FXLC95000_I2C_ADDRESS 0x4C
41 
42 /*! @brief The FXLC95000 Set Report Rate Command Header Bytes */
43 #define FXLC95000_SET_ODR_CMD_HDR 0x02, 0x02, 0x03, 0x04
44 
45 /*! @brief The FXLC95000 Set Resolution Command Header Bytes */
46 #define FXLC95000_SET_RESOLUTION_CMD_HDR 0x02, 0x02, 0x07, 0x01
47 
48 /*! @brief The FXLC95000 Set Range Command Header Bytes */
49 #define FXLC95000_SET_RANGE_CMD_HDR 0x02, 0x02, 0x08, 0x01
50 
51 /*! @brief The FXLC95000 Set Report Rate Payload Bytes */
52 #define FXLC95000_SST_ODR_PAYLOAD(x) (x & 0xFF000000) >> 24, (x & 0xFF0000) >> 16, (x & 0xFF00) >> 8, (x & 0xFF)
53 
54 /*! @brief The FXLC95000 FS Range 2G */
55 #define FXLC95000_ACCEL_RANGE_2G 0x40
56 
57 /*! @brief The FXLC95000 FS Range 4G */
58 #define FXLC95000_ACCEL_RANGE_4G 0x80
59 
60 /*! @brief The FXLC95000 FS Range 8G */
61 #define FXLC95000_ACCEL_RANGE_8G 0xC0
62 
63 /*! @brief The FXLC95000 Resoultion 10-Bit */
64 #define FXLC95000_ACCEL_RESOLUTION_10_BIT 0x0C
65 
66 /*! @brief The FXLC95000 Resoultion 12-Bit */
67 #define FXLC95000_ACCEL_RESOLUTION_12_BIT 0x08
68 
69 /*! @brief The FXLC95000 Resoultion 14-Bit */
70 #define FXLC95000_ACCEL_RESOLUTION_14_BIT 0x04
71 
72 /*! @brief The FXLC95000 Resoultion 16-Bit */
73 #define FXLC95000_ACCEL_RESOLUTION_16_BIT 0x00
74 
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};
87 
88 #endif /* FXLC95000_H_ */