|
| uint8_t | TCMDEXEC_obc_read_temperature_complex (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len) |
| | Reads the temperature from the STDS75DS2F and stores it in the provided variable temperature. Temperature range is -55 to 125 degrees celsius with +/- 3 degrees celsius accuracy over the whole range.
|
| uint8_t | TCMDEXEC_obc_read_temperature (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len) |
| | Reads the temperature from the STDS75DS2F in centi-Celsius.
|
| uint8_t | TCMDEXEC_obc_adc_read_vbat_voltage (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len) |
| | Read the battery voltage using the ADC. Returns the result in mV. Voltage divider ratio is already applied.
|
| static uint8_t | SystemClock_Config_with_hse (void) |
| | This is a version of the SystemClock_Config function in main.c, generated with the HSE SYSCLK config.
|
| static HAL_StatusTypeDef | MX_TIM6_Init_with_new_25MHz_speed (void) |
| | TIM6 Initialization Function.
|
| uint8_t | TCMDEXEC_obc_set_stm32_sysclk_to_hse (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len) |
| | Change the STM32 SYSCLK clock from the HSI to the HSE.
|
| uint8_t SystemClock_Config_with_hse |
( |
void | | ) |
|
|
static |
This is a version of the SystemClock_Config function in main.c, generated with the HSE SYSCLK config.
Configure the main internal regulator output voltage
Initializes the RCC Oscillators according to the specified parameters in the RCC_OscInitTypeDef structure.
Initializes the CPU, AHB and APB buses clocks
| uint8_t TCMDEXEC_obc_set_stm32_sysclk_to_hse |
( |
const char * | args_str, |
|
|
char * | response_output_buf, |
|
|
uint16_t | response_output_buf_len ) |
Change the STM32 SYSCLK clock from the HSI to the HSE.
- Parameters
-
- Returns
- 0 on success.
On bootup, the OBC will use the HSI as its clock, as the HSE may have a PCB design defect, where the output capacitance of the HSE clock is too high. Running this command will switch the SYSCLK from the High-Speed Internal (HSI) at 16 MHz to the probably-fine-but-maybe-questionable High-Speed External (HSE) clock at 25 MHz. The main benefit is that the HSE clock is a Temperature-Compensated Crystal Oscillator (TXCO), and thus maintains the system clock much more reliably.
- Note
- To switch back to the HSI, simply reboot.
-
If the HSE fails, the Independent Watchdog will reset. Thus, this reconfiguration is low-risk.