ADS7952 Driver
API reference
Loading...
Searching...
No Matches
Classes | Namespaces | Macros
ads7952.hpp File Reference

Main driver class for the ADS7952 12-channel, 12-bit SAR ADC. More...

#include <cstdint>
#include <cstddef>
#include <algorithm>
#include "ads7952_config.hpp"
#include "ads7952_registers.hpp"
#include "ads7952_spi_interface.hpp"
#include "ads7952_types.hpp"
#include "ads7952.ipp"

Go to the source code of this file.

Classes

class  ads7952::ADS7952< SpiType >
 Main driver class for the ADS7952 ADC. More...
 

Namespaces

namespace  ads7952
 

Macros

#define ADS7952_HEADER_INCLUDED
 

Detailed Description

Main driver class for the ADS7952 12-channel, 12-bit SAR ADC.

Hardware-agnostic C++20 driver for the Texas Instruments ADS7952 multichannel SAR ADC using CRTP for zero-overhead SPI abstraction.

Key Features

Basic Usage

class MySpi : public ads7952::SpiInterface<MySpi> {
public:
bool transfer(const uint8_t* tx, uint8_t* rx, size_t len) { ... } // false = bus error
};
MySpi spi;
ads7952::ADS7952<MySpi> adc(spi, 2.5f, 5.0f);
adc.EnsureInitialized(); // Idempotent — safe to call repeatedly
auto result = adc.ReadChannel(3);
if (result.ok()) printf("CH3: %.3f V\n", result.voltage);
auto all = adc.ReadAllChannels();
for (uint8_t ch = 0; ch < 12; ch++)
if (all.hasChannel(ch)) printf("CH%u: %u\n", ch, all.count[ch]);
Main driver class for the ADS7952 ADC.
Definition ads7952.hpp:81
bool transfer(const uint8_t *tx, uint8_t *rx, std::size_t len)
Perform a full-duplex SPI data transfer.

Definition in file ads7952.hpp.

Macro Definition Documentation

◆ ADS7952_HEADER_INCLUDED

#define ADS7952_HEADER_INCLUDED

Definition at line 42 of file ads7952.hpp.