ADS7952 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Functions | Variables
Frame format

Command words, program registers and the reply word. More...

Functions

constexpr uint8_t ads7952::reg::ReplyAddress (uint16_t reply) noexcept
 The 4-bit field DO15:12 of a reply: the channel the result belongs to (DI04 = 0 in the frame before), or the levels of GPIO3:0 (DI04 = 1).
 
constexpr uint16_t ads7952::reg::ReplyCode (uint16_t reply) noexcept
 The 12-bit conversion result of a reply, DO11:00.
 
constexpr uint16_t ads7952::reg::ManualWord (uint8_t channel, uint16_t control) noexcept
 A Manual mode word with DI11 = 1: select channel for the next frame and set DI06:00.
 
constexpr uint16_t ads7952::reg::AutoWord (uint16_t mode, bool restart, uint16_t control) noexcept
 An Auto-1 or Auto-2 mode word with DI11 = 1.
 
constexpr uint16_t ads7952::reg::Auto2ProgramWord (uint8_t last) noexcept
 The Auto-2 program word: last becomes the last channel of the Auto-2 sequence.
 
constexpr uint16_t ads7952::reg::AlarmGroupWord (uint8_t group) noexcept
 The first frame of an alarm group's programming sequence.
 
constexpr uint16_t ads7952::reg::AlarmThresholdWord (uint8_t channel_in_group, bool high, bool exit, uint16_t threshold) noexcept
 One alarm threshold frame of a group's programming sequence.
 

Variables

constexpr uint32_t ads7952::reg::kCommandShift = 12
 DI15:12 hold the command.
 
constexpr uint16_t ads7952::reg::kCommandMask = 0xF000U
 DI15:12.
 
constexpr uint16_t ads7952::reg::kContinue = 0x0000U
 0000: keep the mode, ignore DI11:00.
 
constexpr uint16_t ads7952::reg::kManual = 0x1000U
 0001: Manual mode (Table 1).
 
constexpr uint16_t ads7952::reg::kAuto1 = 0x2000U
 0010: Auto-1 mode (Table 2).
 
constexpr uint16_t ads7952::reg::kAuto2 = 0x3000U
 0011: Auto-2 mode (Table 5).
 
constexpr uint16_t ads7952::reg::kGpioProgram = 0x4000U
 0100: GPIO program register (Table 11).
 
constexpr uint16_t ads7952::reg::kAuto1Program = 0x8000U
 1000: Auto-1 mask in the next frame.
 
constexpr uint16_t ads7952::reg::kAuto2Program = 0x9000U
 1001: Auto-2 last channel (Table 6).
 
constexpr uint16_t ads7952::reg::kAlarmProgramGroup0 = 0xC000U
 11bb: alarm group bb (Table 13).
 
constexpr uint16_t ads7952::reg::kProgramEnable = 0x0800U
 DI11: take DI10:00 (Manual: DI06:00).
 
constexpr uint16_t ads7952::reg::kAutoReset = 0x0400U
 DI10, Auto modes: restart the sequence.
 
constexpr uint32_t ads7952::reg::kManualChannelShift = 7
 DI10:07, Manual: the next channel.
 
constexpr uint16_t ads7952::reg::kRangeTwoVref = 0x0040U
 DI06: 0 to 2 x VREF (Range 2).
 
constexpr uint16_t ads7952::reg::kPowerDown = 0x0020U
 DI05: power down at the next frame's end.
 
constexpr uint16_t ads7952::reg::kGpioReadout = 0x0010U
 DI04: next reply carries GPIO3:0 in DO15:12.
 
constexpr uint16_t ads7952::reg::kGpioDataMask = 0x000FU
 DI03:00: GPIO output levels.
 
constexpr uint16_t ads7952::reg::kControlMask = 0x007FU
 DI06:00: the bits a mode word programs.
 
constexpr uint32_t ads7952::reg::kAuto2LastShift = 6
 DI09:06: the last channel of the sequence.
 
constexpr uint16_t ads7952::reg::kGpioResetAll = 0x0200U
 DI09: reset every register next frame.
 
constexpr uint16_t ads7952::reg::kGpio3PowerDown = 0x0100U
 DI08: GPIO3 is the power-down input.
 
constexpr uint16_t ads7952::reg::kGpio2Range = 0x0080U
 DI07: GPIO2 is the range input.
 
