|
CTS-SAT-1-OBC-Firmware
|
#include "config/configuration.h"#include "comms_drivers/ax100_tx.h"#include "comms_drivers/comms_tx.h"#include "rtos_tasks/rtos_bootup_operation_fsm_task.h"#include "comms_drivers/rf_antenna_switch.h"#include "rtos_tasks/rtos_bulk_downlink_task.h"#include "littlefs/littlefs_helper.h"#include <stdio.h>#include <stdint.h>#include <string.h>
Functions | |
| int16_t | CONFIG_get_int_var_index (const char *search_name) |
| Finds an int config variable in CONFIG_int_config_variables and returns its index. | |
| int16_t | CONFIG_get_str_var_index (const char *search_name) |
| Finds a string config variable in CONFIG_str_config_variables and returns its index. | |
| uint8_t | CONFIG_set_int_variable (const char *var_name, const uint64_t new_value) |
| Assigns a new value to an integer configuration variable. | |
| uint8_t | CONFIG_set_str_variable (const char *var_name, const char *new_value) |
| Assigns a new value to a string configuration variable. | |
| uint16_t | CONFIG_int_var_to_json (const char *var_name, char *json_str, const uint16_t json_str_max_len) |
| Converts an integer configuration variable to a JSON string. | |
| uint16_t | CONFIG_all_int_vars_to_json (char *json_str, const uint16_t json_str_size) |
| Converts ALL integer configuration variables to a tightly-packed JSON dictionary string. | |
| uint16_t | CONFIG_str_var_to_json (const char *var_name, char *json_str, const uint16_t json_str_max_len) |
| Converts a string configuration variable to a JSON string. | |
Variables | |
| uint32_t | EPS_monitor_safety_adcs_interval_ms |
| Check whether the EPS is in safety mode. If it's in safety mode, disable all EPS power channels. | |
| uint32_t | EPS_time_sync_period_sec |
| How frequently to set the OBC time based on the EPS time if the time divergence is >2 seconds. | |
| uint32_t | EPS_max_time_deviation_for_sync_ms |
| If the OBC time and EPS time differ by more than this value, the OBC time will be set based on the EPS time. | |
| uint32_t | TASK_heartbeat_period_ms |
| The period of the heartbeat task, in milliseconds. 0 to disable. | |
| uint32_t | TCMD_require_valid_sha256 |
| Boolean. When 1, the telecommand parser will require a valid SHA256 hash in the telecommand string. | |
| uint32_t | CONFIG_EPS_enable_uart_debug_print |
| When enabled, the EPS's raw data is sent to the debug UART. | |
| uint32_t | TCMD_handle_ax100_tcmds_interval_ms |
| The interval between handling telecommands (parsing and adding to agenda) uplinked via the UHF radio. Note: Does not include execution. Decrease this to 200ms-250ms (or lower) if bulk uplinking large amounts of data (e.g., firmware). | |
| uint32_t | TCMD_handle_umbilical_tcmds_interval_ms |
| The interval between handling telecommands (parsing and adding to agenda) from the umbilical UART. | |
| uint32_t | MPI_max_temperature_shutoff_celcius |
| If the MPI exceeds this value during data recording, recording will be disabled. | |
| uint32_t | MPI_max_recording_duration_sec |
| Maximum duration for MPI data recording in seconds. | |
| uint32_t | STM32_system_reset_interval_sec |
| If the system uptime exceeds this value, the system will reset (reboot). | |
| uint32_t | STM32_system_reset_no_uplink_interval_sec |
| If the duration since an AX100 uplink telecommand exceeds this value, the system will reset (reboot). | |
| uint32_t | COMMS_beacon_interval_ms |
| Interval between basic beacon packets, in ms. | |
| uint32_t | GNSS_write_cmd_mode_data_to_firehose_file |
| Boolean. Whether to store command-mode GNSS data to the firehose file. | |
| uint32_t | LOG_timestamp_prefix_format |
| Format for the timestamp prefix. | |
| uint32_t | TCMD_enqueue_from_agenda_file_interval_ms |
| Interval between enqueuing telecommands from the agenda file, in ms. | |
| uint32_t | TCMD_enqueue_grace_period_ms |
| When enqueuing telecommands from a file, gracefully handle time resync values <= this value. | |
| uint32_t | TCMD_max_consecutive_burst_execution_size |
| Execute this many telecommands back-to-back when they come due, if they're available. | |
| uint32_t | LOG_file_flush_interval_sec |
| Interval in seconds at which to flush the log file to the filesystem. | |
| uint32_t | LOG_file_rotation_interval_sec |
| Interval in seconds where a new dated log file is created, and the old file is closed. | |
| uint32_t | CONFIG_int_demo_var_1 = 13345 |
| Does nothing. Used for testing configuration variables. | |
| uint32_t | EPS_monitor_interval_ms = 20000 |
| The interval at which the EPS_monitor_and_disable_overcurrent_channels task runs. | |
| uint32_t | TCMD_require_unique_tssent = 0 |
| Boolean. Whether to require the @tssent suffix tag for all telecommands. | |
| const uint32_t | CONFIG_freertos_min_remaining_stack_percent = 20 |
| The percentage of the stack space that should remain free. If the free space falls below this percentage, a warning will be logged. | |
| CONFIG_integer_config_entry_t | CONFIG_int_config_variables [] |
| const uint8_t | CONFIG_int_config_variables_count = sizeof(CONFIG_int_config_variables) / sizeof(CONFIG_integer_config_entry_t) |
| char | CONFIG_str_demo_var_1 [25] = "CONFIG_str_demo_var_1" |
| char | CONFIG_str_demo_var_2 [50] = "CONFIG_str_demo_var_2" |
| char | COMMS_beacon_friendly_message_str [COMMS_BEACON_FRIENDLY_MESSAGE_SIZE] |
| char | TCMD_active_agenda_filename [LFS_MAX_PATH_LENGTH] |
| The file path of the agenda file to load upcoming telecommands from. | |
| CONFIG_string_config_entry_t | CONFIG_str_config_variables [] |
| const uint8_t | CONFIG_str_config_variables_count = sizeof(CONFIG_str_config_variables) / sizeof(CONFIG_string_config_entry_t) |
| uint16_t CONFIG_all_int_vars_to_json | ( | char * | json_str, |
| const uint16_t | json_str_size ) |
Converts ALL integer configuration variables to a tightly-packed JSON dictionary string.
| json_str | Buffer to write the JSON string to |
| json_str_size | Max length of the buffer |

