HF-ADS7952 Driver 0.1.0-dev
HF-ADS7952 C++ Driver
Loading...
Searching...
No Matches
ads7952::reg::Alarm Namespace Reference

Functions

constexpr uint16_t ChannelInGroup (uint8_t ch_in_group) noexcept
 Encode alarm channel index within a 4-channel group.
 
constexpr uint16_t Threshold12To10 (uint16_t adc_12bit) noexcept
 Convert 12-bit ADC threshold to 10-bit alarm register format.
 
constexpr uint16_t GroupMode (uint8_t channel) noexcept
 Resolve alarm programming mode code for a global channel.
 

Variables

constexpr uint16_t HIGH_REGISTER = 0x2000
 
constexpr uint16_t LOW_REGISTER = 0x0000
 
constexpr uint16_t EXIT_NEXT_FRAME = 0x1000
 
constexpr uint16_t CONTINUE_PROG = 0x0000
 

Function Documentation

◆ ChannelInGroup()

constexpr uint16_t ads7952::reg::Alarm::ChannelInGroup ( uint8_t ch_in_group)
inlineconstexprnoexcept

Encode alarm channel index within a 4-channel group.

Parameters
ch_in_groupChannel offset in group [0..3].
Returns
Encoded channel-in-group bits [15:14].

Definition at line 168 of file ads7952_registers.hpp.

Referenced by ads7952::ADS7952< SpiType >::ProgramAlarm().

◆ GroupMode()

constexpr uint16_t ads7952::reg::Alarm::GroupMode ( uint8_t channel)
inlineconstexprnoexcept

Resolve alarm programming mode code for a global channel.

Parameters
channelGlobal channel index.
Returns
One of ALARM_GROUP_0..ALARM_GROUP_3 mode constants.

Definition at line 193 of file ads7952_registers.hpp.

References ads7952::reg::Mode::ALARM_GROUP_0, ads7952::reg::Mode::ALARM_GROUP_1, ads7952::reg::Mode::ALARM_GROUP_2, and ads7952::reg::Mode::ALARM_GROUP_3.

◆ Threshold12To10()

constexpr uint16_t ads7952::reg::Alarm::Threshold12To10 ( uint16_t adc_12bit)
inlineconstexprnoexcept

Convert 12-bit ADC threshold to 10-bit alarm register format.

Parameters
adc_12bitThreshold in 12-bit ADC count units.
Returns
Threshold bits [9:0] expected by alarm register.

Definition at line 183 of file ads7952_registers.hpp.

Referenced by ads7952::ADS7952< SpiType >::ProgramAlarm().

Variable Documentation

◆ CONTINUE_PROG

constexpr uint16_t ads7952::reg::Alarm::CONTINUE_PROG = 0x0000
inlineconstexpr

Definition at line 176 of file ads7952_registers.hpp.

◆ EXIT_NEXT_FRAME

constexpr uint16_t ads7952::reg::Alarm::EXIT_NEXT_FRAME = 0x1000
inlineconstexpr

Definition at line 175 of file ads7952_registers.hpp.

Referenced by ads7952::ADS7952< SpiType >::ProgramAlarm().

◆ HIGH_REGISTER

constexpr uint16_t ads7952::reg::Alarm::HIGH_REGISTER = 0x2000
inlineconstexpr

Definition at line 172 of file ads7952_registers.hpp.

Referenced by ads7952::ADS7952< SpiType >::ProgramAlarm().

◆ LOW_REGISTER

constexpr uint16_t ads7952::reg::Alarm::LOW_REGISTER = 0x0000
inlineconstexpr

Definition at line 173 of file ads7952_registers.hpp.