|
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "acc_definitions_a121.h"
#include "acc_detector_distance.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_sensor.h"
#include "acc_version.h"
Go to the source code of this file.
Data Structures | |
struct | acc_ref_app_tank_level_config_t |
struct | app_context_t |
struct | app_result_t |
Functions | |
static void | cleanup (app_context_t *context) |
static float | get_detector_start_m (acc_ref_app_tank_level_config_t *app_config) |
static float | get_detector_end_m (acc_ref_app_tank_level_config_t *app_config) |
static void | set_config (acc_ref_app_tank_level_config_t *app_config, tank_level_preset_config_t preset) |
static bool | initialize_application_resources (app_context_t *context) |
static bool | sensor_calibration (acc_sensor_t *sensor, acc_cal_result_t *cal_result, void *buffer, uint32_t buffer_size) |
static bool | full_detector_calibration (app_context_t *context, const acc_cal_result_t *sensor_cal_result) |
static bool | detector_recalibration (app_context_t *context, const acc_cal_result_t *sensor_cal_result) |
static bool | detector_get_next (app_context_t *context, const acc_cal_result_t *sensor_cal_result, acc_detector_distance_result_t *detector_result) |
static void | swap (float *array, uint16_t idx_a, uint16_t idx_b) |
static void | sort (float *array, uint16_t array_length) |
static float | median (float *array, uint16_t array_length) |
static float | nanmean (float *array, uint16_t array_length) |
static void | process_detector_result (const acc_detector_distance_result_t *distance_result, app_result_t *app_result, app_context_t *context) |
static void | print_result (const app_result_t *app_result, const acc_ref_app_tank_level_config_t *app_config) |
int | acconeer_main (int argc, char *argv[]) |
Assembly test example. More... | |
#define DEFAULT_PRESET_CONFIG TANK_LEVEL_PRESET_CONFIG_SMALL_TANK |
Definition at line 106 of file ref_app_tank_level.c.
#define DEFAULT_UPDATE_RATE 1.0f |
Definition at line 26 of file ref_app_tank_level.c.
#define LARGE_TANK_CLOSE_RANGE_LEAKAGE_CANCELLATION true |
Definition at line 68 of file ref_app_tank_level.c.
#define LARGE_TANK_MAX_PROFILE ACC_CONFIG_PROFILE_5 |
Definition at line 62 of file ref_app_tank_level.c.
#define LARGE_TANK_MAX_STEP_LENGTH 0U |
Definition at line 61 of file ref_app_tank_level.c.
#define LARGE_TANK_MEDIAN_FILTER_LENGTH 3U |
Definition at line 57 of file ref_app_tank_level.c.
#define LARGE_TANK_NUM_FRAMES_REC 50U |
Definition at line 63 of file ref_app_tank_level.c.
#define LARGE_TANK_NUM_MEDIANS_TO_AVERAGE 1U |
Definition at line 58 of file ref_app_tank_level.c.
#define LARGE_TANK_PEAK_SORTING ACC_DETECTOR_DISTANCE_PEAK_SORTING_STRONGEST |
Definition at line 64 of file ref_app_tank_level.c.
#define LARGE_TANK_RANGE_END_M 10.0f |
Definition at line 60 of file ref_app_tank_level.c.
#define LARGE_TANK_RANGE_START_M 0.1f |
Definition at line 59 of file ref_app_tank_level.c.
#define LARGE_TANK_REFLECTOR_SHAPE ACC_DETECTOR_DISTANCE_REFLECTOR_SHAPE_PLANAR |
Definition at line 65 of file ref_app_tank_level.c.
#define LARGE_TANK_SIGNAL_QUALITY 20.0f |
Definition at line 67 of file ref_app_tank_level.c.
#define LARGE_TANK_THRESHOLD_SENSITIVITY 0.0f |
Definition at line 66 of file ref_app_tank_level.c.
#define MEDIUM_TANK_CLOSE_RANGE_LEAKAGE_CANCELLATION true |
Definition at line 54 of file ref_app_tank_level.c.
#define MEDIUM_TANK_MAX_PROFILE ACC_CONFIG_PROFILE_3 |
Definition at line 48 of file ref_app_tank_level.c.
#define MEDIUM_TANK_MAX_STEP_LENGTH 0U |
Definition at line 47 of file ref_app_tank_level.c.
#define MEDIUM_TANK_MEDIAN_FILTER_LENGTH 3U |
Definition at line 43 of file ref_app_tank_level.c.
#define MEDIUM_TANK_NUM_FRAMES_REC 50U |
Definition at line 49 of file ref_app_tank_level.c.
#define MEDIUM_TANK_NUM_MEDIANS_TO_AVERAGE 3U |
Definition at line 44 of file ref_app_tank_level.c.
#define MEDIUM_TANK_PEAK_SORTING ACC_DETECTOR_DISTANCE_PEAK_SORTING_STRONGEST |
Definition at line 50 of file ref_app_tank_level.c.
#define MEDIUM_TANK_RANGE_END_M 6.0f |
Definition at line 46 of file ref_app_tank_level.c.
#define MEDIUM_TANK_RANGE_START_M 0.05f |
Definition at line 45 of file ref_app_tank_level.c.
#define MEDIUM_TANK_REFLECTOR_SHAPE ACC_DETECTOR_DISTANCE_REFLECTOR_SHAPE_PLANAR |
Definition at line 51 of file ref_app_tank_level.c.
#define MEDIUM_TANK_SIGNAL_QUALITY 20.0f |
Definition at line 53 of file ref_app_tank_level.c.
#define MEDIUM_TANK_THRESHOLD_SENSITIVITY 0.0f |
Definition at line 52 of file ref_app_tank_level.c.
#define SENSOR_ID 1U |
Definition at line 24 of file ref_app_tank_level.c.
#define SENSOR_TIMEOUT_MS 1000U |
Definition at line 25 of file ref_app_tank_level.c.
#define SMALL_TANK_CLOSE_RANGE_LEAKAGE_CANCELLATION true |
Definition at line 40 of file ref_app_tank_level.c.
#define SMALL_TANK_MAX_PROFILE ACC_CONFIG_PROFILE_2 |
Definition at line 34 of file ref_app_tank_level.c.
#define SMALL_TANK_MAX_STEP_LENGTH 2U |
Definition at line 33 of file ref_app_tank_level.c.
#define SMALL_TANK_MEDIAN_FILTER_LENGTH 5U |
Definition at line 29 of file ref_app_tank_level.c.
#define SMALL_TANK_NUM_FRAMES_REC 50U |
Definition at line 35 of file ref_app_tank_level.c.
#define SMALL_TANK_NUM_MEDIANS_TO_AVERAGE 5U |
Definition at line 30 of file ref_app_tank_level.c.
#define SMALL_TANK_PEAK_SORTING ACC_DETECTOR_DISTANCE_PEAK_SORTING_CLOSEST |
Definition at line 36 of file ref_app_tank_level.c.
#define SMALL_TANK_RANGE_END_M 0.5f |
Definition at line 32 of file ref_app_tank_level.c.
#define SMALL_TANK_RANGE_START_M 0.03f |
Definition at line 31 of file ref_app_tank_level.c.
#define SMALL_TANK_REFLECTOR_SHAPE ACC_DETECTOR_DISTANCE_REFLECTOR_SHAPE_PLANAR |
Definition at line 37 of file ref_app_tank_level.c.
#define SMALL_TANK_SIGNAL_QUALITY 20.0f |
Definition at line 39 of file ref_app_tank_level.c.
#define SMALL_TANK_THRESHOLD_SENSITIVITY 0.0f |
Definition at line 38 of file ref_app_tank_level.c.
enum peak_status_t |
Enumerator | |
---|---|
PEAK_STATUS_IN_RANGE | |
PEAK_STATUS_NO_DETECTION | |
PEAK_STATUS_OVERFLOW | |
PEAK_STATUS_OUT_OF_RANGE |
Definition at line 137 of file ref_app_tank_level.c.
Enumerator | |
---|---|
TANK_LEVEL_PRESET_CONFIG_NONE | |
TANK_LEVEL_PRESET_CONFIG_SMALL_TANK | |
TANK_LEVEL_PRESET_CONFIG_MEDIUM_TANK | |
TANK_LEVEL_PRESET_CONFIG_LARGE_TANK |
Definition at line 98 of file ref_app_tank_level.c.
int acconeer_main | ( | int | argc, |
char * | argv[] | ||
) |
Assembly test example.
Surface velocity example application.
Tank level reference application.
Smart presence reference application.
Breathing example application.
Service subsweeps example.
Service multple configurations example.
Low power service 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.
Detector presence example with multiple configurations.
Low power detector presence example.
Detector presence example.
Distance detector low power example.
Detector distance example.
Control helper example.
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)
Detector filters and states are reset on prepare (reconfiguration) to avoid risk of false detections when switching back to a zone.
Detector filters and states are reset on prepare (reconfiguration) to avoid risk of false detections when switching back to a zone.
Definition at line 210 of file ref_app_tank_level.c.
|
static |
Definition at line 334 of file ref_app_tank_level.c.
|
static |
Definition at line 575 of file ref_app_tank_level.c.
|
static |
Definition at line 553 of file ref_app_tank_level.c.
|
static |
Definition at line 531 of file ref_app_tank_level.c.
|
static |
Definition at line 361 of file ref_app_tank_level.c.
|
static |
Definition at line 354 of file ref_app_tank_level.c.
|
static |
Definition at line 432 of file ref_app_tank_level.c.
|
static |
Definition at line 645 of file ref_app_tank_level.c.
|
static |
Definition at line 679 of file ref_app_tank_level.c.
|
static |
Definition at line 775 of file ref_app_tank_level.c.
|
static |
Definition at line 697 of file ref_app_tank_level.c.
|
static |
Definition at line 488 of file ref_app_tank_level.c.
|
static |
Definition at line 368 of file ref_app_tank_level.c.
|
static |
Definition at line 630 of file ref_app_tank_level.c.
|
static |
Definition at line 621 of file ref_app_tank_level.c.