Functions
distance_reg_protocol_access.c File Reference
`#include <stdbool.h>`
`#include <stdint.h>`
`#include "acc_detector_distance.h"`
`#include "acc_detector_distance_definitions.h"`
`#include "acc_integration.h"`
`#include "acc_version.h"`
`#include "acc_reg_protocol.h"`
`#include "distance_reg_protocol.h"`
`#include "i2c_distance_detector.h"`

Go to the source code of this file.

## Functions
static uint32_t | get_protocol_error_flags (void)
| Get the protocol error status flags. More...
static uint32_t | get_peak_distance (uint16_t peak_id)
| Get peak distance. More...
static uint32_t | get_peak_strength (uint16_t peak_id)
| Get peak strength. More...
void | distance_reg_read_application_id (uint32_t *value)
void | distance_reg_read_version (uint32_t *value)
void | distance_reg_read_protocol_status (uint32_t *value)
void | distance_reg_read_measure_counter (uint32_t *value)
void | distance_reg_read_detector_status (uint32_t *value)
void | distance_reg_read_distance_result (uint32_t *value)
void | distance_reg_read_peak0_distance (uint32_t *value)
void | distance_reg_read_peak1_distance (uint32_t *value)
void | distance_reg_read_peak2_distance (uint32_t *value)
void | distance_reg_read_peak3_distance (uint32_t *value)
void | distance_reg_read_peak4_distance (uint32_t *value)
void | distance_reg_read_peak5_distance (uint32_t *value)
void | distance_reg_read_peak6_distance (uint32_t *value)
void | distance_reg_read_peak7_distance (uint32_t *value)
void | distance_reg_read_peak8_distance (uint32_t *value)
void | distance_reg_read_peak9_distance (uint32_t *value)
void | distance_reg_read_peak0_strength (uint32_t *value)
void | distance_reg_read_peak1_strength (uint32_t *value)
void | distance_reg_read_peak2_strength (uint32_t *value)
void | distance_reg_read_peak3_strength (uint32_t *value)
void | distance_reg_read_peak4_strength (uint32_t *value)
void | distance_reg_read_peak5_strength (uint32_t *value)
void | distance_reg_read_peak6_strength (uint32_t *value)
void | distance_reg_read_peak7_strength (uint32_t *value)
void | distance_reg_read_peak8_strength (uint32_t *value)
void | distance_reg_read_peak9_strength (uint32_t *value)
void | distance_reg_read_start (uint32_t *value)
bool | distance_reg_write_start (const uint32_t value)
void | distance_reg_read_end (uint32_t *value)
bool | distance_reg_write_end (const uint32_t value)
void | distance_reg_read_max_step_length (uint32_t *value)
bool | distance_reg_write_max_step_length (const uint32_t value)
void | distance_reg_read_close_range_leakage_cancellation (uint32_t *value)
bool | distance_reg_write_close_range_leakage_cancellation (const uint32_t value)
void | distance_reg_read_signal_quality (uint32_t *value)
bool | distance_reg_write_signal_quality (const uint32_t value)
void | distance_reg_read_max_profile (uint32_t *value)
bool | distance_reg_write_max_profile (const uint32_t value)
void | distance_reg_read_threshold_method (uint32_t *value)
bool | distance_reg_write_threshold_method (const uint32_t value)
void | distance_reg_read_peak_sorting (uint32_t *value)
bool | distance_reg_write_peak_sorting (const uint32_t value)
void | distance_reg_read_num_frames_recorded_threshold (uint32_t *value)
bool | distance_reg_write_num_frames_recorded_threshold (const uint32_t value)
void | distance_reg_read_fixed_amplitude_threshold_value (uint32_t *value)
bool | distance_reg_write_fixed_amplitude_threshold_value (const uint32_t value)
void | distance_reg_read_fixed_strength_threshold_value (uint32_t *value)
bool | distance_reg_write_fixed_strength_threshold_value (const uint32_t value)
void | distance_reg_read_threshold_sensitivity (uint32_t *value)
bool | distance_reg_write_threshold_sensitivity (const uint32_t value)
void | distance_reg_read_reflector_shape (uint32_t *value)
bool | distance_reg_write_reflector_shape (const uint32_t value)
void | distance_reg_read_measure_on_wakeup (uint32_t *value)
bool | distance_reg_write_measure_on_wakeup (const uint32_t value)
bool | distance_reg_write_command (const uint32_t value)

## Function Documentation

## ◆ distance_reg_read_application_id()

void distance_reg_read_application_id | ( | uint32_t * | value | ) |

Read: The application id register.

Definition at line 55 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_close_range_leakage_cancellation()

void distance_reg_read_close_range_leakage_cancellation | ( | uint32_t * | value | ) |

Read: Enable the close range leakage cancellation logic.

Definition at line 312 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_detector_status()

void distance_reg_read_detector_status | ( | uint32_t * | value | ) |