| int16_t CONFIG_get_int_var_index | ( | const char * | search_name | ) |
Finds an int config variable in CONFIG_int_config_variables and returns its index.
| name | Name of the variable being searched, as registered in CONFIG_int_config_variables |

| int16_t CONFIG_get_str_var_index | ( | const char * | search_name | ) |
Finds a string config variable in CONFIG_str_config_variables and returns its index.
| name | Name of the variable being searched, as registered in CONFIG_str_config_variables |

| uint16_t CONFIG_int_var_to_json | ( | const char * | var_name, |
| char * | json_str, | ||
| const uint16_t | json_str_max_len ) |
Converts an integer configuration variable to a JSON string.
| var_name | Name of the variable |
| json_str | Buffer to write the JSON string to |
| json_str_max_len | Max length of the buffer |


| uint8_t CONFIG_set_int_variable | ( | const char * | var_name, |
| const uint64_t | new_value ) |
Assigns a new value to an integer configuration variable.
| var_name | Name of the variable |
| new_value | New value |


| uint8_t CONFIG_set_str_variable | ( | const char * | var_name, |
| const char * | new_value ) |
Assigns a new value to a string configuration variable.
| config_var | Pointer to the configuration variable |
| new_value | New value |


| uint16_t CONFIG_str_var_to_json | ( | const char * | var_name, |
| char * | json_str, | ||
| const uint16_t | json_str_max_len ) |
Converts a string configuration variable to a JSON string.
| var_name | Name of the variable |
| json_str | Buffer to write the JSON string to |
| json_str_max_len | Max length of the buffer |


