HF-ADS7952 Driver 0.1.0-dev
HF-ADS7952 C++ Driver
Loading...
Searching...
No Matches
ads7952_types.hpp File Reference

Type definitions for the ADS7952 driver. More...

#include <cstdint>
#include <type_traits>

Go to the source code of this file.

Classes

struct  ads7952::GPIOConfig
 
struct  ads7952::ReadResult
 
struct  ads7952::ChannelReadings
 

Namespaces

namespace  ads7952
 
namespace  ads7952::gpio
 

Enumerations

enum class  ads7952::Mode : uint8_t { ads7952::Mode::Manual , ads7952::Mode::Auto1 , ads7952::Mode::Auto2 }
 
enum class  ads7952::Range : uint8_t { ads7952::Range::Vref , ads7952::Range::TwoVref }
 
enum class  ads7952::PowerDown : uint8_t { ads7952::PowerDown::Normal , ads7952::PowerDown::PowerDown }
 
enum class  ads7952::AlarmBound : uint8_t { ads7952::AlarmBound::Low = 0 , ads7952::AlarmBound::High = 1 }
 
enum class  ads7952::Error : uint8_t {
  ads7952::Error::Ok = 0 , ads7952::Error::NotInitialized , ads7952::Error::InvalidChannel , ads7952::Error::SpiError ,
  ads7952::Error::ProgrammingFailed , ads7952::Error::ModeChangeFailed , ads7952::Error::Timeout
}
 
enum class  ads7952::GPIO01AlarmMode : uint8_t {
  ads7952::GPIO01AlarmMode::GPIO = 0 , ads7952::GPIO01AlarmMode::GPIO0_HighAndLowAlarm = 1 , ads7952::GPIO01AlarmMode::GPIO0_HighAlarm = 2 , ads7952::GPIO01AlarmMode::GPIO1_HighAlarm = 4 ,
  ads7952::GPIO01AlarmMode::GPIO1_LowAlarm_GPIO0_HighAlarm = 6
}
 

Functions

template<typename... Channels>
constexpr uint16_t ads7952::ChannelMask (Channels... channels) noexcept
 Construct a channel enable bitmask from a list of channel numbers.
 
constexpr uint16_t ads7952::ChannelRangeMask (uint8_t first, uint8_t last) noexcept
 Build a contiguous channel range mask from first to last (inclusive).
 
constexpr uint16_t ads7952::VoltageToCount (float voltage, float vref) noexcept
 Convert a voltage to a 12-bit ADC count.
 

Variables

constexpr uint8_t ads7952::gpio::kGPIO0 = 0x01
 Bit 0 — GPIO pin 0.
 
constexpr uint8_t ads7952::gpio::kGPIO1 = 0x02
 Bit 1 — GPIO pin 1.
 
constexpr uint8_t ads7952::gpio::kGPIO2 = 0x04
 Bit 2 — GPIO pin 2.
 
constexpr uint8_t ads7952::gpio::kGPIO3 = 0x08
 Bit 3 — GPIO pin 3.
 
constexpr uint8_t ads7952::gpio::kAll = 0x0F
 All 4 GPIO pins.
 
constexpr uint8_t ads7952::gpio::kNone = 0x00
 No GPIO pins.
 
Predefined Auto-1 Channel Masks

Bit ordering: bit N = channel N, bit 0 = CH0 (LSB).

constexpr uint16_t ads7952::kAllChannels = 0x0FFF
 CH0–CH11 (all 12)
 
constexpr uint16_t ads7952::kEvenChannels = 0x0555
 CH0, CH2, CH4, CH6, CH8, CH10.
 
constexpr uint16_t ads7952::kOddChannels = 0x0AAA
 CH1, CH3, CH5, CH7, CH9, CH11.
 
constexpr uint16_t ads7952::kFirstFour = 0x000F
 CH0–CH3.
 
constexpr uint16_t ads7952::kSecondFour = 0x00F0
 CH4–CH7.
 
constexpr uint16_t ads7952::kThirdFour = 0x0F00
 CH8–CH11.
 

Detailed Description

Type definitions for the ADS7952 driver.

Provides enum classes, result structures, and configuration types used throughout the ADS7952 driver and application code.

Definition in file ads7952_types.hpp.