SparkFun Pulsed Coherent Radar Sensor  v2.0.0-3-g4d2d89c
Library for the SparkFun Pulsed Coherent Radar Sensor
Loading...
Searching...
No Matches
sfDevXM125Distance Class Reference

#include <sfDevXM125Distance.h>

Inheritance diagram for sfDevXM125Distance:

Public Member Functions

sfTkError_t begin (sfTkII2C *theBus=nullptr)
 Initializes the distance detector device. More...
 
sfTkError_t distanceSetup (uint32_t start=sfe_xm125_distance_start_default, uint32_t end=sfe_xm125_distance_end_default)
 This function sets all the beginning values for a basic I2C example to be run on the device for presence sensing. More...
 
sfTkError_t detectorReadingSetup ()
 This function does all the required checks and busy waits to make sure the device is ready for distance readings. More...
 
sfTkError_t getDetectorVersion (uint32_t &major, uint32_t &minor, uint32_t &patch)
 This function returns the version number of the device structure: major.minor.patch. More...
 
sfTkError_t getDetectorError (uint32_t &error)
 This function returns if there was an error from the protocol status register. More...
 
sfTkError_t getDetectorErrorStatus (uint32_t &status)
 This function returns the error status according to the bit mask value for the distance devices errors and busy bit. More...
 
sfTkError_t getMeasureCounter (uint32_t &counter)
 This function returns the measure counter, the number of measurements performed since restart. More...
 
sfTkError_t getDetectorStatus (uint32_t &status)
 This function returns the status of the device if there are any issues with any of the status's listed defined. More...
 
sfTkError_t getNumberDistances (uint32_t &distance)
 This function returns the number of detected distances. More...
 
sfTkError_t getNearStartEdge (uint32_t &edge)
 This function returns the indication that there might be an object near the start point of the measured range. More...
 
sfTkError_t getCalibrationNeeded (uint32_t &calibrate)
 This function returns the indication of a sensor calibration needed. More...
 
sfTkError_t getMeasureDistanceError (uint32_t &error)
 This function returns if the measure command failed. More...
 
sfTkError_t getTemperature (int16_t &temperature)
 This function returns the temperature in sensor during measurements (in degree Celsius). Note that it has poor absolute accuracy and should only be used for relative temperature measurements. More...
 
sfTkError_t getPeakDistance (uint8_t num, uint32_t &peak)
 This function returns the distance to peak num Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak0Distance (uint32_t &peak)
 This function returns the distance to peak 0 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak1Distance (uint32_t &peak)
 This function returns the distance to peak 1 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak2Distance (uint32_t &peak)
 This function returns the distance to peak 2 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak3Distance (uint32_t &peak)
 This function returns the distance to peak 3 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak4Distance (uint32_t &peak)
 This function returns the distance to peak 4 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak5Distance (uint32_t &peak)
 This function returns the distance to peak 5 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak6Distance (uint32_t &peak)
 This function returns the distance to peak 6 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak7Distance (uint32_t &peak)
 This function returns the distance to peak 7 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak8Distance (uint32_t &peak)
 This function returns the distance to peak 8 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak9Distance (uint32_t &peak)
 This function returns the distance to peak 9 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeakStrength (uint8_t num, int32_t &peak)
 This function returns the strength to peak num Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak0Strength (int32_t &peak)
 This function returns the strength of peak 0 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak1Strength (int32_t &peak)
 This function returns the strength of peak 1 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak2Strength (int32_t &peak)
 This function returns the strength of peak 2 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak3Strength (int32_t &peak)
 This function returns the strength of peak 3 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak4Strength (int32_t &peak)
 This function returns the strength of peak 4 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak5Strength (int32_t &peak)
 This function returns the strength of peak 5 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak6Strength (int32_t &peak)
 This function returns the strength of peak 6 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak7Strength (int32_t &peak)
 This function returns the strength of peak 7 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak8Strength (int32_t &peak)
 This function returns the strength of peak 8 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getPeak9Strength (int32_t &peak)
 This function returns the strength of peak 9 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getStart (uint32_t &startVal)
 This function returns the start of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value Default Value: 250. More...
 
sfTkError_t setStart (uint32_t start)
 This function sets the start of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value Default Value: 250. More...
 
