Adafruit Library
Public Member Functions | List of all members
WipperSnapper_I2C_Driver_Out Class Reference

Derived class for I2C output component drivers. More...

#include <WipperSnapper_I2C_Driver_Out.h>

Inheritance diagram for WipperSnapper_I2C_Driver_Out:
WipperSnapper_I2C_Driver WipperSnapper_I2C_Driver_Out_7Seg WipperSnapper_I2C_Driver_Out_CharLcd WipperSnapper_I2C_Driver_Out_QuadAlphaNum WipperSnapper_I2C_Driver_Out_SH1107 WipperSnapper_I2C_Driver_Out_Ssd1306

Public Member Functions

 WipperSnapper_I2C_Driver_Out (TwoWire *i2c, uint16_t sensorAddress)
 Creates a new I2C output component driver. More...
 
virtual ~WipperSnapper_I2C_Driver_Out ()
 Destructor for an I2C output component.
 
virtual void WriteMessage (const char *message)
 Writes a message to an i2c output device. More...
 
virtual void ConfigureSSD1306 (uint8_t width, uint8_t height, uint8_t text_size, uint8_t rotation=0)
 Configures a SSD1306 OLED display. Must be called before driver begin() More...
 
virtual void WriteMessageSSD1306 (const char *message)
 Writes a message to the SSD1306 display. More...
 
virtual void ConfigureI2CBackpack (int32_t brightness, uint32_t alignment)
 Configures a LED backpack. More...
 
virtual void SetLedBackpackBrightness (uint8_t b)
 Sets the brightness of the LED backpack. More...
 
void WriteLedBackpack (wippersnapper_i2c_v1_LEDBackpackWrite *msg_write)
 Writes a message to the LED backpack. More...
 
virtual void ConfigureCharLcd (uint32_t rows, uint32_t cols)
 Configures a character LCD. More...
 
void EnableCharLcdBacklight (bool enable)
 Turns the character LCD backlight on or off. More...
 
void WriteMessageCharLCD (wippersnapper_i2c_v1_CharLCDWrite *write_char_lcd, bool enable_backlight=true)
 Writes a message to the LCD. More...
 
- Public Member Functions inherited from WipperSnapper_I2C_Driver
 WipperSnapper_I2C_Driver (TwoWire *i2c, uint16_t sensorAddress)
 Instanciates an I2C sensor. More...
 
virtual ~WipperSnapper_I2C_Driver ()
 Destructor for an I2C sensor.
 
bool begin ()
 Initializes the I2C sensor and begins I2C. More...
 
void setSensorPeriod (float period, wippersnapper_i2c_v1_SensorType sensorType)
 Sets the sensor's period, provided a wippersnapper_i2c_v1_SensorType. More...
 
void configureDriver (wippersnapper_i2c_v1_I2CDeviceInitRequest *msgDeviceInitReq)
 Uses an I2CDeviceInitRequest message to configure the sensors belonging to the driver. More...
 
uint16_t getI2CAddress ()
 Gets the I2C device's address. More...
 
virtual long getSensorCO2Period ()
 Base implementation - Returns the co2 sensor's period, if set. More...
 
virtual long getSensorCO2PeriodPrv ()
 Base implementation - Returns the previous time interval at which the co2 sensor was queried last. More...
 
virtual void setSensorCO2PeriodPrv (long period)
 Sets a timestamp for when the co2 sensor was queried. More...
 
virtual bool getEventCO2 (sensors_event_t *co2Event)
 Gets a sensor's CO2 value. More...
 
virtual long getSensorECO2Period ()
 Base implementation - Returns the eCO2 sensor's period, if set. More...
 
virtual long getSensorECO2PeriodPrv ()
 Base implementation - Returns the previous time interval at which the eCO2 sensor was queried last. More...
 
virtual void setSensorECO2PeriodPrv (long period)
 Sets a timestamp for when the eCO2 sensor was queried. More...
 
virtual bool getEventECO2 (sensors_event_t *eco2Event)
 Gets a sensor's eCO2 value. More...
 
virtual long getSensorTVOCPeriod ()
 Base implementation - Returns the TVOC sensor's period, if set. More...
 
virtual long getSensorTVOCPeriodPrv ()
 Base implementation - Returns the previous time interval at which the TVOC sensor was queried last. More...
 
virtual void setSensorTVOCPeriodPrv (long period)
 Sets a timestamp for when the TVOC sensor was queried. More...
 
virtual bool getEventTVOC (sensors_event_t *tvocEvent)
 Gets a sensor's TVOC value. More...
 
virtual long getSensorAmbientTempPeriod ()
 Base implementation - Returns the ambient temperature (°C) sensor's period, if set. More...
 
virtual long getSensorAmbientTempPeriodPrv ()
 Base implementation - Returns the previous time interval at which the ambient temperature sensor (°C) was queried last. More...
 
virtual void setSensorAmbientTempPeriodPrv (long periodPrv)
 Sets a timestamp for when the ambient temperature sensor (°C) was queried. More...
 
virtual bool getEventAmbientTemp (sensors_event_t *tempEvent)
 Base implementation - Reads an ambient temperature sensor (°C). Expects value to return in the proper SI unit. More...
 
virtual long getSensorRelativeHumidityPeriod ()
 Base implementation - Returns the humidity sensor's period, if set. More...
 
virtual long getSensorRelativeHumidityPeriodPrv ()
 Base implementation - Returns the previous time interval at which the humidity sensor was queried last. More...
 
virtual void setSensorRelativeHumidityPeriodPrv (long periodPrv)
 Sets a timestamp for when the temperature sensor was queried. More...
 
virtual bool getEventRelativeHumidity (sensors_event_t *humidEvent)
 Base implementation - Reads a humidity sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorPressurePeriod ()
 Base implementation - Returns the pressure sensor's period, if set. More...
 
virtual long getSensorPressurePeriodPrv ()
 Base implementation - Returns the previous time interval at which the pressure sensor was queried last. More...
 
virtual void setSensorPressurePeriodPrv (long period)
 Sets a timestamp for when the pressure sensor was queried. More...
 
virtual bool getEventPressure (sensors_event_t *pressureEvent)
 Base implementation - Reads a pressure sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorAltitudePeriod ()
 Base implementation - Returns the Altitude sensor's period, if set. More...
 
virtual long getSensorAltitudePeriodPrv ()
 Base implementation - Returns the previous time interval at which the Altitude sensor was queried last. More...
 
virtual void setSensorAltitudePeriodPrv (long period)
 Sets a timestamp for when the Altitude sensor was queried. More...
 
virtual bool getEventAltitude (sensors_event_t *altitudeEvent)
 Base implementation - Reads a Altitude sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorObjectTempPeriod ()
 Base implementation - Returns the object temperature sensor's period, if set. More...
 
virtual long getSensorObjectTempPeriodPrv ()
 Base implementation - Returns the previous time interval at which the object temperature sensor was queried last. More...
 
virtual void setSensorObjectTempPeriodPrv (long period)
 Sets a timestamp for when the object temperature sensor was queried. More...
 
virtual bool getEventObjectTemp (sensors_event_t *objectTempEvent)
 Base implementation - Reads a object temperature sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorLightPeriod ()
 Base implementation - Returns the object light sensor's period, if set. More...
 
virtual long getSensorLightPeriodPrv ()
 Base implementation - Returns the previous time interval at which the light sensor was queried last. More...
 
virtual void setSensorLightPeriodPrv (long period)
 Sets a timestamp for when the light sensor was queried. More...
 
virtual bool getEventLight (sensors_event_t *lightEvent)
 Base implementation - Reads a object light sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorPM10_STDPeriod ()
 Base implementation - Returns the object pm10 standard sensors' period, if set. More...
 
virtual long getSensorPM10_STDPeriodPrv ()
 Base implementation - Returns the previous time interval at which the pm10 std. sensor was queried last. More...
 
virtual void setSensorPM10_STDPeriodPrv (long period)
 Sets a timestamp for when the light sensor was queried. More...
 
virtual bool getEventPM10_STD (sensors_event_t *pm10StdEvent)
 Base implementation - Reads a object pm10 std. sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorPM25_STDPeriod ()
 Base implementation - Returns the object pm25 standard sensors' period, if set. More...
 
virtual long getSensorPM25_STDPeriodPrv ()
 Base implementation - Returns the previous time interval at which the pm25 std. sensor was queried last. More...
 
virtual void setSensorPM25_STDPeriodPrv (long period)
 Sets a timestamp for when the light sensor was queried. More...
 
virtual bool getEventPM25_STD (sensors_event_t *pm25StdEvent)
 Base implementation - Reads a object pm25 std. sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorPM100_STDPeriod ()
 Base implementation - Returns the object pm100 standard sensors' period, if set. More...
 
virtual long getSensorPM100_STDPeriodPrv ()
 Base implementation - Returns the previous time interval at which the pm100 std. sensor was queried last. More...
 
virtual void setSensorPM100_STDPeriodPrv (long period)
 Sets a timestamp for when the light sensor was queried. More...
 
virtual bool getEventPM100_STD (sensors_event_t *pm100StdEvent)
 Base implementation - Reads a object pm100 std. sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorUnitlessPercentPeriod ()
 Base implementation - Returns the object unitless % sensor period, if set. More...
 
virtual long getSensorUnitlessPercentPeriodPrv ()
 Base implementation - Returns the previous time interval at which the unitless % sensor was queried last. More...
 
virtual void setSensorUnitlessPercentPeriodPrv (long period)
 Sets a timestamp for when the unitless % sensor was queried. More...
 
virtual bool getEventUnitlessPercent (sensors_event_t *unitlessPercentEvent)
 Base implementation - Reads a object unitless % std. sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorVoltagePeriod ()
 Base implementation - Returns the voltage sensor's period. More...
 
virtual long getSensorVoltagePeriodPrv ()
 Base implementation - Returns the previous time interval at which the voltage sensor was queried last. More...
 
virtual void setSensorVoltagePeriodPrv (long period)
 Sets a timestamp for when the voltage sensor was queried. More...
 
virtual bool getEventVoltage (sensors_event_t *voltageEvent)
 Base implementation - Reads a voltage sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorCurrentPeriod ()
 Base implementation - Returns the current sensor's period. More...
 
virtual long getSensorCurrentPeriodPrv ()
 Base implementation - Returns the previous time interval at which the current sensor was queried last. More...
 
virtual void setSensorCurrentPeriodPrv (long period)
 Sets a timestamp for when the current sensor was queried. More...
 
virtual bool getEventCurrent (sensors_event_t *currentEvent)
 Base implementation - Reads a current sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorRawPeriod ()
 Base implementation - Returns the raw sensor's period, if set. More...
 
virtual long getSensorRawPeriodPrv ()
 Base implementation - Returns the previous time interval at which the raw sensor was queried last. More...
 
virtual void setSensorRawPeriodPrv (long period)
 Sets a timestamp for when the raw sensor was queried. More...
 
virtual bool getEventRaw (sensors_event_t *rawEvent)
 Gets a sensor's Raw value. More...
 
virtual void disableAmbientTempF ()
 Disables the device's ambient temperature (°F) sensor, if it exists.
 
virtual long getSensorAmbientTempFPeriod ()
 Base implementation - Returns the ambient temperature (°F) sensor's period, if set. More...
 
virtual long getSensorAmbientTempFPeriodPrv ()
 Base implementation - Returns the previous time interval at which the ambient temperature sensor (°F) was queried last. More...
 
virtual void setSensorAmbientTempFPeriodPrv (long period)
 Sets a timestamp for when the ambient temperature sensor (°F) was queried. More...
 
virtual bool getEventAmbientTempF (sensors_event_t *AmbientTempFEvent)
 Helper function to obtain a sensor's ambient temperature value in °F. Requires getEventAmbientTemp() to be fully implemented by a driver. More...
 
virtual long getSensorObjectTempFPeriod ()
 Base implementation - Returns the object temperature (°F) sensor's period, if set. More...
 
virtual long getSensorObjectTempFPeriodPrv ()
 Base implementation - Returns the previous time interval at which the object temperature sensor (°F) was queried last. More...
 
virtual void setSensorObjectTempFPeriodPrv (long period)
 Sets a timestamp for when the object temperature sensor (°F) was queried. More...
 
virtual bool getEventObjectTempF (sensors_event_t *objectTempFEvent)
 Helper function to obtain a sensor's object temperature value in °F. Requires getEventObjectTemp() to be fully implemented by a driver. More...
 
virtual long getSensorGasResistancePeriod ()
 Base implementation - Returns the gas resistance (ohms) sensor's period, if set. More...
 
virtual long getSensorGasResistancePeriodPrv ()
 Base implementation - Returns the previous time interval at which the gas resistance sensor (ohms) was queried last. More...
 
virtual void setSensorGasResistancePeriodPrv (long period)
 Sets a timestamp for when the object gas resistance sensor was queried. More...
 
virtual bool getEventGasResistance (sensors_event_t *gasEvent)
 Base implementation - Reads a gas resistance sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorNOxIndexPeriod ()
 Base implementation - Returns the NOx Index sensor's period, if set. More...
 
virtual long getSensorNOxIndexPeriodPrv ()
 Base implementation - Returns the previous time interval at which the NOx Index sensor was queried last. More...
 
virtual void setSensorNOxIndexPeriodPrv (long period)
 Sets a timestamp for when the object NOx Index sensor was queried. More...
 
virtual bool getEventNOxIndex (sensors_event_t *gasEvent)
 Base implementation - Reads a NOx Index sensor and converts the reading into the expected SI unit. More...
 
virtual long getSensorVOCIndexPeriod ()
 Base implementation - Returns the VOC Index sensor's period, if set. More...
 
virtual long getSensorVOCIndexPeriodPrv ()
 Base implementation - Returns the previous time interval at which the VOC Index sensor was queried last. More...
 
virtual void setSensorVOCIndexPeriodPrv (long period)
 Sets a timestamp for when the object VOC Index sensor was queried. More...
 
virtual bool getEventVOCIndex (sensors_event_t *gasEvent)
 Base implementation - Reads a VOC Index sensor and converts the reading into the expected SI unit. More...
 
virtual void enableSensorProximity ()
 Enables the device's proximity sensor, if it exists.
 
virtual void disableSensorProximity ()
 Disables the device's object proximity sensor, if it exists.
 
virtual long sensorProximityPeriod ()
 Base implementation - Returns the proximity sensor's period, if set. More...
 
virtual void setSensorProximityPeriod (long period)
 Set the proximity sensor's return frequency. More...
 
virtual long SensorProximityPeriodPrv ()
 Base implementation - Returns the previous time interval at which the proximity sensor was queried last. More...
 
virtual void setSensorProximityPeriodPrv (long period)
 Sets a timestamp for when the proximity sensor was queried. More...
 
virtual bool getEventProximity (sensors_event_t *proximityEvent)
 Base implementation - Reads a proximity sensor and converts the reading into the expected SI unit. More...
 
virtual void updateSensorProximity (float period)
 Updates the properties of a proximity sensor. More...
 

Additional Inherited Members

- Protected Attributes inherited from WipperSnapper_I2C_Driver
TwoWire * _i2c
 Pointer to the I2C driver's Wire object.
 
uint16_t _sensorAddress
 The I2C driver's unique I2C address.
 
long _tempSensorPeriod
 The time period between reading the temperature sensor's value. More...
 
long _tempSensorPeriodPrv
 
long _humidSensorPeriod
 The time period between reading the humidity sensor's value. More...
 
long _humidSensorPeriodPrv
 
long _pressureSensorPeriod
 The time period between reading the pressure sensor's value. More...
 
long _pressureSensorPeriodPrv
 
long _CO2SensorPeriod
 The time period between reading the CO2 sensor's value. More...
 
long _CO2SensorPeriodPrv
 The time when the CO2 sensor was last read. More...
 
long _ECO2SensorPeriod
 The time period between reading the eCO2 sensor's value. More...
 
long _ECO2SensorPeriodPrv
 The time when the eCO2 sensor was last read. More...
 
long _TVOCSensorPeriod
 The time period between reading the TVOC sensor's value. More...
 
long _TVOCSensorPeriodPrv
 The time when the TVOC sensor was last read. More...
 
long _altitudeSensorPeriod
 The time period between reading the altitude sensor's value. More...
 
long _altitudeSensorPeriodPrv
 
long _objectTempSensorPeriod = 0L
 
long _objectTempSensorPeriodPrv
 
long _lightSensorPeriod
 The time period between reading the light sensor's value. More...
 
long _lightSensorPeriodPrv
 
long _PM10SensorPeriod
 The time period between reading the pm25 sensor's value. More...
 
long _PM10SensorPeriodPrv
 The time when the pm25 sensor was last read. More...
 
long _PM25SensorPeriod
 The time period between reading the pm25 sensor's value. More...
 
long _PM25SensorPeriodPrv
 The time when the pm25 sensor was last read. More...
 
long _PM100SensorPeriod
 The time period between reading the pm100_std sensor's value. More...
 
long _PM100SensorPeriodPrv
 
long _unitlessPercentPeriod
 The time period between reading the unitless % sensor's value. More...
 
long _unitlessPercentPeriodPrv
 
long _voltagePeriod
 The time period between reading the voltage sensor's value. More...
 
long _voltagePeriodPrv
 
long _currentPeriod
 The time period between reading the current sensor's value. More...
 
long _currentPeriodPrv
 
long _rawSensorPeriod
 The time period between reading the Raw sensor's value. More...
 
long _rawSensorPeriodPrv
 The time when the Raw sensor was last read. More...
 
long _ambientTempFPeriod = 0L
 
long _ambientTempFPeriodPrv
 
long _objectTempFPeriod = 0L
 
long _objectTempFPeriodPrv
 
long _gasResistancePeriod = 0L
 
long _gasResistancePeriodPrv
 
long _NOxIndexPeriod
 The time period between reading the NOx Index sensor's value. More...
 
long _NOxIndexPeriodPrv
 
