Tool Libs
UMIT-TIROL Institute of Automation and Control Engineering library collection
 
Loading...
Searching...
No Matches
MAX31865 Struct Reference

Implementation of MAX31865 based temperature sensor. More...

#include <MAX31865.h>

Inherits SPI::Device.

Collaboration diagram for MAX31865:
[legend]

Classes

struct  Config
 Sensor configuration. More...
 

Public Types

enum  Type { PT2WIRE = 0 , PT3WIRE = 1 , PT4WIRE = 0 }
 Sensor Type. More...
 

Public Member Functions

 MAX31865 (Sink< SPI::Request > &bus, DIO cs, Config c={ .wires=PT2WIRE,.Rnom=100,.Rref=430, })
 configure temperature sensor
 
double tempLin ()
 linear temperature approximation
 
double temp ()
 quadratic temperature approximation
 
void sense ()
 async read temperature data from sensor
 
void readFault ()
 async read fault data from sensor
 
void readAllData ()
 async read all data from sensor
 
void callback (const SPI::Request rq) override
 is called as soon as requested data arrived over wire
 
uint8_t fault ()
 
void clearFaults ()
 clear faults on sensor
 
void setLThr (uint16_t thr)
 set low fault threshold value
 
void setHThr (uint16_t thr)
 set high fault threshold value
 
void select (bool sel)
 chipselect activation
 

Public Attributes

DIO cs
 GPIO chipselect line.
 
struct SPI::Device::Conf conf
 necessary SPI configuration
 

Detailed Description

Implementation of MAX31865 based temperature sensor.

supports 2 to 4 wire sensors of arbitrary nominal resistances, and arbitrary reference resistors.

Warning
reference resistor must be greater than sensor resistor (for platinum based resistors Rref = 4 * Rnom works best)
implemented only for temperatures > 0 degrees C. see https://analog.com/media/en/technical-documentation/application-notes/AN709_0.pdf for details

Class Documentation

◆ MAX31865::Config

struct MAX31865::Config

Sensor configuration.

Class Members
Type wires number of wires
double Rnom nominal resistance
double Rref reference resistor

Member Enumeration Documentation

◆ Type

Sensor Type.

Enumerator
PT2WIRE 

2 wire

PT3WIRE 

3 wire

PT4WIRE 

4 wire

Constructor & Destructor Documentation

◆ MAX31865()

MAX31865::MAX31865 ( Sink< SPI::Request > &  bus,
DIO  cs,
Config  c = { .wires = PT2WIRE, .Rnom = 100, .Rref = 430, } 
)
inline

configure temperature sensor

Parameters
busSPI request queue
csDigital In/Out pin of chip select line
cHardware configuration of sensor

configures sensor for auto conversion with 50Hz filter

Member Function Documentation

◆ tempLin()

double MAX31865::tempLin ( )
inline

linear temperature approximation

Returns
temperature in °C, NAN if sensor fault

◆ temp()

double MAX31865::temp ( )
inline

quadratic temperature approximation

Returns
temperature in °C, NAN if sensor fault

◆ fault()

uint8_t MAX31865::fault ( )
inline
Returns
fault byte read from sensor

◆ setLThr()

void MAX31865::setLThr ( uint16_t  thr)
inline

set low fault threshold value

Parameters
thrthreshold

◆ setHThr()

void MAX31865::setHThr ( uint16_t  thr)
inline

set high fault threshold value

Parameters
thrthreshold

◆ select()

void SPI::Device::select ( bool  sel)
inlineinherited

chipselect activation

Parameters
seltrue/false

The documentation for this struct was generated from the following file: