Data Structures | Typedefs | Functions
Presence Detector

Presence detector API description. More...

## Data Structures
struct | acc_detector_presence_result_t
| Presence detector results container. More...
struct | acc_detector_presence_metadata_t

## Typedefs
typedef struct acc_detector_presence_handle | acc_detector_presence_handle_t
typedef struct acc_detector_presence_config | acc_detector_presence_config_t

## Functions
acc_detector_presence_config_t * | acc_detector_presence_config_create (void)
| Create a configuration for a presence detector. More...
void | acc_detector_presence_config_destroy (acc_detector_presence_config_t *presence_config)
| Destroy a presence detector configuration. More...
void | acc_detector_presence_config_log (acc_detector_presence_config_t *presence_config)
| Print a configuration to the log. More...
bool | acc_detector_presence_get_buffer_size (const acc_detector_presence_handle_t *presence_handle, uint32_t *buffer_size)
| Get the buffer size needed for the provided presence detector handle. More...
acc_detector_presence_handle_t * | acc_detector_presence_create (acc_detector_presence_config_t *presence_config, acc_detector_presence_metadata_t *metadata)
| Create a presence detector with the provided configuration. More...
void | acc_detector_presence_destroy (acc_detector_presence_handle_t *presence_handle)
| Destroy a presence detector identified with the provided handle. More...
bool | acc_detector_presence_prepare (const acc_detector_presence_handle_t *presence_handle, acc_detector_presence_config_t *presence_config, acc_sensor_t *sensor, const acc_cal_result_t *cal_result, void *buffer, uint32_t buffer_size)
| Prepare the detector to do a measurement. More...
void | acc_detector_presence_reset_filters (const acc_detector_presence_handle_t *presence_handle)
| Reset internal filters. More...
bool | acc_detector_presence_process (acc_detector_presence_handle_t *presence_handle, void *buffer, acc_detector_presence_result_t *result)
| Process the data according to the configuration used in acc_detector_presence_config_create. More...
void | acc_detector_presence_config_start_set (acc_detector_presence_config_t *presence_config, float start)
| Set the start point of measurement interval in meters. More...
float | acc_detector_presence_config_start_get (const acc_detector_presence_config_t *presence_config)
| Get the start point of measurement interval in meters. More...
void | acc_detector_presence_config_end_set (acc_detector_presence_config_t *presence_config, float end)
| Set the end point of measurement interval in meters. More...
float | acc_detector_presence_config_end_get (const acc_detector_presence_config_t *presence_config)
| Get the end point of measurement interval in meters. More...
void | acc_detector_presence_config_step_length_set (acc_detector_presence_config_t *presence_config, uint16_t step_length)
| Set the step length in points. More...
uint16_t | acc_detector_presence_config_step_length_get (const acc_detector_presence_config_t *presence_config)
| Get the step length in points. More...
void | acc_detector_presence_config_auto_step_length_set (acc_detector_presence_config_t *presence_config, bool enable)
| Enable automatic selection of step length based on the profile. More...
bool | acc_detector_presence_config_auto_step_length_get (const acc_detector_presence_config_t *presence_config)
| Get if automatic selection of step length based on the profile is enabled. More...
void | acc_detector_presence_config_profile_set (acc_detector_presence_config_t *presence_config, acc_config_profile_t profile)
| Set a profile. More...
acc_config_profile_t | acc_detector_presence_config_profile_get (const acc_detector_presence_config_t *presence_config)
| Get the currently set profile. More...
void | acc_detector_presence_config_auto_profile_set (acc_detector_presence_config_t *presence_config, bool enable)
| Enable automatic selection of profile based on start point of measurement. More...
bool | acc_detector_presence_config_auto_profile_get (const acc_detector_presence_config_t *presence_config)
| Get if automatic selection of profile based on start point of measurement is enabled. More...
void | acc_detector_presence_config_inter_frame_idle_state_set (acc_detector_presence_config_t *presence_config, acc_config_idle_state_t idle_state)
| Set inter frame idle state. More...
acc_config_idle_state_t | acc_detector_presence_config_inter_frame_idle_state_get (const acc_detector_presence_config_t *presence_config)
| Get inter frame idle state. More...
void | acc_detector_presence_config_hwaas_set (acc_detector_presence_config_t *presence_config, uint16_t hwaas)
| Set the hardware accelerated average samples (HWAAS) More...
uint16_t | acc_detector_presence_config_hwaas_get (const acc_detector_presence_config_t *presence_config)
| Get the hardware accelerated average samples (HWAAS) More...
void | acc_detector_presence_config_sweeps_per_frame_set (acc_detector_presence_config_t *presence_config, uint16_t sweeps_per_frame)
| Set the number of sweeps per frame. More...
uint16_t | acc_detector_presence_config_sweeps_per_frame_get (const acc_detector_presence_config_t *presence_config)
| Get the number of sweeps per frame. More...
void | acc_detector_presence_config_frame_rate_set (acc_detector_presence_config_t *presence_config, float frame_rate)
| Set the frame rate. More...
float | acc_detector_presence_config_frame_rate_get (const acc_detector_presence_config_t *presence_config)
| Get the frame rate. More...
void | acc_detector_presence_config_frame_rate_app_driven_set (acc_detector_presence_config_t *presence_config, bool enable)
| Set if the application should maintain the requested frame rate. More...
bool | acc_detector_presence_config_frame_rate_app_driven_get (const acc_detector_presence_config_t *presence_config)
| Get if the application should maintain the requested frame rate. More...
void | acc_detector_presence_config_sensor_set (acc_detector_presence_config_t *presence_config, acc_sensor_id_t sensor_id)
| Set sensor ID. More...
acc_sensor_id_t | acc_detector_presence_config_sensor_get (const acc_detector_presence_config_t *presence_config)
| Get sensor ID. More...
void | acc_detector_presence_config_reset_filters_on_prepare_set (acc_detector_presence_config_t *presence_config, bool enable)
| Set if the presence filters should reset on prepare. More...
bool | acc_detector_presence_config_reset_filters_on_prepare_get (const acc_detector_presence_config_t *presence_config)
| Get if the presence filters should reset on prepare. More...
void | acc_detector_presence_config_inter_frame_presence_timeout_set (acc_detector_presence_config_t *presence_config, uint16_t inter_frame_presence_timeout)
| Set the inter-frame presence timeout in seconds. More...
uint16_t | acc_detector_presence_config_inter_frame_presence_timeout_get (const acc_detector_presence_config_t *presence_config)
| Get the inter-frame presence timeout in seconds. More...
void | acc_detector_presence_config_intra_detection_set (acc_detector_presence_config_t *presence_config, bool enable)
| Set intra-frame presence detection. More...
bool | acc_detector_presence_config_intra_detection_get (const acc_detector_presence_config_t *presence_config)
| Get if frame intra-frame presence detection is enabled. More...
void | acc_detector_presence_config_intra_detection_threshold_set (acc_detector_presence_config_t *presence_config, float intra_detection_threshold)
| Set the detection threshold for the intra-frame presence detection. More...
float | acc_detector_presence_config_intra_detection_threshold_get (const acc_detector_presence_config_t *presence_config)
| Get the detection threshold for the intra-frame presence detection. More...
void | acc_detector_presence_config_inter_detection_set (acc_detector_presence_config_t *presence_config, bool enable)
| Set inter-frame presence detection. More...
bool | acc_detector_presence_config_inter_detection_get (const acc_detector_presence_config_t *presence_config)
| Get if inter-frame presence detection is enabled. More...
void | acc_detector_presence_config_inter_detection_threshold_set (acc_detector_presence_config_t *presence_config, float inter_detection_threshold)
| Set the detection threshold for the inter-frame presence detection. More...
float | acc_detector_presence_config_inter_detection_threshold_get (const acc_detector_presence_config_t *presence_config)
| Get the detection threshold for the inter-frame presence detection. More...
void | acc_detector_presence_config_inter_frame_deviation_time_const_set (acc_detector_presence_config_t *presence_config, float inter_frame_deviation_time_const)
| Set the time constant of the low pass filter for the inter-frame deviation between fast and slow. More...
float | acc_detector_presence_config_inter_frame_deviation_time_const_get (const acc_detector_presence_config_t *presence_config)
| Get the time constant of the low pass filter for the inter-frame deviation between fast and slow. More...
void | acc_detector_presence_config_inter_frame_fast_cutoff_set (acc_detector_presence_config_t *presence_config, float inter_frame_fast_cutoff)
| Set the cutoff frequency of the low pass filter for the fast filtered absolute sweep mean. More...
float | acc_detector_presence_config_inter_frame_fast_cutoff_get (const acc_detector_presence_config_t *presence_config)
| Get the cutoff frequency of the low pass filter for the fast filtered absolute sweep mean. More...
void | acc_detector_presence_config_inter_frame_slow_cutoff_set (acc_detector_presence_config_t *presence_config, float inter_frame_slow_cutoff)
| Set the cutoff frequency of the low pass filter for the slow filtered absolute sweep mean. More...
float | acc_detector_presence_config_inter_frame_slow_cutoff_get (const acc_detector_presence_config_t *presence_config)
| Get the cutoff frequency of the low pass filter for the slow filtered absolute sweep mean. More...
void | acc_detector_presence_config_intra_frame_time_const_set (acc_detector_presence_config_t *presence_config, float intra_frame_time_const)
| Set the time constant for the depthwise filtering in the intra-frame part. More...
float | acc_detector_presence_config_intra_frame_time_const_get (const acc_detector_presence_config_t *presence_config)
| Get the time constant for the depthwise filtering in the intra-frame part. More...
void | acc_detector_presence_config_intra_output_time_const_set (acc_detector_presence_config_t *presence_config, float intra_output_time_const)
| Set the time constant for the output in the intra-frame part. More...
float | acc_detector_presence_config_intra_output_time_const_get (const acc_detector_presence_config_t *presence_config)
| Get the time constant for the output in the intra-frame part. More...
void | acc_detector_presence_config_inter_output_time_const_set (acc_detector_presence_config_t *presence_config, float inter_output_time_const)
| Set the time constant for the output in the inter-frame part. More...
float | acc_detector_presence_config_inter_output_time_const_get (const acc_detector_presence_config_t *presence_config)
| Get the time constant for the output in the inter-frame part. More...
void | acc_detector_presence_config_automatic_subsweeps_set (acc_detector_presence_config_t *presence_config, bool automatic_subsweeps)
| Set if automatic subsweeps should be used. More...
bool | acc_detector_presence_config_automatic_subsweeps_get (const acc_detector_presence_config_t *presence_config)
| Get if automatic subsweeps should be used. More...
void | acc_detector_presence_config_signal_quality_set (acc_detector_presence_config_t *presence_config, float signal_quality)
| Set signal quality. More...
float | acc_detector_presence_config_signal_quality_get (const acc_detector_presence_config_t *presence_config)
| Get signal quality. More...
float | acc_detector_presence_get_distance_m (const acc_detector_presence_handle_t *presence_handle, uint16_t point_idx)
| Calculate distance in meter for a point in a sweep (including subsweeps) More...

## Detailed Description

Presence detector API description.

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

## Typedef Documentation

## ◆ acc_detector_presence_config_t

typedef struct acc_detector_presence_config acc_detector_presence_config_t

Definition at line 41 of file acc_detector_presence.h.

## ◆ acc_detector_presence_handle_t

typedef struct acc_detector_presence_handle acc_detector_presence_handle_t

Definition at line 34 of file acc_detector_presence.h.

## Function Documentation

## ◆ acc_detector_presence_config_auto_profile_get()

bool acc_detector_presence_config_auto_profile_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get if automatic selection of profile based on start point of measurement is enabled.

See acc_detector_presence_config_auto_profile_set

Parameters

  [in] | presence_config | The configuration

Returns
  true if automatic selection of profile is enabled, false if disabled

## ◆ acc_detector_presence_config_auto_profile_set()

void acc_detector_presence_config_auto_profile_set | ( | acc_detector_presence_config_t * | presence_config,
|  | bool | enable
| ) |  |

Enable automatic selection of profile based on start point of measurement.

The highest possible profile without interference of direct leakage will used to maximize SNR

NOTE! Only used if automatic_subsweeps is set to false

Parameters

  [in] | presence_config | The configuration
  [in] | enable | true to enable auto selection, false to disable

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_auto_step_length_get()

bool acc_detector_presence_config_auto_step_length_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get if automatic selection of step length based on the profile is enabled.

See acc_detector_presence_config_auto_step_length_set

Parameters

  [in] | presence_config | The configuration

Returns
  true if automatic selection of step length is enabled, false if disabled

## ◆ acc_detector_presence_config_auto_step_length_set()

void acc_detector_presence_config_auto_step_length_set | ( | acc_detector_presence_config_t * | presence_config,
|  | bool | enable
| ) |  |

Enable automatic selection of step length based on the profile.

The highest possible step length based on the fwhm of the set profile with the goal to achieve detection on the complete range with minimum number of sampling points

NOTE! Only used if automatic_subsweeps is set to false

Parameters

  [in] | presence_config | The configuration
  [in] | enable | true to enable auto selection, false to disable

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_automatic_subsweeps_get()

bool acc_detector_presence_config_automatic_subsweeps_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get if automatic subsweeps should be used.

Parameters

  [in] | presence_config | The configuration to get enable automatic subsweeps for

Returns
  Enable automatic subsweeps, true if enabled.

## ◆ acc_detector_presence_config_automatic_subsweeps_set()

void acc_detector_presence_config_automatic_subsweeps_set | ( | acc_detector_presence_config_t * | presence_config,
|  | bool | automatic_subsweeps
| ) |  |

