HF-TMC9660 Driver 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC9660
Loading...
Searching...
No Matches
tmc9660::TMC9660< CommType >::GPIO Struct Reference

Subsystem for configuring general-purpose IOs (GPIOs). More...

#include <tmc9660.hpp>

Collaboration diagram for tmc9660::TMC9660< CommType >::GPIO:
[legend]

Public Member Functions

bool setMode (uint8_t pin, bool output, bool pullEnable=false, bool pullUp=true) noexcept
 Configure a GPIO pin as input or output.
 
bool writePin (uint8_t pin, bool value) noexcept
 Write a digital value to a configured output pin.
 
bool readDigital (uint8_t pin, bool &value) noexcept
 Read a digital input pin.
 
bool readAnalog (uint8_t pin, uint16_t &value) noexcept
 Read an analog input (e.g. external temperature or potentiometer).
 

Private Member Functions

 GPIO (TMC9660 &parent) noexcept
 

Private Attributes

TMC9660driver
 

Friends

class TMC9660
 

Detailed Description

template<typename CommType>
struct tmc9660::TMC9660< CommType >::GPIO

Subsystem for configuring general-purpose IOs (GPIOs).

Pins can be configured as digital inputs, digital outputs, or analog inputs. The input pull-up/down resistors and output state can also be controlled.

Refer to the GPIO section and TMCL commands SIO / GIO (Table 18). See datasheet page 19.

Constructor & Destructor Documentation

◆ GPIO()

template<typename CommType >
tmc9660::TMC9660< CommType >::GPIO::GPIO ( TMC9660 & parent)
inlineexplicitprivatenoexcept

Member Function Documentation

◆ readAnalog()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::GPIO::readAnalog ( uint8_t pin,
uint16_t & value )
noexcept

Read an analog input (e.g. external temperature or potentiometer).

Parameters
pinADC input index
[out]valueRaw ADC value (typically 0–65535)
Returns
true on success
  • Analog reads typically apply to AIN3, used with external thermistors.

◆ readDigital()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::GPIO::readDigital ( uint8_t pin,
bool & value )
noexcept

Read a digital input pin.

Parameters
pinGPIO pin index
[out]valueLogic level read from the pin
Returns
true on successful read

◆ setMode()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::GPIO::setMode ( uint8_t pin,
bool output,
bool pullEnable = false,
bool pullUp = true )
noexcept

Configure a GPIO pin as input or output.

Parameters
pinGPIO index (e.g. GPIO0..GPIO18)
outputSet to true to make the pin output, false = input
pull_enableEnable pull resistor
pull_uptrue = pull-up, false = pull-down
Returns
true if configuration applied successfully

◆ writePin()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::GPIO::writePin ( uint8_t pin,
bool value )
noexcept

Write a digital value to a configured output pin.

Parameters
pinGPIO pin index
valuetrue = high, false = low
Returns
true if write succeeded

Friends And Related Symbol Documentation

◆ TMC9660

template<typename CommType >
friend class TMC9660
friend

Member Data Documentation

◆ driver

template<typename CommType >
TMC9660& tmc9660::TMC9660< CommType >::GPIO::driver
private

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