CRTP adapter connecting BaseSpi + CONVST/DRDY GPIO to the ADS9324 driver.
More...
#include <Ads9324Handler.h>
|
| | Ads9324SpiHostAdapter (BaseSpi &spi, BaseGpio *convst, BaseGpio *drdy) noexcept |
| | Bind SPI and conversion pins.
|
| |
| bool | transfer (const uint8_t *tx, uint8_t *rx, std::size_t len) noexcept |
| | Full-duplex SPI transfer (CRTP dispatch target).
|
| |
| void | ConvstWrite (bool high) noexcept |
| | Drive CONVST.
|
| |
| bool | DrdyRead () noexcept |
| | Sample DRDY.
|
| |
| bool | HasDrdy () const noexcept |
| | Whether a DRDY GPIO was supplied.
|
| |
| void | DelayUs (uint32_t us) noexcept |
| | Busy-wait microseconds (nested volatile loop).
|
| |
| void | DelayMs (uint32_t ms) noexcept |
| | Sleep milliseconds via os_delay_msec (chunked at 65535 ms).
|
| |
|
| BaseSpi & | spi_ |
| | SPI device.
|
| |
| BaseGpio * | convst_ |
| | CONVST (required at handler Initialize).
|
| |
| BaseGpio * | drdy_ |
| | Optional DRDY; nullptr = timed wait.
|
| |
CRTP adapter connecting BaseSpi + CONVST/DRDY GPIO to the ADS9324 driver.
Implements both ads9324::SpiInterface and ads9324::HostInterface so a single object can be passed as the driver's SpiType and HostType.
- Note
DelayUs is a calibrated busy loop (no RTOS microsecond delay in hf-core). DelayMs uses os_delay_msec.
- Warning
- SPI
Transfer return codes are currently ignored — the driver treats config writes as infallible.
◆ Ads9324SpiHostAdapter()
| Ads9324SpiHostAdapter::Ads9324SpiHostAdapter |
( |
BaseSpi & |
spi, |
|
|
BaseGpio * |
convst, |
|
|
BaseGpio * |
drdy |
|
) |
| |
|
noexcept |
Bind SPI and conversion pins.
- Parameters
-
| spi | SPI device (CS owned by BaseSpi). |
| convst | CONVST GPIO (may be nullptr; handler init will then fail). |
| drdy | Optional DRDY GPIO; nullptr selects timed CONVST fallback. |
◆ ConvstWrite()
| void Ads9324SpiHostAdapter::ConvstWrite |
( |
bool |
high | ) |
|
|
noexcept |
Drive CONVST.
- Parameters
-
| high | true = SetActive() (CONVST high), false = SetInactive(). |
◆ DelayMs()
| void Ads9324SpiHostAdapter::DelayMs |
( |
uint32_t |
ms | ) |
|
|
noexcept |
Sleep milliseconds via os_delay_msec (chunked at 65535 ms).
- Parameters
-
◆ DelayUs()
| void Ads9324SpiHostAdapter::DelayUs |
( |
uint32_t |
us | ) |
|
|
noexcept |
Busy-wait microseconds (nested volatile loop).
- Parameters
-
◆ DrdyRead()
| bool Ads9324SpiHostAdapter::DrdyRead |
( |
| ) |
|
|
noexcept |
Sample DRDY.
- Returns
IsActive() of the DRDY pin, or true when DRDY is not wired.
◆ HasDrdy()
| bool Ads9324SpiHostAdapter::HasDrdy |
( |
| ) |
const |
|
noexcept |
Whether a DRDY GPIO was supplied.
- Returns
- false → driver uses
ADS9324_CFG::CONV_FALLBACK_US.
◆ transfer()
| bool Ads9324SpiHostAdapter::transfer |
( |
const uint8_t * |
tx, |
|
|
uint8_t * |
rx, |
|
|
std::size_t |
len |
|
) |
| |
|
noexcept |
Full-duplex SPI transfer (CRTP dispatch target).
- Parameters
-
| tx | Transmit buffer, or nullptr to clock zeros. |
| rx | Receive buffer, or nullptr to discard MISO. |
| len | Byte count (3 for config; N×2 or N×3 for conversion). |
- Returns
- true when the bytes were clocked, false on a BaseSpi error.
◆ convst_
| BaseGpio* Ads9324SpiHostAdapter::convst_ |
|
private |
CONVST (required at handler Initialize).
◆ drdy_
| BaseGpio* Ads9324SpiHostAdapter::drdy_ |
|
private |
Optional DRDY; nullptr = timed wait.
◆ spi_
| BaseSpi& Ads9324SpiHostAdapter::spi_ |
|
private |
The documentation for this class was generated from the following files: