Serial Wombat Arduino Library
Public Member Functions | List of all members
SerialWombatHBridge Class Reference

A class representing a Serial Wombat H Bridge Output. More...

#include <SerialWombatHBridge.h>

Inheritance diagram for SerialWombatHBridge:
SerialWombatPin SerialWombatHBridge_18AB

Public Member Functions

 SerialWombatHBridge (SerialWombatChip &serialWombat)
 Constructor for SerialWombatHBridge class. More...
 
int16_t begin (uint8_t pin, uint8_t secondPin, uint16_t PWMPeriod_uS, SerialWombatHBridgeDriverChip chip)
 Initialize a pin that has been declared as HBridge. More...
 
- Public Member Functions inherited from SerialWombatPin
 SerialWombatPin (SerialWombatChip &serialWombatChip)
 Instantiates a Serial Wombat Pin. More...
 
 SerialWombatPin (SerialWombatChip &serialWombatChip, uint8_t pin)
 Instantiates a Serial Wombat Pin. More...
 
uint16_t readPublicData ()
 Read the 16 Bit public data associated with this pin. More...
 
void pinMode (uint8_t mode, bool pullDown=false, bool openDrain=false)
 Set pin to INPUT or OUTPUT, with options for pull Ups and open Drain settings. More...
 
void digitalWrite (uint8_t val)
 Set output pin High or Low. More...
 
int digitalRead ()
 Reads the state of the Pin. More...
 
uint16_t writePublicData (uint16_t value)
 Write a 16 bit value to this pin. More...
 
uint8_t pin ()
 Returns the current SW pin number. Used primarily for virtual calls by derived classes. More...
 
uint8_t swPinModeNumber ()
 Returns the Mode number. Used primarily by derived classes to populate packet data. More...
 
int16_t initPacketNoResponse (uint8_t packetNumber, uint8_t param0=0x55, uint8_t param1=0x55, uint8_t param2=0x55, uint8_t param3=0x55, uint8_t param4=0x55)
 
int16_t initPacketNoResponse (uint8_t packetNumber, uint16_t param0=0x55, uint8_t param1=0x55, uint8_t param2=0x55, uint8_t param3=0x55)
 
int16_t initPacketNoResponse (uint8_t packetNumber, uint16_t param0, uint16_t param1, uint8_t param2=0x55)
 
int16_t disable ()
 Disables the pin mode (if applicable) More...
 

Additional Inherited Members

- Protected Attributes inherited from SerialWombatPin
uint8_t _pin = 255
 
SerialWombatChip_sw
 
uint8_t _pinMode = 0
 

Detailed Description

A class representing a Serial Wombat H Bridge Output.

An instance of this class should be declared for each pair of pins to be used as a Serial Wombat H Bridge.

Constructor & Destructor Documentation

◆ SerialWombatHBridge()

SerialWombatHBridge::SerialWombatHBridge ( SerialWombatChip serialWombat)
inline

Constructor for SerialWombatHBridge class.

Parameters
serialWombatSerialWombat chip on which the PWM will run

Member Function Documentation

◆ begin()

int16_t SerialWombatHBridge::begin ( uint8_t  pin,
uint8_t  secondPin,
uint16_t  PWMPeriod_uS,
SerialWombatHBridgeDriverChip  chip 
)
inline

Initialize a pin that has been declared as HBridge.

Parameters
pinThe pin to become the first pin of the HBridge control.
secondPinThe 2nd pin to become the first pin of the HBridge control.
PWMPeriod_uSA value representing the period of the PWM duty cycle in uS
chipThe Driver chip being driven.