Read: Get detector status flags.

Definition at line 107 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_distance_result()

void distance_reg_read_distance_result | ( | uint32_t * | value | ) |

Read: The result from the distance detector.

Definition at line 113 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_end()

void distance_reg_read_end | ( | uint32_t * | value | ) |

Read: The end of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 264 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_fixed_amplitude_threshold_value()

void distance_reg_read_fixed_amplitude_threshold_value | ( | uint32_t * | value | ) |

Read: Fixed amplitude threshold value Note: This value is a factor 1000 larger than the RSS value.

Definition at line 578 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_fixed_strength_threshold_value()

void distance_reg_read_fixed_strength_threshold_value | ( | uint32_t * | value | ) |

Read: Fixed strength threshold value Note: This value is a factor 1000 larger than the RSS value.

Definition at line 603 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_max_profile()

void distance_reg_read_max_profile | ( | uint32_t * | value | ) |

Read: Max profile.

Definition at line 360 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_max_step_length()

void distance_reg_read_max_step_length | ( | uint32_t * | value | ) |

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

Definition at line 289 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_measure_counter()

void distance_reg_read_measure_counter | ( | uint32_t * | value | ) |

Read: Get the measure counter, the number of measurements performed since restart.

Definition at line 101 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_measure_on_wakeup()

void distance_reg_read_measure_on_wakeup | ( | uint32_t * | value | ) |

Read: Perform measure on wake up.

Definition at line 708 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_num_frames_recorded_threshold()

void distance_reg_read_num_frames_recorded_threshold | ( | uint32_t * | value | ) |

Read: The number frames to use for recorded threshold.

Definition at line 555 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak0_distance()

void distance_reg_read_peak0_distance | ( | uint32_t * | value | ) |

Read: The distance to peak 0. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 119 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak0_strength()

void distance_reg_read_peak0_strength | ( | uint32_t * | value | ) |

Read: The reflective strength of peak 0. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 179 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak1_distance()

void distance_reg_read_peak1_distance | ( | uint32_t * | value | ) |

Read: The distance to peak 1. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 125 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak1_strength()

void distance_reg_read_peak1_strength | ( | uint32_t * | value | ) |

Read: The reflective strength of peak 1. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 185 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak2_distance()

void distance_reg_read_peak2_distance | ( | uint32_t * | value | ) |

Read: The distance to peak 2. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 131 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak2_strength()

void distance_reg_read_peak2_strength | ( | uint32_t * | value | ) |

Read: The reflective strength of peak 2. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 191 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak3_distance()

void distance_reg_read_peak3_distance | ( | uint32_t * | value | ) |

Read: The distance to peak 3. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 137 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak3_strength()

void distance_reg_read_peak3_strength | ( | uint32_t * | value | ) |

Read: The reflective strength of peak 3. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 197 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak4_distance()

void distance_reg_read_peak4_distance | ( | uint32_t * | value | ) |

Read: The distance to peak 4. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 143 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak4_strength()

void distance_reg_read_peak4_strength | ( | uint32_t * | value | ) |

Read: The reflective strength of peak 4. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 203 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak5_distance()

void distance_reg_read_peak5_distance | ( | uint32_t * | value | ) |

Read: The distance to peak 5. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 149 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak5_strength()

void distance_reg_read_peak5_strength | ( | uint32_t * | value | ) |

Read: The reflective strength of peak 5. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 209 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak6_distance()

void distance_reg_read_peak6_distance | ( | uint32_t * | value | ) |

Read: The distance to peak 6. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 155 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak6_strength()

void distance_reg_read_peak6_strength | ( | uint32_t * | value | ) |

Read: The reflective strength of peak 6. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 215 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak7_distance()

void distance_reg_read_peak7_distance | ( | uint32_t * | value | ) |

Read: The distance to peak 7. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 161 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak7_strength()

void distance_reg_read_peak7_strength | ( | uint32_t * | value | ) |

Read: The reflective strength of peak 7. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 221 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak8_distance()

void distance_reg_read_peak8_distance | ( | uint32_t * | value | ) |

Read: The distance to peak 8. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 167 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak8_strength()

void distance_reg_read_peak8_strength | ( | uint32_t * | value | ) |

Read: The reflective strength of peak 8. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 227 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak9_distance()

void distance_reg_read_peak9_distance | ( | uint32_t * | value | ) |

Read: The distance to peak 9. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 173 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak9_strength()

void distance_reg_read_peak9_strength | ( | uint32_t * | value | ) |

Read: The reflective strength of peak 9. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 233 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_peak_sorting()

void distance_reg_read_peak_sorting | ( | uint32_t * | value | ) |

Read: Peak sorting method.

Definition at line 500 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_protocol_status()

void distance_reg_read_protocol_status | ( | uint32_t * | value | ) |

Read: Get protocol error flags.

Definition at line 67 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_reflector_shape()