sfTkError_t getEnd (uint32_t &end)
 This function returns the end of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value Default Value: 3000. More...
 
sfTkError_t setEnd (uint32_t end)
 This function sets the end of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value Default Value: 3000. More...
 
sfTkError_t getMaxStepLength (uint32_t &length)
 This function returns the used to limit step length. If set to 0 (default), the step length is calculated based on profile. Default Value: 0. More...
 
sfTkError_t setMaxStepLength (uint32_t length)
 This function sets the used to limit step length. If set to 0 (default), the step length is calculated based on profile. Default Value: 0. More...
 
sfTkError_t getCloseRangeLeakageCancellation (bool &range)
 This function reads if the close range leakage cancellation logic is enabled. Default Value: true. More...
 
sfTkError_t setCloseRangeLeakageCancellation (bool range)
 This function sets the close range leakage cancellation logic. Default Value: true. More...
 
sfTkError_t getSignalQuality (uint32_t &signal)
 This function returns the high signal quality in a better SNR (because of higher HWAAS) and higher power consumption. Note: This value is a factor 1000 larger than the RSS value Default Value: 15000. More...
 
sfTkError_t setSignalQuality (uint32_t signal)
 This function sets the high signal quality in a better SNR (because of higher HWAAS) and higher power consumption. Note: This value is a factor 1000 larger than the RSS value Default Value: 15000. More...
 
sfTkError_t getMaxProfile (uint32_t &profile)
 This function returns the max profile of the device. Default value = PROFILE5. More...
 
sfTkError_t setMaxProfile (uint32_t profile)
 This function sets the max profile of the device Default value = PROFILE5. More...
 
sfTkError_t getThresholdMethod (uint32_t &method)
 This function returns the threshold method. More...
 
sfTkError_t setThresholdMethod (uint32_t method)
 This function sets the threshold method. More...
 
sfTkError_t getPeakSorting (uint32_t &peak)
 This function returns the peak sorting method. More...
 
sfTkError_t setPeakSorting (uint32_t peak)
 This function sets the peak sorting method. More...
 
sfTkError_t getNumFramesRecordedThreshold (uint32_t &thresh)
 This function returns the number frames to use for recorded threshold. Default Value: 100. More...
 
sfTkError_t setNumFramesRecordedThreshold (uint32_t thresh)
 This function sets the number frames to use for recorded threshold. Default Value: 100. More...
 
sfTkError_t getFixedAmpThreshold (uint32_t &thresh)
 This function returns the fixed amplitude threshold value. Note: This value is a factor 1000 larger than the RSS value Default Value: 100000. More...
 
sfTkError_t setFixedAmpThreshold (uint32_t thresh)
 This function sets the fixed amplitude threshold value. Note: This value is a factor 1000 larger than the RSS value Default Value: 100000. More...
 
sfTkError_t getThresholdSensitivity (uint32_t &thresh)
 This function returns the threshold sensitivity (0 <= sensitivity <= 1000) Note: This value is a factor 1000 larger than the RSS value Default Value: 500. More...
 
sfTkError_t setThresholdSensitivity (uint32_t thresh)
 This function sets the threshold sensitivity (0 <= sensitivity <= 1000) Note: This value is a factor 1000 larger than the RSS value Default Value: 500. More...
 
sfTkError_t getReflectorShape (uint32_t &shape)
 This function returns the reflector shape Default Value: GENERIC. More...
 
sfTkError_t setReflectorShape (uint32_t shape)
 This function sets the reflector shape Default Value: GENERIC. More...
 
sfTkError_t getFixedStrengthThresholdValue (int32_t &thresh)
 This function returns the fixed strength threshold value. Default Value: 0 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t setFixedStrengthThresholdValue (int32_t thresh)
 This function sets the fixed strength threshold value. Default Value: 0 Note: This value is a factor 1000 larger than the RSS value. More...
 
sfTkError_t getMeasureOneWakeup (bool &measure)
 This function returns the measure on wakeup status. Default Value: false. More...
 
sfTkError_t setMeasureOneWakeup (bool measure)
 This function sets the measure on wakeup status. Default Value: false. More...
 
sfTkError_t setCommand (uint32_t command)
 This function sets the specific execute command as defined in the datasheet on Page 25, Section 6.2.40 Command. More...
 
sfTkError_t applyConfiguration ()
 This function applies the configuration to the device by writing the defined value to the distance command register. More...
 
sfTkError_t start ()
 This function starts the device by writing the defined start value to the distance command register. More...
 
sfTkError_t stop ()
 This function stops the device by writing the defined stop value to the distance command register. More...
 
sfTkError_t calibrate ()
 This function calibrates the device by writing the defined calibration value to the distance command register. More...
 
sfTkError_t recalibrate ()
 This function recalibrates the device by writing the defined recalibrate value to the distance command register. More...
 
sfTkError_t enableUartLogs ()
 This function enables the uart logs of the device by writing the defined value to the distance command register. More...
 
sfTkError_t disableUartLogs ()
 This function disables the uart logs of the device by writing the defined value to the distance command register. More...
 
sfTkError_t logConfiguration ()
 This function enables the configuration log of the device by writing the defined value to the distance command register. More...
 
sfTkError_t reset ()
 This function resets the distance detector settings of the device. More...
 
sfTkError_t busyWait ()
 Completes a busy wait loop while the device is uploading information by waiting for the status. More...
 
sfTkError_t init (sfTkII2C *theBus=nullptr)
 This function begins the examples/communication. More...
 

Protected Attributes

sfTkII2C * _theBus
 

Member Function Documentation

◆ applyConfiguration()

sfTkError_t sfDevXM125Distance::applyConfiguration ( )

This function applies the configuration to the device by writing the defined value to the distance command register.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ begin()

sfTkError_t sfDevXM125Distance::begin ( sfTkII2C *  theBus = nullptr)

Initializes the distance detector device.

This function sets up the I2C communication and performs initial checks to ensure the device is ready for operation.

Parameters
theBusPointer to the I2C bus object. If nullptr, the default bus is used.
Returns
ksfTkErrOk on success, or error code (value < -1) on failure.

◆ busyWait()

sfTkError_t sfDevXM125Distance::busyWait ( )

Completes a busy wait loop while the device is uploading information by waiting for the status.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ calibrate()

sfTkError_t sfDevXM125Distance::calibrate ( )

This function calibrates the device by writing the defined calibration value to the distance command register.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ detectorReadingSetup()

int32_t sfDevXM125Distance::detectorReadingSetup ( )

This function does all the required checks and busy waits to make sure the device is ready for distance readings.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ disableUartLogs()

sfTkError_t sfDevXM125Distance::disableUartLogs ( )

This function disables the uart logs of the device by writing the defined value to the distance command register.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ distanceSetup()

int32_t sfDevXM125Distance::distanceSetup ( uint32_t  start = sfe_xm125_distance_start_default,
uint32_t  end = sfe_xm125_distance_end_default 
)

This function sets all the beginning values for a basic I2C example to be run on the device for presence sensing.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ enableUartLogs()

sfTkError_t sfDevXM125Distance::enableUartLogs ( )

This function enables the uart logs of the device by writing the defined value to the distance command register.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getCalibrationNeeded()

sfTkError_t sfDevXM125Distance::getCalibrationNeeded ( uint32_t &  calibrate)

This function returns the indication of a sensor calibration needed.

Parameters
calibrateFlag to indicate calibration required
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getCloseRangeLeakageCancellation()

sfTkError_t sfDevXM125Distance::getCloseRangeLeakageCancellation ( bool &  range)

This function reads if the close range leakage cancellation logic is enabled. Default Value: true.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getDetectorError()

sfTkError_t sfDevXM125Distance::getDetectorError ( uint32_t &  error)

This function returns if there was an error from the protocol status register.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getDetectorErrorStatus()

sfTkError_t sfDevXM125Distance::getDetectorErrorStatus ( uint32_t &  status)

This function returns the error status according to the bit mask value for the distance devices errors and busy bit.

Parameters
statusError status of device (see function for exact error)
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getDetectorStatus()

sfTkError_t sfDevXM125Distance::getDetectorStatus ( uint32_t &  status)

This function returns the status of the device if there are any issues with any of the status's listed defined.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getDetectorVersion()

sfTkError_t sfDevXM125Distance::getDetectorVersion ( uint32_t &  major,
uint32_t &  minor,
uint32_t &  patch 
)

This function returns the version number of the device structure: major.minor.patch.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getEnd()

