@@ -163,11 +163,11 @@ const uint16_t SFE_XM125_DISTANCE_PEAK7_STRENGTH = 0x22;
163
163
const uint16_t SFE_XM125_DISTANCE_PEAK8_STRENGTH = 0x23 ;
164
164
const uint16_t SFE_XM125_DISTANCE_PEAK9_STRENGTH = 0x24 ;
165
165
166
- // Default Value: 250
166
+ // Default Value: 250mm
167
167
const uint16_t SFE_XM125_DISTANCE_START = 0x40 ;
168
168
const uint16_t sfe_xm125_distance_start_default = 250 ;
169
169
170
- // Default Value: 3000
170
+ // Default Value: 3000mm
171
171
const uint16_t SFE_XM125_DISTANCE_END = 0x41 ;
172
172
const uint16_t sfe_xm125_distance_end_default = 3000 ;
173
173
@@ -283,7 +283,8 @@ class sfDevXM125Distance : public sfDevXM125Core
283
283
// / @brief This function sets all the beginning values for a basic I2C
284
284
// / example to be run on the device for presence sensing.
285
285
// / @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);
287
288
288
289
// / @brief This function does all the required checks and busy waits to
289
290
// / make sure the device is ready for distance readings.
@@ -344,6 +345,15 @@ class sfDevXM125Distance : public sfDevXM125Core
344
345
// / @return ksfTkErrOk on success, or error code (value < -1)
345
346
sfTkError_t getDistanceTemperature (int16_t &temperature);
346
347
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
+
347
357
// / @brief This function returns the distance to peak 0
348
358
// / Note: This value is a factor 1000 larger than the RSS value
349
359
// / @return ksfTkErrOk on success, or error code (value < -1)
@@ -394,6 +404,15 @@ class sfDevXM125Distance : public sfDevXM125Core
394
404
// / @return ksfTkErrOk on success, or error code (value < -1)
395
405
sfTkError_t getDistancePeak9Distance (uint32_t &peak);
396
406
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
+
397
416
// / @brief This function returns the strength of peak 0
398
417
// / Note: This value is a factor 1000 larger than the RSS value
399
418
// / @return ksfTkErrOk on success, or error code (value < -1)
0 commit comments