LTC2439Lib
Cette bibliothèque est basée sur la bibliothèque écrite par Tim THUREL, mais adaptée pour fonctionner avec l'ESP8266. Elle ajoute également des méthodes asynchrones
LTC2439.h
1 
42 #ifndef LTC2439_H
43 #define LTC2439_H
44 
45 #include <Arduino.h>
46 #include <SPI.h>
47 
51 class LTC2439
52 {
53  public:
59  LTC2439(uint8_t csPin, uint8_t sdoPin, double vref = 3300);
63  void setVref(double vref);
67  double getVref(){return _vref;};
74  int32_t sampleValue(uint8_t channel, boolean sgl = true);
79  int32_t sampleValue();
86  double sampleVoltage(uint8_t channel, boolean sgl = true);
91  double sampleVoltage();
92  //Methodes asynchrones
98  void startAsyncSample(uint8_t channel, boolean sgl = true, boolean force = false);
102  boolean asyncResultAvailable();
106  double convertToVoltage(int32_t value);
110  int32_t getAsyncValue();
111  protected:
112  private:
113  uint8_t _csPin, _statusPin;
114  boolean _sampleTriggered;
115  double _vref; //Delta de tension de la plage : vref-gnd en mV
116  uint8_t _adcRes;
117  double _quantum;
118  const uint8_t _channelMap[16];
119  const SPISettings _SPIsettings;
120 };
121 
122 #endif //LTC2439_H
double sampleVoltage()
La classe LTC2439 permettant de dialoguer avec le LTC2439.
Definition: LTC2439.h:51
double getVref()
Definition: LTC2439.h:67
void startAsyncSample(uint8_t channel, boolean sgl=true, boolean force=false)
Definition: LTC2439.cpp:21
void setVref(double vref)
Definition: LTC2439.cpp:15
double convertToVoltage(int32_t value)
Definition: LTC2439.cpp:58
int32_t getAsyncValue()
Definition: LTC2439.cpp:65
LTC2439(uint8_t csPin, uint8_t sdoPin, double vref=3300)
Definition: LTC2439.cpp:6
int32_t sampleValue()
boolean asyncResultAvailable()
Definition: LTC2439.cpp:44