File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,11 @@ type DistanceMode uint8
1919type RangeStatus uint8
2020
2121type rangingData struct {
22- mm uint16
23- status RangeStatus
24- signalRateMCPS int32 //MCPS : Mega Count Per Second
25- ambientRateMCPS int32
22+ mm uint16
23+ status RangeStatus
24+ signalRateMCPS int32 //MCPS : Mega Count Per Second
25+ ambientRateMCPS int32
26+ effectiveSPADCount uint16
2627}
2728
2829type resultBuffer struct {
@@ -337,6 +338,11 @@ func (d *Device) AmbientRate() int32 {
337338 return d .rangingData .ambientRateMCPS
338339}
339340
341+ // EffectiveSPADCount returns the effective number of SPADs
342+ func (d * Device ) EffectiveSPADCount () uint16 {
343+ return d .rangingData .effectiveSPADCount
344+ }
345+
340346// getRangingData stores in the buffer the ranging data
341347func (d * Device ) getRangingData () {
342348 d .rangingData .mm = uint16 ((uint32 (d .results .mmCrosstalkSD0 )* 2011 + 0x0400 ) / 0x0800 )
@@ -384,6 +390,7 @@ func (d *Device) getRangingData() {
384390
385391 d .rangingData .signalRateMCPS = 1000000 * int32 (d .results .signalRateCrosstalkMCPSSD0 ) / (1 << 7 )
386392 d .rangingData .ambientRateMCPS = 1000000 * int32 (d .results .ambientRateMCPSSD0 ) / (1 << 7 )
393+ d .rangingData .effectiveSPADCount = d .results .effectiveSPADCount
387394}
388395
389396// setupManualCalibration configures the manual calibration
You can’t perform that action at this time.
0 commit comments