ref_app_touchless_button.c File Reference
#include <complex.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "acc_algorithm.h"
#include "acc_config.h"
#include "acc_definitions_common.h"
#include "acc_hal_definitions_a121.h"
#include "acc_hal_integration_a121.h"
#include "acc_integration.h"
#include "acc_integration_log.h"
#include "acc_processing.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_touchless_button_config_t
 Touchless button application config. More...
 
struct  acc_touchless_button_handle_t
 Touchless button application handle. More...
 
struct  acc_touchless_button_result_t
 Touchless button application result. More...
 

Macros

#define SENSOR_ID   (1U)
 
#define SENSOR_TIMEOUT_MS   (1000U)
 
#define DEFAULT_PRESET   ACC_TOUCHLESS_BUTTON_PRESET_CLOSE
 

Enumerations

enum  acc_touchless_button_measurement_type_t { ACC_TOUCHLESS_BUTTON_CLOSE_RANGE, ACC_TOUCHLESS_BUTTON_FAR_RANGE, ACC_TOUCHLESS_BUTTON_CLOSE_AND_FAR_RANGE }
 Application measurement type. More...
 
enum  acc_touchless_button_preset_t { ACC_TOUCHLESS_BUTTON_PRESET_NONE, ACC_TOUCHLESS_BUTTON_PRESET_CLOSE, ACC_TOUCHLESS_BUTTON_PRESET_FAR, ACC_TOUCHLESS_BUTTON_PRESET_CLOSE_AND_FAR }
 
enum  acc_touchless_button_range_result_t { ACC_TOUCHLESS_BUTTON_RANGE_NOT_USED, ACC_TOUCHLESS_BUTTON_RANGE_NO_DETECTION, ACC_TOUCHLESS_BUTTON_RANGE_DETECTION }
 Touchless button range result. More...
 

Functions

static void cleanup (acc_touchless_button_handle_t *handle)
 
static void set_config (acc_touchless_button_config_t *config, acc_touchless_button_preset_t preset)
 
static bool validate_config (acc_touchless_button_config_t *config)
 
static void config_log (acc_touchless_button_config_t *config)
 
static bool init_handle (acc_touchless_button_handle_t *handle)
 
static float get_threshold (float sensitivity)
 
static void reset_background (acc_touchless_button_handle_t *handle)
 
static bool init_sensor (acc_touchless_button_handle_t *handle)
 
static bool do_sensor_calibration_and_prepare (acc_touchless_button_handle_t *handle)
 
static bool measure (acc_touchless_button_handle_t *handle)
 
static bool check_count (uint16_t *count, uint16_t check_offset, uint16_t check_length)
 
static void update_background (acc_touchless_button_handle_t *handle)
 
static bool get_detection (bool current_detection, uint16_t sig_count, uint16_t non_sig_count, uint16_t patience)
 
static bool process (acc_touchless_button_handle_t *handle, acc_touchless_button_result_t *result)
 
static void print_result (acc_touchless_button_result_t *result)
 
int acconeer_main (int argc, char *argv[])
 Assembly test example. More...
 
static void calc_variance (acc_touchless_button_handle_t *handle)
 

Macro Definition Documentation

◆ DEFAULT_PRESET

#define DEFAULT_PRESET   ACC_TOUCHLESS_BUTTON_PRESET_CLOSE

Definition at line 103 of file ref_app_touchless_button.c.

◆ SENSOR_ID

#define SENSOR_ID   (1U)

Definition at line 26 of file ref_app_touchless_button.c.

◆ SENSOR_TIMEOUT_MS

#define SENSOR_TIMEOUT_MS   (1000U)

Definition at line 29 of file ref_app_touchless_button.c.

Enumeration Type Documentation

◆ acc_touchless_button_measurement_type_t

Application measurement type.

Enumerator
ACC_TOUCHLESS_BUTTON_CLOSE_RANGE 

Corresponds to a range of approximate 0 cm - 5 cm

ACC_TOUCHLESS_BUTTON_FAR_RANGE 

Corresponds to a range of approximate 0 cm - 24 cm

ACC_TOUCHLESS_BUTTON_CLOSE_AND_FAR_RANGE 

Gives two detection outputs, one for each range

Definition at line 34 of file ref_app_touchless_button.c.

◆ acc_touchless_button_preset_t

Enumerator
ACC_TOUCHLESS_BUTTON_PRESET_NONE 
ACC_TOUCHLESS_BUTTON_PRESET_CLOSE 
ACC_TOUCHLESS_BUTTON_PRESET_FAR 
ACC_TOUCHLESS_BUTTON_PRESET_CLOSE_AND_FAR 

Definition at line 95 of file ref_app_touchless_button.c.

◆ acc_touchless_button_range_result_t

Touchless button range result.

Enumerator
ACC_TOUCHLESS_BUTTON_RANGE_NOT_USED 
ACC_TOUCHLESS_BUTTON_RANGE_NO_DETECTION 
ACC_TOUCHLESS_BUTTON_RANGE_DETECTION 

Definition at line 149 of file ref_app_touchless_button.c.

Function Documentation

◆ acconeer_main()

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.

Returns
Returns EXIT_SUCCESS if successful, otherwise EXIT_FAILURE

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.

Vibration example configuration

Definition at line 197 of file ref_app_touchless_button.c.

◆ calc_variance()

static void calc_variance ( acc_touchless_button_handle_t handle)
static

Definition at line 731 of file ref_app_touchless_button.c.

◆ check_count()

static bool check_count ( uint16_t *  count,
uint16_t  check_offset,
uint16_t  check_length 
)
static

Definition at line 790 of file ref_app_touchless_button.c.

◆ cleanup()

static void cleanup ( acc_touchless_button_handle_t handle)
static

Definition at line 317 of file ref_app_touchless_button.c.

◆ config_log()

static void config_log ( acc_touchless_button_config_t config)
static

Definition at line 512 of file ref_app_touchless_button.c.

◆ do_sensor_calibration_and_prepare()

static bool do_sensor_calibration_and_prepare ( acc_touchless_button_handle_t handle)
static

Definition at line 666 of file ref_app_touchless_button.c.

◆ get_detection()

static bool get_detection ( bool  current_detection,
uint16_t  sig_count,
uint16_t  non_sig_count,
uint16_t  patience 
)
static

Definition at line 822 of file ref_app_touchless_button.c.

◆ get_threshold()

static float get_threshold ( float  sensitivity)
static

Definition at line 628 of file ref_app_touchless_button.c.

◆ init_handle()

static bool init_handle ( acc_touchless_button_handle_t handle)
static

Definition at line 560 of file ref_app_touchless_button.c.

◆ init_sensor()

static bool init_sensor ( acc_touchless_button_handle_t handle)
static

Definition at line 646 of file ref_app_touchless_button.c.

◆ measure()

static bool measure ( acc_touchless_button_handle_t handle)
static

Definition at line 703 of file ref_app_touchless_button.c.

◆ print_result()

static void print_result ( acc_touchless_button_result_t result)
static

Definition at line 955 of file ref_app_touchless_button.c.

◆ process()

static bool process ( acc_touchless_button_handle_t handle,
acc_touchless_button_result_t result 
)
static

Definition at line 830 of file ref_app_touchless_button.c.

◆ reset_background()

static void reset_background ( acc_touchless_button_handle_t handle)
static

Definition at line 633 of file ref_app_touchless_button.c.

◆ set_config()

static void set_config ( acc_touchless_button_config_t config,
acc_touchless_button_preset_t  preset 
)
static

Definition at line 393 of file ref_app_touchless_button.c.

◆ update_background()

static void update_background ( acc_touchless_button_handle_t handle)
static

Definition at line 805 of file ref_app_touchless_button.c.

◆ validate_config()

static bool validate_config ( acc_touchless_button_config_t config)
static

Definition at line 473 of file ref_app_touchless_button.c.