32 : slave(bus, cs, config)
59 if ((
sample[1] & 0x7) != 0)
62 LOG_ERR(logger,
"Self test failed, the thermocouple is not connected");
83 result.temperature =
static_cast<float>(
sample) * 0.25;
104 result.temperature =
static_cast<float>(
sample[1] >> 4);
105 result.temperature +=
static_cast<float>(
sample[1] & 0xF) * 0.0625;
#define LOG_ERR(logger,...)
TemperatureData sampleImpl() override
Read a data sample from the sensor. In case of errors, the method should return the last available co...
bool init()
Initialize the sensor.
bool selfTest()
Check if the sensor is working.
static SPIBusConfig getDefaultSPIConfig()
MAX31855(SPIBusInterface &bus, miosix::GpioPin cs, SPIBusConfig config=getDefaultSPIConfig())
bool checkConnected()
Checks whether the thermocouple is connected or not.
TemperatureData readInternalTemperature()
Read the device internal temperature (cold junction).
Interface for low level access of a SPI bus as a master.
Provides high-level access to the SPI Bus for a single transaction.
@ MODE_1
CPOL = 1, CPHA = 0 -> Clock high when idle, sample on first edge.
uint64_t getTimestamp()
Returns the current timer value in microseconds.
This file includes all the types the logdecoder script will decode.
SPI Bus configuration for a specific slave.
SPI::ClockDivider clockDivider
< Peripheral clock division
uint64_t temperatureTimestamp