/*
 * EXTIHandler_STM32.hpp
 *
 *  Created on: Feb 24, 2024
 *      Author: gabriel
 */

#include "EXTIHandler.hpp"
#include "GPIO_Pin_STM32.hpp"

#ifndef SRC_COMPONENTS_EXTIHANDLER_STM32_HPP_
#define SRC_COMPONENTS_EXTIHANDLER_STM32_HPP_

class EXTIHandler_STM32 : public EXTIHandler {
public:
	EXTIHandler_STM32();
	int32_t registerCallback(std::function<void(void*)> callbackFunction, void* argument, GPIO_Pin* irqPin);
	int32_t setCallbackEnabled(GPIO_Pin* irqPin, bool enabled);
	void callback(uint16_t GPIO_Pin);
private:
	uint8_t gpioPinToPinNumber(uint16_t GPIO_Pin);
};

#endif /* SRC_COMPONENTS_EXTIHANDLER_STM32_HPP_ */