long _VOCIndexPeriod
 The time period between reading the VOC Index sensor's value. More...
 
long _VOCIndexPeriodPrv
 
long _proximitySensorPeriod
 The time period between reading the proximity sensor's value. More...
 
long _proximitySensorPeriodPrv
 

Detailed Description

Derived class for I2C output component drivers.

Constructor & Destructor Documentation

◆ WipperSnapper_I2C_Driver_Out()

WipperSnapper_I2C_Driver_Out::WipperSnapper_I2C_Driver_Out ( TwoWire *  i2c,
uint16_t  sensorAddress 
)
inline

Creates a new I2C output component driver.

Parameters
i2cThe I2C hardware interface, default is Wire.
sensorAddressThe I2C sensor's unique address.

Member Function Documentation

◆ WriteMessage()

virtual void WipperSnapper_I2C_Driver_Out::WriteMessage ( const char *  message)
inlinevirtual

Writes a message to an i2c output device.

Parameters
messageThe message to be displayed.

Reimplemented in WipperSnapper_I2C_Driver_Out_7Seg, WipperSnapper_I2C_Driver_Out_QuadAlphaNum, and WipperSnapper_I2C_Driver_Out_CharLcd.

◆ ConfigureSSD1306()

virtual void WipperSnapper_I2C_Driver_Out::ConfigureSSD1306 ( uint8_t  width,
uint8_t  height,
uint8_t  text_size,
uint8_t  rotation = 0 
)
inlinevirtual

Configures a SSD1306 OLED display. Must be called before driver begin()

Parameters
widthThe width of the display in pixels.
heightThe height of the display in pixels.
text_sizeThe display's text size.
rotationThe rotation of the display in degrees, default is 0.

Reimplemented in WipperSnapper_I2C_Driver_Out_SH1107, and WipperSnapper_I2C_Driver_Out_Ssd1306.

◆ WriteMessageSSD1306()

virtual void WipperSnapper_I2C_Driver_Out::WriteMessageSSD1306 ( const char *  message)
inlinevirtual

Writes a message to the SSD1306 display.

Parameters
messageThe message to be displayed.

Reimplemented in WipperSnapper_I2C_Driver_Out_SH1107, and WipperSnapper_I2C_Driver_Out_Ssd1306.

◆ ConfigureI2CBackpack()

virtual void WipperSnapper_I2C_Driver_Out::ConfigureI2CBackpack ( int32_t  brightness,
uint32_t  alignment 
)
inlinevirtual

Configures a LED backpack.

Parameters
brightnessThe brightness of the LED backpack.
alignmentThe alignment of the LED backpack.

Reimplemented in WipperSnapper_I2C_Driver_Out_7Seg, and WipperSnapper_I2C_Driver_Out_QuadAlphaNum.

◆ SetLedBackpackBrightness()

virtual void WipperSnapper_I2C_Driver_Out::SetLedBackpackBrightness ( uint8_t  b)
inlinevirtual

Sets the brightness of the LED backpack.

Parameters
bThe brightness value, from 0 (off) to 15 (full brightness).

Reimplemented in WipperSnapper_I2C_Driver_Out_7Seg, and WipperSnapper_I2C_Driver_Out_QuadAlphaNum.

◆ WriteLedBackpack()

void WipperSnapper_I2C_Driver_Out::WriteLedBackpack ( wippersnapper_i2c_v1_LEDBackpackWrite *  msg_write)
inline

Writes a message to the LED backpack.

Parameters
msg_writePointer to a wippersnapper_i2c_v1_LedBackpackWrite message.

◆ ConfigureCharLcd()

virtual void WipperSnapper_I2C_Driver_Out::ConfigureCharLcd ( uint32_t  rows,
uint32_t  cols 
)
inlinevirtual

Configures a character LCD.

Parameters
rowsThe number of rows in the LCD.
colsThe number of columns in the LCD.

◆ EnableCharLcdBacklight()

void WipperSnapper_I2C_Driver_Out::EnableCharLcdBacklight ( bool  enable)
inline

Turns the character LCD backlight on or off.

Parameters
enableTrue to enable the backlight, false to disable it.

◆ WriteMessageCharLCD()

void WipperSnapper_I2C_Driver_Out::WriteMessageCharLCD ( wippersnapper_i2c_v1_CharLCDWrite *  write_char_lcd,
bool  enable_backlight = true 
)
inline

Writes a message to the LCD.

Parameters
write_char_lcdPoints to a CharLCDWrite message.
enable_backlightTrue if the backlight should be enabled, false otherwise.

The documentation for this class was generated from the following file: