HardFOC Core
API reference
Loading...
Searching...
No Matches
Classes | Functions
Ads9324Handler.h File Reference

hf-core handler for ADS9324 (16-ch 16-bit simultaneous SAR + PGA AFE). More...

#include <cstdint>
#include <memory>
#include <type_traits>
#include <utility>
#include "core/hf-core-drivers/external/hf-ads9324-driver/inc/ads9324.hpp"
#include "base/BaseSpi.h"
#include "base/BaseAdc.h"
#include "base/BaseGpio.h"
#include "RtosMutex.h"

Go to the source code of this file.

Classes

class  Ads9324SpiHostAdapter
 CRTP adapter connecting BaseSpi + CONVST/DRDY GPIO to the ADS9324 driver. More...
 
struct  Ads9324HandlerConfig
 Configuration applied at Ads9324Handler::Initialize. More...
 
struct  Ads9324Diagnostics
 Diagnostic snapshot for one ADS9324 handler instance. More...
 
class  Ads9324Handler
 Thread-safe BaseAdc handler for one ADS9324 on a SPI bus. More...
 

Functions

Ads9324HandlerConfig GetDefaultAds9324Config () noexcept
 Default handler config: differential ±5 V, low PGA bandwidth, two's-complement.
 
std::unique_ptr< Ads9324Handler > CreateAds9324Handler (BaseSpi &spi, BaseGpio *convst, BaseGpio *drdy=nullptr, const Ads9324HandlerConfig &config=GetDefaultAds9324Config()) noexcept
 Factory: construct an Ads9324Handler on the heap.
 

Detailed Description

hf-core handler for ADS9324 (16-ch 16-bit simultaneous SAR + PGA AFE).

Bridges BaseSpi plus CONVST (required) and optional DRDY BaseGpio into the portable ads9324 driver. Implements BaseAdc.

Architecture matches Ads7952Handler:

HF_CORE_ENABLE_ADS9324 is OFF by default. ESP32 hf-core examples turn the flag ON so this handler compiles in CI.

Note
CONVST must be non-null. SetActive() = CONVST high; conversion starts on the falling edge.
See also
docs/handlers/ads9324_handler.md
ads9324.hpp

Function Documentation

◆ CreateAds9324Handler()

std::unique_ptr< Ads9324Handler > CreateAds9324Handler ( BaseSpi &  spi,
BaseGpio *  convst,
BaseGpio *  drdy = nullptr,
const Ads9324HandlerConfig &  config = GetDefaultAds9324Config() 
)
noexcept

Factory: construct an Ads9324Handler on the heap.

Parameters
spiSPI device.
convstCONVST GPIO (required at Initialize).
drdyOptional DRDY.
configDefaults for PGA / format / index.
Returns
Unique pointer (never null unless bad_alloc, which is not used here).

◆ GetDefaultAds9324Config()

Ads9324HandlerConfig GetDefaultAds9324Config ( )
inlinenoexcept

Default handler config: differential ±5 V, low PGA bandwidth, two's-complement.

Returns
Value-initialized Ads9324HandlerConfig.