peary::device::AuxiliaryDevice

Caribou Auxiliary Device class definition. More…

#include <peary/device/AuxiliaryDevice.hpp>

Inherits from peary::device::Device

Public Functions

Name
template <typename… Args> AuxiliaryDevice(std::string_view name, const config::Configuration & config, Args &&… args)Constructor for auxiliary devices.
virtual ~AuxiliaryDevice()Default destructor for Peary Devices.
virtual std::string getType() overrideReturn the human-readable device type.
virtual std::string getFirmwareVersion() overrideReturn the firmware version string for reference.
virtual std::optional< utils::pearyRawData > getRawData() overrideRaw and decoded data readback.
virtual std::optional< utils::pearyRawDataVector > getRawData(const unsigned int noFrames) overrideRaw and decoded data readback.
virtual std::optional< utils::pearydata > getData() overrideRaw and decoded data readback.
virtual std::optional< utils::pearydataVector > getData(const unsigned int noFrames) overrideRaw and decoded data readback.
virtual void powerOn() overridePower ON the device.
virtual void powerOff() overridePower OFF the device.
virtual void daqStart() overrideStart data acquisition.
virtual void daqStop() overrideStop the data acquisition.
virtual void setRegister(const std::string & , uintptr_t ) overrideSet a register on this device.
virtual uintptr_t getRegister(const std::string & ) overrideGet a register from this device.
virtual bool hasRegister(const std::string & ) const overrideCheck if a register exists.
virtual std::vector< std::pair< std::string, uintptr_t > > getRegisters() overrideGet all registers from this device.
virtual std::vector< std::string > listMemories() overrideList all memory registers available on this device.
virtual std::vector< std::string > listRegisters() overrideList all registers available on this device.
virtual std::vector< std::pair< std::string, std::string > > listResources() overrideList all resources registered by this device.
virtual void configureClock(const std::string & , const std::any & ) overrideConfigure clock synthesizer.
virtual void disableClock(const std::string & ) overrideDisable clock output.
virtual bool isClockLocked(const std::string & ) overrideCheck if a clock output is locked.
virtual void setClockFrequency(const std::string & , uint64_t ) overrideSet frequency of a clock output on the board.
virtual void setVoltage(const std::string & , double ) overrideSet voltage and current limit on the board resource.
virtual void setCurrentLimit(const std::string & , double ) overrideSet current limit on the board resource.
virtual void setCurrent(const std::string & , double , utils::Polarity ) overrideSet current on the board resource.
virtual void switchOn(const std::string & ) overrideSwitch on the given board resource.
virtual void switchOff(const std::string & ) overrideSwitch off the given board resource.
virtual double getVoltage(const std::string & ) overrideGet voltage of the given board resource.
virtual double getCurrent(const std::string & ) overrideGet current from the given board resource.
virtual double getPower(const std::string & ) overrideGet power consumption of the given board resource.
virtual void configure() overrideConfigure the device.
virtual void set(std::string , uintptr_t )Set a parameter on the device.
virtual double get(std::string )Get a parameter from the device.
virtual void reset() overrideSending reset signal to the device.
virtual void setMemory(const std::string & , size_t , uintptr_t ) overrideSet memory register on this device.
virtual void setMemory(const std::string & , uintptr_t ) overrideSet memory register on this device.
virtual uintptr_t getMemory(const std::string & , size_t ) overrideGet memory register from this device.
virtual uintptr_t getMemory(const std::string & ) overrideGet memory register from this device.
virtual std::vector< std::pair< std::string, uintptr_t > > getMemories() overrideGet all memory registers from this device.
virtual bool hasMemory(const std::string & name) const overrideCheck if this device has a memory register with the given name.

Protected Functions

Name
T::data_t send(const typename T::data_t & data)Send data to a device which does not contain internal register.
std::vector< typename T::data_t > send(const std::vector< typename T::data_t > & data)Write data to a device which does not contain internal register.
std::pair< typename T::reg_t, typename T::data_t > send(const std::pair< typename T::reg_t, typename T::data_t > & data)Write data to a device containing internal registers.
std::vector< typename T::data_t > send(const typename T::reg_t & reg, const std::vector< typename T::data_t > & data)Write data to a device containing internal registers.
std::vector< std::pair< typename T::reg_t, typename T::data_t > > send(const std::vector< std::pair< typename T::reg_t, typename T::data_t » & data)Write data to a device containing internal registers.
T::vector_t receive(const unsigned int length =1)Receive data from a device which does not contain internal register.
T::vector_t receive(const typename T::reg_t reg, const unsigned int length =1)Receive data from a device containing internal registers.

Protected Attributes

Name
config::Configuration _config
T _interface

Additional inherited members

Public Functions inherited from peary::device::Device

