SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
satnogs::comms::lib::power Class Reference

Manages power supplies and monitors subsystem status. More...

#include <power.hpp>

Classes

class  r_lim
 Current limit resistor configuration. More...
class  io_conf
 Represents the I/O configuration for the power management system. More...

Public Types

enum class  subsys : uint8_t {
  CAN1 = 0 , CAN2 = 1 , RF_5V = 2 , FPGA_5V = 3 ,
  CAN1_LPWR = 4 , CAN2_LPWR = 5 , UHF = 6 , SBAND = 7
}
 Identifies subsystems managed by the power class. More...
enum class  sensor : uint8_t { EFUSES = 0 , EMC1702 = 1 , AVERAGE = 2 }
 Identifies power measurement sources. More...
enum class  channel : uint8_t {
  FPGA = 1 , RF_5V = 2 , DIG_3V3 = 3 , VIN = 4 ,
  V_BAT = 5
}
 Identifies voltage and current measurement channels. More...
enum class  pgood_tp : uint8_t { RAIL_5V = 0 , RAIL_FPGA = 1 , RAIL_UHF = 2 , RAIL_SBAND = 3 }
 Power good indicator. More...

Public Member Functions

void enable (subsys sys, bool en=true)
 Enable/disable the power of subsystems.
bool enabled (subsys sys) const
 Checks the if the subsystem is enabled.
bool pgood (pgood_tp tp) const
 Gets the power good indication from various power supplies.
float voltage (channel sys) const
 Retrieves the voltage of a specified channel.
float current (channel sys) const
 Retrieves the current of a specified channel.
float get_power (sensor src) const
 Calculates the power consumption for a specified sensor source.
 power (const io_conf &io)

Detailed Description

Manages power supplies and monitors subsystem status.

Definition at line 42 of file power.hpp.

Member Enumeration Documentation

◆ channel

enum class satnogs::comms::lib::power::channel : uint8_t
strong

Identifies voltage and current measurement channels.

Enumerator
FPGA 

FPGA voltage/current channel.

RF_5V 

RF 5V voltage/current channel.

DIG_3V3 

Digital 3.3V voltage/current channel.

VIN 

Input voltage channel.

V_BAT 

Battery voltage channel.

Definition at line 76 of file power.hpp.

◆ pgood_tp

enum class satnogs::comms::lib::power::pgood_tp : uint8_t
strong

Power good indicator.

Enumerator
RAIL_5V 

5V rail

RAIL_FPGA 

FPGA rail.

RAIL_UHF 

UHF rail.

RAIL_SBAND 

S-Band rail.

Definition at line 89 of file power.hpp.

◆ sensor

enum class satnogs::comms::lib::power::sensor : uint8_t
strong

Identifies power measurement sources.

Enumerator
EFUSES 

Power measured by eFuses.

EMC1702 

Power measured by the EMC1702 sensor.

AVERAGE 

Average power from all available sources.

Definition at line 65 of file power.hpp.

◆ subsys

enum class satnogs::comms::lib::power::subsys : uint8_t
strong

Identifies subsystems managed by the power class.

Enumerator
CAN1 

CAN Bus 1.

CAN2 

CAN Bus 2.

RF_5V 

RF 5V supply.

FPGA_5V 

FPGA 5V supply.

CAN1_LPWR 

Low-power mode for CAN Bus 1.

CAN2_LPWR 

Low-power mode for CAN Bus 2.

UHF 

UHF subsystem.

SBAND 

S-Band subsystem.

Definition at line 49 of file power.hpp.

Constructor & Destructor Documentation

◆ power()

satnogs::comms::lib::power::power ( const io_conf & io)

Definition at line 233 of file power.cpp.

Member Function Documentation

◆ current()

float satnogs::comms::lib::power::current ( channel sys) const

Retrieves the current of a specified channel.

This function measures the current for a specific power channel using the corresponding ADC and resistor limits. Supported channels include the digital 3.3V rail, RF 5V rail, FPGA rail, and input voltage channel.

Parameters
sysThe channel for which the current is being measured:
Returns
The measured current in amperes (A).
Exceptions
inval_arg_exceptionif the specified channel is not supported.

Definition at line 174 of file power.cpp.

◆ enable()

void satnogs::comms::lib::power::enable ( subsys sys,
bool en = true )

Enable/disable the power of subsystems.

Parameters
systhe target subsystem/power supply
entrue to enable, false to disable

Definition at line 35 of file power.cpp.

◆ enabled()

bool satnogs::comms::lib::power::enabled ( subsys sys) const

Checks the if the subsystem is enabled.

Parameters
systhe subsystem to check
Returns
true if the subsystem is enabled, false otherwise

Definition at line 86 of file power.cpp.

◆ get_power()

float satnogs::comms::lib::power::get_power ( sensor src) const

Calculates the power consumption for a specified sensor source.

This function computes the power consumption based on the specified power sensor source. It supports efuses, EMC1702 sensor, and an averaged value.

Parameters
srcThe power sensor source
Returns
The calculated power in Watts.
Exceptions
inval_arg_exceptionif the specified sensor source is not supported.

Definition at line 209 of file power.cpp.

◆ pgood()

bool satnogs::comms::lib::power::pgood ( pgood_tp tp) const

Gets the power good indication from various power supplies.

Parameters
tpthe power supply
Returns
true if the power is good and stabilized, false otherwise

Definition at line 117 of file power.cpp.

◆ voltage()

float satnogs::comms::lib::power::voltage ( channel sys) const

Retrieves the voltage of a specified channel.

This function measures the voltage for a specific power channel in the system. Supported channels include the input voltage (VIN) and battery voltage (V_BAT).

Parameters
sysThe channel for which the voltage is being measured
Returns
The measured voltage in Volts.
Exceptions
`inval_arg_exception`if the specified channel is not supported.

Definition at line 146 of file power.cpp.


The documentation for this class was generated from the following files: