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

drv8704_pwm.h
Go to the documentation of this file.
1
6 #ifndef DRV8704_PWM_H
7 #define DRV8704_PWM_H
8
9 #include <Arduino.h>
10
11 #include "drv8704_types.h"
12
16 class DRV8704PwmBackend {
17 public:
18 virtual ~DRV8704PwmBackend() {}
19
27 virtual bool begin(const DRV8704Pins& pins,
28 const DRV8704PwmConfig& config,
29 DRV8704PwmCapability& capability) = 0;
30
35 virtual void end(const DRV8704Pins& pins) = 0;
36
44 virtual bool configure(const DRV8704Pins& pins,
45 const DRV8704PwmConfig& config,
46 DRV8704PwmCapability& capability) = 0;
47
55 virtual bool writeDuty(int8_t pin, uint32_t dutyCount, uint32_t maxDuty) = 0;
56
61 virtual void releasePin(int8_t pin) = 0;
62 };
63
68 DRV8704PwmBackend* drv8704CreatePwmBackend();
69
70 #endif // DRV8704_PWM_H
DRV8704PwmBackend
Abstract board-specific PWM backend used for DRV8704 bridge inputs.
Definition: drv8704_pwm.h:16
DRV8704PwmBackend::~DRV8704PwmBackend
virtual ~DRV8704PwmBackend()
Definition: drv8704_pwm.h:18
DRV8704PwmBackend::end
virtual void end(const DRV8704Pins &pins)=0
Release hardware PWM resources and detach all PWM pins.
DRV8704PwmBackend::configure
virtual bool configure(const DRV8704Pins &pins, const DRV8704PwmConfig &config, DRV8704PwmCapability &capability)=0
Update the operating PWM frequency.
DRV8704PwmBackend::writeDuty
virtual bool writeDuty(int8_t pin, uint32_t dutyCount, uint32_t maxDuty)=0
Apply a PWM duty count to one bridge-input pin.
DRV8704PwmBackend::begin
virtual bool begin(const DRV8704Pins &pins, const DRV8704PwmConfig &config, DRV8704PwmCapability &capability)=0
Initialize hardware PWM resources for the provided input pins.
DRV8704PwmBackend::releasePin
virtual void releasePin(int8_t pin)=0
Stop PWM on one pin and return it to GPIO control.
drv8704CreatePwmBackend
DRV8704PwmBackend * drv8704CreatePwmBackend()
Create the platform PWM backend selected by the active Arduino core.
Definition: drv8704_pwm_general.cpp:95
drv8704_types.h
Public enums and data structures for the DRV8704 driver.
DRV8704Pins
Pin assignment bundle for a DRV8704 instance.
Definition: drv8704_types.h:179
DRV8704PwmCapability
Resolved platform PWM capabilities for the active backend.
Definition: drv8704_types.h:332
DRV8704PwmConfig
Requested PWM generator settings.
Definition: drv8704_types.h:320