Data Structures | Macros | Typedefs | Functions
Distance Detector

Distance detector API description. More...

## Data Structures
struct | acc_detector_distance_result_t
| Distance detector result. More...

## Macros
#define | ACC_DETECTOR_DISTANCE_RESULT_MAX_NUM_DISTANCES (10U)

## Typedefs
typedef struct acc_detector_distance_handle | acc_detector_distance_handle_t
typedef struct acc_detector_distance_config | acc_detector_distance_config_t

## Functions
acc_detector_distance_config_t * | acc_detector_distance_config_create (void)
| Create a configuration for a distance detector. More...
void | acc_detector_distance_config_destroy (acc_detector_distance_config_t *config)
| Destroy a configuration for a distance detector. More...
void | acc_detector_distance_config_log (const acc_detector_distance_handle_t *handle, const acc_detector_distance_config_t *config)
| Print a configuration to the log. More...
bool | acc_detector_distance_get_buffer_sizes (const acc_detector_distance_handle_t *handle, uint32_t *buffer_size, uint32_t *calibration_buffer_size)
| Get the buffer sizes needed given the provided detector handle. More...
acc_detector_distance_handle_t * | acc_detector_distance_create (const acc_detector_distance_config_t *config)
| Create a distance detector with the provided configuration. More...
void | acc_detector_distance_destroy (acc_detector_distance_handle_t *handle)
| Destroy the distance detector handle, freeing its resources. More...
bool | acc_detector_distance_calibrate (acc_sensor_t *sensor, acc_detector_distance_handle_t *handle, const acc_cal_result_t *sensor_cal_result, void *buffer, uint32_t buffer_size, void *calibration_buffer, uint32_t calibration_buffer_size, bool *calibration_complete)
| Do a detector calibration. More...
bool | acc_detector_distance_recalibrate (acc_sensor_t *sensor, acc_detector_distance_handle_t *handle, const acc_cal_result_t *sensor_cal_result, void *buffer, uint32_t buffer_size, void *calibration_buffer, uint32_t calibration_buffer_size, bool *calibration_complete)
| Do a detector recalibration. More...
bool | acc_detector_distance_prepare (const acc_detector_distance_handle_t *handle, const acc_detector_distance_config_t *config, acc_sensor_t *sensor, const acc_cal_result_t *sensor_cal_result, void *buffer, uint32_t buffer_size)
| Prepare the detector for measurements. More...
bool | acc_detector_distance_process (acc_detector_distance_handle_t *handle, void *buffer, void *calibration_buffer, bool *result_available, acc_detector_distance_result_t *result)
| Process the data according to the configuration used in acc_detector_distance_config_create. More...
void | acc_detector_distance_config_sensor_set (acc_detector_distance_config_t *config, acc_sensor_id_t sensor)
| Set the sensor ID. More...
acc_sensor_id_t | acc_detector_distance_config_sensor_get (const acc_detector_distance_config_t *config)
| Get the sensor ID. More...
void | acc_detector_distance_config_start_set (acc_detector_distance_config_t *config, float start_m)
| Set the start of measured interval in meters. More...
float | acc_detector_distance_config_start_get (const acc_detector_distance_config_t *config)
| Get the start of measured interval in meters. More...
void | acc_detector_distance_config_end_set (acc_detector_distance_config_t *config, float end_m)
| Set the end of measured interval in meters. More...
float | acc_detector_distance_config_end_get (const acc_detector_distance_config_t *config)
| Get the end of measured interval in meters. More...
void | acc_detector_distance_config_max_step_length_set (acc_detector_distance_config_t *config, uint16_t max_step_length)
| Set the maximum step length. More...
uint16_t | acc_detector_distance_config_max_step_length_get (const acc_detector_distance_config_t *config)
| Get the maximum step length. More...
void | acc_detector_distance_config_close_range_leakage_cancellation_set (acc_detector_distance_config_t *config, bool enable)
| Enable the close range leakage cancellation logic. More...
bool | acc_detector_distance_config_close_range_leakage_cancellation_get (const acc_detector_distance_config_t *config)
| Get if the close range leakage cancellation logic is enabled. More...
void | acc_detector_distance_config_signal_quality_set (acc_detector_distance_config_t *config, float signal_quality)
| Set the signal quality. More...
float | acc_detector_distance_config_signal_quality_get (const acc_detector_distance_config_t *config)
| Get the signal quality. More...
void | acc_detector_distance_config_max_profile_set (acc_detector_distance_config_t *config, acc_config_profile_t max_profile)
| Set the max profile. More...
acc_config_profile_t | acc_detector_distance_config_max_profile_get (const acc_detector_distance_config_t *config)
| Get the max profile. More...
void | acc_detector_distance_config_threshold_method_set (acc_detector_distance_config_t *config, acc_detector_distance_threshold_method_t threshold_method)
| Set the threshold method. More...
acc_detector_distance_threshold_method_t | acc_detector_distance_config_threshold_method_get (const acc_detector_distance_config_t *config)
| Get the threshold method. More...
void | acc_detector_distance_config_peak_sorting_set (acc_detector_distance_config_t *config, acc_detector_distance_peak_sorting_t peak_sorting)
| Set the peak sorting method. More...
acc_detector_distance_peak_sorting_t | acc_detector_distance_config_peak_sorting_get (const acc_detector_distance_config_t *config)
| Get the peak sorting method. More...
void | acc_detector_distance_config_num_frames_recorded_threshold_set (acc_detector_distance_config_t *config, uint16_t num_frames)
| Set the number frames to use for recorded threshold. More...
uint16_t | acc_detector_distance_config_num_frames_recorded_threshold_get (const acc_detector_distance_config_t *config)
| Get the number of frames to use for recorded threshold. More...
void | acc_detector_distance_config_fixed_amplitude_threshold_value_set (acc_detector_distance_config_t *config, float fixed_threshold_value)
| Set fixed amplitude threshold value. More...
float | acc_detector_distance_config_fixed_amplitude_threshold_value_get (const acc_detector_distance_config_t *config)
| Get fixed amplitude threshold value. More...
void | acc_detector_distance_config_fixed_strength_threshold_value_set (acc_detector_distance_config_t *config, float fixed_threshold_value)
| Set fixed strength threshold value. More...
float | acc_detector_distance_config_fixed_strength_threshold_value_get (const acc_detector_distance_config_t *config)
| Get fixed strength threshold value. More...
void | acc_detector_distance_config_threshold_sensitivity_set (acc_detector_distance_config_t *config, float threshold_sensitivity)
| Set threshold sensitivity. More...
float | acc_detector_distance_config_threshold_sensitivity_get (const acc_detector_distance_config_t *config)
| Get threshold sensitivity. More...
void | acc_detector_distance_config_reflector_shape_set (acc_detector_distance_config_t *config, acc_detector_distance_reflector_shape_t reflector_shape)
| Set reflector shape. More...
acc_detector_distance_reflector_shape_t | acc_detector_distance_config_reflector_shape_get (const acc_detector_distance_config_t *config)
| Get reflector shape. More...

## Detailed Description

Distance detector API description.

For a detailed description of the algorithm and its parameters, see docs.acconeer.com

## Macro Definition Documentation

## ◆ ACC_DETECTOR_DISTANCE_RESULT_MAX_NUM_DISTANCES

#define ACC_DETECTOR_DISTANCE_RESULT_MAX_NUM_DISTANCES (10U)

Definition at line 28 of file acc_detector_distance.h.

## Typedef Documentation

## ◆ acc_detector_distance_config_t

typedef struct acc_detector_distance_config acc_detector_distance_config_t

Definition at line 43 of file acc_detector_distance.h.

## ◆ acc_detector_distance_handle_t

typedef struct acc_detector_distance_handle acc_detector_distance_handle_t

Definition at line 35 of file acc_detector_distance.h.

## Function Documentation

## ◆ acc_detector_distance_calibrate()

bool acc_detector_distance_calibrate | ( | acc_sensor_t * | sensor,
|  | acc_detector_distance_handle_t * | handle,
|  | const acc_cal_result_t * | sensor_cal_result,
|  | void * | buffer,
|  | uint32_t | buffer_size,
|  | void * | calibration_buffer,
|  | uint32_t | calibration_buffer_size,
|  | bool * | calibration_complete
| ) |  |

Do a detector calibration.

