![]() |
SparkFun Pulsed Coherent Radar Sensor
v2.0.0-3-g4d2d89c
Library for the SparkFun Pulsed Coherent Radar Sensor
|
Implementation of the SparkFun Qwiic XM125 Library - Methods for the Distance app. More...
#include "sfDevXM125Core.h"
Go to the source code of this file.
Classes | |
struct | sfe_xm125_distance_version_t |
struct | sfe_xm125_distance_protocol_status_t |
struct | sfe_xm125_distance_detector_status_t |
struct | sfe_xm125_distance_result_t |
class | sfDevXM125Distance |
Enumerations | |
enum | sfe_xm125_distance_profile_t { XM125_DISTANCE_PROFILE1 = 1 , XM125_DISTANCE_PROFILE2 = 2 , XM125_DISTANCE_PROFILE3 = 3 , XM125_DISTANCE_PROFILE4 = 4 , XM125_DISTANCE_PROFILE5 = 5 } |
enum | sfe_xm125_distance_threshold_method_t { XM125_DISTANCE_FIXED_AMPLITUDE = 1 , XM125_DISTANCE_RECORDED = 2 , XM125_DISTANCE_CFAR = 3 , XM125_DISTANCE_FIXED_STRENGTH = 4 } |
enum | sfe_xm125_distance_peak_sorting_t { XM125_DISTANCE_CLOSEST = 1 , XM125_DISTANCE_STRONGEST = 2 } |
enum | sfe_xm125_distance_reflector_shape_t { XM125_DISTANCE_GENERIC = 1 , XM125_DISTANCE_PLANAR = 2 } |
enum | sfe_xm125_distance_command_t { XM125_DISTANCE_APPLY_CONFIG_AND_CALIBRATE = 1 , XM125_DISTANCE_MEASURE_DISTANCE = 2 , XM125_DISTANCE_APPLY_CONFIGURATION = 3 , XM125_DISTANCE_CALIBRATE = 4 , XM125_DISTANCE_RECALIBRATE = 5 , XM125_DISTANCE_ENABLE_UART_LOGS = 32 , XM125_DISTANCE_DISABLE_UART_LOGS = 33 , XM125_DISTANCE_LOG_CONFIGURATION = 34 , XM125_DISTANCE_RESET_MODULE = 1381192737 } |
Implementation of the SparkFun Qwiic XM125 Library - Methods for the Distance app.
Header of the SparkFun Qwiic XM125 Library.
This file contains the implementation methods for the distance detection functionality. This is done using a template, which is then paired with the core class to provide the desired functionality.
For this paying attention - yes, this is an example of Curiously Recurring Template Pattern (CRTP) design pattern - https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/
SPDX-License-Identifier: MIT
This file contains the header the Distance Application object
SPDX-License-Identifier: MIT
const uint32_t SFE_XM125_DISTANCE_ALL_ERROR_MASK |
const uint32_t SFE_XM125_DISTANCE_APPLY_CONFIGURATION = 1 |
const uint32_t SFE_XM125_DISTANCE_BUSY_MASK = 0x80000000 |
const uint32_t SFE_XM125_DISTANCE_BUSY_MASK_SHIFT = 30 |
const uint32_t SFE_XM125_DISTANCE_CALIBRATE = 4 |
const uint32_t SFE_XM125_DISTANCE_CALIBRATION_BUFFER_ERROR_MASK = 0x00400000 |
const uint32_t SFE_XM125_DISTANCE_CALIBRATION_BUFFER_ERROR_MASK_SHIFT = 21 |
const uint32_t SFE_XM125_DISTANCE_CALIBRATION_BUFFER_OK_MASK = 0x00000040 |
const uint32_t SFE_XM125_DISTANCE_CALIBRATION_NEEDED_MASK = 0x00000200 |
const uint32_t SFE_XM125_DISTANCE_CALIBRATION_NEEDED_MASK_SHIFT = 9 |
const uint16_t SFE_XM125_DISTANCE_CLOSE_RANGE_LEAKAGE = 0x43 |
const bool sfe_xm125_distance_close_range_leakage_default = true |
const uint16_t SFE_XM125_DISTANCE_COMMAND = 0x100 |
const uint32_t SFE_XM125_DISTANCE_CONFIG_APPLY_ERROR_MASK = 0x00800000 |
const uint32_t SFE_XM125_DISTANCE_CONFIG_APPLY_ERROR_MASK_SHIFT = 22 |
const uint32_t SFE_XM125_DISTANCE_CONFIG_APPLY_OK_MASK = 0x00000080 |
const uint32_t SFE_XM125_DISTANCE_CONFIG_CREATE_ERROR_MASK = 0x00020000 |
const uint32_t SFE_XM125_DISTANCE_CONFIG_CREATE_ERROR_MASK_SHIFT = 16 |
const uint32_t SFE_XM125_DISTANCE_CONFIG_CREATE_OK_MASK = 0x00000002 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_BUFFER_ERROR_MASK = 0x00100000 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_BUFFER_ERROR_MASK_SHIFT = 19 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_BUFFER_OK_MASK = 0x00000010 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_CALIBRATE_ERROR_MASK = 0x02000000 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_CALIBRATE_ERROR_MASK_SHIFT = 24 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_CALIBRATE_OK_MASK = 0x00000200 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_CREATE_ERROR_MASK = 0x00080000 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_CREATE_ERROR_MASK_SHIFT = 18 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_CREATE_OK_MASK = 0x00000008 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_ERROR_MASK = 0x10000000 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_ERROR_MASK_SHIFT = 27 |
const uint16_t SFE_XM125_DISTANCE_DETECTOR_STATUS = 0x03 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_STATUS_MASK = 0b10010000111111110000000011111111 |
const uint32_t SFE_XM125_DISTANCE_DETECTOR_STATUS_MASK_SHIFT = 30 |
const uint32_t SFE_XM125_DISTANCE_DISABLE_UART_LOGS = 33 |
const uint32_t SFE_XM125_DISTANCE_ENABLE_UART_LOGS = 32 |
const uint16_t SFE_XM125_DISTANCE_END = 0x41 |
const uint16_t sfe_xm125_distance_end_default = 3000 |
const uint32_t sfe_xm125_distance_fixed_amp_thresh_val_default = 100000 |
const uint16_t SFE_XM125_DISTANCE_FIXED_AMPLITUDE_THRESHOLD_VAL = 0x49 |
const uint16_t SFE_XM125_DISTANCE_FIXED_STRENGTH_THRESHOLD_VAL = 0x4c |
const uint16_t sfe_xm125_distance_fixed_strength_threshold_val_default = 0 |
const uint32_t SFE_XM125_DISTANCE_LOG_CONFIGURATION = 34 |
const uint32_t SFE_XM125_DISTANCE_MAJOR_VERSION_MASK = 0xffff0000 |
const uint32_t SFE_XM125_DISTANCE_MAJOR_VERSION_MASK_SHIFT = 16 |
const uint16_t SFE_XM125_DISTANCE_MAX_PROFILE = 0x45 |
const uint16_t SFE_XM125_DISTANCE_MAX_STEP_LENGTH = 0x42 |
const uint16_t sfe_xm125_distance_max_step_length_default = 0 |
const uint16_t SFE_XM125_DISTANCE_MEASURE_COUNTER = 0x02 |
const uint32_t SFE_XM125_DISTANCE_MEASURE_DISTANCE_ERROR_MASK = 0x00000400 |
const uint32_t SFE_XM125_DISTANCE_MEASURE_DISTANCE_ERROR_MASK_SHIFT = 10 |
const uint16_t SFE_XM125_DISTANCE_MEASURE_ON_WAKEUP = 0x80 |
const bool sfe_xm125_distance_measure_on_wakup = false |
const uint32_t SFE_XM125_DISTANCE_MINOR_VERSION_MASK = 0x0000ff00 |
const uint32_t SFE_XM125_DISTANCE_MINOR_VERSION_MASK_SHIFT = 8 |
const uint32_t SFE_XM125_DISTANCE_NEAR_START_EDGE_MASK = 0x00000100 |
const uint32_t SFE_XM125_DISTANCE_NEAR_START_EDGE_MASK_SHIFT = 8 |
const uint16_t SFE_XM125_DISTANCE_NUM_FRAMES_RECORDED_THRESH = 0x48 |
const uint16_t sfe_xm125_distance_num_frames_recorded_thresh_default = 100 |
const uint32_t SFE_XM125_DISTANCE_NUMBER_DISTANCES_MASK = 0x0000000f |
const uint32_t SFE_XM125_DISTANCE_PATCH_VERSION_MASK = 0x000000ff |
const uint16_t SFE_XM125_DISTANCE_PEAK0_DISTANCE = 0x11 |
const uint16_t SFE_XM125_DISTANCE_PEAK0_STRENGTH = 0x1b |
const uint16_t SFE_XM125_DISTANCE_PEAK1_DISTANCE = 0x12 |
const uint16_t SFE_XM125_DISTANCE_PEAK1_STRENGTH = 0x1c |
const uint16_t SFE_XM125_DISTANCE_PEAK2_DISTANCE = 0x13 |
const uint16_t SFE_XM125_DISTANCE_PEAK2_STRENGTH = 0x1d |
const uint16_t SFE_XM125_DISTANCE_PEAK3_DISTANCE = 0x14 |
const uint16_t SFE_XM125_DISTANCE_PEAK3_STRENGTH = 0x1e |
const uint16_t SFE_XM125_DISTANCE_PEAK4_DISTANCE = 0x15 |
const uint16_t SFE_XM125_DISTANCE_PEAK4_STRENGTH = 0x1f |
const uint16_t SFE_XM125_DISTANCE_PEAK5_DISTANCE = 0x16 |
const uint16_t SFE_XM125_DISTANCE_PEAK5_STRENGTH = 0x20 |
const uint16_t SFE_XM125_DISTANCE_PEAK6_DISTANCE = 0x17 |
const uint16_t SFE_XM125_DISTANCE_PEAK6_STRENGTH = 0x21 |
const uint16_t SFE_XM125_DISTANCE_PEAK7_DISTANCE = 0x18 |
const uint16_t SFE_XM125_DISTANCE_PEAK7_STRENGTH = 0x22 |
const uint16_t SFE_XM125_DISTANCE_PEAK8_DISTANCE = 0x19 |
const uint16_t SFE_XM125_DISTANCE_PEAK8_STRENGTH = 0x23 |
const uint16_t SFE_XM125_DISTANCE_PEAK9_DISTANCE = 0x1a |
const uint16_t SFE_XM125_DISTANCE_PEAK9_STRENGTH = 0x24 |
const uint16_t SFE_XM125_DISTANCE_PEAK_SORTING = 0x47 |
const uint16_t SFE_XM125_DISTANCE_PROTOCOL_STATUS = 0x01 |
const uint32_t SFE_XM125_DISTANCE_RECALIBRATE = 5 |
const uint16_t SFE_XM125_DISTANCE_REFLECTOR_SHAPE = 0x4b |
const uint32_t SFE_XM125_DISTANCE_RESET_MODULE = 1381192737 |
const uint16_t SFE_XM125_DISTANCE_RESULT = 0x10 |
const uint32_t SFE_XM125_DISTANCE_RSS_REGISTER_ERROR_MASK = 0x00010000 |
const uint32_t SFE_XM125_DISTANCE_RSS_REGISTER_ERROR_MASK_SHIFT = 15 |
const uint32_t SFE_XM125_DISTANCE_RSS_REGISTER_OK_MASK = 0x00000001 |
const uint32_t SFE_XM125_DISTANCE_SENSOR_BUFFER_ERROR_MASK = 0x00200000 |
const uint32_t SFE_XM125_DISTANCE_SENSOR_BUFFER_ERROR_MASK_SHIFT = 20 |
const uint32_t SFE_XM125_DISTANCE_SENSOR_BUFFER_OK_MASK = 0x00000020 |
const uint32_t SFE_XM125_DISTANCE_SENSOR_CALIBRATE_ERROR_MASK = 0x01000000 |
const uint32_t SFE_XM125_DISTANCE_SENSOR_CALIBRATE_ERROR_MASK_SHIFT = 23 |
const uint32_t SFE_XM125_DISTANCE_SENSOR_CALIBRATE_OK_MASK = 0x00000100 |
const uint32_t SFE_XM125_DISTANCE_SENSOR_CREATE_ERROR_MASK = 0x00040000 |
const uint32_t SFE_XM125_DISTANCE_SENSOR_CREATE_ERROR_MASK_SHIFT = 17 |
const uint32_t SFE_XM125_DISTANCE_SENSOR_CREATE_OK_MASK = 0x00000004 |
const uint16_t SFE_XM125_DISTANCE_SIGNAL_QUALITY = 0x44 |
const uint16_t sfe_xm125_distance_signal_quality_default = 15000 |
const uint16_t SFE_XM125_DISTANCE_START = 0x40 |
const uint16_t sfe_xm125_distance_start_default = 250 |
const uint32_t SFE_XM125_DISTANCE_START_DETECTOR = 2 |
const uint32_t SFE_XM125_DISTANCE_STOP_DETECTOR = 3 |
const uint32_t SFE_XM125_DISTANCE_TEMPERATURE_MASK = 0xffff0000 |
const uint32_t SFE_XM125_DISTANCE_TEMPERATURE_MASK_SHIFT = 16 |
const uint16_t SFE_XM125_DISTANCE_THREHSOLD_SENSITIVITY = 0x4a |
const uint16_t SFE_XM125_DISTANCE_THRESHOLD_METHOD = 0x46 |
const uint16_t sfe_xm125_distance_threshold_sensitivity_default = 500 |
const uint16_t SFE_XM125_DISTANCE_VERSION = 0x00 |