On this page
article
peary/hal/Resources.hpp
peary/hal/Resources.hpp
Resource Board Base Class. More…
Namespaces
| Name |
|---|
| peary |
| peary::hal |
Classes
| Name | |
|---|---|
| class | peary::hal::Resource Base class for resources. |
| class | peary::hal::E2Writer A resource that can write to memory. |
| class | peary::hal::E2Reader A resource that can read from memory. |
| class | peary::hal::TemperatureProvider A resource which can read a temperature value. |
| class | peary::hal::VoltageControl A resource which can control a voltage level. |
| class | peary::hal::CurrentLimiter A resource which can control a voltage level. |
| class | peary::hal::VoltageProvider A resource which can read a voltage level. |
| class | peary::hal::CurrentControl A resource which can control a current source. |
| class | peary::hal::CurrentProvider A resource which can read a current value. |
| class | peary::hal::PowerProvider A resource which can read a wattage. |
| class | peary::hal::SwitchControl A resource which can control a switch. |
| class | peary::hal::SwitchStatus A resource which can read the status of a switch. |
| class | peary::hal::AlertMonitor A resource which can monitor alerts. |
| class | peary::hal::ClockSynthesizer A resource which can control a clock multiplier and jitter attenuator. |
| class | peary::hal::Oscillator A resource which can control an oscillator. |
Detailed Description
Resource Board Base Class.
Copyright: Copyright (c) 2016-2025 CERN and the Peary Caribou authors. This software is distributed under the terms of the LGPL-3.0-only License, copied verbatim in the file “LICENSE.md”. SPDX-License-Identifier: LGPL-3.0-only
Source code
#pragma once
#include <any>
#include <cstdint>
#include <filesystem>
#include <string>
#include "peary/utils/datatypes.hpp"
namespace peary::hal {
class Resource {
public:
virtual ~Resource() = default;
void setName(const std::string& name) { _name = name; }
std::string name() const { return _name; }
protected:
std::string _name;
};
class E2Writer : virtual public Resource {
public:
virtual void write(uint16_t address, int value) = 0;
};
class E2Reader : virtual public Resource {
public:
virtual uint8_t read(uint16_t address) = 0;
};
class TemperatureProvider : virtual public Resource {
public:
virtual double getTemperature() = 0;
};
class VoltageControl : virtual public Resource {
public:
virtual void setVoltage(double voltage) = 0;
};
class CurrentLimiter : virtual public Resource {
public:
virtual void setCurrentLimit(double current_limit) = 0;
};
class VoltageProvider : virtual public Resource {
public:
virtual double getVoltage() = 0;
};
class CurrentControl : virtual public Resource {
public:
virtual void setCurrent(double current) = 0;
virtual void setPolarity(utils::Polarity polarity) = 0;
};
class CurrentProvider : virtual public Resource {
public:
virtual double getCurrent() = 0;
};
class PowerProvider : virtual public Resource {
public:
virtual double getPower() = 0;
};
class SwitchControl : virtual public Resource {
public:
virtual void setSwitch(bool enable) = 0;
};
class SwitchStatus : virtual public Resource {
public:
virtual bool getSwitch() = 0;
};
class AlertMonitor : virtual public Resource {
public:
virtual bool getAlertStatus() = 0;
};
class ClockSynthesizer : virtual public Resource {
public:
virtual void configure(const std::any& config) = 0;
virtual void disable() = 0;
virtual bool isLocked() = 0;
};
class Oscillator : virtual public Resource {
public:
virtual void setFrequency(uint64_t frequency) = 0;
};
} // namespace peary::hal
Updated on 2025-11-14 at 11:31:23 +0100