Class API¶
Drv8316::Config contains required spi, chipSelect, and sleep;
optional timer and fault; and a 100 ms default SPI timeout. The object
is non-copyable and non-movable, and referenced HAL objects must outlive it.
Lifecycle and diagnostics¶
initialize() wakes and prepares the device. wake() and sleep()
drive nSLEEP. isFaultPinAsserted() polls nFAULT.
refreshDiagnostics() updates the snapshot returned by diagnostics().
clearFaults() requests device fault clearing. All hardware operations other
than the pin/query helpers return HAL_StatusTypeDef.
Register configuration¶
lockRegisters() and unlockRegisters() are convenience operations.
Every configurable field also has a get…(Enum &value) and
set…(Enum value) pair:
Group |
Method suffixes |
|---|---|
Interface |
|
Bridge |
|
Protection |
|
Overcurrent |
|
Current sense |
|
Buck regulator |
|
Delay |
|
PWM¶
HAL_StatusTypeDef setPwm(uint16_t phaseA, uint16_t phaseB, uint16_t phaseC)
sets timer channel 1–3 compare registers. See PWM output for its boundaries.