MCP9700 Driver
API reference
Loading...
Searching...
No Matches
Classes | Enumerations | Variables
hf::mcp9700 Namespace Reference

Classes

class  Mcp9700Thermistor
 Template driver for MCP9700 family sensors on a multiplexed ADC. More...
 

Enumerations

enum class  Error : uint8_t {
  kNone = 0 , kNotInitialized , kInvalidArgument , kInvalidCoefficients ,
  kAdcError , kOutOfRange
}
 Why the last call failed (see Mcp9700Thermistor::LastError()). More...
 

Variables

constexpr float kDefaultVoltsAtZeroC = 0.5F
 Default output voltage at 0 °C (500 mV typical, MCP9700/MCP9700A).
 
constexpr float kDefaultVoltsPerCelsius = 0.01F
 Default sensitivity (10 mV/°C typical).
 
constexpr float kDefaultSpecifiedMinCelsius = -40.0F
 Default lower end of the specified temperature range (°C).
 
constexpr float kDefaultSpecifiedMaxCelsius = 125.0F
 Default upper end of the specified temperature range (°C).
 
constexpr float kDefaultRangeMarginCelsius = 8.0F
 Default plausibility margin (°C) added on both sides of the specified range.
 

Enumeration Type Documentation

◆ Error

enum class hf::mcp9700::Error : uint8_t
strong

Why the last call failed (see Mcp9700Thermistor::LastError()).

Enumerator
kNone 

The last call succeeded.

kNotInitialized 

Read before a successful Initialize(), or after Deinitialize().

kInvalidArgument 

Null adapter or null output pointer, or an invalid range.

kInvalidCoefficients 

Offset not finite, or slope not a finite positive number.

kAdcError 

EnsureInitialized() returned false or ReadChannelV() returned non-zero.

kOutOfRange 

The voltage is outside the plausible range: open, shorted or mis-scaled input.

Variable Documentation

◆ kDefaultRangeMarginCelsius

constexpr float hf::mcp9700::kDefaultRangeMarginCelsius = 8.0F
inlineconstexpr

Default plausibility margin (°C) added on both sides of the specified range.

Covers the worst-case sensor accuracy of the MCP9700 (-4 °C / +6 °C, DC Electrical Characteristics) plus a little ADC error. With the default coefficients a reading is accepted from -48 °C (20 mV) to +133 °C (1.83 V); an open or grounded input (0 V, -50 °C) is rejected.

◆ kDefaultSpecifiedMaxCelsius

constexpr float hf::mcp9700::kDefaultSpecifiedMaxCelsius = 125.0F
inlineconstexpr

Default upper end of the specified temperature range (°C).

◆ kDefaultSpecifiedMinCelsius

constexpr float hf::mcp9700::kDefaultSpecifiedMinCelsius = -40.0F
inlineconstexpr

Default lower end of the specified temperature range (°C).

MCP9700/9700A/9700B: -40 °C to +125 °C (DS20001942, Temperature Characteristics). Over that range VOUT is 100 mV to 1.75 V (Section 3.2).

◆ kDefaultVoltsAtZeroC

constexpr float hf::mcp9700::kDefaultVoltsAtZeroC = 0.5F
inlineconstexpr

Default output voltage at 0 °C (500 mV typical, MCP9700/MCP9700A).

◆ kDefaultVoltsPerCelsius

constexpr float hf::mcp9700::kDefaultVoltsPerCelsius = 0.01F
inlineconstexpr

Default sensitivity (10 mV/°C typical).