HF-ADS7952 Driver 0.1.0-dev
HF-ADS7952 C++ Driver
Loading...
Searching...
No Matches
Channel Mask Helpers

Helpers and constants for Auto-1 sequence mask construction. More...

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).
 

Detailed Description

Helpers and constants for Auto-1 sequence mask construction.

Function Documentation

◆ ChannelMask()

template<typename... Channels>
constexpr uint16_t ads7952::ChannelMask ( Channels... channels)
constexprnoexcept

Construct a channel enable bitmask from a list of channel numbers.

Bit ordering: bit N corresponds to channel N (bit 0 = CH0, bit 11 = CH11). Only channels 0–11 are valid; out-of-range values are silently masked.

Template Parameters
ChannelsVariadic uint8_t channel numbers
Parameters
channelsChannel numbers to include (0–11)
Returns
uint16_t bitmask suitable for ProgramAuto1Channels()
adc.ProgramAuto1Channels(ads7952::ChannelMask(0, 2, 4, 6, 8, 10));
constexpr uint16_t ChannelMask(Channels... channels) noexcept
Construct a channel enable bitmask from a list of channel numbers.

Definition at line 216 of file ads7952_types.hpp.

◆ ChannelRangeMask()

constexpr uint16_t ads7952::ChannelRangeMask ( uint8_t first,
uint8_t last )
constexprnoexcept

Build a contiguous channel range mask from first to last (inclusive).

Parameters
firstFirst channel index (0-11).
lastLast channel index (0-11), must be >= first.
Returns
Bitmask containing channels [first..last], or 0 if invalid input.

Definition at line 231 of file ads7952_types.hpp.