ADS7952 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Functions | Variables
ads7952::reg Namespace Reference

The ADS795x frame format. More...

Functions

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

Detailed Description

The ADS795x frame format.