modm API documentation
|
#include <modm/driver/temperature/ltc2984.hpp>
Classes | |
struct | Configuration |
struct | Data |
Public Types | |
enum | Register : uint16_t { CommandStatus = 0x000, Results = 0x010, GlobalConfiguration = 0x0f0, MuxChannels = 0x0f4, MuxConfigDelay = 0x0f4, ChannelConfig = 0x200, CustomDataTable = 0x250 } |
enum | CommandStatus : uint8_t { Done = Bit6, Start = Bit7, DoneAndStart = Bit6 | Bit7, Sleep = 0x97 } |
enum | Channel : uint8_t { Ch1 = 0, Ch2 = 1, Ch3 = 2, Ch4 = 3, Ch5 = 4, Ch6 = 5, Ch7 = 6, Ch8 = 7, Ch9 = 8, Ch10 = 9, Ch11 = 10, Ch12 = 11, Ch13 = 12, Ch14 = 13, Ch15 = 14, Ch16 = 15, Ch17 = 16, Ch18 = 17, Ch19 = 18, Ch20 = 19 } |
List of available channels. | |
Public Member Functions | |
MODM_FLAGS8 (CommandStatus) | |
Ltc2984 () | |
Initialize. More... | |
modm::ResumableResult< bool > | ping () |
Ping the LTC298x device. More... | |
modm::ResumableResult< void > | configure (ltc2984::Configuration::Rejection rejection, ltc2984::Configuration::TemperatureUnit temperatureUnit, uint8_t muxDelay=0) |
Configure. More... | |
modm::ResumableResult< bool > | isBusy () |
Check if device is busy. More... | |
modm::ResumableResult< void > | configureChannel (ltc2984::Channel channel, uint32_t config) |
Configure channel. More... | |
modm::ResumableResult< void > | initiateSingleMeasurement (ltc2984::Channel channel) |
Initiate single conversion. More... | |
modm::ResumableResult< void > | initiateMeasurements () |
Initiate measurements for all actived channels. | |
void | enableChannel (ltc2984::Configuration::MuxChannel channel) |
Enable channel for multiplexed conversation. More... | |
void | disableChannel (ltc2984::Configuration::MuxChannel channel) |
Deactivate channel for multiplexed conversation. More... | |
modm::ResumableResult< void > | setChannels () |
Write actived channel configuartion to device. | |
modm::ResumableResult< void > | enterSleepMode () |
Enter sleep mode. | |
modm::ResumableResult< void > | readChannel (ltc2984::Channel channel, ltc2984::Data &value) |
Read temperature value. More... | |
void | attachConfigurationHandler (Spi::ConfigurationHandler handler) |
Protected Member Functions | |
modm::ResumableResult< void > | writeData (Register address, uint8_t *word, size_t length) |
Write 32-bit word to ltc2984 memory. | |
modm::ResumableResult< void > | writeData (Register address, CommandStatus command) |
modm::ResumableResult< void > | readFourBytes (Register address, uint8_t *data) |
Read 32-bit word to ltc2984 memory. | |
modm::ResumableResult< void > | readByte (Register address, uint8_t &byte) |
bool | acquireMaster () |
bool | releaseMaster () |
int8_t | getResumableDepth () const |
bool | isResumableRunning () const |
void | stopResumable () |
modm::ResumableResult<void> modm::ltc2984< SpiMaster, Cs >::configure | ( | ltc2984< SpiMaster, Cs >::Configuration::Rejection | rejection, |
ltc2984< SpiMaster, Cs >::Configuration::TemperatureUnit | temperatureUnit, | ||
uint8_t | muxDelay = 0 |
||
) |
Configure.
rejection | LTC2983/LTC2984 hat built-in simultaneous 50Hz/60Hz Rejection, default both are activated |
temperatureUnit | Temperature unit to use, °C or °F |
muxDelay | Mux configuration delay in 100 microseconds (maximum: 255 x 100us = 25.5ms) |
modm::ResumableResult<void> modm::ltc2984< SpiMaster, Cs >::configureChannel | ( | ltc2984< SpiMaster, Cs >::Channel | channel, |
uint32_t | config | ||
) |
Configure channel.
channel | The channel to configure. |
config | The configuration for the channel. |
void modm::ltc2984< SpiMaster, Cs >::disableChannel | ( | ltc2984< SpiMaster, Cs >::Configuration::MuxChannel | channel | ) |
Deactivate channel for multiplexed conversation.
This has no effect until setChannels() is called
channel | The channel to disable. |
void modm::ltc2984< SpiMaster, Cs >::enableChannel | ( | ltc2984< SpiMaster, Cs >::Configuration::MuxChannel | channel | ) |
Enable channel for multiplexed conversation.
This has no effect until setChannels() is called
channel | The channel to activate. |
modm::ResumableResult<void> modm::ltc2984< SpiMaster, Cs >::initiateSingleMeasurement | ( | ltc2984< SpiMaster, Cs >::Channel | channel | ) |
Initiate single conversion.
channel | The channel to measure. |
modm::ResumableResult<bool> modm::ltc2984< SpiMaster, Cs >::isBusy | ( | ) |
Check if device is busy.
Initialize.
Sets used pins as output. SPI must be initialized by the user!
modm::ResumableResult<bool> modm::ltc2984< SpiMaster, Cs >::ping | ( | ) |
modm::ResumableResult<void> modm::ltc2984< SpiMaster, Cs >::readChannel | ( | ltc2984< SpiMaster, Cs >::Channel | channel, |
ltc2984< SpiMaster, Cs >::Data & | value | ||
) |
Read temperature value.
channel | The channel to read the temperature value from. |
value | The temperature value as configured before. |