|
| | PCF8591 (unsigned int pcfBasePinNumber, int pcfI2cAddress, float adcVoltage=3.3f) |
| | Builds a PCF8591 ADC bound to the given base pin, I2C address, and reference voltage. More...
|
| |
| virtual | ~PCF8591 () |
| | Destroys the ADC, turning it off first. More...
|
| |
| virtual void | TurnOn () override |
| | Initializes the PCF8591 for analog reads via wiringPi, reporting success or failure through the AlertManager. More...
|
| |
| virtual void | TurnOff () override |
| | No-op: the PCF8591 holds no resources that need releasing when turned off. More...
|
| |
| virtual void | ProcessRawValues () override |
| | No-op: the PCF8591 reads its channels on demand in ReadAnalogValue, so there are no raw values to process. More...
|
| |
| virtual std::string | ToString () const override |
| | Serializes the chip's base pin (with its channel range) and ADC voltage to a string. More...
|
| |
| virtual int | ReadAnalogValue (int adcIndex=0) override |
| | Reads a fresh analog value from the given ADC channel, performing a dummy read and settle delay first. More...
|
| |
| unsigned int | GetPCFBasePinNumber () const |
| | Gets the wiringPi base pin; the chip's four ADC channels are read as base+0..base+3. More...
|
| |
| int | GetPCFI2CAddress () const |
| | Gets the chip's I2C address. More...
|
| |
| virtual | ~IAnalogDigitalConverterComponent ()=0 |
| | Pure virtual destructor, making this an abstract interface. More...
|
| |
| virtual int | ReadAnalogValue (int adcIndex=0)=0 |
| | Reads an analog value from the given channel. More...
|
| |
| float | GetADCVoltage () const |
| | Gets the ADC's reference voltage. More...
|
| |
| int | GetMaxRawValue () const |
| | Gets the ADC's full-scale raw count (e.g. More...
|
| |
| | BaseComponent () |
| | Builds a base component with an unknown type and an empty name. More...
|
| |
| virtual | ~BaseComponent () |
| | Virtual destructor so deleting a component through a BaseComponent* also cleans up the concrete subclass. More...
|
| |
| virtual void | TurnOn ()=0 |
| | Turns the component on (e.g. More...
|
| |
| virtual void | TurnOff ()=0 |
| | Turns the component off. More...
|
| |
| virtual std::string | ToString () const =0 |
| | Serializes the component's current readings to a string (usually JSON). More...
|
| |
| virtual void | ProcessRawValues ()=0 |
| | Reads and processes the component's latest raw values (called once per poll). More...
|
| |
| virtual EComponentType | GetComponentType () const |
| | Gets the component's type. More...
|
| |
| const std::string & | GetName () const |
| | Gets the component's unique per-instance name. More...
|
| |
| void | SetName (const std::string &name) |
| | Sets the component's unique per-instance name. More...
|
| |
|
| static std::string | ComponentTypeToString (const EComponentType theComponentTypeToConvert) |
| | Maps an EComponentType to its string name. More...
|
| |
| static EComponentType | StringToComponentType (const std::string &theComponentTypeName) |
| | Maps a type name back to its EComponentType (the inverse of ComponentTypeToString), so the client can turn the type carried on the wire back into a value it can look an icon up with. More...
|
| |
| | IAnalogDigitalConverterComponent () |
| | Initializes the reference voltage and full-scale count to safe 10-bit defaults; concrete ADCs overwrite both in their own constructor, so a subclass that forgets to set them still yields sane (non-garbage) conversions rather than silently wrong volts. More...
|
| |
| float | myADCVoltage |
| | The ADC's reference voltage, used to convert raw readings to volts. More...
|
| |
| int | myMaxRawValue |
| | The ADC's full-scale raw count (255 for an 8-bit chip, 1023 for a 10-bit chip). More...
|
| |
| EComponentType | myComponentType |
| | The kind of component this is (set by each concrete subclass). More...
|
| |
| std::string | myName |
| | A unique per-instance name, assigned when the component is added to the manager. More...
|
| |
PCF8591 analog-to-digital converter chip (I2C), used to read analog sensors on the Raspberry Pi.
- Author
- Eddie O'Hagan
- Date
- 8/13/2026