Set if automatic subsweeps should be used.

Enabling subsweeps will make the presence detector utilize subsweeps. This will automatically optimize settings for the selected range. This setting will disable other settings and automatically overwrite their values.

Parameters

  [in] | presence_config | The configuration to set enable automatic subsweeps for
  [in] | automatic_subsweeps | Enable automatic subsweeps setting, true will enable the setting

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_create()

acc_detector_presence_config_t* acc_detector_presence_config_create | ( | void |  | ) |

Create a configuration for a presence detector.

Returns
  Presence detector configuration, NULL if creation was not possible

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_destroy()

void acc_detector_presence_config_destroy | ( | acc_detector_presence_config_t * | presence_config | ) |

Destroy a presence detector configuration.

Parameters

  [in] | presence_config | The configuration to destroy

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_end_get()

float acc_detector_presence_config_end_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the end point of measurement interval in meters.

Parameters

  [in] | presence_config | The configuration

Returns
  The end point of measurement interval in meters

## ◆ acc_detector_presence_config_end_set()

void acc_detector_presence_config_end_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | end
| ) |  |

Set the end point of measurement interval in meters.

Parameters

  [in] | presence_config | The configuration
  [in] | end | The end point of measurement interval in meters

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_frame_rate_app_driven_get()

bool acc_detector_presence_config_frame_rate_app_driven_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get if the application should maintain the requested frame rate.

See acc_detector_presence_config_frame_rate_app_driven_set

Parameters

  [in] | presence_config | The configuration

Returns
  true if application driven frame rate is enabled, false if disabled

## ◆ acc_detector_presence_config_frame_rate_app_driven_set()

void acc_detector_presence_config_frame_rate_app_driven_set | ( | acc_detector_presence_config_t * | presence_config,
|  | bool | enable
| ) |  |

Set if the application should maintain the requested frame rate.

If set to true, the application must maintain the frame rate set using acc_detector_presence_config_frame_rate_set If set to false, the frame rate is maintained by the sensor at the frame rate given by acc_detector_presence_config_frame_rate_set.

Parameters

  [in] | presence_config | The configuration
  [in] | enable | true to enable application driven frame rate, false to disable

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_frame_rate_get()

float acc_detector_presence_config_frame_rate_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the frame rate.

See acc_detector_presence_config_frame_rate_set

Parameters

  [in] | presence_config | The configuration

Returns
  Frame rate in Hz

Examples
  example_detector_presence_low_power_hibernate.c, and example_detector_presence_low_power_off.c.

## ◆ acc_detector_presence_config_frame_rate_set()

void acc_detector_presence_config_frame_rate_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | frame_rate
| ) |  |

Set the frame rate.

This frame rate is maintained by the sensor if acc_detector_presence_config_frame_rate_app_driven_set is invoked with false (default) and the application must maintain the given frame rate if invoked with true. If the application maintains the frame rate it is important that it doesn't deviate more than 10% from the set value for the presence algorithm to work optimally. See acc_config_frame_rate_set for details

Parameters

  [in] | presence_config | The configuration
  [in] | frame_rate | Frame rate in Hz. Must be > 0

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_hwaas_get()

uint16_t acc_detector_presence_config_hwaas_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the hardware accelerated average samples (HWAAS)

See acc_detector_presence_config_hwaas_set

Parameters

  [in] | presence_config | The configuration

Returns
  Hardware accelerated average samples

## ◆ acc_detector_presence_config_hwaas_set()

void acc_detector_presence_config_hwaas_set | ( | acc_detector_presence_config_t * | presence_config,
|  | uint16_t | hwaas
| ) |  |

Set the hardware accelerated average samples (HWAAS)

See acc_config_hwaas_set for more details

Parameters

  [in] | presence_config | The configuration
  [in] | hwaas | Hardware accelerated average samples

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_inter_detection_get()

