Skyward boardcore
|
MAX31855 thermocouple sensor driver. More...
#include <MAX31855.h>
Public Member Functions | |
MAX31855 (SPIBusInterface &bus, miosix::GpioPin cs, SPIBusConfig config=getDefaultSPIConfig()) | |
bool | init () |
Initialize the sensor. | |
bool | selfTest () |
Check if the sensor is working. | |
bool | checkConnected () |
Checks whether the thermocouple is connected or not. | |
TemperatureData | readInternalTemperature () |
Read the device internal temperature (cold junction). | |
![]() | |
Sensor () | |
Sensor (Sensor &&other) | |
virtual | ~Sensor () |
void | sample () override |
Sample the sensor. | |
virtual TemperatureData | getLastSample () |
![]() | |
virtual | ~AbstractSensor () |
SensorErrors | getLastError () |
Get last error for debugging purposes. Avoid silent fails. | |
Static Public Member Functions | |
static SPIBusConfig | getDefaultSPIConfig () |
Protected Member Functions | |
TemperatureData | sampleImpl () override |
Read a data sample from the sensor. In case of errors, the method should return the last available correct sample. | |
Additional Inherited Members | |
![]() | |
using | DataType |
![]() | |
DataType | lastSample |
miosix::FastMutex | mutex |
![]() | |
SensorErrors | lastError = SensorErrors::NO_ERRORS |
MAX31855 thermocouple sensor driver.
The MAX31855 performs cold-junction compensation and digitizes the signal from a K, J, N, T, S, R, or E type thermocouple depending on the selected product variant. The data is output in a signed 14-bit, SPI-compatible, read-only format. This converter resolves temperatures to 0.25°C, allows readings as high as +1800°C and as low as -270°C, and exhibits thermocouple accuracy of ±2°C for temperatures ranging from -200°C to +700°C for K-type thermocouples.
Definition at line 43 of file MAX31855.h.
Boardcore::MAX31855::MAX31855 | ( | SPIBusInterface & | bus, |
miosix::GpioPin | cs, | ||
SPIBusConfig | config = getDefaultSPIConfig() ) |
Definition at line 30 of file MAX31855.cpp.
bool Boardcore::MAX31855::checkConnected | ( | ) |
Checks whether the thermocouple is connected or not.
Definition at line 48 of file MAX31855.cpp.
|
static |
Definition at line 36 of file MAX31855.cpp.
|
virtual |
Initialize the sensor.
Implements Boardcore::AbstractSensor.
Definition at line 44 of file MAX31855.cpp.
TemperatureData Boardcore::MAX31855::readInternalTemperature | ( | ) |
Read the device internal temperature (cold junction).
Definition at line 88 of file MAX31855.cpp.
|
overrideprotectedvirtual |
Read a data sample from the sensor. In case of errors, the method should return the last available correct sample.
Implements Boardcore::Sensor< TemperatureData >.
Definition at line 69 of file MAX31855.cpp.
|
virtual |
Check if the sensor is working.
Implements Boardcore::AbstractSensor.
Definition at line 46 of file MAX31855.cpp.