![]() |
Serial Wombat Arduino Library
|
Extends the SerialWombatPWM class with SW4A/SW4B specific functionality. More...
#include <SerialWombatPWM.h>
Public Member Functions | |
SerialWombatPWM_4AB (SerialWombatChip &serialWombat) | |
void | setFrequency_SW4AB (Wombat4A_B_PWMFrequencyValues_t frequency) |
Set PWM Frequency (Adjusts all PWM outputs' frequency on a SerialWombat 4A/B chip) More... | |
![]() | |
SerialWombatPWM (SerialWombatChip &serialWombat) | |
Constructor for SerialWombatPWM class. More... | |
void | begin (uint8_t pin, uint16_t dutyCycle=0, bool invert=false) |
Initialize a pin that has been declared as PWM. More... | |
void | writeDutyCycle (uint16_t dutyCycle) |
Set PWM duty cycle. More... | |
~SerialWombatPWM () | |
![]() | |
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) |
Set pin to INPUT or OUTPUT. More... | |
void | pinMode (uint8_t mode, bool pullDown, bool openDrain) |
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... | |
Additional Inherited Members | |
![]() | |
uint8_t | _pin = 255 |
SerialWombatChip & | _sw |
uint8_t | _pinMode = 0 |
Extends the SerialWombatPWM class with SW4A/SW4B specific functionality.
SerialWombatPWM_4AB::SerialWombatPWM_4AB | ( | SerialWombatChip & | serialWombat | ) |
void SerialWombatPWM_4AB::setFrequency_SW4AB | ( | Wombat4A_B_PWMFrequencyValues_t | frequency | ) |
Set PWM Frequency (Adjusts all PWM outputs' frequency on a SerialWombat 4A/B chip)
frequency | A value of the Wombat4A_B_PWMFrequencyValues_t enumeration |
This function changes the Serial Wombat 4A and 4B PWM output frequncy by adjusting the clock divisor for the PWM generation hardware. By default the value is 31250Hz. Changing the frequency may reduce PWM resolution from 10 bits to 8 bits for some frequencies. However, the input value for duty cycle for methods of this class continue to be 0 to 65535 and are scaled accordingly.