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

extends the SerialWombatPulseTimer class with SW18AB specific functionality More...

#include <SerialWombatPulseTimer.h>

Inheritance diagram for SerialWombatPulseTimer_18AB:
SerialWombatPulseTimer SerialWombatPin

Public Types

enum  publicDataOutput {
  HIGH_TIME = 0, LOW_TIME = 1, PULSE_COUNT = 2, PERIOD_ON_LTH_TRANSITION = 3,
  PERIOD_ON_HTL_TRANSITION = 4, FREQUENCY_ON_LTH_TRANSITION = 5, FREQUENCY_ON_HTL_TRANSITION = 6, DUTYCYCLE_ON_LTH_TRANSITION = 7,
  DUTYCYCLE_ON_HTL_TRANSITION = 8
}
 

Public Member Functions

 SerialWombatPulseTimer_18AB (SerialWombatChip &serialWombat)
 constructor for SerialWombatPulseTimer_18AB More...
 
int16_t configurePublicDataOutput (SerialWombatPulseTimer_18AB::publicDataOutput publicDataOutput)
 configures which measurement is the Public Data Output of this pin mode More...
 
- Public Member Functions inherited from SerialWombatPulseTimer
 SerialWombatPulseTimer (SerialWombatChip &serialWombat)
 Class constructor for SerialWombatPulseTimer. More...
 
void begin (uint8_t pin, SerialWombatPulseTimerUnits units=SW_PULSETIMER_uS, bool pullUpEnabled=false)
 Initialization routine for SerialWombatPulseTimer. More...
 
void refresh ()
 Retreive the latest values for HighCounts, LowCounts, Pulses, and MeasurementOverflowOccured. More...
 
void refreshHighCountsLowCounts ()
 Retreive the High and Low counts from the Serial Wombat chip in a single transaction. More...
 
void refreshHighCountsPulses ()
 Retreive the High counts and number of pulses Serial Wombat chip in a single transaction. More...
 
uint16_t readHighCounts ()
 Retreives the most recent Counts in the configured units for the most recent high pulse. More...
 
uint16_t readLowCounts ()
 Retreives the most recent Counts in the configured units for the most recent low pulse. More...
 
uint16_t readPulses ()
 Retreives the number of pulses. 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)
 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

- Public Attributes inherited from SerialWombatPulseTimer
uint16_t HighCounts = 0
 Count in selected units of last retreived high pulse. More...
 
uint16_t LowCounts = 0
 Count in selected units of last retreived low pulse. More...
 
uint16_t Pulses = 0
 Count of last retreived pulses. More...
 
bool MeasurementOverflowOccurred = false
 
- Protected Attributes inherited from SerialWombatPin
uint8_t _pin = 255
 
SerialWombatChip_sw
 
uint8_t _pinMode = 0
 

Detailed Description

extends the SerialWombatPulseTimer class with SW18AB specific functionality

This class adds functionality that is specific to the SW18AB firmware in addition to generic SerialWombatPulseTimer functionality avaialble on all Serial Wombat chips

Member Enumeration Documentation

◆ publicDataOutput

Enumerator
HIGH_TIME 

The pulse high time in uS. Updated on each high to low transition.

LOW_TIME 

the pulse low time in uS. Update on each low to high transition.

PULSE_COUNT 

The number of pulses that have occured since initialization. Updated on each high to low transition.

PERIOD_ON_LTH_TRANSITION 

The period of the pulse in uS, based on the previous high and low times, updated on low to high transition.

PERIOD_ON_HTL_TRANSITION 

The period of the pulse in uS, based on the previous high and low times, updated on high to low transition.

FREQUENCY_ON_LTH_TRANSITION 

The frequency of the pulse in Hz, based on the previous high and low times, updated on low to high transition.

FREQUENCY_ON_HTL_TRANSITION 

The frequency of the pulse in Hz, based on the previous high and low times, updated on high to low transition.

DUTYCYCLE_ON_LTH_TRANSITION 

Duty cycle of the pulse as a ratio from 0 to 65535, updated on low to high transition.

DUTYCYCLE_ON_HTL_TRANSITION 

Duty cycle of the pulse as a ratio from 0 to 65535, updated on high to low transition.

Constructor & Destructor Documentation

◆ SerialWombatPulseTimer_18AB()

SerialWombatPulseTimer_18AB::SerialWombatPulseTimer_18AB ( SerialWombatChip serialWombat)

constructor for SerialWombatPulseTimer_18AB

Parameters
serialWombatreference to the SerialWombat chip on which the SerialWombatPulseTimer_18AB will run

Member Function Documentation

◆ configurePublicDataOutput()

int16_t SerialWombatPulseTimer_18AB::configurePublicDataOutput ( SerialWombatPulseTimer_18AB::publicDataOutput  publicDataOutput)

configures which measurement is the Public Data Output of this pin mode

This function sets what data is avaialble through the public data This function is only avaialble on the Serial Wombat 18AB chip

Parameters
publicDataOutputAn enumerated type indicating what data to output
Returns
returns 0 or higher for success or a negative error code.