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