io expander class ok , adc not working

This commit is contained in:
Emanuele Trabattoni
2026-04-14 11:02:33 +02:00
parent 782aa95ee6
commit 899c8cffbc
11 changed files with 838 additions and 574 deletions
+11 -8
View File
@@ -9,7 +9,8 @@
// Device Libraries
#include <ADS1256.h>
#include <AD5292.h>
#include <PCA95x5.h>
#include <extio.h>
#include <Wire.h>
// ADC Channel mapping
#define ADC_CH_PEAK_12P_IN SING_0
@@ -24,23 +25,25 @@
// Device Pointer structs for tasks
struct Devices
{
// Busses
std::unique_ptr<TwoWire> m_i2c = nullptr;
std::unique_ptr<SPIClass> m_spi_a = nullptr;
std::unique_ptr<SPIClass> m_spi_b = nullptr;
// Bus Mutextes
std::mutex m_spi_a_mutex;
std::mutex m_spi_b_mutex;
std::mutex m_i2c_mutex;
// Device Pointers
std::unique_ptr<AD5292> m_pot_a = nullptr;
std::unique_ptr<AD5292> m_pot_b = nullptr;
std::unique_ptr<ADS1256> m_adc_a = nullptr;
std::unique_ptr<ADS1256> m_adc_b = nullptr;
std::unique_ptr<PCA9555> m_expander_a = nullptr;
std::unique_ptr<PCA9555> m_expander_b = nullptr;
std::unique_ptr<PCA9555> m_expander_inputs_ab = nullptr;
std::unique_ptr<ExternalIO> m_ext_io = nullptr;
std::mutex m_spi_a_mutex;
std::mutex m_spi_b_mutex;
std::mutex m_i2c_mutex;
};
// Adc read channel wrapper to selet mux before reading