2 * Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the copyright holder nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
39 /***************************************************************************/
42 ****************************************************************************/
45 /***************************************************************************/
48 ****************************************************************************/
50 /*! @name Global array that stores the configuration file of BMI270 */
51 const uint8_t bmi270_config_file
[] = {
52 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x3d, 0xb1, 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x91, 0x03, 0x80, 0x2e, 0xbc,
53 0xb0, 0x80, 0x2e, 0xa3, 0x03, 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x00, 0xb0, 0x50, 0x30, 0x21, 0x2e, 0x59, 0xf5,
54 0x10, 0x30, 0x21, 0x2e, 0x6a, 0xf5, 0x80, 0x2e, 0x3b, 0x03, 0x00, 0x00, 0x00, 0x00, 0x08, 0x19, 0x01, 0x00, 0x22,
55 0x00, 0x75, 0x00, 0x00, 0x10, 0x00, 0x10, 0xd1, 0x00, 0xb3, 0x43, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
56 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
57 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
58 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
59 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
60 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
61 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
62 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
63 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
64 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0xe0, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
66 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x19, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
67 0xe0, 0xaa, 0x38, 0x05, 0xe0, 0x90, 0x30, 0xfa, 0x00, 0x96, 0x00, 0x4b, 0x09, 0x11, 0x00, 0x11, 0x00, 0x02, 0x00,
68 0x2d, 0x01, 0xd4, 0x7b, 0x3b, 0x01, 0xdb, 0x7a, 0x04, 0x00, 0x3f, 0x7b, 0xcd, 0x6c, 0xc3, 0x04, 0x85, 0x09, 0xc3,
69 0x04, 0xec, 0xe6, 0x0c, 0x46, 0x01, 0x00, 0x27, 0x00, 0x19, 0x00, 0x96, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x0c, 0x00,
70 0xf0, 0x3c, 0x00, 0x01, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x32, 0x00, 0x05, 0x00, 0xee,
71 0x06, 0x04, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x04, 0x00, 0xa8, 0x05, 0xee, 0x06, 0x00, 0x04, 0xbc, 0x02, 0xb3, 0x00,
72 0x85, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
73 0x00, 0x00, 0x00, 0xb4, 0x00, 0x01, 0x00, 0xb9, 0x00, 0x01, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
74 0x00, 0x00, 0x01, 0x00, 0x80, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
75 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
76 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
77 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
78 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2e, 0x00, 0xc1, 0xfd, 0x2d, 0xde,
79 0x00, 0xeb, 0x00, 0xda, 0x00, 0x00, 0x0c, 0xff, 0x0f, 0x00, 0x04, 0xc0, 0x00, 0x5b, 0xf5, 0xc9, 0x01, 0x1e, 0xf2,
80 0x80, 0x00, 0x3f, 0xff, 0x19, 0xf4, 0x58, 0xf5, 0x66, 0xf5, 0x64, 0xf5, 0xc0, 0xf1, 0xf0, 0x00, 0xe0, 0x00, 0xcd,
81 0x01, 0xd3, 0x01, 0xdb, 0x01, 0xff, 0x7f, 0xff, 0x01, 0xe4, 0x00, 0x74, 0xf7, 0xf3, 0x00, 0xfa, 0x00, 0xff, 0x3f,
82 0xca, 0x03, 0x6c, 0x38, 0x56, 0xfe, 0x44, 0xfd, 0xbc, 0x02, 0xf9, 0x06, 0x00, 0xfc, 0x12, 0x02, 0xae, 0x01, 0x58,
83 0xfa, 0x9a, 0xfd, 0x77, 0x05, 0xbb, 0x02, 0x96, 0x01, 0x95, 0x01, 0x7f, 0x01, 0x82, 0x01, 0x89, 0x01, 0x87, 0x01,
84 0x88, 0x01, 0x8a, 0x01, 0x8c, 0x01, 0x8f, 0x01, 0x8d, 0x01, 0x92, 0x01, 0x91, 0x01, 0xdd, 0x00, 0x9f, 0x01, 0x7e,
85 0x01, 0xdb, 0x00, 0xb6, 0x01, 0x70, 0x69, 0x26, 0xd3, 0x9c, 0x07, 0x1f, 0x05, 0x9d, 0x00, 0x00, 0x08, 0xbc, 0x05,
86 0x37, 0xfa, 0xa2, 0x01, 0xaa, 0x01, 0xa1, 0x01, 0xa8, 0x01, 0xa0, 0x01, 0xa8, 0x05, 0xb4, 0x01, 0xb4, 0x01, 0xce,
87 0x00, 0xd0, 0x00, 0xfc, 0x00, 0xc5, 0x01, 0xff, 0xfb, 0xb1, 0x00, 0x00, 0x38, 0x00, 0x30, 0xfd, 0xf5, 0xfc, 0xf5,
88 0xcd, 0x01, 0xa0, 0x00, 0x5f, 0xff, 0x00, 0x40, 0xff, 0x00, 0x00, 0x80, 0x6d, 0x0f, 0xeb, 0x00, 0x7f, 0xff, 0xc2,
89 0xf5, 0x68, 0xf7, 0xb3, 0xf1, 0x67, 0x0f, 0x5b, 0x0f, 0x61, 0x0f, 0x80, 0x0f, 0x58, 0xf7, 0x5b, 0xf7, 0x83, 0x0f,
90 0x86, 0x00, 0x72, 0x0f, 0x85, 0x0f, 0xc6, 0xf1, 0x7f, 0x0f, 0x6c, 0xf7, 0x00, 0xe0, 0x00, 0xff, 0xd1, 0xf5, 0x87,
91 0x0f, 0x8a, 0x0f, 0xff, 0x03, 0xf0, 0x3f, 0x8b, 0x00, 0x8e, 0x00, 0x90, 0x00, 0xb9, 0x00, 0x2d, 0xf5, 0xca, 0xf5,
92 0xcb, 0x01, 0x20, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
93 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
94 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
95 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
96 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
98 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
99 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
100 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
101 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
103 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x50, 0x98, 0x2e,
104 0xd7, 0x0e, 0x50, 0x32, 0x98, 0x2e, 0xfa, 0x03, 0x00, 0x30, 0xf0, 0x7f, 0x00, 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0x00,
105 0x2e, 0x01, 0x80, 0x08, 0xa2, 0xfb, 0x2f, 0x98, 0x2e, 0xba, 0x03, 0x21, 0x2e, 0x19, 0x00, 0x01, 0x2e, 0xee, 0x00,
106 0x00, 0xb2, 0x07, 0x2f, 0x01, 0x2e, 0x19, 0x00, 0x00, 0xb2, 0x03, 0x2f, 0x01, 0x50, 0x03, 0x52, 0x98, 0x2e, 0x07,
107 0xcc, 0x01, 0x2e, 0xdd, 0x00, 0x00, 0xb2, 0x27, 0x2f, 0x05, 0x2e, 0x8a, 0x00, 0x05, 0x52, 0x98, 0x2e, 0xc7, 0xc1,
108 0x03, 0x2e, 0xe9, 0x00, 0x40, 0xb2, 0xf0, 0x7f, 0x08, 0x2f, 0x01, 0x2e, 0x19, 0x00, 0x00, 0xb2, 0x04, 0x2f, 0x00,
109 0x30, 0x21, 0x2e, 0xe9, 0x00, 0x98, 0x2e, 0xb4, 0xb1, 0x01, 0x2e, 0x18, 0x00, 0x00, 0xb2, 0x10, 0x2f, 0x05, 0x50,
110 0x98, 0x2e, 0x4d, 0xc3, 0x05, 0x50, 0x98, 0x2e, 0x5a, 0xc7, 0x98, 0x2e, 0xf9, 0xb4, 0x98, 0x2e, 0x54, 0xb2, 0x98,
111 0x2e, 0x67, 0xb6, 0x98, 0x2e, 0x17, 0xb2, 0x10, 0x30, 0x21, 0x2e, 0x77, 0x00, 0x01, 0x2e, 0xef, 0x00, 0x00, 0xb2,
112 0x04, 0x2f, 0x98, 0x2e, 0x7a, 0xb7, 0x00, 0x30, 0x21, 0x2e, 0xef, 0x00, 0x01, 0x2e, 0xd4, 0x00, 0x04, 0xae, 0x0b,
113 0x2f, 0x01, 0x2e, 0xdd, 0x00, 0x00, 0xb2, 0x07, 0x2f, 0x05, 0x52, 0x98, 0x2e, 0x8e, 0x0e, 0x00, 0xb2, 0x02, 0x2f,
114 0x10, 0x30, 0x21, 0x2e, 0x7d, 0x00, 0x01, 0x2e, 0x7d, 0x00, 0x00, 0x90, 0x90, 0x2e, 0xf1, 0x02, 0x01, 0x2e, 0xd7,
115 0x00, 0x00, 0xb2, 0x04, 0x2f, 0x98, 0x2e, 0x2f, 0x0e, 0x00, 0x30, 0x21, 0x2e, 0x7b, 0x00, 0x01, 0x2e, 0x7b, 0x00,
116 0x00, 0xb2, 0x12, 0x2f, 0x01, 0x2e, 0xd4, 0x00, 0x00, 0x90, 0x02, 0x2f, 0x98, 0x2e, 0x1f, 0x0e, 0x09, 0x2d, 0x98,
117 0x2e, 0x81, 0x0d, 0x01, 0x2e, 0xd4, 0x00, 0x04, 0x90, 0x02, 0x2f, 0x50, 0x32, 0x98, 0x2e, 0xfa, 0x03, 0x00, 0x30,
118 0x21, 0x2e, 0x7b, 0x00, 0x01, 0x2e, 0x7c, 0x00, 0x00, 0xb2, 0x90, 0x2e, 0x09, 0x03, 0x01, 0x2e, 0x7c, 0x00, 0x01,
119 0x31, 0x01, 0x08, 0x00, 0xb2, 0x04, 0x2f, 0x98, 0x2e, 0x47, 0xcb, 0x10, 0x30, 0x21, 0x2e, 0x77, 0x00, 0x81, 0x30,
120 0x01, 0x2e, 0x7c, 0x00, 0x01, 0x08, 0x00, 0xb2, 0x61, 0x2f, 0x03, 0x2e, 0x89, 0x00, 0x01, 0x2e, 0xd4, 0x00, 0x98,
121 0xbc, 0x98, 0xb8, 0x05, 0xb2, 0x0f, 0x58, 0x23, 0x2f, 0x07, 0x90, 0x09, 0x54, 0x00, 0x30, 0x37, 0x2f, 0x15, 0x41,
122 0x04, 0x41, 0xdc, 0xbe, 0x44, 0xbe, 0xdc, 0xba, 0x2c, 0x01, 0x61, 0x00, 0x0f, 0x56, 0x4a, 0x0f, 0x0c, 0x2f, 0xd1,
123 0x42, 0x94, 0xb8, 0xc1, 0x42, 0x11, 0x30, 0x05, 0x2e, 0x6a, 0xf7, 0x2c, 0xbd, 0x2f, 0xb9, 0x80, 0xb2, 0x08, 0x22,
124 0x98, 0x2e, 0xc3, 0xb7, 0x21, 0x2d, 0x61, 0x30, 0x23, 0x2e, 0xd4, 0x00, 0x98, 0x2e, 0xc3, 0xb7, 0x00, 0x30, 0x21,
125 0x2e, 0x5a, 0xf5, 0x18, 0x2d, 0xe1, 0x7f, 0x50, 0x30, 0x98, 0x2e, 0xfa, 0x03, 0x0f, 0x52, 0x07, 0x50, 0x50, 0x42,
126 0x70, 0x30, 0x0d, 0x54, 0x42, 0x42, 0x7e, 0x82, 0xe2, 0x6f, 0x80, 0xb2, 0x42, 0x42, 0x05, 0x2f, 0x21, 0x2e, 0xd4,
127 0x00, 0x10, 0x30, 0x98, 0x2e, 0xc3, 0xb7, 0x03, 0x2d, 0x60, 0x30, 0x21, 0x2e, 0xd4, 0x00, 0x01, 0x2e, 0xd4, 0x00,
128 0x06, 0x90, 0x18, 0x2f, 0x01, 0x2e, 0x76, 0x00, 0x0b, 0x54, 0x07, 0x52, 0xe0, 0x7f, 0x98, 0x2e, 0x7a, 0xc1, 0xe1,
129 0x6f, 0x08, 0x1a, 0x40, 0x30, 0x08, 0x2f, 0x21, 0x2e, 0xd4, 0x00, 0x20, 0x30, 0x98, 0x2e, 0xaf, 0xb7, 0x50, 0x32,
130 0x98, 0x2e, 0xfa, 0x03, 0x05, 0x2d, 0x98, 0x2e, 0x38, 0x0e, 0x00, 0x30, 0x21, 0x2e, 0xd4, 0x00, 0x00, 0x30, 0x21,
131 0x2e, 0x7c, 0x00, 0x18, 0x2d, 0x01, 0x2e, 0xd4, 0x00, 0x03, 0xaa, 0x01, 0x2f, 0x98, 0x2e, 0x45, 0x0e, 0x01, 0x2e,
132 0xd4, 0x00, 0x3f, 0x80, 0x03, 0xa2, 0x01, 0x2f, 0x00, 0x2e, 0x02, 0x2d, 0x98, 0x2e, 0x5b, 0x0e, 0x30, 0x30, 0x98,
133 0x2e, 0xce, 0xb7, 0x00, 0x30, 0x21, 0x2e, 0x7d, 0x00, 0x50, 0x32, 0x98, 0x2e, 0xfa, 0x03, 0x01, 0x2e, 0x77, 0x00,
134 0x00, 0xb2, 0x24, 0x2f, 0x98, 0x2e, 0xf5, 0xcb, 0x03, 0x2e, 0xd5, 0x00, 0x11, 0x54, 0x01, 0x0a, 0xbc, 0x84, 0x83,
135 0x86, 0x21, 0x2e, 0xc9, 0x01, 0xe0, 0x40, 0x13, 0x52, 0xc4, 0x40, 0x82, 0x40, 0xa8, 0xb9, 0x52, 0x42, 0x43, 0xbe,
136 0x53, 0x42, 0x04, 0x0a, 0x50, 0x42, 0xe1, 0x7f, 0xf0, 0x31, 0x41, 0x40, 0xf2, 0x6f, 0x25, 0xbd, 0x08, 0x08, 0x02,
137 0x0a, 0xd0, 0x7f, 0x98, 0x2e, 0xa8, 0xcf, 0x06, 0xbc, 0xd1, 0x6f, 0xe2, 0x6f, 0x08, 0x0a, 0x80, 0x42, 0x98, 0x2e,
138 0x58, 0xb7, 0x00, 0x30, 0x21, 0x2e, 0xee, 0x00, 0x21, 0x2e, 0x77, 0x00, 0x21, 0x2e, 0xdd, 0x00, 0x80, 0x2e, 0xf4,
139 0x01, 0x1a, 0x24, 0x22, 0x00, 0x80, 0x2e, 0xec, 0x01, 0x10, 0x50, 0xfb, 0x7f, 0x98, 0x2e, 0xf3, 0x03, 0x57, 0x50,
140 0xfb, 0x6f, 0x01, 0x30, 0x71, 0x54, 0x11, 0x42, 0x42, 0x0e, 0xfc, 0x2f, 0xc0, 0x2e, 0x01, 0x42, 0xf0, 0x5f, 0x80,
141 0x2e, 0x00, 0xc1, 0xfd, 0x2d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9a, 0x01,
142 0x34, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
143 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
144 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
145 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
146 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
147 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
148 0x00, 0x00, 0x20, 0x50, 0xe7, 0x7f, 0xf6, 0x7f, 0x06, 0x32, 0x0f, 0x2e, 0x61, 0xf5, 0xfe, 0x09, 0xc0, 0xb3, 0x04,
149 0x2f, 0x17, 0x30, 0x2f, 0x2e, 0xef, 0x00, 0x2d, 0x2e, 0x61, 0xf5, 0xf6, 0x6f, 0xe7, 0x6f, 0xe0, 0x5f, 0xc8, 0x2e,
150 0x20, 0x50, 0xe7, 0x7f, 0xf6, 0x7f, 0x46, 0x30, 0x0f, 0x2e, 0xa4, 0xf1, 0xbe, 0x09, 0x80, 0xb3, 0x06, 0x2f, 0x0d,
151 0x2e, 0xd4, 0x00, 0x84, 0xaf, 0x02, 0x2f, 0x16, 0x30, 0x2d, 0x2e, 0x7b, 0x00, 0x86, 0x30, 0x2d, 0x2e, 0x60, 0xf5,
152 0xf6, 0x6f, 0xe7, 0x6f, 0xe0, 0x5f, 0xc8, 0x2e, 0x01, 0x2e, 0x77, 0xf7, 0x09, 0xbc, 0x0f, 0xb8, 0x00, 0xb2, 0x10,
153 0x50, 0xfb, 0x7f, 0x10, 0x30, 0x0b, 0x2f, 0x03, 0x2e, 0x8a, 0x00, 0x96, 0xbc, 0x9f, 0xb8, 0x40, 0xb2, 0x05, 0x2f,
154 0x03, 0x2e, 0x68, 0xf7, 0x9e, 0xbc, 0x9f, 0xb8, 0x40, 0xb2, 0x07, 0x2f, 0x03, 0x2e, 0x7e, 0x00, 0x41, 0x90, 0x01,
155 0x2f, 0x98, 0x2e, 0xdc, 0x03, 0x03, 0x2c, 0x00, 0x30, 0x21, 0x2e, 0x7e, 0x00, 0xfb, 0x6f, 0xf0, 0x5f, 0xb8, 0x2e,
156 0x20, 0x50, 0xe0, 0x7f, 0xfb, 0x7f, 0x00, 0x2e, 0x27, 0x50, 0x98, 0x2e, 0x3b, 0xc8, 0x29, 0x50, 0x98, 0x2e, 0xa7,
157 0xc8, 0x01, 0x50, 0x98, 0x2e, 0x55, 0xcc, 0xe1, 0x6f, 0x2b, 0x50, 0x98, 0x2e, 0xe0, 0xc9, 0xfb, 0x6f, 0x00, 0x30,
158 0xe0, 0x5f, 0x21, 0x2e, 0x7e, 0x00, 0xb8, 0x2e, 0x73, 0x50, 0x01, 0x30, 0x57, 0x54, 0x11, 0x42, 0x42, 0x0e, 0xfc,
159 0x2f, 0xb8, 0x2e, 0x21, 0x2e, 0x59, 0xf5, 0x10, 0x30, 0xc0, 0x2e, 0x21, 0x2e, 0x4a, 0xf1, 0x90, 0x50, 0xf7, 0x7f,
160 0xe6, 0x7f, 0xd5, 0x7f, 0xc4, 0x7f, 0xb3, 0x7f, 0xa1, 0x7f, 0x90, 0x7f, 0x82, 0x7f, 0x7b, 0x7f, 0x98, 0x2e, 0x35,
161 0xb7, 0x00, 0xb2, 0x90, 0x2e, 0x97, 0xb0, 0x03, 0x2e, 0x8f, 0x00, 0x07, 0x2e, 0x91, 0x00, 0x05, 0x2e, 0xb1, 0x00,
162 0x3f, 0xba, 0x9f, 0xb8, 0x01, 0x2e, 0xb1, 0x00, 0xa3, 0xbd, 0x4c, 0x0a, 0x05, 0x2e, 0xb1, 0x00, 0x04, 0xbe, 0xbf,
163 0xb9, 0xcb, 0x0a, 0x4f, 0xba, 0x22, 0xbd, 0x01, 0x2e, 0xb3, 0x00, 0xdc, 0x0a, 0x2f, 0xb9, 0x03, 0x2e, 0xb8, 0x00,
164 0x0a, 0xbe, 0x9a, 0x0a, 0xcf, 0xb9, 0x9b, 0xbc, 0x01, 0x2e, 0x97, 0x00, 0x9f, 0xb8, 0x93, 0x0a, 0x0f, 0xbc, 0x91,
165 0x0a, 0x0f, 0xb8, 0x90, 0x0a, 0x25, 0x2e, 0x18, 0x00, 0x05, 0x2e, 0xc1, 0xf5, 0x2e, 0xbd, 0x2e, 0xb9, 0x01, 0x2e,
166 0x19, 0x00, 0x31, 0x30, 0x8a, 0x04, 0x00, 0x90, 0x07, 0x2f, 0x01, 0x2e, 0xd4, 0x00, 0x04, 0xa2, 0x03, 0x2f, 0x01,
167 0x2e, 0x18, 0x00, 0x00, 0xb2, 0x0c, 0x2f, 0x19, 0x50, 0x05, 0x52, 0x98, 0x2e, 0x4d, 0xb7, 0x05, 0x2e, 0x78, 0x00,
168 0x80, 0x90, 0x10, 0x30, 0x01, 0x2f, 0x21, 0x2e, 0x78, 0x00, 0x25, 0x2e, 0xdd, 0x00, 0x98, 0x2e, 0x3e, 0xb7, 0x00,
169 0xb2, 0x02, 0x30, 0x01, 0x30, 0x04, 0x2f, 0x01, 0x2e, 0x19, 0x00, 0x00, 0xb2, 0x00, 0x2f, 0x21, 0x30, 0x01, 0x2e,
170 0xea, 0x00, 0x08, 0x1a, 0x0e, 0x2f, 0x23, 0x2e, 0xea, 0x00, 0x33, 0x30, 0x1b, 0x50, 0x0b, 0x09, 0x01, 0x40, 0x17,
171 0x56, 0x46, 0xbe, 0x4b, 0x08, 0x4c, 0x0a, 0x01, 0x42, 0x0a, 0x80, 0x15, 0x52, 0x01, 0x42, 0x00, 0x2e, 0x01, 0x2e,
172 0x18, 0x00, 0x00, 0xb2, 0x1f, 0x2f, 0x03, 0x2e, 0xc0, 0xf5, 0xf0, 0x30, 0x48, 0x08, 0x47, 0xaa, 0x74, 0x30, 0x07,
173 0x2e, 0x7a, 0x00, 0x61, 0x22, 0x4b, 0x1a, 0x05, 0x2f, 0x07, 0x2e, 0x66, 0xf5, 0xbf, 0xbd, 0xbf, 0xb9, 0xc0, 0x90,
174 0x0b, 0x2f, 0x1d, 0x56, 0x2b, 0x30, 0xd2, 0x42, 0xdb, 0x42, 0x01, 0x04, 0xc2, 0x42, 0x04, 0xbd, 0xfe, 0x80, 0x81,
175 0x84, 0x23, 0x2e, 0x7a, 0x00, 0x02, 0x42, 0x02, 0x32, 0x25, 0x2e, 0x62, 0xf5, 0x05, 0x2e, 0xd6, 0x00, 0x81, 0x84,
176 0x25, 0x2e, 0xd6, 0x00, 0x02, 0x31, 0x25, 0x2e, 0x60, 0xf5, 0x05, 0x2e, 0x8a, 0x00, 0x0b, 0x50, 0x90, 0x08, 0x80,
177 0xb2, 0x0b, 0x2f, 0x05, 0x2e, 0xca, 0xf5, 0xf0, 0x3e, 0x90, 0x08, 0x25, 0x2e, 0xca, 0xf5, 0x05, 0x2e, 0x59, 0xf5,
178 0xe0, 0x3f, 0x90, 0x08, 0x25, 0x2e, 0x59, 0xf5, 0x90, 0x6f, 0xa1, 0x6f, 0xb3, 0x6f, 0xc4, 0x6f, 0xd5, 0x6f, 0xe6,
179 0x6f, 0xf7, 0x6f, 0x7b, 0x6f, 0x82, 0x6f, 0x70, 0x5f, 0xc8, 0x2e, 0xc0, 0x50, 0x90, 0x7f, 0xe5, 0x7f, 0xd4, 0x7f,
180 0xc3, 0x7f, 0xb1, 0x7f, 0xa2, 0x7f, 0x87, 0x7f, 0xf6, 0x7f, 0x7b, 0x7f, 0x00, 0x2e, 0x01, 0x2e, 0x60, 0xf5, 0x60,
181 0x7f, 0x98, 0x2e, 0x35, 0xb7, 0x02, 0x30, 0x63, 0x6f, 0x15, 0x52, 0x50, 0x7f, 0x62, 0x7f, 0x5a, 0x2c, 0x02, 0x32,
182 0x1a, 0x09, 0x00, 0xb3, 0x14, 0x2f, 0x00, 0xb2, 0x03, 0x2f, 0x09, 0x2e, 0x18, 0x00, 0x00, 0x91, 0x0c, 0x2f, 0x43,
183 0x7f, 0x98, 0x2e, 0x97, 0xb7, 0x1f, 0x50, 0x02, 0x8a, 0x02, 0x32, 0x04, 0x30, 0x25, 0x2e, 0x64, 0xf5, 0x15, 0x52,
184 0x50, 0x6f, 0x43, 0x6f, 0x44, 0x43, 0x25, 0x2e, 0x60, 0xf5, 0xd9, 0x08, 0xc0, 0xb2, 0x36, 0x2f, 0x98, 0x2e, 0x3e,
185 0xb7, 0x00, 0xb2, 0x06, 0x2f, 0x01, 0x2e, 0x19, 0x00, 0x00, 0xb2, 0x02, 0x2f, 0x50, 0x6f, 0x00, 0x90, 0x0a, 0x2f,
186 0x01, 0x2e, 0x79, 0x00, 0x00, 0x90, 0x19, 0x2f, 0x10, 0x30, 0x21, 0x2e, 0x79, 0x00, 0x00, 0x30, 0x98, 0x2e, 0xdc,
187 0x03, 0x13, 0x2d, 0x01, 0x2e, 0xc3, 0xf5, 0x0c, 0xbc, 0x0f, 0xb8, 0x12, 0x30, 0x10, 0x04, 0x03, 0xb0, 0x26, 0x25,
188 0x21, 0x50, 0x03, 0x52, 0x98, 0x2e, 0x4d, 0xb7, 0x10, 0x30, 0x21, 0x2e, 0xee, 0x00, 0x02, 0x30, 0x60, 0x7f, 0x25,
189 0x2e, 0x79, 0x00, 0x60, 0x6f, 0x00, 0x90, 0x05, 0x2f, 0x00, 0x30, 0x21, 0x2e, 0xea, 0x00, 0x15, 0x50, 0x21, 0x2e,
190 0x64, 0xf5, 0x15, 0x52, 0x23, 0x2e, 0x60, 0xf5, 0x02, 0x32, 0x50, 0x6f, 0x00, 0x90, 0x02, 0x2f, 0x03, 0x30, 0x27,
191 0x2e, 0x78, 0x00, 0x07, 0x2e, 0x60, 0xf5, 0x1a, 0x09, 0x00, 0x91, 0xa3, 0x2f, 0x19, 0x09, 0x00, 0x91, 0xa0, 0x2f,
192 0x90, 0x6f, 0xa2, 0x6f, 0xb1, 0x6f, 0xc3, 0x6f, 0xd4, 0x6f, 0xe5, 0x6f, 0x7b, 0x6f, 0xf6, 0x6f, 0x87, 0x6f, 0x40,
193 0x5f, 0xc8, 0x2e, 0xc0, 0x50, 0xe7, 0x7f, 0xf6, 0x7f, 0x26, 0x30, 0x0f, 0x2e, 0x61, 0xf5, 0x2f, 0x2e, 0x7c, 0x00,
194 0x0f, 0x2e, 0x7c, 0x00, 0xbe, 0x09, 0xa2, 0x7f, 0x80, 0x7f, 0x80, 0xb3, 0xd5, 0x7f, 0xc4, 0x7f, 0xb3, 0x7f, 0x91,
195 0x7f, 0x7b, 0x7f, 0x0b, 0x2f, 0x23, 0x50, 0x1a, 0x25, 0x12, 0x40, 0x42, 0x7f, 0x74, 0x82, 0x12, 0x40, 0x52, 0x7f,
196 0x00, 0x2e, 0x00, 0x40, 0x60, 0x7f, 0x98, 0x2e, 0x6a, 0xd6, 0x81, 0x30, 0x01, 0x2e, 0x7c, 0x00, 0x01, 0x08, 0x00,
197 0xb2, 0x42, 0x2f, 0x03, 0x2e, 0x89, 0x00, 0x01, 0x2e, 0x89, 0x00, 0x97, 0xbc, 0x06, 0xbc, 0x9f, 0xb8, 0x0f, 0xb8,
198 0x00, 0x90, 0x23, 0x2e, 0xd8, 0x00, 0x10, 0x30, 0x01, 0x30, 0x2a, 0x2f, 0x03, 0x2e, 0xd4, 0x00, 0x44, 0xb2, 0x05,
199 0x2f, 0x47, 0xb2, 0x00, 0x30, 0x2d, 0x2f, 0x21, 0x2e, 0x7c, 0x00, 0x2b, 0x2d, 0x03, 0x2e, 0xfd, 0xf5, 0x9e, 0xbc,
200 0x9f, 0xb8, 0x40, 0x90, 0x14, 0x2f, 0x03, 0x2e, 0xfc, 0xf5, 0x99, 0xbc, 0x9f, 0xb8, 0x40, 0x90, 0x0e, 0x2f, 0x03,
201 0x2e, 0x49, 0xf1, 0x25, 0x54, 0x4a, 0x08, 0x40, 0x90, 0x08, 0x2f, 0x98, 0x2e, 0x35, 0xb7, 0x00, 0xb2, 0x10, 0x30,
202 0x03, 0x2f, 0x50, 0x30, 0x21, 0x2e, 0xd4, 0x00, 0x10, 0x2d, 0x98, 0x2e, 0xaf, 0xb7, 0x00, 0x30, 0x21, 0x2e, 0x7c,
203 0x00, 0x0a, 0x2d, 0x05, 0x2e, 0x69, 0xf7, 0x2d, 0xbd, 0x2f, 0xb9, 0x80, 0xb2, 0x01, 0x2f, 0x21, 0x2e, 0x7d, 0x00,
204 0x23, 0x2e, 0x7c, 0x00, 0xe0, 0x31, 0x21, 0x2e, 0x61, 0xf5, 0xf6, 0x6f, 0xe7, 0x6f, 0x80, 0x6f, 0xa2, 0x6f, 0xb3,
205 0x6f, 0xc4, 0x6f, 0xd5, 0x6f, 0x7b, 0x6f, 0x91, 0x6f, 0x40, 0x5f, 0xc8, 0x2e, 0x60, 0x51, 0x0a, 0x25, 0x36, 0x88,
206 0xf4, 0x7f, 0xeb, 0x7f, 0x00, 0x32, 0x31, 0x52, 0x32, 0x30, 0x13, 0x30, 0x98, 0x2e, 0x15, 0xcb, 0x0a, 0x25, 0x33,
207 0x84, 0xd2, 0x7f, 0x43, 0x30, 0x05, 0x50, 0x2d, 0x52, 0x98, 0x2e, 0x95, 0xc1, 0xd2, 0x6f, 0x27, 0x52, 0x98, 0x2e,
208 0xd7, 0xc7, 0x2a, 0x25, 0xb0, 0x86, 0xc0, 0x7f, 0xd3, 0x7f, 0xaf, 0x84, 0x29, 0x50, 0xf1, 0x6f, 0x98, 0x2e, 0x4d,
209 0xc8, 0x2a, 0x25, 0xae, 0x8a, 0xaa, 0x88, 0xf2, 0x6e, 0x2b, 0x50, 0xc1, 0x6f, 0xd3, 0x6f, 0xf4, 0x7f, 0x98, 0x2e,
210 0xb6, 0xc8, 0xe0, 0x6e, 0x00, 0xb2, 0x32, 0x2f, 0x33, 0x54, 0x83, 0x86, 0xf1, 0x6f, 0xc3, 0x7f, 0x04, 0x30, 0x30,
211 0x30, 0xf4, 0x7f, 0xd0, 0x7f, 0xb2, 0x7f, 0xe3, 0x30, 0xc5, 0x6f, 0x56, 0x40, 0x45, 0x41, 0x28, 0x08, 0x03, 0x14,
212 0x0e, 0xb4, 0x08, 0xbc, 0x82, 0x40, 0x10, 0x0a, 0x2f, 0x54, 0x26, 0x05, 0x91, 0x7f, 0x44, 0x28, 0xa3, 0x7f, 0x98,
213 0x2e, 0xd9, 0xc0, 0x08, 0xb9, 0x33, 0x30, 0x53, 0x09, 0xc1, 0x6f, 0xd3, 0x6f, 0xf4, 0x6f, 0x83, 0x17, 0x47, 0x40,
214 0x6c, 0x15, 0xb2, 0x6f, 0xbe, 0x09, 0x75, 0x0b, 0x90, 0x42, 0x45, 0x42, 0x51, 0x0e, 0x32, 0xbc, 0x02, 0x89, 0xa1,
215 0x6f, 0x7e, 0x86, 0xf4, 0x7f, 0xd0, 0x7f, 0xb2, 0x7f, 0x04, 0x30, 0x91, 0x6f, 0xd6, 0x2f, 0xeb, 0x6f, 0xa0, 0x5e,
216 0xb8, 0x2e, 0x03, 0x2e, 0x97, 0x00, 0x1b, 0xbc, 0x60, 0x50, 0x9f, 0xbc, 0x0c, 0xb8, 0xf0, 0x7f, 0x40, 0xb2, 0xeb,
217 0x7f, 0x2b, 0x2f, 0x03, 0x2e, 0x7f, 0x00, 0x41, 0x40, 0x01, 0x2e, 0xc8, 0x00, 0x01, 0x1a, 0x11, 0x2f, 0x37, 0x58,
218 0x23, 0x2e, 0xc8, 0x00, 0x10, 0x41, 0xa0, 0x7f, 0x38, 0x81, 0x01, 0x41, 0xd0, 0x7f, 0xb1, 0x7f, 0x98, 0x2e, 0x64,
219 0xcf, 0xd0, 0x6f, 0x07, 0x80, 0xa1, 0x6f, 0x11, 0x42, 0x00, 0x2e, 0xb1, 0x6f, 0x01, 0x42, 0x11, 0x30, 0x01, 0x2e,
220 0xfc, 0x00, 0x00, 0xa8, 0x03, 0x30, 0xcb, 0x22, 0x4a, 0x25, 0x01, 0x2e, 0x7f, 0x00, 0x3c, 0x89, 0x35, 0x52, 0x05,
221 0x54, 0x98, 0x2e, 0xc4, 0xce, 0xc1, 0x6f, 0xf0, 0x6f, 0x98, 0x2e, 0x95, 0xcf, 0x04, 0x2d, 0x01, 0x30, 0xf0, 0x6f,
222 0x98, 0x2e, 0x95, 0xcf, 0xeb, 0x6f, 0xa0, 0x5f, 0xb8, 0x2e, 0x03, 0x2e, 0xb3, 0x00, 0x02, 0x32, 0xf0, 0x30, 0x03,
223 0x31, 0x30, 0x50, 0x8a, 0x08, 0x08, 0x08, 0xcb, 0x08, 0xe0, 0x7f, 0x80, 0xb2, 0xf3, 0x7f, 0xdb, 0x7f, 0x25, 0x2f,
224 0x03, 0x2e, 0xca, 0x00, 0x41, 0x90, 0x04, 0x2f, 0x01, 0x30, 0x23, 0x2e, 0xca, 0x00, 0x98, 0x2e, 0x3f, 0x03, 0xc0,
225 0xb2, 0x05, 0x2f, 0x03, 0x2e, 0xda, 0x00, 0x00, 0x30, 0x41, 0x04, 0x23, 0x2e, 0xda, 0x00, 0x98, 0x2e, 0x92, 0xb2,
226 0x10, 0x25, 0xf0, 0x6f, 0x00, 0xb2, 0x05, 0x2f, 0x01, 0x2e, 0xda, 0x00, 0x02, 0x30, 0x10, 0x04, 0x21, 0x2e, 0xda,
227 0x00, 0x40, 0xb2, 0x01, 0x2f, 0x23, 0x2e, 0xc8, 0x01, 0xdb, 0x6f, 0xe0, 0x6f, 0xd0, 0x5f, 0x80, 0x2e, 0x95, 0xcf,
228 0x01, 0x30, 0xe0, 0x6f, 0x98, 0x2e, 0x95, 0xcf, 0x11, 0x30, 0x23, 0x2e, 0xca, 0x00, 0xdb, 0x6f, 0xd0, 0x5f, 0xb8,
229 0x2e, 0xd0, 0x50, 0x0a, 0x25, 0x33, 0x84, 0x55, 0x50, 0xd2, 0x7f, 0xe2, 0x7f, 0x03, 0x8c, 0xc0, 0x7f, 0xbb, 0x7f,
230 0x00, 0x30, 0x05, 0x5a, 0x39, 0x54, 0x51, 0x41, 0xa5, 0x7f, 0x96, 0x7f, 0x80, 0x7f, 0x98, 0x2e, 0xd9, 0xc0, 0x05,
231 0x30, 0xf5, 0x7f, 0x20, 0x25, 0x91, 0x6f, 0x3b, 0x58, 0x3d, 0x5c, 0x3b, 0x56, 0x98, 0x2e, 0x67, 0xcc, 0xc1, 0x6f,
232 0xd5, 0x6f, 0x52, 0x40, 0x50, 0x43, 0xc1, 0x7f, 0xd5, 0x7f, 0x10, 0x25, 0x98, 0x2e, 0xfe, 0xc9, 0x10, 0x25, 0x98,
233 0x2e, 0x74, 0xc0, 0x86, 0x6f, 0x30, 0x28, 0x92, 0x6f, 0x82, 0x8c, 0xa5, 0x6f, 0x6f, 0x52, 0x69, 0x0e, 0x39, 0x54,
234 0xdb, 0x2f, 0x19, 0xa0, 0x15, 0x30, 0x03, 0x2f, 0x00, 0x30, 0x21, 0x2e, 0x81, 0x01, 0x0a, 0x2d, 0x01, 0x2e, 0x81,
235 0x01, 0x05, 0x28, 0x42, 0x36, 0x21, 0x2e, 0x81, 0x01, 0x02, 0x0e, 0x01, 0x2f, 0x98, 0x2e, 0xf3, 0x03, 0x57, 0x50,
236 0x12, 0x30, 0x01, 0x40, 0x98, 0x2e, 0xfe, 0xc9, 0x51, 0x6f, 0x0b, 0x5c, 0x8e, 0x0e, 0x3b, 0x6f, 0x57, 0x58, 0x02,
237 0x30, 0x21, 0x2e, 0x95, 0x01, 0x45, 0x6f, 0x2a, 0x8d, 0xd2, 0x7f, 0xcb, 0x7f, 0x13, 0x2f, 0x02, 0x30, 0x3f, 0x50,
238 0xd2, 0x7f, 0xa8, 0x0e, 0x0e, 0x2f, 0xc0, 0x6f, 0x53, 0x54, 0x02, 0x00, 0x51, 0x54, 0x42, 0x0e, 0x10, 0x30, 0x59,
239 0x52, 0x02, 0x30, 0x01, 0x2f, 0x00, 0x2e, 0x03, 0x2d, 0x50, 0x42, 0x42, 0x42, 0x12, 0x30, 0xd2, 0x7f, 0x80, 0xb2,
240 0x03, 0x2f, 0x00, 0x30, 0x21, 0x2e, 0x80, 0x01, 0x12, 0x2d, 0x01, 0x2e, 0xc9, 0x00, 0x02, 0x80, 0x05, 0x2e, 0x80,
241 0x01, 0x11, 0x30, 0x91, 0x28, 0x00, 0x40, 0x25, 0x2e, 0x80, 0x01, 0x10, 0x0e, 0x05, 0x2f, 0x01, 0x2e, 0x7f, 0x01,
242 0x01, 0x90, 0x01, 0x2f, 0x98, 0x2e, 0xf3, 0x03, 0x00, 0x2e, 0xa0, 0x41, 0x01, 0x90, 0xa6, 0x7f, 0x90, 0x2e, 0xe3,
243 0xb4, 0x01, 0x2e, 0x95, 0x01, 0x00, 0xa8, 0x90, 0x2e, 0xe3, 0xb4, 0x5b, 0x54, 0x95, 0x80, 0x82, 0x40, 0x80, 0xb2,
244 0x02, 0x40, 0x2d, 0x8c, 0x3f, 0x52, 0x96, 0x7f, 0x90, 0x2e, 0xc2, 0xb3, 0x29, 0x0e, 0x76, 0x2f, 0x01, 0x2e, 0xc9,
245 0x00, 0x00, 0x40, 0x81, 0x28, 0x45, 0x52, 0xb3, 0x30, 0x98, 0x2e, 0x0f, 0xca, 0x5d, 0x54, 0x80, 0x7f, 0x00, 0x2e,
246 0xa1, 0x40, 0x72, 0x7f, 0x82, 0x80, 0x82, 0x40, 0x60, 0x7f, 0x98, 0x2e, 0xfe, 0xc9, 0x10, 0x25, 0x98, 0x2e, 0x74,
247 0xc0, 0x62, 0x6f, 0x05, 0x30, 0x87, 0x40, 0xc0, 0x91, 0x04, 0x30, 0x05, 0x2f, 0x05, 0x2e, 0x83, 0x01, 0x80, 0xb2,
248 0x14, 0x30, 0x00, 0x2f, 0x04, 0x30, 0x05, 0x2e, 0xc9, 0x00, 0x73, 0x6f, 0x81, 0x40, 0xe2, 0x40, 0x69, 0x04, 0x11,
249 0x0f, 0xe1, 0x40, 0x16, 0x30, 0xfe, 0x29, 0xcb, 0x40, 0x02, 0x2f, 0x83, 0x6f, 0x83, 0x0f, 0x22, 0x2f, 0x47, 0x56,
250 0x13, 0x0f, 0x12, 0x30, 0x77, 0x2f, 0x49, 0x54, 0x42, 0x0e, 0x12, 0x30, 0x73, 0x2f, 0x00, 0x91, 0x0a, 0x2f, 0x01,
251 0x2e, 0x8b, 0x01, 0x19, 0xa8, 0x02, 0x30, 0x6c, 0x2f, 0x63, 0x50, 0x00, 0x2e, 0x17, 0x42, 0x05, 0x42, 0x68, 0x2c,
252 0x12, 0x30, 0x0b, 0x25, 0x08, 0x0f, 0x50, 0x30, 0x02, 0x2f, 0x21, 0x2e, 0x83, 0x01, 0x03, 0x2d, 0x40, 0x30, 0x21,
253 0x2e, 0x83, 0x01, 0x2b, 0x2e, 0x85, 0x01, 0x5a, 0x2c, 0x12, 0x30, 0x00, 0x91, 0x2b, 0x25, 0x04, 0x2f, 0x63, 0x50,
254 0x02, 0x30, 0x17, 0x42, 0x17, 0x2c, 0x02, 0x42, 0x98, 0x2e, 0xfe, 0xc9, 0x10, 0x25, 0x98, 0x2e, 0x74, 0xc0, 0x05,
255 0x2e, 0xc9, 0x00, 0x81, 0x84, 0x5b, 0x30, 0x82, 0x40, 0x37, 0x2e, 0x83, 0x01, 0x02, 0x0e, 0x07, 0x2f, 0x5f, 0x52,
256 0x40, 0x30, 0x62, 0x40, 0x41, 0x40, 0x91, 0x0e, 0x01, 0x2f, 0x21, 0x2e, 0x83, 0x01, 0x05, 0x30, 0x2b, 0x2e, 0x85,
257 0x01, 0x12, 0x30, 0x36, 0x2c, 0x16, 0x30, 0x15, 0x25, 0x81, 0x7f, 0x98, 0x2e, 0xfe, 0xc9, 0x10, 0x25, 0x98, 0x2e,
258 0x74, 0xc0, 0x19, 0xa2, 0x16, 0x30, 0x15, 0x2f, 0x05, 0x2e, 0x97, 0x01, 0x80, 0x6f, 0x82, 0x0e, 0x05, 0x2f, 0x01,
259 0x2e, 0x86, 0x01, 0x06, 0x28, 0x21, 0x2e, 0x86, 0x01, 0x0b, 0x2d, 0x03, 0x2e, 0x87, 0x01, 0x5f, 0x54, 0x4e, 0x28,
260 0x91, 0x42, 0x00, 0x2e, 0x82, 0x40, 0x90, 0x0e, 0x01, 0x2f, 0x21, 0x2e, 0x88, 0x01, 0x02, 0x30, 0x13, 0x2c, 0x05,
261 0x30, 0xc0, 0x6f, 0x08, 0x1c, 0xa8, 0x0f, 0x16, 0x30, 0x05, 0x30, 0x5b, 0x50, 0x09, 0x2f, 0x02, 0x80, 0x2d, 0x2e,
262 0x82, 0x01, 0x05, 0x42, 0x05, 0x80, 0x00, 0x2e, 0x02, 0x42, 0x3e, 0x80, 0x00, 0x2e, 0x06, 0x42, 0x02, 0x30, 0x90,
263 0x6f, 0x3e, 0x88, 0x01, 0x40, 0x04, 0x41, 0x4c, 0x28, 0x01, 0x42, 0x07, 0x80, 0x10, 0x25, 0x24, 0x40, 0x00, 0x40,
264 0x00, 0xa8, 0xf5, 0x22, 0x23, 0x29, 0x44, 0x42, 0x7a, 0x82, 0x7e, 0x88, 0x43, 0x40, 0x04, 0x41, 0x00, 0xab, 0xf5,
265 0x23, 0xdf, 0x28, 0x43, 0x42, 0xd9, 0xa0, 0x14, 0x2f, 0x00, 0x90, 0x02, 0x2f, 0xd2, 0x6f, 0x81, 0xb2, 0x05, 0x2f,
266 0x63, 0x54, 0x06, 0x28, 0x90, 0x42, 0x85, 0x42, 0x09, 0x2c, 0x02, 0x30, 0x5b, 0x50, 0x03, 0x80, 0x29, 0x2e, 0x7e,
267 0x01, 0x2b, 0x2e, 0x82, 0x01, 0x05, 0x42, 0x12, 0x30, 0x2b, 0x2e, 0x83, 0x01, 0x45, 0x82, 0x00, 0x2e, 0x40, 0x40,
268 0x7a, 0x82, 0x02, 0xa0, 0x08, 0x2f, 0x63, 0x50, 0x3b, 0x30, 0x15, 0x42, 0x05, 0x42, 0x37, 0x80, 0x37, 0x2e, 0x7e,
269 0x01, 0x05, 0x42, 0x12, 0x30, 0x01, 0x2e, 0xc9, 0x00, 0x02, 0x8c, 0x40, 0x40, 0x84, 0x41, 0x7a, 0x8c, 0x04, 0x0f,
270 0x03, 0x2f, 0x01, 0x2e, 0x8b, 0x01, 0x19, 0xa4, 0x04, 0x2f, 0x2b, 0x2e, 0x82, 0x01, 0x98, 0x2e, 0xf3, 0x03, 0x12,
271 0x30, 0x81, 0x90, 0x61, 0x52, 0x08, 0x2f, 0x65, 0x42, 0x65, 0x42, 0x43, 0x80, 0x39, 0x84, 0x82, 0x88, 0x05, 0x42,
272 0x45, 0x42, 0x85, 0x42, 0x05, 0x43, 0x00, 0x2e, 0x80, 0x41, 0x00, 0x90, 0x90, 0x2e, 0xe1, 0xb4, 0x65, 0x54, 0xc1,
273 0x6f, 0x80, 0x40, 0x00, 0xb2, 0x43, 0x58, 0x69, 0x50, 0x44, 0x2f, 0x55, 0x5c, 0xb7, 0x87, 0x8c, 0x0f, 0x0d, 0x2e,
274 0x96, 0x01, 0xc4, 0x40, 0x36, 0x2f, 0x41, 0x56, 0x8b, 0x0e, 0x2a, 0x2f, 0x0b, 0x52, 0xa1, 0x0e, 0x0a, 0x2f, 0x05,
275 0x2e, 0x8f, 0x01, 0x14, 0x25, 0x98, 0x2e, 0xfe, 0xc9, 0x4b, 0x54, 0x02, 0x0f, 0x69, 0x50, 0x05, 0x30, 0x65, 0x54,
276 0x15, 0x2f, 0x03, 0x2e, 0x8e, 0x01, 0x4d, 0x5c, 0x8e, 0x0f, 0x3a, 0x2f, 0x05, 0x2e, 0x8f, 0x01, 0x98, 0x2e, 0xfe,
277 0xc9, 0x4f, 0x54, 0x82, 0x0f, 0x05, 0x30, 0x69, 0x50, 0x65, 0x54, 0x30, 0x2f, 0x6d, 0x52, 0x15, 0x30, 0x42, 0x8c,
278 0x45, 0x42, 0x04, 0x30, 0x2b, 0x2c, 0x84, 0x43, 0x6b, 0x52, 0x42, 0x8c, 0x00, 0x2e, 0x85, 0x43, 0x15, 0x30, 0x24,
279 0x2c, 0x45, 0x42, 0x8e, 0x0f, 0x20, 0x2f, 0x0d, 0x2e, 0x8e, 0x01, 0xb1, 0x0e, 0x1c, 0x2f, 0x23, 0x2e, 0x8e, 0x01,
280 0x1a, 0x2d, 0x0e, 0x0e, 0x17, 0x2f, 0xa1, 0x0f, 0x15, 0x2f, 0x23, 0x2e, 0x8d, 0x01, 0x13, 0x2d, 0x98, 0x2e, 0x74,
281 0xc0, 0x43, 0x54, 0xc2, 0x0e, 0x0a, 0x2f, 0x65, 0x50, 0x04, 0x80, 0x0b, 0x30, 0x06, 0x82, 0x0b, 0x42, 0x79, 0x80,
282 0x41, 0x40, 0x12, 0x30, 0x25, 0x2e, 0x8c, 0x01, 0x01, 0x42, 0x05, 0x30, 0x69, 0x50, 0x65, 0x54, 0x84, 0x82, 0x43,
283 0x84, 0xbe, 0x8c, 0x84, 0x40, 0x86, 0x41, 0x26, 0x29, 0x94, 0x42, 0xbe, 0x8e, 0xd5, 0x7f, 0x19, 0xa1, 0x43, 0x40,
284 0x0b, 0x2e, 0x8c, 0x01, 0x84, 0x40, 0xc7, 0x41, 0x5d, 0x29, 0x27, 0x29, 0x45, 0x42, 0x84, 0x42, 0xc2, 0x7f, 0x01,
285 0x2f, 0xc0, 0xb3, 0x1d, 0x2f, 0x05, 0x2e, 0x94, 0x01, 0x99, 0xa0, 0x01, 0x2f, 0x80, 0xb3, 0x13, 0x2f, 0x80, 0xb3,
286 0x18, 0x2f, 0xc0, 0xb3, 0x16, 0x2f, 0x12, 0x40, 0x01, 0x40, 0x92, 0x7f, 0x98, 0x2e, 0x74, 0xc0, 0x92, 0x6f, 0x10,
287 0x0f, 0x20, 0x30, 0x03, 0x2f, 0x10, 0x30, 0x21, 0x2e, 0x7e, 0x01, 0x0a, 0x2d, 0x21, 0x2e, 0x7e, 0x01, 0x07, 0x2d,
288 0x20, 0x30, 0x21, 0x2e, 0x7e, 0x01, 0x03, 0x2d, 0x10, 0x30, 0x21, 0x2e, 0x7e, 0x01, 0xc2, 0x6f, 0x01, 0x2e, 0xc9,
289 0x00, 0xbc, 0x84, 0x02, 0x80, 0x82, 0x40, 0x00, 0x40, 0x90, 0x0e, 0xd5, 0x6f, 0x02, 0x2f, 0x15, 0x30, 0x98, 0x2e,
290 0xf3, 0x03, 0x41, 0x91, 0x05, 0x30, 0x07, 0x2f, 0x67, 0x50, 0x3d, 0x80, 0x2b, 0x2e, 0x8f, 0x01, 0x05, 0x42, 0x04,
291 0x80, 0x00, 0x2e, 0x05, 0x42, 0x02, 0x2c, 0x00, 0x30, 0x00, 0x30, 0xa2, 0x6f, 0x98, 0x8a, 0x86, 0x40, 0x80, 0xa7,
292 0x05, 0x2f, 0x98, 0x2e, 0xf3, 0x03, 0xc0, 0x30, 0x21, 0x2e, 0x95, 0x01, 0x06, 0x25, 0x1a, 0x25, 0xe2, 0x6f, 0x76,
293 0x82, 0x96, 0x40, 0x56, 0x43, 0x51, 0x0e, 0xfb, 0x2f, 0xbb, 0x6f, 0x30, 0x5f, 0xb8, 0x2e, 0x01, 0x2e, 0xb8, 0x00,
294 0x01, 0x31, 0x41, 0x08, 0x40, 0xb2, 0x20, 0x50, 0xf2, 0x30, 0x02, 0x08, 0xfb, 0x7f, 0x01, 0x30, 0x10, 0x2f, 0x05,
295 0x2e, 0xcc, 0x00, 0x81, 0x90, 0xe0, 0x7f, 0x03, 0x2f, 0x23, 0x2e, 0xcc, 0x00, 0x98, 0x2e, 0x55, 0xb6, 0x98, 0x2e,
296 0x1d, 0xb5, 0x10, 0x25, 0xfb, 0x6f, 0xe0, 0x6f, 0xe0, 0x5f, 0x80, 0x2e, 0x95, 0xcf, 0x98, 0x2e, 0x95, 0xcf, 0x10,
297 0x30, 0x21, 0x2e, 0xcc, 0x00, 0xfb, 0x6f, 0xe0, 0x5f, 0xb8, 0x2e, 0x00, 0x51, 0x05, 0x58, 0xeb, 0x7f, 0x2a, 0x25,
298 0x89, 0x52, 0x6f, 0x5a, 0x89, 0x50, 0x13, 0x41, 0x06, 0x40, 0xb3, 0x01, 0x16, 0x42, 0xcb, 0x16, 0x06, 0x40, 0xf3,
299 0x02, 0x13, 0x42, 0x65, 0x0e, 0xf5, 0x2f, 0x05, 0x40, 0x14, 0x30, 0x2c, 0x29, 0x04, 0x42, 0x08, 0xa1, 0x00, 0x30,
300 0x90, 0x2e, 0x52, 0xb6, 0xb3, 0x88, 0xb0, 0x8a, 0xb6, 0x84, 0xa4, 0x7f, 0xc4, 0x7f, 0xb5, 0x7f, 0xd5, 0x7f, 0x92,
301 0x7f, 0x73, 0x30, 0x04, 0x30, 0x55, 0x40, 0x42, 0x40, 0x8a, 0x17, 0xf3, 0x08, 0x6b, 0x01, 0x90, 0x02, 0x53, 0xb8,
302 0x4b, 0x82, 0xad, 0xbe, 0x71, 0x7f, 0x45, 0x0a, 0x09, 0x54, 0x84, 0x7f, 0x98, 0x2e, 0xd9, 0xc0, 0xa3, 0x6f, 0x7b,
303 0x54, 0xd0, 0x42, 0xa3, 0x7f, 0xf2, 0x7f, 0x60, 0x7f, 0x20, 0x25, 0x71, 0x6f, 0x75, 0x5a, 0x77, 0x58, 0x79, 0x5c,
304 0x75, 0x56, 0x98, 0x2e, 0x67, 0xcc, 0xb1, 0x6f, 0x62, 0x6f, 0x50, 0x42, 0xb1, 0x7f, 0xb3, 0x30, 0x10, 0x25, 0x98,
305 0x2e, 0x0f, 0xca, 0x84, 0x6f, 0x20, 0x29, 0x71, 0x6f, 0x92, 0x6f, 0xa5, 0x6f, 0x76, 0x82, 0x6a, 0x0e, 0x73, 0x30,
306 0x00, 0x30, 0xd0, 0x2f, 0xd2, 0x6f, 0xd1, 0x7f, 0xb4, 0x7f, 0x98, 0x2e, 0x2b, 0xb7, 0x15, 0xbd, 0x0b, 0xb8, 0x02,
307 0x0a, 0xc2, 0x6f, 0xc0, 0x7f, 0x98, 0x2e, 0x2b, 0xb7, 0x15, 0xbd, 0x0b, 0xb8, 0x42, 0x0a, 0xc0, 0x6f, 0x08, 0x17,
308 0x41, 0x18, 0x89, 0x16, 0xe1, 0x18, 0xd0, 0x18, 0xa1, 0x7f, 0x27, 0x25, 0x16, 0x25, 0x98, 0x2e, 0x79, 0xc0, 0x8b,
309 0x54, 0x90, 0x7f, 0xb3, 0x30, 0x82, 0x40, 0x80, 0x90, 0x0d, 0x2f, 0x7d, 0x52, 0x92, 0x6f, 0x98, 0x2e, 0x0f, 0xca,
310 0xb2, 0x6f, 0x90, 0x0e, 0x06, 0x2f, 0x8b, 0x50, 0x14, 0x30, 0x42, 0x6f, 0x51, 0x6f, 0x14, 0x42, 0x12, 0x42, 0x01,
311 0x42, 0x00, 0x2e, 0x31, 0x6f, 0x98, 0x2e, 0x74, 0xc0, 0x41, 0x6f, 0x80, 0x7f, 0x98, 0x2e, 0x74, 0xc0, 0x82, 0x6f,
312 0x10, 0x04, 0x43, 0x52, 0x01, 0x0f, 0x05, 0x2e, 0xcb, 0x00, 0x00, 0x30, 0x04, 0x30, 0x21, 0x2f, 0x51, 0x6f, 0x43,
313 0x58, 0x8c, 0x0e, 0x04, 0x30, 0x1c, 0x2f, 0x85, 0x88, 0x41, 0x6f, 0x04, 0x41, 0x8c, 0x0f, 0x04, 0x30, 0x16, 0x2f,
314 0x84, 0x88, 0x00, 0x2e, 0x04, 0x41, 0x04, 0x05, 0x8c, 0x0e, 0x04, 0x30, 0x0f, 0x2f, 0x82, 0x88, 0x31, 0x6f, 0x04,
315 0x41, 0x04, 0x05, 0x8c, 0x0e, 0x04, 0x30, 0x08, 0x2f, 0x83, 0x88, 0x00, 0x2e, 0x04, 0x41, 0x8c, 0x0f, 0x04, 0x30,
316 0x02, 0x2f, 0x21, 0x2e, 0xad, 0x01, 0x14, 0x30, 0x00, 0x91, 0x14, 0x2f, 0x03, 0x2e, 0xa1, 0x01, 0x41, 0x90, 0x0e,
317 0x2f, 0x03, 0x2e, 0xad, 0x01, 0x14, 0x30, 0x4c, 0x28, 0x23, 0x2e, 0xad, 0x01, 0x46, 0xa0, 0x06, 0x2f, 0x81, 0x84,
318 0x8d, 0x52, 0x48, 0x82, 0x82, 0x40, 0x21, 0x2e, 0xa1, 0x01, 0x42, 0x42, 0x5c, 0x2c, 0x02, 0x30, 0x05, 0x2e, 0xaa,
319 0x01, 0x80, 0xb2, 0x02, 0x30, 0x55, 0x2f, 0x03, 0x2e, 0xa9, 0x01, 0x92, 0x6f, 0xb3, 0x30, 0x98, 0x2e, 0x0f, 0xca,
320 0xb2, 0x6f, 0x90, 0x0f, 0x00, 0x30, 0x02, 0x30, 0x4a, 0x2f, 0xa2, 0x6f, 0x87, 0x52, 0x91, 0x00, 0x85, 0x52, 0x51,
321 0x0e, 0x02, 0x2f, 0x00, 0x2e, 0x43, 0x2c, 0x02, 0x30, 0xc2, 0x6f, 0x7f, 0x52, 0x91, 0x0e, 0x02, 0x30, 0x3c, 0x2f,
322 0x51, 0x6f, 0x81, 0x54, 0x98, 0x2e, 0xfe, 0xc9, 0x10, 0x25, 0xb3, 0x30, 0x21, 0x25, 0x98, 0x2e, 0x0f, 0xca, 0x32,
323 0x6f, 0xc0, 0x7f, 0xb3, 0x30, 0x12, 0x25, 0x98, 0x2e, 0x0f, 0xca, 0x42, 0x6f, 0xb0, 0x7f, 0xb3, 0x30, 0x12, 0x25,
324 0x98, 0x2e, 0x0f, 0xca, 0xb2, 0x6f, 0x90, 0x28, 0x83, 0x52, 0x98, 0x2e, 0xfe, 0xc9, 0xc2, 0x6f, 0x90, 0x0f, 0x00,
325 0x30, 0x02, 0x30, 0x1d, 0x2f, 0x05, 0x2e, 0xa1, 0x01, 0x80, 0xb2, 0x12, 0x30, 0x0f, 0x2f, 0x42, 0x6f, 0x03, 0x2e,
326 0xab, 0x01, 0x91, 0x0e, 0x02, 0x30, 0x12, 0x2f, 0x52, 0x6f, 0x03, 0x2e, 0xac, 0x01, 0x91, 0x0f, 0x02, 0x30, 0x0c,
327 0x2f, 0x21, 0x2e, 0xaa, 0x01, 0x0a, 0x2c, 0x12, 0x30, 0x03, 0x2e, 0xcb, 0x00, 0x8d, 0x58, 0x08, 0x89, 0x41, 0x40,
328 0x11, 0x43, 0x00, 0x43, 0x25, 0x2e, 0xa1, 0x01, 0xd4, 0x6f, 0x8f, 0x52, 0x00, 0x43, 0x3a, 0x89, 0x00, 0x2e, 0x10,
329 0x43, 0x10, 0x43, 0x61, 0x0e, 0xfb, 0x2f, 0x03, 0x2e, 0xa0, 0x01, 0x11, 0x1a, 0x02, 0x2f, 0x02, 0x25, 0x21, 0x2e,
330 0xa0, 0x01, 0xeb, 0x6f, 0x00, 0x5f, 0xb8, 0x2e, 0x91, 0x52, 0x10, 0x30, 0x02, 0x30, 0x95, 0x56, 0x52, 0x42, 0x4b,
331 0x0e, 0xfc, 0x2f, 0x8d, 0x54, 0x88, 0x82, 0x93, 0x56, 0x80, 0x42, 0x53, 0x42, 0x40, 0x42, 0x42, 0x86, 0x83, 0x54,
332 0xc0, 0x2e, 0xc2, 0x42, 0x00, 0x2e, 0xa3, 0x52, 0x00, 0x51, 0x52, 0x40, 0x47, 0x40, 0x1a, 0x25, 0x01, 0x2e, 0x97,
333 0x00, 0x8f, 0xbe, 0x72, 0x86, 0xfb, 0x7f, 0x0b, 0x30, 0x7c, 0xbf, 0xa5, 0x50, 0x10, 0x08, 0xdf, 0xba, 0x70, 0x88,
334 0xf8, 0xbf, 0xcb, 0x42, 0xd3, 0x7f, 0x6c, 0xbb, 0xfc, 0xbb, 0xc5, 0x0a, 0x90, 0x7f, 0x1b, 0x7f, 0x0b, 0x43, 0xc0,
335 0xb2, 0xe5, 0x7f, 0xb7, 0x7f, 0xa6, 0x7f, 0xc4, 0x7f, 0x90, 0x2e, 0x1c, 0xb7, 0x07, 0x2e, 0xd2, 0x00, 0xc0, 0xb2,
336 0x0b, 0x2f, 0x97, 0x52, 0x01, 0x2e, 0xcd, 0x00, 0x82, 0x7f, 0x98, 0x2e, 0xbb, 0xcc, 0x0b, 0x30, 0x37, 0x2e, 0xd2,
337 0x00, 0x82, 0x6f, 0x90, 0x6f, 0x1a, 0x25, 0x00, 0xb2, 0x8b, 0x7f, 0x14, 0x2f, 0xa6, 0xbd, 0x25, 0xbd, 0xb6, 0xb9,
338 0x2f, 0xb9, 0x80, 0xb2, 0xd4, 0xb0, 0x0c, 0x2f, 0x99, 0x54, 0x9b, 0x56, 0x0b, 0x30, 0x0b, 0x2e, 0xb1, 0x00, 0xa1,
339 0x58, 0x9b, 0x42, 0xdb, 0x42, 0x6c, 0x09, 0x2b, 0x2e, 0xb1, 0x00, 0x8b, 0x42, 0xcb, 0x42, 0x86, 0x7f, 0x73, 0x84,
340 0xa7, 0x56, 0xc3, 0x08, 0x39, 0x52, 0x05, 0x50, 0x72, 0x7f, 0x63, 0x7f, 0x98, 0x2e, 0xc2, 0xc0, 0xe1, 0x6f, 0x62,
341 0x6f, 0xd1, 0x0a, 0x01, 0x2e, 0xcd, 0x00, 0xd5, 0x6f, 0xc4, 0x6f, 0x72, 0x6f, 0x97, 0x52, 0x9d, 0x5c, 0x98, 0x2e,
342 0x06, 0xcd, 0x23, 0x6f, 0x90, 0x6f, 0x99, 0x52, 0xc0, 0xb2, 0x04, 0xbd, 0x54, 0x40, 0xaf, 0xb9, 0x45, 0x40, 0xe1,
343 0x7f, 0x02, 0x30, 0x06, 0x2f, 0xc0, 0xb2, 0x02, 0x30, 0x03, 0x2f, 0x9b, 0x5c, 0x12, 0x30, 0x94, 0x43, 0x85, 0x43,
344 0x03, 0xbf, 0x6f, 0xbb, 0x80, 0xb3, 0x20, 0x2f, 0x06, 0x6f, 0x26, 0x01, 0x16, 0x6f, 0x6e, 0x03, 0x45, 0x42, 0xc0,
345 0x90, 0x29, 0x2e, 0xce, 0x00, 0x9b, 0x52, 0x14, 0x2f, 0x9b, 0x5c, 0x00, 0x2e, 0x93, 0x41, 0x86, 0x41, 0xe3, 0x04,
346 0xae, 0x07, 0x80, 0xab, 0x04, 0x2f, 0x80, 0x91, 0x0a, 0x2f, 0x86, 0x6f, 0x73, 0x0f, 0x07, 0x2f, 0x83, 0x6f, 0xc0,
347 0xb2, 0x04, 0x2f, 0x54, 0x42, 0x45, 0x42, 0x12, 0x30, 0x04, 0x2c, 0x11, 0x30, 0x02, 0x2c, 0x11, 0x30, 0x11, 0x30,
348 0x02, 0xbc, 0x0f, 0xb8, 0xd2, 0x7f, 0x00, 0xb2, 0x0a, 0x2f, 0x01, 0x2e, 0xfc, 0x00, 0x05, 0x2e, 0xc7, 0x01, 0x10,
349 0x1a, 0x02, 0x2f, 0x21, 0x2e, 0xc7, 0x01, 0x03, 0x2d, 0x02, 0x2c, 0x01, 0x30, 0x01, 0x30, 0xb0, 0x6f, 0x98, 0x2e,
350 0x95, 0xcf, 0xd1, 0x6f, 0xa0, 0x6f, 0x98, 0x2e, 0x95, 0xcf, 0xe2, 0x6f, 0x9f, 0x52, 0x01, 0x2e, 0xce, 0x00, 0x82,
351 0x40, 0x50, 0x42, 0x0c, 0x2c, 0x42, 0x42, 0x11, 0x30, 0x23, 0x2e, 0xd2, 0x00, 0x01, 0x30, 0xb0, 0x6f, 0x98, 0x2e,
352 0x95, 0xcf, 0xa0, 0x6f, 0x01, 0x30, 0x98, 0x2e, 0x95, 0xcf, 0x00, 0x2e, 0xfb, 0x6f, 0x00, 0x5f, 0xb8, 0x2e, 0x83,
353 0x86, 0x01, 0x30, 0x00, 0x30, 0x94, 0x40, 0x24, 0x18, 0x06, 0x00, 0x53, 0x0e, 0x4f, 0x02, 0xf9, 0x2f, 0xb8, 0x2e,
354 0xa9, 0x52, 0x00, 0x2e, 0x60, 0x40, 0x41, 0x40, 0x0d, 0xbc, 0x98, 0xbc, 0xc0, 0x2e, 0x01, 0x0a, 0x0f, 0xb8, 0xab,
355 0x52, 0x53, 0x3c, 0x52, 0x40, 0x40, 0x40, 0x4b, 0x00, 0x82, 0x16, 0x26, 0xb9, 0x01, 0xb8, 0x41, 0x40, 0x10, 0x08,
356 0x97, 0xb8, 0x01, 0x08, 0xc0, 0x2e, 0x11, 0x30, 0x01, 0x08, 0x43, 0x86, 0x25, 0x40, 0x04, 0x40, 0xd8, 0xbe, 0x2c,
357 0x0b, 0x22, 0x11, 0x54, 0x42, 0x03, 0x80, 0x4b, 0x0e, 0xf6, 0x2f, 0xb8, 0x2e, 0x9f, 0x50, 0x10, 0x50, 0xad, 0x52,
358 0x05, 0x2e, 0xd3, 0x00, 0xfb, 0x7f, 0x00, 0x2e, 0x13, 0x40, 0x93, 0x42, 0x41, 0x0e, 0xfb, 0x2f, 0x98, 0x2e, 0xa5,
359 0xb7, 0x98, 0x2e, 0x87, 0xcf, 0x01, 0x2e, 0xd9, 0x00, 0x00, 0xb2, 0xfb, 0x6f, 0x0b, 0x2f, 0x01, 0x2e, 0x69, 0xf7,
360 0xb1, 0x3f, 0x01, 0x08, 0x01, 0x30, 0xf0, 0x5f, 0x23, 0x2e, 0xd9, 0x00, 0x21, 0x2e, 0x69, 0xf7, 0x80, 0x2e, 0x7a,
361 0xb7, 0xf0, 0x5f, 0xb8, 0x2e, 0x01, 0x2e, 0xc0, 0xf8, 0x03, 0x2e, 0xfc, 0xf5, 0x15, 0x54, 0xaf, 0x56, 0x82, 0x08,
362 0x0b, 0x2e, 0x69, 0xf7, 0xcb, 0x0a, 0xb1, 0x58, 0x80, 0x90, 0xdd, 0xbe, 0x4c, 0x08, 0x5f, 0xb9, 0x59, 0x22, 0x80,
363 0x90, 0x07, 0x2f, 0x03, 0x34, 0xc3, 0x08, 0xf2, 0x3a, 0x0a, 0x08, 0x02, 0x35, 0xc0, 0x90, 0x4a, 0x0a, 0x48, 0x22,
364 0xc0, 0x2e, 0x23, 0x2e, 0xfc, 0xf5, 0x10, 0x50, 0xfb, 0x7f, 0x98, 0x2e, 0x56, 0xc7, 0x98, 0x2e, 0x49, 0xc3, 0x10,
365 0x30, 0xfb, 0x6f, 0xf0, 0x5f, 0x21, 0x2e, 0xcc, 0x00, 0x21, 0x2e, 0xca, 0x00, 0xb8, 0x2e, 0x03, 0x2e, 0xd3, 0x00,
366 0x16, 0xb8, 0x02, 0x34, 0x4a, 0x0c, 0x21, 0x2e, 0x2d, 0xf5, 0xc0, 0x2e, 0x23, 0x2e, 0xd3, 0x00, 0x03, 0xbc, 0x21,
367 0x2e, 0xd5, 0x00, 0x03, 0x2e, 0xd5, 0x00, 0x40, 0xb2, 0x10, 0x30, 0x21, 0x2e, 0x77, 0x00, 0x01, 0x30, 0x05, 0x2f,
368 0x05, 0x2e, 0xd8, 0x00, 0x80, 0x90, 0x01, 0x2f, 0x23, 0x2e, 0x6f, 0xf5, 0xc0, 0x2e, 0x21, 0x2e, 0xd9, 0x00, 0x11,
369 0x30, 0x81, 0x08, 0x01, 0x2e, 0x6a, 0xf7, 0x71, 0x3f, 0x23, 0xbd, 0x01, 0x08, 0x02, 0x0a, 0xc0, 0x2e, 0x21, 0x2e,
370 0x6a, 0xf7, 0x30, 0x25, 0x00, 0x30, 0x21, 0x2e, 0x5a, 0xf5, 0x10, 0x50, 0x21, 0x2e, 0x7b, 0x00, 0x21, 0x2e, 0x7c,
371 0x00, 0xfb, 0x7f, 0x98, 0x2e, 0xc3, 0xb7, 0x40, 0x30, 0x21, 0x2e, 0xd4, 0x00, 0xfb, 0x6f, 0xf0, 0x5f, 0x03, 0x25,
372 0x80, 0x2e, 0xaf, 0xb7, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
373 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
374 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
375 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x01, 0x2e, 0x5d, 0xf7, 0x08, 0xbc, 0x80, 0xac, 0x0e, 0xbb, 0x02, 0x2f,
376 0x00, 0x30, 0x41, 0x04, 0x82, 0x06, 0xc0, 0xa4, 0x00, 0x30, 0x11, 0x2f, 0x40, 0xa9, 0x03, 0x2f, 0x40, 0x91, 0x0d,
377 0x2f, 0x00, 0xa7, 0x0b, 0x2f, 0x80, 0xb3, 0xb3, 0x58, 0x02, 0x2f, 0x90, 0xa1, 0x26, 0x13, 0x20, 0x23, 0x80, 0x90,
378 0x10, 0x30, 0x01, 0x2f, 0xcc, 0x0e, 0x00, 0x2f, 0x00, 0x30, 0xb8, 0x2e, 0xb5, 0x50, 0x18, 0x08, 0x08, 0xbc, 0x88,
379 0xb6, 0x0d, 0x17, 0xc6, 0xbd, 0x56, 0xbc, 0xb7, 0x58, 0xda, 0xba, 0x04, 0x01, 0x1d, 0x0a, 0x10, 0x50, 0x05, 0x30,
380 0x32, 0x25, 0x45, 0x03, 0xfb, 0x7f, 0xf6, 0x30, 0x21, 0x25, 0x98, 0x2e, 0x37, 0xca, 0x16, 0xb5, 0x9a, 0xbc, 0x06,
381 0xb8, 0x80, 0xa8, 0x41, 0x0a, 0x0e, 0x2f, 0x80, 0x90, 0x02, 0x2f, 0x2d, 0x50, 0x48, 0x0f, 0x09, 0x2f, 0xbf, 0xa0,
382 0x04, 0x2f, 0xbf, 0x90, 0x06, 0x2f, 0xb7, 0x54, 0xca, 0x0f, 0x03, 0x2f, 0x00, 0x2e, 0x02, 0x2c, 0xb7, 0x52, 0x2d,
383 0x52, 0xf2, 0x33, 0x98, 0x2e, 0xd9, 0xc0, 0xfb, 0x6f, 0xf1, 0x37, 0xc0, 0x2e, 0x01, 0x08, 0xf0, 0x5f, 0xbf, 0x56,
384 0xb9, 0x54, 0xd0, 0x40, 0xc4, 0x40, 0x0b, 0x2e, 0xfd, 0xf3, 0xbf, 0x52, 0x90, 0x42, 0x94, 0x42, 0x95, 0x42, 0x05,
385 0x30, 0xc1, 0x50, 0x0f, 0x88, 0x06, 0x40, 0x04, 0x41, 0x96, 0x42, 0xc5, 0x42, 0x48, 0xbe, 0x73, 0x30, 0x0d, 0x2e,
386 0xd8, 0x00, 0x4f, 0xba, 0x84, 0x42, 0x03, 0x42, 0x81, 0xb3, 0x02, 0x2f, 0x2b, 0x2e, 0x6f, 0xf5, 0x06, 0x2d, 0x05,
387 0x2e, 0x77, 0xf7, 0xbd, 0x56, 0x93, 0x08, 0x25, 0x2e, 0x77, 0xf7, 0xbb, 0x54, 0x25, 0x2e, 0xc2, 0xf5, 0x07, 0x2e,
388 0xfd, 0xf3, 0x42, 0x30, 0xb4, 0x33, 0xda, 0x0a, 0x4c, 0x00, 0x27, 0x2e, 0xfd, 0xf3, 0x43, 0x40, 0xd4, 0x3f, 0xdc,
389 0x08, 0x43, 0x42, 0x00, 0x2e, 0x00, 0x2e, 0x43, 0x40, 0x24, 0x30, 0xdc, 0x0a, 0x43, 0x42, 0x04, 0x80, 0x03, 0x2e,
390 0xfd, 0xf3, 0x4a, 0x0a, 0x23, 0x2e, 0xfd, 0xf3, 0x61, 0x34, 0xc0, 0x2e, 0x01, 0x42, 0x00, 0x2e, 0x60, 0x50, 0x1a,
391 0x25, 0x7a, 0x86, 0xe0, 0x7f, 0xf3, 0x7f, 0x03, 0x25, 0xc3, 0x52, 0x41, 0x84, 0xdb, 0x7f, 0x33, 0x30, 0x98, 0x2e,
392 0x16, 0xc2, 0x1a, 0x25, 0x7d, 0x82, 0xf0, 0x6f, 0xe2, 0x6f, 0x32, 0x25, 0x16, 0x40, 0x94, 0x40, 0x26, 0x01, 0x85,
393 0x40, 0x8e, 0x17, 0xc4, 0x42, 0x6e, 0x03, 0x95, 0x42, 0x41, 0x0e, 0xf4, 0x2f, 0xdb, 0x6f, 0xa0, 0x5f, 0xb8, 0x2e,
394 0xb0, 0x51, 0xfb, 0x7f, 0x98, 0x2e, 0xe8, 0x0d, 0x5a, 0x25, 0x98, 0x2e, 0x0f, 0x0e, 0xcb, 0x58, 0x32, 0x87, 0xc4,
395 0x7f, 0x65, 0x89, 0x6b, 0x8d, 0xc5, 0x5a, 0x65, 0x7f, 0xe1, 0x7f, 0x83, 0x7f, 0xa6, 0x7f, 0x74, 0x7f, 0xd0, 0x7f,
396 0xb6, 0x7f, 0x94, 0x7f, 0x17, 0x30, 0xc7, 0x52, 0xc9, 0x54, 0x51, 0x7f, 0x00, 0x2e, 0x85, 0x6f, 0x42, 0x7f, 0x00,
397 0x2e, 0x51, 0x41, 0x45, 0x81, 0x42, 0x41, 0x13, 0x40, 0x3b, 0x8a, 0x00, 0x40, 0x4b, 0x04, 0xd0, 0x06, 0xc0, 0xac,
398 0x85, 0x7f, 0x02, 0x2f, 0x02, 0x30, 0x51, 0x04, 0xd3, 0x06, 0x41, 0x84, 0x05, 0x30, 0x5d, 0x02, 0xc9, 0x16, 0xdf,
399 0x08, 0xd3, 0x00, 0x8d, 0x02, 0xaf, 0xbc, 0xb1, 0xb9, 0x59, 0x0a, 0x65, 0x6f, 0x11, 0x43, 0xa1, 0xb4, 0x52, 0x41,
400 0x53, 0x41, 0x01, 0x43, 0x34, 0x7f, 0x65, 0x7f, 0x26, 0x31, 0xe5, 0x6f, 0xd4, 0x6f, 0x98, 0x2e, 0x37, 0xca, 0x32,
401 0x6f, 0x75, 0x6f, 0x83, 0x40, 0x42, 0x41, 0x23, 0x7f, 0x12, 0x7f, 0xf6, 0x30, 0x40, 0x25, 0x51, 0x25, 0x98, 0x2e,
402 0x37, 0xca, 0x14, 0x6f, 0x20, 0x05, 0x70, 0x6f, 0x25, 0x6f, 0x69, 0x07, 0xa2, 0x6f, 0x31, 0x6f, 0x0b, 0x30, 0x04,
403 0x42, 0x9b, 0x42, 0x8b, 0x42, 0x55, 0x42, 0x32, 0x7f, 0x40, 0xa9, 0xc3, 0x6f, 0x71, 0x7f, 0x02, 0x30, 0xd0, 0x40,
404 0xc3, 0x7f, 0x03, 0x2f, 0x40, 0x91, 0x15, 0x2f, 0x00, 0xa7, 0x13, 0x2f, 0x00, 0xa4, 0x11, 0x2f, 0x84, 0xbd, 0x98,
405 0x2e, 0x79, 0xca, 0x55, 0x6f, 0xb7, 0x54, 0x54, 0x41, 0x82, 0x00, 0xf3, 0x3f, 0x45, 0x41, 0xcb, 0x02, 0xf6, 0x30,
406 0x98, 0x2e, 0x37, 0xca, 0x35, 0x6f, 0xa4, 0x6f, 0x41, 0x43, 0x03, 0x2c, 0x00, 0x43, 0xa4, 0x6f, 0x35, 0x6f, 0x17,
407 0x30, 0x42, 0x6f, 0x51, 0x6f, 0x93, 0x40, 0x42, 0x82, 0x00, 0x41, 0xc3, 0x00, 0x03, 0x43, 0x51, 0x7f, 0x00, 0x2e,
408 0x94, 0x40, 0x41, 0x41, 0x4c, 0x02, 0xc4, 0x6f, 0xd1, 0x56, 0x63, 0x0e, 0x74, 0x6f, 0x51, 0x43, 0xa5, 0x7f, 0x8a,
409 0x2f, 0x09, 0x2e, 0xd8, 0x00, 0x01, 0xb3, 0x21, 0x2f, 0xcb, 0x58, 0x90, 0x6f, 0x13, 0x41, 0xb6, 0x6f, 0xe4, 0x7f,
410 0x00, 0x2e, 0x91, 0x41, 0x14, 0x40, 0x92, 0x41, 0x15, 0x40, 0x17, 0x2e, 0x6f, 0xf5, 0xb6, 0x7f, 0xd0, 0x7f, 0xcb,
411 0x7f, 0x98, 0x2e, 0x00, 0x0c, 0x07, 0x15, 0xc2, 0x6f, 0x14, 0x0b, 0x29, 0x2e, 0x6f, 0xf5, 0xc3, 0xa3, 0xc1, 0x8f,
412 0xe4, 0x6f, 0xd0, 0x6f, 0xe6, 0x2f, 0x14, 0x30, 0x05, 0x2e, 0x6f, 0xf5, 0x14, 0x0b, 0x29, 0x2e, 0x6f, 0xf5, 0x18,
413 0x2d, 0xcd, 0x56, 0x04, 0x32, 0xb5, 0x6f, 0x1c, 0x01, 0x51, 0x41, 0x52, 0x41, 0xc3, 0x40, 0xb5, 0x7f, 0xe4, 0x7f,
414 0x98, 0x2e, 0x1f, 0x0c, 0xe4, 0x6f, 0x21, 0x87, 0x00, 0x43, 0x04, 0x32, 0xcf, 0x54, 0x5a, 0x0e, 0xef, 0x2f, 0x15,
415 0x54, 0x09, 0x2e, 0x77, 0xf7, 0x22, 0x0b, 0x29, 0x2e, 0x77, 0xf7, 0xfb, 0x6f, 0x50, 0x5e, 0xb8, 0x2e, 0x10, 0x50,
416 0x01, 0x2e, 0xd4, 0x00, 0x00, 0xb2, 0xfb, 0x7f, 0x51, 0x2f, 0x01, 0xb2, 0x48, 0x2f, 0x02, 0xb2, 0x42, 0x2f, 0x03,
417 0x90, 0x56, 0x2f, 0xd7, 0x52, 0x79, 0x80, 0x42, 0x40, 0x81, 0x84, 0x00, 0x40, 0x42, 0x42, 0x98, 0x2e, 0x93, 0x0c,
418 0xd9, 0x54, 0xd7, 0x50, 0xa1, 0x40, 0x98, 0xbd, 0x82, 0x40, 0x3e, 0x82, 0xda, 0x0a, 0x44, 0x40, 0x8b, 0x16, 0xe3,
419 0x00, 0x53, 0x42, 0x00, 0x2e, 0x43, 0x40, 0x9a, 0x02, 0x52, 0x42, 0x00, 0x2e, 0x41, 0x40, 0x15, 0x54, 0x4a, 0x0e,
420 0x3a, 0x2f, 0x3a, 0x82, 0x00, 0x30, 0x41, 0x40, 0x21, 0x2e, 0x85, 0x0f, 0x40, 0xb2, 0x0a, 0x2f, 0x98, 0x2e, 0xb1,
421 0x0c, 0x98, 0x2e, 0x45, 0x0e, 0x98, 0x2e, 0x5b, 0x0e, 0xfb, 0x6f, 0xf0, 0x5f, 0x00, 0x30, 0x80, 0x2e, 0xce, 0xb7,
422 0xdd, 0x52, 0xd3, 0x54, 0x42, 0x42, 0x4f, 0x84, 0x73, 0x30, 0xdb, 0x52, 0x83, 0x42, 0x1b, 0x30, 0x6b, 0x42, 0x23,
423 0x30, 0x27, 0x2e, 0xd7, 0x00, 0x37, 0x2e, 0xd4, 0x00, 0x21, 0x2e, 0xd6, 0x00, 0x7a, 0x84, 0x17, 0x2c, 0x42, 0x42,
424 0x30, 0x30, 0x21, 0x2e, 0xd4, 0x00, 0x12, 0x2d, 0x21, 0x30, 0x00, 0x30, 0x23, 0x2e, 0xd4, 0x00, 0x21, 0x2e, 0x7b,
425 0xf7, 0x0b, 0x2d, 0x17, 0x30, 0x98, 0x2e, 0x51, 0x0c, 0xd5, 0x50, 0x0c, 0x82, 0x72, 0x30, 0x2f, 0x2e, 0xd4, 0x00,
426 0x25, 0x2e, 0x7b, 0xf7, 0x40, 0x42, 0x00, 0x2e, 0xfb, 0x6f, 0xf0, 0x5f, 0xb8, 0x2e, 0x70, 0x50, 0x0a, 0x25, 0x39,
427 0x86, 0xfb, 0x7f, 0xe1, 0x32, 0x62, 0x30, 0x98, 0x2e, 0xc2, 0xc4, 0xb5, 0x56, 0xa5, 0x6f, 0xab, 0x08, 0x91, 0x6f,
428 0x4b, 0x08, 0xdf, 0x56, 0xc4, 0x6f, 0x23, 0x09, 0x4d, 0xba, 0x93, 0xbc, 0x8c, 0x0b, 0xd1, 0x6f, 0x0b, 0x09, 0xcb,
429 0x52, 0xe1, 0x5e, 0x56, 0x42, 0xaf, 0x09, 0x4d, 0xba, 0x23, 0xbd, 0x94, 0x0a, 0xe5, 0x6f, 0x68, 0xbb, 0xeb, 0x08,
430 0xbd, 0xb9, 0x63, 0xbe, 0xfb, 0x6f, 0x52, 0x42, 0xe3, 0x0a, 0xc0, 0x2e, 0x43, 0x42, 0x90, 0x5f, 0xd1, 0x50, 0x03,
431 0x2e, 0x25, 0xf3, 0x13, 0x40, 0x00, 0x40, 0x9b, 0xbc, 0x9b, 0xb4, 0x08, 0xbd, 0xb8, 0xb9, 0x98, 0xbc, 0xda, 0x0a,
432 0x08, 0xb6, 0x89, 0x16, 0xc0, 0x2e, 0x19, 0x00, 0x62, 0x02, 0x10, 0x50, 0xfb, 0x7f, 0x98, 0x2e, 0x81, 0x0d, 0x01,
433 0x2e, 0xd4, 0x00, 0x31, 0x30, 0x08, 0x04, 0xfb, 0x6f, 0x01, 0x30, 0xf0, 0x5f, 0x23, 0x2e, 0xd6, 0x00, 0x21, 0x2e,
434 0xd7, 0x00, 0xb8, 0x2e, 0x01, 0x2e, 0xd7, 0x00, 0x03, 0x2e, 0xd6, 0x00, 0x48, 0x0e, 0x01, 0x2f, 0x80, 0x2e, 0x1f,
435 0x0e, 0xb8, 0x2e, 0xe3, 0x50, 0x21, 0x34, 0x01, 0x42, 0x82, 0x30, 0xc1, 0x32, 0x25, 0x2e, 0x62, 0xf5, 0x01, 0x00,
436 0x22, 0x30, 0x01, 0x40, 0x4a, 0x0a, 0x01, 0x42, 0xb8, 0x2e, 0xe3, 0x54, 0xf0, 0x3b, 0x83, 0x40, 0xd8, 0x08, 0xe5,
437 0x52, 0x83, 0x42, 0x00, 0x30, 0x83, 0x30, 0x50, 0x42, 0xc4, 0x32, 0x27, 0x2e, 0x64, 0xf5, 0x94, 0x00, 0x50, 0x42,
438 0x40, 0x42, 0xd3, 0x3f, 0x84, 0x40, 0x7d, 0x82, 0xe3, 0x08, 0x40, 0x42, 0x83, 0x42, 0xb8, 0x2e, 0xdd, 0x52, 0x00,
439 0x30, 0x40, 0x42, 0x7c, 0x86, 0xb9, 0x52, 0x09, 0x2e, 0x70, 0x0f, 0xbf, 0x54, 0xc4, 0x42, 0xd3, 0x86, 0x54, 0x40,
440 0x55, 0x40, 0x94, 0x42, 0x85, 0x42, 0x21, 0x2e, 0xd7, 0x00, 0x42, 0x40, 0x25, 0x2e, 0xfd, 0xf3, 0xc0, 0x42, 0x7e,
441 0x82, 0x05, 0x2e, 0x7d, 0x00, 0x80, 0xb2, 0x14, 0x2f, 0x05, 0x2e, 0x89, 0x00, 0x27, 0xbd, 0x2f, 0xb9, 0x80, 0x90,
442 0x02, 0x2f, 0x21, 0x2e, 0x6f, 0xf5, 0x0c, 0x2d, 0x07, 0x2e, 0x71, 0x0f, 0x14, 0x30, 0x1c, 0x09, 0x05, 0x2e, 0x77,
443 0xf7, 0xbd, 0x56, 0x47, 0xbe, 0x93, 0x08, 0x94, 0x0a, 0x25, 0x2e, 0x77, 0xf7, 0xe7, 0x54, 0x50, 0x42, 0x4a, 0x0e,
444 0xfc, 0x2f, 0xb8, 0x2e, 0x50, 0x50, 0x02, 0x30, 0x43, 0x86, 0xe5, 0x50, 0xfb, 0x7f, 0xe3, 0x7f, 0xd2, 0x7f, 0xc0,
445 0x7f, 0xb1, 0x7f, 0x00, 0x2e, 0x41, 0x40, 0x00, 0x40, 0x48, 0x04, 0x98, 0x2e, 0x74, 0xc0, 0x1e, 0xaa, 0xd3, 0x6f,
446 0x14, 0x30, 0xb1, 0x6f, 0xe3, 0x22, 0xc0, 0x6f, 0x52, 0x40, 0xe4, 0x6f, 0x4c, 0x0e, 0x12, 0x42, 0xd3, 0x7f, 0xeb,
447 0x2f, 0x03, 0x2e, 0x86, 0x0f, 0x40, 0x90, 0x11, 0x30, 0x03, 0x2f, 0x23, 0x2e, 0x86, 0x0f, 0x02, 0x2c, 0x00, 0x30,
448 0xd0, 0x6f, 0xfb, 0x6f, 0xb0, 0x5f, 0xb8, 0x2e, 0x40, 0x50, 0xf1, 0x7f, 0x0a, 0x25, 0x3c, 0x86, 0xeb, 0x7f, 0x41,
449 0x33, 0x22, 0x30, 0x98, 0x2e, 0xc2, 0xc4, 0xd3, 0x6f, 0xf4, 0x30, 0xdc, 0x09, 0x47, 0x58, 0xc2, 0x6f, 0x94, 0x09,
450 0xeb, 0x58, 0x6a, 0xbb, 0xdc, 0x08, 0xb4, 0xb9, 0xb1, 0xbd, 0xe9, 0x5a, 0x95, 0x08, 0x21, 0xbd, 0xf6, 0xbf, 0x77,
451 0x0b, 0x51, 0xbe, 0xf1, 0x6f, 0xeb, 0x6f, 0x52, 0x42, 0x54, 0x42, 0xc0, 0x2e, 0x43, 0x42, 0xc0, 0x5f, 0x50, 0x50,
452 0xf5, 0x50, 0x31, 0x30, 0x11, 0x42, 0xfb, 0x7f, 0x7b, 0x30, 0x0b, 0x42, 0x11, 0x30, 0x02, 0x80, 0x23, 0x33, 0x01,
453 0x42, 0x03, 0x00, 0x07, 0x2e, 0x80, 0x03, 0x05, 0x2e, 0xd3, 0x00, 0x23, 0x52, 0xe2, 0x7f, 0xd3, 0x7f, 0xc0, 0x7f,
454 0x98, 0x2e, 0xb6, 0x0e, 0xd1, 0x6f, 0x08, 0x0a, 0x1a, 0x25, 0x7b, 0x86, 0xd0, 0x7f, 0x01, 0x33, 0x12, 0x30, 0x98,
455 0x2e, 0xc2, 0xc4, 0xd1, 0x6f, 0x08, 0x0a, 0x00, 0xb2, 0x0d, 0x2f, 0xe3, 0x6f, 0x01, 0x2e, 0x80, 0x03, 0x51, 0x30,
456 0xc7, 0x86, 0x23, 0x2e, 0x21, 0xf2, 0x08, 0xbc, 0xc0, 0x42, 0x98, 0x2e, 0xa5, 0xb7, 0x00, 0x2e, 0x00, 0x2e, 0xd0,
457 0x2e, 0xb0, 0x6f, 0x0b, 0xb8, 0x03, 0x2e, 0x1b, 0x00, 0x08, 0x1a, 0xb0, 0x7f, 0x70, 0x30, 0x04, 0x2f, 0x21, 0x2e,
458 0x21, 0xf2, 0x00, 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0x98, 0x2e, 0x6d, 0xc0, 0x98, 0x2e, 0x5d, 0xc0, 0xed, 0x50, 0x98,
459 0x2e, 0x44, 0xcb, 0xef, 0x50, 0x98, 0x2e, 0x46, 0xc3, 0xf1, 0x50, 0x98, 0x2e, 0x53, 0xc7, 0x35, 0x50, 0x98, 0x2e,
460 0x64, 0xcf, 0x10, 0x30, 0x98, 0x2e, 0xdc, 0x03, 0x20, 0x26, 0xc0, 0x6f, 0x02, 0x31, 0x12, 0x42, 0xab, 0x33, 0x0b,
461 0x42, 0x37, 0x80, 0x01, 0x30, 0x01, 0x42, 0xf3, 0x37, 0xf7, 0x52, 0xfb, 0x50, 0x44, 0x40, 0xa2, 0x0a, 0x42, 0x42,
462 0x8b, 0x31, 0x09, 0x2e, 0x5e, 0xf7, 0xf9, 0x54, 0xe3, 0x08, 0x83, 0x42, 0x1b, 0x42, 0x23, 0x33, 0x4b, 0x00, 0xbc,
463 0x84, 0x0b, 0x40, 0x33, 0x30, 0x83, 0x42, 0x0b, 0x42, 0xe0, 0x7f, 0xd1, 0x7f, 0x98, 0x2e, 0x58, 0xb7, 0xd1, 0x6f,
464 0x80, 0x30, 0x40, 0x42, 0x03, 0x30, 0xe0, 0x6f, 0xf3, 0x54, 0x04, 0x30, 0x00, 0x2e, 0x00, 0x2e, 0x01, 0x89, 0x62,
465 0x0e, 0xfa, 0x2f, 0x43, 0x42, 0x11, 0x30, 0xfb, 0x6f, 0xc0, 0x2e, 0x01, 0x42, 0xb0, 0x5f, 0xc1, 0x4a, 0x00, 0x00,
466 0x6d, 0x57, 0x00, 0x00, 0x77, 0x8e, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xd3, 0xff, 0xff, 0xff, 0xe5, 0xff, 0xff,
467 0xff, 0xee, 0xe1, 0xff, 0xff, 0x7c, 0x13, 0x00, 0x00, 0x46, 0xe6, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
468 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
469 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
470 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2e, 0x00, 0xc1, 0x80,
471 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
472 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
473 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
474 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
475 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
476 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
477 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
478 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
479 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
480 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
481 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
482 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
486 /*! @name Global array that stores the feature input configuration of BMI270 */
487 const struct bmi2_feature_config bmi270_feat_in
[BMI270_MAX_FEAT_IN
] = {
488 { .type
= BMI2_CONFIG_ID
, .page
= BMI2_PAGE_1
, .start_addr
= BMI270_CONFIG_ID_STRT_ADDR
},
489 { .type
= BMI2_MAX_BURST_LEN
, .page
= BMI2_PAGE_1
, .start_addr
= BMI270_MAX_BURST_LEN_STRT_ADDR
},
490 { .type
= BMI2_CRT_GYRO_SELF_TEST
, .page
= BMI2_PAGE_1
, .start_addr
= BMI270_CRT_GYRO_SELF_TEST_STRT_ADDR
},
491 { .type
= BMI2_ABORT_CRT_GYRO_SELF_TEST
, .page
= BMI2_PAGE_1
, .start_addr
= BMI270_ABORT_STRT_ADDR
},
492 { .type
= BMI2_AXIS_MAP
, .page
= BMI2_PAGE_1
, .start_addr
= BMI270_AXIS_MAP_STRT_ADDR
},
493 { .type
= BMI2_GYRO_SELF_OFF
, .page
= BMI2_PAGE_1
, .start_addr
= BMI270_GYRO_SELF_OFF_STRT_ADDR
},
494 { .type
= BMI2_NVM_PROG_PREP
, .page
= BMI2_PAGE_1
, .start_addr
= BMI270_NVM_PROG_PREP_STRT_ADDR
},
495 { .type
= BMI2_GYRO_GAIN_UPDATE
, .page
= BMI2_PAGE_1
, .start_addr
= BMI270_GYRO_GAIN_UPDATE_STRT_ADDR
},
496 { .type
= BMI2_ANY_MOTION
, .page
= BMI2_PAGE_1
, .start_addr
= BMI270_ANY_MOT_STRT_ADDR
},
497 { .type
= BMI2_NO_MOTION
, .page
= BMI2_PAGE_2
, .start_addr
= BMI270_NO_MOT_STRT_ADDR
},
498 { .type
= BMI2_SIG_MOTION
, .page
= BMI2_PAGE_2
, .start_addr
= BMI270_SIG_MOT_STRT_ADDR
},
499 { .type
= BMI2_STEP_COUNTER_PARAMS
, .page
= BMI2_PAGE_3
, .start_addr
= BMI270_STEP_CNT_1_STRT_ADDR
},
500 { .type
= BMI2_STEP_DETECTOR
, .page
= BMI2_PAGE_6
, .start_addr
= BMI270_STEP_CNT_4_STRT_ADDR
},
501 { .type
= BMI2_STEP_COUNTER
, .page
= BMI2_PAGE_6
, .start_addr
= BMI270_STEP_CNT_4_STRT_ADDR
},
502 { .type
= BMI2_STEP_ACTIVITY
, .page
= BMI2_PAGE_6
, .start_addr
= BMI270_STEP_CNT_4_STRT_ADDR
},
503 { .type
= BMI2_WRIST_GESTURE
, .page
= BMI2_PAGE_6
, .start_addr
= BMI270_WRIST_GEST_STRT_ADDR
},
504 { .type
= BMI2_WRIST_WEAR_WAKE_UP
, .page
= BMI2_PAGE_7
, .start_addr
= BMI270_WRIST_WEAR_WAKE_UP_STRT_ADDR
},
507 /*! @name Global array that stores the feature output configuration */
508 const struct bmi2_feature_config bmi270_feat_out
[BMI270_MAX_FEAT_OUT
] = {
509 { .type
= BMI2_STEP_COUNTER
, .page
= BMI2_PAGE_0
, .start_addr
= BMI270_STEP_CNT_OUT_STRT_ADDR
},
510 { .type
= BMI2_STEP_ACTIVITY
, .page
= BMI2_PAGE_0
, .start_addr
= BMI270_STEP_ACT_OUT_STRT_ADDR
},
511 { .type
= BMI2_WRIST_GESTURE
, .page
= BMI2_PAGE_0
, .start_addr
= BMI270_WRIST_GEST_OUT_STRT_ADDR
},
512 { .type
= BMI2_GYRO_GAIN_UPDATE
, .page
= BMI2_PAGE_0
, .start_addr
= BMI270_GYR_USER_GAIN_OUT_STRT_ADDR
},
513 { .type
= BMI2_GYRO_CROSS_SENSE
, .page
= BMI2_PAGE_0
, .start_addr
= BMI270_GYRO_CROSS_SENSE_STRT_ADDR
},
514 { .type
= BMI2_NVM_STATUS
, .page
= BMI2_PAGE_0
, .start_addr
= BMI270_NVM_VFRM_OUT_STRT_ADDR
},
515 { .type
= BMI2_VFRM_STATUS
, .page
= BMI2_PAGE_0
, .start_addr
= BMI270_NVM_VFRM_OUT_STRT_ADDR
}
518 /*! @name Global array that stores the feature interrupts of BMI270 */
519 struct bmi2_map_int bmi270_map_int
[BMI270_MAX_INT_MAP
] = {
520 { .type
= BMI2_SIG_MOTION
, .sens_map_int
= BMI270_INT_SIG_MOT_MASK
},
521 { .type
= BMI2_STEP_COUNTER
, .sens_map_int
= BMI270_INT_STEP_COUNTER_MASK
},
522 { .type
= BMI2_STEP_DETECTOR
, .sens_map_int
= BMI270_INT_STEP_DETECTOR_MASK
},
523 { .type
= BMI2_STEP_ACTIVITY
, .sens_map_int
= BMI270_INT_STEP_ACT_MASK
},
524 { .type
= BMI2_WRIST_GESTURE
, .sens_map_int
= BMI270_INT_WRIST_GEST_MASK
},
525 { .type
= BMI2_WRIST_WEAR_WAKE_UP
, .sens_map_int
= BMI270_INT_WRIST_WEAR_WAKEUP_MASK
},
526 { .type
= BMI2_ANY_MOTION
, .sens_map_int
= BMI270_INT_ANY_MOT_MASK
},
527 { .type
= BMI2_NO_MOTION
, .sens_map_int
= BMI270_INT_NO_MOT_MASK
},
530 /******************************************************************************/
532 /*! Local Function Prototypes
533 ******************************************************************************/
536 * @brief This internal API is used to validate the device pointer for
539 * @param[in] dev : Structure instance of bmi2_dev.
541 * @return Result of API execution status
542 * @retval 0 -> Success
543 * @retval < 0 -> Fail
545 static int8_t null_ptr_check(const struct bmi2_dev
*dev
);
548 * @brief This internal API enables the selected sensor/features.
550 * @param[in] sensor_sel : Selects the desired sensor.
551 * @param[in, out] dev : Structure instance of bmi2_dev.
553 * @return Result of API execution status
554 * @retval 0 -> Success
555 * @retval < 0 -> Fail
557 static int8_t sensor_enable(uint64_t sensor_sel
, struct bmi2_dev
*dev
);
560 * @brief This internal API disables the selected sensor/features.
562 * @param[in] sensor_sel : Selects the desired sensor.
563 * @param[in, out] dev : Structure instance of bmi2_dev.
565 * @return Result of API execution status
566 * @retval 0 -> Success
567 * @retval < 0 -> Fail
569 static int8_t sensor_disable(uint64_t sensor_sel
, struct bmi2_dev
*dev
);
572 * @brief This internal API selects the sensors/features to be enabled or
575 * @param[in] sens_list : Pointer to select the sensor.
576 * @param[in] n_sens : Number of sensors selected.
577 * @param[out] sensor_sel : Gets the selected sensor.
579 * @return Result of API execution status
580 * @retval 0 -> Success
581 * @retval < 0 -> Fail
583 static int8_t select_sensor(const uint8_t *sens_list
, uint8_t n_sens
, uint64_t *sensor_sel
);
586 * @brief This internal API is used to enable/disable any-motion feature.
588 * @param[in] dev : Structure instance of bmi2_dev.
589 * @param[in] enable : Enables/Disables any-motion.
591 * Enable | Description
592 * -------------|---------------
593 * BMI2_DISABLE | Disables any-motion.
594 * BMI2_ENABLE | Enables any-motion.
596 * @return Result of API execution status
597 * @retval 0 -> Success
598 * @retval < 0 -> Fail
600 static int8_t set_any_motion(uint8_t enable
, struct bmi2_dev
*dev
);
603 * @brief This internal API is used to enable/disable no-motion feature.
605 * @param[in] dev : Structure instance of bmi2_dev.
606 * @param[in] enable : Enables/Disables no-motion.
608 * Enable | Description
609 * -------------|---------------
610 * BMI2_DISABLE | Disables no-motion.
611 * BMI2_ENABLE | Enables no-motion.
613 * @return Result of API execution status
614 * @retval 0 -> Success
615 * @retval < 0 -> Fail
617 static int8_t set_no_motion(uint8_t enable
, struct bmi2_dev
*dev
);
620 * @brief This internal API is used to enable/disable sig-motion feature.
622 * @param[in] dev : Structure instance of bmi2_dev.
623 * @param[in] enable : Enables/Disables sig-motion.
625 * Enable | Description
626 * -------------|---------------
627 * BMI2_DISABLE | Disables sig-motion.
628 * BMI2_ENABLE | Enables sig-motion.
630 * @return Result of API execution status
631 * @retval 0 -> Success
632 * @retval < 0 -> Fail
634 static int8_t set_sig_motion(uint8_t enable
, struct bmi2_dev
*dev
);
637 * @brief This internal API is used to enable/disable step detector feature.
639 * @param[in] dev : Structure instance of bmi2_dev.
640 * @param[in] enable : Enables/Disables step-detector.
642 * Enable | Description
643 * -------------|---------------
644 * BMI2_DISABLE | Disables step detector
645 * BMI2_ENABLE | Enables step detector
647 * @return Result of API execution status
648 * @retval 0 -> Success
649 * @retval < 0 -> Fail
651 static int8_t set_step_detector(uint8_t enable
, struct bmi2_dev
*dev
);
654 * @brief This internal API is used to enable/disable step counter feature.
656 * @param[in] dev : Structure instance of bmi2_dev.
657 * @param[in] enable : Enables/Disables step counter.
659 * Enable | Description
660 * -------------|---------------
661 * BMI2_DISABLE | Disables step counter
662 * BMI2_ENABLE | Enables step counter
664 * @return Result of API execution status
665 * @retval 0 -> Success
666 * @retval < 0 -> Fail
668 static int8_t set_step_counter(uint8_t enable
, struct bmi2_dev
*dev
);
671 * @brief This internal API is used to enable/disable step activity detection.
673 * @param[in] dev : Structure instance of bmi2_dev.
674 * @param[in] enable : Enables/Disables step activity.
676 * Enable | Description
677 * -------------|---------------
678 * BMI2_DISABLE | Disables step activity
679 * BMI2_ENABLE | Enables step activity
681 * @return Result of API execution status
682 * @retval 0 -> Success
683 * @retval < 0 -> Fail
685 static int8_t set_step_activity(uint8_t enable
, struct bmi2_dev
*dev
);
688 * @brief This internal API gives an option to enable offset correction
689 * feature of gyroscope, either internally or by the host.
691 * @param[in] enable : Enables/Disables self-offset correction.
692 * @param[in] dev : Structure instance of bmi2_dev.
694 * enable | Description
695 * -------------|---------------
696 * BMI2_ENABLE | gyroscope offset correction values are set internally
697 * BMI2_DISABLE | gyroscope offset correction values has to be set by host
699 * @return Result of API execution status
700 * @retval 0 -> Success
701 * @retval < 0 -> Fail
703 static int8_t set_gyro_self_offset_corr(uint8_t enable
, struct bmi2_dev
*dev
);
706 * @brief This internal API is used to enable/disable gyroscope user gain
709 * @param[in] dev : Structure instance of bmi2_dev.
710 * @param[in] enable : Enables/Disables gyroscope user gain.
712 * Enable | Description
713 * -------------|---------------
714 * BMI2_DISABLE | Disables gyroscope user gain
715 * BMI2_ENABLE | Enables gyroscope user gain
717 * @return Result of API execution status
718 * @retval 0 -> Success
719 * @retval < 0 -> Fail
721 static int8_t set_gyro_user_gain(uint8_t enable
, struct bmi2_dev
*dev
);
724 * @brief This internal API enables the wrist gesture feature.
726 * @param[in] dev : Structure instance of bmi2_dev.
727 * @param[in] enable : Enables/Disables wrist gesture.
729 * Enable | Description
730 * -------------|---------------
731 * BMI2_DISABLE | Disables wrist gesture
732 * BMI2_ENABLE | Enables wrist gesture
734 * @return Result of API execution status
735 * @retval 0 -> Success
736 * @retval < 0 -> Fail
738 static int8_t set_wrist_gesture(uint8_t enable
, struct bmi2_dev
*dev
);
741 * @brief This internal API enables the wrist wear wake up feature.
743 * @param[in] dev : Structure instance of bmi2_dev.
744 * @param[in] enable : Enables/Disables wrist wear wake up.
746 * Enable | Description
747 * -------------|---------------
748 * BMI2_DISABLE | Disables wrist wear wake up
749 * BMI2_ENABLE | Enables wrist wear wake up
751 * @return Result of API execution status
752 * @retval 0 -> Success
753 * @retval < 0 -> Fail
755 static int8_t set_wrist_wear_wake_up(uint8_t enable
, struct bmi2_dev
*dev
);
758 * @brief This internal API sets any-motion configurations like axes select,
759 * duration, threshold and output-configuration.
761 * @param[in] config : Structure instance of bmi2_any_motion_config.
762 * @param[in, out] dev : Structure instance of bmi2_dev.
765 *----------------------------------------------------------------------------
766 * bmi2_any_motion_config |
767 * Structure parameters | Description
768 *--------------------------|--------------------------------------------------
769 * | Defines the number of consecutive data points for
770 * | which the threshold condition must be respected,
771 * | for interrupt assertion. It is expressed in 50 Hz
772 * duration | samples (20 msec).
773 * | Range is 0 to 163sec.
774 * | Default value is 5 = 100ms.
775 * -------------------------|---------------------------------------------------
776 * | Slope threshold value for in 5.11g format.
777 * threshold | Range is 0 to 1g.
778 * | Default value is 0xAA = 83mg.
779 * -------------------------|---------------------------------------------------
780 * x_sel, y_sel, z_sel | Selects the feature on a per-axis basis
781 * -------------------------|---------------------------------------------------
784 * @return Result of API execution status
785 * @retval 0 -> Success
786 * @retval < 0 -> Fail
788 static int8_t set_any_motion_config(const struct bmi2_any_motion_config
*config
, struct bmi2_dev
*dev
);
791 * @brief This internal API sets no-motion configurations like axes select,
792 * duration, threshold and output-configuration.
794 * @param[in] config : Structure instance of bmi2_no_motion_config.
795 * @param[in, out] dev : Structure instance of bmi2_dev.
798 *----------------------------------------------------------------------------
799 * bmi2_no_motion_config |
800 * Structure parameters | Description
801 *--------------------------|--------------------------------------------------
802 * | Defines the number of consecutive data points for
803 * | which the threshold condition must be respected,
804 * | for interrupt assertion. It is expressed in 50 Hz
805 * duration | samples (20 msec).
806 * | Range is 0 to 163sec.
807 * | Default value is 5 = 100ms.
808 * -------------------------|---------------------------------------------------
809 * | Slope threshold value for in 5.11g format.
810 * threshold | Range is 0 to 1g.
811 * | Default value is 0xAA = 83mg.
812 * -------------------------|---------------------------------------------------
813 * x_sel, y_sel, z_sel | Selects the feature on a per-axis basis
814 * -------------------------|---------------------------------------------------
817 * @return Result of API execution status
818 * @retval 0 -> Success
819 * @retval < 0 -> Fail
821 static int8_t set_no_motion_config(const struct bmi2_no_motion_config
*config
, struct bmi2_dev
*dev
);
824 * @brief This internal API sets sig-motion configurations like block-size,
825 * output-configuration and other parameters.
827 * @param[in] config : Structure instance of bmi2_sig_motion_config.
828 * @param[in, out] dev : Structure instance of bmi2_dev.
830 *----------------------------------------------------------------------------
831 * bmi2_sig_motion_config |
832 * Structure parameters | Description
833 * -------------------------|---------------------------------------------------
834 * | Defines the duration after which the significant
835 * block_size | motion interrupt is triggered. It is expressed in
836 * | 50 Hz samples (20 ms). Default value is 0xFA=5sec.
837 *--------------------------|---------------------------------------------------
839 * @return Result of API execution status
840 * @retval 0 -> Success
841 * @retval < 0 -> Fail
843 static int8_t set_sig_motion_config(const struct bmi2_sig_motion_config
*config
, struct bmi2_dev
*dev
);
846 * @brief This internal API sets step counter parameter configurations.
848 * @param[in] step_count_params : Array that stores parameters 1 to 25.
849 * @param[in] dev : Structure instance of bmi2_dev.
851 * @return Result of API execution status
852 * @retval 0 -> Success
853 * @retval < 0 -> Fail
855 static int8_t set_step_count_params_config(const uint16_t *step_count_params
, struct bmi2_dev
*dev
);
858 * @brief This internal API sets step counter/detector/activity configurations.
860 * @param[in] config : Structure instance of bmi2_step_config.
861 * @param[in] dev : Structure instance of bmi2_dev.
863 *---------------------------------------------------------------------------
865 * Structure parameters | Description
866 *--------------------------|--------------------------------------------------
867 * | The Step-counter will trigger output every time
868 * | the number of steps are counted. Holds implicitly
869 * water-mark level | a 20x factor, so the range is 0 to 10230,
870 * | with resolution of 20 steps.
871 * -------------------------|---------------------------------------------------
872 * reset counter | Flag to reset the counted steps.
873 * -------------------------|---------------------------------------------------
876 * @return Result of API execution status
877 * @retval 0 -> Success
878 * @retval < 0 -> Fail
880 static int8_t set_step_config(const struct bmi2_step_config
*config
, struct bmi2_dev
*dev
);
883 * @brief This internal API sets wrist gesture configurations like wearable-arm,
884 * and output-configuration.
886 * @param[in] config : Structure instance of bmi2_wrist_gest_config.
887 * @param[in, out] dev : Structure instance of bmi2_dev.
890 *-----------------------------------------------------------------------------
891 * bmi2_wrist_gest_config |
892 * Structure parameters | Description
893 *--------------------------|--------------------------------------------------
894 * | Device in left (0) or right (1) arm. By default,
895 * wear_arm | the wearable device is assumed to be in left arm
896 * | i.e. default value is 0.
897 * -------------------------|---------------------------------------------------
900 * @return Result of API execution status
901 * @retval 0 -> Success
902 * @retval < 0 -> Fail
904 static int8_t set_wrist_gest_config(const struct bmi2_wrist_gest_config
*config
, struct bmi2_dev
*dev
);
907 * @brief This internal API sets wrist wear wake-up configurations like
908 * output-configuration.
910 * @param[in] config : Structure instance of
911 * bmi2_wrist_wear_wake_up_config.
912 * @param[in, out] dev : Structure instance of bmi2_dev.
915 *-----------------------------------------------------------------------------
916 * bmi2_wrist_wear_wake_up_config |
917 * Structure parameters | Description
918 *----------------------------------|-------------------------------------------
919 * | To set the wrist wear wake-up parameters like
920 * | min_angle_focus, min_angle_nonfocus,
921 * wrist_wear_wakeup_params | angle_landscape_left, angle_landscape_right,
922 * | angle_potrait_up and down.
923 * ---------------------------------|-------------------------------------------
926 * @return Result of API execution status
927 * @retval 0 -> Success
928 * @retval < 0 -> Fail
930 static int8_t set_wrist_wear_wake_up_config(const struct bmi2_wrist_wear_wake_up_config
*config
, struct bmi2_dev
*dev
);
933 * @brief This internal API gets any-motion configurations like axes select,
934 * duration, threshold and output-configuration.
936 * @param[out] config : Structure instance of bmi2_any_motion_config.
937 * @param[in, out] dev : Structure instance of bmi2_dev.
940 *----------------------------------------------------------------------------
941 * bmi2_any_motion_config |
942 * Structure parameters | Description
943 *--------------------------|--------------------------------------------------
944 * | Defines the number of consecutive data points for
945 * | which the threshold condition must be respected,
946 * | for interrupt assertion. It is expressed in 50 Hz
947 * duration | samples (20 msec).
948 * | Range is 0 to 163sec.
949 * | Default value is 5 = 100ms.
950 * -------------------------|---------------------------------------------------
951 * | Slope threshold value for in 5.11g format.
952 * threshold | Range is 0 to 1g.
953 * | Default value is 0xAA = 83mg.
954 * -------------------------|---------------------------------------------------
955 * x_sel, y_sel, z_sel | Selects the feature on a per-axis basis
956 * -------------------------|---------------------------------------------------
959 * @return Result of API execution status
960 * @retval 0 -> Success
961 * @retval < 0 -> Fail
963 static int8_t get_any_motion_config(struct bmi2_any_motion_config
*config
, struct bmi2_dev
*dev
);
966 * @brief This internal API gets no-motion configurations like axes select,
967 * duration, threshold and output-configuration.
969 * @param[out] config : Structure instance of bmi2_no_motion_config.
970 * @param[in, out] dev : Structure instance of bmi2_dev.
973 *----------------------------------------------------------------------------
974 * bmi2_no_motion_config |
975 * Structure parameters | Description
976 *--------------------------|--------------------------------------------------
977 * | Defines the number of consecutive data points for
978 * | which the threshold condition must be respected,
979 * | for interrupt assertion. It is expressed in 50 Hz
980 * duration | samples (20 msec).
981 * | Range is 0 to 163sec.
982 * | Default value is 5 = 100ms.
983 * -------------------------|---------------------------------------------------
984 * | Slope threshold value for in 5.11g format.
985 * threshold | Range is 0 to 1g.
986 * | Default value is 0xAA = 83mg.
987 * -------------------------|---------------------------------------------------
988 * x_sel, y_sel, z_sel | Selects the feature on a per-axis basis
989 * -------------------------|---------------------------------------------------
992 * @return Result of API execution status
993 * @retval 0 -> Success
994 * @retval < 0 -> Fail
996 static int8_t get_no_motion_config(struct bmi2_no_motion_config
*config
, struct bmi2_dev
*dev
);
999 * @brief This internal API gets sig-motion configurations like block-size,
1000 * output-configuration and other parameters.
1002 * @param[out] config : Structure instance of bmi2_sig_motion_config.
1003 * @param[in, out] dev : Structure instance of bmi2_dev.
1005 *----------------------------------------------------------------------------
1006 * bmi2_sig_motion_config |
1007 * Structure parameters | Description
1008 * -------------------------|---------------------------------------------------
1009 * | Defines the duration after which the significant
1010 * block_size | motion interrupt is triggered. It is expressed in
1011 * | 50 Hz samples (20 ms). Default value is 0xFA=5sec.
1012 *--------------------------|---------------------------------------------------
1014 * @return Result of API execution status
1015 * @retval 0 -> Success
1016 * @retval < 0 -> Fail
1018 static int8_t get_sig_motion_config(struct bmi2_sig_motion_config
*config
, struct bmi2_dev
*dev
);
1021 * @brief This internal API gets step counter parameter configurations.
1023 * @param[in] step_count_params : Array that stores parameters 1 to 25.
1024 * @param[in] dev : Structure instance of bmi2_dev.
1026 * @return Result of API execution status
1027 * @retval 0 -> Success
1028 * @retval < 0 -> Fail
1030 static int8_t get_step_count_params_config(uint16_t *step_count_params
, struct bmi2_dev
*dev
);
1033 * @brief This internal API gets step counter/detector/activity configurations.
1035 * @param[out] config : Structure instance of bmi2_step_config.
1036 * @param[in] dev : Structure instance of bmi2_dev.
1039 *----------------------------------------------------------------------------
1040 * bmi2_step_config |
1041 * Structure parameters | Description
1042 *--------------------------|--------------------------------------------------
1043 * | The Step-counter will trigger output every time
1044 * | the number of steps are counted. Holds implicitly
1045 * water-mark level | a 20x factor, so the range is 0 to 10230,
1046 * | with resolution of 20 steps.
1047 * -------------------------|---------------------------------------------------
1048 * reset counter | Flag to reset the counted steps.
1049 * -------------------------|---------------------------------------------------
1052 * @return Result of API execution status
1053 * @retval 0 -> Success
1054 * @retval < 0 -> Fail
1056 static int8_t get_step_config(struct bmi2_step_config
*config
, struct bmi2_dev
*dev
);
1059 * @brief This internal API gets wrist gesture configurations like wearable-arm,
1060 * and output-configuration.
1062 * @param[out] config : Structure instance of bmi2_wrist_gest_config.
1063 * @param[in, out] dev : Structure instance of bmi2_dev.
1066 *-----------------------------------------------------------------------------
1067 * bmi2_wrist_gest_config |
1068 * Structure parameters | Description
1069 *--------------------------|--------------------------------------------------
1070 * | Device in left (0) or right (1) arm. By default,
1071 * wear_arm | the wearable device is assumed to be in left arm
1072 * | i.e. default value is 0.
1073 * -------------------------|---------------------------------------------------
1076 * @return Result of API execution status
1077 * @retval 0 -> Success
1078 * @retval < 0 -> Fail
1080 static int8_t get_wrist_gest_config(struct bmi2_wrist_gest_config
*config
, struct bmi2_dev
*dev
);
1083 * @brief This internal API gets wrist wear wake-up configurations like
1084 * output-configuration.
1086 * @param[out] config : Structure instance of
1087 * bmi2_wrist_wear_wake_up_config.
1088 * @param[in, out] dev : Structure instance of bmi2_dev.
1091 *------------------------------------|---------------------------------------
1092 * bmi2_wrist_wear_wake_up_wh_config |
1093 * Structure parameters | Description
1094 *------------------------------------|-------------------------------------------
1095 * | To get the wrist wear wake-up parameters like
1096 * | min_angle_focus, min_angle_nonfocus,
1097 * wrist_wear_wake_params | angle_landscape_left, angle_landscape_right,
1098 * | angle_potrait_up and down.
1099 * -----------------------------------|-------------------------------------------
1102 * @return Result of API execution status
1103 * @retval 0 -> Success
1104 * @retval < 0 -> Fail
1106 static int8_t get_wrist_wear_wake_up_config(struct bmi2_wrist_wear_wake_up_config
*config
, struct bmi2_dev
*dev
);
1109 * @brief This internal API gets the output values of wrist gesture.
1111 * @param[out] wrist_gest : Pointer to the stored wrist gesture.
1112 * @param[in] dev : Structure instance of bmi2_dev.
1114 * *wrist_gest | Output
1115 * -------------|------------
1117 * 0x01 | PUSH_ARM_DOWN
1119 * 0x03 | WRIST_SHAKE_JIGGLE
1123 * @return Result of API execution status
1124 * @retval 0 -> Success
1125 * @retval < 0 -> Fail
1127 static int8_t get_wrist_gest_status(uint8_t *wrist_gest
, struct bmi2_dev
*dev
);
1130 * @brief This internal API gets the output values of step activity.
1132 * @param[out] step_act : Pointer to the stored step activity data.
1133 * @param[in] dev : Structure instance of bmi2_dev.
1135 * *step_act | Output
1136 * -----------|------------
1142 * @return Result of API execution status
1143 * @retval 0 -> Success
1144 * @retval < 0 -> Fails
1146 static int8_t get_step_activity_output(uint8_t *step_act
, struct bmi2_dev
*dev
);
1149 * @brief This internal API gets the output values of step counter.
1151 * @param[out] step_count : Pointer to the stored step counter data.
1152 * @param[in] dev : Structure instance of bmi2_dev.
1154 * @return Result of API execution status
1155 * @retval 0 -> Success
1156 * @retval < 0 -> Fail
1158 static int8_t get_step_counter_output(uint32_t *step_count
, struct bmi2_dev
*dev
);
1161 * @brief This internal API gets the error status related to NVM.
1163 * @param[out] nvm_err_stat : Stores the NVM error status.
1164 * @param[in] dev : Structure instance of bmi2_dev.
1166 * @return Result of API execution status
1167 * @retval 0 -> Success
1168 * @retval < 0 -> Fail
1170 static int8_t get_nvm_error_status(struct bmi2_nvm_err_status
*nvm_err_stat
, struct bmi2_dev
*dev
);
1173 * @brief This internal API gets the error status related to virtual frames.
1175 * @param[out] vfrm_err_stat : Stores the VFRM related error status.
1176 * @param[in] dev : Structure instance of bmi2_dev.
1178 * @return Result of API execution status
1179 * @retval 0 -> Success
1180 * @retval < 0 -> Fail
1182 static int8_t get_vfrm_error_status(struct bmi2_vfrm_err_status
*vfrm_err_stat
, struct bmi2_dev
*dev
);
1185 * @brief This internal API is used to get enable status of gyroscope user gain
1188 * @param[out] status : Stores status of gyroscope user gain update.
1189 * @param[in] dev : Structure instance of bmi2_dev.
1191 * @return Result of API execution status
1192 * @retval 0 -> Success
1193 * @retval < 0 -> Fail
1195 static int8_t get_user_gain_upd_status(uint8_t *status
, struct bmi2_dev
*dev
);
1198 * @brief This internal API enables/disables compensation of the gain defined
1199 * in the GAIN register.
1201 * @param[in] enable : Enables/Disables gain compensation
1202 * @param[in] dev : Structure instance of bmi2_dev.
1204 * enable | Description
1205 * -------------|---------------
1206 * BMI2_ENABLE | Enable gain compensation.
1207 * BMI2_DISABLE | Disable gain compensation.
1209 * @return Result of API execution status
1210 * @retval 0 -> Success
1211 * @retval < 0 -> Fail
1213 static int8_t enable_gyro_gain(uint8_t enable
, struct bmi2_dev
*dev
);
1216 * @brief This internal API is used to extract the output feature configuration
1217 * details like page and start address from the look-up table.
1219 * @param[out] feat_output : Structure that stores output feature
1221 * @param[in] type : Type of feature or sensor.
1222 * @param[in] dev : Structure instance of bmi2_dev.
1224 * @return Returns the feature found flag.
1226 * @retval BMI2_FALSE : Feature not found
1227 * BMI2_TRUE : Feature found
1229 static uint8_t extract_output_feat_config(struct bmi2_feature_config
*feat_output
,
1231 const struct bmi2_dev
*dev
);
1233 /***************************************************************************/
1235 /*! User Interface Definitions
1236 ****************************************************************************/
1240 * 1) updates the device structure with address of the configuration file.
1241 * 2) Initializes BMI270 sensor.
1242 * 3) Writes the configuration file.
1243 * 4) Updates the feature offset parameters in the device structure.
1244 * 5) Updates the maximum number of pages, in the device structure.
1246 int8_t bmi270_init(struct bmi2_dev
*dev
)
1248 /* Variable to define error */
1251 /* Null-pointer check */
1252 rslt
= null_ptr_check(dev
);
1253 if (rslt
== BMI2_OK
)
1255 /* Assign chip id of BMI270 */
1256 dev
->chip_id
= BMI270_CHIP_ID
;
1258 /* get the size of config array */
1259 dev
->config_size
= sizeof(bmi270_config_file
);
1261 /* Enable the variant specific features if any */
1262 dev
->variant_feature
= BMI2_GYRO_CROSS_SENS_ENABLE
| BMI2_CRT_RTOSK_ENABLE
;
1264 /* An extra dummy byte is read during SPI read */
1265 if (dev
->intf
== BMI2_SPI_INTF
)
1267 dev
->dummy_byte
= 1;
1271 dev
->dummy_byte
= 0;
1274 /* If configuration file pointer is not assigned any address */
1275 if (!dev
->config_file_ptr
)
1277 /* Give the address of the configuration file array to
1278 * the device pointer
1280 dev
->config_file_ptr
= bmi270_config_file
;
1283 /* Initialize BMI2 sensor */
1284 rslt
= bmi2_sec_init(dev
);
1285 if (rslt
== BMI2_OK
)
1287 /* Assign the offsets of the feature input
1288 * configuration to the device structure
1290 dev
->feat_config
= bmi270_feat_in
;
1292 /* Assign the offsets of the feature output to
1293 * the device structure
1295 dev
->feat_output
= bmi270_feat_out
;
1297 /* Assign the maximum number of pages to the
1300 dev
->page_max
= BMI270_MAX_PAGE_NUM
;
1302 /* Assign maximum number of input sensors/
1303 * features to device structure
1305 dev
->input_sens
= BMI270_MAX_FEAT_IN
;
1307 /* Assign maximum number of output sensors/
1308 * features to device structure
1310 dev
->out_sens
= BMI270_MAX_FEAT_OUT
;
1312 /* Assign the offsets of the feature interrupt
1313 * to the device structure
1315 dev
->map_int
= bmi270_map_int
;
1317 /* Assign maximum number of feature interrupts
1318 * to device structure
1320 dev
->sens_int_map
= BMI270_MAX_INT_MAP
;
1322 /* Get the gyroscope cross axis sensitivity */
1323 rslt
= bmi2_get_gyro_cross_sense(dev
);
1331 * @brief This API selects the sensors/features to be enabled.
1333 int8_t bmi270_sensor_enable(const uint8_t *sens_list
, uint8_t n_sens
, struct bmi2_dev
*dev
)
1335 /* Variable to define error */
1338 /* Variable to select sensor */
1339 uint64_t sensor_sel
= 0;
1341 /* Null-pointer check */
1342 rslt
= null_ptr_check(dev
);
1343 if ((rslt
== BMI2_OK
) && (sens_list
!= NULL
))
1345 /* Get the selected sensors */
1346 rslt
= select_sensor(sens_list
, n_sens
, &sensor_sel
);
1347 if (rslt
== BMI2_OK
)
1349 /* Enable the selected sensors */
1350 rslt
= sensor_enable(sensor_sel
, dev
);
1355 rslt
= BMI2_E_NULL_PTR
;
1362 * @brief This API selects the sensors/features to be disabled.
1364 int8_t bmi270_sensor_disable(const uint8_t *sens_list
, uint8_t n_sens
, struct bmi2_dev
*dev
)
1366 /* Variable to define error */
1369 /* Variable to select sensor */
1370 uint64_t sensor_sel
= 0;
1372 /* Null-pointer check */
1373 rslt
= null_ptr_check(dev
);
1374 if ((rslt
== BMI2_OK
) && (sens_list
!= NULL
))
1376 /* Get the selected sensors */
1377 rslt
= select_sensor(sens_list
, n_sens
, &sensor_sel
);
1378 if (rslt
== BMI2_OK
)
1380 /* Disable the selected sensors */
1381 rslt
= sensor_disable(sensor_sel
, dev
);
1386 rslt
= BMI2_E_NULL_PTR
;
1393 * @brief This API sets the sensor/feature configuration.
1395 int8_t bmi270_set_sensor_config(struct bmi2_sens_config
*sens_cfg
, uint8_t n_sens
, struct bmi2_dev
*dev
)
1397 /* Variable to define error */
1400 /* Variable to define loop */
1403 /* Variable to get the status of advance power save */
1404 uint8_t aps_stat
= 0;
1406 /* Null-pointer check */
1407 rslt
= null_ptr_check(dev
);
1408 if ((rslt
== BMI2_OK
) && (sens_cfg
!= NULL
))
1410 /* Get status of advance power save mode */
1411 aps_stat
= dev
->aps_status
;
1413 for (loop
= 0; loop
< n_sens
; loop
++)
1415 if ((sens_cfg
[loop
].type
== BMI2_ACCEL
) || (sens_cfg
[loop
].type
== BMI2_GYRO
) ||
1416 (sens_cfg
[loop
].type
== BMI2_AUX
) || (sens_cfg
[loop
].type
== BMI2_GYRO_GAIN_UPDATE
))
1418 rslt
= bmi2_set_sensor_config(&sens_cfg
[loop
], 1, dev
);
1422 /* Disable Advance power save if enabled for auxiliary
1423 * and feature configurations
1425 if (aps_stat
== BMI2_ENABLE
)
1427 /* Disable advance power save if
1430 rslt
= bmi2_set_adv_power_save(BMI2_DISABLE
, dev
);
1433 if (rslt
== BMI2_OK
)
1435 switch (sens_cfg
[loop
].type
)
1437 /* Set any motion configuration */
1438 case BMI2_ANY_MOTION
:
1439 rslt
= set_any_motion_config(&sens_cfg
[loop
].cfg
.any_motion
, dev
);
1442 /* Set no motion configuration */
1443 case BMI2_NO_MOTION
:
1444 rslt
= set_no_motion_config(&sens_cfg
[loop
].cfg
.no_motion
, dev
);
1447 /* Set sig-motion configuration */
1448 case BMI2_SIG_MOTION
:
1449 rslt
= set_sig_motion_config(&sens_cfg
[loop
].cfg
.sig_motion
, dev
);
1452 /* Set the step counter parameters */
1453 case BMI2_STEP_COUNTER_PARAMS
:
1454 rslt
= set_step_count_params_config(sens_cfg
[loop
].cfg
.step_counter_params
, dev
);
1457 /* Set step counter/detector/activity configuration */
1458 case BMI2_STEP_DETECTOR
:
1459 case BMI2_STEP_COUNTER
:
1460 case BMI2_STEP_ACTIVITY
:
1461 rslt
= set_step_config(&sens_cfg
[loop
].cfg
.step_counter
, dev
);
1464 /* Set the wrist gesture configuration */
1465 case BMI2_WRIST_GESTURE
:
1466 rslt
= set_wrist_gest_config(&sens_cfg
[loop
].cfg
.wrist_gest
, dev
);
1469 /* Set the wrist wear wake-up configuration */
1470 case BMI2_WRIST_WEAR_WAKE_UP
:
1471 rslt
= set_wrist_wear_wake_up_config(&sens_cfg
[loop
].cfg
.wrist_wear_wake_up
, dev
);
1475 rslt
= BMI2_E_INVALID_SENSOR
;
1480 /* Return error if any of the set configurations fail */
1481 if (rslt
!= BMI2_OK
)
1488 /* Enable Advance power save if disabled while configuring and
1489 * not when already disabled
1491 if ((aps_stat
== BMI2_ENABLE
) && (rslt
== BMI2_OK
))
1493 rslt
= bmi2_set_adv_power_save(BMI2_ENABLE
, dev
);
1498 rslt
= BMI2_E_NULL_PTR
;
1505 * @brief This API gets the sensor/feature configuration.
1507 int8_t bmi270_get_sensor_config(struct bmi2_sens_config
*sens_cfg
, uint8_t n_sens
, struct bmi2_dev
*dev
)
1509 /* Variable to define error */
1512 /* Variable to define loop */
1515 /* Variable to get the status of advance power save */
1516 uint8_t aps_stat
= 0;
1518 /* Null-pointer check */
1519 rslt
= null_ptr_check(dev
);
1520 if ((rslt
== BMI2_OK
) && (sens_cfg
!= NULL
))
1522 /* Get status of advance power save mode */
1523 aps_stat
= dev
->aps_status
;
1524 for (loop
= 0; loop
< n_sens
; loop
++)
1526 if ((sens_cfg
[loop
].type
== BMI2_ACCEL
) || (sens_cfg
[loop
].type
== BMI2_GYRO
) ||
1527 (sens_cfg
[loop
].type
== BMI2_AUX
) || (sens_cfg
[loop
].type
== BMI2_GYRO_GAIN_UPDATE
))
1529 rslt
= bmi2_get_sensor_config(&sens_cfg
[loop
], 1, dev
);
1533 /* Disable Advance power save if enabled for auxiliary
1534 * and feature configurations
1536 if ((sens_cfg
[loop
].type
>= BMI2_MAIN_SENS_MAX_NUM
) || (sens_cfg
[loop
].type
== BMI2_AUX
))
1539 if (aps_stat
== BMI2_ENABLE
)
1541 /* Disable advance power save if
1544 rslt
= bmi2_set_adv_power_save(BMI2_DISABLE
, dev
);
1548 if (rslt
== BMI2_OK
)
1550 switch (sens_cfg
[loop
].type
)
1552 /* Get sig-motion configuration */
1553 case BMI2_SIG_MOTION
:
1554 rslt
= get_sig_motion_config(&sens_cfg
[loop
].cfg
.sig_motion
, dev
);
1557 /* Get any motion configuration */
1558 case BMI2_ANY_MOTION
:
1559 rslt
= get_any_motion_config(&sens_cfg
[loop
].cfg
.any_motion
, dev
);
1562 /* Get no motion configuration */
1563 case BMI2_NO_MOTION
:
1564 rslt
= get_no_motion_config(&sens_cfg
[loop
].cfg
.no_motion
, dev
);
1567 /* Set the step counter parameters */
1568 case BMI2_STEP_COUNTER_PARAMS
:
1569 rslt
= get_step_count_params_config(sens_cfg
[loop
].cfg
.step_counter_params
, dev
);
1572 /* Get step counter/detector/activity configuration */
1573 case BMI2_STEP_DETECTOR
:
1574 case BMI2_STEP_COUNTER
:
1575 case BMI2_STEP_ACTIVITY
:
1576 rslt
= get_step_config(&sens_cfg
[loop
].cfg
.step_counter
, dev
);
1579 /* Get the wrist gesture configuration */
1580 case BMI2_WRIST_GESTURE
:
1581 rslt
= get_wrist_gest_config(&sens_cfg
[loop
].cfg
.wrist_gest
, dev
);
1584 /* Get the wrist wear wake-up configuration */
1585 case BMI2_WRIST_WEAR_WAKE_UP
:
1586 rslt
= get_wrist_wear_wake_up_config(&sens_cfg
[loop
].cfg
.wrist_wear_wake_up
, dev
);
1590 rslt
= BMI2_E_INVALID_SENSOR
;
1595 /* Return error if any of the get configurations fail */
1596 if (rslt
!= BMI2_OK
)
1603 /* Enable Advance power save if disabled while configuring and
1604 * not when already disabled
1606 if ((aps_stat
== BMI2_ENABLE
) && (rslt
== BMI2_OK
))
1608 rslt
= bmi2_set_adv_power_save(BMI2_ENABLE
, dev
);
1613 rslt
= BMI2_E_NULL_PTR
;
1620 * @brief This API gets the sensor/feature data for accelerometer, gyroscope,
1621 * auxiliary sensor, step counter, high-g, gyroscope user-gain update,
1622 * orientation, gyroscope cross sensitivity and error status for NVM and VFRM.
1624 int8_t bmi270_get_sensor_data(struct bmi2_sensor_data
*sensor_data
, uint8_t n_sens
, struct bmi2_dev
*dev
)
1626 /* Variable to define error */
1629 /* Variable to define loop */
1632 /* Variable to get the status of advance power save */
1633 uint8_t aps_stat
= 0;
1635 /* Null-pointer check */
1636 rslt
= null_ptr_check(dev
);
1637 if ((rslt
== BMI2_OK
) && (sensor_data
!= NULL
))
1639 /* Get status of advance power save mode */
1640 aps_stat
= dev
->aps_status
;
1641 for (loop
= 0; loop
< n_sens
; loop
++)
1643 if ((sensor_data
[loop
].type
== BMI2_ACCEL
) || (sensor_data
[loop
].type
== BMI2_GYRO
) ||
1644 (sensor_data
[loop
].type
== BMI2_AUX
) || (sensor_data
[loop
].type
== BMI2_GYRO_GAIN_UPDATE
) ||
1645 (sensor_data
[loop
].type
== BMI2_GYRO_CROSS_SENSE
))
1647 rslt
= bmi2_get_sensor_data(&sensor_data
[loop
], 1, dev
);
1651 /* Disable Advance power save if enabled for feature
1654 if (sensor_data
[loop
].type
>= BMI2_MAIN_SENS_MAX_NUM
)
1656 if (aps_stat
== BMI2_ENABLE
)
1658 /* Disable advance power save if
1661 rslt
= bmi2_set_adv_power_save(BMI2_DISABLE
, dev
);
1665 if (rslt
== BMI2_OK
)
1667 switch (sensor_data
[loop
].type
)
1669 case BMI2_STEP_COUNTER
:
1671 /* Get step counter output */
1672 rslt
= get_step_counter_output(&sensor_data
[loop
].sens_data
.step_counter_output
, dev
);
1674 case BMI2_STEP_ACTIVITY
:
1676 /* Get step activity output */
1677 rslt
= get_step_activity_output(&sensor_data
[loop
].sens_data
.activity_output
, dev
);
1679 case BMI2_NVM_STATUS
:
1681 /* Get NVM error status */
1682 rslt
= get_nvm_error_status(&sensor_data
[loop
].sens_data
.nvm_status
, dev
);
1684 case BMI2_VFRM_STATUS
:
1686 /* Get VFRM error status */
1687 rslt
= get_vfrm_error_status(&sensor_data
[loop
].sens_data
.vfrm_status
, dev
);
1689 case BMI2_WRIST_GESTURE
:
1691 /* Get wrist gesture status */
1692 rslt
= get_wrist_gest_status(&sensor_data
[loop
].sens_data
.wrist_gesture_output
, dev
);
1695 rslt
= BMI2_E_INVALID_SENSOR
;
1699 /* Return error if any of the get sensor data fails */
1700 if (rslt
!= BMI2_OK
)
1707 /* Enable Advance power save if disabled while
1708 * configuring and not when already disabled
1710 if ((aps_stat
== BMI2_ENABLE
) && (rslt
== BMI2_OK
))
1712 rslt
= bmi2_set_adv_power_save(BMI2_ENABLE
, dev
);
1718 rslt
= BMI2_E_NULL_PTR
;
1725 * @brief This API updates the gyroscope user-gain.
1727 int8_t bmi270_update_gyro_user_gain(const struct bmi2_gyro_user_gain_config
*user_gain
, struct bmi2_dev
*dev
)
1729 /* Variable to define error */
1732 /* Variable to select sensor */
1733 uint8_t sens_sel
[2] = { BMI2_GYRO
, BMI2_GYRO_GAIN_UPDATE
};
1735 /* Structure to define sensor configurations */
1736 struct bmi2_sens_config sens_cfg
;
1738 /* Variable to store status of user-gain update module */
1741 /* Variable to define count */
1742 uint8_t count
= 100;
1744 /* Null-pointer check */
1745 rslt
= null_ptr_check(dev
);
1746 if ((rslt
== BMI2_OK
) && (user_gain
!= NULL
))
1748 /* Select type of feature */
1749 sens_cfg
.type
= BMI2_GYRO_GAIN_UPDATE
;
1751 /* Get the user gain configurations */
1752 rslt
= bmi270_get_sensor_config(&sens_cfg
, 1, dev
);
1753 if (rslt
== BMI2_OK
)
1755 /* Get the user-defined ratio */
1756 sens_cfg
.cfg
.gyro_gain_update
= *user_gain
;
1758 /* Set rate ratio for all axes */
1759 rslt
= bmi270_set_sensor_config(&sens_cfg
, 1, dev
);
1762 /* Disable gyroscope */
1763 if (rslt
== BMI2_OK
)
1765 rslt
= bmi270_sensor_disable(&sens_sel
[0], 1, dev
);
1768 /* Enable gyroscope user-gain update module */
1769 if (rslt
== BMI2_OK
)
1771 rslt
= bmi270_sensor_enable(&sens_sel
[1], 1, dev
);
1774 /* Set the command to trigger the computation */
1775 if (rslt
== BMI2_OK
)
1777 rslt
= bmi2_set_command_register(BMI2_USR_GAIN_CMD
, dev
);
1780 if (rslt
== BMI2_OK
)
1782 /* Poll until enable bit of user-gain update is 0 */
1785 rslt
= get_user_gain_upd_status(&status
, dev
);
1786 if ((rslt
== BMI2_OK
) && (status
== 0))
1788 /* Enable compensation of gain defined
1789 * in the GAIN register
1791 rslt
= enable_gyro_gain(BMI2_ENABLE
, dev
);
1793 /* Enable gyroscope */
1794 if (rslt
== BMI2_OK
)
1796 rslt
= bmi270_sensor_enable(&sens_sel
[0], 1, dev
);
1802 dev
->delay_us(10000, dev
->intf_ptr
);
1805 /* Return error if user-gain update is failed */
1806 if ((rslt
== BMI2_OK
) && (status
!= 0))
1808 rslt
= BMI2_E_GYR_USER_GAIN_UPD_FAIL
;
1814 rslt
= BMI2_E_NULL_PTR
;
1821 * @brief This API reads the compensated gyroscope user-gain values.
1823 int8_t bmi270_read_gyro_user_gain(struct bmi2_gyro_user_gain_data
*gyr_usr_gain
, struct bmi2_dev
*dev
)
1825 /* Variable to define error */
1828 /* Variable to define register data */
1829 uint8_t reg_data
[3] = { 0 };
1831 /* Null-pointer check */
1832 rslt
= null_ptr_check(dev
);
1833 if ((rslt
== BMI2_OK
) && (gyr_usr_gain
!= NULL
))
1835 /* Get the gyroscope compensated gain values */
1836 rslt
= bmi2_get_regs(BMI2_GYR_USR_GAIN_0_ADDR
, reg_data
, 3, dev
);
1837 if (rslt
== BMI2_OK
)
1839 /* Gyroscope user gain correction X-axis */
1840 gyr_usr_gain
->x
= (int8_t)BMI2_GET_BIT_POS0(reg_data
[0], BMI2_GYR_USR_GAIN_X
);
1842 /* Gyroscope user gain correction Y-axis */
1843 gyr_usr_gain
->y
= (int8_t)BMI2_GET_BIT_POS0(reg_data
[1], BMI2_GYR_USR_GAIN_Y
);
1845 /* Gyroscope user gain correction z-axis */
1846 gyr_usr_gain
->z
= (int8_t)BMI2_GET_BIT_POS0(reg_data
[2], BMI2_GYR_USR_GAIN_Z
);
1851 rslt
= BMI2_E_NULL_PTR
;
1858 * @brief This API maps/unmaps feature interrupts to that of interrupt pins.
1860 int8_t bmi270_map_feat_int(const struct bmi2_sens_int_config
*sens_int
, uint8_t n_sens
, struct bmi2_dev
*dev
)
1862 /* Variable to define error */
1865 /* Variable to define loop */
1868 /* Null-pointer check */
1869 rslt
= null_ptr_check(dev
);
1870 if ((rslt
== BMI2_OK
) && (sens_int
!= NULL
))
1872 for (loop
= 0; loop
< n_sens
; loop
++)
1874 switch (sens_int
[loop
].type
)
1876 case BMI2_SIG_MOTION
:
1877 case BMI2_WRIST_GESTURE
:
1878 case BMI2_ANY_MOTION
:
1879 case BMI2_NO_MOTION
:
1880 case BMI2_STEP_COUNTER
:
1881 case BMI2_STEP_DETECTOR
:
1882 case BMI2_STEP_ACTIVITY
:
1883 case BMI2_WRIST_WEAR_WAKE_UP
:
1885 rslt
= bmi2_map_feat_int(sens_int
[loop
].type
, sens_int
[loop
].hw_int_pin
, dev
);
1888 rslt
= BMI2_E_INVALID_SENSOR
;
1892 /* Return error if interrupt mapping fails */
1893 if (rslt
!= BMI2_OK
)
1901 rslt
= BMI2_E_NULL_PTR
;
1907 /***************************************************************************/
1909 /*! Local Function Definitions
1910 ****************************************************************************/
1913 * @brief This internal API is used to validate the device structure pointer for
1916 static int8_t null_ptr_check(const struct bmi2_dev
*dev
)
1918 /* Variable to define error */
1919 int8_t rslt
= BMI2_OK
;
1921 if ((dev
== NULL
) || (dev
->read
== NULL
) || (dev
->write
== NULL
) || (dev
->delay_us
== NULL
))
1923 /* Device structure pointer is not valid */
1924 rslt
= BMI2_E_NULL_PTR
;
1931 * @brief This internal API selects the sensor/features to be enabled or
1934 static int8_t select_sensor(const uint8_t *sens_list
, uint8_t n_sens
, uint64_t *sensor_sel
)
1936 /* Variable to define error */
1937 int8_t rslt
= BMI2_OK
;
1939 /* Variable to define loop */
1942 for (count
= 0; count
< n_sens
; count
++)
1944 switch (sens_list
[count
])
1947 *sensor_sel
|= BMI2_ACCEL_SENS_SEL
;
1950 *sensor_sel
|= BMI2_GYRO_SENS_SEL
;
1953 *sensor_sel
|= BMI2_AUX_SENS_SEL
;
1956 *sensor_sel
|= BMI2_TEMP_SENS_SEL
;
1958 case BMI2_SIG_MOTION
:
1959 *sensor_sel
|= BMI2_SIG_MOTION_SEL
;
1961 case BMI2_ANY_MOTION
:
1962 *sensor_sel
|= BMI2_ANY_MOT_SEL
;
1964 case BMI2_NO_MOTION
:
1965 *sensor_sel
|= BMI2_NO_MOT_SEL
;
1967 case BMI2_STEP_DETECTOR
:
1968 *sensor_sel
|= BMI2_STEP_DETECT_SEL
;
1970 case BMI2_STEP_COUNTER
:
1971 *sensor_sel
|= BMI2_STEP_COUNT_SEL
;
1973 case BMI2_STEP_ACTIVITY
:
1974 *sensor_sel
|= BMI2_STEP_ACT_SEL
;
1976 case BMI2_GYRO_GAIN_UPDATE
:
1977 *sensor_sel
|= BMI2_GYRO_GAIN_UPDATE_SEL
;
1979 case BMI2_GYRO_SELF_OFF
:
1980 *sensor_sel
|= BMI2_GYRO_SELF_OFF_SEL
;
1982 case BMI2_WRIST_GESTURE
:
1983 *sensor_sel
|= BMI2_WRIST_GEST_SEL
;
1985 case BMI2_WRIST_WEAR_WAKE_UP
:
1986 *sensor_sel
|= BMI2_WRIST_WEAR_WAKE_UP_SEL
;
1989 rslt
= BMI2_E_INVALID_SENSOR
;
1998 * @brief This internal API enables the selected sensor/features.
2000 static int8_t sensor_enable(uint64_t sensor_sel
, struct bmi2_dev
*dev
)
2002 /* Variable to define error */
2005 /* Variable to store register values */
2006 uint8_t reg_data
= 0;
2008 /* Variable to define loop */
2011 /* Variable to get the status of advance power save */
2012 uint8_t aps_stat
= 0;
2014 rslt
= bmi2_get_regs(BMI2_PWR_CTRL_ADDR
, ®_data
, 1, dev
);
2015 if (rslt
== BMI2_OK
)
2017 /* Enable accelerometer */
2018 if (sensor_sel
& BMI2_ACCEL_SENS_SEL
)
2020 reg_data
= BMI2_SET_BITS(reg_data
, BMI2_ACC_EN
, BMI2_ENABLE
);
2023 /* Enable gyroscope */
2024 if (sensor_sel
& BMI2_GYRO_SENS_SEL
)
2026 reg_data
= BMI2_SET_BITS(reg_data
, BMI2_GYR_EN
, BMI2_ENABLE
);
2029 /* Enable auxiliary sensor */
2030 if (sensor_sel
& BMI2_AUX_SENS_SEL
)
2032 reg_data
= BMI2_SET_BIT_POS0(reg_data
, BMI2_AUX_EN
, BMI2_ENABLE
);
2035 /* Enable temperature sensor */
2036 if (sensor_sel
& BMI2_TEMP_SENS_SEL
)
2038 reg_data
= BMI2_SET_BITS(reg_data
, BMI2_TEMP_EN
, BMI2_ENABLE
);
2041 /* Enable the sensors that are set in the power control register */
2042 if (sensor_sel
& BMI2_MAIN_SENSORS
)
2044 rslt
= bmi2_set_regs(BMI2_PWR_CTRL_ADDR
, ®_data
, 1, dev
);
2048 if ((rslt
== BMI2_OK
) && (sensor_sel
& ~(BMI2_MAIN_SENSORS
)))
2050 /* Get status of advance power save mode */
2051 aps_stat
= dev
->aps_status
;
2052 if (aps_stat
== BMI2_ENABLE
)
2054 /* Disable advance power save if enabled */
2055 rslt
= bmi2_set_adv_power_save(BMI2_DISABLE
, dev
);
2058 if (rslt
== BMI2_OK
)
2062 /* Enable sig-motion feature */
2063 if (sensor_sel
& BMI2_SIG_MOTION_SEL
)
2065 rslt
= set_sig_motion(BMI2_ENABLE
, dev
);
2066 if (rslt
== BMI2_OK
)
2068 dev
->sens_en_stat
|= BMI2_SIG_MOTION_SEL
;
2076 /* Enable any motion feature */
2077 if (sensor_sel
& BMI2_ANY_MOT_SEL
)
2079 rslt
= set_any_motion(BMI2_ENABLE
, dev
);
2080 if (rslt
== BMI2_OK
)
2082 dev
->sens_en_stat
|= BMI2_ANY_MOT_SEL
;
2090 /* Enable no motion feature */
2091 if (sensor_sel
& BMI2_NO_MOT_SEL
)
2093 rslt
= set_no_motion(BMI2_ENABLE
, dev
);
2094 if (rslt
== BMI2_OK
)
2096 dev
->sens_en_stat
|= BMI2_NO_MOT_SEL
;
2104 /* Enable step detector feature */
2105 if (sensor_sel
& BMI2_STEP_DETECT_SEL
)
2107 rslt
= set_step_detector(BMI2_ENABLE
, dev
);
2108 if (rslt
== BMI2_OK
)
2110 dev
->sens_en_stat
|= BMI2_STEP_DETECT_SEL
;
2118 /* Enable step counter feature */
2119 if (sensor_sel
& BMI2_STEP_COUNT_SEL
)
2121 rslt
= set_step_counter(BMI2_ENABLE
, dev
);
2122 if (rslt
== BMI2_OK
)
2124 dev
->sens_en_stat
|= BMI2_STEP_COUNT_SEL
;
2132 /* Enable step activity feature */
2133 if (sensor_sel
& BMI2_STEP_ACT_SEL
)
2135 rslt
= set_step_activity(BMI2_ENABLE
, dev
);
2136 if (rslt
== BMI2_OK
)
2138 dev
->sens_en_stat
|= BMI2_STEP_ACT_SEL
;
2146 /* Enable gyroscope user gain */
2147 if (sensor_sel
& BMI2_GYRO_GAIN_UPDATE_SEL
)
2149 rslt
= set_gyro_user_gain(BMI2_ENABLE
, dev
);
2150 if (rslt
== BMI2_OK
)
2152 dev
->sens_en_stat
|= BMI2_GYRO_GAIN_UPDATE_SEL
;
2160 /* Enable gyroscope self-offset correction feature */
2161 if (sensor_sel
& BMI2_GYRO_SELF_OFF_SEL
)
2163 rslt
= set_gyro_self_offset_corr(BMI2_ENABLE
, dev
);
2164 if (rslt
== BMI2_OK
)
2166 dev
->sens_en_stat
|= BMI2_GYRO_SELF_OFF_SEL
;
2174 /* Enable wrist gesture feature for wearable variant */
2175 if (sensor_sel
& BMI2_WRIST_GEST_SEL
)
2177 rslt
= set_wrist_gesture(BMI2_ENABLE
, dev
);
2178 if (rslt
== BMI2_OK
)
2180 dev
->sens_en_stat
|= BMI2_WRIST_GEST_SEL
;
2188 /* Enable wrist wear wake-up feature */
2189 if (sensor_sel
& BMI2_WRIST_WEAR_WAKE_UP_SEL
)
2191 rslt
= set_wrist_wear_wake_up(BMI2_ENABLE
, dev
);
2192 if (rslt
== BMI2_OK
)
2194 dev
->sens_en_stat
|= BMI2_WRIST_WEAR_WAKE_UP_SEL
;
2203 /* Enable Advance power save if disabled while
2204 * configuring and not when already disabled
2206 if ((aps_stat
== BMI2_ENABLE
) && (rslt
== BMI2_OK
))
2208 rslt
= bmi2_set_adv_power_save(BMI2_ENABLE
, dev
);
2217 * @brief This internal API disables the selected sensors/features.
2219 static int8_t sensor_disable(uint64_t sensor_sel
, struct bmi2_dev
*dev
)
2221 /* Variable to define error */
2224 /* Variable to store register values */
2225 uint8_t reg_data
= 0;
2227 /* Variable to define loop */
2230 /* Variable to get the status of advance power save */
2231 uint8_t aps_stat
= 0;
2233 rslt
= bmi2_get_regs(BMI2_PWR_CTRL_ADDR
, ®_data
, 1, dev
);
2234 if (rslt
== BMI2_OK
)
2236 /* Disable accelerometer */
2237 if (sensor_sel
& BMI2_ACCEL_SENS_SEL
)
2239 reg_data
= BMI2_SET_BIT_VAL0(reg_data
, BMI2_ACC_EN
);
2242 /* Disable gyroscope */
2243 if (sensor_sel
& BMI2_GYRO_SENS_SEL
)
2245 reg_data
= BMI2_SET_BIT_VAL0(reg_data
, BMI2_GYR_EN
);
2248 /* Disable auxiliary sensor */
2249 if (sensor_sel
& BMI2_AUX_SENS_SEL
)
2251 reg_data
= BMI2_SET_BIT_VAL0(reg_data
, BMI2_AUX_EN
);
2254 /* Disable temperature sensor */
2255 if (sensor_sel
& BMI2_TEMP_SENS_SEL
)
2257 reg_data
= BMI2_SET_BIT_VAL0(reg_data
, BMI2_TEMP_EN
);
2260 /* Disable the sensors that are set in the power control register */
2261 if (sensor_sel
& BMI2_MAIN_SENSORS
)
2263 rslt
= bmi2_set_regs(BMI2_PWR_CTRL_ADDR
, ®_data
, 1, dev
);
2267 if ((rslt
== BMI2_OK
) && (sensor_sel
& ~(BMI2_MAIN_SENSORS
)))
2269 /* Get status of advance power save mode */
2270 aps_stat
= dev
->aps_status
;
2271 if (aps_stat
== BMI2_ENABLE
)
2273 /* Disable advance power save if enabled */
2274 rslt
= bmi2_set_adv_power_save(BMI2_DISABLE
, dev
);
2277 if (rslt
== BMI2_OK
)
2281 /* Disable sig-motion feature */
2282 if (sensor_sel
& BMI2_SIG_MOTION_SEL
)
2284 rslt
= set_sig_motion(BMI2_DISABLE
, dev
);
2285 if (rslt
== BMI2_OK
)
2287 dev
->sens_en_stat
&= ~BMI2_SIG_MOTION_SEL
;
2295 /* Disable any-motion feature */
2296 if (sensor_sel
& BMI2_ANY_MOT_SEL
)
2298 rslt
= set_any_motion(BMI2_DISABLE
, dev
);
2299 if (rslt
== BMI2_OK
)
2301 dev
->sens_en_stat
&= ~BMI2_ANY_MOT_SEL
;
2309 /* Disable no-motion feature */
2310 if (sensor_sel
& BMI2_NO_MOT_SEL
)
2312 rslt
= set_no_motion(BMI2_DISABLE
, dev
);
2313 if (rslt
== BMI2_OK
)
2315 dev
->sens_en_stat
&= ~BMI2_NO_MOT_SEL
;
2323 /* Disable step detector feature */
2324 if (sensor_sel
& BMI2_STEP_DETECT_SEL
)
2326 rslt
= set_step_detector(BMI2_DISABLE
, dev
);
2327 if (rslt
== BMI2_OK
)
2329 dev
->sens_en_stat
&= ~BMI2_STEP_DETECT_SEL
;
2337 /* Disable step counter feature */
2338 if (sensor_sel
& BMI2_STEP_COUNT_SEL
)
2340 rslt
= set_step_counter(BMI2_DISABLE
, dev
);
2341 if (rslt
== BMI2_OK
)
2343 dev
->sens_en_stat
&= ~BMI2_STEP_COUNT_SEL
;
2351 /* Disable step activity feature */
2352 if (sensor_sel
& BMI2_STEP_ACT_SEL
)
2354 rslt
= set_step_activity(BMI2_DISABLE
, dev
);
2355 if (rslt
== BMI2_OK
)
2357 dev
->sens_en_stat
&= ~BMI2_STEP_ACT_SEL
;
2365 /* Disable gyroscope user gain */
2366 if (sensor_sel
& BMI2_GYRO_GAIN_UPDATE_SEL
)
2368 rslt
= set_gyro_user_gain(BMI2_DISABLE
, dev
);
2369 if (rslt
== BMI2_OK
)
2371 dev
->sens_en_stat
&= ~BMI2_GYRO_GAIN_UPDATE_SEL
;
2379 /* Disable gyroscope self-offset correction feature */
2380 if (sensor_sel
& BMI2_GYRO_SELF_OFF_SEL
)
2382 rslt
= set_gyro_self_offset_corr(BMI2_DISABLE
, dev
);
2383 if (rslt
== BMI2_OK
)
2385 dev
->sens_en_stat
&= ~BMI2_GYRO_SELF_OFF_SEL
;
2393 /* Disable wrist gesture feature for wearable variant*/
2394 if (sensor_sel
& BMI2_WRIST_GEST_SEL
)
2396 rslt
= set_wrist_gesture(BMI2_DISABLE
, dev
);
2397 if (rslt
== BMI2_OK
)
2399 dev
->sens_en_stat
&= ~BMI2_WRIST_GEST_SEL
;
2407 /* Enable wrist wear wake-up feature */
2408 if (sensor_sel
& BMI2_WRIST_WEAR_WAKE_UP_SEL
)
2410 rslt
= set_wrist_wear_wake_up(BMI2_DISABLE
, dev
);
2411 if (rslt
== BMI2_OK
)
2413 dev
->sens_en_stat
&= ~BMI2_WRIST_WEAR_WAKE_UP_SEL
;
2421 /* Enable Advance power save if disabled while
2422 * configuring and not when already disabled
2424 if ((aps_stat
== BMI2_ENABLE
) && (rslt
== BMI2_OK
))
2426 rslt
= bmi2_set_adv_power_save(BMI2_ENABLE
, dev
);
2436 * @brief This internal API is used to enable/disable any motion feature.
2438 static int8_t set_any_motion(uint8_t enable
, struct bmi2_dev
*dev
)
2440 /* Variable to define error */
2443 /* Array to define the feature configuration */
2444 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2446 /* Variable to define the array offset */
2449 /* Variable to set flag */
2452 /* Initialize feature configuration for any-motion */
2453 struct bmi2_feature_config any_mot_config
= { 0, 0, 0 };
2455 /* Search for any-motion feature and extract its configurations details */
2456 feat_found
= bmi2_extract_input_feat_config(&any_mot_config
, BMI2_ANY_MOTION
, dev
);
2459 /* Get the configuration from the page where any-motion feature resides */
2460 rslt
= bmi2_get_feat_config(any_mot_config
.page
, feat_config
, dev
);
2461 if (rslt
== BMI2_OK
)
2463 /* Define the offset for enable/disable of any-motion axes */
2464 idx
= any_mot_config
.start_addr
+ BMI2_ANY_MOT_FEAT_EN_OFFSET
;
2466 /* Set the feature enable bit */
2467 feat_config
[idx
] = BMI2_SET_BITS(feat_config
[idx
], BMI2_ANY_NO_MOT_EN
, enable
);
2469 /* Set the configuration back to the page */
2470 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
2475 rslt
= BMI2_E_INVALID_SENSOR
;
2482 * @brief This internal API is used to enable/disable no-motion feature.
2484 static int8_t set_no_motion(uint8_t enable
, struct bmi2_dev
*dev
)
2486 /* Variable to define error */
2489 /* Array to define the feature configuration */
2490 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2492 /* Variable to define the array offset */
2495 /* Variable to set flag */
2498 /* Initialize feature configuration for no-motion */
2499 struct bmi2_feature_config no_mot_config
= { 0, 0, 0 };
2501 /* Search for no-motion feature and extract its configurations details */
2502 feat_found
= bmi2_extract_input_feat_config(&no_mot_config
, BMI2_NO_MOTION
, dev
);
2505 /* Get the configuration from the page where any/no-motion feature resides */
2506 rslt
= bmi2_get_feat_config(no_mot_config
.page
, feat_config
, dev
);
2507 if (rslt
== BMI2_OK
)
2509 /* Define the offset for enable/disable of no-motion axes */
2510 idx
= no_mot_config
.start_addr
+ BMI2_NO_MOT_FEAT_EN_OFFSET
;
2512 /* Set the feature enable bit */
2513 feat_config
[idx
] = BMI2_SET_BITS(feat_config
[idx
], BMI2_ANY_NO_MOT_EN
, enable
);
2515 /* Set the configuration back to the page */
2516 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
2521 rslt
= BMI2_E_INVALID_SENSOR
;
2528 * @brief This internal API is used to enable/disable step detector feature.
2530 static int8_t set_step_detector(uint8_t enable
, struct bmi2_dev
*dev
)
2532 /* Variable to define error */
2535 /* Array to define the feature configuration */
2536 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2538 /* Variable to define the array offset */
2541 /* Variable to set flag */
2544 /* Initialize feature configuration for step detector */
2545 struct bmi2_feature_config step_det_config
= { 0, 0, 0 };
2547 /* Search for step detector feature and extract its configuration details */
2548 feat_found
= bmi2_extract_input_feat_config(&step_det_config
, BMI2_STEP_DETECTOR
, dev
);
2551 /* Get the configuration from the page where step detector feature resides */
2552 rslt
= bmi2_get_feat_config(step_det_config
.page
, feat_config
, dev
);
2553 if (rslt
== BMI2_OK
)
2555 /* Define the offset for enable/disable of step detector */
2556 idx
= step_det_config
.start_addr
+ BMI2_STEP_COUNT_FEAT_EN_OFFSET
;
2558 /* Set the feature enable bit */
2559 feat_config
[idx
] = BMI2_SET_BITS(feat_config
[idx
], BMI2_STEP_DET_FEAT_EN
, enable
);
2561 /* Set the configuration back to the page */
2562 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
2567 rslt
= BMI2_E_INVALID_SENSOR
;
2574 * @brief This internal API is used to enable/disable step counter feature.
2576 static int8_t set_step_counter(uint8_t enable
, struct bmi2_dev
*dev
)
2578 /* Variable to define error */
2581 /* Array to define the feature configuration */
2582 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2584 /* Variable to define the array offset */
2587 /* Variable to set flag */
2590 /* Initialize feature configuration for step counter */
2591 struct bmi2_feature_config step_count_config
= { 0, 0, 0 };
2593 /* Search for step counter feature and extract its configuration details */
2594 feat_found
= bmi2_extract_input_feat_config(&step_count_config
, BMI2_STEP_COUNTER
, dev
);
2597 /* Get the configuration from the page where step-counter feature resides */
2598 rslt
= bmi2_get_feat_config(step_count_config
.page
, feat_config
, dev
);
2599 if (rslt
== BMI2_OK
)
2601 /* Define the offset for enable/disable of step counter */
2602 idx
= step_count_config
.start_addr
+ BMI2_STEP_COUNT_FEAT_EN_OFFSET
;
2604 /* Set the feature enable bit */
2605 feat_config
[idx
] = BMI2_SET_BITS(feat_config
[idx
], BMI2_STEP_COUNT_FEAT_EN
, enable
);
2607 /* Set the configuration back to the page */
2608 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
2613 rslt
= BMI2_E_INVALID_SENSOR
;
2620 * @brief This internal API is used to enable/disable sig-motion feature.
2622 static int8_t set_sig_motion(uint8_t enable
, struct bmi2_dev
*dev
)
2624 /* Variable to define error */
2627 /* Array to define the feature configuration */
2628 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2630 /* Variable to define the array offset */
2633 /* Variable to set flag */
2636 /* Initialize feature configuration for sig-motion */
2637 struct bmi2_feature_config sig_mot_config
= { 0, 0, 0 };
2639 /* Search for sig-motion feature and extract its configuration details */
2640 feat_found
= bmi2_extract_input_feat_config(&sig_mot_config
, BMI2_SIG_MOTION
, dev
);
2643 /* Get the configuration from the page where sig-motion feature resides */
2644 rslt
= bmi2_get_feat_config(sig_mot_config
.page
, feat_config
, dev
);
2645 if (rslt
== BMI2_OK
)
2647 /* Define the offset for enable/disable of sig-motion */
2648 idx
= sig_mot_config
.start_addr
+ BMI2_SIG_MOT_FEAT_EN_OFFSET
;
2650 /* Set the feature enable bit */
2651 feat_config
[idx
] = BMI2_SET_BIT_POS0(feat_config
[idx
], BMI2_SIG_MOT_FEAT_EN
, enable
);
2653 /* Set the configuration back to the page */
2654 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
2659 rslt
= BMI2_E_INVALID_SENSOR
;
2666 * @brief This internal API is used to enable/disable step activity detection.
2668 static int8_t set_step_activity(uint8_t enable
, struct bmi2_dev
*dev
)
2670 /* Variable to define error */
2673 /* Array to define the feature configuration */
2674 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2676 /* Variable to define the array offset */
2679 /* Variable to set flag */
2682 /* Initialize feature configuration for step activity */
2683 struct bmi2_feature_config step_act_config
= { 0, 0, 0 };
2685 /* Search for step activity feature and extract its configuration details */
2686 feat_found
= bmi2_extract_input_feat_config(&step_act_config
, BMI2_STEP_ACTIVITY
, dev
);
2689 /* Get the configuration from the page where step-activity
2692 rslt
= bmi2_get_feat_config(step_act_config
.page
, feat_config
, dev
);
2693 if (rslt
== BMI2_OK
)
2695 /* Define the offset for enable/disable of step activity */
2696 idx
= step_act_config
.start_addr
+ BMI2_STEP_COUNT_FEAT_EN_OFFSET
;
2698 /* Set the feature enable bit */
2699 feat_config
[idx
] = BMI2_SET_BITS(feat_config
[idx
], BMI2_STEP_ACT_FEAT_EN
, enable
);
2701 /* Set the configuration back to the page */
2702 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
2707 rslt
= BMI2_E_INVALID_SENSOR
;
2714 * @brief This internal API gives an option to enable self-offset correction
2715 * feature of gyroscope, either internally or by the host.
2717 static int8_t set_gyro_self_offset_corr(uint8_t enable
, struct bmi2_dev
*dev
)
2719 /* Variable to define error */
2722 /* Array to define the feature configuration */
2723 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2725 /* Variable to define the array offset */
2728 /* Variable to set flag */
2731 /* Initialize feature configuration for self-offset correction */
2732 struct bmi2_feature_config self_off_corr_cfg
= { 0, 0, 0 };
2734 /* Search for self-offset correction and extract its configuration details */
2735 feat_found
= bmi2_extract_input_feat_config(&self_off_corr_cfg
, BMI2_GYRO_SELF_OFF
, dev
);
2738 /* Get the configuration from the page where self-offset
2739 * correction feature resides
2741 rslt
= bmi2_get_feat_config(self_off_corr_cfg
.page
, feat_config
, dev
);
2742 if (rslt
== BMI2_OK
)
2744 /* Define the offset for enable/disable of self-offset correction */
2745 idx
= self_off_corr_cfg
.start_addr
;
2747 /* Set the feature enable bit */
2748 feat_config
[idx
] = BMI2_SET_BITS(feat_config
[idx
], BMI2_GYR_SELF_OFF_CORR_FEAT_EN
, enable
);
2750 /* Set the configuration back to the page */
2751 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
2756 rslt
= BMI2_E_INVALID_SENSOR
;
2763 * @brief This internal API enables the wrist gesture feature.
2765 static int8_t set_wrist_gesture(uint8_t enable
, struct bmi2_dev
*dev
)
2767 /* Variable to define error */
2770 /* Array to define the feature configuration */
2771 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2773 /* Variable to define the array offset */
2776 /* Variable to set flag */
2779 /* Initialize feature configuration for wrist gesture */
2780 struct bmi2_feature_config wrist_gest_cfg
= { 0, 0, 0 };
2782 /* Search for wrist gesture and extract its configuration details */
2783 feat_found
= bmi2_extract_input_feat_config(&wrist_gest_cfg
, BMI2_WRIST_GESTURE
, dev
);
2786 /* Get the configuration from the page where wrist gesture feature resides */
2787 rslt
= bmi2_get_feat_config(wrist_gest_cfg
.page
, feat_config
, dev
);
2788 if (rslt
== BMI2_OK
)
2790 /* Define the offset for enable/disable of wrist gesture */
2791 idx
= wrist_gest_cfg
.start_addr
;
2793 /* Set the feature enable bit */
2794 feat_config
[idx
] = BMI2_SET_BITS(feat_config
[idx
], BMI2_WRIST_GEST_FEAT_EN
, enable
);
2796 /* Set the configuration back to the page */
2797 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
2802 rslt
= BMI2_E_INVALID_SENSOR
;
2809 * @brief This internal API enables the wrist wear wake up feature.
2811 static int8_t set_wrist_wear_wake_up(uint8_t enable
, struct bmi2_dev
*dev
)
2813 /* Variable to define error */
2816 /* Array to define the feature configuration */
2817 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2819 /* Variable to define the array offset */
2822 /* Variable to set flag */
2825 /* Initialize feature configuration for wrist wear wake up */
2826 struct bmi2_feature_config wrist_wake_up_cfg
= { 0, 0, 0 };
2828 /* Search for wrist wear wake up and extract its configuration details */
2829 feat_found
= bmi2_extract_input_feat_config(&wrist_wake_up_cfg
, BMI2_WRIST_WEAR_WAKE_UP
, dev
);
2832 /* Get the configuration from the page where wrist wear wake up
2835 rslt
= bmi2_get_feat_config(wrist_wake_up_cfg
.page
, feat_config
, dev
);
2836 if (rslt
== BMI2_OK
)
2838 /* Define the offset for enable/disable of wrist wear wake up */
2839 idx
= wrist_wake_up_cfg
.start_addr
;
2841 /* Set the feature enable bit */
2842 feat_config
[idx
] = BMI2_SET_BITS(feat_config
[idx
], BMI2_WRIST_WEAR_WAKE_UP_FEAT_EN
, enable
);
2844 /* Set the configuration back to the page */
2845 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
2850 rslt
= BMI2_E_INVALID_SENSOR
;
2857 * @brief This internal API is used to enable/disable gyroscope user gain
2860 static int8_t set_gyro_user_gain(uint8_t enable
, struct bmi2_dev
*dev
)
2862 /* Variable to define error */
2865 /* Array to define the feature configuration */
2866 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2868 /* Variable to define the array offset */
2871 /* Variable to set flag */
2874 /* Initialize feature configuration for gyroscope user gain */
2875 struct bmi2_feature_config gyr_user_gain_cfg
= { 0, 0, 0 };
2877 /* Search for user gain feature and extract its configuration details */
2878 feat_found
= bmi2_extract_input_feat_config(&gyr_user_gain_cfg
, BMI2_GYRO_GAIN_UPDATE
, dev
);
2881 /* Get the configuration from the page where user gain feature resides */
2882 rslt
= bmi2_get_feat_config(gyr_user_gain_cfg
.page
, feat_config
, dev
);
2883 if (rslt
== BMI2_OK
)
2885 /* Define the offset for enable/disable of user gain */
2886 idx
= gyr_user_gain_cfg
.start_addr
+ BMI2_GYR_USER_GAIN_FEAT_EN_OFFSET
;
2888 /* Set the feature enable bit */
2889 feat_config
[idx
] = BMI2_SET_BITS(feat_config
[idx
], BMI2_GYR_USER_GAIN_FEAT_EN
, enable
);
2891 /* Set the configuration back to the page */
2892 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
2897 rslt
= BMI2_E_INVALID_SENSOR
;
2904 * @brief This internal API sets any-motion configurations like axes select,
2905 * duration, threshold and output-configuration.
2907 static int8_t set_any_motion_config(const struct bmi2_any_motion_config
*config
, struct bmi2_dev
*dev
)
2909 /* Variable to define error */
2912 /* Array to define the feature configuration */
2913 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2915 /* Variable to define the array offset */
2918 /* Variable to define count */
2921 /* Variable to set flag */
2924 /* Initialize feature configuration for any motion */
2925 struct bmi2_feature_config any_mot_config
= { 0, 0, 0 };
2927 /* Copy the feature configuration address to a local pointer */
2928 uint16_t *data_p
= (uint16_t *) (void *)feat_config
;
2930 /* Search for any-motion feature and extract its configuration details */
2931 feat_found
= bmi2_extract_input_feat_config(&any_mot_config
, BMI2_ANY_MOTION
, dev
);
2934 /* Get the configuration from the page where any-motion feature resides */
2935 rslt
= bmi2_get_feat_config(any_mot_config
.page
, feat_config
, dev
);
2936 if (rslt
== BMI2_OK
)
2938 /* Define the offset in bytes for any-motion select */
2939 idx
= any_mot_config
.start_addr
;
2941 /* Get offset in words since all the features are set in words length */
2945 *(data_p
+ idx
) = BMI2_SET_BIT_POS0(*(data_p
+ idx
), BMI2_ANY_NO_MOT_DUR
, config
->duration
);
2948 *(data_p
+ idx
) = BMI2_SET_BITS(*(data_p
+ idx
), BMI2_ANY_NO_MOT_X_SEL
, config
->select_x
);
2951 *(data_p
+ idx
) = BMI2_SET_BITS(*(data_p
+ idx
), BMI2_ANY_NO_MOT_Y_SEL
, config
->select_y
);
2954 *(data_p
+ idx
) = BMI2_SET_BITS(*(data_p
+ idx
), BMI2_ANY_NO_MOT_Z_SEL
, config
->select_z
);
2956 /* Increment offset by 1 word to set threshold and output configuration */
2960 *(data_p
+ idx
) = BMI2_SET_BIT_POS0(*(data_p
+ idx
), BMI2_ANY_NO_MOT_THRES
, config
->threshold
);
2962 /* Increment offset by 1 more word to get the total length in words */
2965 /* Get total length in bytes to copy from local pointer to the array */
2966 idx
= (uint8_t)(idx
* 2) - any_mot_config
.start_addr
;
2968 /* Copy the bytes to be set back to the array */
2969 for (index
= 0; index
< idx
; index
++)
2971 feat_config
[any_mot_config
.start_addr
+
2972 index
] = *((uint8_t *) data_p
+ any_mot_config
.start_addr
+ index
);
2975 /* Set the configuration back to the page */
2976 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
2981 rslt
= BMI2_E_INVALID_SENSOR
;
2988 * @brief This internal API sets no-motion configurations like axes select,
2989 * duration, threshold and output-configuration.
2991 static int8_t set_no_motion_config(const struct bmi2_no_motion_config
*config
, struct bmi2_dev
*dev
)
2993 /* Variable to define error */
2996 /* Array to define the feature configuration */
2997 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
2999 /* Variable to define the array offset */
3002 /* Variable to define count */
3005 /* Variable to set flag */
3008 /* Initialize feature configuration for no-motion */
3009 struct bmi2_feature_config no_mot_config
= { 0, 0, 0 };
3011 /* Copy the feature configuration address to a local pointer */
3012 uint16_t *data_p
= (uint16_t *) (void *)feat_config
;
3014 /* Search for no-motion feature and extract its configuration details */
3015 feat_found
= bmi2_extract_input_feat_config(&no_mot_config
, BMI2_NO_MOTION
, dev
);
3018 /* Get the configuration from the page where no-motion feature resides */
3019 rslt
= bmi2_get_feat_config(no_mot_config
.page
, feat_config
, dev
);
3020 if (rslt
== BMI2_OK
)
3022 /* Define the offset in bytes for no-motion select */
3023 idx
= no_mot_config
.start_addr
;
3025 /* Get offset in words since all the features are set in words length */
3029 *(data_p
+ idx
) = BMI2_SET_BIT_POS0(*(data_p
+ idx
), BMI2_ANY_NO_MOT_DUR
, config
->duration
);
3032 *(data_p
+ idx
) = BMI2_SET_BITS(*(data_p
+ idx
), BMI2_ANY_NO_MOT_X_SEL
, config
->select_x
);
3035 *(data_p
+ idx
) = BMI2_SET_BITS(*(data_p
+ idx
), BMI2_ANY_NO_MOT_Y_SEL
, config
->select_y
);
3038 *(data_p
+ idx
) = BMI2_SET_BITS(*(data_p
+ idx
), BMI2_ANY_NO_MOT_Z_SEL
, config
->select_z
);
3040 /* Increment offset by 1 word to set threshold and output configuration */
3044 *(data_p
+ idx
) = BMI2_SET_BIT_POS0(*(data_p
+ idx
), BMI2_ANY_NO_MOT_THRES
, config
->threshold
);
3046 /* Increment offset by 1 more word to get the total length in words */
3049 /* Get total length in bytes to copy from local pointer to the array */
3050 idx
= (uint8_t)(idx
* 2) - no_mot_config
.start_addr
;
3052 /* Copy the bytes to be set back to the array */
3053 for (index
= 0; index
< idx
; index
++)
3055 feat_config
[no_mot_config
.start_addr
+
3056 index
] = *((uint8_t *) data_p
+ no_mot_config
.start_addr
+ index
);
3059 /* Set the configuration back to the page */
3060 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
3065 rslt
= BMI2_E_INVALID_SENSOR
;
3072 * @brief This internal API sets sig-motion configurations like block-size,
3073 * output-configuration and other parameters.
3075 static int8_t set_sig_motion_config(const struct bmi2_sig_motion_config
*config
, struct bmi2_dev
*dev
)
3077 /* Variable to define error */
3080 /* Array to define the feature configuration */
3081 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
3083 /* Variable to define the array offset */
3086 /* Variable to define index */
3089 /* Variable to set flag */
3092 /* Initialize feature configuration for sig-motion */
3093 struct bmi2_feature_config sig_mot_config
= { 0, 0, 0 };
3095 /* Copy the feature configuration address to a local pointer */
3096 uint16_t *data_p
= (uint16_t *) (void *)feat_config
;
3098 /* Search for sig-motion feature and extract its configuration details */
3099 feat_found
= bmi2_extract_input_feat_config(&sig_mot_config
, BMI2_SIG_MOTION
, dev
);
3102 /* Get the configuration from the page where sig-motion feature resides */
3103 rslt
= bmi2_get_feat_config(sig_mot_config
.page
, feat_config
, dev
);
3104 if (rslt
== BMI2_OK
)
3106 /* Define the offset in bytes for sig-motion select */
3107 idx
= sig_mot_config
.start_addr
;
3109 /* Get offset in words since all the features are set in words length */
3112 /* Set parameter 1 */
3113 *(data_p
+ idx
) = BMI2_SET_BIT_POS0(*(data_p
+ idx
), BMI2_SIG_MOT_PARAM_1
, config
->block_size
);
3115 /* Increment offset by 1 word to set parameter 2 */
3118 /* Set parameter 2 */
3119 *(data_p
+ idx
) = BMI2_SET_BIT_POS0(*(data_p
+ idx
), BMI2_SIG_MOT_PARAM_2
, config
->param_2
);
3121 /* Increment offset by 1 word to set parameter 3 */
3124 /* Set parameter 3 */
3125 *(data_p
+ idx
) = BMI2_SET_BIT_POS0(*(data_p
+ idx
), BMI2_SIG_MOT_PARAM_3
, config
->param_3
);
3127 /* Increment offset by 1 word to set parameter 4 */
3130 /* Set parameter 4 */
3131 *(data_p
+ idx
) = BMI2_SET_BIT_POS0(*(data_p
+ idx
), BMI2_SIG_MOT_PARAM_4
, config
->param_4
);
3133 /* Increment offset by 1 word to set parameter 5 */
3136 /* Set parameter 5 */
3137 *(data_p
+ idx
) = BMI2_SET_BIT_POS0(*(data_p
+ idx
), BMI2_SIG_MOT_PARAM_5
, config
->param_5
);
3139 /* Increment offset by 1 word to set output- configuration */
3142 /* Get total length in bytes to copy from local pointer to the array */
3143 idx
= (uint8_t)(idx
* 2) - sig_mot_config
.start_addr
;
3145 /* Copy the bytes to be set back to the array */
3146 for (index
= 0; index
< idx
; index
++)
3148 feat_config
[sig_mot_config
.start_addr
+
3149 index
] = *((uint8_t *) data_p
+ sig_mot_config
.start_addr
+ index
);
3152 /* Set the configuration back to the page */
3153 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
3158 rslt
= BMI2_E_INVALID_SENSOR
;
3165 * @brief This internal API sets step counter parameter configurations.
3167 static int8_t set_step_count_params_config(const uint16_t *step_count_params
, struct bmi2_dev
*dev
)
3169 /* Variable to define error */
3170 int8_t rslt
= BMI2_OK
;
3172 /* Array to define the feature configuration */
3173 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
3175 /* Variable to define index */
3178 /* Variable to set flag */
3181 /* Initialize feature configuration for step counter parameters */
3182 struct bmi2_feature_config step_params_config
= { 0, 0, 0 };
3184 /* Variable to index the page number */
3187 /* Variable to define the start page */
3190 /* Variable to define start address of the parameters */
3193 /* Variable to define number of bytes */
3194 uint8_t n_bytes
= (BMI2_STEP_CNT_N_PARAMS
* 2);
3196 /* Variable to store number of pages */
3197 uint8_t n_pages
= (n_bytes
/ 16);
3199 /* Variable to define the end page */
3202 /* Variable to define the remaining bytes to be read */
3205 /* Variable to define the maximum words(16 bytes or 8 words) to be read in a page */
3206 uint8_t max_len
= 8;
3208 /* Variable index bytes in a page */
3209 uint8_t page_byte_idx
;
3211 /* Variable to index the parameters */
3212 uint8_t param_idx
= 0;
3214 /* Copy the feature configuration address to a local pointer */
3215 uint16_t *data_p
= (uint16_t *) (void *)feat_config
;
3217 /* Search for step counter parameter feature and extract its configuration details */
3218 feat_found
= bmi2_extract_input_feat_config(&step_params_config
, BMI2_STEP_COUNTER_PARAMS
, dev
);
3221 /* Get the start page for the step counter parameters */
3222 start_page
= step_params_config
.page
;
3224 /* Get the end page for the step counter parameters */
3225 end_page
= start_page
+ n_pages
;
3227 /* Get the start address for the step counter parameters */
3228 start_addr
= step_params_config
.start_addr
;
3230 /* Get the remaining length of bytes to be read */
3231 remain_len
= (uint8_t)((n_bytes
- (n_pages
* 16)) + start_addr
);
3232 for (page_idx
= start_page
; page_idx
<= end_page
; page_idx
++)
3234 /* Get the configuration from the respective page */
3235 rslt
= bmi2_get_feat_config(page_idx
, feat_config
, dev
);
3236 if (rslt
== BMI2_OK
)
3238 /* Start from address 0x00 when switched to next page */
3239 if (page_idx
> start_page
)
3244 /* Remaining number of words to be read in the page */
3245 if (page_idx
== end_page
)
3247 max_len
= (remain_len
/ 2);
3250 /* Get offset in words since all the features are set in words length */
3251 page_byte_idx
= start_addr
/ 2;
3252 for (; page_byte_idx
< max_len
;)
3254 /* Set parameters 1 to 25 */
3255 *(data_p
+ page_byte_idx
) = BMI2_SET_BIT_POS0(*(data_p
+ page_byte_idx
),
3256 BMI2_STEP_COUNT_PARAMS
,
3257 step_count_params
[param_idx
]);
3259 /* Increment offset by 1 word to set to the next parameter */
3262 /* Increment to next parameter */
3266 /* Get total length in bytes to copy from local pointer to the array */
3267 page_byte_idx
= (uint8_t)(page_byte_idx
* 2) - step_params_config
.start_addr
;
3269 /* Copy the bytes to be set back to the array */
3270 for (index
= 0; index
< page_byte_idx
; index
++)
3272 feat_config
[step_params_config
.start_addr
+
3273 index
] = *((uint8_t *) data_p
+ step_params_config
.start_addr
+ index
);
3276 /* Set the configuration back to the page */
3277 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
3283 rslt
= BMI2_E_INVALID_SENSOR
;
3289 /* @brief This internal API sets step counter configurations like water-mark
3290 * level, reset-counter and output-configuration step detector and activity.
3292 static int8_t set_step_config(const struct bmi2_step_config
*config
, struct bmi2_dev
*dev
)
3294 /* Variable to define error */
3297 /* Array to define the feature configuration */
3298 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
3300 /* Variable to define the array offset */
3303 /* Variable to define index */
3306 /* Variable to set flag */
3309 /* Initialize feature configuration for step counter 4 */
3310 struct bmi2_feature_config step_count_config
= { 0, 0, 0 };
3312 /* Copy the feature configuration address to a local pointer */
3313 uint16_t *data_p
= (uint16_t *) (void *)feat_config
;
3315 /* Search for step counter feature and extract its configuration details */
3316 feat_found
= bmi2_extract_input_feat_config(&step_count_config
, BMI2_STEP_COUNTER
, dev
);
3319 /* Get the configuration from the page where step counter resides */
3320 rslt
= bmi2_get_feat_config(step_count_config
.page
, feat_config
, dev
);
3321 if (rslt
== BMI2_OK
)
3323 /* Define the offset in bytes */
3324 idx
= step_count_config
.start_addr
;
3326 /* Get offset in words since all the features are set in words length */
3329 /* Set water-mark level */
3330 *(data_p
+ idx
) = BMI2_SET_BIT_POS0(*(data_p
+ idx
), BMI2_STEP_COUNT_WM_LEVEL
, config
->watermark_level
);
3332 /* Set reset-counter */
3333 *(data_p
+ idx
) = BMI2_SET_BITS(*(data_p
+ idx
), BMI2_STEP_COUNT_RST_CNT
, config
->reset_counter
);
3335 /* Increment offset by 1 word to set output
3336 * configuration of step detector and step activity
3340 /* Set step buffer size */
3341 *(data_p
+ idx
) = BMI2_SET_BITS(*(data_p
+ idx
), BMI2_STEP_BUFFER_SIZE
, config
->step_buffer_size
);
3343 /* Increment offset by 1 more word to get the total length in words */
3346 /* Get total length in bytes to copy from local pointer to the array */
3347 idx
= (uint8_t)(idx
* 2) - step_count_config
.start_addr
;
3349 /* Copy the bytes to be set back to the array */
3350 for (index
= 0; index
< idx
; index
++)
3352 feat_config
[step_count_config
.start_addr
+
3353 index
] = *((uint8_t *) data_p
+ step_count_config
.start_addr
+ index
);
3356 /* Set the configuration back to the page */
3357 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
3362 rslt
= BMI2_E_INVALID_SENSOR
;
3369 * @brief This internal API sets wrist gesture configurations like wearable-arm,
3370 * and output-configuration.
3372 static int8_t set_wrist_gest_config(const struct bmi2_wrist_gest_config
*config
, struct bmi2_dev
*dev
)
3374 /* Variable to define error */
3377 /* Array to define the feature configuration */
3378 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
3380 /* Variable to define the array offset */
3383 /* Variable to define index */
3386 /* Variable to set flag */
3389 /* Initialize feature configuration for wrist gesture */
3390 struct bmi2_feature_config wrist_gest_config
= { 0, 0, 0 };
3392 /* Copy the feature configuration address to a local pointer */
3393 uint16_t *data_p
= (uint16_t *) (void *)feat_config
;
3395 /* Search for wrist gesture feature and extract its configuration details */
3396 feat_found
= bmi2_extract_input_feat_config(&wrist_gest_config
, BMI2_WRIST_GESTURE
, dev
);
3399 /* Get the configuration from the page where wrist gesture feature resides */
3400 rslt
= bmi2_get_feat_config(wrist_gest_config
.page
, feat_config
, dev
);
3401 if (rslt
== BMI2_OK
)
3403 /* Define the offset in bytes for gesture select */
3404 idx
= wrist_gest_config
.start_addr
;
3406 /* Get offset in words since all the features are set in words length */
3409 /* Set wearable arm */
3410 *(data_p
+ idx
) = BMI2_SET_BITS(*(data_p
+ idx
), BMI2_WRIST_GEST_WEAR_ARM
, config
->wearable_arm
);
3412 /* Increment offset by 1 more word to set minimum tilt angle (min_flick_peak) */
3414 *(data_p
+ idx
) = config
->min_flick_peak
;
3416 /* Increment offset by 1 more word to set min_flick_samples */
3418 *(data_p
+ idx
) = config
->min_flick_samples
;
3420 /* Increment offset by 1 more word to set max time within gesture moment has to be completed */
3422 *(data_p
+ idx
) = config
->max_duration
;
3424 /* Increment offset by 1 more word to get the total length in words */
3427 /* Get total length in bytes to copy from local pointer to the array */
3428 idx
= (uint8_t)(idx
* 2) - wrist_gest_config
.start_addr
;
3430 /* Copy the bytes to be set back to the array */
3431 for (index
= 0; index
< idx
; index
++)
3433 feat_config
[wrist_gest_config
.start_addr
+
3434 index
] = *((uint8_t *) data_p
+ wrist_gest_config
.start_addr
+ index
);
3437 /* Set the configuration back to the page */
3438 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
3443 rslt
= BMI2_E_INVALID_SENSOR
;
3450 * @brief This internal API sets wrist wear wake-up configurations like
3451 * output-configuration.
3453 static int8_t set_wrist_wear_wake_up_config(const struct bmi2_wrist_wear_wake_up_config
*config
, struct bmi2_dev
*dev
)
3455 /* Variable to define error */
3458 /* Array to define the feature configuration */
3459 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
3461 /* Variable to define the array offset */
3464 /* Variable to define index */
3467 /* Variable to set flag */
3470 /* Initialize feature configuration for wrist wear wake-up */
3471 struct bmi2_feature_config wrist_wake_up_config
= { 0, 0, 0 };
3473 /* Copy the feature configuration address to a local pointer */
3474 uint16_t *data_p
= (uint16_t *) (void *)feat_config
;
3476 /* Search for wrist wear wake-up feature and extract its configuration details */
3477 feat_found
= bmi2_extract_input_feat_config(&wrist_wake_up_config
, BMI2_WRIST_WEAR_WAKE_UP
, dev
);
3480 /* Get the configuration from the page where wrist wear wake-up feature resides */
3481 rslt
= bmi2_get_feat_config(wrist_wake_up_config
.page
, feat_config
, dev
);
3482 if (rslt
== BMI2_OK
)
3484 /* Define the offset in bytes for wrist wear wake-up select */
3485 idx
= wrist_wake_up_config
.start_addr
;
3487 /* Get offset in words since all the features are set in words length */
3490 *(data_p
+ idx
) = config
->min_angle_focus
;
3492 /* Increment offset by 1 more word to set min_angle_nonfocus */
3494 *(data_p
+ idx
) = config
->min_angle_nonfocus
;
3496 /* Increment offset by 1 more word to set max_tilt_lr */
3498 *(data_p
+ idx
) = config
->max_tilt_lr
;
3500 /* Increment offset by 1 more word to set max_tilt_ll */
3502 *(data_p
+ idx
) = config
->max_tilt_ll
;
3504 /* Increment offset by 1 more word to set max_tilt_pd */
3506 *(data_p
+ idx
) = config
->max_tilt_pd
;
3508 /* Increment offset by 1 more word to set max_tilt_pu */
3510 *(data_p
+ idx
) = config
->max_tilt_pu
;
3512 /* Increment offset by 1 more word to get the total length in words */
3515 /* Get total length in bytes to copy from local pointer to the array */
3516 idx
= (uint8_t)(idx
* 2) - wrist_wake_up_config
.start_addr
;
3518 /* Copy the bytes to be set back to the array */
3519 for (index
= 0; index
< idx
; index
++)
3521 feat_config
[wrist_wake_up_config
.start_addr
+
3522 index
] = *((uint8_t *) data_p
+ wrist_wake_up_config
.start_addr
+ index
);
3525 /* Set the configuration back to the page */
3526 rslt
= bmi2_set_regs(BMI2_FEATURES_REG_ADDR
, feat_config
, BMI2_FEAT_SIZE_IN_BYTES
, dev
);
3531 rslt
= BMI2_E_INVALID_SENSOR
;
3538 * @brief This internal API gets any-motion configurations like axes select,
3539 * duration, threshold and output-configuration.
3541 static int8_t get_any_motion_config(struct bmi2_any_motion_config
*config
, struct bmi2_dev
*dev
)
3543 /* Variable to define error */
3546 /* Array to define the feature configuration */
3547 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
3549 /* Variable to define the array offset */
3552 /* Variable to define LSB */
3555 /* Variable to define MSB */
3558 /* Variable to define a word */
3561 /* Variable to set flag */
3564 /* Initialize feature configuration for any-motion */
3565 struct bmi2_feature_config any_mot_config
= { 0, 0, 0 };
3567 /* Search for any-motion feature and extract its configuration details */
3568 feat_found
= bmi2_extract_input_feat_config(&any_mot_config
, BMI2_ANY_MOTION
, dev
);
3571 /* Get the configuration from the page where any-motion feature resides */
3572 rslt
= bmi2_get_feat_config(any_mot_config
.page
, feat_config
, dev
);
3573 if (rslt
== BMI2_OK
)
3575 /* Define the offset for feature enable for any-motion */
3576 idx
= any_mot_config
.start_addr
;
3578 /* Get word to calculate duration, x, y and z select */
3579 lsb
= (uint16_t) feat_config
[idx
++];
3580 msb
= ((uint16_t) feat_config
[idx
++] << 8);
3581 lsb_msb
= lsb
| msb
;
3584 config
->duration
= lsb_msb
& BMI2_ANY_NO_MOT_DUR_MASK
;
3587 config
->select_x
= (lsb_msb
& BMI2_ANY_NO_MOT_X_SEL_MASK
) >> BMI2_ANY_NO_MOT_X_SEL_POS
;
3590 config
->select_y
= (lsb_msb
& BMI2_ANY_NO_MOT_Y_SEL_MASK
) >> BMI2_ANY_NO_MOT_Y_SEL_POS
;
3593 config
->select_z
= (lsb_msb
& BMI2_ANY_NO_MOT_Z_SEL_MASK
) >> BMI2_ANY_NO_MOT_Z_SEL_POS
;
3595 /* Get word to calculate threshold, output configuration from the same word */
3596 lsb
= (uint16_t) feat_config
[idx
++];
3597 msb
= ((uint16_t) feat_config
[idx
++] << 8);
3598 lsb_msb
= lsb
| msb
;
3601 config
->threshold
= lsb_msb
& BMI2_ANY_NO_MOT_THRES_MASK
;
3606 rslt
= BMI2_E_INVALID_SENSOR
;
3613 * @brief This internal API gets no-motion configurations like axes select,
3614 * duration, threshold and output-configuration.
3616 static int8_t get_no_motion_config(struct bmi2_no_motion_config
*config
, struct bmi2_dev
*dev
)
3618 /* Variable to define error */
3621 /* Array to define the feature configuration */
3622 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
3624 /* Variable to define the array offset */
3627 /* Variable to define LSB */
3630 /* Variable to define MSB */
3633 /* Variable to define a word */
3634 uint16_t lsb_msb
= 0;
3636 /* Variable to set flag */
3639 /* Initialize feature configuration for no-motion */
3640 struct bmi2_feature_config no_mot_config
= { 0, 0, 0 };
3642 /* Search for no-motion feature and extract its configuration details */
3643 feat_found
= bmi2_extract_input_feat_config(&no_mot_config
, BMI2_NO_MOTION
, dev
);
3646 /* Get the configuration from the page where no-motion feature resides */
3647 rslt
= bmi2_get_feat_config(no_mot_config
.page
, feat_config
, dev
);
3648 if (rslt
== BMI2_OK
)
3650 /* Define the offset for feature enable for no-motion */
3651 idx
= no_mot_config
.start_addr
;
3653 /* Get word to calculate duration, x, y and z select */
3654 lsb
= (uint16_t) feat_config
[idx
++];
3655 msb
= ((uint16_t) feat_config
[idx
++] << 8);
3656 lsb_msb
= lsb
| msb
;
3659 config
->duration
= lsb_msb
& BMI2_ANY_NO_MOT_DUR_MASK
;
3662 config
->select_x
= (lsb_msb
& BMI2_ANY_NO_MOT_X_SEL_MASK
) >> BMI2_ANY_NO_MOT_X_SEL_POS
;
3665 config
->select_y
= (lsb_msb
& BMI2_ANY_NO_MOT_Y_SEL_MASK
) >> BMI2_ANY_NO_MOT_Y_SEL_POS
;
3668 config
->select_z
= (lsb_msb
& BMI2_ANY_NO_MOT_Z_SEL_MASK
) >> BMI2_ANY_NO_MOT_Z_SEL_POS
;
3670 /* Get word to calculate threshold, output configuration from the same word */
3671 lsb
= (uint16_t) feat_config
[idx
++];
3672 msb
= ((uint16_t) feat_config
[idx
++] << 8);
3673 lsb_msb
= lsb
| msb
;
3676 config
->threshold
= lsb_msb
& BMI2_ANY_NO_MOT_THRES_MASK
;
3681 rslt
= BMI2_E_INVALID_SENSOR
;
3688 * @brief This internal API gets sig-motion configurations like block-size,
3689 * output-configuration and other parameters.
3691 static int8_t get_sig_motion_config(struct bmi2_sig_motion_config
*config
, struct bmi2_dev
*dev
)
3693 /* Variable to define error */
3696 /* Array to define the feature configuration */
3697 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
3699 /* Variable to define the array offset */
3702 /* Variable to define LSB */
3705 /* Variable to define MSB */
3708 /* Variable to define a word */
3709 uint16_t lsb_msb
= 0;
3711 /* Variable to set flag */
3714 /* Initialize feature configuration sig-motion */
3715 struct bmi2_feature_config sig_mot_config
= { 0, 0, 0 };
3717 /* Search for sig-motion feature and extract its configuration details */
3718 feat_found
= bmi2_extract_input_feat_config(&sig_mot_config
, BMI2_SIG_MOTION
, dev
);
3721 /* Get the configuration from the page where sig-motion feature resides */
3722 rslt
= bmi2_get_feat_config(sig_mot_config
.page
, feat_config
, dev
);
3723 if (rslt
== BMI2_OK
)
3725 /* Define the offset for feature enable for sig-motion */
3726 idx
= sig_mot_config
.start_addr
;
3728 /* Get word to calculate parameter 1 */
3729 lsb
= (uint16_t) feat_config
[idx
++];
3730 msb
= ((uint16_t) feat_config
[idx
++] << 8);
3731 lsb_msb
= lsb
| msb
;
3733 /* Get parameter 1 */
3734 config
->block_size
= lsb_msb
& BMI2_SIG_MOT_PARAM_1_MASK
;
3736 /* Get word to calculate parameter 2 */
3737 lsb
= (uint16_t) feat_config
[idx
++];
3738 msb
= ((uint16_t) feat_config
[idx
++] << 8);
3739 lsb_msb
= lsb
| msb
;
3741 /* Get parameter 2 */
3742 config
->param_2
= lsb_msb
& BMI2_SIG_MOT_PARAM_2_MASK
;
3744 /* Get word to calculate parameter 3 */
3745 lsb
= (uint16_t) feat_config
[idx
++];
3746 msb
= ((uint16_t) feat_config
[idx
++] << 8);
3747 lsb_msb
= lsb
| msb
;
3749 /* Get parameter 3 */
3750 config
->param_3
= lsb_msb
& BMI2_SIG_MOT_PARAM_3_MASK
;
3752 /* Get word to calculate parameter 4 */
3753 lsb
= (uint16_t) feat_config
[idx
++];
3754 msb
= ((uint16_t) feat_config
[idx
++] << 8);
3755 lsb_msb
= lsb
| msb
;
3757 /* Get parameter 4 */
3758 config
->param_4
= lsb_msb
& BMI2_SIG_MOT_PARAM_4_MASK
;
3760 /* Get word to calculate parameter 5 */
3761 lsb
= (uint16_t) feat_config
[idx
++];
3762 msb
= ((uint16_t) feat_config
[idx
++] << 8);
3763 lsb_msb
= lsb
| msb
;
3765 /* Get parameter 5 */
3766 config
->param_5
= lsb_msb
& BMI2_SIG_MOT_PARAM_5_MASK
;
3771 rslt
= BMI2_E_INVALID_SENSOR
;
3778 * @brief This internal API gets step counter parameter configurations.
3780 static int8_t get_step_count_params_config(uint16_t *step_count_params
, struct bmi2_dev
*dev
)
3782 /* Variable to define error */
3783 int8_t rslt
= BMI2_OK
;
3785 /* Array to define the feature configuration */
3786 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
3788 /* Variable to set flag */
3791 /* Variable to define LSB */
3794 /* Variable to define MSB */
3797 /* Variable to define a word */
3798 uint16_t lsb_msb
= 0;
3800 /* Initialize feature configuration for step counter 1 */
3801 struct bmi2_feature_config step_params_config
= { 0, 0, 0 };
3803 /* Variable to index the page number */
3806 /* Variable to define the start page */
3809 /* Variable to define start address of the parameters */
3812 /* Variable to define number of bytes */
3813 uint8_t n_bytes
= (BMI2_STEP_CNT_N_PARAMS
* 2);
3815 /* Variable to store number of pages */
3816 uint8_t n_pages
= (n_bytes
/ 16);
3818 /* Variable to define the end page */
3821 /* Variable to define the remaining bytes to be read */
3824 /* Variable to define the maximum words to be read in a page */
3825 uint8_t max_len
= BMI2_FEAT_SIZE_IN_BYTES
;
3827 /* Variable index bytes in a page */
3828 uint8_t page_byte_idx
;
3830 /* Variable to index the parameters */
3831 uint8_t param_idx
= 0;
3833 /* Search for step counter parameter feature and extract its configuration details */
3834 feat_found
= bmi2_extract_input_feat_config(&step_params_config
, BMI2_STEP_COUNTER_PARAMS
, dev
);
3837 /* Get the start page for the step counter parameters */
3838 start_page
= step_params_config
.page
;
3840 /* Get the end page for the step counter parameters */
3841 end_page
= start_page
+ n_pages
;
3843 /* Get the start address for the step counter parameters */
3844 start_addr
= step_params_config
.start_addr
;
3846 /* Get the remaining length of bytes to be read */
3847 remain_len
= (uint8_t)((n_bytes
- (n_pages
* 16)) + start_addr
);
3848 for (page_idx
= start_page
; page_idx
<= end_page
; page_idx
++)
3850 /* Get the configuration from the respective page */
3851 rslt
= bmi2_get_feat_config(page_idx
, feat_config
, dev
);
3852 if (rslt
== BMI2_OK
)
3854 /* Start from address 0x00 when switched to next page */
3855 if (page_idx
> start_page
)
3860 /* Remaining number of bytes to be read in the page */
3861 if (page_idx
== end_page
)
3863 max_len
= remain_len
;
3866 /* Get the offset */
3867 page_byte_idx
= start_addr
;
3868 while (page_byte_idx
< max_len
)
3870 /* Get word to calculate the parameter*/
3871 lsb
= (uint16_t) feat_config
[page_byte_idx
++];
3872 if (page_byte_idx
< max_len
)
3874 msb
= ((uint16_t) feat_config
[page_byte_idx
++] << 8);
3877 lsb_msb
= lsb
| msb
;
3879 /* Get parameters 1 to 25 */
3880 step_count_params
[param_idx
] = lsb_msb
& BMI2_STEP_COUNT_PARAMS_MASK
;
3882 /* Increment to next parameter */
3890 rslt
= BMI2_E_INVALID_SENSOR
;
3897 * @brief This internal API gets step counter/detector/activity configurations.
3899 static int8_t get_step_config(struct bmi2_step_config
*config
, struct bmi2_dev
*dev
)
3901 /* Variable to define error */
3904 /* Array to define the feature configuration */
3905 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
3907 /* Variable to define the array offset */
3910 /* Variable to define LSB */
3913 /* Variable to define MSB */
3916 /* Variable to define a word */
3917 uint16_t lsb_msb
= 0;
3919 /* Variable to set flag */
3922 /* Initialize feature configuration for step counter */
3923 struct bmi2_feature_config step_count_config
= { 0, 0, 0 };
3925 /* Search for step counter 4 feature and extract its configuration details */
3926 feat_found
= bmi2_extract_input_feat_config(&step_count_config
, BMI2_STEP_COUNTER
, dev
);
3929 /* Get the configuration from the page where step counter 4 parameter resides */
3930 rslt
= bmi2_get_feat_config(step_count_config
.page
, feat_config
, dev
);
3931 if (rslt
== BMI2_OK
)
3933 /* Define the offset for feature enable for step counter/detector/activity */
3934 idx
= step_count_config
.start_addr
;
3936 /* Get word to calculate water-mark level and reset counter */
3937 lsb
= (uint16_t) feat_config
[idx
++];
3938 msb
= ((uint16_t) feat_config
[idx
++] << 8);
3939 lsb_msb
= lsb
| msb
;
3941 /* Get water-mark level */
3942 config
->watermark_level
= lsb_msb
& BMI2_STEP_COUNT_WM_LEVEL_MASK
;
3944 /* Get reset counter */
3945 config
->reset_counter
= (lsb_msb
& BMI2_STEP_COUNT_RST_CNT_MASK
) >> BMI2_STEP_COUNT_RST_CNT_POS
;
3947 /* Get word to calculate output configuration of step detector and activity */
3948 lsb
= (uint16_t) feat_config
[idx
++];
3949 msb
= ((uint16_t) feat_config
[idx
++] << 8);
3950 lsb_msb
= lsb
| msb
;
3952 config
->step_buffer_size
= (lsb_msb
& BMI2_STEP_BUFFER_SIZE_MASK
) >> BMI2_STEP_BUFFER_SIZE_POS
;
3957 rslt
= BMI2_E_INVALID_SENSOR
;
3964 * @brief This internal API gets wrist gesture configurations like wearable-arm,
3965 * and output-configuration.
3967 static int8_t get_wrist_gest_config(struct bmi2_wrist_gest_config
*config
, struct bmi2_dev
*dev
)
3969 /* Variable to define error */
3972 /* Array to define the feature configuration */
3973 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
3975 /* Variable to define the array offset */
3978 /* Variable to set flag */
3981 /* Initialize feature configuration for wrist gesture */
3982 struct bmi2_feature_config wrist_gest_config
= { 0, 0, 0 };
3984 /* Copy the feature configuration address to a local pointer */
3985 uint16_t *data_p
= (uint16_t *) (void *)feat_config
;
3987 /* Search for wrist gesture feature and extract its configuration details */
3988 feat_found
= bmi2_extract_input_feat_config(&wrist_gest_config
, BMI2_WRIST_GESTURE
, dev
);
3991 /* Get the configuration from the page where wrist gesture feature resides */
3992 rslt
= bmi2_get_feat_config(wrist_gest_config
.page
, feat_config
, dev
);
3993 if (rslt
== BMI2_OK
)
3995 /* Define the offset in bytes for wrist gesture select */
3996 idx
= wrist_gest_config
.start_addr
;
3998 /* Get offset in words since all the features are set in words length */
4001 /* Get wearable arm */
4002 config
->wearable_arm
= (*(data_p
+ idx
) & BMI2_WRIST_GEST_WEAR_ARM_MASK
) >> BMI2_WRIST_GEST_WEAR_ARM_POS
;
4004 /* Increment the offset by 1 word to get min_flick_peak */
4006 config
->min_flick_peak
= *(data_p
+ idx
);
4008 /* Increment the offset by 1 word to get min_flick_samples */
4010 config
->min_flick_samples
= *(data_p
+ idx
);
4012 /* Increment the offset by 1 word to get max_duration */
4014 config
->max_duration
= *(data_p
+ idx
);
4019 rslt
= BMI2_E_INVALID_SENSOR
;
4026 * @brief This internal API gets wrist wear wake-up configurations like
4027 * output-configuration.
4029 static int8_t get_wrist_wear_wake_up_config(struct bmi2_wrist_wear_wake_up_config
*config
, struct bmi2_dev
*dev
)
4031 /* Variable to define error */
4034 /* Array to define the feature configuration */
4035 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
4037 /* Variable to define the array offset */
4040 /* Variable to set flag */
4043 /* Initialize feature configuration for wrist wear wake-up */
4044 struct bmi2_feature_config wrist_wake_up_config
= { 0, 0, 0 };
4046 /* Copy the feature configuration address to a local pointer */
4047 uint16_t *data_p
= (uint16_t *) (void *)feat_config
;
4049 /* Search for wrist wear wake-up feature and extract its configuration details */
4050 feat_found
= bmi2_extract_input_feat_config(&wrist_wake_up_config
, BMI2_WRIST_WEAR_WAKE_UP
, dev
);
4053 /* Get the configuration from the page where wrist wear wake-up feature resides */
4054 rslt
= bmi2_get_feat_config(wrist_wake_up_config
.page
, feat_config
, dev
);
4055 if (rslt
== BMI2_OK
)
4057 /* Define the offset in bytes for wrist wear wake-up select */
4058 idx
= wrist_wake_up_config
.start_addr
;
4060 /* Get offset in words since all the features are set in words length */
4063 config
->min_angle_focus
= *(data_p
+ idx
);
4065 /* Increment the offset value by 1 word to get min_angle_nonfocus */
4067 config
->min_angle_nonfocus
= *(data_p
+ idx
);
4069 /* Increment the offset value by 1 word to get max_tilt_lr */
4071 config
->max_tilt_lr
= *(data_p
+ idx
);
4073 /* Increment the offset value by 1 word to get max_tilt_ll */
4075 config
->max_tilt_ll
= *(data_p
+ idx
);
4077 /* Increment the offset value by 1 word to get max_tilt_pd */
4079 config
->max_tilt_pd
= *(data_p
+ idx
);
4081 /* Increment the offset value by 1 word to get max_tilt_pu */
4083 config
->max_tilt_pu
= *(data_p
+ idx
);
4089 rslt
= BMI2_E_INVALID_SENSOR
;
4096 * @brief This internal API gets the output values of the wrist gesture.
4098 static int8_t get_wrist_gest_status(uint8_t *wrist_gest
, struct bmi2_dev
*dev
)
4100 /* Variable to define error */
4103 /* Array to define the feature configuration */
4104 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
4106 /* Variables to define index */
4109 /* Variable to set flag */
4112 /* Initialize feature output for wrist gesture */
4113 struct bmi2_feature_config wrist_gest_out_config
= { 0, 0, 0 };
4115 /* Search for wrist gesture feature and extract its configuration details */
4116 feat_found
= extract_output_feat_config(&wrist_gest_out_config
, BMI2_WRIST_GESTURE
, dev
);
4119 /* Get the feature output configuration for wrist gesture */
4120 rslt
= bmi2_get_feat_config(wrist_gest_out_config
.page
, feat_config
, dev
);
4121 if (rslt
== BMI2_OK
)
4123 /* Define the offset in bytes for wrist gesture output */
4124 idx
= wrist_gest_out_config
.start_addr
;
4126 /* Get the wrist gesture output */
4127 *wrist_gest
= feat_config
[idx
];
4132 rslt
= BMI2_E_INVALID_SENSOR
;
4139 * @brief This internal API gets the output values of step counter.
4141 static int8_t get_step_counter_output(uint32_t *step_count
, struct bmi2_dev
*dev
)
4143 /* Variable to define error */
4146 /* Array to define the feature configuration */
4147 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
4149 /* Variables to define index */
4152 /* Variable to set flag */
4155 /* Initialize feature output for step counter */
4156 struct bmi2_feature_config step_cnt_out_config
= { 0, 0, 0 };
4158 /* Search for step counter output feature and extract its configuration details */
4159 feat_found
= extract_output_feat_config(&step_cnt_out_config
, BMI2_STEP_COUNTER
, dev
);
4162 /* Get the feature output configuration for step-counter */
4163 rslt
= bmi2_get_feat_config(step_cnt_out_config
.page
, feat_config
, dev
);
4164 if (rslt
== BMI2_OK
)
4166 /* Define the offset in bytes for step counter output */
4167 idx
= step_cnt_out_config
.start_addr
;
4169 /* Get the step counter output in 4 bytes */
4170 *step_count
= (uint32_t) feat_config
[idx
++];
4171 *step_count
|= ((uint32_t) feat_config
[idx
++] << 8);
4172 *step_count
|= ((uint32_t) feat_config
[idx
++] << 16);
4173 *step_count
|= ((uint32_t) feat_config
[idx
++] << 24);
4178 rslt
= BMI2_E_INVALID_SENSOR
;
4185 * @brief This internal API gets the error status related to NVM.
4187 static int8_t get_nvm_error_status(struct bmi2_nvm_err_status
*nvm_err_stat
, struct bmi2_dev
*dev
)
4189 /* Variable to define error */
4192 /* Array to define the feature configuration */
4193 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
4195 /* Variables to define index */
4198 /* Variable to set flag */
4201 /* Initialize feature output for NVM error status */
4202 struct bmi2_feature_config nvm_err_cfg
= { 0, 0, 0 };
4204 /* Search for NVM error status feature and extract its configuration details */
4205 feat_found
= extract_output_feat_config(&nvm_err_cfg
, BMI2_NVM_STATUS
, dev
);
4208 /* Get the feature output configuration for NVM error status */
4209 rslt
= bmi2_get_feat_config(nvm_err_cfg
.page
, feat_config
, dev
);
4210 if (rslt
== BMI2_OK
)
4212 /* Define the offset in bytes for NVM error status */
4213 idx
= nvm_err_cfg
.start_addr
;
4215 /* Increment index to get the error status */
4218 /* Error when NVM load action fails */
4219 nvm_err_stat
->load_error
= BMI2_GET_BIT_POS0(feat_config
[idx
], BMI2_NVM_LOAD_ERR_STATUS
);
4221 /* Error when NVM program action fails */
4222 nvm_err_stat
->prog_error
= BMI2_GET_BITS(feat_config
[idx
], BMI2_NVM_PROG_ERR_STATUS
);
4224 /* Error when NVM erase action fails */
4225 nvm_err_stat
->erase_error
= BMI2_GET_BITS(feat_config
[idx
], BMI2_NVM_ERASE_ERR_STATUS
);
4227 /* Error when NVM program limit is exceeded */
4228 nvm_err_stat
->exceed_error
= BMI2_GET_BITS(feat_config
[idx
], BMI2_NVM_END_EXCEED_STATUS
);
4230 /* Error when NVM privilege mode is not acquired */
4231 nvm_err_stat
->privil_error
= BMI2_GET_BITS(feat_config
[idx
], BMI2_NVM_PRIV_ERR_STATUS
);
4236 rslt
= BMI2_E_INVALID_SENSOR
;
4243 * @brief This internal API is used to get enable status of gyroscope user gain
4246 static int8_t get_user_gain_upd_status(uint8_t *status
, struct bmi2_dev
*dev
)
4248 /* Variable to define error */
4249 int8_t rslt
= BMI2_OK
;
4251 /* Array to define the feature configuration */
4252 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
4254 /* Variable to define the array offset */
4257 /* Variable to set flag */
4260 /* Variable to check APS status */
4261 uint8_t aps_stat
= 0;
4263 /* Initialize feature configuration for gyroscope user gain */
4264 struct bmi2_feature_config gyr_user_gain_cfg
= { 0, 0, 0 };
4266 /* Search for user gain feature and extract its configuration details */
4267 feat_found
= bmi2_extract_input_feat_config(&gyr_user_gain_cfg
, BMI2_GYRO_GAIN_UPDATE
, dev
);
4270 /* Disable advance power save */
4271 aps_stat
= dev
->aps_status
;
4272 if (aps_stat
== BMI2_ENABLE
)
4274 rslt
= bmi2_set_adv_power_save(BMI2_DISABLE
, dev
);
4277 if (rslt
== BMI2_OK
)
4279 /* Get the configuration from the page where user gain feature resides */
4280 rslt
= bmi2_get_feat_config(gyr_user_gain_cfg
.page
, feat_config
, dev
);
4281 if (rslt
== BMI2_OK
)
4283 /* Define the offset for enable/disable of user gain */
4284 idx
= gyr_user_gain_cfg
.start_addr
+ BMI2_GYR_USER_GAIN_FEAT_EN_OFFSET
;
4286 /* Set the feature enable status */
4287 *status
= BMI2_GET_BITS(feat_config
[idx
], BMI2_GYR_USER_GAIN_FEAT_EN
);
4293 rslt
= BMI2_E_INVALID_SENSOR
;
4296 /* Enable Advance power save if disabled while configuring and not when already disabled */
4297 if ((rslt
== BMI2_OK
) && (aps_stat
== BMI2_ENABLE
))
4299 rslt
= bmi2_set_adv_power_save(BMI2_ENABLE
, dev
);
4306 * @brief This internal API gets the output values of step activity.
4308 static int8_t get_step_activity_output(uint8_t *step_act
, struct bmi2_dev
*dev
)
4310 /* Variable to define error */
4313 /* Array to define the feature configuration */
4314 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
4316 /* Variables to define index */
4319 /* Variable to set flag */
4322 /* Initialize feature output for step activity */
4323 struct bmi2_feature_config step_act_out_config
= { 0, 0, 0 };
4325 /* Search for step activity output feature and extract its configuration details */
4326 feat_found
= extract_output_feat_config(&step_act_out_config
, BMI2_STEP_ACTIVITY
, dev
);
4329 /* Get the feature output configuration for step-activity */
4330 rslt
= bmi2_get_feat_config(step_act_out_config
.page
, feat_config
, dev
);
4331 if (rslt
== BMI2_OK
)
4333 /* Define the offset in bytes for step activity output */
4334 idx
= step_act_out_config
.start_addr
;
4336 /* Get the step activity output */
4337 *step_act
= feat_config
[idx
];
4342 rslt
= BMI2_E_INVALID_SENSOR
;
4349 * @brief This internal API gets the error status related to virtual frames.
4351 static int8_t get_vfrm_error_status(struct bmi2_vfrm_err_status
*vfrm_err_stat
, struct bmi2_dev
*dev
)
4353 /* Variable to define error */
4356 /* Array to define the feature configuration */
4357 uint8_t feat_config
[BMI2_FEAT_SIZE_IN_BYTES
] = { 0 };
4359 /* Variables to define index */
4362 /* Variable to set flag */
4365 /* Initialize feature output for VFRM error status */
4366 struct bmi2_feature_config vfrm_err_cfg
= { 0, 0, 0 };
4368 /* Search for VFRM error status feature and extract its configuration details */
4369 feat_found
= extract_output_feat_config(&vfrm_err_cfg
, BMI2_VFRM_STATUS
, dev
);
4372 /* Get the feature output configuration for VFRM error status */
4373 rslt
= bmi2_get_feat_config(vfrm_err_cfg
.page
, feat_config
, dev
);
4374 if (rslt
== BMI2_OK
)
4376 /* Define the offset in bytes for VFRM error status */
4377 idx
= vfrm_err_cfg
.start_addr
;
4379 /* Increment index to get the error status */
4382 /* Internal error while acquiring lock for FIFO */
4383 vfrm_err_stat
->lock_error
= BMI2_GET_BITS(feat_config
[idx
], BMI2_VFRM_LOCK_ERR_STATUS
);
4385 /* Internal error while writing byte into FIFO */
4386 vfrm_err_stat
->write_error
= BMI2_GET_BITS(feat_config
[idx
], BMI2_VFRM_WRITE_ERR_STATUS
);
4388 /* Internal error while writing into FIFO */
4389 vfrm_err_stat
->fatal_error
= BMI2_GET_BITS(feat_config
[idx
], BMI2_VFRM_FATAL_ERR_STATUS
);
4394 rslt
= BMI2_E_INVALID_SENSOR
;
4401 * @brief This internal API enables/disables compensation of the gain defined
4402 * in the GAIN register.
4404 static int8_t enable_gyro_gain(uint8_t enable
, struct bmi2_dev
*dev
)
4406 /* Variable to define error */
4409 /* Variable to define register data */
4410 uint8_t reg_data
= 0;
4412 rslt
= bmi2_get_regs(BMI2_GYR_OFF_COMP_6_ADDR
, ®_data
, 1, dev
);
4413 if (rslt
== BMI2_OK
)
4415 reg_data
= BMI2_SET_BITS(reg_data
, BMI2_GYR_GAIN_EN
, enable
);
4416 rslt
= bmi2_set_regs(BMI2_GYR_OFF_COMP_6_ADDR
, ®_data
, 1, dev
);
4423 * @brief This internal API is used to extract the output feature configuration
4424 * details from the look-up table.
4426 static uint8_t extract_output_feat_config(struct bmi2_feature_config
*feat_output
,
4428 const struct bmi2_dev
*dev
)
4430 /* Variable to define loop */
4433 /* Variable to set flag */
4434 uint8_t feat_found
= BMI2_FALSE
;
4436 /* Search for the output feature from the output configuration array */
4437 while (loop
< dev
->out_sens
)
4439 if (dev
->feat_output
[loop
].type
== type
)
4441 *feat_output
= dev
->feat_output
[loop
];
4442 feat_found
= BMI2_TRUE
;