sfTkError_t sfDevXM125Distance::getEnd ( uint32_t &  end)

This function returns the end of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value Default Value: 3000.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getFixedAmpThreshold()

sfTkError_t sfDevXM125Distance::getFixedAmpThreshold ( uint32_t &  thresh)

This function returns the fixed amplitude threshold value. Note: This value is a factor 1000 larger than the RSS value Default Value: 100000.

Parameters
threshFixed amplitude threshold value
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getFixedStrengthThresholdValue()

sfTkError_t sfDevXM125Distance::getFixedStrengthThresholdValue ( int32_t &  thresh)

This function returns the fixed strength threshold value. Default Value: 0 Note: This value is a factor 1000 larger than the RSS value.

Parameters
threshfixed threshold strength value
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getMaxProfile()

sfTkError_t sfDevXM125Distance::getMaxProfile ( uint32_t &  profile)

This function returns the max profile of the device. Default value = PROFILE5.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getMaxStepLength()

sfTkError_t sfDevXM125Distance::getMaxStepLength ( uint32_t &  length)

This function returns the used to limit step length. If set to 0 (default), the step length is calculated based on profile. Default Value: 0.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getMeasureCounter()

sfTkError_t sfDevXM125Distance::getMeasureCounter ( uint32_t &  counter)

This function returns the measure counter, the number of measurements performed since restart.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getMeasureDistanceError()

sfTkError_t sfDevXM125Distance::getMeasureDistanceError ( uint32_t &  error)

This function returns if the measure command failed.

Parameters
errorFlag to indicate measure command error
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getMeasureOneWakeup()

sfTkError_t sfDevXM125Distance::getMeasureOneWakeup ( bool &  measure)

This function returns the measure on wakeup status. Default Value: false.

Parameters
measureMeasure on wakeup occurrence
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getNearStartEdge()

sfTkError_t sfDevXM125Distance::getNearStartEdge ( uint32_t &  edge)

This function returns the indication that there might be an object near the start point of the measured range.

Parameters
edgeFlag to determine object in range
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getNumberDistances()

sfTkError_t sfDevXM125Distance::getNumberDistances ( uint32_t &  distance)

This function returns the number of detected distances.

Parameters
distanceNumber of detected distances
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getNumFramesRecordedThreshold()

sfTkError_t sfDevXM125Distance::getNumFramesRecordedThreshold ( uint32_t &  thresh)

This function returns the number frames to use for recorded threshold. Default Value: 100.

Parameters
threshNumber of frames
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak0Distance()

sfTkError_t sfDevXM125Distance::getPeak0Distance ( uint32_t &  peak)

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

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak0Strength()

sfTkError_t sfDevXM125Distance::getPeak0Strength ( int32_t &  peak)

This function returns the strength of peak 0 Note: This value is a factor 1000 larger than the RSS value.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak1Distance()

sfTkError_t sfDevXM125Distance::getPeak1Distance ( uint32_t &  peak)

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

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak1Strength()

sfTkError_t sfDevXM125Distance::getPeak1Strength ( int32_t &  peak)

This function returns the strength of peak 1 Note: This value is a factor 1000 larger than the RSS value.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak2Distance()

sfTkError_t sfDevXM125Distance::getPeak2Distance ( uint32_t &  peak)

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

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak2Strength()

sfTkError_t sfDevXM125Distance::getPeak2Strength ( int32_t &  peak)

This function returns the strength of peak 2 Note: This value is a factor 1000 larger than the RSS value.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak3Distance()

sfTkError_t sfDevXM125Distance::getPeak3Distance ( uint32_t &  peak)

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

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak3Strength()

sfTkError_t sfDevXM125Distance::getPeak3Strength ( int32_t &  peak)

This function returns the strength of peak 3 Note: This value is a factor 1000 larger than the RSS value.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak4Distance()

sfTkError_t sfDevXM125Distance::getPeak4Distance ( uint32_t &  peak)

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

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak4Strength()

sfTkError_t sfDevXM125Distance::getPeak4Strength ( int32_t &  peak)

This function returns the strength of peak 4 Note: This value is a factor 1000 larger than the RSS value.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak5Distance()

sfTkError_t sfDevXM125Distance::getPeak5Distance ( uint32_t &  peak)

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

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak5Strength()

