enable disable interrupts on adc drdy only when needed (only for cycle read now) fixed useless delays
This commit is contained in:
@@ -10,8 +10,7 @@
|
||||
Benjamin Pelletier for pointing out and fixing an issue around the handling of the DRDY signal
|
||||
*/
|
||||
|
||||
#ifndef _ADS1256_h
|
||||
#define _ADS1256_h
|
||||
#pragma once
|
||||
|
||||
#include <SPI.h>
|
||||
#include <Arduino.h>
|
||||
@@ -159,21 +158,10 @@ public:
|
||||
// Stop AD
|
||||
void stopConversion();
|
||||
|
||||
// functions for callback
|
||||
inline uint8_t getDRDYpin()
|
||||
{
|
||||
return m_DRDY_pin;
|
||||
}
|
||||
|
||||
SemaphoreHandle_t getDRDYsemaphoreHigh()
|
||||
{
|
||||
return m_drdyHigh;
|
||||
}
|
||||
|
||||
SemaphoreHandle_t getDRDYsemaphoreLow()
|
||||
{
|
||||
return m_drdyLow;
|
||||
}
|
||||
// functions for callback, public to be accessed by static callback
|
||||
inline uint8_t getDRDYpin();
|
||||
inline SemaphoreHandle_t getDRDYsemaphoreHigh();
|
||||
inline SemaphoreHandle_t getDRDYsemaphoreLow();
|
||||
|
||||
private:
|
||||
SPIClass *_spi; // Pointer to an SPIClass object
|
||||
@@ -183,6 +171,8 @@ private:
|
||||
void updateMUX(uint8_t muxValue);
|
||||
inline void CS_LOW();
|
||||
inline void CS_HIGH();
|
||||
inline void enableDRDYinterrupt();
|
||||
inline void disableDRDYinterrupt();
|
||||
|
||||
void updateConversionParameter(); // Refresh the conversion parameter based on the PGA
|
||||
|
||||
@@ -212,4 +202,3 @@ private:
|
||||
SemaphoreHandle_t m_drdyHigh;
|
||||
SemaphoreHandle_t m_drdyLow;
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user