Adafruit MAX31865 Arduino Library
|
#include <Adafruit_MAX31865.h>
Public Member Functions | |
Adafruit_MAX31865 (int8_t spi_cs, int8_t spi_mosi, int8_t spi_miso, int8_t spi_clk) | |
Create the interface object using software (bitbang) SPI. More... | |
Adafruit_MAX31865 (int8_t spi_cs, SPIClass *theSPI=&SPI) | |
Create the interface object using hardware SPI. More... | |
bool | begin (max31865_numwires_t x=MAX31865_2WIRE) |
Initialize the SPI interface and set the number of RTD wires used. More... | |
uint8_t | readFault (max31865_fault_cycle_t fault_cycle=MAX31865_FAULT_AUTO) |
Read the raw 8-bit FAULTSTAT register. More... | |
void | clearFault (void) |
Clear all faults in FAULTSTAT. | |
uint16_t | readRTD () |
Read the raw 16-bit value from the RTD_REG in one shot mode. More... | |
void | setThresholds (uint16_t lower, uint16_t upper) |
Write the lower and upper values into the threshold fault register to values as returned by readRTD() More... | |
uint16_t | getLowerThreshold (void) |
Read the raw 16-bit lower threshold value. More... | |
uint16_t | getUpperThreshold (void) |
Read the raw 16-bit lower threshold value. More... | |
void | setWires (max31865_numwires_t wires) |
How many wires we have in our RTD setup, can be MAX31865_2WIRE, MAX31865_3WIRE, or MAX31865_4WIRE. More... | |
void | autoConvert (bool b) |
Whether we want to have continuous conversions (50/60 Hz) More... | |
void | enable50Hz (bool b) |
Whether we want filter out 50Hz noise or 60Hz noise. More... | |
void | enableBias (bool b) |
Enable the bias voltage on the RTD sensor. More... | |
float | temperature (float RTDnominal, float refResistor) |
Read the temperature in C from the RTD through calculation of the resistance. Uses http://www.analog.com/media/en/technical-documentation/application-notes/AN709_0.pdf technique. More... | |
float | calculateTemperature (uint16_t RTDraw, float RTDnominal, float refResistor) |
Calculate the temperature in C from the RTD through calculation of the resistance. Uses http://www.analog.com/media/en/technical-documentation/application-notes/AN709_0.pdf technique. More... | |
Interface class for the MAX31865 RTD Sensor reader
Adafruit_MAX31865::Adafruit_MAX31865 | ( | int8_t | spi_cs, |
int8_t | spi_mosi, | ||
int8_t | spi_miso, | ||
int8_t | spi_clk | ||
) |
Create the interface object using software (bitbang) SPI.
spi_cs | the SPI CS pin to use |
spi_mosi | the SPI MOSI pin to use |
spi_miso | the SPI MISO pin to use |
spi_clk | the SPI clock pin to use |
Adafruit_MAX31865::Adafruit_MAX31865 | ( | int8_t | spi_cs, |
SPIClass * | theSPI = &SPI |
||
) |
Create the interface object using hardware SPI.
spi_cs | the SPI chip select pin to use |
theSPI | the SPI device to use, default is SPI |
bool Adafruit_MAX31865::begin | ( | max31865_numwires_t | wires = MAX31865_2WIRE | ) |
Initialize the SPI interface and set the number of RTD wires used.
wires | The number of wires in enum format. Can be MAX31865_2WIRE, MAX31865_3WIRE, or MAX31865_4WIRE |
uint8_t Adafruit_MAX31865::readFault | ( | max31865_fault_cycle_t | fault_cycle = MAX31865_FAULT_AUTO | ) |
Read the raw 8-bit FAULTSTAT register.
fault_cycle | The fault cycle type to run. Can be MAX31865_FAULT_NONE, MAX31865_FAULT_AUTO, MAX31865_FAULT_MANUAL_RUN, or MAX31865_FAULT_MANUAL_FINISH |
uint16_t Adafruit_MAX31865::readRTD | ( | void | ) |
Read the raw 16-bit value from the RTD_REG in one shot mode.
void Adafruit_MAX31865::setThresholds | ( | uint16_t | lower, |
uint16_t | upper | ||
) |
Write the lower and upper values into the threshold fault register to values as returned by readRTD()
lower | raw lower threshold |
upper | raw upper threshold |
uint16_t Adafruit_MAX31865::getLowerThreshold | ( | void | ) |
Read the raw 16-bit lower threshold value.
uint16_t Adafruit_MAX31865::getUpperThreshold | ( | void | ) |
Read the raw 16-bit lower threshold value.
void Adafruit_MAX31865::setWires | ( | max31865_numwires_t | wires | ) |
How many wires we have in our RTD setup, can be MAX31865_2WIRE, MAX31865_3WIRE, or MAX31865_4WIRE.
wires | The number of wires in enum format |
void Adafruit_MAX31865::autoConvert | ( | bool | b | ) |
Whether we want to have continuous conversions (50/60 Hz)
b | If true, auto conversion is enabled |
void Adafruit_MAX31865::enable50Hz | ( | bool | b | ) |
Whether we want filter out 50Hz noise or 60Hz noise.
b | If true, 50Hz noise is filtered, else 60Hz(default) |
void Adafruit_MAX31865::enableBias | ( | bool | b | ) |
Enable the bias voltage on the RTD sensor.
b | If true bias is enabled, else disabled |
float Adafruit_MAX31865::temperature | ( | float | RTDnominal, |
float | refResistor | ||
) |
Read the temperature in C from the RTD through calculation of the resistance. Uses http://www.analog.com/media/en/technical-documentation/application-notes/AN709_0.pdf technique.
RTDnominal | The 'nominal' resistance of the RTD sensor, usually 100 or 1000 |
refResistor | The value of the matching reference resistor, usually 430 or 4300 |
float Adafruit_MAX31865::calculateTemperature | ( | uint16_t | RTDraw, |
float | RTDnominal, | ||
float | refResistor | ||
) |
Calculate the temperature in C from the RTD through calculation of the resistance. Uses http://www.analog.com/media/en/technical-documentation/application-notes/AN709_0.pdf technique.
RTDraw | The raw 16-bit value from the RTD_REG |
RTDnominal | The 'nominal' resistance of the RTD sensor, usually 100 or 1000 |
refResistor | The value of the matching reference resistor, usually 430 or 4300 |