sfTkError_t sfDevXM125Distance::getPeak5Strength ( int32_t &  peak)

This function returns the strength of peak 5 Note: This value is a factor 1000 larger than the RSS value.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak6Distance()

sfTkError_t sfDevXM125Distance::getPeak6Distance ( uint32_t &  peak)

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

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak6Strength()

sfTkError_t sfDevXM125Distance::getPeak6Strength ( int32_t &  peak)

This function returns the strength of peak 6 Note: This value is a factor 1000 larger than the RSS value.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak7Distance()

sfTkError_t sfDevXM125Distance::getPeak7Distance ( uint32_t &  peak)

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

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak7Strength()

sfTkError_t sfDevXM125Distance::getPeak7Strength ( int32_t &  peak)

This function returns the strength of peak 7 Note: This value is a factor 1000 larger than the RSS value.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak8Distance()

sfTkError_t sfDevXM125Distance::getPeak8Distance ( uint32_t &  peak)

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

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak8Strength()

sfTkError_t sfDevXM125Distance::getPeak8Strength ( int32_t &  peak)

This function returns the strength of peak 8 Note: This value is a factor 1000 larger than the RSS value.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak9Distance()

sfTkError_t sfDevXM125Distance::getPeak9Distance ( uint32_t &  peak)

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

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeak9Strength()

sfTkError_t sfDevXM125Distance::getPeak9Strength ( int32_t &  peak)

This function returns the strength of peak 9 Note: This value is a factor 1000 larger than the RSS value.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeakDistance()

sfTkError_t sfDevXM125Distance::getPeakDistance ( uint8_t  num,
uint32_t &  peak 
)

This function returns the distance to peak num Note: This value is a factor 1000 larger than the RSS value.

Parameters
numPeak number to get distance (0-9)
peakDistance to peak num
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeakSorting()

sfTkError_t sfDevXM125Distance::getPeakSorting ( uint32_t &  peak)

This function returns the peak sorting method.

Parameters
peakPeak sorting method
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getPeakStrength()

sfTkError_t sfDevXM125Distance::getPeakStrength ( uint8_t  num,
int32_t &  peak 
)

This function returns the strength to peak num Note: This value is a factor 1000 larger than the RSS value.

Parameters
numPeak number to get strength (0-9)
peakstrength to peak num
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getReflectorShape()

sfTkError_t sfDevXM125Distance::getReflectorShape ( uint32_t &  shape)

This function returns the reflector shape Default Value: GENERIC.

Parameters
shapeGeneric or planar reflection
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getSignalQuality()

sfTkError_t sfDevXM125Distance::getSignalQuality ( uint32_t &  signal)

This function returns the high signal quality in a better SNR (because of higher HWAAS) and higher power consumption. Note: This value is a factor 1000 larger than the RSS value Default Value: 15000.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getStart()

sfTkError_t sfDevXM125Distance::getStart ( uint32_t &  startVal)

This function returns the start of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value Default Value: 250.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getTemperature()

sfTkError_t sfDevXM125Distance::getTemperature ( int16_t &  temperature)

This function returns the temperature in sensor during measurements (in degree Celsius). Note that it has poor absolute accuracy and should only be used for relative temperature measurements.

Parameters
temperatureRelative temperature of device
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getThresholdMethod()

sfTkError_t sfDevXM125Distance::getThresholdMethod ( uint32_t &  method)

This function returns the threshold method.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ getThresholdSensitivity()

sfTkError_t sfDevXM125Distance::getThresholdSensitivity ( uint32_t &  thresh)

This function returns the threshold sensitivity (0 <= sensitivity <= 1000) Note: This value is a factor 1000 larger than the RSS value Default Value: 500.

Parameters
thresh&Threshold sensitivity
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ init()

sfTkError_t sfDevXM125Core::init ( sfTkII2C *  theBus = nullptr)
inherited

This function begins the examples/communication.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ logConfiguration()

sfTkError_t sfDevXM125Distance::logConfiguration ( )

This function enables the configuration log of the device by writing the defined value to the distance command register.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ recalibrate()

sfTkError_t sfDevXM125Distance::recalibrate ( )

This function recalibrates the device by writing the defined recalibrate value to the distance command register.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ reset()

