UUtzinger_DRV8704 0.1.0 Arduino library for the DRV8704 dual H-bridge gate driver

Public Member Functions | List of all members
DRV8704PwmBackend Class Referenceabstract

Abstract board-specific PWM backend used for DRV8704 bridge inputs. More...

`#include <drv8704_pwm.h>`

## Public Member Functions
virtual bool | begin (const DRV8704Pins &pins, const DRV8704PwmConfig &config, DRV8704PwmCapability &capability)=0
| Initialize hardware PWM resources for the provided input pins. More...
virtual bool | configure (const DRV8704Pins &pins, const DRV8704PwmConfig &config, DRV8704PwmCapability &capability)=0
| Update the operating PWM frequency. More...
virtual void | end (const DRV8704Pins &pins)=0
| Release hardware PWM resources and detach all PWM pins. More...
virtual void | releasePin (int8_t pin)=0
| Stop PWM on one pin and return it to GPIO control. More...
virtual bool | writeDuty (int8_t pin, uint32_t dutyCount, uint32_t maxDuty)=0
| Apply a PWM duty count to one bridge-input pin. More...
virtual | ~DRV8704PwmBackend ()

## Detailed Description

Abstract board-specific PWM backend used for DRV8704 bridge inputs.

## Constructor & Destructor Documentation

## ◆ ~DRV8704PwmBackend()

virtual DRV8704PwmBackend::~DRV8704PwmBackend | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ begin()

virtual bool DRV8704PwmBackend::begin | ( | const DRV8704Pins & | pins,
|  | const DRV8704PwmConfig & | config,
|  | DRV8704PwmCapability & | capability
| ) |  |
| pure virtual

Initialize hardware PWM resources for the provided input pins.

Parameters

  pins | Driver pin bundle.
  config | Requested PWM configuration.
  capability | Resolved PWM capability report.

Returns
  True when the backend is available and initialized.

## ◆ configure()

virtual bool DRV8704PwmBackend::configure | ( | const DRV8704Pins & | pins,
|  | const DRV8704PwmConfig & | config,
|  | DRV8704PwmCapability & | capability
| ) |  |
| pure virtual

Update the operating PWM frequency.

Parameters

  pins | Driver pin bundle.
  config | Requested PWM configuration.
  capability | Updated PWM capability report.

Returns
  True when the backend accepted the requested frequency.

## ◆ end()

virtual void DRV8704PwmBackend::end | ( | const DRV8704Pins & | pins | ) |
| pure virtual

Release hardware PWM resources and detach all PWM pins.

Parameters

  pins | Driver pin bundle.

## ◆ releasePin()

virtual void DRV8704PwmBackend::releasePin | ( | int8_t | pin | ) |
| pure virtual

Stop PWM on one pin and return it to GPIO control.

Parameters

  pin | MCU pin number.

## ◆ writeDuty()

virtual bool DRV8704PwmBackend::writeDuty | ( | int8_t | pin,
|  | uint32_t | dutyCount,
|  | uint32_t | maxDuty
| ) |  |
| pure virtual

Apply a PWM duty count to one bridge-input pin.

Parameters

  pin | MCU pin number.
  dutyCount | Duty count from 0 to max-duty.
  maxDuty | Maximum duty count supported by the active resolution.

Returns
  True when the PWM output was applied.

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

- src/drv8704_pwm.h