CTS-SAT-1-OBC-Firmware
|
#include "eps_drivers/eps_power_management.h"
#include <string.h>
#include <stdint.h>
#include <stdio.h>
#include "rtos_tasks/rtos_eps_tasks.h"
#include "eps_drivers/eps_types_to_json.h"
#include "eps_drivers/eps_commands.h"
#include "log/log.h"
Functions | |
uint8_t | EPS_monitor_and_disable_overcurrent_channels () |
Monitors the power consumption of each channel and logs the data in JSON format. | |
uint8_t | EPS_log_pdu_json (const EPS_struct_pdu_housekeeping_data_eng_t *EPS_pdu_housekeeping_data_eng) |
Logs the PDU housekeeping data in JSON format. | |
void | EPS_channel_management (const EPS_struct_pdu_housekeeping_data_eng_t *EPS_pdu_housekeeping_data_eng) |
Monitor the power consumption of each channel and disable any channels that exceed a certain threshold. | |
void | EPS_CMD_power_management_set_current_threshold (uint8_t channel, uint16_t threshold) |
Variables | |
uint16_t | EPS_current_mA_threshhold [32] |
void EPS_channel_management | ( | const EPS_struct_pdu_housekeeping_data_eng_t * | EPS_pdu_housekeeping_data_eng | ) |
Monitor the power consumption of each channel and disable any channels that exceed a certain threshold.
[in] | EPS_pdu_housekeeping_data_eng | PDU housekeeping data with the current power consumption of each channel |
[in] | prev_EPS_pdu_housekeeping_data_eng | Previous PDU housekeeping data with the previous power consumption of each chan/// |
void EPS_CMD_power_management_set_current_threshold | ( | uint8_t | channel, |
uint16_t | threshold ) |
uint8_t EPS_log_pdu_json | ( | const EPS_struct_pdu_housekeeping_data_eng_t * | EPS_pdu_housekeeping_data_eng | ) |
Logs the PDU housekeeping data in JSON format.
[in] | EPS_pdu_housekeeping_data_eng | PDU housekeeping data to be logged |
uint8_t EPS_monitor_and_disable_overcurrent_channels | ( | ) |
Monitors the power consumption of each channel and logs the data in JSON format.
This function will obtain the PDU housekeeping data and log the data in JSON format. If this is the first time the function is called, it will save the data for future comparisons. It will then check if the power consumption has increased or decreased by more than a certain threshold. If it has, it will disable the channel and log an error message. The function will log an error message if the channel is disabled due to a power issue.
uint16_t EPS_current_mA_threshhold[32] |