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

Subsystem for configuring the MOSFET gate driver. More...

#include <TMC9660.hpp>

Collaboration diagram for TMC9660::GateDriver:

Public Member Functions

bool setOutputPolarity (tmc9660::tmcl::PwmOutputPolarity lowSide, tmc9660::tmcl::PwmOutputPolarity highSide) noexcept
 Set the gate driver output polarity.
 
bool configureBreakBeforeMakeTiming (uint8_t lowSideUVW, uint8_t highSideUVW, uint8_t lowSideY2, uint8_t highSideY2) noexcept
 Configure the break-before-make timing for the gate driver.
 
bool enableAdaptiveDriveTime (bool enableUVW, bool enableY2) noexcept
 Enable or disable adaptive drive time for UVW and Y2 phases.
 
bool configureDriveTimes (uint8_t sinkTimeUVW, uint8_t sourceTimeUVW, uint8_t sinkTimeY2, uint8_t sourceTimeY2) noexcept
 Configure drive times for UVW and Y2 phases.
 
bool configureCurrentLimits (tmc9660::tmcl::GateCurrentSink sinkCurrentUVW, tmc9660::tmcl::GateCurrentSource sourceCurrentUVW, tmc9660::tmcl::GateCurrentSink sinkCurrentY2, tmc9660::tmcl::GateCurrentSource sourceCurrentY2) noexcept
 Configure gate driver current limits for UVW and Y2 phases.
 
bool configureBootstrapCurrentLimit (tmc9660::tmcl::BootstrapCurrentLimit limit) noexcept
 Configure bootstrap current limit.
 
bool configureUndervoltageProtection (tmc9660::tmcl::UndervoltageLevel supplyLevel, tmc9660::tmcl::UndervoltageEnable enableVdrv, tmc9660::tmcl::UndervoltageEnable enableBstUVW, tmc9660::tmcl::UndervoltageEnable enableBstY2) noexcept
 Configure undervoltage protection settings.
 
bool enableOvercurrentProtection (tmc9660::tmcl::OvercurrentEnable enableUVWLowSide, tmc9660::tmcl::OvercurrentEnable enableUVWHighSide, tmc9660::tmcl::OvercurrentEnable enableY2LowSide, tmc9660::tmcl::OvercurrentEnable enableY2HighSide) noexcept
 Enable or disable overcurrent protection for UVW and Y2 phases.
 
bool setOvercurrentThresholds (tmc9660::tmcl::OvercurrentThreshold uvwLowSideThreshold, tmc9660::tmcl::OvercurrentThreshold uvwHighSideThreshold, tmc9660::tmcl::OvercurrentThreshold y2LowSideThreshold, tmc9660::tmcl::OvercurrentThreshold y2HighSideThreshold) noexcept
 Configure overcurrent protection thresholds for UVW and Y2 phases.
 
bool setOvercurrentBlanking (tmc9660::tmcl::OvercurrentTiming uvwLowSideTime, tmc9660::tmcl::OvercurrentTiming uvwHighSideTime, tmc9660::tmcl::OvercurrentTiming y2LowSideTime, tmc9660::tmcl::OvercurrentTiming y2HighSideTime) noexcept
 Configure the overcurrent protection blanking time for UVW and Y2 phases.
 
bool setOvercurrentDeglitch (tmc9660::tmcl::OvercurrentTiming uvwLowSideTime, tmc9660::tmcl::OvercurrentTiming uvwHighSideTime, tmc9660::tmcl::OvercurrentTiming y2LowSideTime, tmc9660::tmcl::OvercurrentTiming y2HighSideTime) noexcept
 Configure the overcurrent protection deglitch time for UVW and Y2 phases.
 
bool enableVdsMonitoringLow (tmc9660::tmcl::VdsUsage uvwEnable, tmc9660::tmcl::VdsUsage y2Enable) noexcept
 Enable or disable VDS monitoring for overcurrent protection on UVW and Y2 low sides.
 
