Serial Wombat Arduino Library
Loading...
Searching...
No Matches
SerialWombatBlink Class Reference

A class representing a Serial Wombat Blink Output. More...

#include <SerialWombatBlink.h>

Inheritance diagram for SerialWombatBlink:
Collaboration diagram for SerialWombatBlink:

Public Member Functions

 SerialWombatBlink (SerialWombatChip &serialWombat)
 Constructor for SerialWombatBlink class.
 
int16_t begin (uint8_t pin, uint8_t publicDataSource)
 Initialize a pin that has been declared as Blink.
 
int16_t begin (uint8_t pin, SerialWombatDataSource publicDataSource)
 Initialize a pin that has been declared as Blink.
 
- Public Member Functions inherited from SerialWombatPin
 SerialWombatPin (SerialWombatChip &serialWombatChip)
 Instantiates a Serial Wombat Pin.
 
 SerialWombatPin (SerialWombatChip &serialWombatChip, uint8_t pin)
 Instantiates a Serial Wombat Pin.
 
uint16_t readPublicData ()
 Read the 16 Bit public data associated with this pin.
 
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.
 
void digitalWrite (uint8_t val)
 Set output pin High or Low.
 
int digitalRead ()
 Reads the state of the Pin.
 
uint16_t writePublicData (uint16_t value)
 Write a 16 bit value to this pin.
 
uint8_t pin ()
 Returns the current SW pin number. Used primarily for virtual calls by derived classes.
 
uint8_t swPinModeNumber ()
 Returns the Mode number. Used primarily by derived classes to populate packet data.
 
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)
 
int16_t enablePullup (bool enabled)
 Enables the weak pull up on a pin. Implemented on SW18AB and SW8B only.
 
int16_t enablePulldown (bool enabled)
 Enables the weak pull down on a pin. Implemented on SW18AB and SW8B only.
 
int16_t enableOpenDrain (bool enabled)
 Enables open drain mode on a pin. Implemented on SW18AB and SW8B only.
 
int16_t forceDMA (bool enabled)
 Forces use of DMA instead of hardware timing resources on SW18AB.
 
void setPinNumberForTesting (uint8_t pin)
 A function designed for testing only. May have unpredictable results if used in real time. Not intended for general use.
 

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 Blink Output.

An instance of this class should be declared for each pin to be used as a Serial Wombat Blink Output.

This is a very simple pin mode that sets an output high for at least 30mS each time a public data value changes. Otherwise the pin is digital low.
A constantly changing output can cause this pin to remain high (the 30mS timer is reset to 30 each time the public data input changes.

The public data of this pin indicates how many mS of on time remain.

This pin mode exists to provide a blink option using very little microcontroller flash space, so it can be included with all SW8B builds. See the SerialWombatPulseOnChange pin mode for a much more powerful and configurable version.

Definition at line 52 of file SerialWombatBlink.h.

Constructor & Destructor Documentation

◆ SerialWombatBlink()

SerialWombatBlink::SerialWombatBlink ( SerialWombatChip & serialWombat)
inline

Constructor for SerialWombatBlink class.

Parameters
serialWombatSerialWombat chip on which the Blink output will run

Definition at line 59 of file SerialWombatBlink.h.

Member Function Documentation

◆ begin() [1/2]

int16_t SerialWombatBlink::begin ( uint8_t pin,
SerialWombatDataSource publicDataSource )
inline

Initialize a pin that has been declared as Blink.

Parameters
pinPin to initialize to Blink mode.
publicDataSourcePin that will cause a blink if it changes.
Returns
0 if successful, non-zero otherwise.

Definition at line 80 of file SerialWombatBlink.h.

◆ begin() [2/2]

int16_t SerialWombatBlink::begin ( uint8_t pin,
uint8_t publicDataSource )
inline

Initialize a pin that has been declared as Blink.

Parameters
pinPin to initialize to Blink mode.
publicDataSourcePin that will cause a blink if it changes.
Returns
0 if successful, non-zero otherwise.

Definition at line 67 of file SerialWombatBlink.h.