|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
#include <DeviceBeginCommon.hpp>
Public Member Functions | |
| virtual | ~DeviceBeginCommon () |
| uint8_t | getAddress () const |
| uint8_t | getInterface () const |
Public Member Functions inherited from SensorCommWrapper | |
| SensorCommWrapper ()=default | |
| int | readReg (uint8_t reg) const |
| int | readRegBuff (uint8_t reg, uint8_t *buf, size_t len) const |
| int | readBuff (uint8_t *buf, size_t len) const |
| int | writeReg (uint8_t reg, uint8_t val) |
| int | writeRegBuff (uint8_t reg, uint8_t *buf, size_t len) |
| int | writeBuff (uint8_t *buf, size_t len) |
| int | writeThenRead (const uint8_t *write_buffer, size_t write_len, uint8_t *read_buffer, size_t read_len) |
| bool | setRegBit (uint8_t reg, uint8_t bit) |
| bool | clrRegBit (uint8_t reg, uint8_t bit) |
| bool | getRegBit (uint8_t reg, uint8_t bit) |
| int | updateBits (uint8_t reg, uint8_t mask, uint8_t value_shifted) |
| void | setAddress (uint8_t address) |
| void | setAck (bool enable) |
Public Member Functions inherited from SensorCommInterface | |
| virtual | ~SensorCommInterface ()=default |
Protected Member Functions | |
| DeviceBeginCommon ()=default | |
| virtual bool | initImpl (uint8_t param)=0 |
| virtual bool | ensureValid () const override |
| virtual SensorCommBase * | getComm () const override |
| virtual void | beforeBegin () |
| virtual void | afterCommReady () |
| virtual void | afterInitSuccess (uint8_t param) |
| virtual void | onBeginFail () |
| bool | fail () |
| void | clearCommState () |
| template<typename CreateComm > | |
| bool | beginLifecycle (uint8_t addr, uint8_t iface, uint8_t initParam, CreateComm createComm) |
Protected Attributes | |
| std::unique_ptr< SensorCommBase > | comm |
| std::unique_ptr< SensorHal > | hal |
| std::unique_ptr< SensorCommStatic > | staticComm |
| uint8_t | _addr = 0 |
| uint8_t | _iface = COMM_CUSTOM |
Definition at line 34 of file DeviceBeginCommon.hpp.
|
inlinevirtual |
Definition at line 37 of file DeviceBeginCommon.hpp.
References comm.
|
protecteddefault |
|
inlineprotectedvirtual |
Definition at line 77 of file DeviceBeginCommon.hpp.
Referenced by beginLifecycle().
|
inlineprotectedvirtual |
Definition at line 80 of file DeviceBeginCommon.hpp.
Referenced by beginLifecycle().
|
inlineprotectedvirtual |
Definition at line 72 of file DeviceBeginCommon.hpp.
Referenced by beginLifecycle().
|
inlineprotected |
Definition at line 105 of file DeviceBeginCommon.hpp.
References _addr, _iface, afterCommReady(), afterInitSuccess(), beforeBegin(), clearCommState(), fail(), and initImpl().
Referenced by ComplexDeviceWithHal::begin(), ComplexStaticDeviceWithHal::begin(), SPIDeviceWithHal::begin(), I2CDeviceNoHal::begin(), and I2CDeviceWithHal::begin().
|
inlineprotected |
Definition at line 92 of file DeviceBeginCommon.hpp.
References _addr, _iface, comm, COMM_CUSTOM, hal, and staticComm.
Referenced by beginLifecycle().
|
inlineoverrideprotectedvirtual |
Implements SensorCommInterface.
Reimplemented in ComplexDeviceWithHal, ComplexStaticDeviceWithHal, I2CDeviceWithHal, and SPIDeviceWithHal.
Definition at line 58 of file DeviceBeginCommon.hpp.
References comm.
Referenced by IoExpanderXL9555::digitalReadImpl().
|
inlineprotected |
Definition at line 86 of file DeviceBeginCommon.hpp.
References onBeginFail().
Referenced by beginLifecycle().
|
inline |
Definition at line 44 of file DeviceBeginCommon.hpp.
References _addr.
|
inlineoverrideprotectedvirtual |
Implements SensorCommInterface.
Definition at line 64 of file DeviceBeginCommon.hpp.
References comm.
|
inline |
Definition at line 48 of file DeviceBeginCommon.hpp.
References _iface.
|
protectedpure virtual |
Implemented in IoExpanderPCA9570, IoExpanderXL9555, SensorQMI8658, SensorPawA350, SensorQMI8658, and TouchDrvInterface.
Referenced by beginLifecycle().
|
inlineprotectedvirtual |
Definition at line 83 of file DeviceBeginCommon.hpp.
Referenced by fail().
|
protected |
Definition at line 131 of file DeviceBeginCommon.hpp.
Referenced by beginLifecycle(), clearCommState(), getAddress(), and SensorBMA4XX::update().
|
protected |
Definition at line 132 of file DeviceBeginCommon.hpp.
Referenced by beginLifecycle(), clearCommState(), getInterface(), and SensorBMA4XX::update().
|
protected |
Definition at line 127 of file DeviceBeginCommon.hpp.
Referenced by ComplexDeviceWithHal::begin(), ComplexStaticDeviceWithHal::begin(), SPIDeviceWithHal::begin(), I2CDeviceNoHal::begin(), I2CDeviceWithHal::begin(), SensorQMI8658::calibration(), clearCommState(), SensorQMI8658::configAccelerometer(), SensorQMI8658::configActivityInterruptMap(), SensorQMI8658::configFIFO(), SensorQMI8658::configGyroscope(), SensorQMI8658::configMotion(), SensorQMI8658::configPedometer(), SensorQMI8658::configTap(), SensorQMI8658::configWakeOnMotion(), SensorQMI8658::disableAccelerometer(), SensorQMI8658::disableGyroscope(), SensorQMI8658::disableLockingMechanism(), SensorQMI8658::disableMotionDetect(), SensorQMI8658::disablePedometer(), SensorQMI8658::disableSyncSampleMode(), SensorQMI8658::disableTap(), SensorQMI8658::dumpCtrlRegister(), SensorQMI8658::enableAccelerometer(), SensorQMI8658::enableDataReadyINT(), SensorQMI8658::enableGyroscope(), SensorQMI8658::enableINT(), SensorQMI8658::enableLockingMechanism(), SensorQMI8658::enableMotionDetect(), SensorQMI8658::enablePedometer(), SensorQMI8658::enableSyncSampleMode(), SensorQMI8658::enableTap(), ComplexDeviceWithHal::ensureValid(), ComplexStaticDeviceWithHal::ensureValid(), ensureValid(), I2CDeviceWithHal::ensureValid(), SPIDeviceWithHal::ensureValid(), SensorQMI8658::getAccelRaw(), SensorQMI8658::getChipID(), getComm(), SensorQMI8658::getDataReady(), SensorQMI8658::getGyroRaw(), SensorQMI8658::getIrqStatus(), SensorQMI8658::getPedometerCounter(), SensorQMI8658::getStatusRegister(), SensorQMI8658::getTapStatus(), SensorQMI8658::getTemperature_C(), SensorQMI8658::getTimestamp(), SensorQMI8658::initImpl(), SensorQMI8658::powerDown(), SensorQMI8658::powerOn(), GaugeAXP2602::refresh(), SensorQMI8658::reset(), SensorQMI8658::selfTestAccel(), SensorQMI8658::selfTestGyro(), SensorQMI8658::setAccelOffset(), SensorQMI8658::setGyroOffset(), SensorQMI8658::update(), SensorQMI8658::whoAmI(), SensorQMI8658::writeCalibration(), and ~DeviceBeginCommon().
|
protected |
Definition at line 128 of file DeviceBeginCommon.hpp.
Referenced by HapticDriver_DRV2605::autoCal(), ComplexDeviceWithHal::begin(), ComplexStaticDeviceWithHal::begin(), SPIDeviceWithHal::begin(), I2CDeviceWithHal::begin(), SensorQMI8658::calibrate(), SensorQMI8658::calibration(), clearCommState(), GaugeAXP2602::clearIRQStatus(), SensorQMI8658::configWakeOnMotionAdvanced(), AXP517Core::delayMs(), AXP517Core::digitalRead(), TouchDrvCST816::disableAutoSleep(), TouchDrvCST816::enableAutoSleep(), ComplexDeviceWithHal::ensureValid(), ComplexStaticDeviceWithHal::ensureValid(), I2CDeviceWithHal::ensureValid(), SPIDeviceWithHal::ensureValid(), SensorQMI8658::getDataReady(), GaugeBQ27220::getOperationConfig(), SensorQMI8658::hardwareSelfTest(), SensorQMI8658::initImpl(), SensorQMI8658::isDataReady(), TouchDrvInterface::isPressed(), HapticDriver_AW86224::loadRamData(), HapticDriver_AW86224::longVibration(), AXP517Core::millis(), AXP517Core::pinMode(), HapticDriver_AW86224::playEffectAsync(), HapticDriver_AW86224::playRtp(), SensorQMI8658::readFromFifo(), TouchDrvInterface::reset(), GaugeAXP2602::reset(), SensorQMI8658::reset(), SensorBMM150::reset(), SensorQMC5883L::reset(), SensorQMC6309::reset(), SensorQSTMagnetic::reset(), TouchDrvCST226::reset(), SensorQMI8658::reset(), HapticDriver_AW86224::run(), SensorQMC6309::selfTest(), SensorQSTMagnetic::selfTest(), SensorQMI8658::selfTestAccel(), SensorQMI8658::selfTestGyro(), GaugeBQ27220::setNewCapacity(), SensorQMI8658::setPins(), HapticDriver_AW86224::shortVibration(), TouchDrvCST226::sleep(), TouchDrvCST3530::sleep(), TouchDrvCST92xx::sleep(), TouchDrvGT911::sleep(), TouchDrvGT9895::sleep(), HapticDriver_AW86224::softReset(), SensorQMI8658::update(), SensorBMA4XX::update(), HapticDriver_AW86224::vibrationUpdate(), TouchDrvCST3530::wakeup(), TouchDrvGT911::wakeup(), TouchDrvGT9895::wakeup(), SensorQMI8658::writeCommand(), and GaugeAXP2602::writeGaugeData().
|
protected |
Definition at line 129 of file DeviceBeginCommon.hpp.
Referenced by clearCommState(), and SensorBMA4XX::update().