sfTkError_t sfDevXM125Distance::reset ( )

This function resets the distance detector settings of the device.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setCloseRangeLeakageCancellation()

sfTkError_t sfDevXM125Distance::setCloseRangeLeakageCancellation ( bool  range)

This function sets the close range leakage cancellation logic. Default Value: true.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setCommand()

sfTkError_t sfDevXM125Distance::setCommand ( uint32_t  command)

This function sets the specific execute command as defined in the datasheet on Page 25, Section 6.2.40 Command.

Parameters
applyEnable configuration and calibrate
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setEnd()

sfTkError_t sfDevXM125Distance::setEnd ( uint32_t  end)

This function sets the end of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value Default Value: 3000.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setFixedAmpThreshold()

sfTkError_t sfDevXM125Distance::setFixedAmpThreshold ( uint32_t  thresh)

This function sets the fixed amplitude threshold value. Note: This value is a factor 1000 larger than the RSS value Default Value: 100000.

Parameters
threshFixed amplitude threshold value
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setFixedStrengthThresholdValue()

sfTkError_t sfDevXM125Distance::setFixedStrengthThresholdValue ( int32_t  thresh)

This function sets the fixed strength threshold value. Default Value: 0 Note: This value is a factor 1000 larger than the RSS value.

Parameters
threshfixed threshold strength value
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setMaxProfile()

sfTkError_t sfDevXM125Distance::setMaxProfile ( uint32_t  profile)

This function sets the max profile of the device Default value = PROFILE5.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setMaxStepLength()

sfTkError_t sfDevXM125Distance::setMaxStepLength ( uint32_t  length)

This function sets the used to limit step length. If set to 0 (default), the step length is calculated based on profile. Default Value: 0.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setMeasureOneWakeup()

sfTkError_t sfDevXM125Distance::setMeasureOneWakeup ( bool  measure)

This function sets the measure on wakeup status. Default Value: false.

Parameters
measureMeasure on wakeup occurrence
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setNumFramesRecordedThreshold()

sfTkError_t sfDevXM125Distance::setNumFramesRecordedThreshold ( uint32_t  thresh)

This function sets the number frames to use for recorded threshold. Default Value: 100.

Parameters
threshNumber of frames
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setPeakSorting()

sfTkError_t sfDevXM125Distance::setPeakSorting ( uint32_t  peak)

This function sets the peak sorting method.

Parameters
peakPeak sorting method
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setReflectorShape()

sfTkError_t sfDevXM125Distance::setReflectorShape ( uint32_t  shape)

This function sets the reflector shape Default Value: GENERIC.

Parameters
shapeGeneric or planar reflection
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setSignalQuality()

sfTkError_t sfDevXM125Distance::setSignalQuality ( uint32_t  signal)

This function sets the high signal quality in a better SNR (because of higher HWAAS) and higher power consumption. Note: This value is a factor 1000 larger than the RSS value Default Value: 15000.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setStart()

sfTkError_t sfDevXM125Distance::setStart ( uint32_t  start)

This function sets the start of measured interval in millimeters. Note: This value is a factor 1000 larger than the RSS value Default Value: 250.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setThresholdMethod()

sfTkError_t sfDevXM125Distance::setThresholdMethod ( uint32_t  method)

This function sets the threshold method.

Parameters
methodThreshold method (enum)
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ setThresholdSensitivity()

sfTkError_t sfDevXM125Distance::setThresholdSensitivity ( uint32_t  thresh)

This function sets the threshold sensitivity (0 <= sensitivity <= 1000) Note: This value is a factor 1000 larger than the RSS value Default Value: 500.

Parameters
threshThreshold sensitivity
Returns
ksfTkErrOk on success, or error code (value < -1)

◆ start()

sfTkError_t sfDevXM125Distance::start ( )

This function starts the device by writing the defined start value to the distance command register.

Returns
ksfTkErrOk on success, or error code (value < -1)

◆ stop()

sfTkError_t sfDevXM125Distance::stop ( )

This function stops the device by writing the defined stop value to the distance command register.

Returns
ksfTkErrOk on success, or error code (value < -1)

Member Data Documentation

◆ _theBus

sfTkII2C* sfDevXM125Core::_theBus
protectedinherited

The documentation for this class was generated from the following files: