#include <stdint.h>
#include "eps_drivers/eps_types.h"
Go to the source code of this file.
◆ EPS_channel_from_str()
Converts an EPS channel name to a channel enum.
- Parameters
-
channel_name | A case-insensitive c-string of the channel name (e.g., "mpi"), or a number representing the channel number (e.g., "1" or "16"). Valid string values: "vbatt_stack", "stack_5v", "stack_3v3", "camera", "uhf_antenna_deploy", "gnss", "mpi_5v", "mpi_12v", "boom". |
- Returns
- The corresponding enum value. Returns EPS_CHANNEL_UNKNOWN if no match is found.
◆ EPS_channel_to_str()
Converts channel enum into an ASCII-printable name string.
- Parameters
-
channel | An enum of typedef EPS_CHANNEL_enum_t representing the different channel names of the EPS Ex. EPS_CHANNEL_VBATT_STACK , EPS_CHANNEL_5V_CH2_UNUSED or EPS_CHANNEL_3V3_UHF_ANTENNA_DEPLOY |
- Returns
- Returns a string of the channel name corresponding to the inputted channel enum
◆ EPS_check_status_bit_of_channel()
uint8_t EPS_check_status_bit_of_channel |
( |
uint16_t | status_bitfield_1, |
|
|
uint16_t | status_bitfield_2, |
|
|
uint8_t | channel_number ) |
Takes in the status bitfields of the eps and outputs the status of the given channel number.
- Parameters
-
status_bitfield_1 | The status bitfield of channels 0-15. |
status_bitfield_2 | The status bitfield of channels 16-31. |
- Returns
- 0 if the channel is disabled, 1 if the channel is enabled, and 2 if channel number is invalid
- Note
- If all channels are enabled, the output buffer would be require about 300 bytes.
◆ EPS_convert_ch_num_to_string_and_append()
uint8_t EPS_convert_ch_num_to_string_and_append |
( |
char * | response_output_buf, |
|
|
uint16_t | response_output_buf_len, |
|
|
uint8_t | ch_number ) |
Convert EPS ch_number to ch_name, then append as a JSON list element to response_output_buf.
- Parameters
-
response_output_buf | The output buffer that will store the string |
response_output_buf_len | The total length of the output buffer |
ch_number | The channel number of the EPS that will be converted to channel name |
- Returns
- 0 when string was properly outputted into the buffer, 1 if the channel number is invalid
◆ EPS_get_enabled_channels_json()
void EPS_get_enabled_channels_json |
( |
uint16_t | status_bitfield_1, |
|
|
uint16_t | status_bitfield_2, |
|
|
char * | response_output_buf, |
|
|
uint16_t | response_output_buf_len ) |
◆ EPS_set_channel_enabled()
Sets the enabled state of an EPS channel (on or off).
- Parameters
-
channel | The channel to enable or disable. |
enabled | 0 to disable, >0 to enable. |
- Returns
- 0 on success, >0 on failure. Returns 99 if channel is unknown. Propagates the return value from EPS_CMD_output_bus_channel_on/off().