LightHub 4.6.0
Open-source smart home controller firmware
Loading...
Searching...
No Matches
readCache Class Reference

Cache of raw pin reads to avoid multiple GPIO/I2C accesses within one poll cycle. More...

#include <inputs.h>

Public Member Functions

 readCache ()
uint16_t analogReadCached (uint8_t pin, uint8_t trigPin=0, uint8_t _type=IN_ANALOG)
uint8_t digitalReadCached (uint8_t pin)
void invalidateInputCache ()

Protected Attributes

uint8_t addr
 Cached I2C address / type / value.
uint8_t type
uint16_t cached_data

Detailed Description

Cache of raw pin reads to avoid multiple GPIO/I2C accesses within one poll cycle.

Constructor & Destructor Documentation

◆ readCache()

readCache::readCache ( )

Member Function Documentation

◆ analogReadCached()

uint16_t readCache::analogReadCached ( uint8_t pin,
uint8_t trigPin = 0,
uint8_t _type = IN_ANALOG )

Cached analogRead (with an optional trigger pin, e.g. for ultrasonic).

◆ digitalReadCached()

uint8_t readCache::digitalReadCached ( uint8_t pin)

Cached digitalRead.

TBD

◆ invalidateInputCache()

void readCache::invalidateInputCache ( )

Invalidate the cached read so the next read hits the hardware.

Member Data Documentation

◆ addr

uint8_t readCache::addr
protected

Cached I2C address / type / value.

◆ cached_data

uint16_t readCache::cached_data
protected

◆ type

uint8_t readCache::type
protected

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