peary::board::carboard::VoltageRegulator

Voltage regulator resource for CaR board.

#include <peary/hardware/boards/Carboard.hpp>

Inherits from peary::hal::VoltageControl, peary::hal::VoltageProvider, peary::hal::CurrentLimiter, peary::hal::CurrentProvider, peary::hal::PowerProvider, peary::hal::SwitchControl, peary::hal::AlertMonitor, peary::hal::Resource

Public Functions

Name
VoltageRegulator(component::DAC7678 & dac, component::DAC7678::Channel dac_channel, component::INA226 & ina, component::PCA9539 & pca_pwr, component::PCA9539::Port pca_pwr_port, component::PCA9539::Channel pca_pwr_channel, component::PCA9539 & pca_alert, component::PCA9539::Port pca_alert_port, component::PCA9539::Channel pca_alert_channel)Constructor for VoltageRegulator class.
virtual void setVoltage(double voltage) overrideSet the output voltage for the voltage regulator.
virtual void setCurrentLimit(double current_limit) overrideSet the current limit for the voltage regulator.
virtual void setSwitch(bool enable) overrideEnable or disable the output of the voltage regulator.
virtual double getVoltage() overrideGet the output voltage of the voltage regulator.
virtual double getCurrent() overrideGet the output current of the voltage regulator.
virtual double getPower() overrideGet the output power of the voltage regulator.
virtual bool getAlertStatus() overrideGet the alert status of the voltage regulator.

Additional inherited members

Public Functions inherited from peary::hal::Resource

Name
virtual ~Resource() =defaultDefault constructor.
void setName(std::string_view name)Set the name of the resource.
std::string name() constGet the name of the resource.

Protected Attributes inherited from peary::hal::Resource

Name
std::string _name

Public Functions Documentation

function VoltageRegulator

  inline VoltageRegulator(
    component::DAC7678 & dac,
    component::DAC7678::Channel dac_channel,
    component::INA226 & ina,
    component::PCA9539 & pca_pwr,
    component::PCA9539::Port pca_pwr_port,
    component::PCA9539::Channel pca_pwr_channel,
    component::PCA9539 & pca_alert,
    component::PCA9539::Port pca_alert_port,
    component::PCA9539::Channel pca_alert_channel
)
  

Constructor for VoltageRegulator class.

Parameters:

  • dac Reference to the DAC7678 component
  • dac_channel The DAC channel to control the voltage regulator
  • ina Reference to the INA226 component for voltage, current, and power monitoring
  • pca_pwr Reference to the PCA9539 component for power control
  • pca_pwr_port The PCA port for power control
  • pca_pwr_channel The PCA channel for power control
  • pca_alert Reference to the PCA9539 component for alert monitoring
  • pca_alert_port The PCA port for alert monitoring
  • pca_alert_channel The PCA channel for alert monitoring

function setVoltage

  inline virtual void setVoltage(
    double voltage
) override
  

Set the output voltage for the voltage regulator.

Parameters:

  • voltage The voltage to set (in volts)

Reimplements: peary::hal::VoltageControl::setVoltage

function setCurrentLimit

  inline virtual void setCurrentLimit(
    double current_limit
) override
  

Set the current limit for the voltage regulator.

Parameters:

  • current_limit The current limit to set (in amperes)

Reimplements: peary::hal::CurrentLimiter::setCurrentLimit

function setSwitch

  inline virtual void setSwitch(
    bool enable
) override
  

Enable or disable the output of the voltage regulator.

Parameters:

  • enable True to enable the output, false to disable

Reimplements: peary::hal::SwitchControl::setSwitch

function getVoltage

  inline virtual double getVoltage() override
  

Get the output voltage of the voltage regulator.

Return: The output voltage (in volts)

Reimplements: peary::hal::VoltageProvider::getVoltage

function getCurrent

  inline virtual double getCurrent() override
  

Get the output current of the voltage regulator.

Return: The output current (in amperes)

Reimplements: peary::hal::CurrentProvider::getCurrent

function getPower

  inline virtual double getPower() override
  

Get the output power of the voltage regulator.

Return: The output power (in watts)

Reimplements: peary::hal::PowerProvider::getPower

function getAlertStatus

  inline virtual bool getAlertStatus() override
  

Get the alert status of the voltage regulator.

Return: True if an alert is active, false otherwise

Reimplements: peary::hal::AlertMonitor::getAlertStatus


Updated on 2026-01-16 at 00:29:05 +0100