libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::Pin Struct Reference

representation of hardware port/pin combination More...

Detailed Description

representation of hardware port/pin combination

#include <daisy_core.h>

Public Member Functions

constexpr Pin (const GPIOPort pt, const uint8_t pn)
 Constructor creates a valid pin.
 
constexpr Pin ()
 Basic Constructor creates an invalid Pin object.
 
constexpr bool IsValid () const
 checks validity of a Pin
 
constexpr bool operator== (const Pin &rhs) const
 comparison operator for checking equality between Pin objects
 
constexpr bool operator!= (const Pin &rhs) const
 comparison operator for checking inequality between Pin objects
 

Public Attributes

GPIOPort port
 
uint8_t pin
 

Constructor & Destructor Documentation

◆ Pin() [1/2]

constexpr daisy::Pin::Pin ( const GPIOPort  pt,
const uint8_t  pn 
)
inlineconstexpr

Constructor creates a valid pin.

Parameters
ptGPIOPort between PA, and PK corresponding to STM32 Port.
pnpin number in range of 0-15

◆ Pin() [2/2]

constexpr daisy::Pin::Pin ( )
inlineconstexpr

Basic Constructor creates an invalid Pin object.

Member Function Documentation

◆ IsValid()

constexpr bool daisy::Pin::IsValid ( ) const
inlineconstexpr

checks validity of a Pin

Return values
returnstrue if the port is a valid hardware pin, otherwise false.

◆ operator!=()

constexpr bool daisy::Pin::operator!= ( const Pin rhs) const
inlineconstexpr

comparison operator for checking inequality between Pin objects

◆ operator==()

constexpr bool daisy::Pin::operator== ( const Pin rhs) const
inlineconstexpr

comparison operator for checking equality between Pin objects

Member Data Documentation

◆ pin

uint8_t daisy::Pin::pin

◆ port

GPIOPort daisy::Pin::port

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