Name
Device(std::string_view name, const config::Configuration & )Default constructor for Peary Devices.
virtual ~Device()Default destructor for Peary Devices.
bool isManaged()Indicator flag for managed devices.
std::string getVersion()Return the software version string for reference.
std::string getName()Return the human-readable device name (full qualifier)
std::vector< std::pair< std::string, std::size_t > > listCommands()Retrieve list of all available device-specifiv commands.
std::string command(const std::string & name, const std::vector< std::string > & args =std::vector< std::string >())Call device-specific command with a list of arguments.
std::string command(const std::string & name, const std::string & arg)Call device-specific command with a single argument.

Protected Attributes inherited from peary::device::Device

Name
utils::Dispatcher _dispatcher Command dispatcher for this device.

Friends inherited from peary::device::Device

Name
class DeviceManager

Detailed Description

  template <typename T >
class peary::device::AuxiliaryDevice;
  

Caribou Auxiliary Device class definition.

Template Parameters:

  • T Type of the interface

Public Functions Documentation

function AuxiliaryDevice

  template <typename... Args>
AuxiliaryDevice(
    std::string_view name,
    const config::Configuration & config,
    Args &&... args
)
  

Constructor for auxiliary devices.

function ~AuxiliaryDevice

  virtual ~AuxiliaryDevice()
  

Default destructor for Peary Devices.

function getType

  virtual std::string getType() override
  

Return the human-readable device type.

Reimplements: peary::device::Device::getType

function getFirmwareVersion

  inline virtual std::string getFirmwareVersion() override
  

Return the firmware version string for reference.

Reimplements: peary::device::Device::getFirmwareVersion

function getRawData

  virtual std::optional< utils::pearyRawData > getRawData() override
  

Raw and decoded data readback.

Reimplements: peary::device::Device::getRawData

function getRawData

  virtual std::optional< utils::pearyRawDataVector > getRawData(
    const unsigned int noFrames
) override
  

Raw and decoded data readback.

Parameters:

  • noFrames Number of frames to be read

Return: Vector of raw data frames

Reimplements: peary::device::Device::getRawData

function getData

  virtual std::optional< utils::pearydata > getData() override
  

Raw and decoded data readback.

Return: Decoded data structure

Reimplements: peary::device::Device::getData

function getData

  virtual std::optional< utils::pearydataVector > getData(
    const unsigned int noFrames
) override
  

Raw and decoded data readback.

Parameters:

  • noFrames Number of frames to be read

Return: Vector of decoded data frames

Reimplements: peary::device::Device::getData

function powerOn

  inline virtual void powerOn() override
  

Power ON the device.

Reimplements: peary::device::Device::powerOn

function powerOff

  inline virtual void powerOff() override
  

Power OFF the device.

Reimplements: peary::device::Device::powerOff

function daqStart

  inline virtual void daqStart() override
  

Start data acquisition.

Reimplements: peary::device::Device::daqStart

function daqStop

  inline virtual void daqStop() override
  

Stop the data acquisition.

Reimplements: peary::device::Device::daqStop

function setRegister

  inline virtual void setRegister(
    const std::string & ,
    uintptr_t 
) override
  

Set a register on this device.

Reimplements: peary::device::Device::setRegister

function getRegister

  inline virtual uintptr_t getRegister(
    const std::string & 
) override
  

Get a register from this device.

Reimplements: peary::device::Device::getRegister

function hasRegister

  inline virtual bool hasRegister(
    const std::string & 
) const override
  

Check if a register exists.

Reimplements: peary::device::Device::hasRegister

function getRegisters

  inline virtual std::vector< std::pair< std::string, uintptr_t > > getRegisters() override
  

Get all registers from this device.

Reimplements: peary::device::Device::getRegisters

function listMemories

  inline virtual std::vector< std::string > listMemories() override
  

List all memory registers available on this device.

Reimplements: peary::device::Device::listMemories

function listRegisters

  inline virtual std::vector< std::string > listRegisters() override
  

List all registers available on this device.

Reimplements: peary::device::Device::listRegisters

function listResources

  inline virtual std::vector< std::pair< std::string, std::string > > listResources() override
  

List all resources registered by this device.

Reimplements: peary::device::Device::listResources

function configureClock

  inline virtual void configureClock(
    const std::string & ,
    const std::any & 
) override
  

Configure clock synthesizer.

Reimplements: peary::device::Device::configureClock

function disableClock

  inline virtual void disableClock(
    const std::string & 
) override
  

Disable clock output.

Reimplements: peary::device::Device::disableClock

function isClockLocked

  inline virtual bool isClockLocked(
    const std::string & 
) override
  

Check if a clock output is locked.

Reimplements: peary::device::Device::isClockLocked

function setClockFrequency

  inline virtual void setClockFrequency(
    const std::string & ,
    uint64_t 
) override
  

Set frequency of a clock output on the board.

Reimplements: peary::device::Device::setClockFrequency

function setVoltage

  inline virtual void setVoltage(
    const std::string & ,
    double 
) override
  

Set voltage and current limit on the board resource.

