Skip to content
Snippets Groups Projects
Commit 535bff3d authored by Daniel Joseph Antrim's avatar Daniel Joseph Antrim
Browse files

add some doxy doc

parent d78883ed
No related branches found
No related tags found
6 merge requests!308Bring main and devel back in sync,!300playing with fixing divergence between devel and main,!287Updates for Julabo Chiller,!285Julabo Chiller Added with Fixed Pipeline Compatibility,!269Merge devel into main: largest change is code formatting checker and enforcement in CI,!225Add support for 4-channel 12-bit ADC ADS1015
Pipeline #2552130 passed
......@@ -11,27 +11,78 @@ class LinearCalibration;
class I2CCom;
/** \brief ADS1015: Low-power, I2C compatible 4-channel 12-bit ADC
*
* The `ADS1015` class provides a driver for the Texas Instruments low-power,
* I2C compatible 4-channel 12-bit ADC. Support for single-shot ADC conversions
* is supported, whereas the differential measurement capabilities of the
* ADS1015 are not.
*
* [Datasheet](https://cdn.sparkfun.com/assets/a/c/4/9/b/ads1015.pdf)
*/
class ADS1015 : public ADCDevice {
public:
//! \brief Gain values for the ADS1015 programmable gain amplifier
enum class Gain { xTWOTHIRDS, xONE, xTWO, xFOUR, xEIGHT, xSIXTEEN };
//! \brief ADS1015 constructor taking a fullscale range as input
/**
* \param fullscale_range The fullscale range that the ADS1015 should be
* configured to use (internally configures the programmable gain associated
* with the provided fullscale range). \param com I2C communication device
* used for communication with the ADS1015
*/
ADS1015(double fullscale_range, std::shared_ptr<I2CCom> com);
//! \brief ADS1015 constructor taking a gain as input
/**
* \param gain A valid value of ADS1015::Gain (internally sets the fullscale
* range associated with the gain). \param com I2C communication device used
* for communication with the ADS1015
*/
ADS1015(Gain gain, std::shared_ptr<I2CCom> com);
//! \brief Default destructor
virtual ~ADS1015() {}
//! \brief Perform an ADC conversion on the default ADC channel
virtual int32_t readCount();
//! \brief Perform an ADC conversion on a specified ADC channel
/**
* \param channel The ADC channel to measure from
*/
virtual int32_t readCount(uint8_t channel);
//! \brief Perform ADC conversions on a set of ADC channels
/**
* \param channels The set of ADC channels to measure from
* \param data The array to hold the set of measurements associated with the
* measurement channels
*/
virtual void readCount(const std::vector<uint8_t>& channels,
std::vector<int32_t>& data);
// The ADS1015 has an internal programmable gain amplifier at the
// input stage (applied to the analog signals prior to digitization).
// Depending on the gain setting, the full scale range of the ADC (the
// maximum analog value that saturates the digital output) changes.
//! \brief Set the gain
/**
* \param gain A value of ADS1015::Gain
*
* The ADS1015 has a programmable gain amplifier at the input stage,
* applied to the analog signals prior to the digitization stage.
* Depending on the gain setting, the fullscale range of the ADC
* changes. The fullscale range is the maximum analog value that saturates
* the digital output of the ADC.
*
* This method internally converts the `gain` value to the ADS1015 fullscale
* range associated with the gain setting and then calls
* `ADS1015::setFullScaleRange`.
*/
void setGain(Gain gain);
//! \brief Set the ADS1015 fullscale range
/**
* \param val The value of the fullscale range. Must be associated with a
* valid ADS1015::Gain.
*/
void setFullScaleRange(double val);
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment