diff --git a/stm-firmware/include/reflow-controller/adc-meas.h b/stm-firmware/include/reflow-controller/adc-meas.h index 8a06231..b265bae 100644 --- a/stm-firmware/include/reflow-controller/adc-meas.h +++ b/stm-firmware/include/reflow-controller/adc-meas.h @@ -34,15 +34,35 @@ */ #define ADC_PT1000_CHANNEL 2U +/** + * @brief GPIO Port the ADC converter for the PT1000 measurement is connected to + */ #define ADC_PT1000_PORT GPIOA + +/** + * @brief The clock enable mask of the RCC register for ADC_PT1000_PORT + */ #define ADC_PT1000_PORT_RCC_MASK RCC_AHB1ENR_GPIOAEN +/** + * @brief The GPIO pin number the PT1000 analog voltage is connected to + */ #define ADC_PT1000_PIN 2U +/** + * @brief The cycle count the moving average filter is labeled 'instable' after startup of the measurement or changing + * the alpha value @ref ADC_PT1000_FILTER_WEIGHT + */ #define ADC_FILTER_STARTUP_CYCLES 800U +/** + * @brief The delay value programmed into the sample timer + */ #define ADC_PT1000_SAMPLE_CNT_DELAY 1000U +/** + * @brief The amount of samples to take to prefilter the analog signal + */ #define ADC_PT1000_DMA_AVG_SAMPLES 6U /** @@ -144,8 +164,14 @@ void adc_pt1000_convert_raw_value_array_to_resistance(float *resistance_dest, fl */ enum adc_pt1000_error adc_pt1000_check_error(); +/** + * @brief Clear the error status of the PT1000 measurement + */ void adc_pt1000_clear_error(); +/** + * @brief Disable the PT1000 measurement + */ void adc_pt1000_disable(); #endif // __ADCMEAS_H__ diff --git a/stm-firmware/include/reflow-controller/button.h b/stm-firmware/include/reflow-controller/button.h index ac44344..6da147e 100644 --- a/stm-firmware/include/reflow-controller/button.h +++ b/stm-firmware/include/reflow-controller/button.h @@ -21,19 +21,55 @@ #ifndef __BUTTON_H__ #define __BUTTON_H__ +/** + * @brief GPIO Port the button is connected to + */ #define BUTTON_PORT GPIOD + +/** + * @brief The RCC clock mask for @ref BUTTON_PORT + */ #define BUTTON_RCC_MASK RCC_AHB1ENR_GPIODEN + +/** + * @brief The GPIO pin number the button is connected to + */ #define BUTTON_PIN 4 +/** + * @brief The time in ms the button has to stay pressed to be detected as a short press + */ #define BUTTON_SHORT_ON_TIME_MS 50UL + +/** + * @brief Time in ms the button has to be pressed to be counted as a long press + */ #define BUTTON_LONG_ON_TIME_MS 400UL + +#if BUTTON_LONG_ON_TIME_MS <= BUTTON_SHORT_ON_TIME_MS +#error "Button BUTTON_SHORT_ON_TIME_MS time has to be shorter than BUTTON_LONG_ON_TIME_MS" +#endif + +/** + * @brief States the puhsbutton of the rotary encoder can be in + */ enum button_state {BUTTON_IDLE = 0, BUTTON_SHORT_RELEASED, BUTTON_LONG_RELEASED, BUTTON_SHORT, BUTTON_LONG}; +/** + * @brief Init the push button + */ void button_init(); +/** + * @brief read if a push button event occured + * @return Button event + */ enum button_state button_read_event(); +/** + * @brief button_deinit + */ void button_deinit();