Reimplements: peary::device::Device::setVoltage

function setCurrentLimit

  inline virtual void setCurrentLimit(
    const std::string & ,
    double 
) override
  

Set current limit on the board resource.

Reimplements: peary::device::Device::setCurrentLimit

function setCurrent

  inline virtual void setCurrent(
    const std::string & ,
    double ,
    utils::Polarity 
) override
  

Set current on the board resource.

Reimplements: peary::device::Device::setCurrent

function switchOn

  inline virtual void switchOn(
    const std::string & 
) override
  

Switch on the given board resource.

Reimplements: peary::device::Device::switchOn

function switchOff

  inline virtual void switchOff(
    const std::string & 
) override
  

Switch off the given board resource.

Reimplements: peary::device::Device::switchOff

function getVoltage

  inline virtual double getVoltage(
    const std::string & 
) override
  

Get voltage of the given board resource.

Reimplements: peary::device::Device::getVoltage

function getCurrent

  inline virtual double getCurrent(
    const std::string & 
) override
  

Get current from the given board resource.

Reimplements: peary::device::Device::getCurrent

function getPower

  inline virtual double getPower(
    const std::string & 
) override
  

Get power consumption of the given board resource.

Reimplements: peary::device::Device::getPower

function configure

  inline virtual void configure() override
  

Configure the device.

Reimplements: peary::device::Device::configure

function set

  inline virtual void set(
    std::string ,
    uintptr_t 
)
  

Set a parameter on the device.

function get

  inline virtual double get(
    std::string 
)
  

Get a parameter from the device.

function reset

  inline virtual void reset() override
  

Sending reset signal to the device.

Reimplements: peary::device::Device::reset

function setMemory

  inline virtual void setMemory(
    const std::string & ,
    size_t ,
    uintptr_t 
) override
  

Set memory register on this device.

Reimplements: peary::device::Device::setMemory

function setMemory

  inline virtual void setMemory(
    const std::string & ,
    uintptr_t 
) override
  

Set memory register on this device.

Reimplements: peary::device::Device::setMemory

function getMemory

  inline virtual uintptr_t getMemory(
    const std::string & ,
    size_t 
) override
  

Get memory register from this device.

Reimplements: peary::device::Device::getMemory

function getMemory

  inline virtual uintptr_t getMemory(
    const std::string & 
) override
  

Get memory register from this device.

Reimplements: peary::device::Device::getMemory

function getMemories

  inline virtual std::vector< std::pair< std::string, uintptr_t > > getMemories() override
  

Get all memory registers from this device.

Reimplements: peary::device::Device::getMemories

function hasMemory

  inline virtual bool hasMemory(
    const std::string & name
) const override
  

Check if this device has a memory register with the given name.

Parameters:

  • name Name of the memory register

Return: True if a memory register with this name is available, false otherwise

Reimplements: peary::device::Device::hasMemory

Protected Functions Documentation

function send

  T::data_t send(
    const typename T::data_t & data
)
  

Send data to a device which does not contain internal register.

Parameters:

  • data Data to be sent

Return: Data read back if readout is integral part of write operations

function send

  std::vector< typename T::data_t > send(
    const std::vector< typename T::data_t > & data
)
  

Write data to a device which does not contain internal register.

Parameters:

  • data Vector of data to be sent

Return: Data read back if readout is integral part of write operations

function send

  std::pair< typename T::reg_t, typename T::data_t > send(
    const std::pair< typename T::reg_t, typename T::data_t > & data
)
  

Write data to a device containing internal registers.

Parameters:

  • data Pair of register address and data to be sent

Return: Pair of register address and data read back if readout is integral part of write operations

function send

  std::vector< typename T::data_t > send(
    const typename T::reg_t & reg,
    const std::vector< typename T::data_t > & data
)
  

Write data to a device containing internal registers.

Parameters:

  • reg Register address to which data is to be sent
  • data Vector of data to be sent

Return: Data read back if readout is integral part of write operations

function send

  std::vector< std::pair< typename T::reg_t, typename T::data_t > > send(
    const std::vector< std::pair< typename T::reg_t, typename T::data_t >> & data
)
  

Write data to a device containing internal registers.

Parameters:

  • data Vector of pairs of register address and data to be sent

Return: Vector of pairs of register address and data read back if readout is integral part of write operations

function receive

  T::vector_t receive(
    const unsigned int length =1
)
  

Receive data from a device which does not contain internal register.

Parameters:

  • length Number of data words to be read

Return: Data read back

function receive

  T::vector_t receive(
    const typename T::reg_t reg,
    const unsigned int length =1
)
  

Receive data from a device containing internal registers.

Parameters:

  • reg Register address from which data is to be read
  • length Number of data words to be read

Return: Data read back

Protected Attributes Documentation

variable _config

  config::Configuration _config;
  

Device configuration object

variable _interface

  T _interface;
  

interface


Updated on 2026-01-30 at 22:01:05 +0100