bool configureVgsShortProtectionUVW (tmc9660::tmcl::VgsShortEnable enableLowSideOn, tmc9660::tmcl::VgsShortEnable enableLowSideOff, tmc9660::tmcl::VgsShortEnable enableHighSideOn, tmc9660::tmcl::VgsShortEnable enableHighSideOff) noexcept
 Configure gate-to-source short protection for UVW phases.
 
bool configureVgsShortProtectionY2 (tmc9660::tmcl::VgsShortEnable enableLowSideOn, tmc9660::tmcl::VgsShortEnable enableLowSideOff, tmc9660::tmcl::VgsShortEnable enableHighSideOn, tmc9660::tmcl::VgsShortEnable enableHighSideOff) noexcept
 Configure gate-to-source short protection for Y2 phase.
 
bool setVgsShortBlankingTime (tmc9660::tmcl::VgsBlankingTime uvwTime, tmc9660::tmcl::VgsBlankingTime y2Time) noexcept
 Set gate-to-source short protection blanking time.
 
bool setVgsShortDeglitchTime (tmc9660::tmcl::VgsDeglitchTime uvwTime, tmc9660::tmcl::VgsDeglitchTime y2Time) noexcept
 Set gate-to-source short protection deglitch time.
 
bool setRetryBehavior (tmc9660::tmcl::GdrvRetryBehaviour retryBehavior) noexcept
 Configure fault retry behavior.
 
bool setDriveFaultBehavior (tmc9660::tmcl::DriveFaultBehaviour faultBehavior) noexcept
 Configure drive fault behavior.
 
bool setFaultHandlerRetries (uint8_t retries) noexcept
 Set the maximum number of retries for fault handling.
 

Private Member Functions

 GateDriver (TMC9660 &parent) noexcept
 

Private Attributes

TMC9660driver
 

Friends

class TMC9660
 

Detailed Description

Subsystem for configuring the MOSFET gate driver.

Constructor & Destructor Documentation

◆ GateDriver()

TMC9660::GateDriver::GateDriver ( TMC9660 parent)
inlineexplicitprivatenoexcept

Member Function Documentation

◆ configureBootstrapCurrentLimit()

bool TMC9660::GateDriver::configureBootstrapCurrentLimit ( tmc9660::tmcl::BootstrapCurrentLimit  limit)
noexcept

Configure bootstrap current limit.

Sets the maximum current for the bootstrap capacitor.

Parameters
limitBootstrap current limit (BootstrapCurrentLimit enum).
Returns
true if successfully configured.

◆ configureBreakBeforeMakeTiming()

bool TMC9660::GateDriver::configureBreakBeforeMakeTiming ( uint8_t  lowSideUVW,
uint8_t  highSideUVW,
uint8_t  lowSideY2,
uint8_t  highSideY2 
)
noexcept

Configure the break-before-make timing for the gate driver.

Sets the timing for switching between high and low sides of the gate driver.

Parameters
lowSideUVWBreak-before-make time for UVW low side (0-255, 8.33ns units).
highSideUVWBreak-before-make time for UVW high side (0-255, 8.33ns units).
lowSideY2Break-before-make time for Y2 low side (0-255, 8.33ns units).
highSideY2Break-before-make time for Y2 high side (0-255, 8.33ns units).
Returns
true if successfully configured.

◆ configureCurrentLimits()

bool TMC9660::GateDriver::configureCurrentLimits ( tmc9660::tmcl::GateCurrentSink  sinkCurrentUVW,
tmc9660::tmcl::GateCurrentSource  sourceCurrentUVW,
tmc9660::tmcl::GateCurrentSink  sinkCurrentY2,
tmc9660::tmcl::GateCurrentSource  sourceCurrentY2 
)
noexcept

Configure gate driver current limits for UVW and Y2 phases.

Sets the maximum sink and source currents for the gate driver.

Parameters
sinkCurrentUVWSink current for UVW phases (GateCurrentSink enum).
sourceCurrentUVWSource current for UVW phases (GateCurrentSource enum).
sinkCurrentY2Sink current for Y2 phase (GateCurrentSink enum).
sourceCurrentY2Source current for Y2 phase (GateCurrentSource enum).
Returns
true if successfully configured.