constexpr uint32_t ads7952::reg::kGpioAlarmShift = 4
 DI06:04: GPIO0/GPIO1 alarm outputs.
 
constexpr uint16_t ads7952::reg::kGpioDirectionMask = 0x000FU
 DI03:00: 1 = output.
 
constexpr uint32_t ads7952::reg::kAlarmChannelShift = 14
 DI15:14: channel within the group.
 
constexpr uint16_t ads7952::reg::kAlarmHigh = 0x2000U
 DI13: 1 high threshold, 0 low.
 
constexpr uint16_t ads7952::reg::kAlarmExit = 0x1000U
 DI12: leave the sequence after this frame.
 
constexpr uint16_t ads7952::reg::kAlarmThresholdMask = 0x03FFU
 DI09:00: the upper 10 result bits.
 
constexpr uint16_t ads7952::reg::kAlarmHighReset = 0x03FFU
 High threshold after reset: all ones.
 
constexpr uint16_t ads7952::reg::kAlarmLowReset = 0x0000U
 Low threshold after reset: all zeros.
 
constexpr uint32_t ads7952::reg::kChannelsPerAlarmGroup = 4
 Table 12: four channels per group.
 
constexpr uint32_t ads7952::reg::kReplyAddressShift = 12
 DO15:12: channel address or GPIO3:0.
 
constexpr uint16_t ads7952::reg::kReplyCodeMask
 DO11:00: the 12-bit result, straight binary.
 

Detailed Description

Command words, program registers and the reply word.

Function Documentation

◆ AlarmGroupWord()

constexpr uint16_t ads7952::reg::AlarmGroupWord ( uint8_t  group)
constexprnoexcept

The first frame of an alarm group's programming sequence.

Parameters
group0 to 3 (channels 4 x group to 4 x group + 3).
Returns
The word.

◆ AlarmThresholdWord()

constexpr uint16_t ads7952::reg::AlarmThresholdWord ( uint8_t  channel_in_group,
bool  high,
bool  exit,
uint16_t  threshold 
)
constexprnoexcept

One alarm threshold frame of a group's programming sequence.

Parameters
channel_in_group0 to 3.
highThe high threshold (else the low one).
exitLeave the sequence after this frame.
thresholdThe 10-bit register value: the upper 10 bits of a 12-bit result.
Returns
The word.

◆ Auto2ProgramWord()

constexpr uint16_t ads7952::reg::Auto2ProgramWord ( uint8_t  last)
constexprnoexcept

The Auto-2 program word: last becomes the last channel of the Auto-2 sequence.

Parameters
last0 to 15.
Returns
The word.

◆ AutoWord()

constexpr uint16_t ads7952::reg::AutoWord ( uint16_t  mode,
bool  restart,
uint16_t  control 
)
constexprnoexcept

An Auto-1 or Auto-2 mode word with DI11 = 1.

Parameters
modekAuto1 or kAuto2.
restartSet DI10: start the sequence again at its first channel.
controlDI06:00.
Returns
The word.

◆ ManualWord()

constexpr uint16_t ads7952::reg::ManualWord ( uint8_t  channel,
uint16_t  control 
)
constexprnoexcept

A Manual mode word with DI11 = 1: select channel for the next frame and set DI06:00.

Parameters
channel0 to 15.
controlDI06:00 (range, power-down, GPIO readout, GPIO levels).
Returns
The word.

◆ ReplyAddress()

constexpr uint8_t ads7952::reg::ReplyAddress ( uint16_t  reply)
constexprnoexcept

The 4-bit field DO15:12 of a reply: the channel the result belongs to (DI04 = 0 in the frame before), or the levels of GPIO3:0 (DI04 = 1).

Parameters
replyThe 16-bit reply word.
Returns
0 to 15.

◆ ReplyCode()

constexpr uint16_t ads7952::reg::ReplyCode ( uint16_t  reply)
constexprnoexcept

The 12-bit conversion result of a reply, DO11:00.

Parameters
replyThe 16-bit reply word.
Returns
0 to 4095.

Variable Documentation

◆ kReplyCodeMask

constexpr uint16_t ads7952::reg::kReplyCodeMask
inlineconstexpr
Initial value:
=
0x0FFFU

DO11:00: the 12-bit result, straight binary.