Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::GpioHandle Struct Reference

GPIO pin handle with port, pin number, and polarity. More...

Detailed Description

GPIO pin handle with port, pin number, and polarity.

Represents a GPIO pin as resolved from hardware manifests. Used to pass pin configuration to driver functions.

Examples:

  • RP2040 GPIO25: GpioHandle{0, 25, false} - Single port MCU
  • STM32 PC7: GpioHandle{2, 7, false} - Port C (2), pin 7
  • Active-low LED: GpioHandle{0, 25, true} - write(true) drives LOW

Definition at line 29 of file handle.hpp.

#include <handle.hpp>

Public Member Functions

constexpr bool effective_level (bool logical_state) const noexcept
 Get the effective physical level accounting for active_low.
 

Public Attributes

uint32_t port
 GPIO port number (0 for single-port MCUs)
 
uint32_t pin
 Pin number within port.
 
bool active_low
 True if signal is active-low (inverted)
 

Member Function Documentation

◆ effective_level()

constexpr bool sbl::GpioHandle::effective_level ( bool  logical_state) const
inlineconstexprnoexcept

Get the effective physical level accounting for active_low.

Parameters
logical_stateLogical state (true = active/on, false = inactive/off)
Returns
Physical level to write to hardware

Definition at line 39 of file handle.hpp.

References active_low.

Member Data Documentation

◆ port

uint32_t sbl::GpioHandle::port

GPIO port number (0 for single-port MCUs)

Definition at line 30 of file handle.hpp.

◆ pin

uint32_t sbl::GpioHandle::pin

Pin number within port.

Definition at line 31 of file handle.hpp.

◆ active_low

bool sbl::GpioHandle::active_low

True if signal is active-low (inverted)

Definition at line 32 of file handle.hpp.

Referenced by effective_level().


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