example_cargo_reg_protocol_access.c
Go to the documentation of this file.
1 // Copyright (c) Acconeer AB, 2023-2025
2 // All rights reserved
3 // This file is subject to the terms and conditions defined in the file
4 // 'LICENSES/license_acconeer.txt', (BSD 3-Clause License) which is part
5 // of this source code package.
6
7 #include <stdbool.h>
8 #include <stdint.h>
9
10 #include "acc_integration.h"
11 #include "acc_version.h"
12 #include "example_cargo.h"
13
14 #include "acc_reg_protocol.h"
15 #include "example_cargo_reg_protocol.h"
16 #include "i2c_example_cargo.h"
17
18 /**
19 * @brief Get the protocol error status flags
20 *
21 * @return error flags as uint32 register value
22 */
23 static uint32_t get_protocol_error_flags(void);
24
25 //
26 // REGISTER READ/WRITE ACCESS FUNCTIONS
27 //
28
29 void example_cargo_reg_read_application_id(uint32_t *value)
30 {
31 *value = EXAMPLE_CARGO_REG_APPLICATION_ID_ENUM_EXAMPLE_CARGO;
32 }
33
34 void example_cargo_reg_read_version(uint32_t *value)
35 {
36 *value = acc_version_get_hex();
37 }
38
39 void example_cargo_reg_read_protocol_status(uint32_t *value)
40 {
41 uint32_t error_flags = get_protocol_error_flags();
42 uint32_t protocol_status = 0;
43
44 if ((error_flags & ACC_REG_ERROR_FLAG_PROTOCOL_STATE_ERROR) != 0)
45 {
46 protocol_status |= EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_PROTOCOL_STATE_ERROR_MASK;
47 }
48
49 if ((error_flags & ACC_REG_ERROR_FLAG_PACKET_LENGTH_ERROR) != 0)
50 {
51 protocol_status |= EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_PACKET_LENGTH_ERROR_MASK;
52 }
53
54 if ((error_flags & ACC_REG_ERROR_FLAG_ADDRESS_ERROR) != 0)
55 {
56 protocol_status |= EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_ADDRESS_ERROR_MASK;
57 }
58
59 if ((error_flags & ACC_REG_ERROR_FLAG_WRITE_FAILED) != 0)
60 {
61 protocol_status |= EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_WRITE_FAILED_MASK;
62 }
63
64 if ((error_flags & ACC_REG_ERROR_FLAG_WRITE_TO_READ_ONLY) != 0)
65 {
66 protocol_status |= EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_WRITE_TO_READ_ONLY_MASK;
67 }
68
69 *value = protocol_status;
70 }
71
72 void example_cargo_reg_read_measure_counter(uint32_t *value)
73 {
74 *value = i2c_example_cargo_get_measure_counter();
75 }
76
77 void example_cargo_reg_read_actual_presence_update_rate(uint32_t *value)
78 {
79 *value = i2c_example_cargo_get_actual_presence_update_rate();
80 }
81
82 bool example_cargo_reg_write_command(const uint32_t value)
83 {
84 return i2c_example_cargo_command(value);
85 }
86
87 void example_cargo_reg_read_application_status(uint32_t *value)
88 {
89 *value = i2c_example_cargo_get_status();
90 }
91
92 void example_cargo_reg_read_container_size(uint32_t *value)
93 {
94 cargo_config_t *config = i2c_example_cargo_get_config();
95
96 switch (config->container_size)
97 {
98 case CARGO_CONTAINER_SIZE_10_FT:
99 *value = 10U;
100 break;
101 case CARGO_CONTAINER_SIZE_20_FT:
102 *value = 20U;
103 break;
104 case CARGO_CONTAINER_SIZE_40_FT:
105 *value = 40U;
106 break;
107 default:
108 *value = 0U;
109 break;
110 }
111 }
112
113 bool example_cargo_reg_write_container_size(uint32_t value)
114 {
115 bool status = true;
116
117 cargo_config_t *config = i2c_example_cargo_get_config();
118
119 switch (value)
120 {
121 case 10U:
122 config->container_size = CARGO_CONTAINER_SIZE_10_FT;
123 break;
124 case 20U:
125 config->container_size = CARGO_CONTAINER_SIZE_20_FT;
126 break;
127 case 40U:
128 config->container_size = CARGO_CONTAINER_SIZE_40_FT;
129 break;
130 default:
131 status = false;
132 break;
133 }
134 return status;
135 }
136
137 void example_cargo_reg_read_activate_utilization_level(uint32_t *value)
138 {
139 cargo_config_t *config = i2c_example_cargo_get_config();
140
141 *value = (uint32_t)config->activate_utilization_level;
142 }
143
144 bool example_cargo_reg_write_activate_utilization_level(uint32_t value)
145 {
146 cargo_config_t *config = i2c_example_cargo_get_config();
147
148 config->activate_utilization_level = (bool)value;
149
150 return true;
151 }
152
153 void example_cargo_reg_read_utilization_signal_quality(uint32_t *value)
154 {
155 cargo_config_t *config = i2c_example_cargo_get_config();
156
157 *value = acc_reg_protocol_float_to_uint32_milli(config->utilization.signal_quality);
158 }
159
160 bool example_cargo_reg_write_utilization_signal_quality(uint32_t value)
161 {
162 cargo_config_t *config = i2c_example_cargo_get_config();
163
164 config->utilization.signal_quality = acc_reg_protocol_uint32_milli_to_float(value);
165
166 return true;
167 }
168
169 void example_cargo_reg_read_utilization_threshold_sensitivity(uint32_t *value)
170 {
171 cargo_config_t *config = i2c_example_cargo_get_config();
172
173 *value = acc_reg_protocol_float_to_uint32_milli(config->utilization.threshold_sensitivity);
174 }
175
176 bool example_cargo_reg_write_utilization_threshold_sensitivity(uint32_t value)
177 {
178 cargo_config_t *config = i2c_example_cargo_get_config();
179
180 config->utilization.threshold_sensitivity = acc_reg_protocol_uint32_milli_to_float(value);
181
182 return true;
183 }
184
185 void example_cargo_reg_read_activate_presence(uint32_t *value)
186 {
187 cargo_config_t *config = i2c_example_cargo_get_config();
188
189 *value = (bool)config->activate_presence;
190 }
191
192 bool example_cargo_reg_write_activate_presence(uint32_t value)
193 {
194 cargo_config_t *config = i2c_example_cargo_get_config();
195
196 config->activate_presence = (bool)value;
197
198 return true;
199 }
200
201 void example_cargo_reg_read_presence_update_rate(uint32_t *value)
202 {
203 cargo_config_t *config = i2c_example_cargo_get_config();
204
205 *value = acc_reg_protocol_float_to_uint32_milli(config->presence.update_rate);
206 }
207
208 bool example_cargo_reg_write_presence_update_rate(uint32_t value)
209 {
210 cargo_config_t *config = i2c_example_cargo_get_config();
211
212 config->presence.update_rate = acc_reg_protocol_uint32_milli_to_float(value);
213
214 return true;
215 }
216
217 void example_cargo_reg_read_presence_sweeps_per_frame(uint32_t *value)
218 {
219 cargo_config_t *config = i2c_example_cargo_get_config();
220
221 *value = (uint32_t)config->presence.sweeps_per_frame;
222 }
223
224 bool example_cargo_reg_write_presence_sweeps_per_frame(uint32_t value)
225 {
226 cargo_config_t *config = i2c_example_cargo_get_config();
227
228 config->presence.sweeps_per_frame = (uint16_t)value;
229
230 return true;
231 }
232
233 void example_cargo_reg_read_presence_signal_quality(uint32_t *value)
234 {
235 cargo_config_t *config = i2c_example_cargo_get_config();
236
237 *value = acc_reg_protocol_float_to_uint32_milli(config->presence.signal_quality);
238 }
239
240 bool example_cargo_reg_write_presence_signal_quality(uint32_t value)
241 {
242 cargo_config_t *config = i2c_example_cargo_get_config();
243
244 config->presence.signal_quality = acc_reg_protocol_uint32_milli_to_float(value);
245
246 return true;
247 }
248
249 void example_cargo_reg_read_presence_inter_detection_threshold(uint32_t *value)
250 {
251 cargo_config_t *config = i2c_example_cargo_get_config();
252
253 *value = acc_reg_protocol_float_to_uint32_milli(config->presence.inter_detection_threshold);
254 }
255
256 bool example_cargo_reg_write_presence_inter_detection_threshold(uint32_t value)
257 {
258 cargo_config_t *config = i2c_example_cargo_get_config();
259
260 config->presence.inter_detection_threshold = acc_reg_protocol_uint32_milli_to_float(value);
261
262 return true;
263 }
264
265 void example_cargo_reg_read_presence_intra_detection_threshold(uint32_t *value)
266 {
267 cargo_config_t *config = i2c_example_cargo_get_config();
268
269 *value = acc_reg_protocol_float_to_uint32_milli(config->presence.intra_detection_threshold);
270 }
271
272 bool example_cargo_reg_write_presence_intra_detection_threshold(uint32_t value)
273 {
274 cargo_config_t *config = i2c_example_cargo_get_config();
275
276 config->presence.intra_detection_threshold = acc_reg_protocol_uint32_milli_to_float(value);
277
278 return true;
279 }
280
281 void example_cargo_reg_read_result_header(uint32_t *value)
282 {
283 cargo_result_t result = {0};
284 int16_t temperature = i2c_example_cargo_get_temperature();
285
286 uint32_t temperature_bits =
287 (((uint32_t)temperature) << EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_TEMPERATURE_POS) & EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_TEMPERATURE_MASK;
288
289 i2c_example_cargo_copy_utilization_result_fields(&result);
290
291 uint32_t utilization_valid_bit = (((uint32_t)result.utilization_valid) << EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_UTILIZATION_LEVEL_VALID_POS) &
292 EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_UTILIZATION_LEVEL_VALID_MASK;
293
294 i2c_example_cargo_copy_presence_burst_result_fields(&result);
295
296 uint32_t presence_valid_bit = (((uint32_t)result.presence_valid) << EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_PRESENCE_VALID_POS) &
297 EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_PRESENCE_VALID_MASK;
298
299 uint32_t packed = temperature_bits | utilization_valid_bit | presence_valid_bit;
300 *value = packed;
301 }
302
303 void example_cargo_reg_read_utilization_distance(uint32_t *value)
304 {
305 cargo_result_t result = {0};
306
307 i2c_example_cargo_copy_utilization_result_fields(&result);
308
309 *value = acc_reg_protocol_float_to_uint32_milli(result.distance);
310 }
311
312 void example_cargo_reg_read_utilization_level_mm(uint32_t *value)
313 {
314 cargo_result_t result = {0};
315
316 i2c_example_cargo_copy_utilization_result_fields(&result);
317
318 *value = acc_reg_protocol_float_to_uint32_milli(result.level_m);
319 }
320
321 void example_cargo_reg_read_utilization_level_percent(uint32_t *value)
322 {
323 cargo_result_t result = {0};
324
325 i2c_example_cargo_copy_utilization_result_fields(&result);
326
327 *value = (uint32_t)result.level_percent;
328 }
329
330 void example_cargo_reg_read_presence_detected(uint32_t *value)
331 {
332 cargo_result_t result = {0};
333
334 i2c_example_cargo_copy_presence_burst_result_fields(&result);
335
336 *value = (uint32_t)result.presence_detected;
337 }
338
339 void example_cargo_reg_read_max_inter_presence_score(uint32_t *value)
340 {
341 cargo_result_t result = {0};
342
343 i2c_example_cargo_copy_presence_burst_result_fields(&result);
344
345 *value = acc_reg_protocol_float_to_uint32_milli(result.inter_presence_score);
346 }
347
348 void example_cargo_reg_read_max_intra_presence_score(uint32_t *value)
349 {
350 cargo_result_t result = {0};
351
352 i2c_example_cargo_copy_presence_burst_result_fields(&result);
353
354 *value = acc_reg_protocol_float_to_uint32_milli(result.intra_presence_score);
355 }
356
357 //
358 // PRIVATE HELPER FUNCTIONS
359 //
360
361 static uint32_t get_protocol_error_flags(void)
362 {
363 /* Make sure we do not have a race for error flags */
364 acc_integration_critical_section_enter();
365
366 uint32_t error_flags = acc_reg_protocol_get_error_flags();
367
368 acc_integration_critical_section_exit();
369
370 return error_flags;
371 }
example_cargo_reg_read_application_status
void example_cargo_reg_read_application_status(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:87
acc_reg_protocol_float_to_uint32_milli
uint32_t acc_reg_protocol_float_to_uint32_milli(float value)
Convert 1000 * float to uint32.
Definition: acc_reg_protocol.c:336
example_cargo_reg_read_result_header
void example_cargo_reg_read_result_header(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:281
example_cargo_reg_write_utilization_threshold_sensitivity
bool example_cargo_reg_write_utilization_threshold_sensitivity(uint32_t value)
Definition: example_cargo_reg_protocol_access.c:176
cargo_config_t::update_rate
float update_rate
Definition: example_cargo.h:75
get_protocol_error_flags
static uint32_t get_protocol_error_flags(void)
Get the protocol error status flags.
Definition: example_cargo_reg_protocol_access.c:361
example_cargo_reg_read_utilization_threshold_sensitivity
void example_cargo_reg_read_utilization_threshold_sensitivity(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:169
example_cargo_reg_write_activate_presence
bool example_cargo_reg_write_activate_presence(uint32_t value)
Definition: example_cargo_reg_protocol_access.c:192
cargo_config_t::intra_detection_threshold
float intra_detection_threshold
Definition: example_cargo.h:96
acc_reg_protocol_get_error_flags
uint32_t acc_reg_protocol_get_error_flags(void)
Get the error flags for the register protocol.
Definition: acc_reg_protocol.c:319
i2c_example_cargo_get_status
uint32_t i2c_example_cargo_get_status(void)
Get cargo example app status.
Definition: i2c_example_cargo.c:241
i2c_example_cargo_get_actual_presence_update_rate
uint32_t i2c_example_cargo_get_actual_presence_update_rate(void)
Get the estimated presence update rate of the.
Definition: i2c_example_cargo.c:264
ACC_REG_ERROR_FLAG_PACKET_LENGTH_ERROR
#define ACC_REG_ERROR_FLAG_PACKET_LENGTH_ERROR
Definition: acc_reg_protocol.h:15
acc_version.h
i2c_example_cargo_copy_utilization_result_fields
void i2c_example_cargo_copy_utilization_result_fields(cargo_result_t *dst_result)
Copy utilization example app cargo result.
Definition: i2c_example_cargo.c:275
EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_PRESENCE_VALID_POS
#define EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_PRESENCE_VALID_POS
Definition: example_cargo_reg_protocol.h:102
cargo_config_t::signal_quality
float signal_quality
Definition: example_cargo.h:57
ACC_REG_ERROR_FLAG_ADDRESS_ERROR
#define ACC_REG_ERROR_FLAG_ADDRESS_ERROR
Definition: acc_reg_protocol.h:16
example_cargo_reg_read_actual_presence_update_rate
void example_cargo_reg_read_actual_presence_update_rate(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:77
cargo_result_t::distance
float distance
Definition: example_cargo.h:118
i2c_example_cargo_command
bool i2c_example_cargo_command(uint32_t command)
Send command to be executed to cargo i2c app.
Definition: i2c_example_cargo.c:219
acc_integration_critical_section_exit
void acc_integration_critical_section_exit(void)
Definition: acc_integration_cortex.c:16
cargo_result_t::level_m
float level_m
Definition: example_cargo.h:123
i2c_example_cargo_get_measure_counter
uint32_t i2c_example_cargo_get_measure_counter(void)
Get the count of number of measurements performed.
Definition: i2c_example_cargo.c:253
cargo_config_t::utilization
struct cargo_config_t::@0 utilization
example_cargo_reg_write_presence_signal_quality
bool example_cargo_reg_write_presence_signal_quality(uint32_t value)
Definition: example_cargo_reg_protocol_access.c:240
acc_integration.h
example_cargo_reg_write_presence_intra_detection_threshold
bool example_cargo_reg_write_presence_intra_detection_threshold(uint32_t value)
Definition: example_cargo_reg_protocol_access.c:272
acc_version_get_hex
uint32_t acc_version_get_hex(void)
Get the version of the Acconeer software as a hex number.
cargo_config_t
Configuration struct for cargo.
Definition: example_cargo.h:43
example_cargo_reg_read_protocol_status
void example_cargo_reg_read_protocol_status(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:39
example_cargo_reg_read_presence_detected
void example_cargo_reg_read_presence_detected(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:330
config
cargo_config_t config
Definition: i2c_example_cargo.c:34
cargo_result_t::inter_presence_score
float inter_presence_score
Definition: example_cargo.h:137
example_cargo_reg_read_max_inter_presence_score
void example_cargo_reg_read_max_inter_presence_score(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:339
example_cargo_reg_read_presence_inter_detection_threshold
void example_cargo_reg_read_presence_inter_detection_threshold(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:249
cargo_result_t::level_percent
float level_percent
Definition: example_cargo.h:128
cargo_config_t::sweeps_per_frame
uint16_t sweeps_per_frame
Definition: example_cargo.h:80
CARGO_CONTAINER_SIZE_10_FT
@ CARGO_CONTAINER_SIZE_10_FT
Definition: example_cargo.h:35
ACC_REG_ERROR_FLAG_WRITE_FAILED
#define ACC_REG_ERROR_FLAG_WRITE_FAILED
Definition: acc_reg_protocol.h:17
CARGO_CONTAINER_SIZE_40_FT
@ CARGO_CONTAINER_SIZE_40_FT
Definition: example_cargo.h:37
example_cargo.h
EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_TEMPERATURE_POS
#define EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_TEMPERATURE_POS
Definition: example_cargo_reg_protocol.h:98
EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_TEMPERATURE_MASK
#define EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_TEMPERATURE_MASK
Definition: example_cargo_reg_protocol.h:99
cargo_result_t::utilization_valid
bool utilization_valid
Definition: example_cargo.h:115
example_cargo_reg_read_presence_intra_detection_threshold
void example_cargo_reg_read_presence_intra_detection_threshold(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:265
cargo_result_t::presence_valid
bool presence_valid
Definition: example_cargo.h:131
EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_PACKET_LENGTH_ERROR_MASK
#define EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_PACKET_LENGTH_ERROR_MASK
Definition: example_cargo_reg_protocol.h:51
example_cargo_reg_read_version
void example_cargo_reg_read_version(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:34
result
cargo_result_t result
Definition: i2c_example_cargo.c:43
cargo_config_t::presence
struct cargo_config_t::@1 presence
example_cargo_reg_write_command
bool example_cargo_reg_write_command(const uint32_t value)
Definition: example_cargo_reg_protocol_access.c:82
example_cargo_reg_read_activate_presence
void example_cargo_reg_read_activate_presence(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:185
CARGO_CONTAINER_SIZE_20_FT
@ CARGO_CONTAINER_SIZE_20_FT
Definition: example_cargo.h:36
EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_PROTOCOL_STATE_ERROR_MASK
#define EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_PROTOCOL_STATE_ERROR_MASK
Definition: example_cargo_reg_protocol.h:49
i2c_example_cargo_copy_presence_burst_result_fields
void i2c_example_cargo_copy_presence_burst_result_fields(cargo_result_t *dst_result)
Copy presence example app cargo result.
Definition: i2c_example_cargo.c:289
example_cargo_reg_read_utilization_level_percent
void example_cargo_reg_read_utilization_level_percent(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:321
example_cargo_reg_read_presence_sweeps_per_frame
void example_cargo_reg_read_presence_sweeps_per_frame(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:217
i2c_example_cargo.h
acc_reg_protocol_uint32_milli_to_float
float acc_reg_protocol_uint32_milli_to_float(uint32_t value)
Convert uint32 / 1000 to float.
Definition: acc_reg_protocol.c:351
example_cargo_reg_write_presence_update_rate
bool example_cargo_reg_write_presence_update_rate(uint32_t value)
Definition: example_cargo_reg_protocol_access.c:208
cargo_config_t::activate_utilization_level
bool activate_utilization_level
Definition: example_cargo.h:49
cargo_result_t::intra_presence_score
float intra_presence_score
Definition: example_cargo.h:140
example_cargo_reg_read_presence_signal_quality
void example_cargo_reg_read_presence_signal_quality(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:233
example_cargo_reg_read_utilization_signal_quality
void example_cargo_reg_read_utilization_signal_quality(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:153
ACC_REG_ERROR_FLAG_PROTOCOL_STATE_ERROR
#define ACC_REG_ERROR_FLAG_PROTOCOL_STATE_ERROR
Definition: acc_reg_protocol.h:14
i2c_example_cargo_get_temperature
int16_t i2c_example_cargo_get_temperature(void)
Get most recently measured temperature.
Definition: i2c_example_cargo.c:303
example_cargo_reg_read_utilization_distance
void example_cargo_reg_read_utilization_distance(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:303
EXAMPLE_CARGO_REG_APPLICATION_ID_ENUM_EXAMPLE_CARGO
#define EXAMPLE_CARGO_REG_APPLICATION_ID_ENUM_EXAMPLE_CARGO
Definition: example_cargo_reg_protocol.h:118
ACC_REG_ERROR_FLAG_WRITE_TO_READ_ONLY
#define ACC_REG_ERROR_FLAG_WRITE_TO_READ_ONLY
Definition: acc_reg_protocol.h:18
example_cargo_reg_write_presence_inter_detection_threshold
bool example_cargo_reg_write_presence_inter_detection_threshold(uint32_t value)
Definition: example_cargo_reg_protocol_access.c:256
acc_reg_protocol.h
acc_integration_critical_section_enter
void acc_integration_critical_section_enter(void)
Definition: acc_integration_cortex.c:9
EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_UTILIZATION_LEVEL_VALID_POS
#define EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_UTILIZATION_LEVEL_VALID_POS
Definition: example_cargo_reg_protocol.h:100
cargo_config_t::container_size
cargo_container_size_t container_size
Definition: example_cargo.h:47
example_cargo_reg_read_container_size
void example_cargo_reg_read_container_size(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:92
example_cargo_reg_read_max_intra_presence_score
void example_cargo_reg_read_max_intra_presence_score(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:348
EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_ADDRESS_ERROR_MASK
#define EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_ADDRESS_ERROR_MASK
Definition: example_cargo_reg_protocol.h:53
cargo_result_t
Result type.
Definition: example_cargo.h:109
EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_WRITE_FAILED_MASK
#define EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_WRITE_FAILED_MASK
Definition: example_cargo_reg_protocol.h:55
cargo_result_t::presence_detected
bool presence_detected
Definition: example_cargo.h:134
example_cargo_reg_write_container_size
bool example_cargo_reg_write_container_size(uint32_t value)
Definition: example_cargo_reg_protocol_access.c:113
EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_WRITE_TO_READ_ONLY_MASK
#define EXAMPLE_CARGO_REG_PROTOCOL_STATUS_FIELD_WRITE_TO_READ_ONLY_MASK
Definition: example_cargo_reg_protocol.h:57
example_cargo_reg_read_measure_counter
void example_cargo_reg_read_measure_counter(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:72
EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_UTILIZATION_LEVEL_VALID_MASK
#define EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_UTILIZATION_LEVEL_VALID_MASK
Definition: example_cargo_reg_protocol.h:101
example_cargo_reg_write_activate_utilization_level
bool example_cargo_reg_write_activate_utilization_level(uint32_t value)
Definition: example_cargo_reg_protocol_access.c:144
cargo_config_t::inter_detection_threshold
float inter_detection_threshold
Definition: example_cargo.h:91
cargo_config_t::threshold_sensitivity
float threshold_sensitivity
Definition: example_cargo.h:65
example_cargo_reg_protocol.h
example_cargo_reg_write_utilization_signal_quality
bool example_cargo_reg_write_utilization_signal_quality(uint32_t value)
Definition: example_cargo_reg_protocol_access.c:160
example_cargo_reg_read_presence_update_rate
void example_cargo_reg_read_presence_update_rate(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:201
example_cargo_reg_read_application_id
void example_cargo_reg_read_application_id(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:29
cargo_config_t::activate_presence
bool activate_presence
Definition: example_cargo.h:68
example_cargo_reg_write_presence_sweeps_per_frame
bool example_cargo_reg_write_presence_sweeps_per_frame(uint32_t value)
Definition: example_cargo_reg_protocol_access.c:224
EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_PRESENCE_VALID_MASK
#define EXAMPLE_CARGO_REG_RESULT_HEADER_FIELD_PRESENCE_VALID_MASK
Definition: example_cargo_reg_protocol.h:103
example_cargo_reg_read_utilization_level_mm
void example_cargo_reg_read_utilization_level_mm(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:312
i2c_example_cargo_get_config
cargo_config_t * i2c_example_cargo_get_config(void)
Get pointer to internal cargo config struct.
Definition: i2c_example_cargo.c:214
example_cargo_reg_read_activate_utilization_level
void example_cargo_reg_read_activate_utilization_level(uint32_t *value)
Definition: example_cargo_reg_protocol_access.c:137