|
|
#include <complex.h>#include <stdarg.h>#include <stdbool.h>#include <stdint.h>#include <stdio.h>#include <string.h>#include "acc_definitions_a121.h"#include "acc_hal_definitions_a121.h"#include "acc_hal_integration_a121.h"#include "acc_integration.h"#include "acc_integration_log.h"#include "acc_rss_a121.h"#include "acc_version.h"#include "example_cargo.h"#include "acc_reg_protocol.h"#include "example_cargo_reg_protocol.h"#include "i2c_application_system.h"#include "i2c_example_cargo.h"Go to the source code of this file.
Macros | |
| #define | SENSOR_ID (1U) |
| #define | SENSOR_TIMEOUT_MS (10000U) |
| #define | UART_LOG_BUFFER_SIZE 100 |
Functions | |
| static uint32_t | get_command (void) |
| Get the i2c_detector_command values. More... | |
| static void | application_status_set_bits (uint32_t bit_mask) |
| Set bits in the i2c_application_status. More... | |
| static void | application_status_clr_bits (uint32_t bit_mask) |
| Clear bits in the i2c_application_status. More... | |
| static bool | application_status_test_bits (uint32_t bit_mask) |
| Test bits in the i2c_application_status. More... | |
| static void | create_sensor (void) |
| Create sensor. More... | |
| static bool | calibrate_sensor (void) |
| Calibrate sensor. More... | |
| static bool | do_cargo_calibration (bool full_calibration) |
| Performs cargo calibration. More... | |
| static bool | enter_hibernation (void) |
| Enter sensor hibernation state. More... | |
| static bool | exit_hibernation (void) |
| Exit sensor hibernation state. More... | |
| static bool | validate_application_config_for_i2c (void) |
| Validate Cargo config for this I2C application. More... | |
| static void | apply_application_config (void) |
| Apply config. More... | |
| static bool | utilization_get_next (void) |
| Get next utilization level measurement. More... | |
| static bool | presence_get_next (void) |
| Get next presence measurement. More... | |
| static void | presence_reset_burst_result (void) |
| Reset presence burst result. More... | |
| static void | presence_update_burst_result (const cargo_result_t *cargo_result) |
| Update presence brust result. More... | |
| static void | increment_measure_counter (void) |
| Increment measure counter by one. More... | |
| static void | update_presence_update_rate_estimate (void) |
| Update presence frame estimation. More... | |
| static void | update_most_recent_temperature (int16_t temperature) |
| Set most recent temperature to the passed temperature. More... | |
| static void | module_low_power (void) |
| Try to set module in low power mode. More... | |
| static void | log_cargo_result_on_uart (const cargo_result_t *result) |
| Print the application result. More... | |
| static void | uart_log (const char *format,...) |
| UART logging function (can be enabled/disabled by command) More... | |
| cargo_config_t * | i2c_example_cargo_get_config (void) |
| Get pointer to internal cargo config struct. More... | |
| bool | i2c_example_cargo_command (uint32_t command) |
| Send command to be executed to cargo i2c app. More... | |
| uint32_t | i2c_example_cargo_get_status (void) |
| Get cargo example app status. More... | |
| uint32_t | i2c_example_cargo_get_measure_counter (void) |
| Get the count of number of measurements performed. More... | |
| uint32_t | i2c_example_cargo_get_actual_presence_update_rate (void) |
| Get the estimated presence update rate of the. More... | |
| void | i2c_example_cargo_copy_utilization_result_fields (cargo_result_t *dst_result) |
| Copy utilization example app cargo result. More... | |
| void | i2c_example_cargo_copy_presence_burst_result_fields (cargo_result_t *dst_result) |
| Copy presence example app cargo result. More... | |
| int16_t | i2c_example_cargo_get_temperature (void) |
| Get most recently measured temperature. More... | |
| int | acconeer_main (int argc, char *argv[]) |
| Assembly test example. More... | |
Variables | |
| struct { | |
| acc_sensor_t * sensor | |
| cargo_config_t config | |
| cargo_handle_t * handle | |
| acc_cal_result_t sensor_cal_result | |
| acc_detector_cal_result_dynamic_t distance_cal_result_dynamic | |
| uint8_t * distance_cal_result_static | |
| uint32_t distance_cal_result_static_size | |
| void * buffer | |
| uint32_t buffer_size | |
| cargo_result_t result | |
| int16_t most_recent_temperature | |
| bool utilization_result_available | |
| } | g_resources |
| struct { | |
| uint32_t i2c_application_command | |
| uint32_t i2c_application_status | |
| uint32_t measure_counter | |
| uint32_t presence_last_tick_ms | |
| uint32_t presence_estimated_frame_rate_mhz | |
| bool uart_logs_enabed | |
| } | g_application_state |
| struct { | |
| bool presence_valid | |
| bool presence_detected | |
| float max_inter_presence_score | |
| float max_intra_presence_score | |
| } | g_presence_burst_result |
| #define SENSOR_ID (1U) |
Definition at line 28 of file i2c_example_cargo.c.
| #define SENSOR_TIMEOUT_MS (10000U) |
Definition at line 29 of file i2c_example_cargo.c.
| #define UART_LOG_BUFFER_SIZE 100 |
Definition at line 68 of file i2c_example_cargo.c.
| int acconeer_main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Assembly test example.
Touchless button application.
Tank level reference application.
Smart presence reference application.
Parking application.
Breathing example application.
Waste level application.
Vibration example.
Surface velocity example application.
Service subsweeps example.
Service multple configurations example.
Low power service example.
Service sensor calibration caching example.
Service example.
Processing subtract adaptive background example.
Processing static presence example.
Processing peak interpolation example.
Processing noncoherent mean example.
Processing coherent mean example.
Processing amplitude example.
hand motion application
Detector presence example with multiple configurations.
Low power detector presence example.
Detector presence example.
Detector distance example with iq data print.
Distance detector low power example.
Detector distance with calibration caching example.
Detector distance example.
Control helper example.
Cargo application.
Test if measure on wake up is enable Do a measurement if the the detector is ready (configured and calibrated)
Test if measure on wake up is enable Do a measurement if the the detector is ready (configured and calibrated)
Definition at line 320 of file i2c_example_cargo.c.
|
static |
Clear bits in the i2c_application_status.
The i2c_application_status is protected by a critical section
| [in] | bit_mask | The bit_mask to clear |
Definition at line 547 of file i2c_example_cargo.c.
|
static |
Set bits in the i2c_application_status.
The i2c_application_status is protected by a critical section
| [in] | bit_mask | The bit_mask to set |
Definition at line 534 of file i2c_example_cargo.c.
|
static |
Test bits in the i2c_application_status.
The i2c_application_status is protected by a critical section
| [in] | bit_mask | The bit_mask to test |
Definition at line 560 of file i2c_example_cargo.c.
|
static |
Apply config.
This function will create the distance- & presence detector and allocate the needed memory
Definition at line 713 of file i2c_example_cargo.c.
|
static |
|
static |
Create sensor.
Definition at line 572 of file i2c_example_cargo.c.
|
static |
Performs cargo calibration.
Definition at line 633 of file i2c_example_cargo.c.
|
static |
Enter sensor hibernation state.
exit_hibernate needs to be called before the sensor can measure again.
Definition at line 685 of file i2c_example_cargo.c.
|
static |
Exit sensor hibernation state.
Definition at line 699 of file i2c_example_cargo.c.
|
static |
Get the i2c_detector_command values.
The i2c_application_command is cleared during this read The read and clear are protected by a critical section
Definition at line 520 of file i2c_example_cargo.c.
| bool i2c_example_cargo_command | ( | uint32_t | command | ) |
Send command to be executed to cargo i2c app.
| [in] | command | The command to be executed |
Definition at line 219 of file i2c_example_cargo.c.
| void i2c_example_cargo_copy_presence_burst_result_fields | ( | cargo_result_t * | dst_result | ) |
Copy presence example app cargo result.
Definition at line 289 of file i2c_example_cargo.c.
| void i2c_example_cargo_copy_utilization_result_fields | ( | cargo_result_t * | dst_result | ) |
Copy utilization example app cargo result.
Definition at line 275 of file i2c_example_cargo.c.
| uint32_t i2c_example_cargo_get_actual_presence_update_rate | ( | void | ) |
Get the estimated presence update rate of the.
The application measures time between presence updates with ms accuraccy.
Definition at line 264 of file i2c_example_cargo.c.
| cargo_config_t* i2c_example_cargo_get_config | ( | void | ) |
Get pointer to internal cargo config struct.
Definition at line 214 of file i2c_example_cargo.c.
| uint32_t i2c_example_cargo_get_measure_counter | ( | void | ) |
Get the count of number of measurements performed.
The counter will be increased every time the Cargo example app completes a measurement
Definition at line 253 of file i2c_example_cargo.c.
| uint32_t i2c_example_cargo_get_status | ( | void | ) |
Get cargo example app status.
Definition at line 241 of file i2c_example_cargo.c.
| int16_t i2c_example_cargo_get_temperature | ( | void | ) |
Get most recently measured temperature.
Definition at line 303 of file i2c_example_cargo.c.
|
static |
Increment measure counter by one.
Definition at line 1033 of file i2c_example_cargo.c.
|
static |
Print the application result.
Only available when the UART logs have been enabled with ENABLE_UART_LOGS
| [in] | result | The cargo result |
Definition at line 1089 of file i2c_example_cargo.c.
|
static |
Try to set module in low power mode.
Definition at line 1066 of file i2c_example_cargo.c.
|
static |
Get next presence measurement.
Definition at line 923 of file i2c_example_cargo.c.
|
static |
Reset presence burst result.
Definition at line 994 of file i2c_example_cargo.c.
|
static |
Update presence brust result.
Definition at line 1006 of file i2c_example_cargo.c.
|
static |
UART logging function (can be enabled/disabled by command)
Definition at line 1115 of file i2c_example_cargo.c.
|
static |
Set most recent temperature to the passed temperature.
Definition at line 1057 of file i2c_example_cargo.c.
|
static |
Update presence frame estimation.
Definition at line 1045 of file i2c_example_cargo.c.
|
static |
Get next utilization level measurement.
Definition at line 830 of file i2c_example_cargo.c.
|
static |
Validate Cargo config for this I2C application.
Definition at line 819 of file i2c_example_cargo.c.
| void* buffer |
Definition at line 40 of file i2c_example_cargo.c.
| uint32_t buffer_size |
Definition at line 41 of file i2c_example_cargo.c.
| cargo_config_t config |
Definition at line 34 of file i2c_example_cargo.c.
| acc_detector_cal_result_dynamic_t distance_cal_result_dynamic |
Definition at line 37 of file i2c_example_cargo.c.
| uint8_t* distance_cal_result_static |
Definition at line 38 of file i2c_example_cargo.c.
| uint32_t distance_cal_result_static_size |
Definition at line 39 of file i2c_example_cargo.c.
| struct { ... } g_application_state |
| struct { ... } g_presence_burst_result |
| struct { ... } g_resources |
| cargo_handle_t* handle |
Definition at line 35 of file i2c_example_cargo.c.
| uint32_t i2c_application_command |
Definition at line 50 of file i2c_example_cargo.c.
| uint32_t i2c_application_status |
Definition at line 51 of file i2c_example_cargo.c.
| float max_inter_presence_score |
Definition at line 64 of file i2c_example_cargo.c.
| float max_intra_presence_score |
Definition at line 65 of file i2c_example_cargo.c.
| uint32_t measure_counter |
Definition at line 52 of file i2c_example_cargo.c.
| int16_t most_recent_temperature |
Definition at line 44 of file i2c_example_cargo.c.
| bool presence_detected |
Definition at line 63 of file i2c_example_cargo.c.
| uint32_t presence_estimated_frame_rate_mhz |
Definition at line 55 of file i2c_example_cargo.c.
| uint32_t presence_last_tick_ms |
Definition at line 54 of file i2c_example_cargo.c.
| bool presence_valid |
Definition at line 62 of file i2c_example_cargo.c.
| cargo_result_t result |
Definition at line 43 of file i2c_example_cargo.c.
| acc_sensor_t* sensor |
Definition at line 33 of file i2c_example_cargo.c.
| acc_cal_result_t sensor_cal_result |
Definition at line 36 of file i2c_example_cargo.c.
| bool uart_logs_enabed |
Definition at line 57 of file i2c_example_cargo.c.
| bool utilization_result_available |
Definition at line 45 of file i2c_example_cargo.c.