HF-Core Platform 0.1.0-dev
Hardware-Agnostic Handler Layer & RTOS Utilities for HardFOC
Loading...
Searching...
No Matches
Tmc9660Handler::Gpio Class Reference

BaseGpio adapter for a single TMC9660 internal GPIO channel. More...

#include <Tmc9660Handler.h>

Inheritance diagram for Tmc9660Handler::Gpio:
[legend]
Collaboration diagram for Tmc9660Handler::Gpio:
[legend]

Public Member Functions

 Gpio (Tmc9660Handler &parent, uint8_t gpioNumber)
 Construct a GPIO wrapper for a specific TMC9660 internal pin.
 
 ~Gpio () noexcept override=default
 Default destructor.
 
BaseGpio Interface Implementation
bool Initialize () noexcept override
 Initialize the GPIO pin (configures as output by default on the TMC9660).
 
bool Deinitialize () noexcept override
 Deinitialize (no-op; TMC9660 GPIO persists until device reset).
 
bool IsPinAvailable () const noexcept override
 Check if this GPIO number is a valid TMC9660 pin (17 or 18).
 
hf_u8_t GetMaxPins () const noexcept override
 Returns 2 (GPIO17 and GPIO18 are exposed).
 
const charGetDescription () const noexcept override
 Returns a description string like "TMC9660 GPIO17".
 

Protected Member Functions

BaseGpio Protected Implementation
hf_gpio_err_t SetDirectionImpl (hf_gpio_direction_t direction) noexcept override
 Set pin direction (INPUT or OUTPUT supported).
 
hf_gpio_err_t SetOutputModeImpl (hf_gpio_output_mode_t mode) noexcept override
 Set output mode. Only PUSH_PULL is supported.
 
hf_gpio_err_t SetPullModeImpl (hf_gpio_pull_mode_t mode) noexcept override
 Set pull mode. Only FLOATING is supported.
 
hf_gpio_err_t SetPinLevelImpl (hf_gpio_level_t level) noexcept override
 Write HIGH or LOW to the TMC9660 GPIO pin via the driver.
 
hf_gpio_err_t GetPinLevelImpl (hf_gpio_level_t &level) noexcept override
 Read the current level of the TMC9660 GPIO pin via the driver.
 
hf_gpio_pull_mode_t GetPullModeImpl () const noexcept override
 Returns FLOATING (TMC9660 pull is set via bootloader config).
 
hf_gpio_err_t GetDirectionImpl (hf_gpio_direction_t &direction) const noexcept override
 Returns the current configured direction (INPUT or OUTPUT).
 
hf_gpio_err_t GetOutputModeImpl (hf_gpio_output_mode_t &mode) const noexcept override
 Returns PUSH_PULL.
 

Private Attributes

Tmc9660Handlerparent_
 Owning handler instance.
 
uint8_t gpioNumber_
 TMC9660 internal GPIO pin number.
 
char description_ [32]
 Human-readable description (e.g., "TMC9660 GPIO17").
 
hf_gpio_direction_t direction_ = hf_gpio_direction_t::HF_GPIO_DIRECTION_OUTPUT
 Current direction.
 

Detailed Description

BaseGpio adapter for a single TMC9660 internal GPIO channel.

Wraps one of the TMC9660's internal GPIO pins (e.g., GPIO17, GPIO18) as a HardFOC BaseGpio instance. Supports digital read/write via the TMC9660 driver's gpio subsystem.

The TMC9660 GPIO pins are configured as push-pull outputs by default. Pull mode is limited to floating (the TMC9660 configures pull via bootloader config, not at runtime through TMCL).

Note
Only GPIO17 and GPIO18 are currently exposed. Additional pins can be added by expanding the gpioWrappers_ array.

Constructor & Destructor Documentation

◆ Gpio()

Tmc9660Handler::Gpio::Gpio ( Tmc9660Handler & parent,
uint8_t gpioNumber )

Construct a GPIO wrapper for a specific TMC9660 internal pin.

Parameters
parentReference to the owning Tmc9660Handler.
gpioNumberTMC9660 internal GPIO number (e.g., 17 or 18).

◆ ~Gpio()

Tmc9660Handler::Gpio::~Gpio ( )
overridedefaultnoexcept

Default destructor.

Member Function Documentation

◆ Deinitialize()

bool Tmc9660Handler::Gpio::Deinitialize ( )
overridenoexcept

Deinitialize (no-op; TMC9660 GPIO persists until device reset).

◆ GetDescription()

const char * Tmc9660Handler::Gpio::GetDescription ( ) const
overridenoexcept

Returns a description string like "TMC9660 GPIO17".

◆ GetDirectionImpl()

hf_gpio_err_t Tmc9660Handler::Gpio::GetDirectionImpl ( hf_gpio_direction_t & direction) const
overrideprotectednoexcept

Returns the current configured direction (INPUT or OUTPUT).

Here is the call graph for this function:

◆ GetMaxPins()

hf_u8_t Tmc9660Handler::Gpio::GetMaxPins ( ) const
overridenoexcept

Returns 2 (GPIO17 and GPIO18 are exposed).

◆ GetOutputModeImpl()

hf_gpio_err_t Tmc9660Handler::Gpio::GetOutputModeImpl ( hf_gpio_output_mode_t & mode) const
overrideprotectednoexcept

Returns PUSH_PULL.

Here is the call graph for this function:

◆ GetPinLevelImpl()

hf_gpio_err_t Tmc9660Handler::Gpio::GetPinLevelImpl ( hf_gpio_level_t & level)
overrideprotectednoexcept

Read the current level of the TMC9660 GPIO pin via the driver.

Here is the call graph for this function:

◆ GetPullModeImpl()

hf_gpio_pull_mode_t Tmc9660Handler::Gpio::GetPullModeImpl ( ) const
overrideprotectednoexcept

Returns FLOATING (TMC9660 pull is set via bootloader config).

◆ Initialize()

bool Tmc9660Handler::Gpio::Initialize ( )
overridenoexcept

Initialize the GPIO pin (configures as output by default on the TMC9660).

Here is the call graph for this function:

◆ IsPinAvailable()

bool Tmc9660Handler::Gpio::IsPinAvailable ( ) const
overridenoexcept

Check if this GPIO number is a valid TMC9660 pin (17 or 18).

◆ SetDirectionImpl()

hf_gpio_err_t Tmc9660Handler::Gpio::SetDirectionImpl ( hf_gpio_direction_t direction)
overrideprotectednoexcept

Set pin direction (INPUT or OUTPUT supported).

Here is the call graph for this function:

◆ SetOutputModeImpl()

hf_gpio_err_t Tmc9660Handler::Gpio::SetOutputModeImpl ( hf_gpio_output_mode_t mode)
overrideprotectednoexcept

Set output mode. Only PUSH_PULL is supported.

Here is the call graph for this function:

◆ SetPinLevelImpl()

hf_gpio_err_t Tmc9660Handler::Gpio::SetPinLevelImpl ( hf_gpio_level_t level)
overrideprotectednoexcept

Write HIGH or LOW to the TMC9660 GPIO pin via the driver.

Here is the call graph for this function:

◆ SetPullModeImpl()

hf_gpio_err_t Tmc9660Handler::Gpio::SetPullModeImpl ( hf_gpio_pull_mode_t mode)
overrideprotectednoexcept

Set pull mode. Only FLOATING is supported.

Here is the call graph for this function:

Member Data Documentation

◆ description_

char Tmc9660Handler::Gpio::description_[32]
private

Human-readable description (e.g., "TMC9660 GPIO17").

◆ direction_

hf_gpio_direction_t Tmc9660Handler::Gpio::direction_ = hf_gpio_direction_t::HF_GPIO_DIRECTION_OUTPUT
private

Current direction.

◆ gpioNumber_

uint8_t Tmc9660Handler::Gpio::gpioNumber_
private

TMC9660 internal GPIO pin number.

◆ parent_

Tmc9660Handler& Tmc9660Handler::Gpio::parent_
private

Owning handler instance.


The documentation for this class was generated from the following files: