2023-07-16 21:17:14 +02:00

40 lines
733 B
C++

#ifndef STA_CORE_STM32_ADC_HPP
#define STA_CORE_STM32_ADC_HPP
#include <sta/config.hpp>
#ifdef STA_PLATFORM_STM32
#include <sta/devices/stm32/hal.hpp>
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_PLATFORM_STM32
#endif // STA_CORE_STM32_ADC_HPP