ADS7952 Driver
API reference
Loading...
Searching...
No Matches
Namespaces | Classes | Enumerations | Functions
ads7952 Namespace Reference

Namespaces

namespace  detail
 CRTP-based template interface for SPI bus operations.
 
namespace  gpio
 
namespace  reg
 

Classes

class  ADS7952
 Main driver class for the ADS7952 ADC. More...
 
struct  ChannelReadings
 
struct  GPIOConfig
 
struct  ReadResult
 
class  SpiInterface
 

Enumerations

enum class  Mode : uint8_t { Mode::Manual , Mode::Auto1 , Mode::Auto2 }
 
enum class  Range : uint8_t { Range::Vref , Range::TwoVref }
 
enum class  PowerDown : uint8_t { PowerDown::Normal , PowerDown::PowerDown }
 
enum class  AlarmBound : uint8_t { AlarmBound::Low = 0 , AlarmBound::High = 1 }
 
enum class  Error : uint8_t {
  Error::Ok = 0 , Error::NotInitialized , Error::InvalidChannel , Error::SpiError ,
  Error::ProgrammingFailed , Error::ModeChangeFailed , Error::Timeout
}
 
enum class  GPIO01AlarmMode : uint8_t {
  GPIO01AlarmMode::GPIO = 0 , GPIO01AlarmMode::GPIO0_HighAndLowAlarm = 1 , GPIO01AlarmMode::GPIO0_HighAlarm = 2 , GPIO01AlarmMode::GPIO1_LowAlarm = 4 ,
  GPIO01AlarmMode::GPIO1_LowAlarm_GPIO0_HighAlarm = 6 , GPIO01AlarmMode::GPIO1_HighAlarm = GPIO1_LowAlarm
}
 GPIO0/GPIO1 alarm functions, the DI06:04 codes of the GPIO program register (SLAS605C Table 11). Alarm outputs are active high. The chip has no GPIO1 high-alarm code: GPIO1 can only be the low-alarm output. More...
 

Functions

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

Variables

Predefined Auto-1 Channel Masks

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

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

Variable Documentation

◆ kAllChannels

constexpr uint16_t ads7952::kAllChannels = 0x0FFF
inlineconstexpr

CH0–CH11 (all 12)

Definition at line 250 of file ads7952_types.hpp.

◆ kEvenChannels

constexpr uint16_t ads7952::kEvenChannels = 0x0555
inlineconstexpr

CH0, CH2, CH4, CH6, CH8, CH10.

Definition at line 251 of file ads7952_types.hpp.

◆ kFirstFour

constexpr uint16_t ads7952::kFirstFour = 0x000F
inlineconstexpr

CH0–CH3.

Definition at line 253 of file ads7952_types.hpp.

◆ kOddChannels

constexpr uint16_t ads7952::kOddChannels = 0x0AAA
inlineconstexpr

CH1, CH3, CH5, CH7, CH9, CH11.

Definition at line 252 of file ads7952_types.hpp.

◆ kSecondFour

constexpr uint16_t ads7952::kSecondFour = 0x00F0
inlineconstexpr

CH4–CH7.

Definition at line 254 of file ads7952_types.hpp.

◆ kThirdFour

constexpr uint16_t ads7952::kThirdFour = 0x0F00
inlineconstexpr

CH8–CH11.

Definition at line 255 of file ads7952_types.hpp.