#ifndef STA_CORE_STM32_ADC_HPP #define STA_CORE_STM32_ADC_HPP #include #ifdef STA_PLATFORM_STM32 # include # ifdef HAL_ADC_MODULE_ENABLED # define STA_STM32_ADC_ENABLED # endif #endif #if defined(STA_STM32_ADC_ENABLED) || defined(DOXYGEN) namespace sta { class STM32ADC { public: /** * @param handle A handle to a STM32 ADC. */ STM32ADC(ADC_HandleTypeDef * handle); /** * @brief Starts conversion of the incoming analog signal. */ void start(); /** * @brief * * @param timeout */ void poll(uint32_t timeout); uint32_t getValue(); private: ADC_HandleTypeDef * handle_; }; } // namespace sta #endif // STA_STM32_ADC_ENABLED #endif // STA_CORE_STM32_ADC_HPP