![]() |
FOSSASAT-1B
|
#include "FossaSat1B.h"
Go to the source code of this file.
Data Structures | |
struct | powerConfigBits_t |
Power configuration strutcture, each entry is one bit long. Total 1 byte, lowPowerModeActive is the least significant bit. More... | |
union | powerConfig_t |
Union to quickly access power configuration bits or the entire single-byte value. More... | |
Functions | |
void | Power_Control_Load_Configuration () |
Load the configuration bytes from the EEPROM into RAM. More... | |
void | Power_Control_Save_Configuration () |
Saves the configuration bytes from RAM into EEPROM. More... | |
void | Power_Control_Charge (bool charge) |
This function ensures that the battery is charging. "set MPPT to input which enables battery charging, but only after checking keep alive and temperature limit". More... | |
uint32_t | Power_Control_Get_Sleep_Interval () |
Get the amount of seconds to sleep for given the battery voltage. More... | |
void | Power_Control_Delay (uint32_t ms, bool sleep, bool sleepRadio=false) |
This function delays the program execution for the given number of milliseconds, while maintaining the watchdog signal to prevent it resetting. More... | |
void | Power_Control_Setup_INA226 () |
Initializes the INA226 current sensor. More... | |
bool | Power_Control_INA226_Check () |
Check that the INA2256 is valid. More... | |
float | Power_Control_Get_Battery_Voltage () |
Get the battery voltage by switching the MPPT off and then on again after reading is taken. More... | |
float | Power_Control_Get_Charging_Voltage () |
Gets the charging voltage (from the solar panels) by not switching the MPPT off and taking an INA226 reading. More... | |
float | Power_Control_Get_Charging_Current () |
Gets the amperage which is being provided to the battery. More... | |
bool | Power_Control_Check_Battery_Limit () |
Checks whether battery voltage is below low power limit. Will enable low power mode if that is the case. More... | |
Variables | |
powerConfig_t | powerConfig |
The current power configuration settings. | |
void Power_Control_Charge | ( | bool | charge | ) |
This function ensures that the battery is charging. "set MPPT to input which enables battery charging, but only after checking keep alive and temperature limit".
(ID POWER_CONT_H_T3) (SEV 1) Make sure the battery charges when this function is called.
(ID POWER_CONT_H_T4) (SEV 1) When mppt keep alive is enabled, make sure that the battery charges.
(ID POWER_CONT_H_T5) (SEV 1) When mppt temperature switch is enabled, make sure the battery doesn't charge.
(ID POWER_CONT_H_T6) (SEV 1) When the charge boolean is TRUE, is allows the battery to charge.
(ID POWER_CONT_H_T14) (SEV 1) When the charge boolean is FALSe, is prevents the battery to charge.
charge | The option to charge the battery or turn off the MPPT. |
Definition at line 23 of file power_control.cpp.
bool Power_Control_Check_Battery_Limit | ( | ) |
Checks whether battery voltage is below low power limit. Will enable low power mode if that is the case.
Definition at line 169 of file power_control.cpp.
void Power_Control_Delay | ( | uint32_t | ms, |
bool | sleep, | ||
bool | sleepRadio = false |
||
) |
This function delays the program execution for the given number of milliseconds, while maintaining the watchdog signal to prevent it resetting.
ms | The amount of time to delay the program for. |
sleep | Whether to use the LowPower libraries powerDown feature. |
sleepRadio | Whether to put the radio into sleep mode for the duration. |
Definition at line 73 of file power_control.cpp.
float Power_Control_Get_Battery_Voltage | ( | ) |
Get the battery voltage by switching the MPPT off and then on again after reading is taken.
Definition at line 139 of file power_control.cpp.
float Power_Control_Get_Charging_Current | ( | ) |
Gets the amperage which is being provided to the battery.
Definition at line 162 of file power_control.cpp.
float Power_Control_Get_Charging_Voltage | ( | ) |
Gets the charging voltage (from the solar panels) by not switching the MPPT off and taking an INA226 reading.
Definition at line 155 of file power_control.cpp.
uint32_t Power_Control_Get_Sleep_Interval | ( | ) |
Get the amount of seconds to sleep for given the battery voltage.
Definition at line 47 of file power_control.cpp.
bool Power_Control_INA226_Check | ( | ) |
Check that the INA2256 is valid.
Definition at line 114 of file power_control.cpp.
void Power_Control_Load_Configuration | ( | ) |
Load the configuration bytes from the EEPROM into RAM.
Definition at line 15 of file power_control.cpp.
void Power_Control_Save_Configuration | ( | ) |
Saves the configuration bytes from RAM into EEPROM.
Definition at line 19 of file power_control.cpp.
void Power_Control_Setup_INA226 | ( | ) |
Initializes the INA226 current sensor.
Definition at line 108 of file power_control.cpp.