bool acc_detector_presence_config_inter_detection_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get if inter-frame presence detection is enabled.

See acc_detector_presence_config_inter_detection_set

Parameters

  [in] | presence_config | The configuration to get inter-frame presence detection for

Returns
  true if inter-frame presence detection is enabled, false otherwise

## ◆ acc_detector_presence_config_inter_detection_set()

void acc_detector_presence_config_inter_detection_set | ( | acc_detector_presence_config_t * | presence_config,
|  | bool | enable
| ) |  |

Set inter-frame presence detection.

This is used for detecting slower movements between frames

Parameters

  [in] | presence_config | The configuration to set inter-frame detection for
  [in] | enable | true if inter-frame presence detection should be enabled

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_inter_detection_threshold_get()

float acc_detector_presence_config_inter_detection_threshold_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the detection threshold for the inter-frame presence detection.

See acc_detector_presence_config_inter_detection_threshold_set

Parameters

  [in] | presence_config | The configuration to get the detection threshold for

Returns
  detection threshold

## ◆ acc_detector_presence_config_inter_detection_threshold_set()

void acc_detector_presence_config_inter_detection_threshold_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | inter_detection_threshold
| ) |  |

Set the detection threshold for the inter-frame presence detection.

This is the threshold for detecting slower movements between frames

Parameters

  [in] | presence_config | The configuration to set the detection threshold for
  [in] | inter_detection_threshold | The threshold

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_inter_frame_deviation_time_const_get()

float acc_detector_presence_config_inter_frame_deviation_time_const_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the time constant of the low pass filter for the inter-frame deviation between fast and slow.

Parameters

  [in] | presence_config | The configuration to get the time constant for

Returns
  time constant in s

## ◆ acc_detector_presence_config_inter_frame_deviation_time_const_set()

void acc_detector_presence_config_inter_frame_deviation_time_const_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | inter_frame_deviation_time_const
| ) |  |

Set the time constant of the low pass filter for the inter-frame deviation between fast and slow.

Parameters

  [in] | presence_config | The configuration
  [in] | inter_frame_deviation_time_const | Time constant to set

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_inter_frame_fast_cutoff_get()

float acc_detector_presence_config_inter_frame_fast_cutoff_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the cutoff frequency of the low pass filter for the fast filtered absolute sweep mean.

Parameters

  [in] | presence_config | The configuration to get the cutoff frequency for

Returns
  the cutoff frequency in Hz

## ◆ acc_detector_presence_config_inter_frame_fast_cutoff_set()

void acc_detector_presence_config_inter_frame_fast_cutoff_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | inter_frame_fast_cutoff
| ) |  |

Set the cutoff frequency of the low pass filter for the fast filtered absolute sweep mean.

No filtering is applied if the cutoff is set over half the frame rate (Nyquist limit).

Parameters

  [in] | presence_config | The configuration
  [in] | inter_frame_fast_cutoff | Cutoff frequency to set

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_inter_frame_idle_state_get()

acc_config_idle_state_t acc_detector_presence_config_inter_frame_idle_state_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get inter frame idle state.

See acc_detector_presence_config_inter_frame_idle_state_set

Parameters

  [in] | presence_config | The configuration

Returns
  The idle state to use between frames

## ◆ acc_detector_presence_config_inter_frame_idle_state_set()

void acc_detector_presence_config_inter_frame_idle_state_set | ( | acc_detector_presence_config_t * | presence_config,
|  | acc_config_idle_state_t | idle_state
| ) |  |

Set inter frame idle state.

The 'inter-frame idle state' is the state the sensor idles in between each frame.

See also acc_config_idle_state_t.

Parameters

  [in] | presence_config | The configuration
  [in] | idle_state | The idle state to use between frames

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_inter_frame_presence_timeout_get()

uint16_t acc_detector_presence_config_inter_frame_presence_timeout_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the inter-frame presence timeout in seconds.

See acc_detector_presence_config_inter_frame_presence_timeout_set

Parameters

  [in] | presence_config | The configuration

Returns
  Inter-frame presence timeout in s

## ◆ acc_detector_presence_config_inter_frame_presence_timeout_set()

void acc_detector_presence_config_inter_frame_presence_timeout_set | ( | acc_detector_presence_config_t * | presence_config,
|  | uint16_t | inter_frame_presence_timeout
| ) |  |

Set the inter-frame presence timeout in seconds.

