-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathism6hg256x_motion_intensity.h
More file actions
311 lines (270 loc) · 13.2 KB
/
ism6hg256x_motion_intensity.h
File metadata and controls
311 lines (270 loc) · 13.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
/**
******************************************************************************
* @attention
*
* Copyright (c) 2025 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
#ifndef ISM6HG256X_MOTION_INTENSITY_H
#define ISM6HG256X_MOTION_INTENSITY_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define ISM6HG256X_MOTION_INTENSITY_SENSORS_NUM 1
#ifndef MEMS_CONF_SHARED_TYPES
#define MEMS_CONF_SHARED_TYPES
#define MEMS_CONF_ARRAY_LEN(x) (sizeof(x) / sizeof(x[0]))
/*
* MEMS_CONF_SHARED_TYPES format supports the following operations:
* - MEMS_CONF_OP_TYPE_TYPE_READ: read the register at the location specified
* by the "address" field ("data" field is ignored)
* - MEMS_CONF_OP_TYPE_TYPE_WRITE: write the value specified by the "data"
* field at the location specified by the "address" field
* - MEMS_CONF_OP_TYPE_TYPE_DELAY: wait the number of milliseconds specified by
* the "data" field ("address" field is ignored)
* - MEMS_CONF_OP_TYPE_TYPE_POLL_SET: poll the register at the location
* specified by the "address" field until all the bits identified by the mask
* specified by the "data" field are set to 1
* - MEMS_CONF_OP_TYPE_TYPE_POLL_RESET: poll the register at the location
* specified by the "address" field until all the bits identified by the mask
* specified by the "data" field are reset to 0
*/
struct mems_conf_name_list {
const char *const *list;
uint16_t len;
};
enum {
MEMS_CONF_OP_TYPE_READ = 1,
MEMS_CONF_OP_TYPE_WRITE = 2,
MEMS_CONF_OP_TYPE_DELAY = 3,
MEMS_CONF_OP_TYPE_POLL_SET = 4,
MEMS_CONF_OP_TYPE_POLL_RESET = 5
};
struct mems_conf_op {
uint8_t type;
uint8_t address;
uint8_t data;
};
struct mems_conf_op_list {
const struct mems_conf_op *list;
uint32_t len;
};
#endif /* MEMS_CONF_SHARED_TYPES */
#ifndef MEMS_CONF_METADATA_SHARED_TYPES
#define MEMS_CONF_METADATA_SHARED_TYPES
struct mems_conf_application {
char *name;
char *version;
};
struct mems_conf_result {
uint8_t code;
char *label;
};
enum {
MEMS_CONF_OUTPUT_CORE_HW = 1,
MEMS_CONF_OUTPUT_CORE_EMB = 2,
MEMS_CONF_OUTPUT_CORE_FSM = 3,
MEMS_CONF_OUTPUT_CORE_MLC = 4,
MEMS_CONF_OUTPUT_CORE_ISPU = 5
};
enum {
MEMS_CONF_OUTPUT_TYPE_UINT8_T = 1,
MEMS_CONF_OUTPUT_TYPE_INT8_T = 2,
MEMS_CONF_OUTPUT_TYPE_CHAR = 3,
MEMS_CONF_OUTPUT_TYPE_UINT16_T = 4,
MEMS_CONF_OUTPUT_TYPE_INT16_T = 5,
MEMS_CONF_OUTPUT_TYPE_UINT32_T = 6,
MEMS_CONF_OUTPUT_TYPE_INT32_T = 7,
MEMS_CONF_OUTPUT_TYPE_UINT64_T = 8,
MEMS_CONF_OUTPUT_TYPE_INT64_T = 9,
MEMS_CONF_OUTPUT_TYPE_HALF = 10,
MEMS_CONF_OUTPUT_TYPE_FLOAT = 11,
MEMS_CONF_OUTPUT_TYPE_DOUBLE = 12
};
struct mems_conf_output {
char *name;
uint8_t core;
uint8_t type;
uint16_t len;
uint8_t reg_addr;
char *reg_name;
uint8_t num_results;
const struct mems_conf_result *results;
};
struct mems_conf_output_list {
const struct mems_conf_output *list;
uint16_t len;
};
struct mems_conf_mlc_identifier {
uint8_t fifo_tag;
uint16_t id;
char *label;
};
struct mems_conf_mlc_identifier_list {
const struct mems_conf_mlc_identifier *list;
uint16_t len;
};
#endif /* MEMS_CONF_METADATA_SHARED_TYPES */
static const char *const ism6hg256x_motion_intensity_format_version = "2.0";
static const char *const ism6hg256x_motion_intensity_description = NULL;
static const struct mems_conf_application ism6hg256x_motion_intensity_application = {
.name = "Configuration Converter Tool",
.version = "1.0"
};
static const char *const ism6hg256x_motion_intensity_date = NULL;
/* Sensor names */
static const char *const ism6hg256x_motion_intensity_names_0[] = {
"ISM6HG256X"
};
static const struct mems_conf_name_list ism6hg256x_motion_intensity_name_lists[ISM6HG256X_MOTION_INTENSITY_SENSORS_NUM] = {
{ .list = ism6hg256x_motion_intensity_names_0, .len = (uint16_t)MEMS_CONF_ARRAY_LEN(ism6hg256x_motion_intensity_names_0) }
};
/* Configurations */
static const struct mems_conf_op ism6hg256x_motion_intensity_conf_0[] = {
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x10, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x11, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x01, .data = 0x80 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x04, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x05, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x17, .data = 0x40 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x02, .data = 0x11 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x08, .data = 0xEA },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x66 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x03 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x70 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x03 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x0A },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x01 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x2D },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x02, .data = 0x11 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x08, .data = 0xFA },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x5C },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x03 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x72 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x03 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x7E },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x03 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x02, .data = 0x31 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x08, .data = 0x5C },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x3F },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x01 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x10 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x1F },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x02, .data = 0x31 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x08, .data = 0x72 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x01, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x01, .data = 0x80 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x17, .data = 0x40 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x02, .data = 0x31 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x08, .data = 0x7E },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x9C },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x20 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x10 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0xC0 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x04 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x23 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x21 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0xC0 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0xFE },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x25 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x32 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0xC0 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x40 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x28 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x43 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0xC0 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x2D },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x54 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0xC0 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x40 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x31 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x65 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0xC0 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x35 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0x76 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x09, .data = 0xE0 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x01, .data = 0x80 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x17, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x04, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x05, .data = 0x10 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x02, .data = 0x01 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x01, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x5E, .data = 0x02 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x01, .data = 0x80 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x0D, .data = 0x01 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x60, .data = 0x05 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x45, .data = 0x02 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x01, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x15, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x17, .data = 0x00 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x10, .data = 0x03 },
{ .type = MEMS_CONF_OP_TYPE_WRITE, .address = 0x11, .data = 0x00 }
};
static const struct mems_conf_op_list ism6hg256x_motion_intensity_confs[ISM6HG256X_MOTION_INTENSITY_SENSORS_NUM] = {
{ .list = ism6hg256x_motion_intensity_conf_0, .len = (uint32_t)MEMS_CONF_ARRAY_LEN(ism6hg256x_motion_intensity_conf_0) }
};
/* Outputs */
static const struct mems_conf_result ism6hg256x_motion_intensity_results_0_0[] = {
{ .code = 0x00, .label = "Intensity_0" },
{ .code = 0x01, .label = "Intensity_1" },
{ .code = 0x02, .label = "Intensity_2" },
{ .code = 0x03, .label = "Intensity_3" },
{ .code = 0x04, .label = "Intensity_4" },
{ .code = 0x05, .label = "Intensity_5" },
{ .code = 0x06, .label = "Intensity_6" },
{ .code = 0x07, .label = "Intensity_7" }
};
static const struct mems_conf_output ism6hg256x_motion_intensity_outputs_0[] = {
{
.name = "DT1",
.core = MEMS_CONF_OUTPUT_CORE_MLC,
.type = MEMS_CONF_OUTPUT_TYPE_UINT8_T,
.len = 1,
.reg_addr = 0x70,
.reg_name = "MLC1_SRC",
.num_results = (uint8_t)MEMS_CONF_ARRAY_LEN(ism6hg256x_motion_intensity_results_0_0),
.results = ism6hg256x_motion_intensity_results_0_0
}
};
static const struct mems_conf_output_list ism6hg256x_motion_intensity_output_lists[ISM6HG256X_MOTION_INTENSITY_SENSORS_NUM] = {
{ .list = ism6hg256x_motion_intensity_outputs_0, .len = (uint16_t)MEMS_CONF_ARRAY_LEN(ism6hg256x_motion_intensity_outputs_0) }
};
/* MLC identifiers */
static const struct mems_conf_mlc_identifier ism6hg256x_motion_intensity_mlc_identifiers_0[] = {
{ .fifo_tag = 0x1C, .id = 0x0370, .label = "F1_VAR_on_ACC_V" }
};
static const struct mems_conf_mlc_identifier_list ism6hg256x_motion_intensity_mlc_identifier_lists[ISM6HG256X_MOTION_INTENSITY_SENSORS_NUM] = {
{ .list = ism6hg256x_motion_intensity_mlc_identifiers_0, .len = (uint16_t)MEMS_CONF_ARRAY_LEN(ism6hg256x_motion_intensity_mlc_identifiers_0) }
};
#ifdef __cplusplus
}
#endif
#endif /* ISM6HG256X_MOTION_INTENSITY_H */