|
extern |
|
extern |
Interval between basic beacon packets, in ms.
|
extern |
When enabled, the EPS's raw data is sent to the debug UART.
| const uint32_t CONFIG_freertos_min_remaining_stack_percent = 20 |
The percentage of the stack space that should remain free. If the free space falls below this percentage, a warning will be logged.
| CONFIG_integer_config_entry_t CONFIG_int_config_variables[] |
| const uint8_t CONFIG_int_config_variables_count = sizeof(CONFIG_int_config_variables) / sizeof(CONFIG_integer_config_entry_t) |
| uint32_t CONFIG_int_demo_var_1 = 13345 |
Does nothing. Used for testing configuration variables.
| CONFIG_string_config_entry_t CONFIG_str_config_variables[] |
| const uint8_t CONFIG_str_config_variables_count = sizeof(CONFIG_str_config_variables) / sizeof(CONFIG_string_config_entry_t) |
| char CONFIG_str_demo_var_1[25] = "CONFIG_str_demo_var_1" |
| char CONFIG_str_demo_var_2[50] = "CONFIG_str_demo_var_2" |
|
extern |
If the OBC time and EPS time differ by more than this value, the OBC time will be set based on the EPS time.
| uint32_t EPS_monitor_interval_ms = 20000 |
The interval at which the EPS_monitor_and_disable_overcurrent_channels task runs.
|
extern |
Check whether the EPS is in safety mode. If it's in safety mode, disable all EPS power channels.
|
extern |
How frequently to set the OBC time based on the EPS time if the time divergence is >2 seconds.
|
extern |
Boolean. Whether to store command-mode GNSS data to the firehose file.
If GNSS firehose storage mode is enabled, and the send_cmd_get_response function is used, this config variable controls whether the command-mode response data is written to the firehose file.
|
extern |
Interval in seconds at which to flush the log file to the filesystem.
|
extern |
Interval in seconds where a new dated log file is created, and the old file is closed.
|
extern |
Format for the timestamp prefix.
Options:
|
extern |
Maximum duration for MPI data recording in seconds.
|
extern |
If the MPI exceeds this value during data recording, recording will be disabled.
|
extern |
If the system uptime exceeds this value, the system will reset (reboot).
|
extern |
If the duration since an AX100 uplink telecommand exceeds this value, the system will reset (reboot).
|
extern |
The period of the heartbeat task, in milliseconds. 0 to disable.
|
extern |
The file path of the agenda file to load upcoming telecommands from.
|
extern |
Interval between enqueuing telecommands from the agenda file, in ms.
|
extern |
When enqueuing telecommands from a file, gracefully handle time resync values <= this value.
|
extern |
The interval between handling telecommands (parsing and adding to agenda) uplinked via the UHF radio. Note: Does not include execution. Decrease this to 200ms-250ms (or lower) if bulk uplinking large amounts of data (e.g., firmware).
|
extern |
The interval between handling telecommands (parsing and adding to agenda) from the umbilical UART.
Any value from 1ms to millions is reasonable. 20ms is a good value for optimized bulk uplink. Note: Does not include execution.
|
extern |
Execute this many telecommands back-to-back when they come due, if they're available.
Increase this past 3 to execute commands faster (e.g., during bulk uplink).
| uint32_t TCMD_require_unique_tssent = 0 |
Boolean. Whether to require the @tssent suffix tag for all telecommands.
1 = require, 0 = don't require
|
extern |
Boolean. When 1, the telecommand parser will require a valid SHA256 hash in the telecommand string.