You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.4 KiB

/*
*
* https://www.ti.com/lit/ds/symlink/ads1015.pdf?ts=1616137488325&ref_url=https%253A%252F%252Fwww.google.com%252F
*
*
*
*
*
*/
#ifndef _ADS1015_H_
#define _ADS1015_H_
#define ADS115_MUX_AIN0P_AIN1N 0 // AINP=AIN0 and AINN=AIN1
#define ADS115_MUX_AIN0P_AIN3N 1 // AINP=AIN0 and AINN=AIN3
#define ADS115_MUX_AIN1P_AIN3N 2 // AINP=AIN1 and AINN=AIN3
#define ADS115_MUX_AIN2P_AIN3N 3 // AINP=AIN2 and AINN=AIN3
#define ADS115_MUX_AIN0_GND 4 // AIN0 and AINN=GND
#define ADS115_MUX_AIN0_GND 5 // AIN1 and AINN=GND
#define ADS115_MUX_AIN0_GND 6 // AIN2 and AINN=GND
#define ADS115_MUX_AIN0_GND 7 // AIN3 and AINN=GND
//do not applymorethan VDD+0.3 V to the analog inputs of the device
#define ADS115_GAIN_6144 0 // ±6.144V
#define ADS115_GAIN_4096 1 // ±6.144V
#define ADS115_GAIN_2048 2 // ±6.144V
#define ADS115_GAIN_1024 3 // ±6.144V
#define ADS115_GAIN_512 4 // ±6.144V
#define ADS115_GAIN_256 5 // ±6.144V
#define ADS115_MODE_CONTINIOUS 0
#define ADS115_MODE_SINGLE 1
#include <stdint.h>
#include <iostream>
#include <unistd.h>
#include <math.h>
#include "../../periferals/i2c/i2c_ch1_pImpL.hpp"
#include "../../management/errorHandling.h"
class Ads1015
{
public:
Ads1015(i2c_ch1_pImpL* i2c,ErrorHandler* err);
setMultiplexer(uint8_t mode)
private:
ErrorHandler* errorHandling;
i2c_ch1_pImpL* i2c_ads1015;
};
#endif //_ADS1015_H_