#ifndef __PLATFORM_NRF52_GPIO_H__
#define __PLATFORM_NRF52_GPIO_H__

#include "gpio_interface.h"

#include "platform/nrf52/InterruptHandler.h"

namespace pinetime::platform::nrf52 {

class Gpio : public pinetime::interfaces::GpioInterface
{
public:
    Gpio();
    Gpio(uint32_t);
    void pin_number(uint32_t);
    uint32_t pin_number() override;

    void set_direction(direction, bool blocking_read=false) override;
    uint32_t get() override;
    void set() override;
    void clear() override;
    void toggle() override;

    void handle() override;

private:
    uint32_t pin;
    bool blocking;
    volatile bool wait_for_event;
};

}

#endif
