/*
 * PWM_Pin_STM32.hpp
 *
 *  Created on: Feb 11, 2024
 *      Author: Gabriel
 */

#ifndef SRC_COMPONENTS_PWM_PIN_STM32_HPP_
#define SRC_COMPONENTS_PWM_PIN_STM32_HPP_

#include "main.h"
#include "PWM_Pin.hpp"

class PWM_Pin_STM32 : public PWM_Pin {
public:
	PWM_Pin_STM32(TIM_HandleTypeDef* hTim, uint32_t channel);
	virtual ~PWM_Pin_STM32();
	int32_t init();
	int32_t setDuty(float dutyCycle);
	int32_t setFreq(float freq);
private:
	TIM_HandleTypeDef* hTim;
	uint32_t channel;
};

#endif /* SRC_COMPONENTS_PWM_PIN_STM32_HPP_ */