◆ configureDriveTimes()

bool TMC9660::GateDriver::configureDriveTimes ( uint8_t  sinkTimeUVW,
uint8_t  sourceTimeUVW,
uint8_t  sinkTimeY2,
uint8_t  sourceTimeY2 
)
noexcept

Configure drive times for UVW and Y2 phases.

Sets the discharge and charge times for the gate driver.

Parameters
sinkTimeUVWDischarge time for UVW phases (0 ... 255). Default: 255.
sourceTimeUVWCharge time for UVW phases (0 ... 255). Default: 255.
sinkTimeY2Discharge time for Y2 phase (0 ... 255). Default: 255.
sourceTimeY2Charge time for Y2 phase (0 ... 255). Default: 255.
Returns
true if successfully configured.

◆ configureUndervoltageProtection()

bool TMC9660::GateDriver::configureUndervoltageProtection ( tmc9660::tmcl::UndervoltageLevel  supplyLevel,
tmc9660::tmcl::UndervoltageEnable  enableVdrv,
tmc9660::tmcl::UndervoltageEnable  enableBstUVW,
tmc9660::tmcl::UndervoltageEnable  enableBstY2 
)
noexcept

Configure undervoltage protection settings.

Parameters
supplyLevelSupply voltage (VS) protection level (tmc9660::tmcl::UndervoltageLevel enum).
enableVdrvEnable driver voltage (VDRV) protection (tmc9660::tmcl::UndervoltageEnable enum).
enableBstUVWEnable bootstrap capacitor protection for UVW phases (tmc9660::tmcl::UndervoltageEnable enum).
enableBstY2Enable bootstrap capacitor protection for Y2 phase (tmc9660::tmcl::UndervoltageEnable enum).
Returns
true if successfully configured.

◆ configureVgsShortProtectionUVW()

bool TMC9660::GateDriver::configureVgsShortProtectionUVW ( tmc9660::tmcl::VgsShortEnable  enableLowSideOn,
tmc9660::tmcl::VgsShortEnable  enableLowSideOff,
tmc9660::tmcl::VgsShortEnable  enableHighSideOn,
tmc9660::tmcl::VgsShortEnable  enableHighSideOff 
)
noexcept

Configure gate-to-source short protection for UVW phases.

Parameters
enableLowSideOnEnable protection for ON transition of low side (tmc9660::tmcl::VgsShortEnable enum).
enableLowSideOffEnable protection for OFF transition of low side (tmc9660::tmcl::VgsShortEnable enum).
enableHighSideOnEnable protection for ON transition of high side (tmc9660::tmcl::VgsShortEnable enum).
enableHighSideOffEnable protection for OFF transition of high side (tmc9660::tmcl::VgsShortEnable enum).
Returns
true if successfully configured.

◆ configureVgsShortProtectionY2()

bool TMC9660::GateDriver::configureVgsShortProtectionY2 ( tmc9660::tmcl::VgsShortEnable  enableLowSideOn,
tmc9660::tmcl::VgsShortEnable  enableLowSideOff,
tmc9660::tmcl::VgsShortEnable  enableHighSideOn,
tmc9660::tmcl::VgsShortEnable  enableHighSideOff 
)
noexcept

Configure gate-to-source short protection for Y2 phase.

Parameters
enableLowSideOnEnable protection for ON transition of low side (tmc9660::tmcl::VgsShortEnable enum).
enableLowSideOffEnable protection for OFF transition of low side (tmc9660::tmcl::VgsShortEnable enum).
enableHighSideOnEnable protection for ON transition of high side (tmc9660::tmcl::VgsShortEnable enum).
enableHighSideOffEnable protection for OFF transition of high side (tmc9660::tmcl::VgsShortEnable enum).
Returns
true if successfully configured.

◆ enableAdaptiveDriveTime()

bool TMC9660::GateDriver::enableAdaptiveDriveTime ( bool  enableUVW,
bool  enableY2 
)
noexcept

Enable or disable adaptive drive time for UVW and Y2 phases.

Adaptive drive time shortens the discharge cycle by monitoring gate voltages.