Number of seconds the inter-frame presence score needs to decrease before exponential scaling starts for faster decline. Should be between 0 and 30 where 0 means no timeout

Parameters

  [in] | presence_config | The configuration
  [in] | inter_frame_presence_timeout | Timeout in seconds between 0 and 30

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_inter_frame_slow_cutoff_get()

float acc_detector_presence_config_inter_frame_slow_cutoff_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the cutoff frequency of the low pass filter for the slow filtered absolute sweep mean.

Parameters

  [in] | presence_config | The configuration to get the cutoff frequency for

Returns
  the cutoff frequency in Hz

## ◆ acc_detector_presence_config_inter_frame_slow_cutoff_set()

void acc_detector_presence_config_inter_frame_slow_cutoff_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | inter_frame_slow_cutoff
| ) |  |

Set the cutoff frequency of the low pass filter for the slow filtered absolute sweep mean.

Parameters

  [in] | presence_config | The configuration
  [in] | inter_frame_slow_cutoff | Cutoff frequency to set

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_inter_output_time_const_get()

float acc_detector_presence_config_inter_output_time_const_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the time constant for the output in the inter-frame part.

Parameters

  [in] | presence_config | The configuration to get the time constant for

Returns
  time constant in s

## ◆ acc_detector_presence_config_inter_output_time_const_set()

void acc_detector_presence_config_inter_output_time_const_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | inter_output_time_const
| ) |  |

Set the time constant for the output in the inter-frame part.

Parameters

  [in] | presence_config | The configuration
  [in] | inter_output_time_const | Time constant to set

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_intra_detection_get()

bool acc_detector_presence_config_intra_detection_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get if frame intra-frame presence detection is enabled.

See acc_detector_presence_config_intra_detection_set

Parameters

  [in] | presence_config | The configuration to get intra detection for

Returns
  true if intra-frame detection is enabled, false otherwise

## ◆ acc_detector_presence_config_intra_detection_set()

void acc_detector_presence_config_intra_detection_set | ( | acc_detector_presence_config_t * | presence_config,
|  | bool | enable
| ) |  |

Set intra-frame presence detection.

This is used for detecting faster movements inside frames

Parameters

  [in] | presence_config | The configuration to set intra-frame detection for
  [in] | enable | true if intra-frame detection should be enabled

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_intra_detection_threshold_get()

float acc_detector_presence_config_intra_detection_threshold_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the detection threshold for the intra-frame presence detection.

See acc_detector_presence_config_intra_detection_threshold_set

Parameters

  [in] | presence_config | The configuration to get the detection threshold for

Returns
  The intra-frame detection threshold

## ◆ acc_detector_presence_config_intra_detection_threshold_set()

void acc_detector_presence_config_intra_detection_threshold_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | intra_detection_threshold
| ) |  |

Set the detection threshold for the intra-frame presence detection.

This is the threshold for detecting faster movements inside frames

Parameters

  [in] | presence_config | The configuration to set the detection threshold for
  [in] | intra_detection_threshold | The intra-frame detection threshold to set

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_intra_frame_time_const_get()

float acc_detector_presence_config_intra_frame_time_const_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the time constant for the depthwise filtering in the intra-frame part.

Parameters

  [in] | presence_config | The configuration to get the time constant for

Returns
  time constant in s

## ◆ acc_detector_presence_config_intra_frame_time_const_set()

void acc_detector_presence_config_intra_frame_time_const_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | intra_frame_time_const
| ) |  |

Set the time constant for the depthwise filtering in the intra-frame part.

Parameters

  [in] | presence_config | The configuration
  [in] | intra_frame_time_const | Time constant to set

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_intra_output_time_const_get()

float acc_detector_presence_config_intra_output_time_const_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the time constant for the output in the intra-frame part.

Parameters

  [in] | presence_config | The configuration to get the time constant for

Returns
  time constant in s

## ◆ acc_detector_presence_config_intra_output_time_const_set()

void acc_detector_presence_config_intra_output_time_const_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | intra_output_time_const
| ) |  |

Set the time constant for the output in the intra-frame part.

Parameters

  [in] | presence_config | The configuration
  [in] | intra_output_time_const | Time constant to set

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_log()

void acc_detector_presence_config_log | ( | acc_detector_presence_config_t * | presence_config | ) |

Print a configuration to the log.

Parameters

  [in] | presence_config | The configuration to log

Examples
  example_detector_presence.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_profile_get()

acc_config_profile_t acc_detector_presence_config_profile_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the currently set profile.

See acc_detector_presence_config_profile_set

Parameters

  [in] | presence_config | The configuration

Returns
  The profile currently used

## ◆ acc_detector_presence_config_profile_set()

void acc_detector_presence_config_profile_set | ( | acc_detector_presence_config_t * | presence_config,
|  | acc_config_profile_t | profile
| ) |  |

Set a profile.

Each profile consists of a number of settings for the sensor that configures the RX and TX paths. Lower profiles have higher depth resolution while higher profiles have higher SNR.

The set profile will only be used if profile auto selection was disabled through acc_detector_presence_config_auto_profile_set

NOTE! Only used if automatic_subsweeps is set to false

Parameters

  [in] | presence_config | The configuration
  [in] | profile | The profile to set

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_reset_filters_on_prepare_get()

bool acc_detector_presence_config_reset_filters_on_prepare_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get if the presence filters should reset on prepare.

See acc_detector_presence_config_reset_filters_on_prepare_set

Parameters

  [in] | presence_config | The configuration

Returns
  true if filters should reset on prepare, false otherwise

## ◆ acc_detector_presence_config_reset_filters_on_prepare_set()

void acc_detector_presence_config_reset_filters_on_prepare_set | ( | acc_detector_presence_config_t * | presence_config,
|  | bool | enable
| ) |  |

Set if the presence filters should reset on prepare.

If set to true, the presence filters will be reset when acc_detector_presence_prepare is invoked.

Parameters

  [in] | presence_config | The configuration
  [in] | enable | true to reset the filters on prepare, false to not reset

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_sensor_get()

acc_sensor_id_t acc_detector_presence_config_sensor_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get sensor ID.

Parameters

  [in] | presence_config | The configuration to get the sensor ID for

Returns
  sensor ID

## ◆ acc_detector_presence_config_sensor_set()

void acc_detector_presence_config_sensor_set | ( | acc_detector_presence_config_t * | presence_config,
|  | acc_sensor_id_t | sensor_id
| ) |  |

Set sensor ID.

Parameters

  [in] | presence_config | The configuration to set the sensor ID for
  [in] | sensor_id | The sensor ID

## ◆ acc_detector_presence_config_signal_quality_get()

float acc_detector_presence_config_signal_quality_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get signal quality.

Parameters

  [in] | presence_config | The configuration to get signal quality for

Returns
  Signal quality

## ◆ acc_detector_presence_config_signal_quality_set()

void acc_detector_presence_config_signal_quality_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | signal_quality
| ) |  |

Set signal quality.

Only used if automatic subsweeps is enabled.

Parameters

  [in] | presence_config | The configuration to set signal quality for
  [in] | signal_quality | Signal quality to use

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_start_get()

float acc_detector_presence_config_start_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the start point of measurement interval in meters.

Parameters

  [in] | presence_config | The configuration

Returns
  The start point of measurement interval in meters

## ◆ acc_detector_presence_config_start_set()

void acc_detector_presence_config_start_set | ( | acc_detector_presence_config_t * | presence_config,
|  | float | start
| ) |  |

Set the start point of measurement interval in meters.

Parameters

  [in] | presence_config | The configuration
  [in] | start | The start point of measurement interval in meters

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_config_step_length_get()

uint16_t acc_detector_presence_config_step_length_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the step length in points.

See also
  acc_detector_presence_config_step_length_set

Parameters

  [in] | presence_config | The configuration

Returns
  The step length

## ◆ acc_detector_presence_config_step_length_set()

void acc_detector_presence_config_step_length_set | ( | acc_detector_presence_config_t * | presence_config,
|  | uint16_t | step_length
| ) |  |

Set the step length in points.

This sets the number of steps between each data point.

The set step length will only be used if step length auto selection was disabled through acc_detector_presence_config_auto_step_length_set

Sampling produces complex (IQ) data points with configurable distance spacing, starting from ~2.5mm.

NOTE! Only used if automatic_subsweeps is set to false

Parameters

  [in] | presence_config | The configuration
  [in] | step_length | The step length

## ◆ acc_detector_presence_config_sweeps_per_frame_get()

uint16_t acc_detector_presence_config_sweeps_per_frame_get | ( | const acc_detector_presence_config_t * | presence_config | ) |

Get the number of sweeps per frame.

See acc_detector_presence_config_sweeps_per_frame_set

Parameters

  [in] | presence_config | The configuration

Returns
  Sweeps per frame

## ◆ acc_detector_presence_config_sweeps_per_frame_set()

