HF-TMC9660 Driver
Hardware Agnostic C++ Driver for the TMC9660
Loading...
Searching...
No Matches
TMC9660::GPIO Struct Reference

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

#include <TMC9660.hpp>

Collaboration diagram for TMC9660::GPIO:

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

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()

TMC9660::GPIO::GPIO ( TMC9660 parent)
inlineexplicitprivatenoexcept

Member Function Documentation

◆ readAnalog()

bool TMC9660::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()

bool TMC9660::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()

bool TMC9660::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
pullEnableEnable pull resistor
pullUptrue = pull-up, false = pull-down
Returns
true if configuration applied successfully

◆ writePin()

bool TMC9660::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

friend class TMC9660
friend

Member Data Documentation

◆ driver

TMC9660& TMC9660::GPIO::driver
private

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