Parameters
enableUVWTrue to enable adaptive drive time for UVW phases.
enableY2True to enable adaptive drive time for Y2 phase.
Returns
true if successfully configured.

◆ enableOvercurrentProtection()

bool TMC9660::GateDriver::enableOvercurrentProtection ( tmc9660::tmcl::OvercurrentEnable  enableUVWLowSide,
tmc9660::tmcl::OvercurrentEnable  enableUVWHighSide,
tmc9660::tmcl::OvercurrentEnable  enableY2LowSide,
tmc9660::tmcl::OvercurrentEnable  enableY2HighSide 
)
noexcept

Enable or disable overcurrent protection for UVW and Y2 phases.

Parameters
enableUVWLowSideEnable protection for UVW low side (tmc9660::tmcl::OvercurrentEnable enum).
enableUVWHighSideEnable protection for UVW high side (tmc9660::tmcl::OvercurrentEnable enum).
enableY2LowSideEnable protection for Y2 low side (tmc9660::tmcl::OvercurrentEnable enum).
enableY2HighSideEnable protection for Y2 high side (tmc9660::tmcl::OvercurrentEnable enum).
Returns
true if successfully configured.

◆ enableVdsMonitoringLow()

bool TMC9660::GateDriver::enableVdsMonitoringLow ( tmc9660::tmcl::VdsUsage  uvwEnable,
tmc9660::tmcl::VdsUsage  y2Enable 
)
noexcept

Enable or disable VDS monitoring for overcurrent protection on UVW and Y2 low sides.

Parameters
uvwEnableTrue to enable VDS measurement for overcurrent protection on UVW low side (tmc9660::tmcl::VdsUsage enum).
y2EnableTrue to enable VDS measurement for overcurrent protection on Y2 low side (tmc9660::tmcl::VdsUsage enum).
Returns
true if successfully configured.

◆ setDriveFaultBehavior()

bool TMC9660::GateDriver::setDriveFaultBehavior ( tmc9660::tmcl::DriveFaultBehaviour  faultBehavior)
noexcept

Configure drive fault behavior.

Parameters
faultBehaviorBehavior after all retries fail (tmc9660::tmcl::DriveFaultBehavior enum).
Returns
true if successfully configured.

◆ setFaultHandlerRetries()

bool TMC9660::GateDriver::setFaultHandlerRetries ( uint8_t  retries)
noexcept

Set the maximum number of retries for fault handling.

Parameters
retriesMaximum number of retries (0-255).
Returns
true if successfully configured.

◆ setOutputPolarity()

bool TMC9660::GateDriver::setOutputPolarity ( tmc9660::tmcl::PwmOutputPolarity  lowSide,
tmc9660::tmcl::PwmOutputPolarity  highSide 
)
noexcept

Set the gate driver output polarity.

Configures the PWM_L and PWM_H output polarity.

Parameters
lowSidePolarity for the low-side gate outputs (tmc9660::tmcl::PwmOutputPolarity enum).
highSidePolarity for the high-side gate outputs (tmc9660::tmcl::PwmOutputPolarity enum).
Returns
true if the polarity was set successfully.

◆ setOvercurrentBlanking()

bool TMC9660::GateDriver::setOvercurrentBlanking ( tmc9660::tmcl::OvercurrentTiming  uvwLowSideTime,
tmc9660::tmcl::OvercurrentTiming  uvwHighSideTime,
tmc9660::tmcl::OvercurrentTiming  y2LowSideTime,
tmc9660::tmcl::OvercurrentTiming  y2HighSideTime 
)
noexcept

Configure the overcurrent protection blanking time for UVW and Y2 phases.

Sets the blanking time for overcurrent protection to filter out transient spikes during switching events.

Parameters
uvwLowSideTimeBlanking time for the low side of UVW phases (tmc9660::tmcl::OvercurrentTiming enum).
uvwHighSideTimeBlanking time for the high side of UVW phases (tmc9660::tmcl::OvercurrentTiming enum).
y2LowSideTimeBlanking time for the low side of Y2 phase (tmc9660::tmcl::OvercurrentTiming enum).
y2HighSideTimeBlanking time for the high side of Y2 phase (tmc9660::tmcl::OvercurrentTiming enum).
Returns
true if successfully configured.

◆ setOvercurrentDeglitch()

bool TMC9660::GateDriver::setOvercurrentDeglitch ( tmc9660::tmcl::OvercurrentTiming  uvwLowSideTime,
tmc9660::tmcl::OvercurrentTiming  uvwHighSideTime,
tmc9660::tmcl::OvercurrentTiming  y2LowSideTime,
tmc9660::tmcl::OvercurrentTiming  y2HighSideTime 
)
noexcept

Configure the overcurrent protection deglitch time for UVW and Y2 phases.

Sets how long an overcurrent condition must persist before triggering protection.

Parameters
uvwLowSideTimeDeglitch time for the low side of UVW phases (tmc9660::tmcl::OvercurrentTiming enum).
uvwHighSideTimeDeglitch time for the high side of UVW phases (tmc9660::tmcl::OvercurrentTiming enum).
y2LowSideTimeDeglitch time for the low side of Y2 phase (tmc9660::tmcl::OvercurrentTiming enum).
y2HighSideTimeDeglitch time for the high side of Y2 phase (tmc9660::tmcl::OvercurrentTiming enum).
Returns
true if successfully configured.

◆ setOvercurrentThresholds()

bool TMC9660::GateDriver::setOvercurrentThresholds ( tmc9660::tmcl::OvercurrentThreshold  uvwLowSideThreshold,
tmc9660::tmcl::OvercurrentThreshold  uvwHighSideThreshold,
tmc9660::tmcl::OvercurrentThreshold  y2LowSideThreshold,
tmc9660::tmcl::OvercurrentThreshold  y2HighSideThreshold 
)
noexcept

Configure overcurrent protection thresholds for UVW and Y2 phases.

Parameters
uvwLowSideThresholdThreshold for UVW low side (tmc9660::tmcl::OvercurrentThreshold enum).
uvwHighSideThresholdThreshold for UVW high side (tmc9660::tmcl::OvercurrentThreshold enum).
y2LowSideThresholdThreshold for Y2 low side (tmc9660::tmcl::OvercurrentThreshold enum).
y2HighSideThresholdThreshold for Y2 high side (tmc9660::tmcl::OvercurrentThreshold enum).
Returns
true if successfully configured.

◆ setRetryBehavior()

bool TMC9660::GateDriver::setRetryBehavior ( tmc9660::tmcl::GdrvRetryBehaviour  retryBehavior)
noexcept

Configure fault retry behavior.

Parameters
retryBehaviorRetry behavior after a fault (tmc9660::tmcl::GdrvRetryBehaviour enum).
Returns
true if successfully configured.

◆ setVgsShortBlankingTime()

bool TMC9660::GateDriver::setVgsShortBlankingTime ( tmc9660::tmcl::VgsBlankingTime  uvwTime,
tmc9660::tmcl::VgsBlankingTime  y2Time 
)
noexcept

Set gate-to-source short protection blanking time.

Parameters
uvwTimeBlanking time for UVW phases (tmc9660::tmcl::VgsBlankingTime enum).
y2TimeBlanking time for Y2 phase (tmc9660::tmcl::VgsBlankingTime enum).
Returns
true if successfully configured.

◆ setVgsShortDeglitchTime()

bool TMC9660::GateDriver::setVgsShortDeglitchTime ( tmc9660::tmcl::VgsDeglitchTime  uvwTime,
tmc9660::tmcl::VgsDeglitchTime  y2Time 
)
noexcept

Set gate-to-source short protection deglitch time.

Parameters
uvwTimeDeglitch time for UVW phases (tmc9660::tmcl::VgsDeglitchTime enum).
y2TimeDeglitch time for Y2 phase (tmc9660::tmcl::VgsDeglitchTime enum).
Returns
true if successfully configured.

Friends And Related Symbol Documentation

◆ TMC9660

friend class TMC9660
friend

Member Data Documentation

◆ driver

TMC9660& TMC9660::GateDriver::driver
private

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