some fixes

This commit is contained in:
Ayzen
2026-06-24 13:15:48 +03:00
parent d3d48a5255
commit 42795eb899
147 changed files with 332 additions and 291740 deletions

View File

@ -6,9 +6,37 @@
#ifndef ADC_MUX_H
#define ADC_MUX_H
#include <stdbool.h>
#include <stdint.h>
/**
* @brief Snapshot of all internal STM32 ADC channels exported through telemetry.
*
* The firmware keeps the UART telemetry frame fixed at 30 bytes, so the host
* and the board agree on a stable slot order. These fields are captured from
* the MCU ADC peripherals once per telemetry refresh and then packed into that
* frame by the application core.
*/
typedef struct adc_internal_telemetry_t {
/** @brief Raw 12-bit code for external temperature sensor channel 1. */
uint16_t external_temperature_1_raw;
/** @brief Raw 12-bit code for external temperature sensor channel 2. */
uint16_t external_temperature_2_raw;
/** @brief Raw 12-bit code for the monitored 3.3V rail. */
uint16_t rail_3v3_raw;
/** @brief Raw 12-bit code for the monitored 5V1 rail. */
uint16_t rail_5v1_raw;
/** @brief Raw 12-bit code for the monitored 5V2 rail. */
uint16_t rail_5v2_raw;
/** @brief Raw 12-bit code read from free analog input PF3 / ADC3_IN9. */
uint16_t input_pf3_raw;
/** @brief Raw 12-bit code read from free analog input PF4 / ADC3_IN14. */
uint16_t input_pf4_raw;
/** @brief Raw 12-bit code for the monitored 7V rail. */
uint16_t rail_7v0_raw;
} adc_internal_telemetry_t;
uint16_t adc_mux_read_external_channel(uint8_t channel_index);
uint16_t adc_mux_process_internal_adc_step(uint8_t step);
bool adc_mux_capture_internal_telemetry(adc_internal_telemetry_t *telemetry);
#endif /* ADC_MUX_H */