Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::MAX6675 Class Reference

MAX6675 thermocouple sensor driver. More...

#include <MAX6675.h>

Inheritance diagram for Boardcore::MAX6675:
Collaboration diagram for Boardcore::MAX6675:

Public Member Functions

 MAX6675 (SPIBusInterface &bus, miosix::GpioPin cs, SPIBusConfig config=getDefaultSPIConfig())
 
bool init ()
 Initialize the sensor.
 
bool selfTest ()
 Checks whether the thermocouple is connected or not.
 
bool checkConnection ()
 Checks whether the thermocouple is connected or not.
 
- Public Member Functions inherited from Boardcore::Sensor< TemperatureData >
 Sensor ()
 
 Sensor (Sensor &&other)
 
virtual ~Sensor ()
 
void sample () override
 Sample the sensor.
 
virtual TemperatureData getLastSample ()
 
- Public Member Functions inherited from Boardcore::AbstractSensor
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

- Public Types inherited from Boardcore::Sensor< TemperatureData >
using DataType
 
- Protected Attributes inherited from Boardcore::Sensor< TemperatureData >
DataType lastSample
 
miosix::FastMutex mutex
 
- Protected Attributes inherited from Boardcore::AbstractSensor
SensorErrors lastError = SensorErrors::NO_ERRORS
 

Detailed Description

MAX6675 thermocouple sensor driver.

Definition at line 36 of file MAX6675.h.

Constructor & Destructor Documentation

◆ MAX6675()

Boardcore::MAX6675::MAX6675 ( SPIBusInterface & bus,
miosix::GpioPin cs,
SPIBusConfig config = getDefaultSPIConfig() )

Definition at line 30 of file MAX6675.cpp.

Member Function Documentation

◆ checkConnection()

bool Boardcore::MAX6675::checkConnection ( )

Checks whether the thermocouple is connected or not.

Definition at line 47 of file MAX6675.cpp.

◆ getDefaultSPIConfig()

SPIBusConfig Boardcore::MAX6675::getDefaultSPIConfig ( )
static

Definition at line 35 of file MAX6675.cpp.

◆ init()

bool Boardcore::MAX6675::init ( )
virtual

Initialize the sensor.

Returns
boolean value indicating whether the operation succeded or not

Implements Boardcore::AbstractSensor.

Definition at line 43 of file MAX6675.cpp.

◆ sampleImpl()

TemperatureData Boardcore::MAX6675::sampleImpl ( )
overrideprotectedvirtual

Read a data sample from the sensor. In case of errors, the method should return the last available correct sample.

Returns
sensor data sample

Implements Boardcore::Sensor< TemperatureData >.

Definition at line 68 of file MAX6675.cpp.

◆ selfTest()

bool Boardcore::MAX6675::selfTest ( )
virtual

Checks whether the thermocouple is connected or not.

Returns
True if the thermocouple is connected.

Implements Boardcore::AbstractSensor.

Definition at line 45 of file MAX6675.cpp.


The documentation for this class was generated from the following files: