Class MCP3X0X
Defined in File mcp3x0x.hh
Inheritance Relationships
Derived Types
public iplo::MCP3002
(Class MCP3002)public iplo::MCP3004
(Class MCP3004)public iplo::MCP3008
(Class MCP3008)public iplo::MCP3202
(Class MCP3202)public iplo::MCP3204
(Class MCP3204)public iplo::MCP3208
(Class MCP3208)
Class Documentation
-
class MCP3X0X
Abstract base class for all MCP adc devices.
Subclassed by iplo::MCP3002, iplo::MCP3004, iplo::MCP3008, iplo::MCP3202, iplo::MCP3204, iplo::MCP3208
Public Functions
-
std::int16_t analogRead(std::uint8_t channel)
Read value from the specified channel in single mode.
- Parameters:
channel – Device channel number.
- Returns:
Read value from the channel.
-
std::int16_t differentialRead(std::uint8_t channel)
Read value from the specified channel in differential mode.
- Parameters:
channel – Device channel number.
- Returns:
Final value from differential channels.
-
std::int16_t deltaRead(std::uint8_t channel)
Read.
- Parameters:
channel – Device channel number.
- Returns:
Subtraction of two channels value.
-
std::uint8_t channels()
Return number of channels in the MCP ADC IC.
- Returns:
Number of channels.
Protected Functions
-
virtual std::uint8_t buildRequest(std::uint8_t channel, bool single, std::uint8_t *data) = 0
Pure virtual method for building device request. To be implemented in all derivative class.
-
std::int16_t readAnalogValue(std::uint8_t channel, bool single)
Read raw analog value from the device.
- Parameters:
channel – Channel number to read from
single – Identifier whether reading should be on single mode or differential mode.
- Returns:
Raw read value from the device.
-
std::int16_t analogRead(std::uint8_t channel)