void distance_reg_read_reflector_shape | ( | uint32_t * | value | ) |

Read: Reflector shape.

Definition at line 653 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_signal_quality()

void distance_reg_read_signal_quality | ( | uint32_t * | value | ) |

Read: High signal quality results in a better SNR (because of higher HWAAS) and higher power consumption. Note:This value is a factor 1000 larger than the RSS value.

Definition at line 335 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_start()

void distance_reg_read_start | ( | uint32_t * | value | ) |

Read: The start of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 239 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_threshold_method()

void distance_reg_read_threshold_method | ( | uint32_t * | value | ) |

Read: Threshold method.

Definition at line 433 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_threshold_sensitivity()

void distance_reg_read_threshold_sensitivity | ( | uint32_t * | value | ) |

Read: Threshold sensitivity (0 <= sensitivity <= 1000) Note: This value is a factor 1000 larger than the RSS value.

Definition at line 628 of file distance_reg_protocol_access.c.

## ◆ distance_reg_read_version()

void distance_reg_read_version | ( | uint32_t * | value | ) |

Read: Get the RSS version.

Definition at line 61 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_close_range_leakage_cancellation()

bool distance_reg_write_close_range_leakage_cancellation | ( | const uint32_t | value | ) |

Write: Enable the close range leakage cancellation logic.

Definition at line 320 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_command()

bool distance_reg_write_command | ( | const uint32_t | value | ) |

Write: Execute command.

Definition at line 731 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_end()

bool distance_reg_write_end | ( | const uint32_t | value | ) |

Write: The end of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 273 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_fixed_amplitude_threshold_value()

bool distance_reg_write_fixed_amplitude_threshold_value | ( | const uint32_t | value | ) |

Write: Fixed amplitude threshold value Note: This value is a factor 1000 larger than the RSS value.

Definition at line 587 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_fixed_strength_threshold_value()

bool distance_reg_write_fixed_strength_threshold_value | ( | const uint32_t | value | ) |

Write: Fixed strength threshold value Note: This value is a factor 1000 larger than the RSS value.

Definition at line 612 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_max_profile()

bool distance_reg_write_max_profile | ( | const uint32_t | value | ) |

Write: Max profile.

Definition at line 391 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_max_step_length()

bool distance_reg_write_max_step_length | ( | const uint32_t | value | ) |

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

Definition at line 297 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_measure_on_wakeup()

bool distance_reg_write_measure_on_wakeup | ( | const uint32_t | value | ) |

Write: Perform measure on wake up.

Definition at line 721 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_num_frames_recorded_threshold()

bool distance_reg_write_num_frames_recorded_threshold | ( | const uint32_t | value | ) |

Write: The number frames to use for recorded threshold.

Definition at line 563 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_peak_sorting()

bool distance_reg_write_peak_sorting | ( | const uint32_t | value | ) |

Write: Peak sorting method.

Definition at line 522 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_reflector_shape()

bool distance_reg_write_reflector_shape | ( | const uint32_t | value | ) |

Write: Reflector shape.

Definition at line 675 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_signal_quality()

bool distance_reg_write_signal_quality | ( | const uint32_t | value | ) |

Write: High signal quality results in a better SNR (because of higher HWAAS) and higher power consumption. Note:This value is a factor 1000 larger than the RSS value.

Definition at line 344 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_start()

bool distance_reg_write_start | ( | const uint32_t | value | ) |

Write: The start of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value.

Definition at line 248 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_threshold_method()

bool distance_reg_write_threshold_method | ( | const uint32_t | value | ) |

Write: Threshold method.

Definition at line 461 of file distance_reg_protocol_access.c.

## ◆ distance_reg_write_threshold_sensitivity()

bool distance_reg_write_threshold_sensitivity | ( | const uint32_t | value | ) |

Write: Threshold sensitivity (0 <= sensitivity <= 1000) Note: This value is a factor 1000 larger than the RSS value.

Definition at line 637 of file distance_reg_protocol_access.c.

## ◆ get_peak_distance()

static uint32_t get_peak_distance | ( | uint16_t | peak_id | ) |
| static

Get peak distance.

This function will return the peak distance in mm

Parameters

  [in] | peak_id | The index of the peak

Returns
  The uint32 value representation of the peak distance

Definition at line 755 of file distance_reg_protocol_access.c.

## ◆ get_peak_strength()

static uint32_t get_peak_strength | ( | uint16_t | peak_id | ) |
| static

Get peak strength.

This function will return the peak distance in dB * 1000

Parameters

  [in] | peak_id | The index of the peak

Returns
  The int32 value representation of the peak strength

Definition at line 763 of file distance_reg_protocol_access.c.

## ◆ get_protocol_error_flags()

static uint32_t get_protocol_error_flags | ( | void |  | ) |
| static

Get the protocol error status flags.

Returns
  error flags as uint32 register value

Definition at line 742 of file distance_reg_protocol_access.c.