You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some drivers do not automatically trigger a conversion when measurement methods are called while the sensor is in power-off or idle mode.
Convention
When a driver is powered off or idle, calling any measurement method should automatically trigger a conversion before reading. All drivers implement _ensure_data() which checks the power state and triggers a conversion if needed, with polling and timeout (OSError on failure).
Reference pattern: _ensure_data() (see WSEN-PADS, WSEN-HIDS, HTS221).
Problem
Some drivers do not automatically trigger a conversion when measurement methods are called while the sensor is in power-off or idle mode.
Convention
When a driver is powered off or idle, calling any measurement method should automatically trigger a conversion before reading. All drivers implement
_ensure_data()which checks the power state and triggers a conversion if needed, with polling and timeout (OSErroron failure).Reference pattern:
_ensure_data()(see WSEN-PADS, WSEN-HIDS, HTS221).Audit results
Fixed
_ensure_data()triggers one-shot, pollsSTATUS_P_DA | STATUS_T_DA, raisesWSENPADSTimeout_ensure_data()triggers one-shot, pollsdata_ready(), raisesWSENHIDSTimeoutError_ensure_data()triggers one-shot, pollsSTATUS_T_DA | STATUS_H_DA, raisesOSError_ensure_data()triggers single conversion, pollsdata_ready(), raisesOSError_ensure_data()starts ranging, pollsdata_ready(), clears interrupt, raisesOSError_ensure_light_enabled()/_ensure_proximity_enabled()auto-enable sensor, poll readiness, raiseOSError_ensure_data()restores ODR, polls all status bits, raisesOSErrorTo audit
Auto-trigger behavior to be verified once driver is implemented
Not concerned