libyggdrasil  v1.0.0
bsp::mid::drv::GPIOPin< BaseAddress, Pin, LogicActive > Struct Template Reference

GPIOPin implementation for Midgard. More...

#include <gpio.hpp>

Public Member Functions

 GPIOPin (const GPIOPin &)=delete
 
 GPIOPin (GPIOPin &&)=delete
 
GPIOPinoperator= (const GPIOPin &)=delete
 
constexpr ALWAYS_INLINE auto & operator= (bool state) const noexcept
 Assignment operator overload. More...
 
constexpr ALWAYS_INLINE operator u8 () const noexcept
 u8 conversion operator overload More...
 
bool init () const noexcept
 Init function. More...
 
bool deinit () const noexcept
 Deinit function. More...
 
void makeOutput () const noexcept
 Turn pin into an output. More...
 
void makeInput () const noexcept
 Turn pin into an input. More...
 

Friends

template<addr_t , template< addr_t, u8 > typename>
struct bsp::mid::drv::GPIOPort
 Declare GPIOPort as friend. More...
 

Detailed Description

template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
struct bsp::mid::drv::GPIOPin< BaseAddress, Pin, LogicActive >

GPIOPin implementation for Midgard.

Warning
Do not use this on its own!
Template Parameters
BaseAddressGPIO Block base address
PinPin number

Constructor & Destructor Documentation

◆ GPIOPin() [1/2]

template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
bsp::mid::drv::GPIOPin< BaseAddress, Pin, LogicActive >::GPIOPin ( const GPIOPin< BaseAddress, Pin, LogicActive > &  )
delete

◆ GPIOPin() [2/2]

template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
bsp::mid::drv::GPIOPin< BaseAddress, Pin, LogicActive >::GPIOPin ( GPIOPin< BaseAddress, Pin, LogicActive > &&  )
delete

Member Function Documentation

◆ deinit()

template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
bool bsp::mid::drv::GPIOPin< BaseAddress, Pin, LogicActive >::deinit ( ) const
inlinenoexcept

Deinit function.

Returns
Success

◆ init()

template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
bool bsp::mid::drv::GPIOPin< BaseAddress, Pin, LogicActive >::init ( ) const
inlinenoexcept

Init function.

Returns
Success

◆ makeInput()

template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
void bsp::mid::drv::GPIOPin< BaseAddress, Pin, LogicActive >::makeInput ( ) const
inlinenoexcept

Turn pin into an input.

◆ makeOutput()

template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
void bsp::mid::drv::GPIOPin< BaseAddress, Pin, LogicActive >::makeOutput ( ) const
inlinenoexcept

Turn pin into an output.

◆ operator u8()

template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
constexpr ALWAYS_INLINE bsp::mid::drv::GPIOPin< BaseAddress, Pin, LogicActive >::operator u8 ( ) const
inlineconstexprnoexcept

u8 conversion operator overload

Returns
Pin value

◆ operator=() [1/2]

template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
constexpr ALWAYS_INLINE auto& bsp::mid::drv::GPIOPin< BaseAddress, Pin, LogicActive >::operator= ( bool  state) const
inlineconstexprnoexcept

Assignment operator overload.

Parameters
statePin state
Returns
Pin

◆ operator=() [2/2]

template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
GPIOPin& bsp::mid::drv::GPIOPin< BaseAddress, Pin, LogicActive >::operator= ( const GPIOPin< BaseAddress, Pin, LogicActive > &  )
delete

Friends And Related Function Documentation

◆ bsp::mid::drv::GPIOPort

template<addr_t BaseAddress, u8 Pin, bsp::drv::Active LogicActive>
template<addr_t , template< addr_t, u8 > typename>
friend struct bsp::mid::drv::GPIOPort
friend

Declare GPIOPort as friend.


The documentation for this struct was generated from the following file: