diff --git a/stm-firmware/include/reflow-controller/adc-meas.h b/stm-firmware/include/reflow-controller/adc-meas.h index 6e8e850..248fd5d 100644 --- a/stm-firmware/include/reflow-controller/adc-meas.h +++ b/stm-firmware/include/reflow-controller/adc-meas.h @@ -94,6 +94,11 @@ */ #define ADC_PT1000_WATCHDOG_SAMPLE_COUNT 25U +/** + * @brief Conversion macro: ADC value to resistance + */ +#define ADC_TO_RES(adc) ((float)(adc) / 4096.0f * 2500.0f) + /** * @brief This function sets up the ADC measurement fo the external PT1000 temperature sensor * @@ -160,6 +165,16 @@ int adc_pt1000_get_current_resistance(float *resistance); */ int adc_pt1000_stream_raw_value_to_memory(volatile float *adc_array, uint32_t length, volatile int *flag_to_set); +/** + * @brief Convert an array of raw adc values to resistance values + * + * In case \p resistance_dest is NULL, the conversion is done inplace in the + * \p raw_source array. + * + * @param resistance_dest Destination. Maybe NULL. + * @param raw_source Source array + * @param count Number of values to convert + */ void adc_pt1000_convert_raw_value_array_to_resistance(float *resistance_dest, float *raw_source, uint32_t count); /**