update serTcpOpen declaration to fix compile errors (#14113)
[betaflight.git] / lib / main / BoschSensortec / BMI270-Sensor-API / bmi270_context.c
blob4f6e300351d5d0f1adc4d1d278a98afcdc07ec70
1 /**
2 * Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved.
4 * BSD-3-Clause
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.
33 * @file bmi270_context.c
34 * @date 2020-11-04
35 * @version v2.63.1
39 /***************************************************************************/
41 /*! Header files
42 ****************************************************************************/
43 #include "bmi270_context.h"
45 /***************************************************************************/
47 /*! Global Variable
48 ****************************************************************************/
50 /*! @name Global array that stores the configuration file of BMI270_CONTEXT */
51 const uint8_t bmi270_context_config_file[] = {
52 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x00, 0xb0, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0xc9,
53 0x01, 0x80, 0x2e, 0xe2, 0x00, 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x77, 0xb0, 0x50, 0x30, 0x21, 0x2e, 0x59, 0xf5,
54 0x10, 0x30, 0x21, 0x2e, 0x6a, 0xf5, 0x80, 0x2e, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x09, 0x01, 0x00, 0x22,
55 0x00, 0x76, 0x00, 0x00, 0x10, 0x00, 0x10, 0xd1, 0x00, 0xcb, 0xa7, 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, 0xfd, 0x2d, 0x2c, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
65 0x00, 0x00, 0x00, 0x00, 0x02, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00,
66 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
67 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x24, 0x22, 0x00, 0x80, 0x2e, 0x48, 0x02, 0x01, 0x2e, 0x49,
71 0xf1, 0x0b, 0xbc, 0x10, 0x50, 0x0f, 0xb8, 0x00, 0x90, 0xfb, 0x7f, 0x07, 0x2f, 0x03, 0x2e, 0x21, 0xf2, 0x02, 0x31,
72 0x4a, 0x0a, 0x23, 0x2e, 0x21, 0xf2, 0x09, 0x2c, 0x00, 0x30, 0x98, 0x2e, 0x0e, 0xc7, 0x03, 0x2e, 0x21, 0xf2, 0xf2,
73 0x3e, 0x4a, 0x08, 0x23, 0x2e, 0x21, 0xf2, 0xfb, 0x6f, 0xf0, 0x5f, 0xb8, 0x2e, 0x13, 0x52, 0x00, 0x2e, 0x60, 0x40,
74 0x41, 0x40, 0x0d, 0xbc, 0x98, 0xbc, 0xc0, 0x2e, 0x01, 0x0a, 0x0f, 0xb8, 0x43, 0x86, 0x25, 0x40, 0x04, 0x40, 0xd8,
75 0xbe, 0x2c, 0x0b, 0x22, 0x11, 0x54, 0x42, 0x03, 0x80, 0x4b, 0x0e, 0xf6, 0x2f, 0xb8, 0x2e, 0x20, 0x50, 0xe7, 0x7f,
76 0xf6, 0x7f, 0x46, 0x30, 0x0f, 0x2e, 0xa4, 0xf1, 0xbe, 0x09, 0x80, 0xb3, 0x06, 0x2f, 0x0d, 0x2e, 0x84, 0x00, 0x84,
77 0xaf, 0x02, 0x2f, 0x16, 0x30, 0x2d, 0x2e, 0x7b, 0x00, 0x86, 0x30, 0x2d, 0x2e, 0x60, 0xf5, 0xf6, 0x6f, 0xe7, 0x6f,
78 0xe0, 0x5f, 0xc8, 0x2e, 0x80, 0x2e, 0xfb, 0x00, 0x00, 0x30, 0xc0, 0x2e, 0x21, 0x2e, 0x8d, 0x00, 0x44, 0x47, 0x99,
79 0x00, 0xff, 0x3f, 0x00, 0x0c, 0xff, 0x0f, 0x00, 0x04, 0xc0, 0x00, 0x5b, 0xf5, 0x90, 0x00, 0x1e, 0xf2, 0xfd, 0xf5,
80 0x8e, 0x00, 0x96, 0x00, 0x96, 0x00, 0xe0, 0x00, 0x19, 0xf4, 0x66, 0xf5, 0x00, 0x18, 0x64, 0xf5, 0x9d, 0x00, 0x7f,
81 0x00, 0x81, 0x00, 0xae, 0x00, 0xff, 0xfb, 0x21, 0x02, 0x00, 0x10, 0x00, 0x40, 0xff, 0x00, 0x00, 0x80, 0xff, 0x7f,
82 0x54, 0x0f, 0xeb, 0x00, 0x7f, 0xff, 0xc2, 0xf5, 0x68, 0xf7, 0xb3, 0xf1, 0x4e, 0x0f, 0x42, 0x0f, 0x48, 0x0f, 0x80,
83 0x00, 0x67, 0x0f, 0x58, 0xf7, 0x5b, 0xf7, 0x6a, 0x0f, 0x86, 0x00, 0x59, 0x0f, 0x6c, 0x0f, 0xc6, 0xf1, 0x66, 0x0f,
84 0x6c, 0xf7, 0x00, 0xe0, 0x00, 0xff, 0xd1, 0xf5, 0x6e, 0x0f, 0x71, 0x0f, 0xff, 0x03, 0x00, 0xfc, 0xf0, 0x3f, 0xb9,
85 0x00, 0x2d, 0xf5, 0xca, 0xf5, 0x8a, 0x00, 0x00, 0x08, 0x71, 0x7d, 0xfe, 0xc0, 0x03, 0x3f, 0x05, 0x3e, 0x49, 0x01,
86 0x92, 0x02, 0xf5, 0xd6, 0xe8, 0x63, 0xd3, 0xf8, 0x2e, 0x07, 0x5c, 0xce, 0xa5, 0x67, 0x28, 0x02, 0x4e, 0x01, 0x00,
87 0xf0, 0x33, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
88 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
89 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
90 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
91 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
92 0x00, 0x00, 0x00, 0x00, 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, 0x15, 0x50, 0x10,
97 0x50, 0x17, 0x52, 0x05, 0x2e, 0x7d, 0x00, 0xfb, 0x7f, 0x00, 0x2e, 0x13, 0x40, 0x93, 0x42, 0x41, 0x0e, 0xfb, 0x2f,
98 0x98, 0x2e, 0x91, 0x03, 0x98, 0x2e, 0x87, 0xcf, 0x01, 0x2e, 0x89, 0x00, 0x00, 0xb2, 0x08, 0x2f, 0x01, 0x2e, 0x69,
99 0xf7, 0xb1, 0x3f, 0x01, 0x08, 0x01, 0x30, 0x23, 0x2e, 0x89, 0x00, 0x21, 0x2e, 0x69, 0xf7, 0xfb, 0x6f, 0xf0, 0x5f,
100 0xb8, 0x2e, 0xa0, 0x50, 0x80, 0x7f, 0xe7, 0x7f, 0xd5, 0x7f, 0xc4, 0x7f, 0xb3, 0x7f, 0xa2, 0x7f, 0x91, 0x7f, 0xf6,
101 0x7f, 0x7b, 0x7f, 0x00, 0x2e, 0x01, 0x2e, 0x60, 0xf5, 0x60, 0x7f, 0x98, 0x2e, 0xce, 0x00, 0x62, 0x6f, 0x01, 0x32,
102 0x91, 0x08, 0x80, 0xb2, 0x11, 0x2f, 0x00, 0xb2, 0x03, 0x2f, 0x05, 0x2e, 0x18, 0x00, 0x80, 0x90, 0x09, 0x2f, 0x60,
103 0x7f, 0x98, 0x2e, 0xf9, 0x00, 0x23, 0x50, 0x01, 0x32, 0x01, 0x42, 0x02, 0x86, 0x60, 0x6f, 0x02, 0x30, 0xc2, 0x42,
104 0x23, 0x2e, 0x60, 0xf5, 0x00, 0x90, 0x00, 0x30, 0x01, 0x2f, 0x21, 0x2e, 0x7a, 0x00, 0xf6, 0x6f, 0x91, 0x6f, 0xa2,
105 0x6f, 0xb3, 0x6f, 0xc4, 0x6f, 0xd5, 0x6f, 0xe7, 0x6f, 0x7b, 0x6f, 0x80, 0x6f, 0x60, 0x5f, 0xc8, 0x2e, 0x00, 0x00,
106 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x01, 0xd4, 0x7b, 0x3b,
107 0x01, 0xdb, 0x7a, 0x04, 0x00, 0x3f, 0x7b, 0xcd, 0x6c, 0xc3, 0x04, 0x85, 0x09, 0xc3, 0x04, 0xec, 0xe6, 0x0c, 0x46,
108 0x01, 0x00, 0x27, 0x00, 0x19, 0x00, 0x96, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x0c, 0x00, 0xf0, 0x3c, 0x00, 0x01, 0x01,
109 0x00, 0x03, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
110 0x00, 0x00, 0x01, 0x00, 0xe1, 0x06, 0x66, 0x0a, 0x0a, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
111 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
112 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
113 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x50, 0x98, 0x2e, 0xd7, 0x0e, 0x50, 0x32, 0x98, 0x2e,
114 0x48, 0x03, 0x10, 0x30, 0x21, 0x2e, 0x21, 0xf2, 0x00, 0x30, 0x00, 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0x00, 0x2e, 0x01,
115 0x80, 0x06, 0xa2, 0xfb, 0x2f, 0x01, 0x2e, 0x9c, 0x00, 0x00, 0xb2, 0x10, 0x2f, 0x01, 0x2e, 0x18, 0x00, 0x00, 0xb2,
116 0x0c, 0x2f, 0x01, 0x54, 0x03, 0x52, 0x01, 0x50, 0x98, 0x2e, 0xc2, 0xc0, 0x98, 0x2e, 0xf5, 0xb0, 0x01, 0x50, 0x98,
117 0x2e, 0xd5, 0xb6, 0x10, 0x30, 0x21, 0x2e, 0x19, 0x00, 0x01, 0x2e, 0x84, 0x00, 0x04, 0xae, 0x0b, 0x2f, 0x01, 0x2e,
118 0x9c, 0x00, 0x00, 0xb2, 0x07, 0x2f, 0x01, 0x52, 0x98, 0x2e, 0x8e, 0x0e, 0x00, 0xb2, 0x02, 0x2f, 0x10, 0x30, 0x21,
119 0x2e, 0x79, 0x00, 0x01, 0x2e, 0x79, 0x00, 0x00, 0x90, 0x90, 0x2e, 0x14, 0x03, 0x01, 0x2e, 0x87, 0x00, 0x00, 0xb2,
120 0x04, 0x2f, 0x98, 0x2e, 0x2f, 0x0e, 0x00, 0x30, 0x21, 0x2e, 0x7b, 0x00, 0x01, 0x2e, 0x7b, 0x00, 0x00, 0xb2, 0x12,
121 0x2f, 0x01, 0x2e, 0x84, 0x00, 0x00, 0x90, 0x02, 0x2f, 0x98, 0x2e, 0x1f, 0x0e, 0x09, 0x2d, 0x98, 0x2e, 0x81, 0x0d,
122 0x01, 0x2e, 0x84, 0x00, 0x04, 0x90, 0x02, 0x2f, 0x50, 0x32, 0x98, 0x2e, 0x48, 0x03, 0x00, 0x30, 0x21, 0x2e, 0x7b,
123 0x00, 0x01, 0x2e, 0x78, 0x00, 0x00, 0xb2, 0x90, 0x2e, 0x2c, 0x03, 0x01, 0x2e, 0x78, 0x00, 0x81, 0x30, 0x01, 0x08,
124 0x00, 0xb2, 0x61, 0x2f, 0x03, 0x2e, 0x24, 0x02, 0x01, 0x2e, 0x84, 0x00, 0x98, 0xbc, 0x98, 0xb8, 0x05, 0xb2, 0x0d,
125 0x58, 0x23, 0x2f, 0x07, 0x90, 0x07, 0x54, 0x00, 0x30, 0x37, 0x2f, 0x15, 0x41, 0x04, 0x41, 0xdc, 0xbe, 0x44, 0xbe,
126 0xdc, 0xba, 0x2c, 0x01, 0x61, 0x00, 0x0d, 0x56, 0x4a, 0x0f, 0x0c, 0x2f, 0xd1, 0x42, 0x94, 0xb8, 0xc1, 0x42, 0x11,
127 0x30, 0x05, 0x2e, 0x6a, 0xf7, 0x2c, 0xbd, 0x2f, 0xb9, 0x80, 0xb2, 0x08, 0x22, 0x98, 0x2e, 0xaf, 0x03, 0x21, 0x2d,
128 0x61, 0x30, 0x23, 0x2e, 0x84, 0x00, 0x98, 0x2e, 0xaf, 0x03, 0x00, 0x30, 0x21, 0x2e, 0x5a, 0xf5, 0x18, 0x2d, 0xf1,
129 0x7f, 0x50, 0x30, 0x98, 0x2e, 0x48, 0x03, 0x0d, 0x52, 0x05, 0x50, 0x50, 0x42, 0x70, 0x30, 0x0b, 0x54, 0x42, 0x42,
130 0x7e, 0x82, 0xf2, 0x6f, 0x80, 0xb2, 0x42, 0x42, 0x05, 0x2f, 0x21, 0x2e, 0x84, 0x00, 0x10, 0x30, 0x98, 0x2e, 0xaf,
131 0x03, 0x03, 0x2d, 0x60, 0x30, 0x21, 0x2e, 0x84, 0x00, 0x01, 0x2e, 0x84, 0x00, 0x06, 0x90, 0x18, 0x2f, 0x01, 0x2e,
132 0x77, 0x00, 0x09, 0x54, 0x05, 0x52, 0xf0, 0x7f, 0x98, 0x2e, 0x7a, 0xc1, 0xf1, 0x6f, 0x08, 0x1a, 0x40, 0x30, 0x08,
133 0x2f, 0x21, 0x2e, 0x84, 0x00, 0x20, 0x30, 0x98, 0x2e, 0x9b, 0x03, 0x50, 0x32, 0x98, 0x2e, 0x48, 0x03, 0x05, 0x2d,
134 0x98, 0x2e, 0x38, 0x0e, 0x00, 0x30, 0x21, 0x2e, 0x84, 0x00, 0x00, 0x30, 0x21, 0x2e, 0x78, 0x00, 0x18, 0x2d, 0x01,
135 0x2e, 0x84, 0x00, 0x03, 0xaa, 0x01, 0x2f, 0x98, 0x2e, 0x45, 0x0e, 0x01, 0x2e, 0x84, 0x00, 0x3f, 0x80, 0x03, 0xa2,
136 0x01, 0x2f, 0x00, 0x2e, 0x02, 0x2d, 0x98, 0x2e, 0x5b, 0x0e, 0x30, 0x30, 0x98, 0x2e, 0xba, 0x03, 0x00, 0x30, 0x21,
137 0x2e, 0x79, 0x00, 0x50, 0x32, 0x98, 0x2e, 0x48, 0x03, 0x01, 0x2e, 0x19, 0x00, 0x00, 0xb2, 0x10, 0x2f, 0x01, 0x2e,
138 0x85, 0x00, 0x21, 0x2e, 0x90, 0x00, 0x0f, 0x52, 0x7e, 0x82, 0x11, 0x50, 0x41, 0x40, 0x18, 0xb9, 0x11, 0x42, 0x02,
139 0x42, 0x02, 0x80, 0x00, 0x2e, 0x01, 0x40, 0x01, 0x42, 0x98, 0x2e, 0xaa, 0x01, 0x00, 0x30, 0x21, 0x2e, 0x19, 0x00,
140 0x21, 0x2e, 0x9c, 0x00, 0x80, 0x2e, 0x52, 0x02, 0x21, 0x2e, 0x59, 0xf5, 0x10, 0x30, 0xc0, 0x2e, 0x21, 0x2e, 0x4a,
141 0xf1, 0x80, 0x2e, 0x00, 0xc1, 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, 0x03, 0x2e, 0x7d, 0x00, 0x16, 0xb8, 0x02, 0x34, 0x4a, 0x0c, 0x21, 0x2e, 0x2d, 0xf5, 0xc0, 0x2e, 0x23,
149 0x2e, 0x7d, 0x00, 0x03, 0xbc, 0x21, 0x2e, 0x85, 0x00, 0x03, 0x2e, 0x85, 0x00, 0x40, 0xb2, 0x10, 0x30, 0x21, 0x2e,
150 0x19, 0x00, 0x01, 0x30, 0x05, 0x2f, 0x05, 0x2e, 0x88, 0x00, 0x80, 0x90, 0x01, 0x2f, 0x23, 0x2e, 0x6f, 0xf5, 0xc0,
151 0x2e, 0x21, 0x2e, 0x89, 0x00, 0x11, 0x30, 0x81, 0x08, 0x01, 0x2e, 0x6a, 0xf7, 0x71, 0x3f, 0x23, 0xbd, 0x01, 0x08,
152 0x02, 0x0a, 0xc0, 0x2e, 0x21, 0x2e, 0x6a, 0xf7, 0x30, 0x25, 0x00, 0x30, 0x21, 0x2e, 0x5a, 0xf5, 0x10, 0x50, 0x21,
153 0x2e, 0x7b, 0x00, 0x21, 0x2e, 0x78, 0x00, 0xfb, 0x7f, 0x98, 0x2e, 0xaf, 0x03, 0x40, 0x30, 0x21, 0x2e, 0x84, 0x00,
154 0xfb, 0x6f, 0xf0, 0x5f, 0x03, 0x25, 0x80, 0x2e, 0x9b, 0x03, 0x0b, 0x00, 0x94, 0x02, 0x14, 0x24, 0x80, 0x00, 0x04,
155 0x00, 0x04, 0x30, 0x08, 0xb8, 0x94, 0x02, 0xc0, 0x2e, 0x28, 0xbd, 0x02, 0x0a, 0x0d, 0x82, 0x02, 0x30, 0x12, 0x42,
156 0x41, 0x0e, 0xfc, 0x2f, 0xb8, 0x2e, 0x95, 0x50, 0xc0, 0x2e, 0x21, 0x2e, 0xa9, 0x01, 0x02, 0x30, 0x02, 0x2c, 0x41,
157 0x00, 0x12, 0x42, 0x41, 0x0e, 0xfc, 0x2f, 0xb8, 0x2e, 0x13, 0x82, 0x02, 0x30, 0x12, 0x42, 0x41, 0x0e, 0xfc, 0x2f,
158 0x3f, 0x80, 0xa1, 0x30, 0xc0, 0x2e, 0x01, 0x42, 0x00, 0x2e, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
159 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0xc0, 0x50, 0xe7, 0x7f,
160 0xf6, 0x7f, 0x26, 0x30, 0x0f, 0x2e, 0x61, 0xf5, 0x2f, 0x2e, 0x78, 0x00, 0x0f, 0x2e, 0x78, 0x00, 0xbe, 0x09, 0xa2,
161 0x7f, 0x80, 0x7f, 0x80, 0xb3, 0xd5, 0x7f, 0xc4, 0x7f, 0xb3, 0x7f, 0x91, 0x7f, 0x7b, 0x7f, 0x0b, 0x2f, 0x19, 0x50,
162 0x1a, 0x25, 0x12, 0x40, 0x42, 0x7f, 0x74, 0x82, 0x12, 0x40, 0x52, 0x7f, 0x00, 0x2e, 0x00, 0x40, 0x60, 0x7f, 0x98,
163 0x2e, 0x6a, 0xd6, 0x81, 0x30, 0x01, 0x2e, 0x78, 0x00, 0x01, 0x08, 0x00, 0xb2, 0x42, 0x2f, 0x03, 0x2e, 0x24, 0x02,
164 0x01, 0x2e, 0x24, 0x02, 0x97, 0xbc, 0x06, 0xbc, 0x9f, 0xb8, 0x0f, 0xb8, 0x00, 0x90, 0x23, 0x2e, 0x88, 0x00, 0x10,
165 0x30, 0x01, 0x30, 0x2a, 0x2f, 0x03, 0x2e, 0x84, 0x00, 0x44, 0xb2, 0x05, 0x2f, 0x47, 0xb2, 0x00, 0x30, 0x2d, 0x2f,
166 0x21, 0x2e, 0x78, 0x00, 0x2b, 0x2d, 0x03, 0x2e, 0xfd, 0xf5, 0x9e, 0xbc, 0x9f, 0xb8, 0x40, 0x90, 0x14, 0x2f, 0x03,
167 0x2e, 0xfc, 0xf5, 0x99, 0xbc, 0x9f, 0xb8, 0x40, 0x90, 0x0e, 0x2f, 0x03, 0x2e, 0x49, 0xf1, 0x1b, 0x54, 0x4a, 0x08,
168 0x40, 0x90, 0x08, 0x2f, 0x98, 0x2e, 0xce, 0x00, 0x00, 0xb2, 0x10, 0x30, 0x03, 0x2f, 0x50, 0x30, 0x21, 0x2e, 0x84,
169 0x00, 0x10, 0x2d, 0x98, 0x2e, 0x9b, 0x03, 0x00, 0x30, 0x21, 0x2e, 0x78, 0x00, 0x0a, 0x2d, 0x05, 0x2e, 0x69, 0xf7,
170 0x2d, 0xbd, 0x2f, 0xb9, 0x80, 0xb2, 0x01, 0x2f, 0x21, 0x2e, 0x79, 0x00, 0x23, 0x2e, 0x78, 0x00, 0xe0, 0x31, 0x21,
171 0x2e, 0x61, 0xf5, 0xf6, 0x6f, 0xe7, 0x6f, 0x80, 0x6f, 0xa2, 0x6f, 0xb3, 0x6f, 0xc4, 0x6f, 0xd5, 0x6f, 0x7b, 0x6f,
172 0x91, 0x6f, 0x40, 0x5f, 0xc8, 0x2e, 0x90, 0x50, 0xf7, 0x7f, 0xe6, 0x7f, 0xd5, 0x7f, 0xc4, 0x7f, 0xb3, 0x7f, 0xa1,
173 0x7f, 0x90, 0x7f, 0x82, 0x7f, 0x7b, 0x7f, 0x98, 0x2e, 0xce, 0x00, 0x00, 0xb2, 0x10, 0x30, 0x49, 0x2f, 0x05, 0x2e,
174 0x21, 0x02, 0x03, 0x2e, 0x2d, 0x02, 0x21, 0x56, 0x08, 0x08, 0x93, 0x08, 0x90, 0x0a, 0x25, 0x2e, 0x18, 0x00, 0x05,
175 0x2e, 0xc1, 0xf5, 0x2e, 0xbc, 0x05, 0x2e, 0x84, 0x00, 0x84, 0xa2, 0x0e, 0xb8, 0x31, 0x30, 0x88, 0x04, 0x03, 0x2f,
176 0x01, 0x2e, 0x18, 0x00, 0x00, 0xb2, 0x0c, 0x2f, 0x1d, 0x50, 0x01, 0x52, 0x98, 0x2e, 0xd7, 0x00, 0x05, 0x2e, 0x7a,
177 0x00, 0x80, 0x90, 0x02, 0x2f, 0x10, 0x30, 0x21, 0x2e, 0x7a, 0x00, 0x25, 0x2e, 0x9c, 0x00, 0x05, 0x2e, 0x18, 0x00,
178 0x80, 0xb2, 0x20, 0x2f, 0x01, 0x2e, 0xc0, 0xf5, 0xf2, 0x30, 0x02, 0x08, 0x07, 0xaa, 0x73, 0x30, 0x03, 0x2e, 0x7c,
179 0x00, 0x18, 0x22, 0x41, 0x1a, 0x05, 0x2f, 0x03, 0x2e, 0x66, 0xf5, 0x9f, 0xbc, 0x9f, 0xb8, 0x40, 0x90, 0x0c, 0x2f,
180 0x1f, 0x52, 0x03, 0x30, 0x53, 0x42, 0x2b, 0x30, 0x90, 0x04, 0x5b, 0x42, 0x21, 0x2e, 0x7c, 0x00, 0x24, 0xbd, 0x7e,
181 0x80, 0x81, 0x84, 0x43, 0x42, 0x02, 0x42, 0x02, 0x32, 0x25, 0x2e, 0x62, 0xf5, 0x05, 0x2e, 0x86, 0x00, 0x81, 0x84,
182 0x25, 0x2e, 0x86, 0x00, 0x02, 0x31, 0x25, 0x2e, 0x60, 0xf5, 0x05, 0x2e, 0x25, 0x02, 0x10, 0x30, 0x90, 0x08, 0x80,
183 0xb2, 0x0b, 0x2f, 0x05, 0x2e, 0xca, 0xf5, 0xf0, 0x3e, 0x90, 0x08, 0x25, 0x2e, 0xca, 0xf5, 0x05, 0x2e, 0x59, 0xf5,
184 0xe0, 0x3f, 0x90, 0x08, 0x25, 0x2e, 0x59, 0xf5, 0x90, 0x6f, 0xa1, 0x6f, 0xb3, 0x6f, 0xc4, 0x6f, 0xd5, 0x6f, 0xe6,
185 0x6f, 0xf7, 0x6f, 0x7b, 0x6f, 0x82, 0x6f, 0x70, 0x5f, 0xc8, 0x2e, 0x2f, 0x52, 0x90, 0x50, 0x53, 0x40, 0x4a, 0x25,
186 0x40, 0x40, 0x39, 0x8b, 0xfb, 0x7f, 0x0c, 0xbc, 0x21, 0x52, 0x37, 0x89, 0x0b, 0x30, 0x59, 0x08, 0x0c, 0xb8, 0xe0,
187 0x7f, 0x8b, 0x7f, 0x4b, 0x43, 0x0b, 0x43, 0x40, 0xb2, 0xd1, 0x7f, 0x6e, 0x2f, 0x01, 0x2e, 0x83, 0x00, 0x00, 0xb2,
188 0x0e, 0x2f, 0x25, 0x52, 0x01, 0x2e, 0x7e, 0x00, 0xc3, 0x7f, 0xb4, 0x7f, 0xa5, 0x7f, 0x98, 0x2e, 0xbb, 0xcc, 0x05,
189 0x30, 0x2b, 0x2e, 0x83, 0x00, 0xc3, 0x6f, 0xd1, 0x6f, 0xb4, 0x6f, 0xa5, 0x6f, 0x36, 0xbc, 0x06, 0xb9, 0x35, 0xbc,
190 0x0f, 0xb8, 0x94, 0xb0, 0xc6, 0x7f, 0x00, 0xb2, 0x0c, 0x2f, 0x27, 0x50, 0x29, 0x56, 0x0b, 0x30, 0x05, 0x2e, 0x21,
191 0x02, 0x2d, 0x5c, 0x1b, 0x42, 0xdb, 0x42, 0x96, 0x08, 0x25, 0x2e, 0x21, 0x02, 0x0b, 0x42, 0xcb, 0x42, 0x00, 0x2e,
192 0x31, 0x56, 0xcb, 0x08, 0x25, 0x52, 0x01, 0x2e, 0x7e, 0x00, 0x01, 0x54, 0x2b, 0x5c, 0x98, 0x2e, 0x06, 0xcd, 0xd2,
193 0x6f, 0x27, 0x5a, 0x94, 0x6f, 0xa4, 0xbc, 0x53, 0x41, 0x00, 0xb3, 0x1f, 0xb8, 0x44, 0x41, 0x01, 0x30, 0xd5, 0x7f,
194 0x05, 0x2f, 0x00, 0xb2, 0x03, 0x2f, 0x29, 0x5c, 0x11, 0x30, 0x93, 0x43, 0x84, 0x43, 0x23, 0xbd, 0x2f, 0xb9, 0x80,
195 0xb2, 0x1c, 0x2f, 0x72, 0x6f, 0xda, 0x00, 0x82, 0x6f, 0x22, 0x03, 0x44, 0x43, 0x00, 0x90, 0x27, 0x2e, 0x7f, 0x00,
196 0x29, 0x5a, 0x12, 0x2f, 0x29, 0x54, 0x00, 0x2e, 0x90, 0x40, 0x82, 0x40, 0x18, 0x04, 0xa2, 0x06, 0x80, 0xaa, 0x04,
197 0x2f, 0x80, 0x90, 0x08, 0x2f, 0xc2, 0x6f, 0x50, 0x0f, 0x05, 0x2f, 0xc0, 0x6f, 0x00, 0xb2, 0x02, 0x2f, 0x53, 0x43,
198 0x44, 0x43, 0x11, 0x30, 0xe0, 0x6f, 0x98, 0x2e, 0x95, 0xcf, 0xd1, 0x6f, 0x15, 0x5a, 0x09, 0x2e, 0x7f, 0x00, 0x41,
199 0x40, 0x54, 0x43, 0x08, 0x2c, 0x41, 0x43, 0x15, 0x30, 0x2b, 0x2e, 0x83, 0x00, 0x01, 0x30, 0xe0, 0x6f, 0x98, 0x2e,
200 0x95, 0xcf, 0x00, 0x2e, 0xfb, 0x6f, 0x70, 0x5f, 0xb8, 0x2e, 0x50, 0x86, 0xcd, 0x88, 0x34, 0x85, 0xc5, 0x40, 0x91,
201 0x40, 0x8c, 0x80, 0x06, 0x41, 0x13, 0x40, 0x50, 0x50, 0x6e, 0x01, 0x82, 0x40, 0x04, 0x40, 0x34, 0x8c, 0xfb, 0x7f,
202 0x98, 0x2e, 0xce, 0x03, 0xe0, 0x7f, 0x00, 0x2e, 0x91, 0x41, 0x8c, 0x81, 0x82, 0x41, 0x13, 0x40, 0x04, 0x40, 0x34,
203 0x8e, 0x98, 0x2e, 0xce, 0x03, 0xc0, 0x7f, 0xd5, 0x7f, 0x13, 0x24, 0xff, 0x00, 0xd6, 0x41, 0xcc, 0x83, 0xc2, 0x41,
204 0x57, 0x40, 0x74, 0x80, 0x44, 0x40, 0x11, 0x40, 0x0c, 0x8a, 0xf7, 0x01, 0x94, 0x03, 0x12, 0x24, 0x80, 0x00, 0x3a,
205 0x01, 0x02, 0x30, 0xb2, 0x03, 0xce, 0x17, 0xfb, 0x08, 0x23, 0x01, 0xb2, 0x02, 0x48, 0xbb, 0x28, 0xbd, 0xf2, 0x0b,
206 0x53, 0x41, 0x02, 0x40, 0x44, 0x41, 0x74, 0x8d, 0xb7, 0x7f, 0x98, 0x2e, 0xce, 0x03, 0x50, 0x25, 0x91, 0x41, 0x8c,
207 0x81, 0x82, 0x41, 0x13, 0x40, 0x04, 0x40, 0x34, 0x8e, 0x98, 0x2e, 0xce, 0x03, 0x60, 0x25, 0xd1, 0x41, 0xcc, 0x81,
208 0xc2, 0x41, 0x13, 0x40, 0x04, 0x40, 0x98, 0x2e, 0xce, 0x03, 0x11, 0x24, 0xb3, 0x00, 0x71, 0x0e, 0xd3, 0x6f, 0xe1,
209 0x6f, 0x33, 0x2f, 0x12, 0x24, 0xdd, 0x00, 0xda, 0x0f, 0x2b, 0x2f, 0x12, 0x24, 0x8c, 0x00, 0x5a, 0x0e, 0x09, 0x2f,
210 0x10, 0x24, 0x83, 0x05, 0x48, 0x0e, 0x11, 0x24, 0x7f, 0x22, 0x10, 0x24, 0x18, 0x32, 0x08, 0x22, 0x80, 0x2e, 0xd7,
211 0xb4, 0x13, 0x24, 0xf4, 0x00, 0x73, 0x0e, 0x0f, 0x2f, 0x10, 0x24, 0x11, 0x10, 0x68, 0x0e, 0x10, 0x24, 0xa2, 0x30,
212 0x13, 0x24, 0x97, 0x23, 0x03, 0x22, 0x13, 0x24, 0x3b, 0x04, 0x4b, 0x0e, 0x11, 0x24, 0x0f, 0x30, 0x01, 0x22, 0x80,
213 0x2e, 0xd7, 0xb4, 0x11, 0x24, 0x53, 0x02, 0x41, 0x0e, 0x11, 0x24, 0xe7, 0x31, 0x10, 0x24, 0xfc, 0x25, 0x08, 0x22,
214 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0xe8, 0x40, 0x80, 0x2e, 0xd7, 0xb4, 0xf2, 0x37, 0x5a, 0x0e, 0x90, 0x2e, 0x50,
215 0xb3, 0x12, 0x24, 0xea, 0x00, 0x4a, 0x0e, 0x90, 0x2e, 0xc7, 0xb2, 0xc2, 0x6f, 0x14, 0x24, 0x4c, 0x0b, 0x54, 0x0e,
216 0x90, 0x2e, 0xab, 0xb2, 0x14, 0x24, 0x9b, 0x00, 0x5c, 0x0e, 0x90, 0x2e, 0xa1, 0xb2, 0x14, 0x24, 0x22, 0x01, 0x4c,
217 0x0e, 0x70, 0x2f, 0x82, 0xa3, 0x5e, 0x2f, 0x11, 0x24, 0xba, 0x0b, 0x51, 0x0e, 0x35, 0x2f, 0x11, 0x24, 0x03, 0x08,
218 0x69, 0x0e, 0x2d, 0x2f, 0xb1, 0x6f, 0x14, 0x24, 0x90, 0x00, 0x0c, 0x0e, 0x24, 0x2f, 0x11, 0x24, 0x31, 0x08, 0x69,
219 0x0e, 0x16, 0x2f, 0x11, 0x24, 0x7d, 0x01, 0x59, 0x0e, 0x0e, 0x2f, 0x11, 0x24, 0xd7, 0x0c, 0x51, 0x0e, 0x11, 0x24,
220 0x9f, 0x44, 0x13, 0x24, 0x41, 0x57, 0x4b, 0x22, 0x93, 0x35, 0x43, 0x0e, 0x10, 0x24, 0xbd, 0x42, 0x08, 0x22, 0x80,
221 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0x1c, 0x42, 0x80, 0x2e, 0xd7, 0xb4, 0x11, 0x24, 0x47, 0x01, 0x59, 0x0e, 0x11, 0x24,
222 0xa2, 0x45, 0x10, 0x24, 0x31, 0x51, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0x80, 0x41, 0x80, 0x2e, 0xd7,
223 0xb4, 0x10, 0x24, 0x67, 0x54, 0x80, 0x2e, 0xd7, 0xb4, 0x11, 0x24, 0x8c, 0x08, 0xe9, 0x0f, 0x10, 0x24, 0x0a, 0x48,
224 0x90, 0x2e, 0xd7, 0xb4, 0xb1, 0x6f, 0x13, 0x24, 0xe8, 0x03, 0x8b, 0x0f, 0x10, 0x24, 0xcd, 0x57, 0x90, 0x2e, 0xd7,
225 0xb4, 0x73, 0x35, 0x8b, 0x0f, 0x10, 0x24, 0x6f, 0x42, 0x90, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0xa0, 0xfe, 0x08, 0x0e,
226 0x10, 0x24, 0x38, 0x54, 0x13, 0x24, 0xa3, 0x46, 0x03, 0x22, 0x13, 0x24, 0x45, 0xfd, 0x0b, 0x0e, 0x11, 0x24, 0x04,
227 0x43, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0xb1, 0x6f, 0x00, 0x3a, 0x08, 0x0e, 0x11, 0x24, 0x3d, 0x45, 0x10, 0x24,
228 0x52, 0x54, 0x48, 0x22, 0x10, 0x24, 0x8f, 0x01, 0x58, 0x0e, 0x10, 0x24, 0x48, 0x44, 0x01, 0x22, 0x80, 0x2e, 0xd7,
229 0xb4, 0xb1, 0x6f, 0x13, 0x24, 0xfa, 0x03, 0x0b, 0x0e, 0x11, 0x24, 0x85, 0x43, 0x13, 0x24, 0x35, 0x55, 0x4b, 0x22,
230 0x11, 0xa2, 0x10, 0x24, 0xf6, 0x57, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x11, 0x24, 0xa4, 0x0a, 0x69, 0x0e, 0x11,
231 0x24, 0x7b, 0x5a, 0x10, 0x24, 0x5e, 0x20, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x11, 0x24, 0x0f, 0x01, 0x59, 0x0e,
232 0x0d, 0x2f, 0x18, 0xa2, 0x11, 0x24, 0x2b, 0x47, 0x10, 0x24, 0xf4, 0x55, 0x48, 0x22, 0x10, 0x24, 0x16, 0x0b, 0x50,
233 0x0e, 0x10, 0x24, 0xc7, 0x51, 0x01, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x11, 0x24, 0x72, 0x0a, 0x51, 0x0e, 0x11, 0x24,
234 0x85, 0x55, 0x10, 0x24, 0xb2, 0x47, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0x83, 0x00, 0x48, 0x0e, 0x53,
235 0x2f, 0x11, 0x24, 0xe1, 0x07, 0x69, 0x0e, 0x2d, 0x2f, 0x95, 0xaf, 0x27, 0x2f, 0x82, 0xaf, 0x21, 0x2f, 0x11, 0x24,
236 0xd7, 0x00, 0x59, 0x0e, 0x19, 0x2f, 0xb1, 0x6f, 0x10, 0x24, 0xcc, 0x03, 0x88, 0x0f, 0x10, 0x2f, 0x10, 0x24, 0xe8,
237 0xfe, 0x08, 0x0e, 0x11, 0x24, 0x7e, 0x56, 0x10, 0x24, 0x94, 0x45, 0x48, 0x22, 0xc0, 0x6f, 0x13, 0x24, 0x06, 0x0b,
238 0x43, 0x0e, 0x10, 0x24, 0x2f, 0x51, 0x01, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0xde, 0x51, 0x80, 0x2e, 0xd7,
239 0xb4, 0x10, 0x24, 0xe8, 0x54, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0xa4, 0x52, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24,
240 0xd0, 0x44, 0x80, 0x2e, 0xd7, 0xb4, 0x11, 0x24, 0xb8, 0x00, 0xd9, 0x0f, 0x19, 0x2f, 0xc1, 0x6f, 0x10, 0x24, 0xe7,
241 0x0c, 0xc8, 0x0f, 0x10, 0x2f, 0x11, 0x24, 0xc7, 0x07, 0x69, 0x0e, 0x11, 0x24, 0xf6, 0x52, 0x10, 0x24, 0x7a, 0x12,
242 0x48, 0x22, 0xb0, 0x6f, 0x13, 0x24, 0x5d, 0x02, 0x03, 0x0e, 0x10, 0x24, 0x7c, 0x54, 0x01, 0x22, 0x80, 0x2e, 0xd7,
243 0xb4, 0x10, 0x24, 0x8d, 0x51, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0x28, 0x52, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24,
244 0xd2, 0x07, 0xe8, 0x0f, 0x28, 0x2f, 0x10, 0x24, 0xb0, 0x00, 0xd8, 0x0f, 0x20, 0x2f, 0x10, 0x24, 0xc6, 0x07, 0x68,
245 0x0e, 0x18, 0x2f, 0x50, 0x35, 0x48, 0x0e, 0x11, 0x2f, 0xb1, 0x6f, 0x10, 0x24, 0xf4, 0x01, 0x08, 0x0e, 0x11, 0x24,
246 0x35, 0x51, 0x10, 0x24, 0x22, 0x12, 0x48, 0x22, 0xc0, 0x6f, 0x13, 0x24, 0xe0, 0x0c, 0x43, 0x0e, 0x10, 0x24, 0x7b,
247 0x50, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0x81, 0x52, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0x3b, 0x53,
248 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0x63, 0x51, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0x27, 0x51, 0x80, 0x2e, 0xd7,
249 0xb4, 0x18, 0xa2, 0x90, 0x2e, 0xdb, 0xb3, 0x12, 0x24, 0x08, 0x02, 0x4a, 0x0e, 0x37, 0x2f, 0x12, 0x24, 0x2a, 0x09,
250 0x6a, 0x0e, 0x1d, 0x2f, 0x13, 0x24, 0x8e, 0x00, 0x73, 0x0e, 0x09, 0x2f, 0x11, 0x24, 0xa5, 0x01, 0x41, 0x0e, 0x11,
251 0x24, 0x76, 0x32, 0x10, 0x24, 0x12, 0x25, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0xa9, 0x0d, 0x68, 0x0e,
252 0x10, 0x24, 0x04, 0x27, 0x13, 0x24, 0x73, 0x20, 0x03, 0x22, 0x13, 0x24, 0x14, 0x04, 0x4b, 0x0e, 0x11, 0x24, 0x15,
253 0x2c, 0x01, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x11, 0x24, 0xae, 0x08, 0x69, 0x0e, 0x08, 0x2f, 0xa1, 0x35, 0x71, 0x0e,
254 0x11, 0x24, 0x8b, 0x2b, 0x10, 0x24, 0x07, 0x35, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x91, 0x34, 0x59, 0x0e, 0x11,
255 0x24, 0x7b, 0x19, 0x10, 0x24, 0x50, 0x59, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x62, 0x32, 0x42, 0x0e, 0x22, 0x2f,
256 0xa2, 0x32, 0x5a, 0x0e, 0x1b, 0x2f, 0x12, 0x24, 0x0b, 0x08, 0x6a, 0x0e, 0x0e, 0x2f, 0xa3, 0x34, 0x43, 0x0e, 0x10,
257 0x24, 0x28, 0x2b, 0x13, 0x24, 0x20, 0x23, 0x03, 0x22, 0x13, 0x24, 0x8d, 0x01, 0x4b, 0x0e, 0x11, 0x24, 0x5c, 0x21,
258 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x31, 0x36, 0x59, 0x0e, 0x11, 0x24, 0x43, 0x25, 0x10, 0x24, 0xfa, 0x49, 0x08,
259 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0xc7, 0x2a, 0x80, 0x2e, 0xd7, 0xb4, 0x40, 0x36, 0x58, 0x0e, 0x09, 0x2f,
260 0x11, 0x24, 0x9e, 0x08, 0x69, 0x0e, 0x11, 0x24, 0xe3, 0x54, 0x10, 0x24, 0x73, 0x22, 0x08, 0x22, 0x80, 0x2e, 0xd7,
261 0xb4, 0x10, 0x24, 0x38, 0x01, 0xc8, 0x0f, 0x10, 0x2f, 0x11, 0x24, 0x11, 0x08, 0x69, 0x0e, 0x11, 0x24, 0x6e, 0x48,
262 0x10, 0x24, 0x2b, 0x28, 0x48, 0x22, 0xc0, 0x6f, 0x13, 0x24, 0xc1, 0x0a, 0x43, 0x0e, 0x10, 0x24, 0x0f, 0x23, 0x08,
263 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0xd0, 0x1a, 0x80, 0x2e, 0xd7, 0xb4, 0xe2, 0x33, 0x5a, 0x0e, 0x77, 0x2f,
264 0x12, 0x24, 0x0c, 0x08, 0x6a, 0x0e, 0x2a, 0x2f, 0x12, 0x24, 0xc5, 0x00, 0x4a, 0x0e, 0x08, 0x2f, 0x11, 0x36, 0x59,
265 0x0e, 0x11, 0x24, 0xfd, 0x18, 0x10, 0x24, 0x75, 0x58, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0xc2, 0x34, 0x5a, 0x0e,
266 0x0d, 0x2f, 0x11, 0x24, 0x36, 0x08, 0x69, 0x0e, 0x11, 0x24, 0x08, 0x58, 0x13, 0x24, 0x3b, 0x54, 0x4b, 0x22, 0x01,
267 0xa2, 0x10, 0x24, 0xc6, 0x52, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0xb3, 0x36, 0x4b, 0x0e, 0x11, 0x24, 0x0e, 0x24,
268 0x13, 0x24, 0x7b, 0x50, 0x59, 0x22, 0x0e, 0xa2, 0x10, 0x24, 0xf7, 0x56, 0x01, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0xc2,
269 0x35, 0x5a, 0x0e, 0x12, 0x2f, 0x01, 0xa2, 0x0c, 0x2f, 0x84, 0xa3, 0x10, 0x24, 0xd4, 0x58, 0x13, 0x24, 0x76, 0x56,
270 0x03, 0x22, 0x73, 0x36, 0x4b, 0x0e, 0x11, 0x24, 0xeb, 0x52, 0x08, 0x22, 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0x87,
271 0x16, 0x80, 0x2e, 0xd7, 0xb4, 0xb0, 0x6f, 0x13, 0x24, 0x02, 0xfd, 0x03, 0x0e, 0x29, 0x2f, 0x84, 0xa3, 0xc0, 0x6f,
272 0x09, 0x2f, 0x11, 0x24, 0xe4, 0x0a, 0x41, 0x0e, 0x11, 0x24, 0x5d, 0x44, 0x10, 0x24, 0x2f, 0x5a, 0x08, 0x22, 0x80,
273 0x2e, 0xd7, 0xb4, 0x13, 0x24, 0x96, 0x0c, 0x43, 0x0e, 0x0e, 0x2f, 0x40, 0x33, 0x48, 0x0e, 0x10, 0x24, 0xf2, 0x18,
274 0x13, 0x24, 0x31, 0x49, 0x03, 0x22, 0x13, 0x24, 0x99, 0x00, 0x4b, 0x0e, 0x11, 0x24, 0xab, 0x18, 0x01, 0x22, 0x80,
275 0x2e, 0xd7, 0xb4, 0x11, 0x24, 0xc6, 0x07, 0x69, 0x0e, 0x11, 0x24, 0xb0, 0x49, 0x10, 0x24, 0xbf, 0x17, 0x08, 0x22,
276 0x80, 0x2e, 0xd7, 0xb4, 0x10, 0x24, 0x03, 0x15, 0x80, 0x2e, 0xd7, 0xb4, 0xb0, 0x32, 0x48, 0x0e, 0x57, 0x2f, 0xa0,
277 0x37, 0x48, 0x0e, 0x13, 0x2f, 0x83, 0xa3, 0x08, 0x2f, 0x10, 0x24, 0xe0, 0x00, 0x48, 0x0e, 0x11, 0x24, 0xf6, 0x25,
278 0x10, 0x24, 0x75, 0x17, 0x71, 0x2c, 0x08, 0x22, 0x10, 0x24, 0xa0, 0x00, 0x48, 0x0e, 0x11, 0x24, 0x7f, 0x18, 0x10,
279 0x24, 0xa6, 0x13, 0x68, 0x2c, 0x08, 0x22, 0x11, 0x24, 0xf9, 0x07, 0x69, 0x0e, 0x0d, 0x2f, 0x11, 0x24, 0x10, 0x08,
280 0x69, 0x0e, 0x11, 0x24, 0xb1, 0x14, 0x10, 0x24, 0x8e, 0x58, 0x48, 0x22, 0x90, 0x32, 0x58, 0x0e, 0x10, 0x24, 0x6d,
281 0x14, 0x56, 0x2c, 0x01, 0x22, 0xc1, 0x6f, 0x10, 0x24, 0x68, 0x0c, 0x48, 0x0e, 0xb1, 0x6f, 0x0c, 0x2f, 0xcd, 0xa2,
282 0x10, 0x24, 0x23, 0x14, 0x13, 0x24, 0x8d, 0x42, 0x03, 0x22, 0x13, 0x24, 0x2a, 0xfd, 0x0b, 0x0e, 0x11, 0x24, 0x53,
283 0x12, 0x43, 0x2c, 0x08, 0x22, 0x10, 0x24, 0xcc, 0x07, 0x68, 0x0e, 0x0e, 0x2f, 0x10, 0x24, 0x08, 0xfd, 0x08, 0x0e,
284 0x10, 0x24, 0x08, 0x16, 0x13, 0x24, 0x83, 0x45, 0x03, 0x22, 0x13, 0x24, 0xa1, 0xfd, 0x0b, 0x0e, 0x11, 0x24, 0xa6,
285 0x14, 0x30, 0x2c, 0x01, 0x22, 0x10, 0x24, 0x5b, 0x01, 0x08, 0x0e, 0x11, 0x24, 0x2f, 0x12, 0x10, 0x24, 0xdd, 0x44,
286 0x27, 0x2c, 0x08, 0x22, 0xdb, 0xa2, 0x0f, 0x2f, 0xc1, 0x6f, 0x10, 0x24, 0xb2, 0x0b, 0x48, 0x0e, 0x11, 0x24, 0x21,
287 0x55, 0x10, 0x24, 0xc8, 0x14, 0x48, 0x22, 0x10, 0x24, 0x4c, 0x08, 0x68, 0x0e, 0x10, 0x24, 0xe4, 0x57, 0x15, 0x2c,
288 0x01, 0x22, 0x44, 0xa2, 0x0f, 0x2f, 0xc1, 0x6f, 0x10, 0x24, 0xcb, 0x0b, 0x48, 0x0e, 0x11, 0x24, 0x09, 0x58, 0x10,
289 0x24, 0xe4, 0x10, 0x48, 0x22, 0x10, 0x24, 0x4d, 0x08, 0x68, 0x0e, 0x10, 0x24, 0x1a, 0x12, 0x03, 0x2c, 0x01, 0x22,
290 0x10, 0x24, 0x0c, 0x10, 0xfb, 0x6f, 0xb0, 0x5f, 0xb8, 0x2e, 0xa3, 0x32, 0xc3, 0x00, 0x60, 0x51, 0xc2, 0x40, 0x81,
291 0x84, 0xd3, 0x7f, 0xd2, 0x42, 0xe0, 0x7f, 0x00, 0x30, 0xc4, 0x40, 0x20, 0x02, 0xc3, 0x7f, 0xd0, 0x42, 0x42, 0x3d,
292 0xc0, 0x40, 0x01, 0x80, 0xc0, 0x42, 0xda, 0x00, 0x93, 0x7f, 0xb1, 0x7f, 0xab, 0x7f, 0x98, 0x2e, 0xb3, 0xc0, 0x91,
293 0x6f, 0xf3, 0x32, 0x40, 0x42, 0x00, 0xac, 0x8b, 0x00, 0x02, 0x2f, 0xe1, 0x6f, 0x39, 0x56, 0x43, 0x42, 0xa1, 0x82,
294 0x91, 0x7f, 0x33, 0x33, 0x4b, 0x00, 0x81, 0x7f, 0x13, 0x3c, 0x4b, 0x00, 0x80, 0x40, 0x53, 0x34, 0xb5, 0x6f, 0x8b,
295 0x00, 0x0d, 0xb0, 0x43, 0x87, 0x76, 0x7f, 0xb2, 0x7f, 0x63, 0x7f, 0x65, 0x25, 0xb5, 0x6f, 0x92, 0x41, 0x63, 0x41,
296 0x64, 0x41, 0x44, 0x81, 0x56, 0x7f, 0x41, 0x7f, 0x00, 0x2e, 0x26, 0x40, 0x27, 0x40, 0x45, 0x41, 0xf7, 0x7f, 0xb0,
297 0x7f, 0x98, 0x2e, 0x67, 0xcc, 0x81, 0x6f, 0x0f, 0xa4, 0x43, 0x40, 0x72, 0x6f, 0x94, 0x6f, 0x05, 0x30, 0x01, 0x2f,
298 0xc0, 0xa0, 0x03, 0x2f, 0x31, 0xac, 0x07, 0x2f, 0xc0, 0xa4, 0x05, 0x2f, 0xa2, 0x00, 0xeb, 0x04, 0x80, 0x40, 0x01,
299 0x80, 0x43, 0x42, 0x80, 0x42, 0x41, 0x86, 0x56, 0x6f, 0x62, 0x6f, 0x41, 0x6f, 0x42, 0x82, 0x72, 0x0e, 0x83, 0x7f,
300 0xd5, 0x2f, 0x53, 0x32, 0x8b, 0x00, 0xa1, 0x86, 0x56, 0x25, 0xf0, 0x82, 0x82, 0x40, 0x8d, 0xb0, 0x52, 0x40, 0xde,
301 0x00, 0x91, 0x7f, 0xb3, 0x7f, 0x85, 0x7f, 0xb3, 0x30, 0x7b, 0x52, 0x98, 0x2e, 0x5a, 0xca, 0x1a, 0x25, 0x83, 0x6f,
302 0x6d, 0x82, 0xfd, 0x88, 0x50, 0x7f, 0x71, 0x7f, 0x81, 0x7f, 0x05, 0x30, 0x83, 0x30, 0x00, 0x30, 0x11, 0x41, 0x52,
303 0x6f, 0x25, 0x7f, 0x30, 0x7f, 0x44, 0x7f, 0x98, 0x2e, 0x0f, 0xca, 0x73, 0x6f, 0x20, 0x25, 0x90, 0x6f, 0x7d, 0x52,
304 0xd2, 0x42, 0x73, 0x7f, 0x12, 0x7f, 0x98, 0x2e, 0x86, 0xb7, 0x93, 0x6f, 0x11, 0x6f, 0xd2, 0x40, 0x0a, 0x18, 0x31,
305 0x6f, 0x0e, 0x00, 0x93, 0x7f, 0x83, 0x30, 0x44, 0x6f, 0x21, 0x6f, 0x62, 0x6f, 0x62, 0x0e, 0x4f, 0x03, 0xe1, 0x2f,
306 0x33, 0x52, 0x01, 0x00, 0x01, 0x30, 0x69, 0x03, 0x3a, 0x25, 0xea, 0x82, 0x92, 0x6f, 0xf0, 0x86, 0xd1, 0xbe, 0x0f,
307 0xb8, 0xbd, 0x84, 0x94, 0x7f, 0x05, 0x0a, 0x23, 0x7f, 0x52, 0x7f, 0x40, 0x7f, 0x31, 0x7f, 0x71, 0x7f, 0xd3, 0x30,
308 0x84, 0x6f, 0x55, 0x6f, 0x10, 0x41, 0x52, 0x41, 0x41, 0x6f, 0x55, 0x7f, 0x10, 0x7f, 0x04, 0x7f, 0x98, 0x2e, 0x0f,
309 0xca, 0x11, 0x6f, 0x20, 0x25, 0x98, 0x2e, 0xfe, 0xc9, 0x31, 0x6f, 0x04, 0x6f, 0x50, 0x42, 0x31, 0x7f, 0xd3, 0x30,
310 0x21, 0x6f, 0x61, 0x0e, 0xea, 0x2f, 0xb1, 0x6f, 0x41, 0x84, 0x32, 0x25, 0x90, 0x40, 0x84, 0x40, 0x71, 0x6f, 0xb4,
311 0x7f, 0x72, 0x7f, 0x40, 0x7f, 0x33, 0x7f, 0x98, 0x2e, 0xb3, 0xc0, 0x53, 0x6f, 0xb1, 0x32, 0x99, 0x00, 0x83, 0xb9,
312 0x41, 0x6f, 0x4b, 0x00, 0xb0, 0x6f, 0x03, 0x30, 0xc3, 0x02, 0x84, 0x40, 0xb2, 0x7f, 0xa1, 0x84, 0x0d, 0xb1, 0x52,
313 0x7f, 0x56, 0x01, 0x74, 0x6f, 0x30, 0x6f, 0x92, 0x6f, 0x43, 0x8b, 0x03, 0x43, 0x01, 0x42, 0x95, 0x7f, 0xbd, 0x86,
314 0x51, 0x41, 0x41, 0x7f, 0x75, 0x7f, 0x00, 0x2e, 0xd1, 0x40, 0x42, 0x41, 0x32, 0x7f, 0x23, 0x7f, 0x98, 0x2e, 0x74,
315 0xc0, 0x41, 0x6f, 0xc8, 0x00, 0x90, 0x6f, 0x01, 0x30, 0x75, 0x6f, 0x32, 0x6f, 0x03, 0x42, 0x91, 0x02, 0x23, 0x6f,
316 0x61, 0x6f, 0x59, 0x0e, 0x62, 0x43, 0x95, 0x7f, 0xe7, 0x2f, 0xb2, 0x6f, 0x51, 0x6f, 0x82, 0x40, 0x8d, 0xb0, 0x8e,
317 0x00, 0xfd, 0x8a, 0xb2, 0x7f, 0x02, 0x30, 0x79, 0x52, 0x05, 0x25, 0x03, 0x30, 0x54, 0x40, 0xec, 0x01, 0x16, 0x40,
318 0x43, 0x89, 0xc7, 0x41, 0x37, 0x18, 0x3d, 0x8b, 0x96, 0x00, 0x44, 0x0e, 0xdf, 0x02, 0xf4, 0x2f, 0x09, 0x52, 0x51,
319 0x00, 0x02, 0x30, 0x9a, 0x02, 0xb5, 0x6f, 0x45, 0x87, 0x1b, 0xba, 0x25, 0xbc, 0x51, 0x6f, 0x4d, 0x8b, 0x7a, 0x82,
320 0xc6, 0x40, 0x20, 0x0a, 0x30, 0x00, 0xd0, 0x42, 0x2b, 0xb5, 0xc0, 0x40, 0x82, 0x02, 0x40, 0x34, 0x08, 0x00, 0xd2,
321 0x42, 0xb0, 0x7f, 0x75, 0x7f, 0x93, 0x7f, 0x00, 0x2e, 0xb5, 0x6f, 0xe2, 0x6f, 0x63, 0x41, 0x64, 0x41, 0x44, 0x8f,
322 0x82, 0x40, 0xe6, 0x41, 0xc0, 0x41, 0xc4, 0x8f, 0x45, 0x41, 0xf0, 0x7f, 0xb7, 0x7f, 0x61, 0x7f, 0x98, 0x2e, 0x67,
323 0xcc, 0x00, 0x18, 0x09, 0x52, 0x71, 0x00, 0x03, 0x30, 0xbb, 0x02, 0x1b, 0xba, 0x93, 0x6f, 0x25, 0xbc, 0x61, 0x6f,
324 0xc5, 0x40, 0x42, 0x82, 0x20, 0x0a, 0x28, 0x00, 0xd0, 0x42, 0x2b, 0xb9, 0xc0, 0x40, 0x82, 0x02, 0xd2, 0x42, 0x93,
325 0x7f, 0x00, 0x2e, 0x72, 0x6f, 0x5a, 0x0e, 0xd9, 0x2f, 0xb1, 0x6f, 0xf3, 0x3c, 0xcb, 0x00, 0xda, 0x82, 0xc3, 0x40,
326 0x41, 0x40, 0x59, 0x0e, 0x50, 0x2f, 0xe1, 0x6f, 0xe3, 0x32, 0xcb, 0x00, 0xb3, 0x7f, 0x22, 0x30, 0xc0, 0x40, 0x01,
327 0x80, 0xc0, 0x42, 0x02, 0xa2, 0x30, 0x2f, 0xc2, 0x42, 0x98, 0x2e, 0x83, 0xb1, 0xe1, 0x6f, 0xb3, 0x35, 0xcb, 0x00,
328 0x24, 0x3d, 0xc2, 0x40, 0xdc, 0x00, 0x84, 0x40, 0x00, 0x91, 0x93, 0x7f, 0x02, 0x2f, 0x00, 0x2e, 0x06, 0x2c, 0x0c,
329 0xb8, 0x30, 0x25, 0x00, 0x33, 0x48, 0x00, 0x98, 0x2e, 0xf6, 0xb6, 0x91, 0x6f, 0x90, 0x7f, 0x00, 0x2e, 0x44, 0x40,
330 0x20, 0x1a, 0x15, 0x2f, 0xd3, 0x6f, 0xc1, 0x6f, 0xc3, 0x40, 0x35, 0x5a, 0x42, 0x40, 0xd3, 0x7e, 0x08, 0xbc, 0x25,
331 0x09, 0xe2, 0x7e, 0xc4, 0x0a, 0x42, 0x82, 0xf3, 0x7e, 0xd1, 0x7f, 0x34, 0x30, 0x83, 0x6f, 0x82, 0x30, 0x31, 0x30,
332 0x98, 0x2e, 0xb3, 0x00, 0xd1, 0x6f, 0x93, 0x6f, 0x43, 0x42, 0xf0, 0x32, 0xb1, 0x6f, 0x41, 0x82, 0xe2, 0x6f, 0x43,
333 0x40, 0xc1, 0x86, 0xc2, 0xa2, 0x43, 0x42, 0x03, 0x30, 0x02, 0x2f, 0x90, 0x00, 0x00, 0x2e, 0x83, 0x42, 0x61, 0x88,
334 0x42, 0x40, 0x8d, 0xb0, 0x26, 0x00, 0x98, 0x2e, 0xd9, 0x03, 0x1c, 0x83, 0x00, 0x2e, 0x43, 0x42, 0x00, 0x2e, 0xab,
335 0x6f, 0xa0, 0x5e, 0xb8, 0x2e, 0xb1, 0x35, 0x40, 0x51, 0x41, 0x01, 0x02, 0x30, 0x1a, 0x25, 0x13, 0x30, 0x40, 0x25,
336 0x12, 0x42, 0x45, 0x0e, 0xfc, 0x2f, 0x65, 0x34, 0x28, 0x80, 0x25, 0x01, 0x13, 0x42, 0x44, 0x0e, 0xfc, 0x2f, 0x27,
337 0x80, 0x65, 0x56, 0x03, 0x42, 0x15, 0x80, 0xa3, 0x30, 0x03, 0x42, 0x04, 0x80, 0x4d, 0x56, 0x7f, 0x58, 0x13, 0x42,
338 0xd4, 0x7e, 0xc2, 0x7e, 0xf2, 0x7e, 0x6c, 0x8c, 0x81, 0x56, 0x83, 0x58, 0xe3, 0x7e, 0x04, 0x7f, 0x71, 0x8a, 0x97,
339 0x41, 0x17, 0x42, 0x75, 0x0e, 0xfb, 0x2f, 0x85, 0x5c, 0x87, 0x5e, 0x16, 0x7f, 0x36, 0x7f, 0x27, 0x7f, 0x00, 0x2e,
340 0x89, 0x5c, 0x8b, 0x5e, 0x46, 0x7f, 0x57, 0x7f, 0x76, 0x8c, 0x57, 0x41, 0x17, 0x42, 0x6e, 0x0e, 0xfb, 0x2f, 0x8d,
341 0x5a, 0x8f, 0x5e, 0x65, 0x7f, 0x87, 0x7f, 0x72, 0x7f, 0x00, 0x2e, 0x91, 0x5a, 0x93, 0x5e, 0x95, 0x7f, 0xa7, 0x7f,
342 0x7b, 0x8a, 0x97, 0x41, 0x17, 0x42, 0x75, 0x0e, 0xfb, 0x2f, 0x7f, 0x5c, 0xb2, 0x7f, 0xc6, 0x7f, 0xd3, 0x7f, 0xe2,
343 0x7f, 0xf4, 0x7f, 0x40, 0x82, 0x52, 0x41, 0x12, 0x42, 0x69, 0x0e, 0xfb, 0x2f, 0xc0, 0x5e, 0xb8, 0x2e, 0x03, 0x2e,
344 0x2d, 0x02, 0x9f, 0xbc, 0x9f, 0xb8, 0x20, 0x50, 0x40, 0xb2, 0x14, 0x2f, 0x10, 0x25, 0x01, 0x2e, 0x8d, 0x00, 0x00,
345 0x90, 0x0b, 0x2f, 0x97, 0x50, 0xf1, 0x7f, 0xeb, 0x7f, 0x98, 0x2e, 0x83, 0xb6, 0x01, 0x2e, 0x8d, 0x00, 0x01, 0x80,
346 0x21, 0x2e, 0x8d, 0x00, 0xf1, 0x6f, 0xeb, 0x6f, 0xe0, 0x5f, 0x97, 0x50, 0x80, 0x2e, 0xda, 0xb4, 0x00, 0x30, 0x21,
347 0x2e, 0x8d, 0x00, 0xe0, 0x5f, 0xb8, 0x2e, 0x41, 0x25, 0x42, 0x8a, 0x50, 0x50, 0x99, 0x52, 0x81, 0x80, 0x99, 0x09,
348 0xf5, 0x7f, 0x52, 0x25, 0x07, 0x52, 0x03, 0x8e, 0xd9, 0x08, 0x02, 0x40, 0x03, 0x81, 0x44, 0x83, 0x6c, 0xbb, 0xda,
349 0x0e, 0xe7, 0x7f, 0xdb, 0x7f, 0x20, 0x2f, 0x02, 0x41, 0x32, 0x1a, 0x1d, 0x2f, 0x42, 0x85, 0x00, 0x2e, 0x82, 0x40,
350 0xda, 0x0e, 0x03, 0x30, 0x05, 0x2f, 0xf1, 0x6f, 0x06, 0x30, 0x42, 0x40, 0x81, 0x84, 0x18, 0x2c, 0x42, 0x42, 0xbf,
351 0x85, 0x82, 0x00, 0x41, 0x40, 0x86, 0x40, 0x81, 0x8d, 0x86, 0x42, 0x20, 0x25, 0x13, 0x30, 0x06, 0x30, 0x97, 0x40,
352 0x81, 0x8d, 0xf9, 0x0f, 0x09, 0x2f, 0x85, 0xa3, 0xf9, 0x2f, 0x03, 0x30, 0x06, 0x2c, 0x06, 0x30, 0x9b, 0x52, 0xd9,
353 0x0e, 0x13, 0x30, 0x01, 0x30, 0xd9, 0x22, 0xc0, 0xb2, 0x12, 0x83, 0xc1, 0x7f, 0x03, 0x30, 0xb4, 0x7f, 0x06, 0x2f,
354 0x51, 0x30, 0x70, 0x25, 0x98, 0x2e, 0xe3, 0x03, 0xff, 0x81, 0x00, 0x2e, 0x03, 0x42, 0x43, 0x8b, 0xe0, 0x6f, 0xf1,
355 0x6f, 0x00, 0x40, 0x41, 0x40, 0xc8, 0x0f, 0x37, 0x2f, 0x00, 0x41, 0x80, 0xa7, 0x3c, 0x2f, 0x01, 0x83, 0x47, 0x8e,
356 0x42, 0x40, 0xfa, 0x01, 0x81, 0x84, 0x08, 0x89, 0x45, 0x41, 0x55, 0x0e, 0xc6, 0x43, 0x42, 0x42, 0xf4, 0x7f, 0x00,
357 0x2f, 0x43, 0x42, 0x51, 0x82, 0x70, 0x1a, 0x41, 0x40, 0x06, 0x2f, 0xc3, 0x6f, 0x41, 0x82, 0xc1, 0x42, 0xcd, 0x0e,
358 0x26, 0x2f, 0xc5, 0x42, 0x25, 0x2d, 0x7f, 0x82, 0x51, 0xbb, 0xa5, 0x00, 0xce, 0x0f, 0x12, 0x2f, 0x14, 0x30, 0x05,
359 0x30, 0xf7, 0x6f, 0x06, 0x30, 0x05, 0x2c, 0xe0, 0x7f, 0xd0, 0x41, 0x05, 0x1a, 0x23, 0x22, 0xb0, 0x01, 0x7a, 0x0e,
360 0xf9, 0x2f, 0x71, 0x0f, 0xe0, 0x6f, 0x28, 0x22, 0x41, 0x8b, 0x71, 0x22, 0x45, 0xa7, 0xee, 0x2f, 0xb3, 0x6f, 0xc2,
361 0x6f, 0xc0, 0x42, 0x81, 0x42, 0x08, 0x2d, 0x04, 0x25, 0xc4, 0x6f, 0x98, 0x2e, 0xea, 0x03, 0x00, 0x2e, 0x40, 0x41,
362 0x00, 0x43, 0x00, 0x30, 0xdb, 0x6f, 0xb0, 0x5f, 0xb8, 0x2e, 0x10, 0x50, 0x03, 0x40, 0x19, 0x18, 0x37, 0x56, 0x19,
363 0x05, 0x36, 0x25, 0xf7, 0x7f, 0x4a, 0x17, 0x54, 0x18, 0xec, 0x18, 0x09, 0x17, 0x01, 0x30, 0x0c, 0x07, 0xe2, 0x18,
364 0xde, 0x00, 0xf2, 0x6f, 0x97, 0x02, 0x33, 0x58, 0xdc, 0x00, 0x91, 0x02, 0xbf, 0xb8, 0x21, 0xbd, 0x8a, 0x0a, 0xc0,
365 0x2e, 0x02, 0x42, 0xf0, 0x5f, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
366 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
367 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
368 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
369 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
370 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
371 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
372 0x80, 0x2e, 0x00, 0xc1, 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, 0x33, 0x58, 0x02, 0x2f, 0x90, 0xa1, 0x26, 0x13, 0x20, 0x23, 0x80, 0x90,
378 0x10, 0x30, 0x01, 0x2f, 0xcc, 0x0e, 0x00, 0x2f, 0x00, 0x30, 0xb8, 0x2e, 0x35, 0x50, 0x18, 0x08, 0x08, 0xbc, 0x88,
379 0xb6, 0x0d, 0x17, 0xc6, 0xbd, 0x56, 0xbc, 0x37, 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, 0x39, 0x50, 0x48, 0x0f, 0x09, 0x2f, 0xbf, 0xa0,
382 0x04, 0x2f, 0xbf, 0x90, 0x06, 0x2f, 0x37, 0x54, 0xca, 0x0f, 0x03, 0x2f, 0x00, 0x2e, 0x02, 0x2c, 0x37, 0x52, 0x39,
383 0x52, 0xf2, 0x33, 0x98, 0x2e, 0xd9, 0xc0, 0xfb, 0x6f, 0xf1, 0x37, 0xc0, 0x2e, 0x01, 0x08, 0xf0, 0x5f, 0x41, 0x56,
384 0x3b, 0x54, 0xd0, 0x40, 0xc4, 0x40, 0x0b, 0x2e, 0xfd, 0xf3, 0x41, 0x52, 0x90, 0x42, 0x94, 0x42, 0x95, 0x42, 0x05,
385 0x30, 0x43, 0x50, 0x0f, 0x88, 0x06, 0x40, 0x04, 0x41, 0x96, 0x42, 0xc5, 0x42, 0x48, 0xbe, 0x73, 0x30, 0x0d, 0x2e,
386 0x88, 0x00, 0x4f, 0xba, 0x84, 0x42, 0x03, 0x42, 0x81, 0xb3, 0x02, 0x2f, 0x2b, 0x2e, 0x6f, 0xf5, 0x06, 0x2d, 0x05,
387 0x2e, 0x77, 0xf7, 0x3f, 0x56, 0x93, 0x08, 0x25, 0x2e, 0x77, 0xf7, 0x3d, 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, 0x45, 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, 0x4f, 0x58, 0x32, 0x87, 0xc4,
395 0x7f, 0x65, 0x89, 0x6b, 0x8d, 0x47, 0x5a, 0x65, 0x7f, 0xe1, 0x7f, 0x83, 0x7f, 0xa6, 0x7f, 0x74, 0x7f, 0xd0, 0x7f,
396 0xb6, 0x7f, 0x94, 0x7f, 0x17, 0x30, 0x49, 0x52, 0x4b, 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, 0x37, 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, 0x55, 0x56, 0x63, 0x0e, 0x74, 0x6f, 0x51, 0x43, 0xa5, 0x7f, 0x8a,
409 0x2f, 0x09, 0x2e, 0x88, 0x00, 0x01, 0xb3, 0x21, 0x2f, 0x4f, 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, 0x51, 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, 0x53, 0x54, 0x5a, 0x0e, 0xef, 0x2f, 0x4d,
415 0x54, 0x09, 0x2e, 0x77, 0xf7, 0x22, 0x0b, 0x29, 0x2e, 0x77, 0xf7, 0xfb, 0x6f, 0x50, 0x5e, 0xb8, 0x2e, 0x10, 0x50,
416 0x01, 0x2e, 0x84, 0x00, 0x00, 0xb2, 0xfb, 0x7f, 0x51, 0x2f, 0x01, 0xb2, 0x48, 0x2f, 0x02, 0xb2, 0x42, 0x2f, 0x03,
417 0x90, 0x56, 0x2f, 0x5b, 0x52, 0x79, 0x80, 0x42, 0x40, 0x81, 0x84, 0x00, 0x40, 0x42, 0x42, 0x98, 0x2e, 0x93, 0x0c,
418 0x5d, 0x54, 0x5b, 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, 0x4d, 0x54, 0x4a, 0x0e,
420 0x3a, 0x2f, 0x3a, 0x82, 0x00, 0x30, 0x41, 0x40, 0x21, 0x2e, 0x6c, 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, 0xba, 0x03,
422 0x61, 0x52, 0x57, 0x54, 0x42, 0x42, 0x4f, 0x84, 0x73, 0x30, 0x5f, 0x52, 0x83, 0x42, 0x1b, 0x30, 0x6b, 0x42, 0x23,
423 0x30, 0x27, 0x2e, 0x87, 0x00, 0x37, 0x2e, 0x84, 0x00, 0x21, 0x2e, 0x86, 0x00, 0x7a, 0x84, 0x17, 0x2c, 0x42, 0x42,
424 0x30, 0x30, 0x21, 0x2e, 0x84, 0x00, 0x12, 0x2d, 0x21, 0x30, 0x00, 0x30, 0x23, 0x2e, 0x84, 0x00, 0x21, 0x2e, 0x7b,
425 0xf7, 0x0b, 0x2d, 0x17, 0x30, 0x98, 0x2e, 0x51, 0x0c, 0x59, 0x50, 0x0c, 0x82, 0x72, 0x30, 0x2f, 0x2e, 0x84, 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, 0x35, 0x56, 0xa5, 0x6f, 0xab, 0x08, 0x91, 0x6f,
428 0x4b, 0x08, 0x63, 0x56, 0xc4, 0x6f, 0x23, 0x09, 0x4d, 0xba, 0x93, 0xbc, 0x8c, 0x0b, 0xd1, 0x6f, 0x0b, 0x09, 0x4f,
429 0x52, 0x65, 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, 0x55, 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, 0x84, 0x00, 0x31, 0x30, 0x08, 0x04, 0xfb, 0x6f, 0x01, 0x30, 0xf0, 0x5f, 0x23, 0x2e, 0x86, 0x00, 0x21, 0x2e,
434 0x87, 0x00, 0xb8, 0x2e, 0x01, 0x2e, 0x87, 0x00, 0x03, 0x2e, 0x86, 0x00, 0x48, 0x0e, 0x01, 0x2f, 0x80, 0x2e, 0x1f,
435 0x0e, 0xb8, 0x2e, 0x67, 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, 0x67, 0x54, 0xf0, 0x3b, 0x83, 0x40, 0xd8, 0x08, 0x69,
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, 0x61, 0x52, 0x00,
439 0x30, 0x40, 0x42, 0x7c, 0x86, 0x3b, 0x52, 0x09, 0x2e, 0x57, 0x0f, 0x41, 0x54, 0xc4, 0x42, 0xd3, 0x86, 0x54, 0x40,
440 0x55, 0x40, 0x94, 0x42, 0x85, 0x42, 0x21, 0x2e, 0x87, 0x00, 0x42, 0x40, 0x25, 0x2e, 0xfd, 0xf3, 0xc0, 0x42, 0x7e,
441 0x82, 0x05, 0x2e, 0x79, 0x00, 0x80, 0xb2, 0x14, 0x2f, 0x05, 0x2e, 0x24, 0x02, 0x27, 0xbd, 0x2f, 0xb9, 0x80, 0x90,
442 0x02, 0x2f, 0x21, 0x2e, 0x6f, 0xf5, 0x0c, 0x2d, 0x07, 0x2e, 0x58, 0x0f, 0x14, 0x30, 0x1c, 0x09, 0x05, 0x2e, 0x77,
443 0xf7, 0x3f, 0x56, 0x47, 0xbe, 0x93, 0x08, 0x94, 0x0a, 0x25, 0x2e, 0x77, 0xf7, 0x6b, 0x54, 0x50, 0x42, 0x4a, 0x0e,
444 0xfc, 0x2f, 0xb8, 0x2e, 0x50, 0x50, 0x02, 0x30, 0x43, 0x86, 0x69, 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, 0x6d, 0x0f, 0x40, 0x90, 0x11, 0x30, 0x03, 0x2f, 0x23, 0x2e, 0x6d, 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, 0x6f, 0x58, 0xc2, 0x6f, 0x94, 0x09,
450 0x71, 0x58, 0x6a, 0xbb, 0xdc, 0x08, 0xb4, 0xb9, 0xb1, 0xbd, 0x6d, 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 0x75, 0x52, 0x93, 0x30, 0x53, 0x42, 0xfb, 0x7f, 0x7b, 0x30, 0x4b, 0x42, 0x13, 0x30, 0x42, 0x82, 0x20, 0x33, 0x43,
453 0x42, 0xc8, 0x00, 0x01, 0x2e, 0x80, 0x03, 0x05, 0x2e, 0x7d, 0x00, 0x19, 0x52, 0xe2, 0x7f, 0xd0, 0x7f, 0xc3, 0x7f,
454 0x98, 0x2e, 0xb6, 0x0e, 0xd1, 0x6f, 0x48, 0x0a, 0xd1, 0x7f, 0x3a, 0x25, 0xfb, 0x86, 0x01, 0x33, 0x12, 0x30, 0x98,
455 0x2e, 0xc2, 0xc4, 0xd1, 0x6f, 0x48, 0x0a, 0x40, 0xb2, 0x0d, 0x2f, 0xe0, 0x6f, 0x03, 0x2e, 0x80, 0x03, 0x53, 0x30,
456 0x07, 0x80, 0x27, 0x2e, 0x21, 0xf2, 0x98, 0xbc, 0x01, 0x42, 0x98, 0x2e, 0x91, 0x03, 0x00, 0x2e, 0x00, 0x2e, 0xd0,
457 0x2e, 0xb1, 0x6f, 0x9b, 0xb8, 0x07, 0x2e, 0x1b, 0x00, 0x19, 0x1a, 0xb1, 0x7f, 0x71, 0x30, 0x04, 0x2f, 0x23, 0x2e,
458 0x21, 0xf2, 0x00, 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0x98, 0x2e, 0x6d, 0xc0, 0x98, 0x2e, 0x5d, 0xc0, 0x98, 0x2e, 0xdf,
459 0x03, 0x20, 0x26, 0xc1, 0x6f, 0x02, 0x31, 0x52, 0x42, 0xab, 0x30, 0x4b, 0x42, 0x20, 0x33, 0x77, 0x56, 0xf1, 0x37,
460 0xc4, 0x40, 0xa2, 0x0a, 0xc2, 0x42, 0xd8, 0x00, 0x01, 0x2e, 0x5e, 0xf7, 0x41, 0x08, 0x23, 0x2e, 0x94, 0x00, 0xe3,
461 0x7f, 0x98, 0x2e, 0xaa, 0x01, 0xe1, 0x6f, 0x83, 0x30, 0x43, 0x42, 0x03, 0x30, 0xfb, 0x6f, 0x73, 0x50, 0x02, 0x30,
462 0x00, 0x2e, 0x00, 0x2e, 0x81, 0x84, 0x50, 0x0e, 0xfa, 0x2f, 0x43, 0x42, 0x11, 0x30, 0xb0, 0x5f, 0x23, 0x2e, 0x21,
463 0xf2, 0xb8, 0x2e, 0xc1, 0x4a, 0x00, 0x00, 0x6d, 0x57, 0x00, 0x00, 0x77, 0x8e, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff,
464 0xd3, 0xff, 0xff, 0xff, 0xe5, 0xff, 0xff, 0xff, 0xee, 0xe1, 0xff, 0xff, 0x7c, 0x13, 0x00, 0x00, 0x46, 0xe6, 0xff,
465 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
466 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
467 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
468 0x00, 0x00, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
469 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
470 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
471 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
472 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
473 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
474 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
475 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
476 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
477 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
478 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
479 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
480 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
481 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
482 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
483 0xc1, 0xfd, 0x2d
486 /*! @name Global array that stores the feature input configuration of
487 * BMI270_CONTEXT
489 const struct bmi2_feature_config bmi270_context_feat_in[BMI270_CONTEXT_MAX_FEAT_IN] = {
490 { .type = BMI2_CONFIG_ID, .page = BMI2_PAGE_4, .start_addr = BMI270_CONTEXT_CONFIG_ID_STRT_ADDR },
491 { .type = BMI2_STEP_COUNTER_PARAMS, .page = BMI2_PAGE_1, .start_addr = BMI270_CONTEXT_STEP_CNT_1_STRT_ADDR },
492 { .type = BMI2_STEP_DETECTOR, .page = BMI2_PAGE_4, .start_addr = BMI270_CONTEXT_STEP_CNT_4_STRT_ADDR },
493 { .type = BMI2_STEP_COUNTER, .page = BMI2_PAGE_4, .start_addr = BMI270_CONTEXT_STEP_CNT_4_STRT_ADDR },
494 { .type = BMI2_NVM_PROG_PREP, .page = BMI2_PAGE_4, .start_addr = BMI270_CONTEXT_NVM_PROG_PREP_STRT_ADDR },
495 { .type = BMI2_MAX_BURST_LEN, .page = BMI2_PAGE_4, .start_addr = BMI270_CONTEXT_MAX_BURST_LEN_STRT_ADDR },
496 { .type = BMI2_CRT_GYRO_SELF_TEST, .page = BMI2_PAGE_4, .start_addr = BMI270_CONTEXT_CRT_GYRO_SELF_TEST_STRT_ADDR },
497 { .type = BMI2_ABORT_CRT_GYRO_SELF_TEST, .page = BMI2_PAGE_4, .start_addr = BMI270_CONTEXT_ABORT_STRT_ADDR },
498 { .type = BMI2_ACTIVITY_RECOGNITION_SETTINGS, .page = BMI2_PAGE_5,
499 .start_addr = BMI270_CONTEXT_ACT_RGN_SETT_STRT_ADDR },
500 { .type = BMI2_ACTIVITY_RECOGNITION, .page = BMI2_PAGE_5, .start_addr = BMI270_CONTEXT_ACT_RGN_STRT_ADDR },
503 /*! @name Global array that stores the feature output configuration */
504 const struct bmi2_feature_config bmi270_context_feat_out[BMI270_CONTEXT_MAX_FEAT_OUT] = {
505 { .type = BMI2_STEP_COUNTER, .page = BMI2_PAGE_0, .start_addr = BMI270_CONTEXT_STEP_CNT_OUT_STRT_ADDR },
506 { .type = BMI2_GYRO_CROSS_SENSE, .page = BMI2_PAGE_0, .start_addr = BMI270_CONTEXT_GYRO_CROSS_SENSE_STRT_ADDR },
507 { .type = BMI2_GYRO_GAIN_UPDATE, .page = BMI2_PAGE_0, .start_addr = BMI270_CONTEXT_GYR_USER_GAIN_OUT_STRT_ADDR },
508 { .type = BMI2_NVM_STATUS, .page = BMI2_PAGE_0, .start_addr = BMI270_CONTEXT_NVM_VFRM_OUT_STRT_ADDR },
509 { .type = BMI2_VFRM_STATUS, .page = BMI2_PAGE_0, .start_addr = BMI270_CONTEXT_NVM_VFRM_OUT_STRT_ADDR }
512 /*! @name Global array that stores the feature interrupts of BMI270_CONTEXT */
513 struct bmi2_map_int bmi270_c_map_int[BMI270_C_MAX_INT_MAP] = {
514 { .type = BMI2_STEP_COUNTER, .sens_map_int = BMI270_C_INT_STEP_COUNTER_MASK },
515 { .type = BMI2_STEP_DETECTOR, .sens_map_int = BMI270_C_INT_STEP_DETECTOR_MASK },
518 /******************************************************************************/
520 /*! Local Function Prototypes
521 ******************************************************************************/
524 * @brief This internal API is used to validate the device pointer for
525 * null conditions.
527 * @param[in] dev : Structure instance of bmi2_dev.
529 * @return Result of API execution status
530 * @retval 0 -> Success
531 * @retval < 0 -> Fail
533 static int8_t null_ptr_check(const struct bmi2_dev *dev);
536 * @brief This internal API enables the selected sensor/features.
538 * @param[in] sensor_sel : Selects the desired sensor.
539 * @param[in, out] 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 sensor_enable(uint64_t sensor_sel, struct bmi2_dev *dev);
548 * @brief This internal API disables 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_disable(uint64_t sensor_sel, struct bmi2_dev *dev);
560 * @brief This internal API selects the sensors/features to be enabled or
561 * disabled.
563 * @param[in] sens_list : Pointer to select the sensor.
564 * @param[in] n_sens : Number of sensors selected.
565 * @param[out] sensor_sel : Gets the selected sensor.
567 * @return Result of API execution status
568 * @retval 0 -> Success
569 * @retval < 0 -> Fail
571 static int8_t select_sensor(const uint8_t *sens_list, uint8_t n_sens, uint64_t *sensor_sel);
574 * @brief This internal API is used to enable/disable step detector feature.
576 * @param[in] dev : Structure instance of bmi2_dev.
577 * @param[in] enable : Enables/Disables step-detector.
579 * Enable | Description
580 * -------------|---------------
581 * BMI2_DISABLE | Disables step detector
582 * BMI2_ENABLE | Enables step detector
584 * @return Result of API execution status
585 * @retval 0 -> Success
586 * @retval < 0 -> Fail
588 static int8_t set_step_detector(uint8_t enable, struct bmi2_dev *dev);
591 * @brief This internal API is used to enable/disable step counter feature.
593 * @param[in] dev : Structure instance of bmi2_dev.
594 * @param[in] enable : Enables/Disables step counter.
596 * Enable | Description
597 * -------------|---------------
598 * BMI2_DISABLE | Disables step counter
599 * BMI2_ENABLE | Enables step counter
601 * @return Result of API execution status
602 * @retval 0 -> Success
603 * @retval < 0 -> Fail
605 static int8_t set_step_counter(uint8_t enable, struct bmi2_dev *dev);
608 * @brief This internal API is used to enable/disable gyroscope user gain
609 * feature.
611 * @param[in] dev : Structure instance of bmi2_dev.
612 * @param[in] enable : Enables/Disables gyroscope user gain.
614 * Enable | Description
615 * -------------|---------------
616 * BMI2_DISABLE | Disables gyroscope user gain
617 * BMI2_ENABLE | Enables gyroscope user gain
619 * @return Result of API execution status
620 * @retval 0 -> Success
621 * @retval < 0 -> Fail
623 static int8_t set_gyro_user_gain(uint8_t enable, struct bmi2_dev *dev);
626 * @brief This internal API enables/disables the activity recognition feature.
628 * @param[in] enable : Enables/Disables activity recognition.
629 * @param[in] dev : Structure instance of bmi2_dev.
631 * enable | Description
632 * -------------|---------------
633 * BMI2_ENABLE | Enables activity recognition.
634 * BMI2_DISABLE | Disables activity recognition.
636 * @return Result of API execution status
637 * @retval 0 -> Success
638 * @retval < 0 -> Fail
640 static int8_t set_act_recog(uint8_t enable, struct bmi2_dev *dev);
643 * @brief This internal API sets step counter parameter configurations.
645 * @param[in] step_count_params : Array that stores parameters 1 to 25.
646 * @param[in] dev : Structure instance of bmi2_dev.
648 * @return Result of API execution status
649 * @retval 0 -> Success
650 * @retval < 0 -> Fail
652 static int8_t set_step_count_params_config(const uint16_t *step_count_params, struct bmi2_dev *dev);
655 * @brief This internal API sets step counter/detector/activity configurations.
657 * @param[in] config : Structure instance of bmi2_step_config.
658 * @param[in] dev : Structure instance of bmi2_dev.
660 *---------------------------------------------------------------------------
661 * bmi2_step_config |
662 * Structure parameters | Description
663 *--------------------------|--------------------------------------------------
664 * | The Step-counter will trigger output every time
665 * | the number of steps are counted. Holds implicitly
666 * water-mark level | a 20x factor, so the range is 0 to 10230,
667 * | with resolution of 20 steps.
668 * -------------------------|---------------------------------------------------
669 * reset counter | Flag to reset the counted steps.
670 * -------------------------|---------------------------------------------------
671 * @endverbatim
673 * @return Result of API execution status
674 * @retval 0 -> Success
675 * @retval < 0 -> Fail
677 static int8_t set_step_config(const struct bmi2_step_config *config, struct bmi2_dev *dev);
680 * @brief This internal API gets step counter parameter configurations.
682 * @param[in] step_count_params : Array that stores parameters 1 to 25.
683 * @param[in] dev : Structure instance of bmi2_dev.
685 * @return Result of API execution status
686 * @retval 0 -> Success
687 * @retval < 0 -> Fail
689 static int8_t get_step_count_params_config(uint16_t *step_count_params, struct bmi2_dev *dev);
692 * @brief This internal API gets step counter/detector/activity configurations.
694 * @param[out] config : Structure instance of bmi2_step_config.
695 * @param[in] dev : Structure instance of bmi2_dev.
697 * @verbatim
698 *----------------------------------------------------------------------------
699 * bmi2_step_config |
700 * Structure parameters | Description
701 *--------------------------|--------------------------------------------------
702 * | The Step-counter will trigger output every time
703 * | the number of steps are counted. Holds implicitly
704 * water-mark level | a 20x factor, so the range is 0 to 10230,
705 * | with resolution of 20 steps.
706 * -------------------------|---------------------------------------------------
707 * reset counter | Flag to reset the counted steps.
708 * -------------------------|---------------------------------------------------
709 * @endverbatim
711 * @return Result of API execution status
712 * @retval 0 -> Success
713 * @retval < 0 -> Fail
715 static int8_t get_step_config(struct bmi2_step_config *config, struct bmi2_dev *dev);
718 * @brief This internal API is used to parse and store the activity recognition
719 * output from the FIFO data.
721 * @param[out] act_recog : Structure to retrieve output of activity
722 * recognition frame.
723 * @param[in] data_index : Index of the FIFO data which contains
724 * activity recognition frame.
725 * @param[out] fifo : Structure instance of bmi2_dev.
727 * @return Result of API execution status
728 * @retval 0 -> Success
729 * @retval < 0 -> Fail
731 static int8_t unpack_act_recog_output(struct bmi2_act_recog_output *act_recog,
732 uint16_t *data_index,
733 const struct bmi2_fifo_frame *fifo);
736 * @brief This internal API gets the output values of step counter.
738 * @param[out] step_count : Pointer to the stored step counter data.
739 * @param[in] dev : Structure instance of bmi2_dev.
741 * @return Result of API execution status
742 * @retval 0 -> Success
743 * @retval < 0 -> Fail
745 static int8_t get_step_counter_output(uint32_t *step_count, struct bmi2_dev *dev);
748 * @brief This internal API gets the error status related to NVM.
750 * @param[out] nvm_err_stat : Stores the NVM error status.
751 * @param[in] dev : Structure instance of bmi2_dev.
753 * @return Result of API execution status
754 * @retval 0 -> Success
755 * @retval < 0 -> Fail
757 static int8_t get_nvm_error_status(struct bmi2_nvm_err_status *nvm_err_stat, struct bmi2_dev *dev);
760 * @brief This internal API gets the error status related to virtual frames.
762 * @param[out] vfrm_err_stat : Stores the VFRM related error status.
763 * @param[in] dev : Structure instance of bmi2_dev.
765 * @return Result of API execution status
766 * @retval 0 -> Success
767 * @retval < 0 -> Fail
769 static int8_t get_vfrm_error_status(struct bmi2_vfrm_err_status *vfrm_err_stat, struct bmi2_dev *dev);
772 * @brief This internal API is used to get enable status of gyroscope user gain
773 * update.
775 * @param[out] status : Stores status of gyroscope user gain update.
776 * @param[in] dev : Structure instance of bmi2_dev.
778 * @return Result of API execution status
779 * @retval 0 -> Success
780 * @retval < 0 -> Fail
782 static int8_t get_user_gain_upd_status(uint8_t *status, struct bmi2_dev *dev);
785 * @brief This internal API skips S4S frame in the FIFO data while getting
786 * activity recognition output.
788 * @param[in, out] frame_header : FIFO frame header.
789 * @param[in, out] data_index : Index value of the FIFO data bytes
790 * from which S4S frame header is to be
791 * skipped.
792 * @param[in] fifo : Structure instance of bmi2_fifo_frame.
794 * @return Result of API execution status
795 * @retval 0 -> Success
796 * @retval < 0 -> Fail
798 static int8_t move_if_s4s_frame(const uint8_t *frame_header, uint16_t *data_index, const struct bmi2_fifo_frame *fifo);
801 * @brief This internal API enables/disables compensation of the gain defined
802 * in the GAIN register.
804 * @param[in] enable : Enables/Disables gain compensation
805 * @param[in] dev : Structure instance of bmi2_dev.
807 * enable | Description
808 * -------------|---------------
809 * BMI2_ENABLE | Enable gain compensation.
810 * BMI2_DISABLE | Disable gain compensation.
812 * @return Result of API execution status
813 * @retval 0 -> Success
814 * @retval < 0 -> Fail
816 static int8_t enable_gyro_gain(uint8_t enable, struct bmi2_dev *dev);
819 * @brief This internal API is used to extract the output feature configuration
820 * details like page and start address from the look-up table.
822 * @param[out] feat_output : Structure that stores output feature
823 * configurations.
824 * @param[in] type : Type of feature or sensor.
825 * @param[in] dev : Structure instance of bmi2_dev.
827 * @return Returns the feature found flag.
829 * @retval BMI2_FALSE : Feature not found
830 * BMI2_TRUE : Feature found
832 static uint8_t extract_output_feat_config(struct bmi2_feature_config *feat_output,
833 uint8_t type,
834 const struct bmi2_dev *dev);
837 * @brief This internal API is used to move the data index ahead of the
838 * current frame length parameter when unnecessary FIFO data appears while
839 * extracting the user specified data.
841 * @param[in,out] data_index : Index of the FIFO data which is to be
842 * moved ahead of the current frame length
843 * @param[in] current_frame_length : Number of bytes in the current frame.
844 * @param[in] fifo : Structure instance of bmi2_fifo_frame.
846 * @return Result of API execution status
847 * @retval 0 -> Success
848 * @retval < 0 -> Fail
850 static int8_t move_next_frame(uint16_t *data_index, uint8_t current_frame_length, const struct bmi2_fifo_frame *fifo);
852 /***************************************************************************/
854 /*! User Interface Definitions
855 ****************************************************************************/
858 * @brief This API:
859 * 1) Updates the device structure with address of the configuration file.
860 * 2) Initializes BMI270_CONTEXT sensor.
861 * 3) Writes the configuration file.
862 * 4) Updates the feature offset parameters in the device structure.
863 * 5) Updates the maximum number of pages, in the device structure.
865 int8_t bmi270_context_init(struct bmi2_dev *dev)
867 /* Variable to define error */
868 int8_t rslt;
870 /* Null-pointer check */
871 rslt = null_ptr_check(dev);
872 if (rslt == BMI2_OK)
874 /* Assign chip id of BMI270_CONTEXT */
875 dev->chip_id = BMI270_CONTEXT_CHIP_ID;
877 /* Get the size of config array */
878 dev->config_size = sizeof(bmi270_context_config_file);
880 /* Enable the variant specific features if any */
881 dev->variant_feature = BMI2_CRT_RTOSK_ENABLE | BMI2_GYRO_CROSS_SENS_ENABLE;
883 /* An extra dummy byte is read during SPI read */
884 if (dev->intf == BMI2_SPI_INTF)
886 dev->dummy_byte = 1;
888 else
890 dev->dummy_byte = 0;
893 /* If configuration file pointer is not assigned any address */
894 if (!dev->config_file_ptr)
896 /* Give the address of the configuration file array to
897 * the device pointer
899 dev->config_file_ptr = bmi270_context_config_file;
902 /* Initialize BMI2 sensor */
903 rslt = bmi2_sec_init(dev);
904 if (rslt == BMI2_OK)
906 /* Assign the offsets of the feature input
907 * configuration to the device structure
909 dev->feat_config = bmi270_context_feat_in;
911 /* Assign the offsets of the feature output to
912 * the device structure
914 dev->feat_output = bmi270_context_feat_out;
916 /* Assign the maximum number of pages to the
917 * device structure
919 dev->page_max = BMI270_CONTEXT_MAX_PAGE_NUM;
921 /* Assign maximum number of input sensors/
922 * features to device structure
924 dev->input_sens = BMI270_CONTEXT_MAX_FEAT_IN;
926 /* Assign maximum number of output sensors/
927 * features to device structure
929 dev->out_sens = BMI270_CONTEXT_MAX_FEAT_OUT;
931 /* Assign the offsets of the feature interrupt
932 * to the device structure
934 dev->map_int = bmi270_c_map_int;
936 /* Assign maximum number of feature interrupts
937 * to device structure
939 dev->sens_int_map = BMI270_C_MAX_INT_MAP;
943 return rslt;
947 * @brief This API selects the sensors/features to be enabled.
949 int8_t bmi270_context_sensor_enable(const uint8_t *sens_list, uint8_t n_sens, struct bmi2_dev *dev)
951 /* Variable to define error */
952 int8_t rslt;
954 /* Variable to select sensor */
955 uint64_t sensor_sel = 0;
957 /* Null-pointer check */
958 rslt = null_ptr_check(dev);
959 if ((rslt == BMI2_OK) && (sens_list != NULL))
961 /* Get the selected sensors */
962 rslt = select_sensor(sens_list, n_sens, &sensor_sel);
963 if (rslt == BMI2_OK)
965 /* Enable the selected sensors */
966 rslt = sensor_enable(sensor_sel, dev);
969 else
971 rslt = BMI2_E_NULL_PTR;
974 return rslt;
978 * @brief This API selects the sensors/features to be disabled.
980 int8_t bmi270_context_sensor_disable(const uint8_t *sens_list, uint8_t n_sens, struct bmi2_dev *dev)
982 /* Variable to define error */
983 int8_t rslt;
985 /* Variable to select sensor */
986 uint64_t sensor_sel = 0;
988 /* Null-pointer check */
989 rslt = null_ptr_check(dev);
990 if ((rslt == BMI2_OK) && (sens_list != NULL))
992 /* Get the selected sensors */
993 rslt = select_sensor(sens_list, n_sens, &sensor_sel);
994 if (rslt == BMI2_OK)
996 /* Disable the selected sensors */
997 rslt = sensor_disable(sensor_sel, dev);
1000 else
1002 rslt = BMI2_E_NULL_PTR;
1005 return rslt;
1009 * @brief This API sets the sensor/feature configuration.
1011 int8_t bmi270_context_set_sensor_config(struct bmi2_sens_config *sens_cfg, uint8_t n_sens, struct bmi2_dev *dev)
1013 /* Variable to define error */
1014 int8_t rslt;
1016 /* Variable to define loop */
1017 uint8_t loop;
1019 /* Variable to get the status of advance power save */
1020 uint8_t aps_stat = 0;
1022 /* Null-pointer check */
1023 rslt = null_ptr_check(dev);
1024 if ((rslt == BMI2_OK) && (sens_cfg != NULL))
1026 /* Get status of advance power save mode */
1027 aps_stat = dev->aps_status;
1029 for (loop = 0; loop < n_sens; loop++)
1031 if ((sens_cfg[loop].type == BMI2_ACCEL) || (sens_cfg[loop].type == BMI2_GYRO) ||
1032 (sens_cfg[loop].type == BMI2_AUX) || (sens_cfg[loop].type == BMI2_GYRO_GAIN_UPDATE))
1034 rslt = bmi2_set_sensor_config(&sens_cfg[loop], 1, dev);
1036 else
1038 /* Disable Advance power save if enabled for auxiliary
1039 * and feature configurations
1041 if (aps_stat == BMI2_ENABLE)
1043 /* Disable advance power save if
1044 * enabled
1046 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1049 if (rslt == BMI2_OK)
1051 switch (sens_cfg[loop].type)
1053 /* Set the step counter parameters */
1054 case BMI2_STEP_COUNTER_PARAMS:
1055 rslt = set_step_count_params_config(sens_cfg[loop].cfg.step_counter_params, dev);
1056 break;
1058 /* Set step counter/detector/activity configuration */
1059 case BMI2_STEP_DETECTOR:
1060 case BMI2_STEP_COUNTER:
1061 rslt = set_step_config(&sens_cfg[loop].cfg.step_counter, dev);
1062 break;
1064 default:
1065 rslt = BMI2_E_INVALID_SENSOR;
1066 break;
1070 /* Return error if any of the set configurations fail */
1071 if (rslt != BMI2_OK)
1073 break;
1078 /* Enable Advance power save if disabled while configuring and
1079 * not when already disabled
1081 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
1083 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
1086 else
1088 rslt = BMI2_E_NULL_PTR;
1091 return rslt;
1095 * @brief This API gets the sensor/feature configuration.
1097 int8_t bmi270_context_get_sensor_config(struct bmi2_sens_config *sens_cfg, uint8_t n_sens, struct bmi2_dev *dev)
1099 /* Variable to define error */
1100 int8_t rslt;
1102 /* Variable to define loop */
1103 uint8_t loop;
1105 /* Variable to get the status of advance power save */
1106 uint8_t aps_stat = 0;
1108 /* Null-pointer check */
1109 rslt = null_ptr_check(dev);
1110 if ((rslt == BMI2_OK) && (sens_cfg != NULL))
1112 /* Get status of advance power save mode */
1113 aps_stat = dev->aps_status;
1114 for (loop = 0; loop < n_sens; loop++)
1116 if ((sens_cfg[loop].type == BMI2_ACCEL) || (sens_cfg[loop].type == BMI2_GYRO) ||
1117 (sens_cfg[loop].type == BMI2_AUX) || (sens_cfg[loop].type == BMI2_GYRO_GAIN_UPDATE))
1119 rslt = bmi2_get_sensor_config(&sens_cfg[loop], 1, dev);
1121 else
1123 /* Disable Advance power save if enabled for auxiliary
1124 * and feature configurations
1126 if ((sens_cfg[loop].type >= BMI2_MAIN_SENS_MAX_NUM) || (sens_cfg[loop].type == BMI2_AUX))
1129 if (aps_stat == BMI2_ENABLE)
1131 /* Disable advance power save if
1132 * enabled
1134 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1138 if (rslt == BMI2_OK)
1140 switch (sens_cfg[loop].type)
1142 /* Set the step counter parameters */
1143 case BMI2_STEP_COUNTER_PARAMS:
1144 rslt = get_step_count_params_config(sens_cfg[loop].cfg.step_counter_params, dev);
1145 break;
1147 /* Get step counter/detector/activity configuration */
1148 case BMI2_STEP_DETECTOR:
1149 case BMI2_STEP_COUNTER:
1150 rslt = get_step_config(&sens_cfg[loop].cfg.step_counter, dev);
1151 break;
1153 default:
1154 rslt = BMI2_E_INVALID_SENSOR;
1155 break;
1159 /* Return error if any of the get configurations fail */
1160 if (rslt != BMI2_OK)
1162 break;
1167 /* Enable Advance power save if disabled while configuring and
1168 * not when already disabled
1170 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
1172 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
1175 else
1177 rslt = BMI2_E_NULL_PTR;
1180 return rslt;
1184 * @brief This API gets the sensor/feature data for accelerometer, gyroscope,
1185 * auxiliary sensor, step counter, high-g, gyroscope user-gain update,
1186 * orientation, gyroscope cross sensitivity and error status for NVM and VFRM.
1188 int8_t bmi270_context_get_sensor_data(struct bmi2_sensor_data *sensor_data, uint8_t n_sens, struct bmi2_dev *dev)
1190 /* Variable to define error */
1191 int8_t rslt;
1193 /* Variable to define loop */
1194 uint8_t loop;
1196 /* Variable to get the status of advance power save */
1197 uint8_t aps_stat = 0;
1199 /* Null-pointer check */
1200 rslt = null_ptr_check(dev);
1201 if ((rslt == BMI2_OK) && (sensor_data != NULL))
1203 /* Get status of advance power save mode */
1204 aps_stat = dev->aps_status;
1205 for (loop = 0; loop < n_sens; loop++)
1207 if ((sensor_data[loop].type == BMI2_ACCEL) || (sensor_data[loop].type == BMI2_GYRO) ||
1208 (sensor_data[loop].type == BMI2_AUX) || (sensor_data[loop].type == BMI2_GYRO_GAIN_UPDATE) ||
1209 (sensor_data[loop].type == BMI2_GYRO_CROSS_SENSE))
1211 rslt = bmi2_get_sensor_data(&sensor_data[loop], 1, dev);
1213 else
1215 /* Disable Advance power save if enabled for feature
1216 * configurations
1218 if (sensor_data[loop].type >= BMI2_MAIN_SENS_MAX_NUM)
1220 if (aps_stat == BMI2_ENABLE)
1222 /* Disable advance power save if
1223 * enabled
1225 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1229 if (rslt == BMI2_OK)
1231 switch (sensor_data[loop].type)
1233 case BMI2_STEP_COUNTER:
1235 /* Get step counter output */
1236 rslt = get_step_counter_output(&sensor_data[loop].sens_data.step_counter_output, dev);
1237 break;
1238 case BMI2_NVM_STATUS:
1240 /* Get NVM error status */
1241 rslt = get_nvm_error_status(&sensor_data[loop].sens_data.nvm_status, dev);
1242 break;
1243 case BMI2_VFRM_STATUS:
1245 /* Get VFRM error status */
1246 rslt = get_vfrm_error_status(&sensor_data[loop].sens_data.vfrm_status, dev);
1247 break;
1248 default:
1249 rslt = BMI2_E_INVALID_SENSOR;
1250 break;
1253 /* Return error if any of the get sensor data fails */
1254 if (rslt != BMI2_OK)
1256 break;
1261 /* Enable Advance power save if disabled while
1262 * configuring and not when already disabled
1264 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
1266 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
1270 else
1272 rslt = BMI2_E_NULL_PTR;
1275 return rslt;
1279 * @brief This api is used for retrieving the activity recognition settings currently set.
1281 int8_t bmi270_context_get_act_recg_sett(struct bmi2_act_recg_sett *sett, struct bmi2_dev *dev)
1283 /* Variable to define error */
1284 int8_t rslt;
1286 /* Array to define the feature configuration */
1287 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
1289 /* Variable to define the array offset */
1290 uint8_t idx = 0;
1292 /* Variable to get the status of advance power save */
1293 uint8_t aps_stat;
1295 /* Variable to set flag */
1296 uint8_t feat_found;
1297 uint16_t msb_lsb;
1298 uint8_t lsb;
1299 uint8_t msb;
1301 /* Initialize feature configuration for activity recognition */
1302 struct bmi2_feature_config bmi2_act_recg_sett = { 0, 0, 0 };
1304 /* Null-pointer check */
1305 rslt = null_ptr_check(dev);
1306 if (rslt == BMI2_OK)
1309 /* Search for bmi2 Abort feature and extract its configuration details */
1310 feat_found = bmi2_extract_input_feat_config(&bmi2_act_recg_sett, BMI2_ACTIVITY_RECOGNITION_SETTINGS, dev);
1311 if (feat_found)
1313 aps_stat = dev->aps_status;
1314 if (aps_stat == BMI2_ENABLE)
1316 /* Disable advance power save if enabled */
1317 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1320 /* Get the configuration from the page where activity recognition setting feature resides */
1321 if (rslt == BMI2_OK)
1323 rslt = bmi2_get_feat_config(bmi2_act_recg_sett.page, feat_config, dev);
1326 if (rslt == BMI2_OK)
1328 /* Define the offset in bytes */
1329 idx = bmi2_act_recg_sett.start_addr;
1331 /* get the status of enable/disable post processing */
1332 sett->act_rec_1 = BMI2_GET_BIT_POS0(feat_config[idx], BMI2_ACT_RECG_POST_PROS_EN_DIS);
1334 /* increment idx by 2 to point min gdi thres addres */
1335 idx = idx + 2;
1336 lsb = feat_config[idx];
1337 idx++;
1338 msb = feat_config[idx];
1339 msb_lsb = (uint16_t)(lsb | msb << 8);
1340 sett->act_rec_2 = msb_lsb;
1342 /* increment idx by 1 to point max gdi thres addres */
1343 idx++;
1344 lsb = feat_config[idx];
1345 idx++;
1346 msb = feat_config[idx];
1347 msb_lsb = (uint16_t)(lsb | msb << 8);
1348 sett->act_rec_3 = msb_lsb;
1350 /* increment idx by 1 to point buffer size */
1351 idx++;
1352 sett->act_rec_4 = BMI2_GET_BIT_POS0(feat_config[idx], BMI2_ACT_RECG_BUFF_SIZE);
1354 /* increment idx by 2 to to point to min segment confidence */
1355 idx = idx + 2;
1356 sett->act_rec_5 = BMI2_GET_BIT_POS0(feat_config[idx], BMI2_ACT_RECG_MIN_SEG_CONF);
1359 /* Enable Advance power save if disabled while
1360 * configuring and not when already disabled
1362 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
1364 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
1367 else
1369 rslt = BMI2_E_INVALID_SENSOR;
1373 return rslt;
1377 * @brief This api is used for setting the activity recognition settings.
1379 int8_t bmi270_context_set_act_recg_sett(const struct bmi2_act_recg_sett *sett, struct bmi2_dev *dev)
1381 /* Variable to define error */
1382 int8_t rslt;
1384 /* Array to define the feature configuration */
1385 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
1387 /* Variable to define the array offset */
1388 uint8_t idx = 0;
1390 /* Variable to get the status of advance power save */
1391 uint8_t aps_stat;
1393 /* Variable to set flag */
1394 uint8_t feat_found;
1396 /* Initialize feature configuration for activity recognition */
1397 struct bmi2_feature_config bmi2_act_recg_sett = { 0, 0, 0 };
1399 /* Null-pointer check */
1400 rslt = null_ptr_check(dev);
1401 if (rslt == BMI2_OK)
1404 /* Search for bmi2 Abort feature and extract its configuration details */
1405 feat_found = bmi2_extract_input_feat_config(&bmi2_act_recg_sett, BMI2_ACTIVITY_RECOGNITION_SETTINGS, dev);
1406 if (feat_found)
1408 aps_stat = dev->aps_status;
1409 if (aps_stat == BMI2_ENABLE)
1411 /* Disable advance power save if enabled */
1412 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1415 /* Get the configuration from the page where activity recognition setting feature resides */
1416 if (rslt == BMI2_OK)
1418 rslt = bmi2_get_feat_config(bmi2_act_recg_sett.page, feat_config, dev);
1421 if (rslt == BMI2_OK)
1423 /* Define the offset in bytes */
1424 idx = bmi2_act_recg_sett.start_addr;
1425 if ((sett->act_rec_4 > 10) || (sett->act_rec_5 > 10))
1427 rslt = BMI2_E_INVALID_INPUT;
1430 if (rslt == BMI2_OK)
1432 feat_config[idx] = BMI2_SET_BIT_POS0(feat_config[idx],
1433 BMI2_ACT_RECG_POST_PROS_EN_DIS,
1434 sett->act_rec_1);
1436 /* Increment idx by 2 to point min gdi thres addres */
1437 idx = idx + 2;
1438 feat_config[idx] = BMI2_GET_LSB(sett->act_rec_2);
1439 idx++;
1440 feat_config[idx] = BMI2_GET_MSB(sett->act_rec_2);
1442 /* Increment idx by 1 to point max gdi thres addres */
1443 idx++;
1444 feat_config[idx] = BMI2_GET_LSB(sett->act_rec_3);
1445 idx++;
1446 feat_config[idx] = BMI2_GET_MSB(sett->act_rec_3);
1448 /* Increment idx by 1 to point buffer size */
1449 idx++;
1450 feat_config[idx] = BMI2_SET_BIT_POS0(feat_config[idx], BMI2_ACT_RECG_BUFF_SIZE, sett->act_rec_4);
1452 /* Increment idx by 2 to to point to min segment confidence */
1453 idx = idx + 2;
1454 feat_config[idx] = BMI2_SET_BIT_POS0(feat_config[idx], BMI2_ACT_RECG_MIN_SEG_CONF, sett->act_rec_5);
1456 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
1460 /* Enable Advance power save if disabled while
1461 * configuring and not when already disabled
1463 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
1465 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
1468 else
1470 rslt = BMI2_E_INVALID_SENSOR;
1474 return rslt;
1478 * @brief This internal API is used to parse the activity output from the
1479 * FIFO in header mode.
1481 int8_t bmi270_context_get_act_recog_output(struct bmi2_act_recog_output *act_recog,
1482 uint16_t *act_frm_len,
1483 struct bmi2_fifo_frame *fifo,
1484 const struct bmi2_dev *dev)
1486 /* Variable to define error */
1487 int8_t rslt;
1489 /* Variable to define header frame */
1490 uint8_t frame_header = 0;
1492 /* Variable to index the data bytes */
1493 uint16_t data_index;
1495 /* Variable to index activity frames */
1496 uint16_t act_idx = 0;
1498 /* Variable to indicate activity frames read */
1499 uint16_t frame_to_read = 0;
1501 /* Null-pointer check */
1502 rslt = null_ptr_check(dev);
1503 if ((rslt == BMI2_OK) && (act_recog != NULL) && (act_frm_len != NULL) && (fifo != NULL))
1506 /* Store the number of frames to be read */
1507 frame_to_read = *act_frm_len;
1508 for (data_index = fifo->act_recog_byte_start_idx; data_index < fifo->length;)
1510 /* Get frame header byte */
1511 frame_header = fifo->data[data_index] & BMI2_FIFO_TAG_INTR_MASK;
1513 /* Skip S4S frames if S4S is enabled */
1514 rslt = move_if_s4s_frame(&frame_header, &data_index, fifo);
1516 /* Break if FIFO is empty */
1517 if (rslt == BMI2_W_FIFO_EMPTY)
1519 break;
1522 /* Index shifted to next byte where data starts */
1523 data_index++;
1524 switch (frame_header)
1526 /* If header defines accelerometer frame */
1527 case BMI2_FIFO_HEADER_ACC_FRM:
1528 rslt = move_next_frame(&data_index, fifo->acc_frm_len, fifo);
1529 break;
1531 /* If header defines accelerometer and auxiliary frames */
1532 case BMI2_FIFO_HEADER_AUX_ACC_FRM:
1533 rslt = move_next_frame(&data_index, fifo->acc_aux_frm_len, fifo);
1534 break;
1536 /* If header defines accelerometer and gyroscope frames */
1537 case BMI2_FIFO_HEADER_GYR_ACC_FRM:
1538 rslt = move_next_frame(&data_index, fifo->acc_gyr_frm_len, fifo);
1539 break;
1541 /* If header defines accelerometer, auxiliary and gyroscope frames */
1542 case BMI2_FIFO_HEADER_ALL_FRM:
1543 rslt = move_next_frame(&data_index, fifo->all_frm_len, fifo);
1544 break;
1546 /* If header defines only gyroscope frame */
1547 case BMI2_FIFO_HEADER_GYR_FRM:
1548 rslt = move_next_frame(&data_index, fifo->gyr_frm_len, fifo);
1549 break;
1551 /* If header defines only auxiliary frame */
1552 case BMI2_FIFO_HEADER_AUX_FRM:
1553 rslt = move_next_frame(&data_index, fifo->aux_frm_len, fifo);
1554 break;
1556 /* If header defines auxiliary and gyroscope frame */
1557 case BMI2_FIFO_HEADER_AUX_GYR_FRM:
1558 rslt = move_next_frame(&data_index, fifo->aux_gyr_frm_len, fifo);
1559 break;
1561 /* If header defines sensor time frame */
1562 case BMI2_FIFO_HEADER_SENS_TIME_FRM:
1563 rslt = move_next_frame(&data_index, BMI2_SENSOR_TIME_LENGTH, fifo);
1564 break;
1566 /* If header defines skip frame */
1567 case BMI2_FIFO_HEADER_SKIP_FRM:
1568 rslt = move_next_frame(&data_index, BMI2_FIFO_SKIP_FRM_LENGTH, fifo);
1569 break;
1571 /* If header defines Input configuration frame */
1572 case BMI2_FIFO_HEADER_INPUT_CFG_FRM:
1573 rslt = move_next_frame(&data_index, BMI2_FIFO_INPUT_CFG_LENGTH, fifo);
1574 break;
1576 /* If header defines invalid frame or end of valid data */
1577 case BMI2_FIFO_HEAD_OVER_READ_MSB:
1579 /* Move the data index to the last byte to mark completion */
1580 data_index = fifo->length;
1582 /* FIFO is empty */
1583 rslt = BMI2_W_FIFO_EMPTY;
1584 break;
1586 /* If header defines activity recognition frame */
1587 case BMI2_FIFO_VIRT_ACT_RECOG_FRM:
1589 /* Get the activity output */
1590 rslt = unpack_act_recog_output(&act_recog[(act_idx)], &data_index, fifo);
1592 /* Update activity frame index */
1593 (act_idx)++;
1594 break;
1595 default:
1597 /* Move the data index to the last byte in case of invalid values */
1598 data_index = fifo->length;
1600 /* FIFO is empty */
1601 rslt = BMI2_W_FIFO_EMPTY;
1602 break;
1605 /* Number of frames to be read is complete or FIFO is empty */
1606 if ((frame_to_read == act_idx) || (rslt == BMI2_W_FIFO_EMPTY))
1608 break;
1612 /* Update the activity frame index */
1613 (*act_frm_len) = act_idx;
1615 /* Update the activity byte index */
1616 fifo->act_recog_byte_start_idx = data_index;
1618 else
1620 rslt = BMI2_E_NULL_PTR;
1623 return rslt;
1627 * @brief This API updates the gyroscope user-gain.
1629 int8_t bmi270_context_update_gyro_user_gain(const struct bmi2_gyro_user_gain_config *user_gain, struct bmi2_dev *dev)
1631 /* Variable to define error */
1632 int8_t rslt;
1634 /* Variable to select sensor */
1635 uint8_t sens_sel[2] = { BMI2_GYRO, BMI2_GYRO_GAIN_UPDATE };
1637 /* Structure to define sensor configurations */
1638 struct bmi2_sens_config sens_cfg;
1640 /* Variable to store status of user-gain update module */
1641 uint8_t status = 0;
1643 /* Variable to define count */
1644 uint8_t count = 100;
1646 /* Null-pointer check */
1647 rslt = null_ptr_check(dev);
1648 if ((rslt == BMI2_OK) && (user_gain != NULL))
1650 /* Select type of feature */
1651 sens_cfg.type = BMI2_GYRO_GAIN_UPDATE;
1653 /* Get the user gain configurations */
1654 rslt = bmi270_context_get_sensor_config(&sens_cfg, 1, dev);
1655 if (rslt == BMI2_OK)
1657 /* Get the user-defined ratio */
1658 sens_cfg.cfg.gyro_gain_update = *user_gain;
1660 /* Set rate ratio for all axes */
1661 rslt = bmi270_context_set_sensor_config(&sens_cfg, 1, dev);
1664 /* Disable gyroscope */
1665 if (rslt == BMI2_OK)
1667 rslt = bmi270_context_sensor_disable(&sens_sel[0], 1, dev);
1670 /* Enable gyroscope user-gain update module */
1671 if (rslt == BMI2_OK)
1673 rslt = bmi270_context_sensor_enable(&sens_sel[1], 1, dev);
1676 /* Set the command to trigger the computation */
1677 if (rslt == BMI2_OK)
1679 rslt = bmi2_set_command_register(BMI2_USR_GAIN_CMD, dev);
1682 if (rslt == BMI2_OK)
1684 /* Poll until enable bit of user-gain update is 0 */
1685 while (count--)
1687 rslt = get_user_gain_upd_status(&status, dev);
1688 if ((rslt == BMI2_OK) && (status == 0))
1690 /* Enable compensation of gain defined
1691 * in the GAIN register
1693 rslt = enable_gyro_gain(BMI2_ENABLE, dev);
1695 /* Enable gyroscope */
1696 if (rslt == BMI2_OK)
1698 rslt = bmi270_context_sensor_enable(&sens_sel[0], 1, dev);
1701 break;
1704 dev->delay_us(10000, dev->intf_ptr);
1707 /* Return error if user-gain update is failed */
1708 if ((rslt == BMI2_OK) && (status != 0))
1710 rslt = BMI2_E_GYR_USER_GAIN_UPD_FAIL;
1714 else
1716 rslt = BMI2_E_NULL_PTR;
1719 return rslt;
1723 * @brief This API reads the compensated gyroscope user-gain values.
1725 int8_t bmi270_context_read_gyro_user_gain(struct bmi2_gyro_user_gain_data *gyr_usr_gain, struct bmi2_dev *dev)
1727 /* Variable to define error */
1728 int8_t rslt;
1730 /* Variable to define register data */
1731 uint8_t reg_data[3] = { 0 };
1733 /* Null-pointer check */
1734 rslt = null_ptr_check(dev);
1735 if ((rslt == BMI2_OK) && (gyr_usr_gain != NULL))
1737 /* Get the gyroscope compensated gain values */
1738 rslt = bmi2_get_regs(BMI2_GYR_USR_GAIN_0_ADDR, reg_data, 3, dev);
1739 if (rslt == BMI2_OK)
1741 /* Gyroscope user gain correction X-axis */
1742 gyr_usr_gain->x = (int8_t)BMI2_GET_BIT_POS0(reg_data[0], BMI2_GYR_USR_GAIN_X);
1744 /* Gyroscope user gain correction Y-axis */
1745 gyr_usr_gain->y = (int8_t)BMI2_GET_BIT_POS0(reg_data[1], BMI2_GYR_USR_GAIN_Y);
1747 /* Gyroscope user gain correction z-axis */
1748 gyr_usr_gain->z = (int8_t)BMI2_GET_BIT_POS0(reg_data[2], BMI2_GYR_USR_GAIN_Z);
1751 else
1753 rslt = BMI2_E_NULL_PTR;
1756 return rslt;
1760 * @brief This API maps/unmaps feature interrupts to that of interrupt pins.
1762 int8_t bmi270_context_map_feat_int(const struct bmi2_sens_int_config *sens_int, uint8_t n_sens, struct bmi2_dev *dev)
1764 /* Variable to define error */
1765 int8_t rslt;
1767 /* Variable to define loop */
1768 uint8_t loop;
1770 /* Null-pointer check */
1771 rslt = null_ptr_check(dev);
1772 if ((rslt == BMI2_OK) && (sens_int != NULL))
1774 for (loop = 0; loop < n_sens; loop++)
1776 switch (sens_int[loop].type)
1778 case BMI2_STEP_COUNTER:
1779 case BMI2_STEP_DETECTOR:
1781 rslt = bmi2_map_feat_int(sens_int[loop].type, sens_int[loop].hw_int_pin, dev);
1782 break;
1783 default:
1784 rslt = BMI2_E_INVALID_SENSOR;
1785 break;
1788 /* Return error if interrupt mapping fails */
1789 if (rslt != BMI2_OK)
1791 break;
1795 else
1797 rslt = BMI2_E_NULL_PTR;
1800 return rslt;
1803 /***************************************************************************/
1805 /*! Local Function Definitions
1806 ****************************************************************************/
1809 * @brief This internal API is used to validate the device structure pointer for
1810 * null conditions.
1812 static int8_t null_ptr_check(const struct bmi2_dev *dev)
1814 /* Variable to define error */
1815 int8_t rslt = BMI2_OK;
1817 if ((dev == NULL) || (dev->read == NULL) || (dev->write == NULL) || (dev->delay_us == NULL))
1819 /* Device structure pointer is not valid */
1820 rslt = BMI2_E_NULL_PTR;
1823 return rslt;
1827 * @brief This internal API selects the sensor/features to be enabled or
1828 * disabled.
1830 static int8_t select_sensor(const uint8_t *sens_list, uint8_t n_sens, uint64_t *sensor_sel)
1832 /* Variable to define error */
1833 int8_t rslt = BMI2_OK;
1835 /* Variable to define loop */
1836 uint8_t count;
1838 for (count = 0; count < n_sens; count++)
1840 switch (sens_list[count])
1842 case BMI2_ACCEL:
1843 *sensor_sel |= BMI2_ACCEL_SENS_SEL;
1844 break;
1845 case BMI2_GYRO:
1846 *sensor_sel |= BMI2_GYRO_SENS_SEL;
1847 break;
1848 case BMI2_AUX:
1849 *sensor_sel |= BMI2_AUX_SENS_SEL;
1850 break;
1851 case BMI2_TEMP:
1852 *sensor_sel |= BMI2_TEMP_SENS_SEL;
1853 break;
1854 case BMI2_STEP_DETECTOR:
1855 *sensor_sel |= BMI2_STEP_DETECT_SEL;
1856 break;
1857 case BMI2_STEP_COUNTER:
1858 *sensor_sel |= BMI2_STEP_COUNT_SEL;
1859 break;
1860 case BMI2_GYRO_GAIN_UPDATE:
1861 *sensor_sel |= BMI2_GYRO_GAIN_UPDATE_SEL;
1862 break;
1863 case BMI2_ACTIVITY_RECOGNITION:
1864 *sensor_sel |= BMI2_ACTIVITY_RECOGNITION_SEL;
1865 break;
1866 default:
1867 rslt = BMI2_E_INVALID_SENSOR;
1868 break;
1872 return rslt;
1876 * @brief This internal API enables the selected sensor/features.
1878 static int8_t sensor_enable(uint64_t sensor_sel, struct bmi2_dev *dev)
1880 /* Variable to define error */
1881 int8_t rslt;
1883 /* Variable to store register values */
1884 uint8_t reg_data = 0;
1886 /* Variable to define loop */
1887 uint8_t loop = 1;
1889 /* Variable to get the status of advance power save */
1890 uint8_t aps_stat = 0;
1892 rslt = bmi2_get_regs(BMI2_PWR_CTRL_ADDR, &reg_data, 1, dev);
1893 if (rslt == BMI2_OK)
1895 /* Enable accelerometer */
1896 if (sensor_sel & BMI2_ACCEL_SENS_SEL)
1898 reg_data = BMI2_SET_BITS(reg_data, BMI2_ACC_EN, BMI2_ENABLE);
1901 /* Enable gyroscope */
1902 if (sensor_sel & BMI2_GYRO_SENS_SEL)
1904 reg_data = BMI2_SET_BITS(reg_data, BMI2_GYR_EN, BMI2_ENABLE);
1907 /* Enable auxiliary sensor */
1908 if (sensor_sel & BMI2_AUX_SENS_SEL)
1910 reg_data = BMI2_SET_BIT_POS0(reg_data, BMI2_AUX_EN, BMI2_ENABLE);
1913 /* Enable temperature sensor */
1914 if (sensor_sel & BMI2_TEMP_SENS_SEL)
1916 reg_data = BMI2_SET_BITS(reg_data, BMI2_TEMP_EN, BMI2_ENABLE);
1919 /* Enable the sensors that are set in the power control register */
1920 if (sensor_sel & BMI2_MAIN_SENSORS)
1922 rslt = bmi2_set_regs(BMI2_PWR_CTRL_ADDR, &reg_data, 1, dev);
1926 if ((rslt == BMI2_OK) && (sensor_sel & ~(BMI2_MAIN_SENSORS)))
1928 /* Get status of advance power save mode */
1929 aps_stat = dev->aps_status;
1930 if (aps_stat == BMI2_ENABLE)
1932 /* Disable advance power save if enabled */
1933 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1936 if (rslt == BMI2_OK)
1938 while (loop--)
1940 /* Enable step detector feature */
1941 if (sensor_sel & BMI2_STEP_DETECT_SEL)
1943 rslt = set_step_detector(BMI2_ENABLE, dev);
1944 if (rslt == BMI2_OK)
1946 dev->sens_en_stat |= BMI2_STEP_DETECT_SEL;
1948 else
1950 break;
1954 /* Enable step counter feature */
1955 if (sensor_sel & BMI2_STEP_COUNT_SEL)
1957 rslt = set_step_counter(BMI2_ENABLE, dev);
1958 if (rslt == BMI2_OK)
1960 dev->sens_en_stat |= BMI2_STEP_COUNT_SEL;
1962 else
1964 break;
1968 /* Enable gyroscope user gain */
1969 if (sensor_sel & BMI2_GYRO_GAIN_UPDATE_SEL)
1971 rslt = set_gyro_user_gain(BMI2_ENABLE, dev);
1972 if (rslt == BMI2_OK)
1974 dev->sens_en_stat |= BMI2_GYRO_GAIN_UPDATE_SEL;
1976 else
1978 break;
1982 /* Enable activity recognition feature */
1983 if (sensor_sel & BMI2_ACTIVITY_RECOGNITION_SEL)
1985 rslt = set_act_recog(BMI2_ENABLE, dev);
1986 if (rslt == BMI2_OK)
1988 dev->sens_en_stat |= BMI2_ACTIVITY_RECOGNITION_SEL;
1990 else
1992 break;
1997 /* Enable Advance power save if disabled while
1998 * configuring and not when already disabled
2000 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
2002 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
2007 return rslt;
2011 * @brief This internal API disables the selected sensors/features.
2013 static int8_t sensor_disable(uint64_t sensor_sel, struct bmi2_dev *dev)
2015 /* Variable to define error */
2016 int8_t rslt;
2018 /* Variable to store register values */
2019 uint8_t reg_data = 0;
2021 /* Variable to define loop */
2022 uint8_t loop = 1;
2024 /* Variable to get the status of advance power save */
2025 uint8_t aps_stat = 0;
2027 rslt = bmi2_get_regs(BMI2_PWR_CTRL_ADDR, &reg_data, 1, dev);
2028 if (rslt == BMI2_OK)
2030 /* Disable accelerometer */
2031 if (sensor_sel & BMI2_ACCEL_SENS_SEL)
2033 reg_data = BMI2_SET_BIT_VAL0(reg_data, BMI2_ACC_EN);
2036 /* Disable gyroscope */
2037 if (sensor_sel & BMI2_GYRO_SENS_SEL)
2039 reg_data = BMI2_SET_BIT_VAL0(reg_data, BMI2_GYR_EN);
2042 /* Disable auxiliary sensor */
2043 if (sensor_sel & BMI2_AUX_SENS_SEL)
2045 reg_data = BMI2_SET_BIT_VAL0(reg_data, BMI2_AUX_EN);
2048 /* Disable temperature sensor */
2049 if (sensor_sel & BMI2_TEMP_SENS_SEL)
2051 reg_data = BMI2_SET_BIT_VAL0(reg_data, BMI2_TEMP_EN);
2054 /* Disable the sensors that are set in the power control register */
2055 if (sensor_sel & BMI2_MAIN_SENSORS)
2057 rslt = bmi2_set_regs(BMI2_PWR_CTRL_ADDR, &reg_data, 1, dev);
2061 if ((rslt == BMI2_OK) && (sensor_sel & ~(BMI2_MAIN_SENSORS)))
2063 /* Get status of advance power save mode */
2064 aps_stat = dev->aps_status;
2065 if (aps_stat == BMI2_ENABLE)
2067 /* Disable advance power save if enabled */
2068 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
2071 if (rslt == BMI2_OK)
2073 while (loop--)
2075 /* Disable step detector feature */
2076 if (sensor_sel & BMI2_STEP_DETECT_SEL)
2078 rslt = set_step_detector(BMI2_DISABLE, dev);
2079 if (rslt == BMI2_OK)
2081 dev->sens_en_stat &= ~BMI2_STEP_DETECT_SEL;
2083 else
2085 break;
2089 /* Disable step counter feature */
2090 if (sensor_sel & BMI2_STEP_COUNT_SEL)
2092 rslt = set_step_counter(BMI2_DISABLE, dev);
2093 if (rslt == BMI2_OK)
2095 dev->sens_en_stat &= ~BMI2_STEP_COUNT_SEL;
2097 else
2099 break;
2103 /* Disable gyroscope user gain */
2104 if (sensor_sel & BMI2_GYRO_GAIN_UPDATE_SEL)
2106 rslt = set_gyro_user_gain(BMI2_DISABLE, dev);
2107 if (rslt == BMI2_OK)
2109 dev->sens_en_stat &= ~BMI2_GYRO_GAIN_UPDATE_SEL;
2111 else
2113 break;
2117 if (sensor_sel & BMI2_ACTIVITY_RECOGNITION_SEL)
2119 rslt = set_act_recog(BMI2_DISABLE, dev);
2120 if (rslt == BMI2_OK)
2122 dev->sens_en_stat |= BMI2_ACTIVITY_RECOGNITION_SEL;
2124 else
2126 break;
2130 /* Enable Advance power save if disabled while
2131 * configuring and not when already disabled
2133 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
2135 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
2141 return rslt;
2145 * @brief This internal API is used to enable/disable step detector feature.
2147 static int8_t set_step_detector(uint8_t enable, struct bmi2_dev *dev)
2149 /* Variable to define error */
2150 int8_t rslt;
2152 /* Array to define the feature configuration */
2153 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2155 /* Variable to define the array offset */
2156 uint8_t idx = 0;
2158 /* Variable to set flag */
2159 uint8_t feat_found;
2161 /* Initialize feature configuration for step detector */
2162 struct bmi2_feature_config step_det_config = { 0, 0, 0 };
2164 /* Search for step detector feature and extract its configuration details */
2165 feat_found = bmi2_extract_input_feat_config(&step_det_config, BMI2_STEP_DETECTOR, dev);
2166 if (feat_found)
2168 /* Get the configuration from the page where step detector feature resides */
2169 rslt = bmi2_get_feat_config(step_det_config.page, feat_config, dev);
2170 if (rslt == BMI2_OK)
2172 /* Define the offset for enable/disable of step detector */
2173 idx = step_det_config.start_addr + BMI2_STEP_COUNT_FEAT_EN_OFFSET;
2175 /* Set the feature enable bit */
2176 feat_config[idx] = BMI2_SET_BITS(feat_config[idx], BMI2_STEP_DET_FEAT_EN, enable);
2178 /* Set the configuration back to the page */
2179 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2182 else
2184 rslt = BMI2_E_INVALID_SENSOR;
2187 return rslt;
2191 * @brief This internal API is used to enable/disable step counter feature.
2193 static int8_t set_step_counter(uint8_t enable, struct bmi2_dev *dev)
2195 /* Variable to define error */
2196 int8_t rslt;
2198 /* Array to define the feature configuration */
2199 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2201 /* Variable to define the array offset */
2202 uint8_t idx = 0;
2204 /* Variable to set flag */
2205 uint8_t feat_found;
2207 /* Initialize feature configuration for step counter */
2208 struct bmi2_feature_config step_count_config = { 0, 0, 0 };
2210 /* Search for step counter feature and extract its configuration details */
2211 feat_found = bmi2_extract_input_feat_config(&step_count_config, BMI2_STEP_COUNTER, dev);
2212 if (feat_found)
2214 /* Get the configuration from the page where step-counter feature resides */
2215 rslt = bmi2_get_feat_config(step_count_config.page, feat_config, dev);
2216 if (rslt == BMI2_OK)
2218 /* Define the offset for enable/disable of step counter */
2219 idx = step_count_config.start_addr + BMI2_STEP_COUNT_FEAT_EN_OFFSET;
2221 /* Set the feature enable bit */
2222 feat_config[idx] = BMI2_SET_BITS(feat_config[idx], BMI2_STEP_COUNT_FEAT_EN, enable);
2224 /* Set the configuration back to the page */
2225 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2228 else
2230 rslt = BMI2_E_INVALID_SENSOR;
2233 return rslt;
2237 * @brief This internal API is used to enable/disable gyroscope user gain
2238 * feature.
2240 static int8_t set_gyro_user_gain(uint8_t enable, struct bmi2_dev *dev)
2242 /* Variable to define error */
2243 int8_t rslt;
2245 /* Array to define the feature configuration */
2246 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2248 /* Variable to define the array offset */
2249 uint8_t idx = 0;
2251 /* Variable to set flag */
2252 uint8_t feat_found;
2254 /* Initialize feature configuration for gyroscope user gain */
2255 struct bmi2_feature_config gyr_user_gain_cfg = { 0, 0, 0 };
2257 /* Search for user gain feature and extract its configuration details */
2258 feat_found = bmi2_extract_input_feat_config(&gyr_user_gain_cfg, BMI2_GYRO_GAIN_UPDATE, dev);
2259 if (feat_found)
2261 /* Get the configuration from the page where user gain feature resides */
2262 rslt = bmi2_get_feat_config(gyr_user_gain_cfg.page, feat_config, dev);
2263 if (rslt == BMI2_OK)
2265 /* Define the offset for enable/disable of user gain */
2266 idx = gyr_user_gain_cfg.start_addr + BMI2_GYR_USER_GAIN_FEAT_EN_OFFSET;
2268 /* Set the feature enable bit */
2269 feat_config[idx] = BMI2_SET_BITS(feat_config[idx], BMI2_GYR_USER_GAIN_FEAT_EN, enable);
2271 /* Set the configuration back to the page */
2272 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2275 else
2277 rslt = BMI2_E_INVALID_SENSOR;
2280 return rslt;
2284 * @brief This internal API enables/disables the activity recognition feature.
2286 static int8_t set_act_recog(uint8_t enable, struct bmi2_dev *dev)
2288 /* Variable to define error */
2289 int8_t rslt;
2291 /* Array to define the feature configuration */
2292 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2294 /* Variable to define the array offset */
2295 uint8_t idx = 0;
2297 /* Variable to set flag */
2298 uint8_t feat_found;
2300 /* Initialize feature configuration for activity recognition */
2301 struct bmi2_feature_config act_recog_cfg = { 0, 0, 0 };
2303 /* Search for activity recognition and extract its configuration details */
2304 feat_found = bmi2_extract_input_feat_config(&act_recog_cfg, BMI2_ACTIVITY_RECOGNITION, dev);
2305 if (feat_found)
2307 /* Get the configuration from the page where activity
2308 * recognition feature resides
2310 rslt = bmi2_get_feat_config(act_recog_cfg.page, feat_config, dev);
2311 if (rslt == BMI2_OK)
2313 /* Define the offset for enable/disable of activity recognition */
2314 idx = act_recog_cfg.start_addr;
2316 /* Set the feature enable bit */
2317 feat_config[idx] = BMI2_SET_BIT_POS0(feat_config[idx], BMI2_ACTIVITY_RECOG_EN, enable);
2319 /* Set the configuration back to the page */
2320 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2323 else
2325 rslt = BMI2_E_INVALID_SENSOR;
2328 return rslt;
2332 * @brief This internal API sets step counter parameter configurations.
2334 static int8_t set_step_count_params_config(const uint16_t *step_count_params, struct bmi2_dev *dev)
2336 /* Variable to define error */
2337 int8_t rslt = BMI2_OK;
2339 /* Array to define the feature configuration */
2340 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2342 /* Variable to define index */
2343 uint8_t index = 0;
2345 /* Variable to set flag */
2346 uint8_t feat_found;
2348 /* Initialize feature configuration for step counter parameters */
2349 struct bmi2_feature_config step_params_config = { 0, 0, 0 };
2351 /* Variable to index the page number */
2352 uint8_t page_idx;
2354 /* Variable to define the start page */
2355 uint8_t start_page;
2357 /* Variable to define start address of the parameters */
2358 uint8_t start_addr;
2360 /* Variable to define number of bytes */
2361 uint8_t n_bytes = (BMI2_STEP_CNT_N_PARAMS * 2);
2363 /* Variable to store number of pages */
2364 uint8_t n_pages = (n_bytes / 16);
2366 /* Variable to define the end page */
2367 uint8_t end_page;
2369 /* Variable to define the remaining bytes to be read */
2370 uint8_t remain_len;
2372 /* Variable to define the maximum words(16 bytes or 8 words) to be read in a page */
2373 uint8_t max_len = 8;
2375 /* Variable index bytes in a page */
2376 uint8_t page_byte_idx;
2378 /* Variable to index the parameters */
2379 uint8_t param_idx = 0;
2381 /* Copy the feature configuration address to a local pointer */
2382 uint16_t *data_p = (uint16_t *) (void *)feat_config;
2384 /* Search for step counter parameter feature and extract its configuration details */
2385 feat_found = bmi2_extract_input_feat_config(&step_params_config, BMI2_STEP_COUNTER_PARAMS, dev);
2386 if (feat_found)
2388 /* Get the start page for the step counter parameters */
2389 start_page = step_params_config.page;
2391 /* Get the end page for the step counter parameters */
2392 end_page = start_page + n_pages;
2394 /* Get the start address for the step counter parameters */
2395 start_addr = step_params_config.start_addr;
2397 /* Get the remaining length of bytes to be read */
2398 remain_len = (uint8_t)((n_bytes - (n_pages * 16)) + start_addr);
2399 for (page_idx = start_page; page_idx <= end_page; page_idx++)
2401 /* Get the configuration from the respective page */
2402 rslt = bmi2_get_feat_config(page_idx, feat_config, dev);
2403 if (rslt == BMI2_OK)
2405 /* Start from address 0x00 when switched to next page */
2406 if (page_idx > start_page)
2408 start_addr = 0;
2411 /* Remaining number of words to be read in the page */
2412 if (page_idx == end_page)
2414 max_len = (remain_len / 2);
2417 /* Get offset in words since all the features are set in words length */
2418 page_byte_idx = start_addr / 2;
2419 for (; page_byte_idx < max_len;)
2421 /* Set parameters 1 to 25 */
2422 *(data_p + page_byte_idx) = BMI2_SET_BIT_POS0(*(data_p + page_byte_idx),
2423 BMI2_STEP_COUNT_PARAMS,
2424 step_count_params[param_idx]);
2426 /* Increment offset by 1 word to set to the next parameter */
2427 page_byte_idx++;
2429 /* Increment to next parameter */
2430 param_idx++;
2433 /* Get total length in bytes to copy from local pointer to the array */
2434 page_byte_idx = (uint8_t)(page_byte_idx * 2) - step_params_config.start_addr;
2436 /* Copy the bytes to be set back to the array */
2437 for (index = 0; index < page_byte_idx; index++)
2439 feat_config[step_params_config.start_addr +
2440 index] = *((uint8_t *) data_p + step_params_config.start_addr + index);
2443 /* Set the configuration back to the page */
2444 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2448 else
2450 rslt = BMI2_E_INVALID_SENSOR;
2453 return rslt;
2456 /* @brief This internal API sets step counter configurations like water-mark
2457 * level, reset-counter and output-configuration step detector and activity.
2459 static int8_t set_step_config(const struct bmi2_step_config *config, struct bmi2_dev *dev)
2461 /* Variable to define error */
2462 int8_t rslt;
2464 /* Array to define the feature configuration */
2465 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2467 /* Variable to define the array offset */
2468 uint8_t idx = 0;
2470 /* Variable to define index */
2471 uint8_t index = 0;
2473 /* Variable to set flag */
2474 uint8_t feat_found;
2476 /* Initialize feature configuration for step counter 4 */
2477 struct bmi2_feature_config step_count_config = { 0, 0, 0 };
2479 /* Copy the feature configuration address to a local pointer */
2480 uint16_t *data_p = (uint16_t *) (void *)feat_config;
2482 /* Search for step counter feature and extract its configuration details */
2483 feat_found = bmi2_extract_input_feat_config(&step_count_config, BMI2_STEP_COUNTER, dev);
2484 if (feat_found)
2486 /* Get the configuration from the page where step counter resides */
2487 rslt = bmi2_get_feat_config(step_count_config.page, feat_config, dev);
2488 if (rslt == BMI2_OK)
2490 /* Define the offset in bytes */
2491 idx = step_count_config.start_addr;
2493 /* Get offset in words since all the features are set in words length */
2494 idx = idx / 2;
2496 /* Set water-mark level */
2497 *(data_p + idx) = BMI2_SET_BIT_POS0(*(data_p + idx), BMI2_STEP_COUNT_WM_LEVEL, config->watermark_level);
2499 /* Set reset-counter */
2500 *(data_p + idx) = BMI2_SET_BITS(*(data_p + idx), BMI2_STEP_COUNT_RST_CNT, config->reset_counter);
2502 /* Increment offset by 1 word to set output
2503 * configuration of step detector and step activity
2505 idx++;
2507 /* Set step buffer size */
2508 *(data_p + idx) = BMI2_SET_BITS(*(data_p + idx), BMI2_STEP_BUFFER_SIZE, config->step_buffer_size);
2510 /* Increment offset by 1 more word to get the total length in words */
2511 idx++;
2513 /* Get total length in bytes to copy from local pointer to the array */
2514 idx = (uint8_t)(idx * 2) - step_count_config.start_addr;
2516 /* Copy the bytes to be set back to the array */
2517 for (index = 0; index < idx; index++)
2519 feat_config[step_count_config.start_addr +
2520 index] = *((uint8_t *) data_p + step_count_config.start_addr + index);
2523 /* Set the configuration back to the page */
2524 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2527 else
2529 rslt = BMI2_E_INVALID_SENSOR;
2532 return rslt;
2536 * @brief This internal API gets step counter parameter configurations.
2538 static int8_t get_step_count_params_config(uint16_t *step_count_params, struct bmi2_dev *dev)
2540 /* Variable to define error */
2541 int8_t rslt = BMI2_OK;
2543 /* Array to define the feature configuration */
2544 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2546 /* Variable to set flag */
2547 uint8_t feat_found;
2549 /* Variable to define LSB */
2550 uint16_t lsb = 0;
2552 /* Variable to define MSB */
2553 uint16_t msb = 0;
2555 /* Variable to define a word */
2556 uint16_t lsb_msb = 0;
2558 /* Initialize feature configuration for step counter 1 */
2559 struct bmi2_feature_config step_params_config = { 0, 0, 0 };
2561 /* Variable to index the page number */
2562 uint8_t page_idx;
2564 /* Variable to define the start page */
2565 uint8_t start_page;
2567 /* Variable to define start address of the parameters */
2568 uint8_t start_addr;
2570 /* Variable to define number of bytes */
2571 uint8_t n_bytes = (BMI2_STEP_CNT_N_PARAMS * 2);
2573 /* Variable to store number of pages */
2574 uint8_t n_pages = (n_bytes / 16);
2576 /* Variable to define the end page */
2577 uint8_t end_page;
2579 /* Variable to define the remaining bytes to be read */
2580 uint8_t remain_len;
2582 /* Variable to define the maximum words to be read in a page */
2583 uint8_t max_len = BMI2_FEAT_SIZE_IN_BYTES;
2585 /* Variable index bytes in a page */
2586 uint8_t page_byte_idx;
2588 /* Variable to index the parameters */
2589 uint8_t param_idx = 0;
2591 /* Search for step counter parameter feature and extract its configuration details */
2592 feat_found = bmi2_extract_input_feat_config(&step_params_config, BMI2_STEP_COUNTER_PARAMS, dev);
2593 if (feat_found)
2595 /* Get the start page for the step counter parameters */
2596 start_page = step_params_config.page;
2598 /* Get the end page for the step counter parameters */
2599 end_page = start_page + n_pages;
2601 /* Get the start address for the step counter parameters */
2602 start_addr = step_params_config.start_addr;
2604 /* Get the remaining length of bytes to be read */
2605 remain_len = (uint8_t)((n_bytes - (n_pages * 16)) + start_addr);
2606 for (page_idx = start_page; page_idx <= end_page; page_idx++)
2608 /* Get the configuration from the respective page */
2609 rslt = bmi2_get_feat_config(page_idx, feat_config, dev);
2610 if (rslt == BMI2_OK)
2612 /* Start from address 0x00 when switched to next page */
2613 if (page_idx > start_page)
2615 start_addr = 0;
2618 /* Remaining number of bytes to be read in the page */
2619 if (page_idx == end_page)
2621 max_len = remain_len;
2624 /* Get the offset */
2625 page_byte_idx = start_addr;
2626 while (page_byte_idx < max_len)
2628 /* Get word to calculate the parameter*/
2629 lsb = (uint16_t) feat_config[page_byte_idx++];
2630 if (page_byte_idx < max_len)
2632 msb = ((uint16_t) feat_config[page_byte_idx++] << 8);
2635 lsb_msb = lsb | msb;
2637 /* Get parameters 1 to 25 */
2638 step_count_params[param_idx] = lsb_msb & BMI2_STEP_COUNT_PARAMS_MASK;
2640 /* Increment to next parameter */
2641 param_idx++;
2646 else
2648 rslt = BMI2_E_INVALID_SENSOR;
2651 return rslt;
2655 * @brief This internal API gets step counter/detector/activity configurations.
2657 static int8_t get_step_config(struct bmi2_step_config *config, struct bmi2_dev *dev)
2659 /* Variable to define error */
2660 int8_t rslt;
2662 /* Array to define the feature configuration */
2663 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2665 /* Variable to define the array offset */
2666 uint8_t idx = 0;
2668 /* Variable to define LSB */
2669 uint16_t lsb = 0;
2671 /* Variable to define MSB */
2672 uint16_t msb = 0;
2674 /* Variable to define a word */
2675 uint16_t lsb_msb = 0;
2677 /* Variable to set flag */
2678 uint8_t feat_found;
2680 /* Initialize feature configuration for step counter */
2681 struct bmi2_feature_config step_count_config = { 0, 0, 0 };
2683 /* Search for step counter 4 feature and extract its configuration details */
2684 feat_found = bmi2_extract_input_feat_config(&step_count_config, BMI2_STEP_COUNTER, dev);
2685 if (feat_found)
2687 /* Get the configuration from the page where step counter 4 parameter resides */
2688 rslt = bmi2_get_feat_config(step_count_config.page, feat_config, dev);
2689 if (rslt == BMI2_OK)
2691 /* Define the offset for feature enable for step counter/detector/activity */
2692 idx = step_count_config.start_addr;
2694 /* Get word to calculate water-mark level and reset counter */
2695 lsb = (uint16_t) feat_config[idx++];
2696 msb = ((uint16_t) feat_config[idx++] << 8);
2697 lsb_msb = lsb | msb;
2699 /* Get water-mark level */
2700 config->watermark_level = lsb_msb & BMI2_STEP_COUNT_WM_LEVEL_MASK;
2702 /* Get reset counter */
2703 config->reset_counter = (lsb_msb & BMI2_STEP_COUNT_RST_CNT_MASK) >> BMI2_STEP_COUNT_RST_CNT_POS;
2705 /* Get word to calculate output configuration of step detector and activity */
2706 lsb = (uint16_t) feat_config[idx++];
2707 msb = ((uint16_t) feat_config[idx++] << 8);
2708 lsb_msb = lsb | msb;
2710 config->step_buffer_size = (lsb_msb & BMI2_STEP_BUFFER_SIZE_MASK) >> BMI2_STEP_BUFFER_SIZE_POS;
2713 else
2715 rslt = BMI2_E_INVALID_SENSOR;
2718 return rslt;
2722 * @brief This internal API gets the output values of step counter.
2724 static int8_t get_step_counter_output(uint32_t *step_count, struct bmi2_dev *dev)
2726 /* Variable to define error */
2727 int8_t rslt;
2729 /* Array to define the feature configuration */
2730 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2732 /* Variables to define index */
2733 uint8_t idx = 0;
2735 /* Variable to set flag */
2736 uint8_t feat_found;
2738 /* Initialize feature output for step counter */
2739 struct bmi2_feature_config step_cnt_out_config = { 0, 0, 0 };
2741 /* Search for step counter output feature and extract its configuration details */
2742 feat_found = extract_output_feat_config(&step_cnt_out_config, BMI2_STEP_COUNTER, dev);
2743 if (feat_found)
2745 /* Get the feature output configuration for step-counter */
2746 rslt = bmi2_get_feat_config(step_cnt_out_config.page, feat_config, dev);
2747 if (rslt == BMI2_OK)
2749 /* Define the offset in bytes for step counter output */
2750 idx = step_cnt_out_config.start_addr;
2752 /* Get the step counter output in 4 bytes */
2753 *step_count = (uint32_t) feat_config[idx++];
2754 *step_count |= ((uint32_t) feat_config[idx++] << 8);
2755 *step_count |= ((uint32_t) feat_config[idx++] << 16);
2756 *step_count |= ((uint32_t) feat_config[idx++] << 24);
2759 else
2761 rslt = BMI2_E_INVALID_SENSOR;
2764 return rslt;
2768 * @brief This internal API gets the error status related to NVM.
2770 static int8_t get_nvm_error_status(struct bmi2_nvm_err_status *nvm_err_stat, struct bmi2_dev *dev)
2772 /* Variable to define error */
2773 int8_t rslt;
2775 /* Array to define the feature configuration */
2776 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2778 /* Variables to define index */
2779 uint8_t idx = 0;
2781 /* Variable to set flag */
2782 uint8_t feat_found;
2784 /* Initialize feature output for NVM error status */
2785 struct bmi2_feature_config nvm_err_cfg = { 0, 0, 0 };
2787 /* Search for NVM error status feature and extract its configuration details */
2788 feat_found = extract_output_feat_config(&nvm_err_cfg, BMI2_NVM_STATUS, dev);
2789 if (feat_found)
2791 /* Get the feature output configuration for NVM error status */
2792 rslt = bmi2_get_feat_config(nvm_err_cfg.page, feat_config, dev);
2793 if (rslt == BMI2_OK)
2795 /* Define the offset in bytes for NVM error status */
2796 idx = nvm_err_cfg.start_addr;
2798 /* Increment index to get the error status */
2799 idx++;
2801 /* Error when NVM load action fails */
2802 nvm_err_stat->load_error = BMI2_GET_BIT_POS0(feat_config[idx], BMI2_NVM_LOAD_ERR_STATUS);
2804 /* Error when NVM program action fails */
2805 nvm_err_stat->prog_error = BMI2_GET_BITS(feat_config[idx], BMI2_NVM_PROG_ERR_STATUS);
2807 /* Error when NVM erase action fails */
2808 nvm_err_stat->erase_error = BMI2_GET_BITS(feat_config[idx], BMI2_NVM_ERASE_ERR_STATUS);
2810 /* Error when NVM program limit is exceeded */
2811 nvm_err_stat->exceed_error = BMI2_GET_BITS(feat_config[idx], BMI2_NVM_END_EXCEED_STATUS);
2813 /* Error when NVM privilege mode is not acquired */
2814 nvm_err_stat->privil_error = BMI2_GET_BITS(feat_config[idx], BMI2_NVM_PRIV_ERR_STATUS);
2817 else
2819 rslt = BMI2_E_INVALID_SENSOR;
2822 return rslt;
2826 * @brief This internal API is used to get enable status of gyroscope user gain
2827 * update.
2829 static int8_t get_user_gain_upd_status(uint8_t *status, struct bmi2_dev *dev)
2831 /* Variable to define error */
2832 int8_t rslt = BMI2_OK;
2834 /* Array to define the feature configuration */
2835 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2837 /* Variable to define the array offset */
2838 uint8_t idx = 0;
2840 /* Variable to set flag */
2841 uint8_t feat_found;
2843 /* Variable to check APS status */
2844 uint8_t aps_stat = 0;
2846 /* Initialize feature configuration for gyroscope user gain */
2847 struct bmi2_feature_config gyr_user_gain_cfg = { 0, 0, 0 };
2849 /* Search for user gain feature and extract its configuration details */
2850 feat_found = bmi2_extract_input_feat_config(&gyr_user_gain_cfg, BMI2_GYRO_GAIN_UPDATE, dev);
2851 if (feat_found)
2853 /* Disable advance power save */
2854 aps_stat = dev->aps_status;
2855 if (aps_stat == BMI2_ENABLE)
2857 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
2860 if (rslt == BMI2_OK)
2862 /* Get the configuration from the page where user gain feature resides */
2863 rslt = bmi2_get_feat_config(gyr_user_gain_cfg.page, feat_config, dev);
2864 if (rslt == BMI2_OK)
2866 /* Define the offset for enable/disable of user gain */
2867 idx = gyr_user_gain_cfg.start_addr + BMI2_GYR_USER_GAIN_FEAT_EN_OFFSET;
2869 /* Set the feature enable status */
2870 *status = BMI2_GET_BITS(feat_config[idx], BMI2_GYR_USER_GAIN_FEAT_EN);
2874 else
2876 rslt = BMI2_E_INVALID_SENSOR;
2879 /* Enable Advance power save if disabled while configuring and not when already disabled */
2880 if ((rslt == BMI2_OK) && (aps_stat == BMI2_ENABLE))
2882 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
2885 return rslt;
2889 * @brief This internal API is used to parse and store the activity recognition
2890 * output from the FIFO data.
2892 static int8_t unpack_act_recog_output(struct bmi2_act_recog_output *act_recog,
2893 uint16_t *data_index,
2894 const struct bmi2_fifo_frame *fifo)
2896 /* Variable to define error */
2897 int8_t rslt = BMI2_OK;
2899 /* Variables to define 4 bytes of sensor time */
2900 uint32_t time_stamp_byte4 = 0;
2901 uint32_t time_stamp_byte3 = 0;
2902 uint32_t time_stamp_byte2 = 0;
2903 uint32_t time_stamp_byte1 = 0;
2905 /* Validate data index */
2906 if ((*data_index + BMI2_FIFO_VIRT_ACT_DATA_LENGTH) >= fifo->length)
2908 /* Update the data index to the last byte */
2909 (*data_index) = fifo->length;
2911 /* FIFO is empty */
2912 rslt = BMI2_W_FIFO_EMPTY;
2914 else
2916 /* Get time-stamp from the activity recognition frame */
2917 time_stamp_byte4 = ((uint32_t)(fifo->data[(*data_index) + 3]) << 24);
2918 time_stamp_byte3 = ((uint32_t)(fifo->data[(*data_index) + 2]) << 16);
2919 time_stamp_byte2 = fifo->data[(*data_index) + 1] << 8;
2920 time_stamp_byte1 = fifo->data[(*data_index)];
2922 /* Update time-stamp from the virtual frame */
2923 act_recog->time_stamp = (time_stamp_byte4 | time_stamp_byte3 | time_stamp_byte2 | time_stamp_byte1);
2925 /* Move the data index by 4 bytes */
2926 (*data_index) = (*data_index) + BMI2_FIFO_VIRT_ACT_TIME_LENGTH;
2928 /* Update the previous activity from the virtual frame */
2929 act_recog->prev_act = fifo->data[(*data_index)];
2931 /* Move the data index by 1 byte */
2932 (*data_index) = (*data_index) + BMI2_FIFO_VIRT_ACT_TYPE_LENGTH;
2934 /* Update the current activity from the virtual frame */
2935 act_recog->curr_act = fifo->data[(*data_index)];
2937 /* Move the data index by 1 byte */
2938 (*data_index) = (*data_index) + BMI2_FIFO_VIRT_ACT_STAT_LENGTH;
2940 /* More frames could be read */
2941 rslt = BMI2_W_PARTIAL_READ;
2944 return rslt;
2948 * @brief This internal API gets the error status related to virtual frames.
2950 static int8_t get_vfrm_error_status(struct bmi2_vfrm_err_status *vfrm_err_stat, struct bmi2_dev *dev)
2952 /* Variable to define error */
2953 int8_t rslt;
2955 /* Array to define the feature configuration */
2956 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2958 /* Variables to define index */
2959 uint8_t idx = 0;
2961 /* Variable to set flag */
2962 uint8_t feat_found;
2964 /* Initialize feature output for VFRM error status */
2965 struct bmi2_feature_config vfrm_err_cfg = { 0, 0, 0 };
2967 /* Search for VFRM error status feature and extract its configuration details */
2968 feat_found = extract_output_feat_config(&vfrm_err_cfg, BMI2_VFRM_STATUS, dev);
2969 if (feat_found)
2971 /* Get the feature output configuration for VFRM error status */
2972 rslt = bmi2_get_feat_config(vfrm_err_cfg.page, feat_config, dev);
2973 if (rslt == BMI2_OK)
2975 /* Define the offset in bytes for VFRM error status */
2976 idx = vfrm_err_cfg.start_addr;
2978 /* Increment index to get the error status */
2979 idx++;
2981 /* Internal error while acquiring lock for FIFO */
2982 vfrm_err_stat->lock_error = BMI2_GET_BITS(feat_config[idx], BMI2_VFRM_LOCK_ERR_STATUS);
2984 /* Internal error while writing byte into FIFO */
2985 vfrm_err_stat->write_error = BMI2_GET_BITS(feat_config[idx], BMI2_VFRM_WRITE_ERR_STATUS);
2987 /* Internal error while writing into FIFO */
2988 vfrm_err_stat->fatal_error = BMI2_GET_BITS(feat_config[idx], BMI2_VFRM_FATAL_ERR_STATUS);
2991 else
2993 rslt = BMI2_E_INVALID_SENSOR;
2996 return rslt;
3000 * @brief This internal API skips S4S frame in the FIFO data while getting
3001 * step activity output.
3003 static int8_t move_if_s4s_frame(const uint8_t *frame_header, uint16_t *data_index, const struct bmi2_fifo_frame *fifo)
3005 /* Variable to define error */
3006 int8_t rslt = BMI2_OK;
3008 /* Variable to extract virtual header byte */
3009 uint8_t virtual_header_mode;
3011 /* Variable to define pay-load in words */
3012 uint8_t payload_word = 0;
3014 /* Variable to define pay-load in bytes */
3015 uint8_t payload_bytes = 0;
3017 /* Extract virtual header mode from the frame header */
3018 virtual_header_mode = BMI2_GET_BITS(*frame_header, BMI2_FIFO_VIRT_FRM_MODE);
3020 /* If the extracted header byte is a virtual header */
3021 if (virtual_header_mode == BMI2_FIFO_VIRT_FRM_MODE)
3023 /* If frame header is not activity recognition header */
3024 if (*frame_header != 0xC8)
3026 /* Extract pay-load in words from the header byte */
3027 payload_word = BMI2_GET_BITS(*frame_header, BMI2_FIFO_VIRT_PAYLOAD) + 1;
3029 /* Convert to bytes */
3030 payload_bytes = (uint8_t)(payload_word * 2);
3032 /* Move the data index by those pay-load bytes */
3033 rslt = move_next_frame(data_index, payload_bytes, fifo);
3037 return rslt;
3041 * @brief This internal API enables/disables compensation of the gain defined
3042 * in the GAIN register.
3044 static int8_t enable_gyro_gain(uint8_t enable, struct bmi2_dev *dev)
3046 /* Variable to define error */
3047 int8_t rslt;
3049 /* Variable to define register data */
3050 uint8_t reg_data = 0;
3052 rslt = bmi2_get_regs(BMI2_GYR_OFF_COMP_6_ADDR, &reg_data, 1, dev);
3053 if (rslt == BMI2_OK)
3055 reg_data = BMI2_SET_BITS(reg_data, BMI2_GYR_GAIN_EN, enable);
3056 rslt = bmi2_set_regs(BMI2_GYR_OFF_COMP_6_ADDR, &reg_data, 1, dev);
3059 return rslt;
3063 * @brief This internal API is used to extract the output feature configuration
3064 * details from the look-up table.
3066 static uint8_t extract_output_feat_config(struct bmi2_feature_config *feat_output,
3067 uint8_t type,
3068 const struct bmi2_dev *dev)
3070 /* Variable to define loop */
3071 uint8_t loop = 0;
3073 /* Variable to set flag */
3074 uint8_t feat_found = BMI2_FALSE;
3076 /* Search for the output feature from the output configuration array */
3077 while (loop < dev->out_sens)
3079 if (dev->feat_output[loop].type == type)
3081 *feat_output = dev->feat_output[loop];
3082 feat_found = BMI2_TRUE;
3083 break;
3086 loop++;
3089 /* Return flag */
3090 return feat_found;
3094 * @brief This internal API is used to move the data index ahead of the
3095 * current_frame_length parameter when unnecessary FIFO data appears while
3096 * extracting the user specified data.
3098 static int8_t move_next_frame(uint16_t *data_index, uint8_t current_frame_length, const struct bmi2_fifo_frame *fifo)
3100 /* Variables to define error */
3101 int8_t rslt = BMI2_OK;
3103 /* Validate data index */
3104 if (((*data_index) + current_frame_length) > fifo->length)
3106 /* Move the data index to the last byte */
3107 (*data_index) = fifo->length;
3109 /* FIFO is empty */
3110 rslt = BMI2_W_FIFO_EMPTY;
3112 else
3114 /* Move the data index to next frame */
3115 (*data_index) = (*data_index) + current_frame_length;
3117 /* More frames could be read */
3118 rslt = BMI2_W_PARTIAL_READ;
3121 return rslt;