Skyward boardcore
|
MAX31855 thermocouple sensor driver. More...
#include <MAX31856.h>
Public Types | |
enum class | ThermocoupleType : uint8_t { B_TYPE = 0x0 , E_TYPE = 0x1 , J_TYPE = 0x2 , K_TYPE = 0x3 , N_TYPE = 0x4 , R_TYPE = 0x5 , S_TYPE = 0x6 , T_TYPE = 0x7 , GAIN_8 = 0x8 , GAIN_32 = 0x9 } |
![]() | |
using | DataType |
Public Member Functions | |
MAX31856 (SPIBusInterface &bus, miosix::GpioPin cs, SPIBusConfig config=getDefaultSPIConfig(), ThermocoupleType type=ThermocoupleType::K_TYPE) | |
bool | init () |
Initialize the sensor. | |
bool | selfTest () |
Check if the sensor is working. | |
bool | checkConnected () |
Checks whether the thermocouple is connected or not. | |
void | setThermocoupleType (ThermocoupleType type) |
void | setColdJunctionOffset (float offset) |
![]() | |
Sensor () | |
Sensor (Sensor &&other) | |
virtual | ~Sensor () |
void | sample () override |
Sample the sensor. | |
virtual MAX31856Data | getLastSample () |
![]() | |
virtual | ~AbstractSensor () |
SensorErrors | getLastError () |
Get last error for debugging purposes. Avoid silent fails. | |
Static Public Member Functions | |
static SPIBusConfig | getDefaultSPIConfig () |
Protected Member Functions | |
MAX31856Data | 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 | |
![]() | |
DataType | lastSample |
miosix::FastMutex | mutex |
![]() | |
SensorErrors | lastError = SensorErrors::NO_ERRORS |
MAX31855 thermocouple sensor driver.
The MAX31856 performs cold-junction compensation and digitizes the signal from any type of thermocouple. This converter resolves temperatures to 0.0078125°C, allows readings as high as +1800°C and as low as -210°C (depending on thermocouple type), and exhibits thermocouple voltage measurement accuracy of ±0.15%. The thermocouple inputs are protected against over voltage conditions up to ±45V. A lookup table (LUT) stores linearity correction data for several types of thermocouples (K, J, N, R, S, T, E, and B). Line frequency filtering of 50Hz and 60Hz is included, as is thermocouple fault detection
Definition at line 47 of file MAX31856.h.
|
strong |
Enumerator | |
---|---|
B_TYPE | |
E_TYPE | |
J_TYPE | |
K_TYPE | |
N_TYPE | |
R_TYPE | |
S_TYPE | |
T_TYPE | |
GAIN_8 | |
GAIN_32 |
Definition at line 50 of file MAX31856.h.
Boardcore::MAX31856::MAX31856 | ( | SPIBusInterface & | bus, |
miosix::GpioPin | cs, | ||
SPIBusConfig | config = getDefaultSPIConfig(), | ||
ThermocoupleType | type = ThermocoupleType::K_TYPE ) |
Definition at line 30 of file MAX31856.cpp.
bool Boardcore::MAX31856::checkConnected | ( | ) |
Checks whether the thermocouple is connected or not.
Definition at line 65 of file MAX31856.cpp.
|
static |
Definition at line 36 of file MAX31856.cpp.
|
virtual |
Initialize the sensor.
Implements Boardcore::AbstractSensor.
Definition at line 45 of file MAX31856.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< MAX31856Data >.
Definition at line 98 of file MAX31856.cpp.
|
virtual |
Check if the sensor is working.
Implements Boardcore::AbstractSensor.
Definition at line 63 of file MAX31856.cpp.
void Boardcore::MAX31856::setColdJunctionOffset | ( | float | offset | ) |
Definition at line 91 of file MAX31856.cpp.
void Boardcore::MAX31856::setThermocoupleType | ( | ThermocoupleType | type | ) |
Definition at line 85 of file MAX31856.cpp.