The calibrations done are dependant on what configuration is used. E.g. A detector configuration with a fixed threshold will not need to record the background

Note: The calibration_buffer cannot be modified after being populated by this function

Parameters

  [in] | sensor | The sensor instance to use for calibration
  [in] | handle | The detector handle
  [in] | sensor_cal_result | Sensor calibration result
  [in] | buffer | The buffer
  [in] | buffer_size | The size of buffer. Needs to be at least the result of acc_detector_distance_get_buffer_sizes
  [out] | calibration_buffer | The buffer will be populated with calibration data
  [in] | calibration_buffer_size | The size of buffer. Needs to be at least the result of acc_detector_distance_get_buffer_sizes
  [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.

Returns
  true if successful, false otherwise

Examples
  example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_close_range_leakage_cancellation_get()

bool acc_detector_distance_config_close_range_leakage_cancellation_get | ( | const acc_detector_distance_config_t * | config | ) |

Get if the close range leakage cancellation logic is enabled.

Parameters

  [in] | config | The distance detector config

Returns
  true if close range leakage cancellation logic is enabled, false if disabled

## ◆ acc_detector_distance_config_close_range_leakage_cancellation_set()

void acc_detector_distance_config_close_range_leakage_cancellation_set | ( | acc_detector_distance_config_t * | config,
|  | bool | enable
| ) |  |

Enable the close range leakage cancellation logic.

Close range leakage cancellation refers to the process of measuring close to the sensor(<100mm) by first characterizing the direct leakage, and then subtracting it from the measured sweep in order to isolate the signal component of interest. The close range leakage cancellation process requires the sensor to be installed in its intended geometry with free space in front of the sensor during detector calibration.

Parameters

  [out] | config | The distance detector config
  [in] | enable | true to enable close range leakage cancellation logic, false to disable

Examples
  example_detector_distance.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_create()

acc_detector_distance_config_t* acc_detector_distance_config_create | ( | void |  | ) |

Create a configuration for a distance detector.

Returns
  Distance detector configuration, NULL in case of error

Examples
  example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_destroy()

void acc_detector_distance_config_destroy | ( | acc_detector_distance_config_t * | config | ) |

Destroy a configuration for a distance detector.

Parameters

  [in] | config | The configuration to destroy

Examples
  example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_end_get()

float acc_detector_distance_config_end_get | ( | const acc_detector_distance_config_t * | config | ) |

Get the end of measured interval in meters.

Parameters

  [in] | config | The distance detector config

Returns
  the end point in meters

## ◆ acc_detector_distance_config_end_set()

void acc_detector_distance_config_end_set | ( | acc_detector_distance_config_t * | config,
|  | float | end_m
| ) |  |

Set the end of measured interval in meters.

Parameters

  [out] | config | The distance detector config
  [in] | end_m | End point in meters.

Examples
  example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_fixed_amplitude_threshold_value_get()

float acc_detector_distance_config_fixed_amplitude_threshold_value_get | ( | const acc_detector_distance_config_t * | config | ) |

Get fixed amplitude threshold value.

See acc_detector_distance_config_fixed_amplitude_threshold_value_set

Parameters

  [in] | config | The distance detector config

Returns
  The fixed threshold value

## ◆ acc_detector_distance_config_fixed_amplitude_threshold_value_set()

void acc_detector_distance_config_fixed_amplitude_threshold_value_set | ( | acc_detector_distance_config_t * | config,
|  | float | fixed_threshold_value
| ) |  |

Set fixed amplitude threshold value.

This value is used when the threshold method is set to ACC_DETECTOR_DISTANCE_THRESHOLD_METHOD_FIXED_AMPLITUDE

Parameters

  [out] | config | The distance detector config
  [in] | fixed_threshold_value | The fixed threshold value

## ◆ acc_detector_distance_config_fixed_strength_threshold_value_get()

float acc_detector_distance_config_fixed_strength_threshold_value_get | ( | const acc_detector_distance_config_t * | config | ) |

Get fixed strength threshold value.

See acc_detector_distance_config_fixed_strength_threshold_value_set

Parameters

  [in] | config | The distance detector config

Returns
  The fixed threshold value

## ◆ acc_detector_distance_config_fixed_strength_threshold_value_set()

void acc_detector_distance_config_fixed_strength_threshold_value_set | ( | acc_detector_distance_config_t * | config,
|  | float | fixed_threshold_value
| ) |  |

Set fixed strength threshold value.

This value is used when the threshold method is set to ACC_DETECTOR_DISTANCE_THRESHOLD_METHOD_FIXED_STRENGTH

Parameters

  [out] | config | The distance detector config
  [in] | fixed_threshold_value | The fixed threshold value

## ◆ acc_detector_distance_config_log()

void acc_detector_distance_config_log | ( | const acc_detector_distance_handle_t * | handle,
|  | const acc_detector_distance_config_t * | config
| ) |  |

Print a configuration to the log.

Parameters

  [in] | handle | The distance detector handle, if NULL only distance config will be logged
  [in] | config | The configuration to log

Examples
  example_detector_distance.c, and example_detector_distance_with_iq_data_print.c.

## ◆ acc_detector_distance_config_max_profile_get()

acc_config_profile_t acc_detector_distance_config_max_profile_get | ( | const acc_detector_distance_config_t * | config | ) |

Get the max profile.

Parameters

  [in] | config | The distance detector config

Returns
  the max profile

## ◆ acc_detector_distance_config_max_profile_set()

void acc_detector_distance_config_max_profile_set | ( | acc_detector_distance_config_t * | config,
|  | acc_config_profile_t | max_profile
| ) |  |

Set the max profile.

Specifies the highest allowed profile (the default is the highest, Profile 5). A higher profile yields better SNR but worse distance resolution.

Parameters

  [out] | config | The distance detector config
  [in] | max_profile | The max profile

Examples
  example_detector_distance.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_max_step_length_get()

uint16_t acc_detector_distance_config_max_step_length_get | ( | const acc_detector_distance_config_t * | config | ) |

Get the maximum step length.

Parameters

  [in] | config | The distance detector config

Returns
  the maximum step length

## ◆ acc_detector_distance_config_max_step_length_set()

void acc_detector_distance_config_max_step_length_set | ( | acc_detector_distance_config_t * | config,
|  | uint16_t | max_step_length
| ) |  |

Set the maximum step length.

Used to limit step length. If set to 0 (default), the step length is calculated based on profile.

Parameters

  [out] | config | The distance detector config
  [in] | max_step_length | The maximum step length

Examples
  example_detector_distance.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_num_frames_recorded_threshold_get()

uint16_t acc_detector_distance_config_num_frames_recorded_threshold_get | ( | const acc_detector_distance_config_t * | config | ) |

Get the number of frames to use for recorded threshold.

Parameters

  [in] | config | The distance detector config

Returns
  Number of frames

## ◆ acc_detector_distance_config_num_frames_recorded_threshold_set()

void acc_detector_distance_config_num_frames_recorded_threshold_set | ( | acc_detector_distance_config_t * | config,
|  | uint16_t | num_frames
| ) |  |

Set the number frames to use for recorded threshold.

Parameters

  [out] | config | The distance detector config
  [in] | num_frames | Number of frames

Examples
  example_detector_distance.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_peak_sorting_get()

acc_detector_distance_peak_sorting_t acc_detector_distance_config_peak_sorting_get | ( | const acc_detector_distance_config_t * | config | ) |

Get the peak sorting method.

See acc_detector_distance_config_peak_sorting_set

Parameters

  [in] | config | The distance detector config

Returns
  The peak sorting method

## ◆ acc_detector_distance_config_peak_sorting_set()

void acc_detector_distance_config_peak_sorting_set | ( | acc_detector_distance_config_t * | config,
|  | acc_detector_distance_peak_sorting_t | peak_sorting
| ) |  |

Set the peak sorting method.

See acc_detector_distance_peak_sorting_t for details

Parameters

  [out] | config | The distance detector config
  [in] | peak_sorting | The peak sorting method

Examples
  example_detector_distance.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_reflector_shape_get()

acc_detector_distance_reflector_shape_t acc_detector_distance_config_reflector_shape_get | ( | const acc_detector_distance_config_t * | config | ) |

Get reflector shape.

Parameters

  [in] | config | The distance detector config

Returns
  The reflector shape

## ◆ acc_detector_distance_config_reflector_shape_set()

void acc_detector_distance_config_reflector_shape_set | ( | acc_detector_distance_config_t * | config,
|  | acc_detector_distance_reflector_shape_t | reflector_shape
| ) |  |

Set reflector shape.

Parameters

  [out] | config | The distance detector config
  [in] | reflector_shape | The reflector shape

Examples
  example_detector_distance.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_sensor_get()

acc_sensor_id_t acc_detector_distance_config_sensor_get | ( | const acc_detector_distance_config_t * | config | ) |

Get the sensor ID.

Parameters

  [in] | config | The distance detector config

Returns
  Sensor ID

## ◆ acc_detector_distance_config_sensor_set()

void acc_detector_distance_config_sensor_set | ( | acc_detector_distance_config_t * | config,
|  | acc_sensor_id_t | sensor
| ) |  |

Set the sensor ID.

Parameters

  [out] | config | The distance detector config
  [in] | sensor | Sensor ID

## ◆ acc_detector_distance_config_signal_quality_get()

float acc_detector_distance_config_signal_quality_get | ( | const acc_detector_distance_config_t * | config | ) |

Get the signal quality.

Parameters

  [in] | config | The distance detector config

Returns
  the signal quality

## ◆ acc_detector_distance_config_signal_quality_set()

void acc_detector_distance_config_signal_quality_set | ( | acc_detector_distance_config_t * | config,
|  | float | signal_quality
| ) |  |

Set the signal quality.

High signal quality results in a better SNR (because of higher HWAAS) and higher power consumption. Signal quality can be set within the interval [-10, 35].

Parameters

  [out] | config | The distance detector config
  [in] | signal_quality | The signal quality

Examples
  example_detector_distance.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_start_get()

float acc_detector_distance_config_start_get | ( | const acc_detector_distance_config_t * | config | ) |

Get the start of measured interval in meters.

Parameters

  [in] | config | The distance detector config

Returns
  the start point in meters

## ◆ acc_detector_distance_config_start_set()

void acc_detector_distance_config_start_set | ( | acc_detector_distance_config_t * | config,
|  | float | start_m
| ) |  |

Set the start of measured interval in meters.

Parameters

  [out] | config | The distance detector config
  [in] | start_m | Starting point in meters.

Examples
  example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_config_threshold_method_get()

acc_detector_distance_threshold_method_t acc_detector_distance_config_threshold_method_get | ( | const acc_detector_distance_config_t * | config | ) |

Get the threshold method.

Parameters

  [in] | config | The distance detector config

Returns
  the threshold method

## ◆ acc_detector_distance_config_threshold_method_set()

void acc_detector_distance_config_threshold_method_set | ( | acc_detector_distance_config_t * | config,
|  | acc_detector_distance_threshold_method_t | threshold_method
| ) |  |

Set the threshold method.

See acc_detector_distance_threshold_method_t for details

Parameters

  [out] | config | The distance detector config
  [in] | threshold_method | The threshold method

Examples
  example_detector_distance.c, and example_detector_distance_with_iq_data_print.c.

## ◆ acc_detector_distance_config_threshold_sensitivity_get()

float acc_detector_distance_config_threshold_sensitivity_get | ( | const acc_detector_distance_config_t * | config | ) |

Get threshold sensitivity.

Parameters

  [in] | config | The distance detector config

Returns
  The threshold sensitivity

## ◆ acc_detector_distance_config_threshold_sensitivity_set()

void acc_detector_distance_config_threshold_sensitivity_set | ( | acc_detector_distance_config_t * | config,
|  | float | threshold_sensitivity
| ) |  |

Set threshold sensitivity.

High sensitivity yields a low detection threshold, low sensitivity yields a high detection threshold. Threshold sensitivity can be set within the interval [0, 1].

Parameters

  [out] | config | The distance detector config
  [in] | threshold_sensitivity | The threshold sensitivity

Examples
  example_detector_distance.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_create()

acc_detector_distance_handle_t* acc_detector_distance_create | ( | const acc_detector_distance_config_t * | config | ) |

Create a distance detector with the provided configuration.

Parameters

  [in] | config | The configuration to create a distance detector with

Returns
  Distance detector handle, NULL if distance detector was not possible to create

Examples
  example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_destroy()

void acc_detector_distance_destroy | ( | acc_detector_distance_handle_t * | handle | ) |

Destroy the distance detector handle, freeing its resources.

Parameters

  [in] | handle | The handle to destroy

Examples
  example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_get_buffer_sizes()

bool acc_detector_distance_get_buffer_sizes | ( | const acc_detector_distance_handle_t * | handle,
|  | uint32_t * | buffer_size,
|  | uint32_t * | calibration_buffer_size
| ) |  |

Get the buffer sizes needed given the provided detector handle.

buffer_size is memory needed by the detector for calculations. This memory can be reused between instances. calibration_buffer_size is memory needed to calibrate the detector. This memory needs to be persistent for a single instance of the detector.

Parameters

  [in] | handle | The distance detector handle
  [out] | buffer_size | The buffer size
  [out] | calibration_buffer_size | The calibration buffer size

Returns
  true if successful, false otherwise

Examples
  example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_prepare()

bool acc_detector_distance_prepare | ( | const acc_detector_distance_handle_t * | handle,
|  | const acc_detector_distance_config_t * | config,
|  | acc_sensor_t * | sensor,
|  | const acc_cal_result_t * | sensor_cal_result,
|  | void * | buffer,
|  | uint32_t | buffer_size
| ) |  |

Prepare the detector for measurements.

This should to be done before every measure/wait for interrupt/read, as it reconfigures the sensor.

Parameters

  [in,out] | handle | The distance detector handle
  [in] | config | The distance detector config
  [in] | sensor | The sensor instance to prepare
  [in] | sensor_cal_result | The sensor calibration result to prepare with
  [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_buffer_sizes

Returns
  true if successful, false otherwise

Examples
  example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_process()

bool acc_detector_distance_process | ( | acc_detector_distance_handle_t * | handle,
|  | void * | buffer,
|  | void * | calibration_buffer,
|  | bool * | result_available,
|  | acc_detector_distance_result_t * | result
| ) |  |

Process the data according to the configuration used in acc_detector_distance_config_create.

Parameters

  [in] | handle | The distance detector handle
  [in] | buffer | A reference to the buffer (populated by acc_sensor_read) containing the data to be processed.
  [in] | calibration_buffer | The buffer containing results from acc_detector_distance_calibrate
  [out] | result_available | Whether result will contain a new result
  [out] | result | Distance detector result

Returns
  true if successful, false otherwise

Examples
  example_detector_distance.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.

## ◆ acc_detector_distance_recalibrate()

bool acc_detector_distance_recalibrate | ( | acc_sensor_t * | sensor,
|  | acc_detector_distance_handle_t * | handle,
|  | const acc_cal_result_t * | sensor_cal_result,
|  | void * | buffer,
|  | uint32_t | buffer_size,
|  | void * | calibration_buffer,
|  | uint32_t | calibration_buffer_size,
|  | bool * | calibration_complete
| ) |  |

Do a detector recalibration.

This function should only be used if sensor is recalibrated after initial detector calibration.

Note: The calibration_buffer cannot be modified after being populated by this function

Parameters

  [in] | sensor | The sensor instance to use for calibration
  [in] | handle | The detector handle
  [in] | sensor_cal_result | Sensor calibration result
  [in] | buffer | The buffer
  [in] | buffer_size | The size of buffer. Needs to be at least the result of acc_detector_distance_get_buffer_sizes
  [out] | calibration_buffer | The buffer will be populated with calibration data
  [in] | calibration_buffer_size | The size of buffer. Needs to be at least the result of acc_detector_distance_get_buffer_sizes
  [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.

Returns
  true if successful, false otherwise

Examples
  example_detector_distance.c, example_detector_distance_with_iq_data_print.c, and ref_app_tank_level.c.