@@ -163,11 +163,11 @@ const uint16_t SFE_XM125_DISTANCE_PEAK7_STRENGTH = 0x22;
163163const uint16_t SFE_XM125_DISTANCE_PEAK8_STRENGTH = 0x23 ;
164164const uint16_t SFE_XM125_DISTANCE_PEAK9_STRENGTH = 0x24 ;
165165
166- // Default Value: 250
166+ // Default Value: 250mm
167167const uint16_t SFE_XM125_DISTANCE_START = 0x40 ;
168168const uint16_t sfe_xm125_distance_start_default = 250 ;
169169
170- // Default Value: 3000
170+ // Default Value: 3000mm
171171const uint16_t SFE_XM125_DISTANCE_END = 0x41 ;
172172const uint16_t sfe_xm125_distance_end_default = 3000 ;
173173
@@ -283,7 +283,8 @@ class sfDevXM125Distance : public sfDevXM125Core
283283 // / @brief This function sets all the beginning values for a basic I2C
284284 // / example to be run on the device for presence sensing.
285285 // / @return ksfTkErrOk on success, or error code (value < -1)
286- sfTkError_t distanceBegin ();
286+ sfTkError_t distanceBegin (uint32_t start = sfe_xm125_distance_start_default,
287+ uint32_t end = sfe_xm125_distance_end_default);
287288
288289 // / @brief This function does all the required checks and busy waits to
289290 // / make sure the device is ready for distance readings.
@@ -344,6 +345,15 @@ class sfDevXM125Distance : public sfDevXM125Core
344345 // / @return ksfTkErrOk on success, or error code (value < -1)
345346 sfTkError_t getDistanceTemperature (int16_t &temperature);
346347
348+ // --------------------------------------------------------------------------------
349+ // Generic distance peak distance method
350+ // / @brief This function returns the distance to peak num
351+ // / Note: This value is a factor 1000 larger than the RSS value
352+ // / @param num Peak number to get distance (0-9)
353+ // / @param peak Distance to peak num
354+ // / @return ksfTkErrOk on success, or error code (value < -1)
355+ sfTkError_t getDistancePeakDistance (uint8_t num, uint32_t &peak);
356+
347357 // / @brief This function returns the distance to peak 0
348358 // / Note: This value is a factor 1000 larger than the RSS value
349359 // / @return ksfTkErrOk on success, or error code (value < -1)
@@ -394,6 +404,15 @@ class sfDevXM125Distance : public sfDevXM125Core
394404 // / @return ksfTkErrOk on success, or error code (value < -1)
395405 sfTkError_t getDistancePeak9Distance (uint32_t &peak);
396406
407+ // --------------------------------------------------------------------------------
408+ // Generic distance peak strength method
409+ // / @brief This function returns the strength to peak num
410+ // / Note: This value is a factor 1000 larger than the RSS value
411+ // / @param num Peak number to get strength (0-9)
412+ // / @param peak strength to peak num
413+ // / @return ksfTkErrOk on success, or error code (value < -1)
414+ sfTkError_t getDistancePeakStrength (uint8_t num, int32_t &peak);
415+
397416 // / @brief This function returns the strength of peak 0
398417 // / Note: This value is a factor 1000 larger than the RSS value
399418 // / @return ksfTkErrOk on success, or error code (value < -1)
0 commit comments