Merge pull request #11189 from klutvott123/move-telemetry-displayport-init
[betaflight.git] / lib / main / BoschSensortec / BMI270-Sensor-API / bmi270_hc.c
bloba7c9172dd456636d808f413d58f15f9d4710fa1e
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_hc.c
34 * @date 2020-11-04
35 * @version v2.63.1
39 /***************************************************************************/
41 /*! Header files
42 ****************************************************************************/
43 #include "bmi270_hc.h"
45 /***************************************************************************/
47 /*! Global Variable
48 ****************************************************************************/
50 /*! @name Global array that stores the configuration file of BMI270_huawei_context */
51 const uint8_t bmi270_hc_config_file[] = {
52 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x00, 0xb0, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0xa8,
53 0x03, 0x80, 0x2e, 0x91, 0x03, 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x7d, 0xb0, 0x50, 0x30, 0x21, 0x2e, 0x59, 0xf5,
54 0x10, 0x30, 0x21, 0x2e, 0x6a, 0xf5, 0x80, 0x2e, 0xae, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x39, 0x01, 0x00, 0x22,
55 0x00, 0x76, 0x00, 0x00, 0x10, 0x00, 0x10, 0xd1, 0x00, 0x72, 0xb3, 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, 0xd0, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
66 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x1a, 0x24, 0x22, 0x00, 0x80, 0x2e, 0x48, 0x02, 0x01, 0x2e, 0x49, 0xf1, 0x0b,
71 0xbc, 0x10, 0x50, 0x0f, 0xb8, 0x00, 0x90, 0xfb, 0x7f, 0x07, 0x2f, 0x03, 0x2e, 0x21, 0xf2, 0x02, 0x31, 0x4a, 0x0a,
72 0x23, 0x2e, 0x21, 0xf2, 0x09, 0x2c, 0x00, 0x30, 0x98, 0x2e, 0x0e, 0xc7, 0x03, 0x2e, 0x21, 0xf2, 0xf2, 0x3e, 0x4a,
73 0x08, 0x23, 0x2e, 0x21, 0xf2, 0xfb, 0x6f, 0xf0, 0x5f, 0xb8, 0x2e, 0x13, 0x52, 0x00, 0x2e, 0x60, 0x40, 0x41, 0x40,
74 0x0d, 0xbc, 0x98, 0xbc, 0xc0, 0x2e, 0x01, 0x0a, 0x0f, 0xb8, 0x43, 0x86, 0x25, 0x40, 0x04, 0x40, 0xd8, 0xbe, 0x2c,
75 0x0b, 0x22, 0x11, 0x54, 0x42, 0x03, 0x80, 0x4b, 0x0e, 0xf6, 0x2f, 0xb8, 0x2e, 0x15, 0x50, 0x10, 0x50, 0x17, 0x52,
76 0x05, 0x2e, 0x7e, 0x00, 0xfb, 0x7f, 0x00, 0x2e, 0x13, 0x40, 0x93, 0x42, 0x41, 0x0e, 0xfb, 0x2f, 0x98, 0x2e, 0xe0,
77 0x03, 0x98, 0x2e, 0x87, 0xcf, 0x01, 0x2e, 0x8b, 0x00, 0x00, 0xb2, 0x08, 0x2f, 0x01, 0x2e, 0x69, 0xf7, 0xb1, 0x3f,
78 0x01, 0x08, 0x01, 0x30, 0x23, 0x2e, 0x8b, 0x00, 0x21, 0x2e, 0x69, 0xf7, 0xfb, 0x6f, 0xf0, 0x5f, 0xb8, 0x2e, 0x98,
79 0x00, 0xff, 0x3f, 0x00, 0x0c, 0xff, 0x0f, 0x00, 0x04, 0xc0, 0x00, 0x5b, 0xf5, 0x8f, 0x00, 0x1e, 0xf2, 0xfd, 0xf5,
80 0x8d, 0x00, 0x95, 0x00, 0x95, 0x00, 0xe0, 0x00, 0x19, 0xf4, 0x66, 0xf5, 0x00, 0x18, 0xff, 0x00, 0x64, 0xf5, 0x9c,
81 0x00, 0x81, 0x00, 0x83, 0x00, 0x7f, 0x00, 0xff, 0xfb, 0x21, 0x02, 0x00, 0x10, 0x00, 0x40, 0x3a, 0x0f, 0xeb, 0x00,
82 0x7f, 0xff, 0xc2, 0xf5, 0x68, 0xf7, 0x34, 0x0f, 0x28, 0x0f, 0x2e, 0x0f, 0x80, 0x00, 0x4d, 0x0f, 0x58, 0xf7, 0x5b,
83 0xf7, 0x50, 0x0f, 0x00, 0x80, 0xff, 0x7f, 0x86, 0x00, 0x3f, 0x0f, 0x52, 0x0f, 0xb3, 0xf1, 0x4c, 0x0f, 0x6c, 0xf7,
84 0xb9, 0xf1, 0xc6, 0xf1, 0x00, 0xe0, 0x00, 0xff, 0xd1, 0xf5, 0x54, 0x0f, 0x57, 0x0f, 0xff, 0x03, 0x00, 0xfc, 0xf0,
85 0x3f, 0xb9, 0x00, 0x2d, 0xf5, 0xca, 0xf5, 0x6d, 0x03, 0xf0, 0x07, 0xc3, 0x11, 0x1d, 0x08, 0x12, 0x08, 0xb7, 0x15,
86 0x9c, 0x01, 0xed, 0x14, 0xc2, 0x53, 0xca, 0x10, 0xa2, 0x00, 0x74, 0x01, 0xba, 0x17, 0xb4, 0x56, 0xe8, 0x16, 0x9f,
87 0x00, 0xd7, 0x13, 0x2f, 0x52, 0x8a, 0x51, 0x64, 0x01, 0xc6, 0x53, 0xf4, 0x0b, 0x06, 0x08, 0xfc, 0x57, 0xe3, 0x44,
88 0xad, 0x55, 0x4c, 0x01, 0x62, 0x01, 0x0b, 0x08, 0xa0, 0x18, 0x39, 0x59, 0x56, 0x2b, 0x14, 0x01, 0x2a, 0x58, 0x5e,
89 0x0c, 0xc1, 0x47, 0x16, 0x5a, 0xd2, 0x07, 0x2b, 0x21, 0x7f, 0x53, 0x03, 0x08, 0xca, 0x59, 0x1a, 0x0b, 0x5f, 0x57,
90 0x36, 0x47, 0xa6, 0x17, 0x02, 0x01, 0x33, 0x49, 0xdd, 0x58, 0x71, 0x0c, 0x32, 0x08, 0xc6, 0x59, 0xd4, 0x42, 0x65,
91 0x54, 0x15, 0x59, 0x64, 0x08, 0x0c, 0x08, 0x8c, 0x01, 0x98, 0x00, 0x0f, 0x48, 0x02, 0x58, 0x96, 0x0c, 0x1c, 0x43,
92 0x77, 0x48, 0xe9, 0x00, 0x1e, 0x0c, 0xf5, 0x41, 0xf6, 0x46, 0x64, 0x51, 0x98, 0x41, 0xcc, 0x01, 0x66, 0x58, 0x70,
93 0x45, 0x28, 0x21, 0xe7, 0x59, 0x22, 0x30, 0x00, 0x08, 0x71, 0x7d, 0x49, 0x01, 0x92, 0x02, 0xf5, 0xd6, 0xe8, 0x63,
94 0x7a, 0xfa, 0x87, 0x05, 0x0f, 0xcb, 0xa3, 0x72, 0x37, 0xfc, 0xca, 0x03, 0x95, 0xc7, 0x2e, 0x6d, 0x39, 0xc4, 0xc8,
95 0x3b, 0x91, 0x37, 0x29, 0x02, 0x9e, 0x01, 0x00, 0xf0, 0x33, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
96 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
98 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
99 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
100 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
101 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
103 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
104 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
105 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2e, 0xd5, 0xb5, 0x80, 0x2e, 0x00, 0xc1, 0xfd, 0x2d, 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, 0x01, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
110 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xe1, 0x06, 0x66, 0x0a, 0x0a, 0x00, 0x0a, 0x00, 0x5a, 0x8d, 0x33,
111 0x73, 0xcd, 0x8c, 0x9a, 0x99, 0x71, 0x7d, 0xcd, 0x8c, 0xcd, 0x6c, 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, 0xbd, 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, 0x9b, 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, 0x0e, 0xb1, 0x01, 0x50, 0x98,
117 0x2e, 0xdd, 0xb5, 0x10, 0x30, 0x21, 0x2e, 0x19, 0x00, 0x01, 0x2e, 0x86, 0x00, 0x04, 0xae, 0x0b, 0x2f, 0x01, 0x2e,
118 0x9b, 0x00, 0x00, 0xb2, 0x07, 0x2f, 0x01, 0x52, 0x98, 0x2e, 0x74, 0x0e, 0x00, 0xb2, 0x02, 0x2f, 0x10, 0x30, 0x21,
119 0x2e, 0x79, 0x00, 0x01, 0x2e, 0x79, 0x00, 0x00, 0x90, 0x90, 0x2e, 0x14, 0x03, 0x01, 0x2e, 0x89, 0x00, 0x00, 0xb2,
120 0x04, 0x2f, 0x98, 0x2e, 0x15, 0x0e, 0x00, 0x30, 0x21, 0x2e, 0x7c, 0x00, 0x01, 0x2e, 0x7c, 0x00, 0x00, 0xb2, 0x12,
121 0x2f, 0x01, 0x2e, 0x86, 0x00, 0x00, 0x90, 0x02, 0x2f, 0x98, 0x2e, 0x05, 0x0e, 0x09, 0x2d, 0x98, 0x2e, 0x5d, 0x0d,
122 0x01, 0x2e, 0x86, 0x00, 0x04, 0x90, 0x02, 0x2f, 0x50, 0x32, 0x98, 0x2e, 0x48, 0x03, 0x00, 0x30, 0x21, 0x2e, 0x7c,
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, 0x86, 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, 0xa4, 0xb1, 0x21, 0x2d,
128 0x61, 0x30, 0x23, 0x2e, 0x86, 0x00, 0x98, 0x2e, 0xa4, 0xb1, 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, 0x86, 0x00, 0x10, 0x30, 0x98, 0x2e, 0xa4,
131 0xb1, 0x03, 0x2d, 0x60, 0x30, 0x21, 0x2e, 0x86, 0x00, 0x01, 0x2e, 0x86, 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, 0x86, 0x00, 0x20, 0x30, 0x98, 0x2e, 0xea, 0x03, 0x50, 0x32, 0x98, 0x2e, 0x48, 0x03, 0x05, 0x2d,
134 0x98, 0x2e, 0x1e, 0x0e, 0x00, 0x30, 0x21, 0x2e, 0x86, 0x00, 0x00, 0x30, 0x21, 0x2e, 0x78, 0x00, 0x18, 0x2d, 0x01,
135 0x2e, 0x86, 0x00, 0x03, 0xaa, 0x01, 0x2f, 0x98, 0x2e, 0x2b, 0x0e, 0x01, 0x2e, 0x86, 0x00, 0x3f, 0x80, 0x03, 0xa2,
136 0x01, 0x2f, 0x00, 0x2e, 0x02, 0x2d, 0x98, 0x2e, 0x41, 0x0e, 0x30, 0x30, 0x98, 0x2e, 0xaf, 0xb1, 0x00, 0x30, 0x21,
137 0x2e, 0x79, 0x00, 0x50, 0x32, 0x98, 0x2e, 0x48, 0x03, 0x01, 0x2e, 0x19, 0x00, 0x00, 0xb2, 0x10, 0x2f, 0x01, 0x2e,
138 0x87, 0x00, 0x21, 0x2e, 0x8f, 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, 0xe1, 0x00, 0x00, 0x30, 0x21, 0x2e, 0x19, 0x00,
140 0x21, 0x2e, 0x9b, 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, 0x20, 0x50, 0xe7, 0x7f, 0xf6, 0x7f, 0x46, 0x30, 0x0f, 0x2e, 0xa4, 0xf1, 0xbe, 0x09, 0x80, 0xb3, 0x06,
149 0x2f, 0x0d, 0x2e, 0x86, 0x00, 0x84, 0xaf, 0x02, 0x2f, 0x16, 0x30, 0x2d, 0x2e, 0x7c, 0x00, 0x86, 0x30, 0x2d, 0x2e,
150 0x60, 0xf5, 0xf6, 0x6f, 0xe7, 0x6f, 0xe0, 0x5f, 0xc8, 0x2e, 0xa0, 0x50, 0x80, 0x7f, 0xe7, 0x7f, 0xd5, 0x7f, 0xc4,
151 0x7f, 0xb3, 0x7f, 0xa2, 0x7f, 0x91, 0x7f, 0xf6, 0x7f, 0x7b, 0x7f, 0x00, 0x2e, 0x01, 0x2e, 0x60, 0xf5, 0x60, 0x7f,
152 0x98, 0x2e, 0xcd, 0x00, 0x62, 0x6f, 0x01, 0x32, 0x91, 0x08, 0x80, 0xb2, 0x0d, 0x2f, 0x00, 0xb2, 0x03, 0x2f, 0x05,
153 0x2e, 0x18, 0x00, 0x80, 0x90, 0x05, 0x2f, 0x25, 0x56, 0x02, 0x30, 0xc1, 0x42, 0xc2, 0x86, 0x00, 0x2e, 0xc2, 0x42,
154 0x23, 0x2e, 0x60, 0xf5, 0x00, 0x90, 0x00, 0x30, 0x06, 0x2f, 0x21, 0x2e, 0x7a, 0x00, 0x23, 0x50, 0x21, 0x2e, 0x5a,
155 0xf2, 0x98, 0x2e, 0xfb, 0x01, 0xf6, 0x6f, 0x80, 0x6f, 0x91, 0x6f, 0xa2, 0x6f, 0xb3, 0x6f, 0xc4, 0x6f, 0xd5, 0x6f,
156 0xe7, 0x6f, 0x7b, 0x6f, 0x60, 0x5f, 0xc8, 0x2e, 0x03, 0x2e, 0x7e, 0x00, 0x16, 0xb8, 0x02, 0x34, 0x4a, 0x0c, 0x21,
157 0x2e, 0x2d, 0xf5, 0xc0, 0x2e, 0x23, 0x2e, 0x7e, 0x00, 0x03, 0xbc, 0x21, 0x2e, 0x87, 0x00, 0x03, 0x2e, 0x87, 0x00,
158 0x40, 0xb2, 0x10, 0x30, 0x21, 0x2e, 0x19, 0x00, 0x01, 0x30, 0x05, 0x2f, 0x05, 0x2e, 0x8a, 0x00, 0x80, 0x90, 0x01,
159 0x2f, 0x23, 0x2e, 0x6f, 0xf5, 0xc0, 0x2e, 0x21, 0x2e, 0x8b, 0x00, 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, 0x91, 0x7f, 0x80, 0x7f, 0x80, 0xb3, 0xd5, 0x7f, 0xc4, 0x7f, 0xb3, 0x7f, 0x7b, 0x7f, 0x11, 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, 0x01, 0x2e, 0x61, 0xf7, 0x01, 0x31, 0x01, 0x0a, 0x21, 0x2e, 0x61, 0xf7, 0x80, 0x30, 0x03, 0x2e,
164 0x78, 0x00, 0x08, 0x08, 0x00, 0xb2, 0x42, 0x2f, 0x03, 0x2e, 0x24, 0x02, 0x01, 0x2e, 0x24, 0x02, 0x97, 0xbc, 0x06,
165 0xbc, 0x9f, 0xb8, 0x0f, 0xb8, 0x00, 0x90, 0x23, 0x2e, 0x8a, 0x00, 0x10, 0x30, 0x01, 0x30, 0x2a, 0x2f, 0x03, 0x2e,
166 0x86, 0x00, 0x44, 0xb2, 0x05, 0x2f, 0x47, 0xb2, 0x00, 0x30, 0x2d, 0x2f, 0x21, 0x2e, 0x78, 0x00, 0x2b, 0x2d, 0x03,
167 0x2e, 0xfd, 0xf5, 0x9e, 0xbc, 0x9f, 0xb8, 0x40, 0x90, 0x14, 0x2f, 0x03, 0x2e, 0xfc, 0xf5, 0x99, 0xbc, 0x9f, 0xb8,
168 0x40, 0x90, 0x0e, 0x2f, 0x03, 0x2e, 0x49, 0xf1, 0x1b, 0x54, 0x4a, 0x08, 0x40, 0x90, 0x08, 0x2f, 0x98, 0x2e, 0xcd,
169 0x00, 0x00, 0xb2, 0x10, 0x30, 0x03, 0x2f, 0x50, 0x30, 0x21, 0x2e, 0x86, 0x00, 0x10, 0x2d, 0x98, 0x2e, 0xea, 0x03,
170 0x00, 0x30, 0x21, 0x2e, 0x78, 0x00, 0x0a, 0x2d, 0x05, 0x2e, 0x69, 0xf7, 0x2d, 0xbd, 0x2f, 0xb9, 0x80, 0xb2, 0x01,
171 0x2f, 0x21, 0x2e, 0x79, 0x00, 0x23, 0x2e, 0x78, 0x00, 0xe0, 0x31, 0x21, 0x2e, 0x61, 0xf5, 0xf6, 0x6f, 0xe7, 0x6f,
172 0x80, 0x6f, 0xa2, 0x6f, 0xb3, 0x6f, 0xc4, 0x6f, 0xd5, 0x6f, 0x7b, 0x6f, 0x91, 0x6f, 0x40, 0x5f, 0xc8, 0x2e, 0x90,
173 0x50, 0xf7, 0x7f, 0xe6, 0x7f, 0xd5, 0x7f, 0xc4, 0x7f, 0xb3, 0x7f, 0xa1, 0x7f, 0x90, 0x7f, 0x82, 0x7f, 0x7b, 0x7f,
174 0x98, 0x2e, 0xcd, 0x00, 0x00, 0xb2, 0x12, 0x30, 0x5c, 0x2f, 0x01, 0x2e, 0x21, 0x02, 0x03, 0x2e, 0x28, 0x02, 0x9f,
175 0xbc, 0x9f, 0xb8, 0x21, 0x56, 0x8a, 0x08, 0x03, 0x08, 0x82, 0x0a, 0x25, 0x2e, 0x18, 0x00, 0x05, 0x2e, 0xc1, 0xf5,
176 0x2e, 0xbc, 0x05, 0x2e, 0x86, 0x00, 0x84, 0xa2, 0x0e, 0xb8, 0x31, 0x30, 0x88, 0x04, 0x07, 0x2f, 0x01, 0x2e, 0x18,
177 0x00, 0x00, 0x90, 0x03, 0x2f, 0x01, 0x2e, 0x7b, 0x00, 0x00, 0xb2, 0x19, 0x2f, 0x1d, 0x50, 0x01, 0x52, 0x98, 0x2e,
178 0xd6, 0x00, 0x05, 0x2e, 0x7a, 0x00, 0x25, 0x2e, 0x9b, 0x00, 0x05, 0x2e, 0x7a, 0x00, 0x80, 0x90, 0x02, 0x2f, 0x12,
179 0x30, 0x25, 0x2e, 0x7a, 0x00, 0x01, 0x2e, 0x7b, 0x00, 0x00, 0xb2, 0x05, 0x2e, 0x18, 0x00, 0x02, 0x2f, 0x10, 0x30,
180 0x21, 0x2e, 0x18, 0x00, 0x25, 0x2e, 0x7b, 0x00, 0x05, 0x2e, 0x18, 0x00, 0x80, 0xb2, 0x20, 0x2f, 0x01, 0x2e, 0xc0,
181 0xf5, 0xf2, 0x30, 0x02, 0x08, 0x07, 0xaa, 0x73, 0x30, 0x03, 0x2e, 0x7d, 0x00, 0x18, 0x22, 0x41, 0x1a, 0x05, 0x2f,
182 0x03, 0x2e, 0x66, 0xf5, 0x9f, 0xbc, 0x9f, 0xb8, 0x40, 0x90, 0x0c, 0x2f, 0x1f, 0x52, 0x03, 0x30, 0x53, 0x42, 0x2b,
183 0x30, 0x90, 0x04, 0x5b, 0x42, 0x21, 0x2e, 0x7d, 0x00, 0x24, 0xbd, 0x7e, 0x80, 0x81, 0x84, 0x43, 0x42, 0x02, 0x42,
184 0x02, 0x32, 0x25, 0x2e, 0x62, 0xf5, 0x05, 0x2e, 0x88, 0x00, 0x81, 0x84, 0x25, 0x2e, 0x88, 0x00, 0x02, 0x31, 0x25,
185 0x2e, 0x60, 0xf5, 0x05, 0x2e, 0x25, 0x02, 0x10, 0x30, 0x90, 0x08, 0x80, 0xb2, 0x0b, 0x2f, 0x05, 0x2e, 0xca, 0xf5,
186 0xf0, 0x3e, 0x90, 0x08, 0x25, 0x2e, 0xca, 0xf5, 0x05, 0x2e, 0x59, 0xf5, 0xe0, 0x3f, 0x90, 0x08, 0x25, 0x2e, 0x59,
187 0xf5, 0x90, 0x6f, 0xa1, 0x6f, 0xb3, 0x6f, 0xc4, 0x6f, 0xd5, 0x6f, 0xe6, 0x6f, 0xf7, 0x6f, 0x7b, 0x6f, 0x82, 0x6f,
188 0x70, 0x5f, 0xc8, 0x2e, 0x31, 0x50, 0xe0, 0x50, 0x12, 0x40, 0x06, 0x40, 0x1a, 0x25, 0x77, 0x88, 0x75, 0x8a, 0x21,
189 0x56, 0x6c, 0xbf, 0x00, 0x30, 0xd3, 0x08, 0x6c, 0xbb, 0x60, 0x7f, 0x00, 0x43, 0x40, 0x43, 0xc0, 0xb2, 0xd6, 0x7f,
190 0xe5, 0x7f, 0xf4, 0x7f, 0xc3, 0x7f, 0xbb, 0x7f, 0x74, 0x2f, 0x01, 0x2e, 0x85, 0x00, 0x00, 0xb2, 0x0b, 0x2f, 0x27,
191 0x52, 0x01, 0x2e, 0x80, 0x00, 0xa2, 0x7f, 0x98, 0x2e, 0xbb, 0xcc, 0x01, 0x30, 0x23, 0x2e, 0x85, 0x00, 0xa2, 0x6f,
192 0xc3, 0x6f, 0x1a, 0x25, 0x26, 0xbc, 0x86, 0xba, 0x25, 0xbc, 0x0f, 0xb8, 0x54, 0xb1, 0x00, 0xb2, 0xa6, 0x7f, 0x0c,
193 0x2f, 0x29, 0x50, 0x2b, 0x54, 0x0b, 0x30, 0x0b, 0x2e, 0x21, 0x02, 0x2f, 0x58, 0x1b, 0x42, 0x9b, 0x42, 0x6c, 0x09,
194 0x0b, 0x42, 0x2b, 0x2e, 0x21, 0x02, 0x8b, 0x42, 0x72, 0x84, 0x33, 0x50, 0x58, 0x09, 0x03, 0x52, 0x01, 0x50, 0x92,
195 0x7f, 0x85, 0x7f, 0x98, 0x2e, 0xc2, 0xc0, 0x01, 0x2e, 0x80, 0x00, 0xf5, 0x6f, 0xe4, 0x6f, 0x83, 0x6f, 0x92, 0x6f,
196 0x27, 0x52, 0x2d, 0x5c, 0x98, 0x2e, 0x06, 0xcd, 0xc3, 0x6f, 0x29, 0x50, 0x72, 0x6f, 0xb4, 0xbc, 0x14, 0x40, 0x80,
197 0xb2, 0x9f, 0xba, 0x02, 0x40, 0x01, 0x30, 0xf0, 0x7f, 0x05, 0x2f, 0x40, 0xb3, 0x03, 0x2f, 0x2b, 0x5c, 0x11, 0x30,
198 0x94, 0x43, 0x82, 0x43, 0xb3, 0xbd, 0xbf, 0xb9, 0xc0, 0xb2, 0x1c, 0x2f, 0x53, 0x6f, 0x23, 0x01, 0x63, 0x6f, 0x93,
199 0x02, 0x02, 0x42, 0x40, 0x91, 0x29, 0x2e, 0x81, 0x00, 0x2b, 0x50, 0x12, 0x2f, 0x2b, 0x56, 0x00, 0x2e, 0xd5, 0x40,
200 0xc3, 0x40, 0x65, 0x05, 0xd3, 0x06, 0xc0, 0xaa, 0x04, 0x2f, 0xc0, 0x90, 0x08, 0x2f, 0xa3, 0x6f, 0x5d, 0x0f, 0x05,
201 0x2f, 0xa5, 0x6f, 0x40, 0xb3, 0x02, 0x2f, 0x14, 0x42, 0x02, 0x42, 0x11, 0x30, 0xd0, 0x6f, 0x98, 0x2e, 0x95, 0xcf,
202 0xf2, 0x6f, 0x15, 0x52, 0x01, 0x2e, 0x81, 0x00, 0x82, 0x40, 0x50, 0x42, 0x08, 0x2c, 0x42, 0x42, 0x11, 0x30, 0x23,
203 0x2e, 0x85, 0x00, 0x01, 0x30, 0xd0, 0x6f, 0x98, 0x2e, 0x95, 0xcf, 0x00, 0x2e, 0xbb, 0x6f, 0x20, 0x5f, 0xb8, 0x2e,
204 0x11, 0x30, 0x81, 0x08, 0x01, 0x2e, 0x6a, 0xf7, 0x71, 0x3f, 0x23, 0xbd, 0x01, 0x08, 0x02, 0x0a, 0xc0, 0x2e, 0x21,
205 0x2e, 0x6a, 0xf7, 0x30, 0x25, 0x00, 0x30, 0x21, 0x2e, 0x5a, 0xf5, 0x10, 0x50, 0x21, 0x2e, 0x7c, 0x00, 0x21, 0x2e,
206 0x78, 0x00, 0xfb, 0x7f, 0x98, 0x2e, 0xa4, 0xb1, 0x40, 0x30, 0x21, 0x2e, 0x86, 0x00, 0xfb, 0x6f, 0xf0, 0x5f, 0x03,
207 0x25, 0x80, 0x2e, 0xea, 0x03, 0x51, 0x56, 0x05, 0x40, 0x69, 0x18, 0x0d, 0x17, 0xe1, 0x18, 0x19, 0x05, 0x16, 0x25,
208 0x37, 0x25, 0x4a, 0x17, 0x54, 0x18, 0xec, 0x18, 0x04, 0x30, 0x64, 0x07, 0xea, 0x18, 0x8e, 0x00, 0x5f, 0x02, 0x35,
209 0x56, 0x93, 0x00, 0x4c, 0x02, 0x2f, 0xb9, 0x91, 0xbc, 0x91, 0x0a, 0x02, 0x42, 0xb8, 0x2e, 0x0b, 0x00, 0x40, 0xb3,
210 0x94, 0x02, 0x0b, 0x2f, 0x50, 0xa1, 0x03, 0x2f, 0x70, 0x8b, 0x85, 0x14, 0x07, 0x2c, 0x00, 0x30, 0x04, 0x31, 0x25,
211 0x05, 0x04, 0x13, 0x95, 0x14, 0x05, 0x14, 0x94, 0x0a, 0x47, 0x5a, 0x45, 0x01, 0x04, 0x30, 0x94, 0x02, 0xd8, 0xba,
212 0xc0, 0x2e, 0x28, 0xbd, 0x2a, 0x0a, 0x4a, 0x18, 0x00, 0x30, 0xc1, 0x18, 0x6f, 0xb8, 0xc0, 0x2e, 0xf1, 0xbc, 0x01,
213 0x0a, 0x4e, 0x86, 0x80, 0x40, 0x70, 0x50, 0xd1, 0x40, 0x86, 0x84, 0xf0, 0x7f, 0x84, 0x30, 0xce, 0x8a, 0xe2, 0x7f,
214 0x20, 0x04, 0x54, 0x41, 0xc2, 0x40, 0x4c, 0x04, 0x43, 0x41, 0x93, 0x06, 0x49, 0x18, 0x03, 0x31, 0xd8, 0x04, 0x30,
215 0x88, 0xd1, 0x18, 0xd4, 0x7f, 0x00, 0xb2, 0x72, 0x8b, 0xd1, 0x18, 0xc3, 0x7f, 0xbb, 0x7f, 0x0a, 0x2f, 0x10, 0xa0,
216 0x03, 0x2f, 0xd1, 0x6f, 0xb9, 0x13, 0x06, 0x2c, 0x07, 0x30, 0xc1, 0x6f, 0x79, 0x14, 0xb0, 0x12, 0xf8, 0x13, 0x91,
217 0x0b, 0x51, 0x41, 0x4e, 0x85, 0x00, 0xb2, 0x94, 0x40, 0xb2, 0x86, 0x82, 0x40, 0x26, 0x01, 0xa3, 0x7f, 0x97, 0x02,
218 0x43, 0x41, 0x4c, 0x00, 0x9a, 0x02, 0x0a, 0x2f, 0x10, 0xa0, 0x03, 0x2f, 0xd1, 0x6f, 0x51, 0x12, 0x06, 0x2c, 0x02,
219 0x30, 0xc3, 0x6f, 0xd3, 0x14, 0x48, 0x12, 0x90, 0x12, 0x4b, 0x0a, 0x98, 0x2e, 0x79, 0xc0, 0xa1, 0x6f, 0x4f, 0x8a,
220 0x72, 0x8d, 0x43, 0x41, 0x42, 0x40, 0xf5, 0x6f, 0xab, 0xbc, 0x35, 0xba, 0x25, 0xb9, 0xbb, 0xbd, 0xf0, 0x7f, 0x75,
221 0x25, 0x98, 0x2e, 0xdb, 0xb1, 0xd0, 0x7f, 0x57, 0x25, 0x91, 0x41, 0x8e, 0x81, 0x82, 0x41, 0x13, 0x40, 0x04, 0x40,
222 0x32, 0x8c, 0x98, 0x2e, 0xdb, 0xb1, 0xc0, 0x7f, 0x57, 0x25, 0x91, 0x41, 0x8e, 0x81, 0x82, 0x41, 0x13, 0x40, 0x04,
223 0x40, 0x32, 0x8c, 0x98, 0x2e, 0xdb, 0xb1, 0xa0, 0x7f, 0x57, 0x25, 0x91, 0x41, 0x8e, 0x81, 0x82, 0x41, 0x13, 0x40,
224 0x04, 0x40, 0x32, 0x8c, 0x98, 0x2e, 0xdb, 0xb1, 0x90, 0x7f, 0x57, 0x25, 0x91, 0x41, 0x8e, 0x81, 0x82, 0x41, 0x13,
225 0x40, 0x04, 0x40, 0x32, 0x8c, 0x98, 0x2e, 0xdb, 0xb1, 0x57, 0x25, 0x91, 0x41, 0x8e, 0x89, 0xe7, 0x6f, 0x13, 0x41,
226 0x82, 0x41, 0x04, 0x41, 0xe0, 0x7f, 0x98, 0x2e, 0xdb, 0xb1, 0x57, 0x25, 0xf1, 0x6f, 0x52, 0x41, 0xf0, 0x7f, 0x98,
227 0x2e, 0xf3, 0xb1, 0xd1, 0x6f, 0x52, 0x41, 0x30, 0x25, 0x98, 0x2e, 0xf3, 0xb1, 0xc1, 0x6f, 0x52, 0x41, 0xd0, 0x7f,
228 0x98, 0x2e, 0xf3, 0xb1, 0xa1, 0x6f, 0x52, 0x41, 0xc0, 0x7f, 0x98, 0x2e, 0xf3, 0xb1, 0x91, 0x6f, 0x52, 0x41, 0xa0,
229 0x7f, 0x98, 0x2e, 0xf3, 0xb1, 0xe1, 0x6f, 0x52, 0x41, 0x40, 0x25, 0x98, 0x2e, 0xf3, 0xb1, 0x70, 0x25, 0x42, 0x41,
230 0xf1, 0x6f, 0x57, 0x25, 0x98, 0x2e, 0xf3, 0xb1, 0x7b, 0x52, 0xd9, 0x0f, 0x90, 0x2e, 0x70, 0xb3, 0x81, 0x32, 0x69,
231 0x0e, 0x06, 0x2f, 0x01, 0x32, 0x41, 0x0e, 0x0d, 0x53, 0x0f, 0x55, 0x0a, 0x22, 0x80, 0x2e, 0x71, 0xb3, 0x51, 0x34,
232 0x59, 0x0e, 0xd1, 0x6f, 0xc2, 0x6f, 0x90, 0x2e, 0x4f, 0xb3, 0x99, 0x5e, 0x57, 0x0e, 0x7c, 0x2f, 0xaf, 0x5e, 0x4f,
233 0x0e, 0x4d, 0x2f, 0x02, 0xa2, 0x2f, 0x2f, 0xe9, 0x50, 0x60, 0x0e, 0x06, 0x2f, 0x07, 0x55, 0x4a, 0x0e, 0x09, 0x53,
234 0x0b, 0x55, 0x0a, 0x22, 0x80, 0x2e, 0x71, 0xb3, 0xeb, 0x50, 0x60, 0x0e, 0x10, 0x2f, 0xfb, 0x52, 0xd1, 0x0f, 0x0a,
235 0x2f, 0x45, 0xa3, 0x01, 0x53, 0x03, 0x55, 0x4a, 0x22, 0xa2, 0x6f, 0xfd, 0x50, 0x50, 0x0e, 0xff, 0x54, 0x11, 0x22,
236 0x80, 0x2e, 0x71, 0xb3, 0x05, 0x51, 0x80, 0x2e, 0x71, 0xb3, 0xed, 0x54, 0x4a, 0x0e, 0x07, 0x2f, 0xa1, 0x6f, 0xf5,
237 0x54, 0x4a, 0x0e, 0xf7, 0x52, 0xf9, 0x54, 0x0a, 0x22, 0x80, 0x2e, 0x71, 0xb3, 0xef, 0x52, 0x59, 0x0e, 0xf1, 0x52,
238 0xf3, 0x54, 0x0a, 0x22, 0x80, 0x2e, 0x71, 0xb3, 0xcb, 0x52, 0x61, 0x0e, 0x0e, 0x2f, 0xa1, 0x6f, 0xdd, 0x54, 0xca,
239 0x0f, 0x08, 0x2f, 0x01, 0xa2, 0xe1, 0x52, 0xe3, 0x54, 0x4a, 0x22, 0xdf, 0x54, 0x62, 0x0e, 0xe5, 0x54, 0x77, 0x2c,
240 0x0a, 0x22, 0x75, 0x2c, 0xe7, 0x50, 0xd7, 0x52, 0x51, 0x0e, 0xd9, 0x52, 0xdb, 0x54, 0x4a, 0x22, 0x72, 0x35, 0x5a,
241 0x0e, 0xd5, 0x54, 0x6b, 0x2c, 0x11, 0x22, 0xb1, 0x56, 0x53, 0x0e, 0x0a, 0x2f, 0xa1, 0x6f, 0xcf, 0x54, 0x4a, 0x0e,
242 0xd1, 0x52, 0xd3, 0x54, 0x4a, 0x22, 0xcb, 0x54, 0x62, 0x0e, 0xcd, 0x54, 0x5d, 0x2c, 0x11, 0x22, 0x0c, 0xa2, 0x05,
243 0x2f, 0xc5, 0x52, 0x61, 0x0e, 0xc7, 0x52, 0xc9, 0x54, 0x55, 0x2c, 0x0a, 0x22, 0xb3, 0x54, 0x62, 0x0e, 0x0a, 0x2f,
244 0xa2, 0x6f, 0xbf, 0x50, 0x50, 0x0e, 0xc1, 0x54, 0xc3, 0x50, 0x90, 0x22, 0xbb, 0x50, 0x48, 0x0e, 0xbd, 0x52, 0x47,
245 0x2c, 0x0a, 0x22, 0x43, 0xa3, 0xb5, 0x52, 0xb7, 0x54, 0x4a, 0x22, 0x54, 0xa3, 0xb9, 0x54, 0x3f, 0x2c, 0x0a, 0x22,
246 0x41, 0xa3, 0x14, 0x2f, 0xa0, 0x37, 0x50, 0x0e, 0x0f, 0x2f, 0xa1, 0x54, 0x4a, 0x0e, 0x0a, 0x2f, 0xa7, 0x52, 0x61,
247 0x0e, 0xa9, 0x52, 0xab, 0x54, 0x4a, 0x22, 0xa2, 0x6f, 0xa5, 0x50, 0x50, 0x0e, 0xad, 0x54, 0x2c, 0x2c, 0x0a, 0x22,
248 0x2a, 0x2c, 0xa3, 0x50, 0x28, 0x2c, 0x9f, 0x50, 0x01, 0xa2, 0x9b, 0x52, 0x9d, 0x54, 0x23, 0x2c, 0x0a, 0x22, 0x20,
249 0x33, 0x58, 0x0e, 0x09, 0x2f, 0x91, 0x50, 0x48, 0x0e, 0x93, 0x52, 0x95, 0x50, 0x48, 0x22, 0x8f, 0x50, 0x50, 0x0e,
250 0x97, 0x54, 0x16, 0x2c, 0x0a, 0x22, 0x7d, 0x54, 0x62, 0x0e, 0x0e, 0x2f, 0x81, 0x54, 0xe2, 0x0f, 0x09, 0x2f, 0x87,
251 0x54, 0x4a, 0x0e, 0x89, 0x52, 0x8b, 0x54, 0x4a, 0x22, 0x83, 0x54, 0x62, 0x0e, 0x85, 0x54, 0x06, 0x2c, 0x11, 0x22,
252 0x04, 0x2c, 0x8d, 0x50, 0x02, 0x2c, 0x7f, 0x50, 0x11, 0x51, 0xbb, 0x6f, 0x90, 0x5f, 0xb8, 0x2e, 0x32, 0x25, 0xb0,
253 0x51, 0xc2, 0x32, 0x82, 0x00, 0xe0, 0x7f, 0xd2, 0x7f, 0x04, 0x30, 0x80, 0x40, 0x01, 0x80, 0x90, 0x42, 0xc2, 0x7f,
254 0x10, 0x30, 0x85, 0x40, 0x2c, 0x03, 0x94, 0x42, 0x4a, 0x25, 0x85, 0x40, 0x28, 0x28, 0x80, 0x42, 0x25, 0x3d, 0xc3,
255 0x80, 0x2b, 0x89, 0x95, 0x00, 0x81, 0x7f, 0xb2, 0x7f, 0xa4, 0x7f, 0x90, 0x7f, 0x7b, 0x7f, 0x00, 0x2e, 0xd1, 0x40,
256 0x03, 0x54, 0x53, 0x7f, 0x64, 0x7f, 0x98, 0x2e, 0xd9, 0xc0, 0x64, 0x6f, 0x53, 0x6f, 0x91, 0x6f, 0x10, 0x43, 0x59,
257 0x0e, 0xf3, 0x2f, 0xa1, 0x6f, 0x98, 0x2e, 0xb3, 0xc0, 0xb1, 0x6f, 0x13, 0x33, 0x40, 0x42, 0x00, 0xac, 0xcb, 0x00,
258 0x02, 0x2f, 0xe1, 0x6f, 0x53, 0x54, 0x42, 0x42, 0xd1, 0x3d, 0x59, 0x00, 0xc3, 0x40, 0xcf, 0xb0, 0xce, 0x00, 0x72,
259 0x80, 0xc2, 0x40, 0x11, 0x40, 0x91, 0x00, 0xd2, 0x42, 0x89, 0x16, 0xc4, 0x40, 0x22, 0x03, 0x02, 0x40, 0x05, 0x33,
260 0x05, 0x00, 0xd4, 0x42, 0xb3, 0x7f, 0x90, 0x7f, 0x98, 0x2e, 0xfe, 0xc9, 0x91, 0x6f, 0xd2, 0x3d, 0xb3, 0x6f, 0x00,
261 0x18, 0x8a, 0x00, 0xc0, 0x40, 0xb2, 0x88, 0x06, 0x00, 0xd0, 0x42, 0xa0, 0x35, 0xc5, 0x40, 0x6f, 0x03, 0x46, 0x40,
262 0x8f, 0xb1, 0x96, 0x00, 0x20, 0x00, 0xc5, 0x42, 0x92, 0x7f, 0xb0, 0x7f, 0x02, 0x32, 0x01, 0x41, 0x33, 0x30, 0x98,
263 0x2e, 0x0f, 0xca, 0xb5, 0x6f, 0x11, 0x3b, 0x63, 0x41, 0x64, 0x41, 0x44, 0x85, 0x45, 0x41, 0xa6, 0x40, 0x87, 0x40,
264 0x51, 0x00, 0xf7, 0x7f, 0xb1, 0x7f, 0x20, 0x25, 0x98, 0x2e, 0x67, 0xcc, 0xb1, 0x6f, 0xb3, 0x33, 0xcb, 0x00, 0xea,
265 0x82, 0xc2, 0x40, 0x1a, 0xa4, 0xe5, 0x6f, 0x04, 0x30, 0x13, 0x30, 0x01, 0x2f, 0x80, 0xa0, 0x03, 0x2f, 0x2e, 0xac,
266 0x0a, 0x2f, 0x80, 0xa4, 0x08, 0x2f, 0x90, 0x6f, 0x04, 0x80, 0x77, 0x34, 0x06, 0x40, 0x6f, 0x01, 0xa2, 0x04, 0xf3,
267 0x28, 0x42, 0x43, 0x03, 0x42, 0xd3, 0x3d, 0x42, 0x40, 0xcb, 0x00, 0xf2, 0x82, 0x8f, 0xb0, 0xde, 0x00, 0x43, 0x80,
268 0x42, 0x40, 0xb3, 0x7f, 0x90, 0x7f, 0xb3, 0x30, 0x13, 0x53, 0x98, 0x2e, 0x5a, 0xca, 0x3a, 0x25, 0xe8, 0x82, 0xee,
269 0x86, 0xe2, 0x6f, 0x82, 0x84, 0x43, 0x7f, 0x20, 0x7f, 0x51, 0x7f, 0x61, 0x7f, 0x32, 0x7f, 0x05, 0x30, 0xa4, 0x6f,
270 0x83, 0x30, 0x00, 0x30, 0x11, 0x41, 0x22, 0x6f, 0x14, 0x7f, 0x00, 0x7f, 0xf5, 0x7e, 0x98, 0x2e, 0x0f, 0xca, 0x33,
271 0x6f, 0x51, 0x6f, 0xc3, 0x40, 0x50, 0x42, 0x51, 0x7f, 0xe0, 0x7e, 0xc0, 0x90, 0x02, 0x2f, 0x91, 0x6f, 0x00, 0x2e,
272 0x40, 0x42, 0x00, 0x2e, 0xe2, 0x6e, 0x90, 0x6f, 0x15, 0x53, 0x98, 0x2e, 0xc3, 0xb1, 0x93, 0x6f, 0xe1, 0x6e, 0xd2,
273 0x40, 0x0a, 0x18, 0x01, 0x6f, 0x0e, 0x00, 0x93, 0x7f, 0x83, 0x30, 0x14, 0x6f, 0xf1, 0x6e, 0x42, 0x6f, 0x62, 0x0e,
274 0x4f, 0x03, 0xd9, 0x2f, 0x35, 0x52, 0xc1, 0x00, 0x01, 0x30, 0xa9, 0x02, 0x91, 0x6f, 0x7c, 0x82, 0x21, 0xbd, 0xbf,
275 0xb9, 0x1b, 0x30, 0x0a, 0x25, 0xda, 0x0a, 0x5b, 0x42, 0x25, 0x80, 0x33, 0x7f, 0x51, 0x7f, 0x20, 0x7f, 0x90, 0x7f,
276 0xd3, 0x30, 0x64, 0x6f, 0x55, 0x6f, 0x10, 0x41, 0x52, 0x41, 0x31, 0x6f, 0x55, 0x7f, 0x10, 0x7f, 0x04, 0x7f, 0x98,
277 0x2e, 0x0f, 0xca, 0x11, 0x6f, 0x20, 0x25, 0x98, 0x2e, 0xfe, 0xc9, 0x21, 0x6f, 0x04, 0x6f, 0x50, 0x42, 0x21, 0x7f,
278 0xd3, 0x30, 0xa1, 0x6f, 0x61, 0x0e, 0xea, 0x2f, 0xb1, 0x6f, 0x45, 0x84, 0x32, 0x25, 0x90, 0x40, 0x84, 0x40, 0x91,
279 0x6f, 0xb4, 0x7f, 0x92, 0x7f, 0x30, 0x7f, 0x23, 0x7f, 0x98, 0x2e, 0xb3, 0xc0, 0x53, 0x6f, 0xb1, 0x32, 0x19, 0x01,
280 0x83, 0xb9, 0x31, 0x6f, 0x4b, 0x00, 0x02, 0x41, 0xb0, 0x6f, 0x03, 0x30, 0xc3, 0x02, 0x8f, 0xb0, 0xb4, 0x7f, 0xd5,
281 0x3d, 0x25, 0x01, 0xa2, 0x6f, 0xa4, 0x7f, 0x26, 0x01, 0x27, 0x6f, 0x90, 0x6f, 0x07, 0x89, 0xc1, 0x43, 0x94, 0x7f,
282 0x03, 0x42, 0x00, 0x2e, 0x11, 0x41, 0x31, 0x7f, 0x54, 0x7f, 0x00, 0x2e, 0x91, 0x40, 0x03, 0x41, 0x23, 0x7f, 0x12,
283 0x7f, 0x98, 0x2e, 0x74, 0xc0, 0x31, 0x6f, 0xc8, 0x00, 0x90, 0x6f, 0x01, 0x30, 0x54, 0x6f, 0x22, 0x6f, 0x03, 0x42,
284 0xd1, 0x02, 0x41, 0x6f, 0x12, 0x6f, 0x23, 0x43, 0x94, 0x7f, 0x51, 0x0e, 0xe7, 0x2f, 0xb1, 0x6f, 0xa3, 0x6f, 0x42,
285 0x40, 0x8f, 0xb0, 0xf8, 0x82, 0xde, 0x00, 0xc9, 0x86, 0x52, 0x34, 0xb3, 0x7f, 0x8a, 0x00, 0xc6, 0x86, 0xa2, 0x7f,
286 0x93, 0x7f, 0x00, 0x2e, 0xa5, 0x6f, 0xe2, 0x6f, 0x63, 0x41, 0x64, 0x41, 0x44, 0x8f, 0x82, 0x40, 0xe6, 0x41, 0xc0,
287 0x41, 0xc4, 0x8f, 0x45, 0x41, 0xf0, 0x7f, 0xa7, 0x7f, 0x51, 0x7f, 0x98, 0x2e, 0x67, 0xcc, 0x00, 0x18, 0x09, 0x52,
288 0x71, 0x00, 0x03, 0x30, 0xbb, 0x02, 0x1b, 0xba, 0xb3, 0x6f, 0x25, 0xbc, 0x51, 0x6f, 0xc5, 0x40, 0x42, 0x82, 0x20,
289 0x0a, 0x28, 0x00, 0xd0, 0x42, 0x2b, 0xb9, 0xc0, 0x40, 0x82, 0x02, 0xd2, 0x42, 0xb3, 0x7f, 0x00, 0x2e, 0x92, 0x6f,
290 0x5a, 0x0e, 0xd9, 0x2f, 0xa1, 0x6f, 0x43, 0x3d, 0x8b, 0x00, 0x9a, 0x82, 0x83, 0x6f, 0x41, 0x40, 0xc3, 0x40, 0xe0,
291 0x6f, 0x14, 0x33, 0x04, 0x00, 0x82, 0x40, 0x4b, 0x12, 0x51, 0x0e, 0xb0, 0x7f, 0x90, 0x2e, 0x7a, 0xb5, 0x02, 0x40,
292 0x8f, 0xb0, 0xd1, 0x3d, 0x41, 0x00, 0x72, 0x30, 0xd3, 0x04, 0x73, 0x80, 0x4e, 0x00, 0x02, 0x31, 0xd3, 0x05, 0xa0,
293 0x7f, 0xf0, 0x8c, 0x04, 0x40, 0x52, 0x40, 0xc0, 0xb2, 0x50, 0x40, 0x4c, 0x17, 0x96, 0x7f, 0x57, 0x7f, 0x0a, 0x2f,
294 0xd0, 0xa0, 0x03, 0x2f, 0x95, 0x6f, 0x65, 0x15, 0x06, 0x2c, 0x04, 0x30, 0x56, 0x6f, 0xa6, 0x13, 0x6b, 0x15, 0x23,
295 0x15, 0x6e, 0x0b, 0x14, 0x05, 0x64, 0x18, 0x45, 0x07, 0xec, 0x18, 0xc0, 0xb2, 0xec, 0x18, 0x0a, 0x2f, 0xd0, 0xa0,
296 0x03, 0x2f, 0x94, 0x6f, 0xbc, 0x13, 0x06, 0x2c, 0x07, 0x30, 0x54, 0x6f, 0x3c, 0x15, 0x73, 0x13, 0xfb, 0x13, 0xac,
297 0x0b, 0x44, 0x40, 0x26, 0x05, 0x54, 0x42, 0xc0, 0xb2, 0x44, 0x40, 0x27, 0x07, 0x44, 0x42, 0x08, 0x2f, 0xd0, 0xa0,
298 0x02, 0x2f, 0x91, 0x6f, 0x05, 0x2c, 0x81, 0x10, 0x51, 0x6f, 0x41, 0x14, 0xd3, 0x12, 0x99, 0x0a, 0xa1, 0x6f, 0xf3,
299 0x32, 0x42, 0x42, 0x4b, 0x00, 0x13, 0x30, 0x42, 0x40, 0xd3, 0x28, 0x53, 0x42, 0xa1, 0x7f, 0xc2, 0xa2, 0x30, 0x2f,
300 0x82, 0x6f, 0xe1, 0x6f, 0x98, 0x2e, 0xfa, 0xb1, 0x81, 0x6f, 0x41, 0x84, 0x00, 0x2e, 0x81, 0x40, 0x40, 0x90, 0x02,
301 0x2f, 0x00, 0x2e, 0x07, 0x2c, 0x0c, 0xb8, 0x30, 0x25, 0xe1, 0x6f, 0x20, 0x33, 0x48, 0x00, 0x98, 0x2e, 0x07, 0xb6,
302 0xe1, 0x6f, 0xf3, 0x32, 0x4b, 0x00, 0xe0, 0x7f, 0x00, 0x2e, 0x44, 0x40, 0x20, 0x1a, 0x15, 0x2f, 0xd3, 0x6f, 0xc1,
303 0x6f, 0xc3, 0x40, 0x23, 0x5a, 0x42, 0x40, 0x83, 0x7e, 0x08, 0xbc, 0x25, 0x09, 0x92, 0x7e, 0xc4, 0x0a, 0x42, 0x82,
304 0xa3, 0x7e, 0xd1, 0x7f, 0x34, 0x30, 0x63, 0x6f, 0x82, 0x30, 0x31, 0x30, 0x98, 0x2e, 0xb2, 0x00, 0xd1, 0x6f, 0xe3,
305 0x6f, 0x43, 0x42, 0x00, 0x2e, 0xa1, 0x6f, 0xb2, 0x6f, 0x43, 0x40, 0xc1, 0x86, 0xc2, 0xa2, 0x43, 0x42, 0x03, 0x30,
306 0x00, 0x2f, 0x83, 0x42, 0xd2, 0x3d, 0x40, 0x40, 0x0f, 0xb0, 0x0a, 0x01, 0x26, 0x00, 0x05, 0x32, 0x98, 0x2e, 0x7e,
307 0xb5, 0x65, 0x00, 0x00, 0x2e, 0x43, 0x42, 0x00, 0x2e, 0x7b, 0x6f, 0x50, 0x5e, 0xb8, 0x2e, 0x0f, 0x82, 0x02, 0x30,
308 0x12, 0x42, 0x41, 0x0e, 0xfc, 0x2f, 0xb8, 0x2e, 0xc1, 0x35, 0x40, 0x51, 0x01, 0x01, 0x02, 0x30, 0x1a, 0x25, 0x13,
309 0x30, 0x12, 0x42, 0x44, 0x0e, 0xfc, 0x2f, 0x54, 0x3a, 0x04, 0x01, 0x1d, 0x5b, 0x05, 0x7f, 0x75, 0x34, 0x13, 0x5f,
310 0x07, 0x43, 0x25, 0x01, 0x47, 0x5a, 0x05, 0x43, 0x27, 0x89, 0x67, 0x5a, 0x05, 0x43, 0x18, 0x8b, 0x19, 0x59, 0x17,
311 0x51, 0xd4, 0x7e, 0x43, 0x43, 0xc0, 0x7e, 0xe0, 0x7e, 0x6c, 0x88, 0x1b, 0x5d, 0xf6, 0x7e, 0x71, 0x86, 0x42, 0x81,
312 0x15, 0x41, 0x15, 0x42, 0x63, 0x0e, 0xfb, 0x2f, 0x21, 0x59, 0x1f, 0x5d, 0x25, 0x5f, 0x23, 0x5b, 0x34, 0x7f, 0x16,
313 0x7f, 0x45, 0x7f, 0x57, 0x7f, 0x22, 0x7f, 0x76, 0x88, 0xd5, 0x40, 0x15, 0x42, 0x5c, 0x0e, 0xfb, 0x2f, 0x29, 0x57,
314 0x27, 0x5d, 0x2d, 0x5f, 0x2b, 0x5b, 0x83, 0x7f, 0x66, 0x7f, 0x95, 0x7f, 0xa7, 0x7f, 0x72, 0x7f, 0x7b, 0x86, 0x15,
315 0x41, 0x15, 0x42, 0x63, 0x0e, 0xfb, 0x2f, 0x31, 0x59, 0x33, 0x5d, 0x2f, 0x5b, 0xc5, 0x7f, 0xd4, 0x7f, 0xf6, 0x7f,
316 0xb2, 0x7f, 0xe2, 0x7f, 0x40, 0x82, 0xd2, 0x40, 0x12, 0x42, 0x59, 0x0e, 0xfb, 0x2f, 0xc0, 0x5e, 0xb8, 0x2e, 0x00,
317 0x30, 0xc0, 0x2e, 0x21, 0x2e, 0x8c, 0x00, 0x35, 0x51, 0xc0, 0x2e, 0x21, 0x2e, 0xad, 0x00, 0x05, 0x2e, 0x28, 0x02,
318 0x2f, 0xbd, 0x2f, 0xb9, 0x20, 0x50, 0x80, 0xb2, 0x16, 0x2f, 0x20, 0x25, 0x01, 0x2e, 0x8c, 0x00, 0x00, 0x90, 0x0b,
319 0x2f, 0x37, 0x51, 0xf2, 0x7f, 0xeb, 0x7f, 0x98, 0x2e, 0x84, 0xb5, 0x01, 0x2e, 0x8c, 0x00, 0x01, 0x80, 0x21, 0x2e,
320 0x8c, 0x00, 0xf2, 0x6f, 0xeb, 0x6f, 0xe0, 0x5f, 0x03, 0x2e, 0xad, 0x00, 0x37, 0x51, 0x80, 0x2e, 0x74, 0xb3, 0x00,
321 0x30, 0x21, 0x2e, 0x8c, 0x00, 0xe0, 0x5f, 0xb8, 0x2e, 0x02, 0x30, 0x02, 0x2c, 0x41, 0x00, 0x12, 0x42, 0x41, 0x0e,
322 0xfc, 0x2f, 0xb8, 0x2e, 0x81, 0x8e, 0x39, 0x51, 0x07, 0x5c, 0x58, 0x09, 0x9e, 0x09, 0xc3, 0x41, 0x50, 0x50, 0xc3,
323 0x89, 0xf3, 0x0e, 0x41, 0x80, 0xf0, 0x7f, 0xdc, 0xb9, 0xe4, 0x7f, 0x44, 0x80, 0x84, 0x8e, 0x43, 0x88, 0xd1, 0x7f,
324 0x05, 0x30, 0xc2, 0x7f, 0x21, 0x2f, 0xf1, 0x6f, 0x00, 0x2e, 0x41, 0x40, 0x19, 0x1a, 0x1c, 0x2f, 0x82, 0x84, 0x00,
325 0x2e, 0x82, 0x40, 0xf2, 0x0e, 0x05, 0x2f, 0x02, 0x41, 0x81, 0x84, 0x01, 0x30, 0x03, 0x30, 0x22, 0x2c, 0x02, 0x43,
326 0xff, 0x84, 0x42, 0x00, 0x60, 0x25, 0x43, 0x40, 0xc1, 0x86, 0x43, 0x42, 0x11, 0x30, 0xc2, 0x41, 0x03, 0x30, 0x97,
327 0x41, 0xc1, 0x86, 0xfa, 0x0f, 0x13, 0x2f, 0xc5, 0xa2, 0xf9, 0x2f, 0x03, 0x30, 0x10, 0x2c, 0x01, 0x30, 0xd2, 0x6f,
328 0x00, 0x2e, 0x82, 0x40, 0x80, 0x90, 0x04, 0x2f, 0xd2, 0x6f, 0xf1, 0x6f, 0x17, 0x30, 0x87, 0x42, 0x43, 0x42, 0x00,
329 0x2e, 0x3b, 0x55, 0xf2, 0x0e, 0x12, 0x30, 0x55, 0x22, 0x40, 0xb2, 0xbb, 0x7f, 0x06, 0x2f, 0x51, 0x30, 0x60, 0x25,
330 0x98, 0x2e, 0x00, 0xb6, 0xbf, 0x81, 0x00, 0x2e, 0x05, 0x42, 0x00, 0x2e, 0xe2, 0x6f, 0x01, 0x41, 0x82, 0x40, 0xd0,
331 0x6f, 0x13, 0x88, 0xca, 0x0f, 0x49, 0x2f, 0xf2, 0x6f, 0xc0, 0xa6, 0x87, 0x40, 0x43, 0x2f, 0xc5, 0x6f, 0x02, 0x82,
332 0x43, 0x8d, 0x42, 0x40, 0x81, 0x8a, 0x86, 0x41, 0x6e, 0x0e, 0x45, 0x42, 0x47, 0x8a, 0xaa, 0x00, 0x1b, 0x30, 0x83,
333 0x42, 0x09, 0x84, 0xf2, 0x7f, 0x02, 0x30, 0x03, 0x2f, 0x0b, 0x43, 0x2f, 0x89, 0x00, 0x2e, 0x02, 0x43, 0x51, 0x88,
334 0x41, 0x40, 0x15, 0x41, 0x40, 0xb3, 0x4e, 0x22, 0x5f, 0x1a, 0x14, 0x80, 0x03, 0x41, 0x06, 0x2f, 0xc1, 0x84, 0xd6,
335 0x0e, 0x02, 0x42, 0x22, 0x2f, 0x00, 0x2e, 0x21, 0x2c, 0x06, 0x42, 0xff, 0x80, 0x41, 0x0f, 0x91, 0xb9, 0x10, 0x22,
336 0xf4, 0x6f, 0x61, 0x00, 0xc3, 0x0f, 0x12, 0x2f, 0x13, 0x30, 0x04, 0x30, 0xf6, 0x6f, 0x05, 0x30, 0x05, 0x2c, 0xe7,
337 0x7f, 0x97, 0x41, 0x3c, 0x1a, 0xda, 0x23, 0x6f, 0x01, 0x71, 0x0e, 0xf9, 0x2f, 0x68, 0x0f, 0xe6, 0x6f, 0xe6, 0x23,
338 0x01, 0x89, 0x28, 0x22, 0x05, 0xa7, 0xee, 0x2f, 0xf2, 0x6f, 0xb8, 0x84, 0x93, 0x82, 0x87, 0x42, 0x40, 0x42, 0x08,
339 0x2c, 0x07, 0x25, 0x13, 0x30, 0x50, 0x25, 0x98, 0x2e, 0xb3, 0xb6, 0x00, 0x30, 0x43, 0x43, 0x03, 0x43, 0x00, 0x2e,
340 0xbb, 0x6f, 0xb0, 0x5f, 0xb8, 0x2e, 0x15, 0x82, 0x02, 0x30, 0x12, 0x42, 0x41, 0x0e, 0xfc, 0x2f, 0xb8, 0x2e, 0x80,
341 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
342 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
343 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
344 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
345 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
346 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
347 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
348 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
349 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
350 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
351 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
352 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
353 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
354 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
355 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
356 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
357 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
358 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
359 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
360 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
361 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
362 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
363 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
364 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
365 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
366 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
367 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
368 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
369 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
370 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
371 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
372 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80,
373 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
374 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
375 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0xfd, 0x2d, 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, 0x35, 0x58, 0x02, 0x2f, 0x90, 0xa1, 0x26, 0x13, 0x20, 0x23, 0x80, 0x90,
378 0x10, 0x30, 0x01, 0x2f, 0xcc, 0x0e, 0x00, 0x2f, 0x00, 0x30, 0xb8, 0x2e, 0x3d, 0x56, 0x37, 0x54, 0xd0, 0x40, 0xc4,
379 0x40, 0x0b, 0x2e, 0xfd, 0xf3, 0x3d, 0x52, 0x90, 0x42, 0x94, 0x42, 0x95, 0x42, 0x05, 0x30, 0x3f, 0x50, 0x0f, 0x88,
380 0x06, 0x40, 0x04, 0x41, 0x96, 0x42, 0xc5, 0x42, 0x48, 0xbe, 0x73, 0x30, 0x0d, 0x2e, 0x8a, 0x00, 0x4f, 0xba, 0x84,
381 0x42, 0x03, 0x42, 0x81, 0xb3, 0x02, 0x2f, 0x2b, 0x2e, 0x6f, 0xf5, 0x06, 0x2d, 0x05, 0x2e, 0x77, 0xf7, 0x3b, 0x56,
382 0x93, 0x08, 0x25, 0x2e, 0x77, 0xf7, 0x39, 0x54, 0x25, 0x2e, 0xc2, 0xf5, 0x07, 0x2e, 0xfd, 0xf3, 0x42, 0x30, 0xb4,
383 0x33, 0xda, 0x0a, 0x4c, 0x00, 0x27, 0x2e, 0xfd, 0xf3, 0x43, 0x40, 0xd4, 0x3f, 0xdc, 0x08, 0x43, 0x42, 0x00, 0x2e,
384 0x00, 0x2e, 0x43, 0x40, 0x24, 0x30, 0xdc, 0x0a, 0x43, 0x42, 0x04, 0x80, 0x03, 0x2e, 0xfd, 0xf3, 0x4a, 0x0a, 0x23,
385 0x2e, 0xfd, 0xf3, 0x61, 0x34, 0xc0, 0x2e, 0x01, 0x42, 0x00, 0x2e, 0xd0, 0x51, 0xfb, 0x7f, 0x98, 0x2e, 0xcf, 0x0d,
386 0x5a, 0x25, 0x98, 0x2e, 0xf6, 0x0d, 0x6b, 0x87, 0x49, 0x54, 0xe1, 0x7f, 0xa3, 0x7f, 0xb3, 0x7f, 0xb2, 0x88, 0x41,
387 0x52, 0xc2, 0x7f, 0x65, 0x8b, 0x43, 0x56, 0x84, 0x7f, 0x61, 0x7f, 0x75, 0x7f, 0xd0, 0x7f, 0x95, 0x7f, 0x53, 0x7f,
388 0x14, 0x30, 0x45, 0x54, 0x81, 0x6f, 0x42, 0x7f, 0x00, 0x2e, 0x53, 0x40, 0x45, 0x8c, 0x42, 0x40, 0x90, 0x41, 0xbb,
389 0x83, 0x86, 0x41, 0xd8, 0x04, 0x16, 0x06, 0x00, 0xac, 0x81, 0x7f, 0x02, 0x2f, 0x02, 0x30, 0xd3, 0x04, 0x10, 0x06,
390 0xc1, 0x84, 0x01, 0x30, 0xc1, 0x02, 0x0b, 0x16, 0x04, 0x09, 0x14, 0x01, 0x99, 0x02, 0xc1, 0xb9, 0xaf, 0xbc, 0x59,
391 0x0a, 0x64, 0x6f, 0x51, 0x43, 0xa1, 0xb4, 0x12, 0x41, 0x13, 0x41, 0x41, 0x43, 0x35, 0x7f, 0x64, 0x7f, 0x26, 0x31,
392 0xe5, 0x6f, 0xd4, 0x6f, 0x98, 0x2e, 0x37, 0xca, 0x32, 0x6f, 0x75, 0x6f, 0x83, 0x40, 0x42, 0x41, 0x23, 0x7f, 0x12,
393 0x7f, 0xf6, 0x30, 0x40, 0x25, 0x51, 0x25, 0x98, 0x2e, 0x37, 0xca, 0x14, 0x6f, 0x20, 0x05, 0x70, 0x6f, 0x25, 0x6f,
394 0x69, 0x07, 0xa2, 0x6f, 0x31, 0x6f, 0x0b, 0x30, 0x04, 0x42, 0x9b, 0x42, 0x8b, 0x42, 0x55, 0x42, 0x32, 0x7f, 0x40,
395 0xa9, 0xc3, 0x6f, 0x71, 0x7f, 0x02, 0x30, 0xd0, 0x40, 0xc3, 0x7f, 0x03, 0x2f, 0x40, 0x91, 0x15, 0x2f, 0x00, 0xa7,
396 0x13, 0x2f, 0x00, 0xa4, 0x11, 0x2f, 0x84, 0xbd, 0x98, 0x2e, 0x79, 0xca, 0x55, 0x6f, 0x51, 0x54, 0x54, 0x41, 0x82,
397 0x00, 0xf3, 0x3f, 0x45, 0x41, 0xcb, 0x02, 0xf6, 0x30, 0x98, 0x2e, 0x37, 0xca, 0x33, 0x6f, 0xa4, 0x6f, 0xc1, 0x42,
398 0x03, 0x2c, 0x00, 0x43, 0xa4, 0x6f, 0x33, 0x6f, 0x00, 0x2e, 0x42, 0x6f, 0x55, 0x6f, 0x91, 0x40, 0x42, 0x8b, 0x00,
399 0x41, 0x41, 0x00, 0x01, 0x43, 0x55, 0x7f, 0x14, 0x30, 0xc1, 0x40, 0x95, 0x40, 0x4d, 0x02, 0xc5, 0x6f, 0x4f, 0x50,
400 0x68, 0x0e, 0x75, 0x6f, 0xd1, 0x42, 0xa3, 0x7f, 0x8a, 0x2f, 0x09, 0x2e, 0x8a, 0x00, 0x01, 0xb3, 0x22, 0x2f, 0x49,
401 0x58, 0x90, 0x6f, 0x17, 0x30, 0x13, 0x41, 0xb6, 0x6f, 0xe4, 0x7f, 0x00, 0x2e, 0x91, 0x41, 0x14, 0x40, 0x92, 0x41,
402 0x15, 0x40, 0x17, 0x2e, 0x6f, 0xf5, 0xb6, 0x7f, 0xd0, 0x7f, 0xcb, 0x7f, 0x98, 0x2e, 0x00, 0x0c, 0x07, 0x15, 0xc2,
403 0x6f, 0x14, 0x0b, 0x29, 0x2e, 0x6f, 0xf5, 0xc3, 0xa3, 0xc1, 0x8f, 0xe4, 0x6f, 0xd0, 0x6f, 0xe6, 0x2f, 0x14, 0x30,
404 0x05, 0x2e, 0x6f, 0xf5, 0x14, 0x0b, 0x29, 0x2e, 0x6f, 0xf5, 0x44, 0x2d, 0x4b, 0x54, 0x01, 0x32, 0x51, 0x58, 0x05,
405 0x30, 0x23, 0x50, 0x83, 0x40, 0xd8, 0x08, 0x91, 0x01, 0xb8, 0xbd, 0x38, 0xb5, 0xe6, 0x7f, 0x0a, 0x16, 0xb1, 0x6f,
406 0x2a, 0xbb, 0xa6, 0xbd, 0x1c, 0x01, 0x06, 0xbc, 0x52, 0x40, 0x06, 0x0a, 0x53, 0x40, 0x45, 0x03, 0xb1, 0x7f, 0xf6,
407 0x30, 0x98, 0x2e, 0x37, 0xca, 0x1a, 0xbd, 0x16, 0xb6, 0x86, 0xba, 0x00, 0xa9, 0xaa, 0x0a, 0x53, 0x52, 0x0f, 0x2f,
408 0x00, 0x91, 0x53, 0x52, 0x03, 0x2f, 0x53, 0x5a, 0x55, 0x0f, 0x53, 0x52, 0x08, 0x2f, 0x3f, 0xa1, 0x04, 0x2f, 0x3f,
409 0x91, 0x03, 0x2f, 0x51, 0x58, 0xd4, 0x0f, 0x00, 0x2f, 0x51, 0x54, 0x12, 0x25, 0xf2, 0x33, 0x98, 0x2e, 0xd9, 0xc0,
410 0xe4, 0x6f, 0xf5, 0x37, 0x45, 0x09, 0x21, 0x85, 0x05, 0x43, 0x05, 0x30, 0x4d, 0x52, 0x51, 0x0e, 0x01, 0x32, 0x51,
411 0x58, 0xc5, 0x2f, 0x47, 0x54, 0x09, 0x2e, 0x77, 0xf7, 0x22, 0x0b, 0x29, 0x2e, 0x77, 0xf7, 0xfb, 0x6f, 0x30, 0x5e,
412 0xb8, 0x2e, 0x10, 0x50, 0x01, 0x2e, 0x86, 0x00, 0x00, 0xb2, 0xfb, 0x7f, 0x5d, 0x2f, 0x01, 0xb2, 0x54, 0x2f, 0x02,
413 0xb2, 0x4e, 0x2f, 0x03, 0x90, 0x63, 0x2f, 0x59, 0x50, 0x39, 0x82, 0x02, 0x40, 0x81, 0x88, 0x5b, 0x54, 0x41, 0x40,
414 0x61, 0x56, 0x04, 0x42, 0x00, 0x2e, 0x94, 0x40, 0x95, 0x40, 0xd8, 0xbe, 0x2c, 0x0b, 0x45, 0x40, 0x6c, 0x01, 0x55,
415 0x42, 0x0c, 0x17, 0x45, 0x40, 0x2c, 0x03, 0x54, 0x42, 0x53, 0x0e, 0xf2, 0x2f, 0x63, 0x56, 0x3e, 0x82, 0xe2, 0x40,
416 0xc3, 0x40, 0x28, 0xbd, 0x93, 0x0a, 0x43, 0x40, 0xda, 0x00, 0x53, 0x42, 0x8a, 0x16, 0x43, 0x40, 0x9a, 0x02, 0x52,
417 0x42, 0x00, 0x2e, 0x41, 0x40, 0x47, 0x54, 0x4a, 0x0e, 0x3b, 0x2f, 0x3a, 0x82, 0x00, 0x30, 0x41, 0x40, 0x21, 0x2e,
418 0x52, 0x0f, 0x40, 0xb2, 0x0a, 0x2f, 0x98, 0x2e, 0x61, 0x0c, 0x98, 0x2e, 0x2b, 0x0e, 0x98, 0x2e, 0x41, 0x0e, 0xfb,
419 0x6f, 0xf0, 0x5f, 0x00, 0x30, 0x80, 0x2e, 0xaf, 0xb1, 0x5f, 0x54, 0x55, 0x56, 0x83, 0x42, 0x8f, 0x86, 0x74, 0x30,
420 0x5d, 0x54, 0xc4, 0x42, 0x11, 0x30, 0x23, 0x2e, 0x86, 0x00, 0xa1, 0x42, 0x23, 0x30, 0x27, 0x2e, 0x89, 0x00, 0x21,
421 0x2e, 0x88, 0x00, 0xba, 0x82, 0x18, 0x2c, 0x81, 0x42, 0x30, 0x30, 0x21, 0x2e, 0x86, 0x00, 0x13, 0x2d, 0x21, 0x30,
422 0x00, 0x30, 0x23, 0x2e, 0x86, 0x00, 0x21, 0x2e, 0x7b, 0xf7, 0x0c, 0x2d, 0x77, 0x30, 0x98, 0x2e, 0x1f, 0x0c, 0x57,
423 0x50, 0x0c, 0x82, 0x12, 0x30, 0x40, 0x42, 0x25, 0x2e, 0x86, 0x00, 0x2f, 0x2e, 0x7b, 0xf7, 0xfb, 0x6f, 0xf0, 0x5f,
424 0xb8, 0x2e, 0x70, 0x50, 0x0a, 0x25, 0x39, 0x86, 0xfb, 0x7f, 0xe1, 0x32, 0x62, 0x30, 0x98, 0x2e, 0xc2, 0xc4, 0x23,
425 0x56, 0xa5, 0x6f, 0xab, 0x08, 0x91, 0x6f, 0x4b, 0x08, 0x65, 0x56, 0xc4, 0x6f, 0x23, 0x09, 0x4d, 0xba, 0x93, 0xbc,
426 0x8c, 0x0b, 0xd1, 0x6f, 0x0b, 0x09, 0x49, 0x52, 0x67, 0x5e, 0x56, 0x42, 0xaf, 0x09, 0x4d, 0xba, 0x23, 0xbd, 0x94,
427 0x0a, 0xe5, 0x6f, 0x68, 0xbb, 0xeb, 0x08, 0xbd, 0xb9, 0x63, 0xbe, 0xfb, 0x6f, 0x52, 0x42, 0xe3, 0x0a, 0xc0, 0x2e,
428 0x43, 0x42, 0x90, 0x5f, 0x4f, 0x50, 0x03, 0x2e, 0x25, 0xf3, 0x12, 0x40, 0x00, 0x40, 0x28, 0xba, 0x9b, 0xbc, 0x88,
429 0xbd, 0x93, 0xb4, 0xe3, 0x0a, 0x89, 0x16, 0x08, 0xb6, 0xc0, 0x2e, 0x19, 0x00, 0x62, 0x02, 0x10, 0x50, 0xfb, 0x7f,
430 0x98, 0x2e, 0x5d, 0x0d, 0x01, 0x2e, 0x86, 0x00, 0x31, 0x30, 0x08, 0x04, 0xfb, 0x6f, 0x01, 0x30, 0xf0, 0x5f, 0x23,
431 0x2e, 0x88, 0x00, 0x21, 0x2e, 0x89, 0x00, 0xb8, 0x2e, 0x01, 0x2e, 0x89, 0x00, 0x03, 0x2e, 0x88, 0x00, 0x48, 0x0e,
432 0x01, 0x2f, 0x80, 0x2e, 0x05, 0x0e, 0xb8, 0x2e, 0x69, 0x50, 0x21, 0x34, 0x01, 0x42, 0x82, 0x30, 0xc1, 0x32, 0x25,
433 0x2e, 0x62, 0xf5, 0x01, 0x00, 0x22, 0x30, 0x01, 0x40, 0x4a, 0x0a, 0x01, 0x42, 0xb8, 0x2e, 0x69, 0x54, 0xf0, 0x3b,
434 0x83, 0x40, 0xd8, 0x08, 0x6b, 0x52, 0x83, 0x42, 0x00, 0x30, 0x83, 0x30, 0x50, 0x42, 0xc4, 0x32, 0x27, 0x2e, 0x64,
435 0xf5, 0x94, 0x00, 0x50, 0x42, 0x40, 0x42, 0xd3, 0x3f, 0x84, 0x40, 0x7d, 0x82, 0xe3, 0x08, 0x40, 0x42, 0x83, 0x42,
436 0xb8, 0x2e, 0x5f, 0x52, 0x00, 0x30, 0x40, 0x42, 0x7c, 0x86, 0x37, 0x52, 0x09, 0x2e, 0x3d, 0x0f, 0x3d, 0x54, 0xc4,
437 0x42, 0xd3, 0x86, 0x54, 0x40, 0x55, 0x40, 0x94, 0x42, 0x85, 0x42, 0x21, 0x2e, 0x89, 0x00, 0x42, 0x40, 0x25, 0x2e,
438 0xfd, 0xf3, 0xc0, 0x42, 0x7e, 0x82, 0x05, 0x2e, 0x79, 0x00, 0x80, 0xb2, 0x14, 0x2f, 0x05, 0x2e, 0x24, 0x02, 0x27,
439 0xbd, 0x2f, 0xb9, 0x80, 0x90, 0x02, 0x2f, 0x21, 0x2e, 0x6f, 0xf5, 0x0c, 0x2d, 0x07, 0x2e, 0x3e, 0x0f, 0x14, 0x30,
440 0x1c, 0x09, 0x05, 0x2e, 0x77, 0xf7, 0x3b, 0x56, 0x47, 0xbe, 0x93, 0x08, 0x94, 0x0a, 0x25, 0x2e, 0x77, 0xf7, 0x6d,
441 0x54, 0x50, 0x42, 0x4a, 0x0e, 0xfc, 0x2f, 0xb8, 0x2e, 0x50, 0x50, 0x02, 0x30, 0x43, 0x86, 0x6b, 0x50, 0xfb, 0x7f,
442 0xe3, 0x7f, 0xd2, 0x7f, 0xc0, 0x7f, 0xb1, 0x7f, 0x00, 0x2e, 0x41, 0x40, 0x00, 0x40, 0x48, 0x04, 0x98, 0x2e, 0x74,
443 0xc0, 0x1e, 0xaa, 0xd3, 0x6f, 0x14, 0x30, 0xb1, 0x6f, 0xe3, 0x22, 0xc0, 0x6f, 0x52, 0x40, 0xe4, 0x6f, 0x4c, 0x0e,
444 0x12, 0x42, 0xd3, 0x7f, 0xeb, 0x2f, 0x03, 0x2e, 0x53, 0x0f, 0x40, 0x90, 0x11, 0x30, 0x03, 0x2f, 0x23, 0x2e, 0x53,
445 0x0f, 0x02, 0x2c, 0x00, 0x30, 0xd0, 0x6f, 0xfb, 0x6f, 0xb0, 0x5f, 0xb8, 0x2e, 0x40, 0x50, 0xf1, 0x7f, 0x0a, 0x25,
446 0x3c, 0x86, 0xeb, 0x7f, 0x41, 0x33, 0x22, 0x30, 0x98, 0x2e, 0xc2, 0xc4, 0xd3, 0x6f, 0xf4, 0x30, 0xdc, 0x09, 0x71,
447 0x58, 0xc2, 0x6f, 0x94, 0x09, 0x73, 0x58, 0x6a, 0xbb, 0xdc, 0x08, 0xb4, 0xb9, 0xb1, 0xbd, 0x6f, 0x5a, 0x95, 0x08,
448 0x21, 0xbd, 0xf6, 0xbf, 0x77, 0x0b, 0x51, 0xbe, 0xf1, 0x6f, 0xeb, 0x6f, 0x52, 0x42, 0x54, 0x42, 0xc0, 0x2e, 0x43,
449 0x42, 0xc0, 0x5f, 0x50, 0x50, 0x77, 0x52, 0x93, 0x30, 0x53, 0x42, 0xfb, 0x7f, 0x7b, 0x30, 0x4b, 0x42, 0x13, 0x30,
450 0x42, 0x82, 0x20, 0x33, 0x43, 0x42, 0xc8, 0x00, 0x01, 0x2e, 0x80, 0x03, 0x05, 0x2e, 0x7e, 0x00, 0x19, 0x52, 0xe2,
451 0x7f, 0xd0, 0x7f, 0xc3, 0x7f, 0x98, 0x2e, 0x9c, 0x0e, 0xd1, 0x6f, 0x48, 0x0a, 0xd1, 0x7f, 0x3a, 0x25, 0xfb, 0x86,
452 0x01, 0x33, 0x12, 0x30, 0x98, 0x2e, 0xc2, 0xc4, 0xd1, 0x6f, 0x48, 0x0a, 0x40, 0xb2, 0x0d, 0x2f, 0xe0, 0x6f, 0x03,
453 0x2e, 0x80, 0x03, 0x53, 0x30, 0x07, 0x80, 0x27, 0x2e, 0x21, 0xf2, 0x98, 0xbc, 0x01, 0x42, 0x98, 0x2e, 0xe0, 0x03,
454 0x00, 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0xb1, 0x6f, 0x9b, 0xb8, 0x07, 0x2e, 0x1b, 0x00, 0x19, 0x1a, 0xb1, 0x7f, 0x71,
455 0x30, 0x04, 0x2f, 0x23, 0x2e, 0x21, 0xf2, 0x00, 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0x98, 0x2e, 0x6d, 0xc0, 0x98, 0x2e,
456 0x5d, 0xc0, 0x98, 0x2e, 0xd9, 0xb5, 0x20, 0x26, 0xc1, 0x6f, 0x02, 0x31, 0x52, 0x42, 0xab, 0x30, 0x4b, 0x42, 0x20,
457 0x33, 0x79, 0x56, 0xf1, 0x37, 0xc4, 0x40, 0xa2, 0x0a, 0xc2, 0x42, 0xd8, 0x00, 0x01, 0x2e, 0x5e, 0xf7, 0x41, 0x08,
458 0x23, 0x2e, 0x93, 0x00, 0xe3, 0x7f, 0x98, 0x2e, 0xe1, 0x00, 0xe1, 0x6f, 0x83, 0x30, 0x43, 0x42, 0x03, 0x30, 0xfb,
459 0x6f, 0x75, 0x50, 0x02, 0x30, 0x00, 0x2e, 0x00, 0x2e, 0x81, 0x84, 0x50, 0x0e, 0xfa, 0x2f, 0x43, 0x42, 0x11, 0x30,
460 0xb0, 0x5f, 0x23, 0x2e, 0x21, 0xf2, 0xb8, 0x2e, 0xc1, 0x4a, 0x00, 0x00, 0x6d, 0x57, 0x00, 0x00, 0x77, 0x8e, 0x00,
461 0x00, 0xe0, 0xff, 0xff, 0xff, 0xd3, 0xff, 0xff, 0xff, 0xe5, 0xff, 0xff, 0xff, 0xee, 0xe1, 0xff, 0xff, 0x7c, 0x13,
462 0x00, 0x00, 0x46, 0xe6, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
463 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
464 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
465 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1,
466 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00,
467 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e, 0x00, 0xc1, 0x80, 0x2e,
468 0x00, 0xc1, 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_HUAWEI_CONTEXT
489 const struct bmi2_feature_config bmi270_hc_feat_in[BMI270_HC_MAX_FEAT_IN] = {
490 { .type = BMI2_CONFIG_ID, .page = BMI2_PAGE_4, .start_addr = BMI270_HC_CONFIG_ID_STRT_ADDR },
491 { .type = BMI2_STEP_COUNTER_PARAMS, .page = BMI2_PAGE_1, .start_addr = BMI270_HC_STEP_CNT_1_STRT_ADDR },
492 { .type = BMI2_STEP_DETECTOR, .page = BMI2_PAGE_4, .start_addr = BMI270_HC_STEP_CNT_4_STRT_ADDR },
493 { .type = BMI2_STEP_COUNTER, .page = BMI2_PAGE_4, .start_addr = BMI270_HC_STEP_CNT_4_STRT_ADDR },
494 { .type = BMI2_NVM_PROG_PREP, .page = BMI2_PAGE_4, .start_addr = BMI270_HC_NVM_PROG_PREP_STRT_ADDR },
495 { .type = BMI2_MAX_BURST_LEN, .page = BMI2_PAGE_4, .start_addr = BMI270_HC_MAX_BURST_LEN_STRT_ADDR },
496 { .type = BMI2_CRT_GYRO_SELF_TEST, .page = BMI2_PAGE_4, .start_addr = BMI270_HC_CRT_GYRO_SELF_TEST_STRT_ADDR },
497 { .type = BMI2_ABORT_CRT_GYRO_SELF_TEST, .page = BMI2_PAGE_4, .start_addr = BMI270_HC_ABORT_STRT_ADDR },
498 { .type = BMI2_ACTIVITY_RECOGNITION_SETTINGS, .page = BMI2_PAGE_5, .start_addr = BMI270_HC_ACT_RGN_SETT_STRT_ADDR },
499 { .type = BMI2_ACTIVITY_RECOGNITION, .page = BMI2_PAGE_5, .start_addr = BMI270_HC_ACT_RGN_STRT_ADDR },
502 /*! @name Global array that stores the feature output configuration */
503 const struct bmi2_feature_config bmi270_hc_feat_out[BMI270_HC_MAX_FEAT_OUT] = {
504 { .type = BMI2_STEP_COUNTER, .page = BMI2_PAGE_0, .start_addr = BMI270_HC_STEP_CNT_OUT_STRT_ADDR },
505 { .type = BMI2_GYRO_CROSS_SENSE, .page = BMI2_PAGE_0, .start_addr = BMI270_HC_GYRO_CROSS_SENSE_STRT_ADDR },
506 { .type = BMI2_GYRO_GAIN_UPDATE, .page = BMI2_PAGE_0, .start_addr = BMI270_HC_GYR_USER_GAIN_OUT_STRT_ADDR },
507 { .type = BMI2_NVM_STATUS, .page = BMI2_PAGE_0, .start_addr = BMI270_HC_NVM_VFRM_OUT_STRT_ADDR },
508 { .type = BMI2_VFRM_STATUS, .page = BMI2_PAGE_0, .start_addr = BMI270_HC_NVM_VFRM_OUT_STRT_ADDR }
511 /*! @name Global array that stores the feature interrupts of BMI270_HUAWEI_CONTEXT */
512 struct bmi2_map_int bmi270_hc_map_int[BMI270_HC_MAX_INT_MAP] = {
513 { .type = BMI2_STEP_COUNTER, .sens_map_int = BMI270_HC_INT_STEP_COUNTER_MASK },
514 { .type = BMI2_STEP_DETECTOR, .sens_map_int = BMI270_HC_INT_STEP_DETECTOR_MASK },
517 /******************************************************************************/
519 /*! Local Function Prototypes
520 ******************************************************************************/
523 * @brief This internal API is used to validate the device pointer for
524 * null conditions.
526 * @param[in] dev : Structure instance of bmi2_dev.
528 * @return Result of API execution status
529 * @retval 0 -> Success
530 * @retval < 0 -> Fail
532 static int8_t null_ptr_check(const struct bmi2_dev *dev);
535 * @brief This internal API enables the selected sensor/features.
537 * @param[in] sensor_sel : Selects the desired sensor.
538 * @param[in, out] dev : Structure instance of bmi2_dev.
540 * @return Result of API execution status
541 * @retval 0 -> Success
542 * @retval < 0 -> Fail
544 static int8_t sensor_enable(uint64_t sensor_sel, struct bmi2_dev *dev);
547 * @brief This internal API disables the selected sensor/features.
549 * @param[in] sensor_sel : Selects the desired sensor.
550 * @param[in, out] dev : Structure instance of bmi2_dev.
552 * @return Result of API execution status
553 * @retval 0 -> Success
554 * @retval < 0 -> Fail
556 static int8_t sensor_disable(uint64_t sensor_sel, struct bmi2_dev *dev);
559 * @brief This internal API selects the sensors/features to be enabled or
560 * disabled.
562 * @param[in] sens_list : Pointer to select the sensor.
563 * @param[in] n_sens : Number of sensors selected.
564 * @param[out] sensor_sel : Gets the selected sensor.
566 * @return Result of API execution status
567 * @retval 0 -> Success
568 * @retval < 0 -> Fail
570 static int8_t select_sensor(const uint8_t *sens_list, uint8_t n_sens, uint64_t *sensor_sel);
573 * @brief This internal API is used to enable/disable step detector feature.
575 * @param[in] dev : Structure instance of bmi2_dev.
576 * @param[in] enable : Enables/Disables step-detector.
578 * Enable | Description
579 * -------------|---------------
580 * BMI2_DISABLE | Disables step detector
581 * BMI2_ENABLE | Enables step detector
583 * @return Result of API execution status
584 * @retval 0 -> Success
585 * @retval < 0 -> Fail
587 static int8_t set_step_detector(uint8_t enable, struct bmi2_dev *dev);
590 * @brief This internal API is used to enable/disable step counter feature.
592 * @param[in] dev : Structure instance of bmi2_dev.
593 * @param[in] enable : Enables/Disables step counter.
595 * Enable | Description
596 * -------------|---------------
597 * BMI2_DISABLE | Disables step counter
598 * BMI2_ENABLE | Enables step counter
600 * @return Result of API execution status
601 * @retval 0 -> Success
602 * @retval < 0 -> Fail
604 static int8_t set_step_counter(uint8_t enable, struct bmi2_dev *dev);
607 * @brief This internal API enables/disables the activity recognition feature.
609 * @param[in] enable : Enables/Disables activity recognition.
610 * @param[in] dev : Structure instance of bmi2_dev.
612 * enable | Description
613 * -------------|---------------
614 * BMI2_ENABLE | Enables activity recognition.
615 * BMI2_DISABLE | Disables activity recognition.
617 * @return Result of API execution status
618 * @retval 0 -> Success
619 * @retval < 0 -> Fail
621 static int8_t set_act_recog(uint8_t enable, struct bmi2_dev *dev);
624 * @brief This internal API is used to enable/disable gyroscope user gain
625 * feature.
627 * @param[in] dev : Structure instance of bmi2_dev.
628 * @param[in] enable : Enables/Disables gyroscope user gain.
630 * Enable | Description
631 * -------------|---------------
632 * BMI2_DISABLE | Disables gyroscope user gain
633 * BMI2_ENABLE | Enables gyroscope user gain
635 * @return Result of API execution status
636 * @retval 0 -> Success
637 * @retval < 0 -> Fail
639 static int8_t set_gyro_user_gain(uint8_t enable, struct bmi2_dev *dev);
642 * @brief This internal API sets step counter parameter configurations.
644 * @param[in] step_count_params : Array that stores parameters 1 to 25.
645 * @param[in] dev : Structure instance of bmi2_dev.
647 * @return Result of API execution status
648 * @retval 0 -> Success
649 * @retval < 0 -> Fail
651 static int8_t set_step_count_params_config(const uint16_t *step_count_params, struct bmi2_dev *dev);
654 * @brief This internal API sets step counter/detector/activity configurations.
656 * @param[in] config : Structure instance of bmi2_step_config.
657 * @param[in] dev : Structure instance of bmi2_dev.
659 *---------------------------------------------------------------------------
660 * bmi2_step_config |
661 * Structure parameters | Description
662 *--------------------------|--------------------------------------------------
663 * | The Step-counter will trigger output every time
664 * | the number of steps are counted. Holds implicitly
665 * water-mark level | a 20x factor, so the range is 0 to 10230,
666 * | with resolution of 20 steps.
667 * -------------------------|---------------------------------------------------
668 * reset counter | Flag to reset the counted steps.
669 * -------------------------|---------------------------------------------------
670 * @endverbatim
672 * @return Result of API execution status
673 * @retval 0 -> Success
674 * @retval < 0 -> Fail
676 static int8_t set_step_config(const struct bmi2_step_config *config, struct bmi2_dev *dev);
679 * @brief This internal API gets step counter parameter configurations.
681 * @param[in] step_count_params : Array that stores parameters 1 to 25.
682 * @param[in] dev : Structure instance of bmi2_dev.
684 * @return Result of API execution status
685 * @retval 0 -> Success
686 * @retval < 0 -> Fail
688 static int8_t get_step_count_params_config(uint16_t *step_count_params, struct bmi2_dev *dev);
691 * @brief This internal API gets step counter/detector/activity configurations.
693 * @param[out] config : Structure instance of bmi2_step_config.
694 * @param[in] dev : Structure instance of bmi2_dev.
696 * @verbatim
697 *----------------------------------------------------------------------------
698 * bmi2_step_config |
699 * Structure parameters | Description
700 *--------------------------|--------------------------------------------------
701 * | The Step-counter will trigger output every time
702 * | the number of steps are counted. Holds implicitly
703 * water-mark level | a 20x factor, so the range is 0 to 10230,
704 * | with resolution of 20 steps.
705 * -------------------------|---------------------------------------------------
706 * reset counter | Flag to reset the counted steps.
707 * -------------------------|---------------------------------------------------
708 * @endverbatim
710 * @return Result of API execution status
711 * @retval 0 -> Success
712 * @retval < 0 -> Fail
714 static int8_t get_step_config(struct bmi2_step_config *config, struct bmi2_dev *dev);
717 * @brief This internal API is used to parse and store the activity recognition
718 * output from the FIFO data.
720 * @param[out] act_recog : Structure to retrieve output of activity
721 * recognition frame.
722 * @param[in] data_index : Index of the FIFO data which contains
723 * activity recognition frame.
724 * @param[out] fifo : Structure instance of bmi2_dev.
726 * @return Result of API execution status
727 * @retval 0 -> Success
728 * @retval < 0 -> Fail
730 static int8_t unpack_act_recog_output(struct bmi2_act_recog_output *act_recog,
731 uint16_t *data_index,
732 const struct bmi2_fifo_frame *fifo);
735 * @brief This internal API gets the output values of step counter.
737 * @param[out] step_count : Pointer to the stored step counter data.
738 * @param[in] dev : Structure instance of bmi2_dev.
740 * @return Result of API execution status
741 * @retval 0 -> Success
742 * @retval < 0 -> Fail
744 static int8_t get_step_counter_output(uint32_t *step_count, struct bmi2_dev *dev);
747 * @brief This internal API gets the error status related to NVM.
749 * @param[out] nvm_err_stat : Stores the NVM error status.
750 * @param[in] dev : Structure instance of bmi2_dev.
752 * @return Result of API execution status
753 * @retval 0 -> Success
754 * @retval < 0 -> Fail
756 static int8_t get_nvm_error_status(struct bmi2_nvm_err_status *nvm_err_stat, struct bmi2_dev *dev);
759 * @brief This internal API gets the error status related to virtual frames.
761 * @param[out] vfrm_err_stat : Stores the VFRM related error status.
762 * @param[in] dev : Structure instance of bmi2_dev.
764 * @return Result of API execution status
765 * @retval 0 -> Success
766 * @retval < 0 -> Fail
768 static int8_t get_vfrm_error_status(struct bmi2_vfrm_err_status *vfrm_err_stat, struct bmi2_dev *dev);
771 * @brief This internal API is used to get enable status of gyroscope user gain
772 * update.
774 * @param[out] status : Stores status of gyroscope user gain update.
775 * @param[in] dev : Structure instance of bmi2_dev.
777 * @return Result of API execution status
778 * @retval 0 -> Success
779 * @retval < 0 -> Fail
781 static int8_t get_user_gain_upd_status(uint8_t *status, struct bmi2_dev *dev);
784 * @brief This internal API skips S4S frame in the FIFO data while getting
785 * activity recognition output.
787 * @param[in, out] frame_header : FIFO frame header.
788 * @param[in, out] data_index : Index value of the FIFO data bytes
789 * from which S4S frame header is to be
790 * skipped.
791 * @param[in] fifo : Structure instance of bmi2_fifo_frame.
793 * @return Result of API execution status
794 * @retval 0 -> Success
795 * @retval < 0 -> Fail
797 static int8_t move_if_s4s_frame(const uint8_t *frame_header, uint16_t *data_index, const struct bmi2_fifo_frame *fifo);
800 * @brief This internal API enables/disables compensation of the gain defined
801 * in the GAIN register.
803 * @param[in] enable : Enables/Disables gain compensation
804 * @param[in] dev : Structure instance of bmi2_dev.
806 * enable | Description
807 * -------------|---------------
808 * BMI2_ENABLE | Enable gain compensation.
809 * BMI2_DISABLE | Disable gain compensation.
811 * @return Result of API execution status
812 * @retval 0 -> Success
813 * @retval < 0 -> Fail
815 static int8_t enable_gyro_gain(uint8_t enable, struct bmi2_dev *dev);
818 * @brief This internal API is used to extract the output feature configuration
819 * details like page and start address from the look-up table.
821 * @param[out] feat_output : Structure that stores output feature
822 * configurations.
823 * @param[in] type : Type of feature or sensor.
824 * @param[in] dev : Structure instance of bmi2_dev.
826 * @return Returns the feature found flag.
828 * @retval BMI2_FALSE : Feature not found
829 * BMI2_TRUE : Feature found
831 static uint8_t extract_output_feat_config(struct bmi2_feature_config *feat_output,
832 uint8_t type,
833 const struct bmi2_dev *dev);
836 * @brief This internal API is used to move the data index ahead of the
837 * current frame length parameter when unnecessary FIFO data appears while
838 * extracting the user specified data.
840 * @param[in,out] data_index : Index of the FIFO data which is to be
841 * moved ahead of the current frame length
842 * @param[in] current_frame_length : Number of bytes in the current frame.
843 * @param[in] fifo : Structure instance of bmi2_fifo_frame.
845 * @return Result of API execution status
846 * @retval 0 -> Success
847 * @retval < 0 -> Fail
849 static int8_t move_next_frame(uint16_t *data_index, uint8_t current_frame_length, const struct bmi2_fifo_frame *fifo);
851 /***************************************************************************/
853 /*! User Interface Definitions
854 ****************************************************************************/
857 * @brief This API:
858 * 1) Updates the device structure with address of the configuration file.
859 * 2) Initializes BMI270_HUAWEI_CONTEXT sensor.
860 * 3) Writes the configuration file.
861 * 4) Updates the feature offset parameters in the device structure.
862 * 5) Updates the maximum number of pages, in the device structure.
864 int8_t bmi270_hc_init(struct bmi2_dev *dev)
866 /* Variable to define error */
867 int8_t rslt;
869 /* Null-pointer check */
870 rslt = null_ptr_check(dev);
871 if (rslt == BMI2_OK)
873 /* Assign chip id of BMI270_HUAWEI_CONTEXT */
874 dev->chip_id = BMI270_HC_CHIP_ID;
876 /* Get the size of config array */
877 dev->config_size = sizeof(bmi270_hc_config_file);
879 /* Enable the variant specific features if any */
880 dev->variant_feature = BMI2_CRT_RTOSK_ENABLE | BMI2_GYRO_CROSS_SENS_ENABLE;
882 /* An extra dummy byte is read during SPI read */
883 if (dev->intf == BMI2_SPI_INTF)
885 dev->dummy_byte = 1;
887 else
889 dev->dummy_byte = 0;
892 /* If configuration file pointer is not assigned any address */
893 if (!dev->config_file_ptr)
895 /* Give the address of the configuration file array to
896 * the device pointer
898 dev->config_file_ptr = bmi270_hc_config_file;
901 /* Initialize BMI2 sensor */
902 rslt = bmi2_sec_init(dev);
903 if (rslt == BMI2_OK)
905 /* Assign the offsets of the feature input
906 * configuration to the device structure
908 dev->feat_config = bmi270_hc_feat_in;
910 /* Assign the offsets of the feature output to
911 * the device structure
913 dev->feat_output = bmi270_hc_feat_out;
915 /* Assign the maximum number of pages to the
916 * device structure
918 dev->page_max = BMI270_HC_MAX_PAGE_NUM;
920 /* Assign maximum number of input sensors/
921 * features to device structure
923 dev->input_sens = BMI270_HC_MAX_FEAT_IN;
925 /* Assign maximum number of output sensors/
926 * features to device structure
928 dev->out_sens = BMI270_HC_MAX_FEAT_OUT;
930 /* Assign the offsets of the feature interrupt
931 * to the device structure
933 dev->map_int = bmi270_hc_map_int;
935 /* Assign maximum number of feature interrupts
936 * to device structure
938 dev->sens_int_map = BMI270_HC_MAX_INT_MAP;
942 return rslt;
946 * @brief This API selects the sensors/features to be enabled.
948 int8_t bmi270_hc_sensor_enable(const uint8_t *sens_list, uint8_t n_sens, struct bmi2_dev *dev)
950 /* Variable to define error */
951 int8_t rslt;
953 /* Variable to select sensor */
954 uint64_t sensor_sel = 0;
956 /* Null-pointer check */
957 rslt = null_ptr_check(dev);
958 if ((rslt == BMI2_OK) && (sens_list != NULL))
960 /* Get the selected sensors */
961 rslt = select_sensor(sens_list, n_sens, &sensor_sel);
962 if (rslt == BMI2_OK)
964 /* Enable the selected sensors */
965 rslt = sensor_enable(sensor_sel, dev);
968 else
970 rslt = BMI2_E_NULL_PTR;
973 return rslt;
977 * @brief This API selects the sensors/features to be disabled.
979 int8_t bmi270_hc_sensor_disable(const uint8_t *sens_list, uint8_t n_sens, struct bmi2_dev *dev)
981 /* Variable to define error */
982 int8_t rslt;
984 /* Variable to select sensor */
985 uint64_t sensor_sel = 0;
987 /* Null-pointer check */
988 rslt = null_ptr_check(dev);
989 if ((rslt == BMI2_OK) && (sens_list != NULL))
991 /* Get the selected sensors */
992 rslt = select_sensor(sens_list, n_sens, &sensor_sel);
993 if (rslt == BMI2_OK)
995 /* Disable the selected sensors */
996 rslt = sensor_disable(sensor_sel, dev);
999 else
1001 rslt = BMI2_E_NULL_PTR;
1004 return rslt;
1008 * @brief This API sets the sensor/feature configuration.
1010 int8_t bmi270_hc_set_sensor_config(struct bmi2_sens_config *sens_cfg, uint8_t n_sens, struct bmi2_dev *dev)
1012 /* Variable to define error */
1013 int8_t rslt;
1015 /* Variable to define loop */
1016 uint8_t loop;
1018 /* Variable to get the status of advance power save */
1019 uint8_t aps_stat = 0;
1021 /* Null-pointer check */
1022 rslt = null_ptr_check(dev);
1023 if ((rslt == BMI2_OK) && (sens_cfg != NULL))
1025 /* Get status of advance power save mode */
1026 aps_stat = dev->aps_status;
1028 for (loop = 0; loop < n_sens; loop++)
1030 if ((sens_cfg[loop].type == BMI2_ACCEL) || (sens_cfg[loop].type == BMI2_GYRO) ||
1031 (sens_cfg[loop].type == BMI2_AUX) || (sens_cfg[loop].type == BMI2_GYRO_GAIN_UPDATE))
1033 rslt = bmi2_set_sensor_config(&sens_cfg[loop], 1, dev);
1035 else
1037 /* Disable Advance power save if enabled for auxiliary
1038 * and feature configurations
1040 if (aps_stat == BMI2_ENABLE)
1042 /* Disable advance power save if
1043 * enabled
1045 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1048 if (rslt == BMI2_OK)
1050 switch (sens_cfg[loop].type)
1052 /* Set the step counter parameters */
1053 case BMI2_STEP_COUNTER_PARAMS:
1054 rslt = set_step_count_params_config(sens_cfg[loop].cfg.step_counter_params, dev);
1055 break;
1057 /* Set step counter/detector/activity configuration */
1058 case BMI2_STEP_DETECTOR:
1059 case BMI2_STEP_COUNTER:
1060 rslt = set_step_config(&sens_cfg[loop].cfg.step_counter, dev);
1061 break;
1063 default:
1064 rslt = BMI2_E_INVALID_SENSOR;
1065 break;
1069 /* Return error if any of the set configurations fail */
1070 if (rslt != BMI2_OK)
1072 break;
1077 /* Enable Advance power save if disabled while configuring and
1078 * not when already disabled
1080 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
1082 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
1085 else
1087 rslt = BMI2_E_NULL_PTR;
1090 return rslt;
1094 * @brief This API gets the sensor/feature configuration.
1096 int8_t bmi270_hc_get_sensor_config(struct bmi2_sens_config *sens_cfg, uint8_t n_sens, struct bmi2_dev *dev)
1098 /* Variable to define error */
1099 int8_t rslt;
1101 /* Variable to define loop */
1102 uint8_t loop;
1104 /* Variable to get the status of advance power save */
1105 uint8_t aps_stat = 0;
1107 /* Null-pointer check */
1108 rslt = null_ptr_check(dev);
1109 if ((rslt == BMI2_OK) && (sens_cfg != NULL))
1111 /* Get status of advance power save mode */
1112 aps_stat = dev->aps_status;
1113 for (loop = 0; loop < n_sens; loop++)
1115 if ((sens_cfg[loop].type == BMI2_ACCEL) || (sens_cfg[loop].type == BMI2_GYRO) ||
1116 (sens_cfg[loop].type == BMI2_AUX) || (sens_cfg[loop].type == BMI2_GYRO_GAIN_UPDATE))
1118 rslt = bmi2_get_sensor_config(&sens_cfg[loop], 1, dev);
1120 else
1122 /* Disable Advance power save if enabled for auxiliary
1123 * and feature configurations
1125 if ((sens_cfg[loop].type >= BMI2_MAIN_SENS_MAX_NUM) || (sens_cfg[loop].type == BMI2_AUX))
1128 if (aps_stat == BMI2_ENABLE)
1130 /* Disable advance power save if
1131 * enabled
1133 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1137 if (rslt == BMI2_OK)
1139 switch (sens_cfg[loop].type)
1141 /* Set the step counter parameters */
1142 case BMI2_STEP_COUNTER_PARAMS:
1143 rslt = get_step_count_params_config(sens_cfg[loop].cfg.step_counter_params, dev);
1144 break;
1146 /* Get step counter/detector/activity configuration */
1147 case BMI2_STEP_DETECTOR:
1148 case BMI2_STEP_COUNTER:
1149 rslt = get_step_config(&sens_cfg[loop].cfg.step_counter, dev);
1150 break;
1152 default:
1153 rslt = BMI2_E_INVALID_SENSOR;
1154 break;
1158 /* Return error if any of the get configurations fail */
1159 if (rslt != BMI2_OK)
1161 break;
1166 /* Enable Advance power save if disabled while configuring and
1167 * not when already disabled
1169 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
1171 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
1174 else
1176 rslt = BMI2_E_NULL_PTR;
1179 return rslt;
1183 * @brief This API gets the sensor/feature data for accelerometer, gyroscope,
1184 * auxiliary sensor, step counter, high-g, gyroscope user-gain update,
1185 * orientation, gyroscope cross sensitivity and error status for NVM and VFRM.
1187 int8_t bmi270_hc_get_sensor_data(struct bmi2_sensor_data *sensor_data, uint8_t n_sens, struct bmi2_dev *dev)
1189 /* Variable to define error */
1190 int8_t rslt;
1192 /* Variable to define loop */
1193 uint8_t loop;
1195 /* Variable to get the status of advance power save */
1196 uint8_t aps_stat = 0;
1198 /* Null-pointer check */
1199 rslt = null_ptr_check(dev);
1200 if ((rslt == BMI2_OK) && (sensor_data != NULL))
1202 /* Get status of advance power save mode */
1203 aps_stat = dev->aps_status;
1204 for (loop = 0; loop < n_sens; loop++)
1206 if ((sensor_data[loop].type == BMI2_ACCEL) || (sensor_data[loop].type == BMI2_GYRO) ||
1207 (sensor_data[loop].type == BMI2_AUX) || (sensor_data[loop].type == BMI2_GYRO_GAIN_UPDATE) ||
1208 (sensor_data[loop].type == BMI2_GYRO_CROSS_SENSE))
1210 rslt = bmi2_get_sensor_data(&sensor_data[loop], 1, dev);
1212 else
1214 /* Disable Advance power save if enabled for feature
1215 * configurations
1217 if (sensor_data[loop].type >= BMI2_MAIN_SENS_MAX_NUM)
1219 if (aps_stat == BMI2_ENABLE)
1221 /* Disable advance power save if
1222 * enabled
1224 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1228 if (rslt == BMI2_OK)
1230 switch (sensor_data[loop].type)
1232 case BMI2_STEP_COUNTER:
1234 /* Get step counter output */
1235 rslt = get_step_counter_output(&sensor_data[loop].sens_data.step_counter_output, dev);
1236 break;
1237 case BMI2_NVM_STATUS:
1239 /* Get NVM error status */
1240 rslt = get_nvm_error_status(&sensor_data[loop].sens_data.nvm_status, dev);
1241 break;
1242 case BMI2_VFRM_STATUS:
1244 /* Get VFRM error status */
1245 rslt = get_vfrm_error_status(&sensor_data[loop].sens_data.vfrm_status, dev);
1246 break;
1247 default:
1248 rslt = BMI2_E_INVALID_SENSOR;
1249 break;
1252 /* Return error if any of the get sensor data fails */
1253 if (rslt != BMI2_OK)
1255 break;
1260 /* Enable Advance power save if disabled while
1261 * configuring and not when already disabled
1263 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
1265 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
1269 else
1271 rslt = BMI2_E_NULL_PTR;
1274 return rslt;
1278 * @brief This api is used for retrieving the activity recognition settings currently set for bmi270hc.
1280 int8_t bmi270_hc_get_act_recg_sett(struct bmi2_hc_act_recg_sett *sett, struct bmi2_dev *dev)
1282 /* Variable to define error */
1283 int8_t rslt;
1285 /* Array to define the feature configuration */
1286 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
1288 /* Variable to define the array offset */
1289 uint8_t idx = 0;
1291 /* Variable to get the status of advance power save */
1292 uint8_t aps_stat;
1294 /* Variable to set flag */
1295 uint8_t feat_found;
1296 uint16_t msb_lsb;
1297 uint8_t lsb;
1298 uint8_t msb;
1300 /* Initialize feature configuration for activity recognition */
1301 struct bmi2_feature_config bmi2_act_recg_sett = { 0, 0, 0 };
1303 /* Null-pointer check */
1304 rslt = null_ptr_check(dev);
1305 if (rslt == BMI2_OK)
1307 /* Search for activity recognition feature and extract its configuration details */
1308 feat_found = bmi2_extract_input_feat_config(&bmi2_act_recg_sett, BMI2_ACTIVITY_RECOGNITION_SETTINGS, dev);
1309 if (feat_found)
1311 aps_stat = dev->aps_status;
1312 if (aps_stat == BMI2_ENABLE)
1314 /* Disable advance power save if enabled */
1315 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1318 /* Get the configuration from the page where activity recognition setting feature resides */
1319 if (rslt == BMI2_OK)
1321 rslt = bmi2_get_feat_config(bmi2_act_recg_sett.page, feat_config, dev);
1324 if (rslt == BMI2_OK)
1326 /* Define the offset in bytes */
1327 idx = bmi2_act_recg_sett.start_addr;
1329 lsb = feat_config[idx++];
1330 msb = feat_config[idx++];
1331 msb_lsb = ((uint16_t)msb << 8) | lsb;
1333 sett->segment_size = msb_lsb & BMI2_HC_ACT_RECG_SEGMENT_SIZE_MASK;
1335 /* Increment idx by 2 to point post processing enable/disable address */
1336 idx = 4;
1337 lsb = feat_config[idx++];
1338 msb = feat_config[idx++];
1339 msb_lsb = ((uint16_t)msb << 8) | lsb;
1340 sett->pp_en = msb_lsb & BMI2_HC_ACT_RECG_PP_EN_MASK;
1342 /* Increment idx by 2 to point mix gdi thres addres */
1343 idx = 6;
1344 lsb = feat_config[idx++];
1345 msb = feat_config[idx++];
1346 msb_lsb = ((uint16_t)msb << 8) | lsb;
1347 sett->min_gdi_thres = msb_lsb & BMI2_HC_ACT_RECG_MIN_GDI_THRES_MASK;
1349 /* Increment idx by 2 to point max gdi thres addres */
1350 idx = 8;
1351 lsb = feat_config[idx++];
1352 msb = feat_config[idx++];
1353 msb_lsb = ((uint16_t)msb << 8) | lsb;
1354 sett->max_gdi_thres = msb_lsb & BMI2_HC_ACT_RECG_MAX_GDI_THRES_MASK;
1356 /* Increment idx by 2 to point to buffer size */
1357 idx = 10;
1358 lsb = feat_config[idx++];
1359 msb = feat_config[idx++];
1360 msb_lsb = ((uint16_t)msb << 8) | lsb;
1361 sett->buf_size = msb_lsb & BMI2_HC_ACT_RECG_BUF_SIZE_MASK;
1363 /* Increment idx by 2 to to point to min segment confidence */
1364 idx = 12;
1365 lsb = feat_config[idx++];
1366 msb = feat_config[idx++];
1367 msb_lsb = ((uint16_t)msb << 8) | lsb;
1368 sett->min_seg_conf = msb_lsb & BMI2_HC_ACT_RECG_MIN_SEG_CONF_MASK;
1371 /* Enable Advance power save if disabled while
1372 * configuring and not when already disabled
1374 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
1376 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
1379 else
1381 rslt = BMI2_E_INVALID_SENSOR;
1385 return rslt;
1389 * @brief This api is used for setting the activity recognition settings for bmi270hc.
1391 int8_t bmi270_hc_set_act_recg_sett(const struct bmi2_hc_act_recg_sett *sett, struct bmi2_dev *dev)
1393 /* Variable to define error */
1394 int8_t rslt;
1396 /* Array to define the feature configuration */
1397 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
1399 /* Variable to define the array offset */
1400 uint8_t idx = 0;
1402 /* Variable to get the status of advance power save */
1403 uint8_t aps_stat;
1405 /* Variable to set flag */
1406 uint8_t feat_found;
1408 /* Variable to define index */
1409 uint8_t index = 0;
1411 /* Initialize feature configuration for activity recognition */
1412 struct bmi2_feature_config bmi2_act_recg_sett = { 0, 0, 0 };
1414 /* Copy the feature configuration address to a local pointer */
1415 uint16_t *data_p = (uint16_t *) (void *)feat_config;
1417 /* Null-pointer check */
1418 rslt = null_ptr_check(dev);
1419 if (rslt == BMI2_OK)
1421 /* Search for activity recognition feature and extract its configuration details */
1422 feat_found = bmi2_extract_input_feat_config(&bmi2_act_recg_sett, BMI2_ACTIVITY_RECOGNITION_SETTINGS, dev);
1423 if (feat_found)
1425 aps_stat = dev->aps_status;
1426 if (aps_stat == BMI2_ENABLE)
1428 /* Disable advance power save if enabled */
1429 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1432 if (rslt == BMI2_OK)
1434 /* Get the configuration from the page where activity recognition setting feature resides */
1435 rslt = bmi2_get_feat_config(bmi2_act_recg_sett.page, feat_config, dev);
1436 if (rslt == BMI2_OK)
1438 /* Define the offset in bytes */
1439 idx = bmi2_act_recg_sett.start_addr;
1441 /* Get offset in words since all the features are set in words length */
1442 idx = idx / 2;
1444 /* Set segment size */
1445 *(data_p + idx) = BMI2_SET_BIT_POS0(*(data_p + idx),
1446 BMI2_HC_ACT_RECG_SEGMENT_SIZE,
1447 sett->segment_size);
1449 /* Starting address of post processing represented in word length */
1450 idx = 2;
1452 /* Set post processing */
1453 *(data_p + idx) = BMI2_SET_BIT_POS0(*(data_p + idx), BMI2_HC_ACT_RECG_PP_EN, sett->pp_en);
1455 /* Starting address of min_gdi_thres represented in word length */
1456 idx = 3;
1458 /* Set minimum gdi threshold */
1459 *(data_p + idx) = BMI2_SET_BIT_POS0(*(data_p + idx),
1460 BMI2_HC_ACT_RECG_MIN_GDI_THRES,
1461 sett->min_gdi_thres);
1463 /* Starting address of max_gdi_thres represented in word length */
1464 idx = 4;
1466 /* Set maximum gdi threshold */
1467 *(data_p + idx) = BMI2_SET_BIT_POS0(*(data_p + idx),
1468 BMI2_HC_ACT_RECG_MAX_GDI_THRES,
1469 sett->max_gdi_thres);
1471 /* Starting address of buffer size represented in word length */
1472 idx = 5;
1474 /* Set buffer size */
1475 *(data_p + idx) = BMI2_SET_BIT_POS0(*(data_p + idx), BMI2_HC_ACT_RECG_BUF_SIZE, sett->buf_size);
1477 /* Starting address of min_seg_conf represented in word length */
1478 idx = 6;
1480 /* Set min segment confidence */
1481 *(data_p + idx) = BMI2_SET_BIT_POS0(*(data_p + idx),
1482 BMI2_HC_ACT_RECG_MIN_SEG_CONF,
1483 sett->min_seg_conf);
1485 /* Increment offset by 1 more word to get the total length in words */
1486 idx++;
1488 /* Get total length in bytes to copy from local pointer to the array */
1489 idx = (uint8_t)(idx * 2) - bmi2_act_recg_sett.start_addr;
1491 /* Copy the bytes to be set back to the array */
1492 for (index = 0; index <= idx; index++)
1494 feat_config[bmi2_act_recg_sett.start_addr +
1495 index] = *((uint8_t *) data_p + bmi2_act_recg_sett.start_addr + index);
1498 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
1502 /* Enable Advance power save if disabled while
1503 * configuring and not when already disabled
1505 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
1507 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
1510 else
1512 rslt = BMI2_E_INVALID_SENSOR;
1516 return rslt;
1520 * @brief This internal API is used to parse the activity output from the
1521 * FIFO in header mode.
1523 int8_t bmi270_hc_get_act_recog_output(struct bmi2_act_recog_output *act_recog,
1524 uint16_t *act_frm_len,
1525 struct bmi2_fifo_frame *fifo,
1526 const struct bmi2_dev *dev)
1528 /* Variable to define error */
1529 int8_t rslt;
1531 /* Variable to define header frame */
1532 uint8_t frame_header = 0;
1534 /* Variable to index the data bytes */
1535 uint16_t data_index;
1537 /* Variable to index activity frames */
1538 uint16_t act_idx = 0;
1540 /* Variable to indicate activity frames read */
1541 uint16_t frame_to_read = 0;
1543 /* Null-pointer check */
1544 rslt = null_ptr_check(dev);
1545 if ((rslt == BMI2_OK) && (act_recog != NULL) && (act_frm_len != NULL) && (fifo != NULL))
1548 /* Store the number of frames to be read */
1549 frame_to_read = *act_frm_len;
1550 for (data_index = fifo->act_recog_byte_start_idx; data_index < fifo->length;)
1552 /* Get frame header byte */
1553 frame_header = fifo->data[data_index] & BMI2_FIFO_TAG_INTR_MASK;
1555 /* Skip S4S frames if S4S is enabled */
1556 rslt = move_if_s4s_frame(&frame_header, &data_index, fifo);
1558 /* Break if FIFO is empty */
1559 if (rslt == BMI2_W_FIFO_EMPTY)
1561 break;
1564 /* Index shifted to next byte where data starts */
1565 data_index++;
1566 switch (frame_header)
1568 /* If header defines accelerometer frame */
1569 case BMI2_FIFO_HEADER_ACC_FRM:
1570 rslt = move_next_frame(&data_index, fifo->acc_frm_len, fifo);
1571 break;
1573 /* If header defines accelerometer and auxiliary frames */
1574 case BMI2_FIFO_HEADER_AUX_ACC_FRM:
1575 rslt = move_next_frame(&data_index, fifo->acc_aux_frm_len, fifo);
1576 break;
1578 /* If header defines accelerometer and gyroscope frames */
1579 case BMI2_FIFO_HEADER_GYR_ACC_FRM:
1580 rslt = move_next_frame(&data_index, fifo->acc_gyr_frm_len, fifo);
1581 break;
1583 /* If header defines accelerometer, auxiliary and gyroscope frames */
1584 case BMI2_FIFO_HEADER_ALL_FRM:
1585 rslt = move_next_frame(&data_index, fifo->all_frm_len, fifo);
1586 break;
1588 /* If header defines only gyroscope frame */
1589 case BMI2_FIFO_HEADER_GYR_FRM:
1590 rslt = move_next_frame(&data_index, fifo->gyr_frm_len, fifo);
1591 break;
1593 /* If header defines only auxiliary frame */
1594 case BMI2_FIFO_HEADER_AUX_FRM:
1595 rslt = move_next_frame(&data_index, fifo->aux_frm_len, fifo);
1596 break;
1598 /* If header defines auxiliary and gyroscope frame */
1599 case BMI2_FIFO_HEADER_AUX_GYR_FRM:
1600 rslt = move_next_frame(&data_index, fifo->aux_gyr_frm_len, fifo);
1601 break;
1603 /* If header defines sensor time frame */
1604 case BMI2_FIFO_HEADER_SENS_TIME_FRM:
1605 rslt = move_next_frame(&data_index, BMI2_SENSOR_TIME_LENGTH, fifo);
1606 break;
1608 /* If header defines skip frame */
1609 case BMI2_FIFO_HEADER_SKIP_FRM:
1610 rslt = move_next_frame(&data_index, BMI2_FIFO_SKIP_FRM_LENGTH, fifo);
1611 break;
1613 /* If header defines Input configuration frame */
1614 case BMI2_FIFO_HEADER_INPUT_CFG_FRM:
1615 rslt = move_next_frame(&data_index, BMI2_FIFO_INPUT_CFG_LENGTH, fifo);
1616 break;
1618 /* If header defines invalid frame or end of valid data */
1619 case BMI2_FIFO_HEAD_OVER_READ_MSB:
1621 /* Move the data index to the last byte to mark completion */
1622 data_index = fifo->length;
1624 /* FIFO is empty */
1625 rslt = BMI2_W_FIFO_EMPTY;
1626 break;
1628 /* If header defines activity recognition frame */
1629 case BMI2_FIFO_VIRT_ACT_RECOG_FRM:
1631 /* Get the activity output */
1632 rslt = unpack_act_recog_output(&act_recog[(act_idx)], &data_index, fifo);
1634 /* Update activity frame index */
1635 (act_idx)++;
1636 break;
1637 default:
1639 /* Move the data index to the last byte in case of invalid values */
1640 data_index = fifo->length;
1642 /* FIFO is empty */
1643 rslt = BMI2_W_FIFO_EMPTY;
1644 break;
1647 /* Number of frames to be read is complete or FIFO is empty */
1648 if ((frame_to_read == act_idx) || (rslt == BMI2_W_FIFO_EMPTY))
1650 break;
1654 /* Update the activity frame index */
1655 (*act_frm_len) = act_idx;
1657 /* Update the activity byte index */
1658 fifo->act_recog_byte_start_idx = data_index;
1660 else
1662 rslt = BMI2_E_NULL_PTR;
1665 return rslt;
1669 * @brief This API updates the gyroscope user-gain.
1671 int8_t bmi270_hc_update_gyro_user_gain(const struct bmi2_gyro_user_gain_config *user_gain, struct bmi2_dev *dev)
1673 /* Variable to define error */
1674 int8_t rslt;
1676 /* Variable to select sensor */
1677 uint8_t sens_sel[2] = { BMI2_GYRO, BMI2_GYRO_GAIN_UPDATE };
1679 /* Structure to define sensor configurations */
1680 struct bmi2_sens_config sens_cfg;
1682 /* Variable to store status of user-gain update module */
1683 uint8_t status = 0;
1685 /* Variable to define count */
1686 uint8_t count = 100;
1688 /* Null-pointer check */
1689 rslt = null_ptr_check(dev);
1690 if ((rslt == BMI2_OK) && (user_gain != NULL))
1692 /* Select type of feature */
1693 sens_cfg.type = BMI2_GYRO_GAIN_UPDATE;
1695 /* Get the user gain configurations */
1696 rslt = bmi270_hc_get_sensor_config(&sens_cfg, 1, dev);
1697 if (rslt == BMI2_OK)
1699 /* Get the user-defined ratio */
1700 sens_cfg.cfg.gyro_gain_update = *user_gain;
1702 /* Set rate ratio for all axes */
1703 rslt = bmi270_hc_set_sensor_config(&sens_cfg, 1, dev);
1706 /* Disable gyroscope */
1707 if (rslt == BMI2_OK)
1709 rslt = bmi270_hc_sensor_disable(&sens_sel[0], 1, dev);
1712 /* Enable gyroscope user-gain update module */
1713 if (rslt == BMI2_OK)
1715 rslt = bmi270_hc_sensor_enable(&sens_sel[1], 1, dev);
1718 /* Set the command to trigger the computation */
1719 if (rslt == BMI2_OK)
1721 rslt = bmi2_set_command_register(BMI2_USR_GAIN_CMD, dev);
1724 if (rslt == BMI2_OK)
1726 /* Poll until enable bit of user-gain update is 0 */
1727 while (count--)
1729 rslt = get_user_gain_upd_status(&status, dev);
1730 if ((rslt == BMI2_OK) && (status == 0))
1732 /* Enable compensation of gain defined
1733 * in the GAIN register
1735 rslt = enable_gyro_gain(BMI2_ENABLE, dev);
1737 /* Enable gyroscope */
1738 if (rslt == BMI2_OK)
1740 rslt = bmi270_hc_sensor_enable(&sens_sel[0], 1, dev);
1743 break;
1746 dev->delay_us(10000, dev->intf_ptr);
1749 /* Return error if user-gain update is failed */
1750 if ((rslt == BMI2_OK) && (status != 0))
1752 rslt = BMI2_E_GYR_USER_GAIN_UPD_FAIL;
1756 else
1758 rslt = BMI2_E_NULL_PTR;
1761 return rslt;
1765 * @brief This API reads the compensated gyroscope user-gain values.
1767 int8_t bmi270_hc_read_gyro_user_gain(struct bmi2_gyro_user_gain_data *gyr_usr_gain, struct bmi2_dev *dev)
1769 /* Variable to define error */
1770 int8_t rslt;
1772 /* Variable to define register data */
1773 uint8_t reg_data[3] = { 0 };
1775 /* Null-pointer check */
1776 rslt = null_ptr_check(dev);
1777 if ((rslt == BMI2_OK) && (gyr_usr_gain != NULL))
1779 /* Get the gyroscope compensated gain values */
1780 rslt = bmi2_get_regs(BMI2_GYR_USR_GAIN_0_ADDR, reg_data, 3, dev);
1781 if (rslt == BMI2_OK)
1783 /* Gyroscope user gain correction X-axis */
1784 gyr_usr_gain->x = (int8_t)BMI2_GET_BIT_POS0(reg_data[0], BMI2_GYR_USR_GAIN_X);
1786 /* Gyroscope user gain correction Y-axis */
1787 gyr_usr_gain->y = (int8_t)BMI2_GET_BIT_POS0(reg_data[1], BMI2_GYR_USR_GAIN_Y);
1789 /* Gyroscope user gain correction z-axis */
1790 gyr_usr_gain->z = (int8_t)BMI2_GET_BIT_POS0(reg_data[2], BMI2_GYR_USR_GAIN_Z);
1793 else
1795 rslt = BMI2_E_NULL_PTR;
1798 return rslt;
1802 * @brief This API maps/unmaps feature interrupts to that of interrupt pins.
1804 int8_t bmi270_hc_map_feat_int(const struct bmi2_sens_int_config *sens_int, uint8_t n_sens, struct bmi2_dev *dev)
1806 /* Variable to define error */
1807 int8_t rslt;
1809 /* Variable to define loop */
1810 uint8_t loop;
1812 /* Null-pointer check */
1813 rslt = null_ptr_check(dev);
1814 if ((rslt == BMI2_OK) && (sens_int != NULL))
1816 for (loop = 0; loop < n_sens; loop++)
1818 switch (sens_int[loop].type)
1820 case BMI2_STEP_COUNTER:
1821 case BMI2_STEP_DETECTOR:
1823 rslt = bmi2_map_feat_int(sens_int[loop].type, sens_int[loop].hw_int_pin, dev);
1824 break;
1825 default:
1826 rslt = BMI2_E_INVALID_SENSOR;
1827 break;
1830 /* Return error if interrupt mapping fails */
1831 if (rslt != BMI2_OK)
1833 break;
1837 else
1839 rslt = BMI2_E_NULL_PTR;
1842 return rslt;
1845 /***************************************************************************/
1847 /*! Local Function Definitions
1848 ****************************************************************************/
1851 * @brief This internal API is used to validate the device structure pointer for
1852 * null conditions.
1854 static int8_t null_ptr_check(const struct bmi2_dev *dev)
1856 /* Variable to define error */
1857 int8_t rslt = BMI2_OK;
1859 if ((dev == NULL) || (dev->read == NULL) || (dev->write == NULL) || (dev->delay_us == NULL))
1861 /* Device structure pointer is not valid */
1862 rslt = BMI2_E_NULL_PTR;
1865 return rslt;
1869 * @brief This internal API selects the sensor/features to be enabled or
1870 * disabled.
1872 static int8_t select_sensor(const uint8_t *sens_list, uint8_t n_sens, uint64_t *sensor_sel)
1874 /* Variable to define error */
1875 int8_t rslt = BMI2_OK;
1877 /* Variable to define loop */
1878 uint8_t count;
1880 for (count = 0; count < n_sens; count++)
1882 switch (sens_list[count])
1884 case BMI2_ACCEL:
1885 *sensor_sel |= BMI2_ACCEL_SENS_SEL;
1886 break;
1887 case BMI2_GYRO:
1888 *sensor_sel |= BMI2_GYRO_SENS_SEL;
1889 break;
1890 case BMI2_AUX:
1891 *sensor_sel |= BMI2_AUX_SENS_SEL;
1892 break;
1893 case BMI2_TEMP:
1894 *sensor_sel |= BMI2_TEMP_SENS_SEL;
1895 break;
1896 case BMI2_STEP_DETECTOR:
1897 *sensor_sel |= BMI2_STEP_DETECT_SEL;
1898 break;
1899 case BMI2_STEP_COUNTER:
1900 *sensor_sel |= BMI2_STEP_COUNT_SEL;
1901 break;
1902 case BMI2_GYRO_GAIN_UPDATE:
1903 *sensor_sel |= BMI2_GYRO_GAIN_UPDATE_SEL;
1904 break;
1905 case BMI2_ACTIVITY_RECOGNITION:
1906 *sensor_sel |= BMI2_ACTIVITY_RECOGNITION_SEL;
1907 break;
1908 default:
1909 rslt = BMI2_E_INVALID_SENSOR;
1910 break;
1914 return rslt;
1918 * @brief This internal API enables the selected sensor/features.
1920 static int8_t sensor_enable(uint64_t sensor_sel, struct bmi2_dev *dev)
1922 /* Variable to define error */
1923 int8_t rslt;
1925 /* Variable to store register values */
1926 uint8_t reg_data = 0;
1928 /* Variable to define loop */
1929 uint8_t loop = 1;
1931 /* Variable to get the status of advance power save */
1932 uint8_t aps_stat = 0;
1934 rslt = bmi2_get_regs(BMI2_PWR_CTRL_ADDR, &reg_data, 1, dev);
1935 if (rslt == BMI2_OK)
1937 /* Enable accelerometer */
1938 if (sensor_sel & BMI2_ACCEL_SENS_SEL)
1940 reg_data = BMI2_SET_BITS(reg_data, BMI2_ACC_EN, BMI2_ENABLE);
1943 /* Enable gyroscope */
1944 if (sensor_sel & BMI2_GYRO_SENS_SEL)
1946 reg_data = BMI2_SET_BITS(reg_data, BMI2_GYR_EN, BMI2_ENABLE);
1949 /* Enable auxiliary sensor */
1950 if (sensor_sel & BMI2_AUX_SENS_SEL)
1952 reg_data = BMI2_SET_BIT_POS0(reg_data, BMI2_AUX_EN, BMI2_ENABLE);
1955 /* Enable temperature sensor */
1956 if (sensor_sel & BMI2_TEMP_SENS_SEL)
1958 reg_data = BMI2_SET_BITS(reg_data, BMI2_TEMP_EN, BMI2_ENABLE);
1961 /* Enable the sensors that are set in the power control register */
1962 if (sensor_sel & BMI2_MAIN_SENSORS)
1964 rslt = bmi2_set_regs(BMI2_PWR_CTRL_ADDR, &reg_data, 1, dev);
1968 if ((rslt == BMI2_OK) && (sensor_sel & ~(BMI2_MAIN_SENSORS)))
1970 /* Get status of advance power save mode */
1971 aps_stat = dev->aps_status;
1972 if (aps_stat == BMI2_ENABLE)
1974 /* Disable advance power save if enabled */
1975 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
1978 if (rslt == BMI2_OK)
1980 while (loop--)
1982 /* Enable step detector feature */
1983 if (sensor_sel & BMI2_STEP_DETECT_SEL)
1985 rslt = set_step_detector(BMI2_ENABLE, dev);
1986 if (rslt == BMI2_OK)
1988 dev->sens_en_stat |= BMI2_STEP_DETECT_SEL;
1990 else
1992 break;
1996 /* Enable step counter feature */
1997 if (sensor_sel & BMI2_STEP_COUNT_SEL)
1999 rslt = set_step_counter(BMI2_ENABLE, dev);
2000 if (rslt == BMI2_OK)
2002 dev->sens_en_stat |= BMI2_STEP_COUNT_SEL;
2004 else
2006 break;
2010 /* Enable activity recognition feature */
2011 if (sensor_sel & BMI2_ACTIVITY_RECOGNITION_SEL)
2013 rslt = set_act_recog(BMI2_ENABLE, dev);
2014 if (rslt == BMI2_OK)
2016 dev->sens_en_stat |= BMI2_ACTIVITY_RECOGNITION_SEL;
2018 else
2020 break;
2024 /* Enable gyroscope user gain */
2025 if (sensor_sel & BMI2_GYRO_GAIN_UPDATE_SEL)
2027 rslt = set_gyro_user_gain(BMI2_ENABLE, dev);
2028 if (rslt == BMI2_OK)
2030 dev->sens_en_stat |= BMI2_GYRO_GAIN_UPDATE_SEL;
2032 else
2034 break;
2039 /* Enable Advance power save if disabled while
2040 * configuring and not when already disabled
2042 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
2044 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
2049 return rslt;
2053 * @brief This internal API disables the selected sensors/features.
2055 static int8_t sensor_disable(uint64_t sensor_sel, struct bmi2_dev *dev)
2057 /* Variable to define error */
2058 int8_t rslt;
2060 /* Variable to store register values */
2061 uint8_t reg_data = 0;
2063 /* Variable to define loop */
2064 uint8_t loop = 1;
2066 /* Variable to get the status of advance power save */
2067 uint8_t aps_stat = 0;
2069 rslt = bmi2_get_regs(BMI2_PWR_CTRL_ADDR, &reg_data, 1, dev);
2070 if (rslt == BMI2_OK)
2072 /* Disable accelerometer */
2073 if (sensor_sel & BMI2_ACCEL_SENS_SEL)
2075 reg_data = BMI2_SET_BIT_VAL0(reg_data, BMI2_ACC_EN);
2078 /* Disable gyroscope */
2079 if (sensor_sel & BMI2_GYRO_SENS_SEL)
2081 reg_data = BMI2_SET_BIT_VAL0(reg_data, BMI2_GYR_EN);
2084 /* Disable auxiliary sensor */
2085 if (sensor_sel & BMI2_AUX_SENS_SEL)
2087 reg_data = BMI2_SET_BIT_VAL0(reg_data, BMI2_AUX_EN);
2090 /* Disable temperature sensor */
2091 if (sensor_sel & BMI2_TEMP_SENS_SEL)
2093 reg_data = BMI2_SET_BIT_VAL0(reg_data, BMI2_TEMP_EN);
2096 /* Disable the sensors that are set in the power control register */
2097 if (sensor_sel & BMI2_MAIN_SENSORS)
2099 rslt = bmi2_set_regs(BMI2_PWR_CTRL_ADDR, &reg_data, 1, dev);
2103 if ((rslt == BMI2_OK) && (sensor_sel & ~(BMI2_MAIN_SENSORS)))
2105 /* Get status of advance power save mode */
2106 aps_stat = dev->aps_status;
2107 if (aps_stat == BMI2_ENABLE)
2109 /* Disable advance power save if enabled */
2110 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
2113 if (rslt == BMI2_OK)
2115 while (loop--)
2117 /* Disable step detector feature */
2118 if (sensor_sel & BMI2_STEP_DETECT_SEL)
2120 rslt = set_step_detector(BMI2_DISABLE, dev);
2121 if (rslt == BMI2_OK)
2123 dev->sens_en_stat &= ~BMI2_STEP_DETECT_SEL;
2125 else
2127 break;
2131 /* Disable step counter feature */
2132 if (sensor_sel & BMI2_STEP_COUNT_SEL)
2134 rslt = set_step_counter(BMI2_DISABLE, dev);
2135 if (rslt == BMI2_OK)
2137 dev->sens_en_stat &= ~BMI2_STEP_COUNT_SEL;
2139 else
2141 break;
2145 /* Disable activity recognition feature */
2146 if (sensor_sel & BMI2_ACTIVITY_RECOGNITION_SEL)
2148 rslt = set_act_recog(BMI2_DISABLE, dev);
2149 if (rslt == BMI2_OK)
2151 dev->sens_en_stat |= BMI2_ACTIVITY_RECOGNITION_SEL;
2153 else
2155 break;
2159 /* Disable gyroscope user gain */
2160 if (sensor_sel & BMI2_GYRO_GAIN_UPDATE_SEL)
2162 rslt = set_gyro_user_gain(BMI2_DISABLE, dev);
2163 if (rslt == BMI2_OK)
2165 dev->sens_en_stat &= ~BMI2_GYRO_GAIN_UPDATE_SEL;
2167 else
2169 break;
2173 /* Enable Advance power save if disabled while
2174 * configuring and not when already disabled
2176 if ((aps_stat == BMI2_ENABLE) && (rslt == BMI2_OK))
2178 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
2184 return rslt;
2188 * @brief This internal API is used to enable/disable step detector feature.
2190 static int8_t set_step_detector(uint8_t enable, struct bmi2_dev *dev)
2192 /* Variable to define error */
2193 int8_t rslt;
2195 /* Array to define the feature configuration */
2196 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2198 /* Variable to define the array offset */
2199 uint8_t idx = 0;
2201 /* Variable to set flag */
2202 uint8_t feat_found;
2204 /* Initialize feature configuration for step detector */
2205 struct bmi2_feature_config step_det_config = { 0, 0, 0 };
2207 /* Search for step detector feature and extract its configuration details */
2208 feat_found = bmi2_extract_input_feat_config(&step_det_config, BMI2_STEP_DETECTOR, dev);
2209 if (feat_found)
2211 /* Get the configuration from the page where step detector feature resides */
2212 rslt = bmi2_get_feat_config(step_det_config.page, feat_config, dev);
2213 if (rslt == BMI2_OK)
2215 /* Define the offset for enable/disable of step detector */
2216 idx = step_det_config.start_addr + BMI2_STEP_COUNT_FEAT_EN_OFFSET;
2218 /* Set the feature enable bit */
2219 feat_config[idx] = BMI2_SET_BITS(feat_config[idx], BMI2_STEP_DET_FEAT_EN, enable);
2221 /* Set the configuration back to the page */
2222 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2225 else
2227 rslt = BMI2_E_INVALID_SENSOR;
2230 return rslt;
2234 * @brief This internal API is used to enable/disable step counter feature.
2236 static int8_t set_step_counter(uint8_t enable, struct bmi2_dev *dev)
2238 /* Variable to define error */
2239 int8_t rslt;
2241 /* Array to define the feature configuration */
2242 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2244 /* Variable to define the array offset */
2245 uint8_t idx = 0;
2247 /* Variable to set flag */
2248 uint8_t feat_found;
2250 /* Initialize feature configuration for step counter */
2251 struct bmi2_feature_config step_count_config = { 0, 0, 0 };
2253 /* Search for step counter feature and extract its configuration details */
2254 feat_found = bmi2_extract_input_feat_config(&step_count_config, BMI2_STEP_COUNTER, dev);
2255 if (feat_found)
2257 /* Get the configuration from the page where step-counter feature resides */
2258 rslt = bmi2_get_feat_config(step_count_config.page, feat_config, dev);
2259 if (rslt == BMI2_OK)
2261 /* Define the offset for enable/disable of step counter */
2262 idx = step_count_config.start_addr + BMI2_STEP_COUNT_FEAT_EN_OFFSET;
2264 /* Set the feature enable bit */
2265 feat_config[idx] = BMI2_SET_BITS(feat_config[idx], BMI2_STEP_COUNT_FEAT_EN, enable);
2267 /* Set the configuration back to the page */
2268 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2271 else
2273 rslt = BMI2_E_INVALID_SENSOR;
2276 return rslt;
2280 * @brief This internal API enables/disables the activity recognition feature.
2282 static int8_t set_act_recog(uint8_t enable, struct bmi2_dev *dev)
2284 /* Variable to define error */
2285 int8_t rslt;
2287 /* Array to define the feature configuration */
2288 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2290 /* Variable to define the array offset */
2291 uint8_t idx = 0;
2293 /* Variable to set flag */
2294 uint8_t feat_found;
2296 /* Initialize feature configuration for activity recognition */
2297 struct bmi2_feature_config act_recog_cfg = { 0, 0, 0 };
2299 /* Search for activity recognition and extract its configuration details */
2300 feat_found = bmi2_extract_input_feat_config(&act_recog_cfg, BMI2_ACTIVITY_RECOGNITION, dev);
2301 if (feat_found)
2303 /* Get the configuration from the page where activity
2304 * recognition feature resides
2306 rslt = bmi2_get_feat_config(act_recog_cfg.page, feat_config, dev);
2307 if (rslt == BMI2_OK)
2309 /* Define the offset for enable/disable of activity recognition */
2310 idx = act_recog_cfg.start_addr;
2312 /* Set the feature enable bit */
2313 feat_config[idx] = BMI2_SET_BIT_POS0(feat_config[idx], BMI2_ACTIVITY_RECOG_EN, enable);
2315 /* Set the configuration back to the page */
2316 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2319 else
2321 rslt = BMI2_E_INVALID_SENSOR;
2324 return rslt;
2328 * @brief This internal API is used to enable/disable gyroscope user gain
2329 * feature.
2331 static int8_t set_gyro_user_gain(uint8_t enable, struct bmi2_dev *dev)
2333 /* Variable to define error */
2334 int8_t rslt;
2336 /* Array to define the feature configuration */
2337 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2339 /* Variable to define the array offset */
2340 uint8_t idx = 0;
2342 /* Variable to set flag */
2343 uint8_t feat_found;
2345 /* Initialize feature configuration for gyroscope user gain */
2346 struct bmi2_feature_config gyr_user_gain_cfg = { 0, 0, 0 };
2348 /* Search for user gain feature and extract its configuration details */
2349 feat_found = bmi2_extract_input_feat_config(&gyr_user_gain_cfg, BMI2_GYRO_GAIN_UPDATE, dev);
2350 if (feat_found)
2352 /* Get the configuration from the page where user gain feature resides */
2353 rslt = bmi2_get_feat_config(gyr_user_gain_cfg.page, feat_config, dev);
2354 if (rslt == BMI2_OK)
2356 /* Define the offset for enable/disable of user gain */
2357 idx = gyr_user_gain_cfg.start_addr + BMI2_GYR_USER_GAIN_FEAT_EN_OFFSET;
2359 /* Set the feature enable bit */
2360 feat_config[idx] = BMI2_SET_BITS(feat_config[idx], BMI2_GYR_USER_GAIN_FEAT_EN, enable);
2362 /* Set the configuration back to the page */
2363 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2366 else
2368 rslt = BMI2_E_INVALID_SENSOR;
2371 return rslt;
2375 * @brief This internal API sets step counter parameter configurations.
2377 static int8_t set_step_count_params_config(const uint16_t *step_count_params, struct bmi2_dev *dev)
2379 /* Variable to define error */
2380 int8_t rslt = BMI2_OK;
2382 /* Array to define the feature configuration */
2383 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2385 /* Variable to define index */
2386 uint8_t index = 0;
2388 /* Variable to set flag */
2389 uint8_t feat_found;
2391 /* Initialize feature configuration for step counter parameters */
2392 struct bmi2_feature_config step_params_config = { 0, 0, 0 };
2394 /* Variable to index the page number */
2395 uint8_t page_idx;
2397 /* Variable to define the start page */
2398 uint8_t start_page;
2400 /* Variable to define start address of the parameters */
2401 uint8_t start_addr;
2403 /* Variable to define number of bytes */
2404 uint8_t n_bytes = (BMI2_STEP_CNT_N_PARAMS * 2);
2406 /* Variable to store number of pages */
2407 uint8_t n_pages = (n_bytes / 16);
2409 /* Variable to define the end page */
2410 uint8_t end_page;
2412 /* Variable to define the remaining bytes to be read */
2413 uint8_t remain_len;
2415 /* Variable to define the maximum words(16 bytes or 8 words) to be read in a page */
2416 uint8_t max_len = 8;
2418 /* Variable index bytes in a page */
2419 uint8_t page_byte_idx;
2421 /* Variable to index the parameters */
2422 uint8_t param_idx = 0;
2424 /* Copy the feature configuration address to a local pointer */
2425 uint16_t *data_p = (uint16_t *) (void *)feat_config;
2427 /* Search for step counter parameter feature and extract its configuration details */
2428 feat_found = bmi2_extract_input_feat_config(&step_params_config, BMI2_STEP_COUNTER_PARAMS, dev);
2429 if (feat_found)
2431 /* Get the start page for the step counter parameters */
2432 start_page = step_params_config.page;
2434 /* Get the end page for the step counter parameters */
2435 end_page = start_page + n_pages;
2437 /* Get the start address for the step counter parameters */
2438 start_addr = step_params_config.start_addr;
2440 /* Get the remaining length of bytes to be read */
2441 remain_len = (uint8_t)((n_bytes - (n_pages * 16)) + start_addr);
2442 for (page_idx = start_page; page_idx <= end_page; page_idx++)
2444 /* Get the configuration from the respective page */
2445 rslt = bmi2_get_feat_config(page_idx, feat_config, dev);
2446 if (rslt == BMI2_OK)
2448 /* Start from address 0x00 when switched to next page */
2449 if (page_idx > start_page)
2451 start_addr = 0;
2454 /* Remaining number of words to be read in the page */
2455 if (page_idx == end_page)
2457 max_len = (remain_len / 2);
2460 /* Get offset in words since all the features are set in words length */
2461 page_byte_idx = start_addr / 2;
2462 for (; page_byte_idx < max_len;)
2464 /* Set parameters 1 to 25 */
2465 *(data_p + page_byte_idx) = BMI2_SET_BIT_POS0(*(data_p + page_byte_idx),
2466 BMI2_STEP_COUNT_PARAMS,
2467 step_count_params[param_idx]);
2469 /* Increment offset by 1 word to set to the next parameter */
2470 page_byte_idx++;
2472 /* Increment to next parameter */
2473 param_idx++;
2476 /* Get total length in bytes to copy from local pointer to the array */
2477 page_byte_idx = (uint8_t)(page_byte_idx * 2) - step_params_config.start_addr;
2479 /* Copy the bytes to be set back to the array */
2480 for (index = 0; index < page_byte_idx; index++)
2482 feat_config[step_params_config.start_addr +
2483 index] = *((uint8_t *) data_p + step_params_config.start_addr + index);
2486 /* Set the configuration back to the page */
2487 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2491 else
2493 rslt = BMI2_E_INVALID_SENSOR;
2496 return rslt;
2499 /* @brief This internal API sets step counter configurations like water-mark
2500 * level, reset-counter and output-configuration step detector and activity.
2502 static int8_t set_step_config(const struct bmi2_step_config *config, struct bmi2_dev *dev)
2504 /* Variable to define error */
2505 int8_t rslt;
2507 /* Array to define the feature configuration */
2508 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2510 /* Variable to define the array offset */
2511 uint8_t idx = 0;
2513 /* Variable to define index */
2514 uint8_t index = 0;
2516 /* Variable to set flag */
2517 uint8_t feat_found;
2519 /* Initialize feature configuration for step counter 4 */
2520 struct bmi2_feature_config step_count_config = { 0, 0, 0 };
2522 /* Copy the feature configuration address to a local pointer */
2523 uint16_t *data_p = (uint16_t *) (void *)feat_config;
2525 /* Search for step counter feature and extract its configuration details */
2526 feat_found = bmi2_extract_input_feat_config(&step_count_config, BMI2_STEP_COUNTER, dev);
2527 if (feat_found)
2529 /* Get the configuration from the page where step counter resides */
2530 rslt = bmi2_get_feat_config(step_count_config.page, feat_config, dev);
2531 if (rslt == BMI2_OK)
2533 /* Define the offset in bytes */
2534 idx = step_count_config.start_addr;
2536 /* Get offset in words since all the features are set in words length */
2537 idx = idx / 2;
2539 /* Set water-mark level */
2540 *(data_p + idx) = BMI2_SET_BIT_POS0(*(data_p + idx), BMI2_STEP_COUNT_WM_LEVEL, config->watermark_level);
2542 /* Set reset-counter */
2543 *(data_p + idx) = BMI2_SET_BITS(*(data_p + idx), BMI2_STEP_COUNT_RST_CNT, config->reset_counter);
2545 /* Increment offset by 1 word to set output
2546 * configuration of step detector and step activity
2548 idx++;
2550 /* Set step buffer size */
2551 *(data_p + idx) = BMI2_SET_BITS(*(data_p + idx), BMI2_STEP_BUFFER_SIZE, config->step_buffer_size);
2553 /* Increment offset by 1 more word to get the total length in words */
2554 idx++;
2556 /* Get total length in bytes to copy from local pointer to the array */
2557 idx = (uint8_t)(idx * 2) - step_count_config.start_addr;
2559 /* Copy the bytes to be set back to the array */
2560 for (index = 0; index < idx; index++)
2562 feat_config[step_count_config.start_addr +
2563 index] = *((uint8_t *) data_p + step_count_config.start_addr + index);
2566 /* Set the configuration back to the page */
2567 rslt = bmi2_set_regs(BMI2_FEATURES_REG_ADDR, feat_config, BMI2_FEAT_SIZE_IN_BYTES, dev);
2570 else
2572 rslt = BMI2_E_INVALID_SENSOR;
2575 return rslt;
2579 * @brief This internal API gets step counter parameter configurations.
2581 static int8_t get_step_count_params_config(uint16_t *step_count_params, struct bmi2_dev *dev)
2583 /* Variable to define error */
2584 int8_t rslt = BMI2_OK;
2586 /* Array to define the feature configuration */
2587 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2589 /* Variable to set flag */
2590 uint8_t feat_found;
2592 /* Variable to define LSB */
2593 uint16_t lsb = 0;
2595 /* Variable to define MSB */
2596 uint16_t msb = 0;
2598 /* Variable to define a word */
2599 uint16_t lsb_msb = 0;
2601 /* Initialize feature configuration for step counter 1 */
2602 struct bmi2_feature_config step_params_config = { 0, 0, 0 };
2604 /* Variable to index the page number */
2605 uint8_t page_idx;
2607 /* Variable to define the start page */
2608 uint8_t start_page;
2610 /* Variable to define start address of the parameters */
2611 uint8_t start_addr;
2613 /* Variable to define number of bytes */
2614 uint8_t n_bytes = (BMI2_STEP_CNT_N_PARAMS * 2);
2616 /* Variable to store number of pages */
2617 uint8_t n_pages = (n_bytes / 16);
2619 /* Variable to define the end page */
2620 uint8_t end_page;
2622 /* Variable to define the remaining bytes to be read */
2623 uint8_t remain_len;
2625 /* Variable to define the maximum words to be read in a page */
2626 uint8_t max_len = BMI2_FEAT_SIZE_IN_BYTES;
2628 /* Variable index bytes in a page */
2629 uint8_t page_byte_idx;
2631 /* Variable to index the parameters */
2632 uint8_t param_idx = 0;
2634 /* Search for step counter parameter feature and extract its configuration details */
2635 feat_found = bmi2_extract_input_feat_config(&step_params_config, BMI2_STEP_COUNTER_PARAMS, dev);
2636 if (feat_found)
2638 /* Get the start page for the step counter parameters */
2639 start_page = step_params_config.page;
2641 /* Get the end page for the step counter parameters */
2642 end_page = start_page + n_pages;
2644 /* Get the start address for the step counter parameters */
2645 start_addr = step_params_config.start_addr;
2647 /* Get the remaining length of bytes to be read */
2648 remain_len = (uint8_t)((n_bytes - (n_pages * 16)) + start_addr);
2649 for (page_idx = start_page; page_idx <= end_page; page_idx++)
2651 /* Get the configuration from the respective page */
2652 rslt = bmi2_get_feat_config(page_idx, feat_config, dev);
2653 if (rslt == BMI2_OK)
2655 /* Start from address 0x00 when switched to next page */
2656 if (page_idx > start_page)
2658 start_addr = 0;
2661 /* Remaining number of bytes to be read in the page */
2662 if (page_idx == end_page)
2664 max_len = remain_len;
2667 /* Get the offset */
2668 page_byte_idx = start_addr;
2669 while (page_byte_idx < max_len)
2671 /* Get word to calculate the parameter*/
2672 lsb = (uint16_t) feat_config[page_byte_idx++];
2673 if (page_byte_idx < max_len)
2675 msb = ((uint16_t) feat_config[page_byte_idx++] << 8);
2678 lsb_msb = lsb | msb;
2680 /* Get parameters 1 to 25 */
2681 step_count_params[param_idx] = lsb_msb & BMI2_STEP_COUNT_PARAMS_MASK;
2683 /* Increment to next parameter */
2684 param_idx++;
2689 else
2691 rslt = BMI2_E_INVALID_SENSOR;
2694 return rslt;
2698 * @brief This internal API gets step counter/detector/activity configurations.
2700 static int8_t get_step_config(struct bmi2_step_config *config, struct bmi2_dev *dev)
2702 /* Variable to define error */
2703 int8_t rslt;
2705 /* Array to define the feature configuration */
2706 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2708 /* Variable to define the array offset */
2709 uint8_t idx = 0;
2711 /* Variable to define LSB */
2712 uint16_t lsb = 0;
2714 /* Variable to define MSB */
2715 uint16_t msb = 0;
2717 /* Variable to define a word */
2718 uint16_t lsb_msb = 0;
2720 /* Variable to set flag */
2721 uint8_t feat_found;
2723 /* Initialize feature configuration for step counter */
2724 struct bmi2_feature_config step_count_config = { 0, 0, 0 };
2726 /* Search for step counter 4 feature and extract its configuration details */
2727 feat_found = bmi2_extract_input_feat_config(&step_count_config, BMI2_STEP_COUNTER, dev);
2728 if (feat_found)
2730 /* Get the configuration from the page where step counter 4 parameter resides */
2731 rslt = bmi2_get_feat_config(step_count_config.page, feat_config, dev);
2732 if (rslt == BMI2_OK)
2734 /* Define the offset for feature enable for step counter/detector/activity */
2735 idx = step_count_config.start_addr;
2737 /* Get word to calculate water-mark level and reset counter */
2738 lsb = (uint16_t) feat_config[idx++];
2739 msb = ((uint16_t) feat_config[idx++] << 8);
2740 lsb_msb = lsb | msb;
2742 /* Get water-mark level */
2743 config->watermark_level = lsb_msb & BMI2_STEP_COUNT_WM_LEVEL_MASK;
2745 /* Get reset counter */
2746 config->reset_counter = (lsb_msb & BMI2_STEP_COUNT_RST_CNT_MASK) >> BMI2_STEP_COUNT_RST_CNT_POS;
2748 /* Get word to calculate output configuration of step detector and activity */
2749 lsb = (uint16_t) feat_config[idx++];
2750 msb = ((uint16_t) feat_config[idx++] << 8);
2751 lsb_msb = lsb | msb;
2753 config->step_buffer_size = (lsb_msb & BMI2_STEP_BUFFER_SIZE_MASK) >> BMI2_STEP_BUFFER_SIZE_POS;
2756 else
2758 rslt = BMI2_E_INVALID_SENSOR;
2761 return rslt;
2765 * @brief This internal API gets the output values of step counter.
2767 static int8_t get_step_counter_output(uint32_t *step_count, struct bmi2_dev *dev)
2769 /* Variable to define error */
2770 int8_t rslt;
2772 /* Array to define the feature configuration */
2773 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2775 /* Variables to define index */
2776 uint8_t idx = 0;
2778 /* Variable to set flag */
2779 uint8_t feat_found;
2781 /* Initialize feature output for step counter */
2782 struct bmi2_feature_config step_cnt_out_config = { 0, 0, 0 };
2784 /* Search for step counter output feature and extract its configuration details */
2785 feat_found = extract_output_feat_config(&step_cnt_out_config, BMI2_STEP_COUNTER, dev);
2786 if (feat_found)
2788 /* Get the feature output configuration for step-counter */
2789 rslt = bmi2_get_feat_config(step_cnt_out_config.page, feat_config, dev);
2790 if (rslt == BMI2_OK)
2792 /* Define the offset in bytes for step counter output */
2793 idx = step_cnt_out_config.start_addr;
2795 /* Get the step counter output in 4 bytes */
2796 *step_count = (uint32_t) feat_config[idx++];
2797 *step_count |= ((uint32_t) feat_config[idx++] << 8);
2798 *step_count |= ((uint32_t) feat_config[idx++] << 16);
2799 *step_count |= ((uint32_t) feat_config[idx++] << 24);
2802 else
2804 rslt = BMI2_E_INVALID_SENSOR;
2807 return rslt;
2811 * @brief This internal API gets the error status related to NVM.
2813 static int8_t get_nvm_error_status(struct bmi2_nvm_err_status *nvm_err_stat, struct bmi2_dev *dev)
2815 /* Variable to define error */
2816 int8_t rslt;
2818 /* Array to define the feature configuration */
2819 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2821 /* Variables to define index */
2822 uint8_t idx = 0;
2824 /* Variable to set flag */
2825 uint8_t feat_found;
2827 /* Initialize feature output for NVM error status */
2828 struct bmi2_feature_config nvm_err_cfg = { 0, 0, 0 };
2830 /* Search for NVM error status feature and extract its configuration details */
2831 feat_found = extract_output_feat_config(&nvm_err_cfg, BMI2_NVM_STATUS, dev);
2832 if (feat_found)
2834 /* Get the feature output configuration for NVM error status */
2835 rslt = bmi2_get_feat_config(nvm_err_cfg.page, feat_config, dev);
2836 if (rslt == BMI2_OK)
2838 /* Define the offset in bytes for NVM error status */
2839 idx = nvm_err_cfg.start_addr;
2841 /* Increment index to get the error status */
2842 idx++;
2844 /* Error when NVM load action fails */
2845 nvm_err_stat->load_error = BMI2_GET_BIT_POS0(feat_config[idx], BMI2_NVM_LOAD_ERR_STATUS);
2847 /* Error when NVM program action fails */
2848 nvm_err_stat->prog_error = BMI2_GET_BITS(feat_config[idx], BMI2_NVM_PROG_ERR_STATUS);
2850 /* Error when NVM erase action fails */
2851 nvm_err_stat->erase_error = BMI2_GET_BITS(feat_config[idx], BMI2_NVM_ERASE_ERR_STATUS);
2853 /* Error when NVM program limit is exceeded */
2854 nvm_err_stat->exceed_error = BMI2_GET_BITS(feat_config[idx], BMI2_NVM_END_EXCEED_STATUS);
2856 /* Error when NVM privilege mode is not acquired */
2857 nvm_err_stat->privil_error = BMI2_GET_BITS(feat_config[idx], BMI2_NVM_PRIV_ERR_STATUS);
2860 else
2862 rslt = BMI2_E_INVALID_SENSOR;
2865 return rslt;
2869 * @brief This internal API is used to get enable status of gyroscope user gain
2870 * update.
2872 static int8_t get_user_gain_upd_status(uint8_t *status, struct bmi2_dev *dev)
2874 /* Variable to define error */
2875 int8_t rslt = BMI2_OK;
2877 /* Array to define the feature configuration */
2878 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
2880 /* Variable to define the array offset */
2881 uint8_t idx = 0;
2883 /* Variable to set flag */
2884 uint8_t feat_found;
2886 /* Variable to check APS status */
2887 uint8_t aps_stat = 0;
2889 /* Initialize feature configuration for gyroscope user gain */
2890 struct bmi2_feature_config gyr_user_gain_cfg = { 0, 0, 0 };
2892 /* Search for user gain feature and extract its configuration details */
2893 feat_found = bmi2_extract_input_feat_config(&gyr_user_gain_cfg, BMI2_GYRO_GAIN_UPDATE, dev);
2894 if (feat_found)
2896 /* Disable advance power save */
2897 aps_stat = dev->aps_status;
2898 if (aps_stat == BMI2_ENABLE)
2900 rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);
2903 if (rslt == BMI2_OK)
2905 /* Get the configuration from the page where user gain feature resides */
2906 rslt = bmi2_get_feat_config(gyr_user_gain_cfg.page, feat_config, dev);
2907 if (rslt == BMI2_OK)
2909 /* Define the offset for enable/disable of user gain */
2910 idx = gyr_user_gain_cfg.start_addr + BMI2_GYR_USER_GAIN_FEAT_EN_OFFSET;
2912 /* Set the feature enable status */
2913 *status = BMI2_GET_BITS(feat_config[idx], BMI2_GYR_USER_GAIN_FEAT_EN);
2917 else
2919 rslt = BMI2_E_INVALID_SENSOR;
2922 /* Enable Advance power save if disabled while configuring and not when already disabled */
2923 if ((rslt == BMI2_OK) && (aps_stat == BMI2_ENABLE))
2925 rslt = bmi2_set_adv_power_save(BMI2_ENABLE, dev);
2928 return rslt;
2932 * @brief This internal API is used to parse and store the activity recognition
2933 * output from the FIFO data.
2935 static int8_t unpack_act_recog_output(struct bmi2_act_recog_output *act_recog,
2936 uint16_t *data_index,
2937 const struct bmi2_fifo_frame *fifo)
2939 /* Variable to define error */
2940 int8_t rslt = BMI2_OK;
2942 /* Variables to define 4 bytes of sensor time */
2943 uint32_t time_stamp_byte4 = 0;
2944 uint32_t time_stamp_byte3 = 0;
2945 uint32_t time_stamp_byte2 = 0;
2946 uint32_t time_stamp_byte1 = 0;
2948 /* Validate data index */
2949 if ((*data_index + BMI2_FIFO_VIRT_ACT_DATA_LENGTH) >= fifo->length)
2951 /* Update the data index to the last byte */
2952 (*data_index) = fifo->length;
2954 /* FIFO is empty */
2955 rslt = BMI2_W_FIFO_EMPTY;
2957 else
2959 /* Get time-stamp from the activity recognition frame */
2960 time_stamp_byte4 = ((uint32_t)(fifo->data[(*data_index) + 3]) << 24);
2961 time_stamp_byte3 = ((uint32_t)(fifo->data[(*data_index) + 2]) << 16);
2962 time_stamp_byte2 = fifo->data[(*data_index) + 1] << 8;
2963 time_stamp_byte1 = fifo->data[(*data_index)];
2965 /* Update time-stamp from the virtual frame */
2966 act_recog->time_stamp = (time_stamp_byte4 | time_stamp_byte3 | time_stamp_byte2 | time_stamp_byte1);
2968 /* Move the data index by 4 bytes */
2969 (*data_index) = (*data_index) + BMI2_FIFO_VIRT_ACT_TIME_LENGTH;
2971 /* Update the previous activity from the virtual frame */
2972 act_recog->prev_act = fifo->data[(*data_index)];
2974 /* Move the data index by 1 byte */
2975 (*data_index) = (*data_index) + BMI2_FIFO_VIRT_ACT_TYPE_LENGTH;
2977 /* Update the current activity from the virtual frame */
2978 act_recog->curr_act = fifo->data[(*data_index)];
2980 /* Move the data index by 1 byte */
2981 (*data_index) = (*data_index) + BMI2_FIFO_VIRT_ACT_STAT_LENGTH;
2983 /* More frames could be read */
2984 rslt = BMI2_W_PARTIAL_READ;
2987 return rslt;
2991 * @brief This internal API gets the error status related to virtual frames.
2993 static int8_t get_vfrm_error_status(struct bmi2_vfrm_err_status *vfrm_err_stat, struct bmi2_dev *dev)
2995 /* Variable to define error */
2996 int8_t rslt;
2998 /* Array to define the feature configuration */
2999 uint8_t feat_config[BMI2_FEAT_SIZE_IN_BYTES] = { 0 };
3001 /* Variables to define index */
3002 uint8_t idx = 0;
3004 /* Variable to set flag */
3005 uint8_t feat_found;
3007 /* Initialize feature output for VFRM error status */
3008 struct bmi2_feature_config vfrm_err_cfg = { 0, 0, 0 };
3010 /* Search for VFRM error status feature and extract its configuration details */
3011 feat_found = extract_output_feat_config(&vfrm_err_cfg, BMI2_VFRM_STATUS, dev);
3012 if (feat_found)
3014 /* Get the feature output configuration for VFRM error status */
3015 rslt = bmi2_get_feat_config(vfrm_err_cfg.page, feat_config, dev);
3016 if (rslt == BMI2_OK)
3018 /* Define the offset in bytes for VFRM error status */
3019 idx = vfrm_err_cfg.start_addr;
3021 /* Increment index to get the error status */
3022 idx++;
3024 /* Internal error while acquiring lock for FIFO */
3025 vfrm_err_stat->lock_error = BMI2_GET_BITS(feat_config[idx], BMI2_VFRM_LOCK_ERR_STATUS);
3027 /* Internal error while writing byte into FIFO */
3028 vfrm_err_stat->write_error = BMI2_GET_BITS(feat_config[idx], BMI2_VFRM_WRITE_ERR_STATUS);
3030 /* Internal error while writing into FIFO */
3031 vfrm_err_stat->fatal_error = BMI2_GET_BITS(feat_config[idx], BMI2_VFRM_FATAL_ERR_STATUS);
3034 else
3036 rslt = BMI2_E_INVALID_SENSOR;
3039 return rslt;
3043 * @brief This internal API skips S4S frame in the FIFO data while getting
3044 * step activity output.
3046 static int8_t move_if_s4s_frame(const uint8_t *frame_header, uint16_t *data_index, const struct bmi2_fifo_frame *fifo)
3048 /* Variable to define error */
3049 int8_t rslt = BMI2_OK;
3051 /* Variable to extract virtual header byte */
3052 uint8_t virtual_header_mode;
3054 /* Variable to define pay-load in words */
3055 uint8_t payload_word = 0;
3057 /* Variable to define pay-load in bytes */
3058 uint8_t payload_bytes = 0;
3060 /* Extract virtual header mode from the frame header */
3061 virtual_header_mode = BMI2_GET_BITS(*frame_header, BMI2_FIFO_VIRT_FRM_MODE);
3063 /* If the extracted header byte is a virtual header */
3064 if (virtual_header_mode == BMI2_FIFO_VIRT_FRM_MODE)
3066 /* If frame header is not activity recognition header */
3067 if (*frame_header != 0xC8)
3069 /* Extract pay-load in words from the header byte */
3070 payload_word = BMI2_GET_BITS(*frame_header, BMI2_FIFO_VIRT_PAYLOAD) + 1;
3072 /* Convert to bytes */
3073 payload_bytes = (uint8_t)(payload_word * 2);
3075 /* Move the data index by those pay-load bytes */
3076 rslt = move_next_frame(data_index, payload_bytes, fifo);
3080 return rslt;
3084 * @brief This internal API enables/disables compensation of the gain defined
3085 * in the GAIN register.
3087 static int8_t enable_gyro_gain(uint8_t enable, struct bmi2_dev *dev)
3089 /* Variable to define error */
3090 int8_t rslt;
3092 /* Variable to define register data */
3093 uint8_t reg_data = 0;
3095 rslt = bmi2_get_regs(BMI2_GYR_OFF_COMP_6_ADDR, &reg_data, 1, dev);
3096 if (rslt == BMI2_OK)
3098 reg_data = BMI2_SET_BITS(reg_data, BMI2_GYR_GAIN_EN, enable);
3099 rslt = bmi2_set_regs(BMI2_GYR_OFF_COMP_6_ADDR, &reg_data, 1, dev);
3102 return rslt;
3106 * @brief This internal API is used to extract the output feature configuration
3107 * details from the look-up table.
3109 static uint8_t extract_output_feat_config(struct bmi2_feature_config *feat_output,
3110 uint8_t type,
3111 const struct bmi2_dev *dev)
3113 /* Variable to define loop */
3114 uint8_t loop = 0;
3116 /* Variable to set flag */
3117 uint8_t feat_found = BMI2_FALSE;
3119 /* Search for the output feature from the output configuration array */
3120 while (loop < dev->out_sens)
3122 if (dev->feat_output[loop].type == type)
3124 *feat_output = dev->feat_output[loop];
3125 feat_found = BMI2_TRUE;
3126 break;
3129 loop++;
3132 /* Return flag */
3133 return feat_found;
3137 * @brief This internal API is used to move the data index ahead of the
3138 * current_frame_length parameter when unnecessary FIFO data appears while
3139 * extracting the user specified data.
3141 static int8_t move_next_frame(uint16_t *data_index, uint8_t current_frame_length, const struct bmi2_fifo_frame *fifo)
3143 /* Variables to define error */
3144 int8_t rslt = BMI2_OK;
3146 /* Validate data index */
3147 if (((*data_index) + current_frame_length) > fifo->length)
3149 /* Move the data index to the last byte */
3150 (*data_index) = fifo->length;
3152 /* FIFO is empty */
3153 rslt = BMI2_W_FIFO_EMPTY;
3155 else
3157 /* Move the data index to next frame */
3158 (*data_index) = (*data_index) + current_frame_length;
3160 /* More frames could be read */
3161 rslt = BMI2_W_PARTIAL_READ;
3164 return rslt;