PropWare
C++ objects and CMake build system for Parallax Propeller
|
K-type thermocouple amplifier driver using SPI communication for the Parallax Propeller. More...
#include <max6675.h>
Public Member Functions | |
MAX6675 (SPI *spi) | |
Construction requires an instance of the SPI module; the SPI module does not need to be started. More... | |
void | start (const Port::Mask mosi, const Port::Mask miso, const Port::Mask sclk, const Port::Mask cs) |
Initialize communication with an MAX6675 device. More... | |
void | always_set_spi_mode (const bool alwaysSetMode) |
Choose whether to always set the SPI mode and bitmode before reading or writing to the chip; Useful when multiple devices are connected to the SPI bus. More... | |
uint16_t | read () |
Read data in fixed-point form. More... | |
uint16_t | read_whole () |
Read data and return integer value. More... | |
float | read_float () |
Read data in floating point form. More... | |
K-type thermocouple amplifier driver using SPI communication for the Parallax Propeller.
PropWare::MAX6675::MAX6675 | ( | SPI * | spi | ) |
void PropWare::MAX6675::always_set_spi_mode | ( | const bool | alwaysSetMode | ) |
Choose whether to always set the SPI mode and bitmode before reading or writing to the chip; Useful when multiple devices are connected to the SPI bus.
[in] | alwaysSetMode | For any non-zero value, the SPI modes will always be set before a read or write routine |
uint16_t PropWare::MAX6675::read | ( | ) |
Read data in fixed-point form.
12-bit data is stored where lower 2 bits are fractional and upper10 bits are the whole number. Value presented in degrees Celsius
Definition at line 90 of file max6675.h.
float PropWare::MAX6675::read_float | ( | ) |
uint16_t PropWare::MAX6675::read_whole | ( | ) |
void PropWare::MAX6675::start | ( | const Port::Mask | mosi, |
const Port::Mask | miso, | ||
const Port::Mask | sclk, | ||
const Port::Mask | cs | ||
) |
Initialize communication with an MAX6675 device.
[in] | mosi | PinNum mask for MOSI |
[in] | miso | PinNum mask for MISO |
[in] | sclk | PinNum mask for SCLK |
[in] | cs | PinNum mask for CS |
Definition at line 58 of file max6675.h.