Macros | Functions | Variables
example_service_calibration_caching.c File Reference
`#include <stdbool.h>`
`#include <stdint.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include "acc_config.h"`
`#include "acc_definitions_a121.h"`
`#include "acc_definitions_common.h"`
`#include "acc_hal_definitions_a121.h"`
`#include "acc_hal_integration_a121.h"`
`#include "acc_integration.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.

## Macros
#define | SENSOR_ID (1U)
#define | SENSOR_TIMEOUT_MS (1000U)
#define | MAX_DATA_ENTRY_LEN (15U)
#define | MAX_CAL_TEMP_DIFF (16)
#define | MAX_TEMP_VARIATION (125)
#define | MAX_CACHE_COUNT ((MAX_TEMP_VARIATION / MAX_CAL_TEMP_DIFF) + 1)

## Functions
static void | set_config (acc_config_t *config)
static bool | find_cache_index (int16_t temp, uint16_t *cache_index)
static bool | get_next_empty_cache_index (uint16_t *cache_index)
static bool | add_cache (uint16_t cache_index, int16_t temp)
static bool | calibration_caching_and_prepare (acc_sensor_t *sensor, acc_config_t *config, void *buffer, uint32_t buffer_size, bool temp_known, int16_t temp)
static void | cleanup (acc_config_t *config, acc_processing_t *processing, acc_sensor_t *sensor, void *buffer)
int | acconeer_main (int argc, char *argv[])
| Assembly test example. More...

## Variables
static acc_cal_result_t | cal_results [(((125)/(16))+1)]
static int16_t | cal_temps [(((125)/(16))+1)]
static uint16_t | curr_cache_count = 0

## Macro Definition Documentation

## ◆ MAX_CACHE_COUNT

#define MAX_CACHE_COUNT ((MAX_TEMP_VARIATION / MAX_CAL_TEMP_DIFF) + 1)

Examples
  example_service_calibration_caching.c.

Definition at line 66 of file example_service_calibration_caching.c.

## ◆ MAX_CAL_TEMP_DIFF

#define MAX_CAL_TEMP_DIFF (16)

A sensor calibration is valid at the temperature it was done +- 15 degrees

If the temperature isn't controlled during caching, which is the case in this example, the maximum amount of caches needs to be calculated from a temperature difference of 16.

For example

- A calibration is done at 25 degrees, which means it is valid between 10 and 40 degrees
- The temperature changes to 41 degrees
- A new calibration needs to be done at 41 degrees since it is above the valid range for the previous calibration
- The new calibration is then valid between 26 and 56 degrees

However, if the temperature is controlled, for example in a factory, the maximum amount of caches can be calculated from a temperature difference of 30.

For example

- A calibration is done at 25 degrees, which means it is valid between 10 and 40 degrees
- The temperature is manually changed to 55 degrees
- A new calibration can be done which is valid between 40 and 70 degrees

The maximum temperature variation that the application will operate in is assumed to be -40 to 85 degrees in this example.

Examples
  example_service_calibration_caching.c.

Definition at line 64 of file example_service_calibration_caching.c.

## ◆ MAX_DATA_ENTRY_LEN

#define MAX_DATA_ENTRY_LEN (15U)

Definition at line 39 of file example_service_calibration_caching.c.

## ◆ MAX_TEMP_VARIATION

#define MAX_TEMP_VARIATION (125)

Definition at line 65 of file example_service_calibration_caching.c.

## ◆ SENSOR_ID

#define SENSOR_ID (1U)

Examples
  example_service_calibration_caching.c.

Definition at line 37 of file example_service_calibration_caching.c.

## ◆ SENSOR_TIMEOUT_MS

#define SENSOR_TIMEOUT_MS (1000U)

Examples
  example_service_calibration_caching.c.

Definition at line 38 of file example_service_calibration_caching.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.

Examples
  example_service_calibration_caching.c.

Definition at line 92 of file example_service_calibration_caching.c.

## ◆ add_cache()

static bool add_cache | ( | uint16_t | cache_index,
|  | int16_t | temp
| ) |  |
| static

Examples
  example_service_calibration_caching.c.

Definition at line 261 of file example_service_calibration_caching.c.

## ◆ calibration_caching_and_prepare()

static bool calibration_caching_and_prepare | ( | acc_sensor_t * | sensor,
|  | acc_config_t * | config,
|  | void * | buffer,
|  | uint32_t | buffer_size,
|  | bool | temp_known,
|  | int16_t | temp
| ) |  |
| static

Examples
  example_service_calibration_caching.c.

Definition at line 275 of file example_service_calibration_caching.c.

## ◆ cleanup()

static void cleanup | ( | acc_config_t * | config,
|  | acc_processing_t * | processing,
|  | acc_sensor_t * | sensor,
|  | void * | buffer
| ) |  |
| static

Examples
  example_service_calibration_caching.c.

Definition at line 353 of file example_service_calibration_caching.c.

## ◆ find_cache_index()

static bool find_cache_index | ( | int16_t | temp,
|  | uint16_t * | cache_index
| ) |  |
| static

Examples
  example_service_calibration_caching.c.

Definition at line 232 of file example_service_calibration_caching.c.

## ◆ get_next_empty_cache_index()

static bool get_next_empty_cache_index | ( | uint16_t * | cache_index | ) |
| static

Examples
  example_service_calibration_caching.c.

Definition at line 254 of file example_service_calibration_caching.c.

## ◆ set_config()

static void set_config | ( | acc_config_t * | config | ) |
| static

Examples
  example_service_calibration_caching.c.

Definition at line 224 of file example_service_calibration_caching.c.

## Variable Documentation

## ◆ cal_results

acc_cal_result_t cal_results[(((125)/(16))+1)]
| static

Examples
  example_service_calibration_caching.c.

Definition at line 69 of file example_service_calibration_caching.c.

## ◆ cal_temps

int16_t cal_temps[(((125)/(16))+1)]
| static

Examples
  example_service_calibration_caching.c.

Definition at line 70 of file example_service_calibration_caching.c.

## ◆ curr_cache_count

uint16_t curr_cache_count = 0
| static

Examples
  example_service_calibration_caching.c.

Definition at line 71 of file example_service_calibration_caching.c.