STS21 et LTC2497
Cette bibliothèque propose deux pilotes différent : un pilote pour le STS21 et un pilote pour LTC2497 qui sont deux périphériques I2C.
LTC2497.h
1  #ifndef LTC2497_H
2  #define LTC2497_H
3 
4  #include "I2CDevice.h"
9  class LTC2497 : public I2CDevice
10  {
11  public:
15  enum ADC_CHAN { CHAN_0 = 0b00000000,
16  CHAN_1 = 0b00001000,
17  CHAN_2 = 0b00000001,
18  CHAN_3 = 0b00001001,
19  CHAN_4 = 0b00000010,
20  CHAN_5 = 0b00001010,
21  CHAN_6 = 0b00000011,
22  CHAN_7 = 0b00001011,
23  CHAN_8 = 0b00000100,
24  CHAN_9 = 0b00001100,
25  CHAN_10 = 0b00000101,
26  CHAN_11 = 0b00001101,
27  CHAN_12 = 0b00000110,
28  CHAN_13 = 0b00001110,
29  CHAN_14 = 0b00000111,
30  CHAN_15 = 0b00001111
31  };
36  LTC2497(const uint8_t address = 0x45, double vref = 3300);
37 
38  virtual boolean begin(){return I2CDevice::begin();};
42  void setVref(double vref);
48  int32_t sampleValue(ADC_CHAN channel, boolean sgl = true);
52  int32_t sampleValue();
59  double sampleVoltage(ADC_CHAN channel, boolean sgl = true);
64  double sampleVoltage();
65  protected:
66  private:
67  double _vref; //Delta de tension de la plage : vref-gnd en mV
68  uint8_t _dataBytes[3], _adcRes;
69  double _quantum;
70  };
71 
72  #endif //LTC2497_H
Definition: LTC2497.h:25
Definition: LTC2497.h:27
Definition: LTC2497.h:22
void setVref(double vref)
Definition: LTC2497.cpp:12
virtual boolean begin()=0
Definition: I2CDevice.cpp:8
Definition: LTC2497.h:21
Definition: LTC2497.h:28
ADC_CHAN
Enumération de sélection du canal à sampler.
Definition: LTC2497.h:15
Definition: LTC2497.h:18
Definition: LTC2497.h:30
La classe I2CDevice est une classe abstraite servant de modèle pour le développement de pilote pour p...
Definition: I2CDevice.h:76
Definition: LTC2497.h:26
int32_t sampleValue()
Definition: LTC2497.cpp:82
Definition: LTC2497.h:16
LTC2497(const uint8_t address=0x45, double vref=3300)
Definition: LTC2497.cpp:6
Definition: LTC2497.h:23
virtual boolean begin()
Definition: LTC2497.h:38
Definition: LTC2497.h:15
Definition: LTC2497.h:17
Definition: LTC2497.h:29
Definition: LTC2497.h:24
double sampleVoltage()
Definition: LTC2497.cpp:147
Definition: LTC2497.h:20
La classe LTC2497 permet de dialoguer avec l'ADC LTC2497 de Linear Technology Cette ADC à 16 entrées ...
Definition: LTC2497.h:9
Definition: LTC2497.h:19