Files
tactility/Tactility/Include/Tactility/hal/gpio/Gpio.h
T
2025-09-22 23:24:01 +02:00

35 lines
668 B
C++

#pragma once
#include <cstdint>
namespace tt::hal::gpio {
typedef unsigned int Pin;
constexpr Pin NO_PIN = -1;
/** @warning The order must match GpioMode from tt_hal_gpio.h */
enum class Mode {
Disable = 0,
Input,
Output,
OutputOpenDrain,
InputOutput,
InputOutputOpenDrain
};
/** Configure a single pin */
bool configure(Pin pin, Mode mode, bool pullUp, bool pullDown);
/** Configure a set of pins defined by their bit index */
bool configureWithPinBitmask(uint64_t pinBitMask, Mode mode, bool pullUp, bool pullDown);
bool setMode(Pin pin, Mode mode);
bool getLevel(Pin pin);
bool setLevel(Pin pin, bool level);
int getPinCount();
}