Go to the documentation of this file.
48 template<addr_t BaseAddress>
58 template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
63 static_assert(Pin <= 15,
"Pin out of range");
93 bool init() const noexcept {
128 static inline auto MODERx =
typename MODER::template Field<Pin * 2, Pin * 2 + 1>();
134 static inline auto OTYPERx =
typename OTYPER::template Field<Pin, Pin>();
140 static inline auto IDRx =
typename IDR::template Field<Pin, Pin>();
146 static inline auto ODRx =
typename ODR::template Field<Pin, Pin>();
151 template<addr_t,
template<addr_t,u8>
typename>
161 template<addr_t BaseAddress>
197 template<u8 Pin, bsp::drv::Active LogicActive>
207 template<u8 From, u8 To>
208 static constexpr
auto In =
typename IDR::template Field<From, To>();
217 template<u8 From, u8 To>
218 static constexpr
auto Out =
typename ODR::template Field<From, To>();
GPIOPin(const GPIOPin &)=delete
void makeOutput() const noexcept
Turn pin into an output.
Definition: gpio.hpp:109
MMIO Register abstraction. Gives access to bitfields within the register as well as a reference to th...
Definition: registers.hpp:90
uint8_t u8
Unsigned integer definitions.
Definition: types.h:36
constexpr ALWAYS_INLINE auto & operator=(bool state) const noexcept
Assignment operator overload.
Definition: gpio.hpp:73
static constexpr auto Out
Write multiple GPIO Pins.
Definition: gpio.hpp:218
GPIOPort implementation for Midgard.
Definition: gpio.hpp:162
GPIOPort(GPIOPort &&)=delete
GPIOPin implementation for Midgard.
Definition: gpio.hpp:59
#define ALWAYS_INLINE
Definition: attributes.h:34
static constexpr auto In
Read multiple GPIO Pins.
Definition: gpio.hpp:208
RegisterMap
Register map.
Definition: hash.cpp:42
static bool init()
Init function.
Definition: gpio.hpp:178
bool deinit() const noexcept
Deinit function.
Definition: gpio.hpp:102
static bool deinit()
Deinit function.
Definition: gpio.hpp:187
GPIOPin & operator=(const GPIOPin &)=delete
Frontend for the GPIO abstraction.
void makeInput() const noexcept
Turn pin into an input.
Definition: gpio.hpp:117
static constexpr auto Pin
GPIO Pin.
Definition: gpio.hpp:198
GPIOPin(GPIOPin &&)=delete
bool init() const noexcept
Init function.
Definition: gpio.hpp:93
GPIOPort(const GPIOPort &)=delete