CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
configuration.c File Reference
#include "config/configuration.h"
#include "comms_drivers/ax100_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 <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for configuration.c:

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_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 TASK_heartbeat_period_ms
 The period of the heartbeat task, in milliseconds. 0 to disable.
 
uint32_t TCMD_require_valid_sha256
 Bool. 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 CONFIG_int_demo_var_1 = 13345
 
uint32_t CONFIG_int_demo_var_2 = 242344
 
uint32_t EPS_monitor_interval_ms = 20000
 
uint32_t STM32_system_reset_interval_ms = 604800000
 
uint32_t TCMD_require_unique_tssent = 0
 
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"
 
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)
 

Function Documentation

◆ CONFIG_get_int_var_index()

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.

Parameters
nameName of the variable being searched, as registered in CONFIG_int_config_variables
Returns
-1 if not found, otherwise the index of the variable in CONFIG_int_config_variables
Here is the caller graph for this function:

◆ CONFIG_get_str_var_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.

Parameters
nameName of the variable being searched, as registered in CONFIG_str_config_variables
Returns
-1 if not found, otherwise the index of the variable in CONFIG_str_config_variables
Here is the caller graph for this function:

◆ CONFIG_int_var_to_json()

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.

Parameters
var_nameName of the variable
json_strBuffer to write the JSON string to
json_str_max_lenMax length of the buffer
Returns
Length of the JSON string
Note
The JSON string is in the format: {"name":"var_name","value":value}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CONFIG_set_int_variable()

uint8_t CONFIG_set_int_variable ( const char * var_name,
const uint64_t new_value )

Assigns a new value to an integer configuration variable.

Parameters
var_nameName of the variable
new_valueNew value
Returns
0 if success, > 0 if failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CONFIG_set_str_variable()

uint8_t CONFIG_set_str_variable ( const char * var_name,
const char * new_value )

Assigns a new value to a string configuration variable.

Parameters
config_varPointer to the configuration variable
new_valueNew value
Returns
0 if success, > 0 if failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CONFIG_str_var_to_json()

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.

Parameters
var_nameName of the variable
json_strBuffer to write the JSON string to
json_str_max_lenMax length of the buffer
Returns
If successful, Length of the JSON string (>1), otherwise 1
Note
The JSON string is in the format: {"name":"var_name","value":"value"}
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ CONFIG_EPS_enable_uart_debug_print

uint32_t CONFIG_EPS_enable_uart_debug_print
extern

When enabled, the EPS's raw data is sent to the debug UART.

◆ CONFIG_freertos_min_remaining_stack_percent

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_int_config_variables

CONFIG_integer_config_entry_t CONFIG_int_config_variables[]

◆ CONFIG_int_config_variables_count

const uint8_t CONFIG_int_config_variables_count = sizeof(CONFIG_int_config_variables) / sizeof(CONFIG_integer_config_entry_t)

◆ CONFIG_int_demo_var_1

uint32_t CONFIG_int_demo_var_1 = 13345

◆ CONFIG_int_demo_var_2

uint32_t CONFIG_int_demo_var_2 = 242344

◆ CONFIG_str_config_variables

CONFIG_string_config_entry_t CONFIG_str_config_variables[]
Initial value:
= {
{
.variable_name = "CONFIG_str_demo_var_1",
.variable_pointer = CONFIG_str_demo_var_1,
.max_length = sizeof(CONFIG_str_demo_var_1)
},
{
.variable_name = "CONFIG_str_demo_var_2",
.variable_pointer = CONFIG_str_demo_var_2,
.max_length = sizeof(CONFIG_str_demo_var_2)
}
}
char CONFIG_str_demo_var_2[50]
Definition configuration.c:100
char CONFIG_str_demo_var_1[25]
Definition configuration.c:99

◆ CONFIG_str_config_variables_count

const uint8_t CONFIG_str_config_variables_count = sizeof(CONFIG_str_config_variables) / sizeof(CONFIG_string_config_entry_t)

◆ CONFIG_str_demo_var_1

char CONFIG_str_demo_var_1[25] = "CONFIG_str_demo_var_1"

◆ CONFIG_str_demo_var_2

char CONFIG_str_demo_var_2[50] = "CONFIG_str_demo_var_2"

◆ EPS_monitor_interval_ms

uint32_t EPS_monitor_interval_ms = 20000

◆ STM32_system_reset_interval_ms

uint32_t STM32_system_reset_interval_ms = 604800000

◆ TASK_heartbeat_period_ms

uint32_t TASK_heartbeat_period_ms
extern

The period of the heartbeat task, in milliseconds. 0 to disable.

◆ TCMD_require_unique_tssent

uint32_t TCMD_require_unique_tssent = 0

◆ TCMD_require_valid_sha256

uint32_t TCMD_require_valid_sha256
extern

Bool. When 1, the telecommand parser will require a valid SHA256 hash in the telecommand string.