|
|
#include <stdbool.h>#include <stdint.h>#include "acc_config.h"#include "acc_detector_distance.h"#include "acc_detector_presence.h"#include "acc_processing.h"#include "acc_sensor.h"Go to the source code of this file.
Data Structures | |
| struct | cargo_config_t |
| Configuration struct for cargo. More... | |
| struct | cargo_result_t |
| Result type. More... | |
Typedefs | |
| typedef struct cargo_handle | cargo_handle_t |
Enumerations | |
| enum | cargo_preset_t { CARGO_PRESET_CONTAINER_10_FEET, CARGO_PRESET_CONTAINER_20_FEET, CARGO_PRESET_CONTAINER_40_FEET, CARGO_PRESET_NO_LENS } |
| Cargo Example App Presets. More... | |
| enum | cargo_container_size_t { CARGO_CONTAINER_SIZE_10_FT, CARGO_CONTAINER_SIZE_20_FT, CARGO_CONTAINER_SIZE_40_FT } |
| Container size. More... | |
| enum | cargo_mode_t { CARGO_MODE_NONE = 0, CARGO_MODE_UTILIZATION, CARGO_MODE_PRESENCE } |
| Cargo mode enumeration. More... | |
| typedef struct cargo_handle cargo_handle_t |
Definition at line 148 of file example_cargo.h.
Container size.
| Enumerator | |
|---|---|
| CARGO_CONTAINER_SIZE_10_FT | |
| CARGO_CONTAINER_SIZE_20_FT | |
| CARGO_CONTAINER_SIZE_40_FT | |
Definition at line 33 of file example_cargo.h.
| enum cargo_mode_t |
Cargo mode enumeration.
| Enumerator | |
|---|---|
| CARGO_MODE_NONE | |
| CARGO_MODE_UTILIZATION | |
| CARGO_MODE_PRESENCE | |
Definition at line 153 of file example_cargo.h.
| enum cargo_preset_t |
Cargo Example App Presets.
| Enumerator | |
|---|---|
| CARGO_PRESET_CONTAINER_10_FEET | |
| CARGO_PRESET_CONTAINER_20_FEET | |
| CARGO_PRESET_CONTAINER_40_FEET | |
| CARGO_PRESET_NO_LENS | |
Definition at line 22 of file example_cargo.h.
| bool cargo_calibrate | ( | cargo_handle_t * | handle, |
| acc_sensor_t * | sensor, | ||
| const acc_cal_result_t * | sensor_cal_result, | ||
| void * | buffer, | ||
| uint32_t | buffer_size, | ||
| uint8_t * | distance_cal_result_static, | ||
| uint32_t | distance_cal_result_static_size, | ||
| acc_detector_cal_result_dynamic_t * | distance_cal_result_dynamic, | ||
| bool * | calibration_complete | ||
| ) |
Calibrate Cargo.
Calibrating Cargo's internal Detector is needed to ensure reliable Detector results.
See the calibration sections in the Distance Detector User Guide for more information.
| [in] | sensor | The sensor instance to use for calibration |
| [in] | handle | The Cargo handle |
| [in] | sensor_cal_result | Sensor calibration result |
| [in] | buffer | Working memory buffer needed by function |
| [in] | buffer_size | The size of buffer. Needs to be at least the result of cargo_get_buffer_size |
| [out] | distance_cal_result_static | Static result of calibration |
| [in] | distance_cal_result_static_size | The size of distance_cal_result_static. Needs to be at least the result of cargo_get_distance_cal_result_static_size |
| [out] | distance_cal_result_dynamic | Dynamic result of calibration |
| [out] | calibration_complete | Will be set to true when the calibration is complete. If false; at least one more call to this function is needed. Note that it's necessary to wait for interrupt between calls. |
Definition at line 318 of file example_cargo.c.
| void cargo_config_initialize | ( | cargo_config_t * | cargo_config, |
| cargo_preset_t | preset | ||
| ) |
Initialize cargo config struct with a preset.
| [out] | cargo_config | The cargo config to initialize |
| [in] | preset | A cargo_preset_t to initialize the config to |
Definition at line 80 of file example_cargo.c.
| void cargo_config_log | ( | const cargo_config_t * | cargo_config | ) |
Log cargo config to debug uart.
| [in] | cargo_config | The cargo config to log |
Definition at line 135 of file example_cargo.c.
| cargo_mode_t cargo_current_mode_get | ( | const cargo_handle_t * | handle | ) |
Get current mode of the cargo handle.
Really only useful when doing both Presence- & Utilization level measurements.
| [in] | handle | The cargo handle |
Definition at line 622 of file example_cargo.c.
| bool cargo_get_buffer_size | ( | const cargo_handle_t * | handle, |
| uint32_t * | buffer_size | ||
| ) |
Get the required buffer sensor data buffer size.
| [in] | handle | The cargo handle |
| [out] | buffer_size | The required buffer size |
Definition at line 272 of file example_cargo.c.
| bool cargo_get_distance_cal_result_static_size | ( | const cargo_handle_t * | handle, |
| uint32_t * | distance_cal_result_static_size | ||
| ) |
Get the required buffer for static distance detector calibration.
| [in] | handle | The cargo handle |
| [out] | distance_cal_result_static_size | The required buffer size. Will be 0U if activate_utilization_level is false. |
Definition at line 298 of file example_cargo.c.
| cargo_handle_t* cargo_handle_create | ( | const cargo_config_t * | cargo_config | ) |
Create a cargo handle.
| [in] | cargo_config | Cargo configuration |
Definition at line 164 of file example_cargo.c.
| void cargo_handle_destroy | ( | cargo_handle_t * | handle | ) |
Destroy a cargo handle.
| [in] | handle | The cargo handle to destroy |
Definition at line 240 of file example_cargo.c.
| bool cargo_prepare_presence | ( | cargo_handle_t * | handle, |
| acc_sensor_t * | sensor, | ||
| const acc_cal_result_t * | sensor_cal_result, | ||
| void * | buffer, | ||
| uint32_t | buffer_size | ||
| ) |
Prepare Cargo presence for measurements.
| [in,out] | handle | The Cargo handle |
| [in] | sensor | The sensor instance |
| [in] | sensor_cal_result | The sensor calibration result |
| [in] | buffer | Memory used by the detector. Should be at least buffer_size bytes |
| [in] | buffer_size | The buffer size received by acc_detector_distance_get_sizes |
Definition at line 423 of file example_cargo.c.
| bool cargo_prepare_utilization | ( | cargo_handle_t * | handle, |
| acc_sensor_t * | sensor, | ||
| const acc_cal_result_t * | sensor_cal_result, | ||
| void * | buffer, | ||
| uint32_t | buffer_size | ||
| ) |
Prepare Cargo utilization for measurements.
| [in,out] | handle | The Cargo handle |
| [in] | sensor | The sensor instance |
| [in] | sensor_cal_result | The sensor calibration result |
| [in] | buffer | Memory used by the detector. Should be at least buffer_size bytes |
| [in] | buffer_size | The buffer size received by acc_detector_distance_get_sizes |
Definition at line 384 of file example_cargo.c.
| bool cargo_presence_metadata_get | ( | cargo_handle_t * | handle, |
| acc_detector_presence_metadata_t * | presence_metadata | ||
| ) |
Get presence detector metadata.
| [in] | handle | The cargo handle |
| [out] | presence_metadata | The Presence Detector metadata |
Definition at line 634 of file example_cargo.c.
| bool cargo_process_presence | ( | cargo_handle_t * | handle, |
| void * | buffer, | ||
| cargo_result_t * | cargo_result, | ||
| acc_detector_presence_result_t * | nullable_presence_result | ||
| ) |
Process Sparse IQ data into a Cargo result.
| [in] | handle | The Cargo handle |
| [in] | buffer | A reference to the buffer (populated by acc_sensor_read) containing the data to be processed. |
| [out] | cargo_result | Cargo result |
| [out] | nullable_presence_result | Pointer to auxilliary acc_detector_presence_result_t Can be NULL. |
Definition at line 558 of file example_cargo.c.
| bool cargo_process_utilization | ( | cargo_handle_t * | handle, |
| uint8_t * | distance_cal_result_static, | ||
| acc_detector_cal_result_dynamic_t * | distance_cal_result_dynamic, | ||
| void * | buffer, | ||
| cargo_result_t * | cargo_result, | ||
| bool * | result_available, | ||
| acc_detector_distance_result_t * | nullable_distance_result | ||
| ) |
Process Sparse IQ data into a Cargo result.
| [in] | handle | The Cargo handle |
| [in] | distance_cal_result_static | The result from cargo_calibrate |
| [in] | distance_cal_result_dynamic | The result from cargo_calibrate |
| [in] | buffer | A reference to the buffer (populated by acc_sensor_read) containing the data to be processed. |
| [out] | cargo_result | Cargo result |
| [out] | result_available | True if the cargo_result is valid |
| [out] | nullable_distance_result | Pointer to auxilliary acc_detector_distance_result_t Can be NULL. |
Definition at line 462 of file example_cargo.c.
| bool cargo_update_calibration | ( | cargo_handle_t * | handle, |
| acc_sensor_t * | sensor, | ||
| const acc_cal_result_t * | sensor_cal_result, | ||
| void * | buffer, | ||
| uint32_t | buffer_size, | ||
| acc_detector_cal_result_dynamic_t * | distance_cal_result_dynamic, | ||
| bool * | calibration_complete | ||
| ) |
Update Cargo calibration.
Updates Cargo's internal calibration.
If calibration_needed has been set to true, you should do the following:
| [in] | sensor | The sensor instance to use for calibration |
| [in] | handle | The Cargo handle |
| [in] | sensor_cal_result | Sensor calibration result |
| [in] | buffer | Working memory buffer needed by function |
| [in] | buffer_size | The size of buffer. Needs to be at least the result of cargo_get_buffer_size |
| [out] | distance_cal_result_dynamic | Dynamic result of calibration |
| [out] | calibration_complete | Will be set to true when the calibration is complete. If false; at least one more call to this function is needed. Note that it's necessary to wait for interrupt between calls. |
Definition at line 353 of file example_cargo.c.