void acc_detector_presence_config_sweeps_per_frame_set | ( | acc_detector_presence_config_t * | presence_config,
|  | uint16_t | sweeps_per_frame
| ) |  |

Set the number of sweeps per frame.

Sets the number of sweeps that will be captured in each frame (measurement).

Parameters

  [in] | presence_config | The configuration
  [in] | sweeps_per_frame | Sweeps per frame, must be at least 6

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_create()

acc_detector_presence_handle_t* acc_detector_presence_create | ( | acc_detector_presence_config_t * | presence_config,
|  | acc_detector_presence_metadata_t * | metadata
| ) |  |

Create a presence detector with the provided configuration.

Parameters

  [in] | presence_config | The presence detector configuration to create a presence detector with
  [out] | metadata | Metadata for the presence detector given the presence_config

Returns
  Presence detector handle, NULL if presence detector was not possible to create

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_destroy()

void acc_detector_presence_destroy | ( | acc_detector_presence_handle_t * | presence_handle | ) |

Destroy a presence detector identified with the provided handle.

Destroy the context of a presence detector allowing another presence detector to be created using the same resources. If NULL is sent in, nothing happens.

Parameters

  [in] | presence_handle | A reference to the presence detector handle to destroy

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_get_buffer_size()

bool acc_detector_presence_get_buffer_size | ( | const acc_detector_presence_handle_t * | presence_handle,
|  | uint32_t * | buffer_size
| ) |  |

Get the buffer size needed for the provided presence detector handle.

This buffer size can be used to allocate a memory buffer in the application, which is needed for several functions in the detector library. This size will also include memory for holding the depthwise inter/intra presence score arrays that will be part of the result, see acc_detector_presence_result_t

Parameters

  [in] | presence_handle | The presence detector handle to to get the buffer size for
  [out] | buffer_size | The buffer size

Returns
  true if successful, false otherwise

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_get_distance_m()

float acc_detector_presence_get_distance_m | ( | const acc_detector_presence_handle_t * | presence_handle,
|  | uint16_t | point_idx
| ) |  |

Calculate distance in meter for a point in a sweep (including subsweeps)

Parameters

  [in] | presence_handle | The presence detector handle
  [in] | point_idx | Index for distance point in sweep

Returns
  Distance in meters

## ◆ acc_detector_presence_prepare()

bool acc_detector_presence_prepare | ( | const acc_detector_presence_handle_t * | presence_handle,
|  | acc_detector_presence_config_t * | presence_config,
|  | acc_sensor_t * | sensor,
|  | const acc_cal_result_t * | cal_result,
|  | void * | buffer,
|  | uint32_t | buffer_size
| ) |  |

Prepare the detector to do a measurement.

Parameters

  [in] | presence_handle | The presence detector handle to prepare for
  [in] | presence_config | The configuration to prepare with
  [in] | sensor | The sensor instance to prepare
  [in] | cal_result | The calibration result to prepare with
  [in] | buffer | Memory used by the detector to prepare the sensor for measurements The buffer will only be used during the duration of this call
  [in] | buffer_size | The size in bytes of the buffer, should be at least buffer_size from acc_detector_presence_get_buffer_size

Returns
  true if successful, false otherwise

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_process()

bool acc_detector_presence_process | ( | acc_detector_presence_handle_t * | presence_handle,
|  | void * | buffer,
|  | acc_detector_presence_result_t * | result
| ) |  |

Process the data according to the configuration used in acc_detector_presence_config_create.

Parameters

  [in] | presence_handle | The presence detector handle for the presence detector to get the next result for
  [in] | buffer | A reference to the buffer (populated by acc_sensor_read) containing the data to be processed. After this function returns, the depthwise inter/intra presence that is part of the result (acc_detector_presence_result_t) will point to memory located in this buffer. If these arrays are of interest for the application they need to be processed before the buffer is used in any other function.
  [out] | result | Presence detector results

Returns
  true if successful, otherwise false

Examples
  example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, and example_detector_presence_with_iq_data_print.c.

## ◆ acc_detector_presence_reset_filters()

void acc_detector_presence_reset_filters | ( | const acc_detector_presence_handle_t * | presence_handle | ) |

Reset internal filters.

This is the same operation that is performed on every prepare if "reset filters on prepare" is set to true See acc_detector_presence_config_reset_filters_on_prepare_set.

Parameters

  [in] | presence_handle | The presence detector handle for which to reset filters