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

This class extends SerialWombatAnalogInput with SW18AB specific capabilities. More...

#include <SerialWombatAnalogInput.h>

Inheritance diagram for SerialWombatAnalogInput_18AB:
SerialWombatAnalogInput SerialWombatAbstractProcessedInput SerialWombatPin

Public Member Functions

 SerialWombatAnalogInput_18AB (SerialWombatChip &serialWombat)
 
int16_t setInputSource (uint8_t inputSource)
 Set the pin to use another pin's public data instead of the A/D converter as input. More...
 
int16_t setQueue (uint16_t queueIndex, uint16_t msBetweenQueues)
 Set a Queue in User memory periodically store A/D results (SW18AB only) More...
 
uint8_t pin ()
 
uint8_t swPinModeNumber ()
 
- Public Member Functions inherited from SerialWombatAnalogInput
 SerialWombatAnalogInput (SerialWombatChip &SerialWombatChip)
 Constructor for the SerialWombatAnalogInput class. More...
 
int16_t begin (uint8_t pin, uint16_t averageSamples=64, uint16_t filterConstant=0xFF80, AnalogInputPublicDataOutput output=AnalogInputPublicDataOutput::AnalogInputPublicDataOutput_Raw)
 Initialize an analog input on a given pin. More...
 
uint16_t readVoltage_mV ()
 Retreive a raw A/D measurement and convert it to mV. More...
 
uint16_t readCounts ()
 Retreive a raw A/D measurement. More...
 
uint16_t readFiltered_mV ()
 Retreive a filtered A/D measurement and convert it to mV. More...
 
uint16_t readFilteredCounts ()
 Retreive a filtered A/D measurement. More...
 
uint16_t readAveraged_mV ()
 Retreive an averaged A/D measurement and convert it to mV. More...
 
uint16_t readAveragedCounts ()
 Retreive an averaged A/D measurement. More...
 
uint16_t updateSupplyVoltage_mV ()
 Provides a wrapper around the readSupplyVoltage_mV() method for the SerialWombat chip hosting this pin mode. More...
 
 ~SerialWombatAnalogInput ()
 
uint16_t readMaximum_mV (bool resetAfterRead=false)
 Retreive the maximum single sample A/D value in mV. More...
 
uint16_t readMaximumCounts (bool resetAfterRead=false)
 Retreive the maximum single sample A/D value in counts. More...
 
uint16_t readMinimum_mV (bool resetAfterRead=false)
 Retreive the minimum single sample A/D value in mV. More...
 
uint16_t readMinimumCounts (bool resetAfterRead=false)
 Retreive the maximum single sample A/D value in counts. 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...
 
- Public Member Functions inherited from SerialWombatAbstractProcessedInput
 SerialWombatAbstractProcessedInput (SerialWombatChip &sw)
 Constructor for the SerialWombatAbstractScaledOutput Class. More...
 
int16_t writeInverted (bool inverted)
 
int16_t writeFirstOrderFilteringConstant (uint16_t constant)
 
int16_t writeAveragingNumberOfSamples (uint16_t numberOfSamples)
 
int16_t writeExcludeBelowAbove (uint16_t low, uint16_t high)
 
int16_t configureQueue (SerialWombatQueue *queue, Frequency frequency, bool queueHighByte=true, bool queueLowByte=true)
 
int16_t configureOutputValue (OutputValue outputValue)
 
int16_t configureTransformScaleRange (uint16_t min, uint16_t max)
 
int16_t configureTransformLinearMXB (int32_t m, int32_t b)
 
int16_t writeProcessedInputEnable (bool enabled)
 
uint16_t readMinimum (bool reset=false)
 
uint16_t readMaximum (bool reset=false)
 
uint16_t readAverage ()
 
uint16_t readFiltered ()
 

Additional Inherited Members

- Public Types inherited from SerialWombatAbstractProcessedInput
enum  Frequency {
  FREQ_1Hz = 0, FREQ_2Hz = 1, FREQ_4Hz = 2, FREQ_8Hz = 3,
  FREQ_16Hz = 4, FREQ_32Hz = 5, FREQ_64Hz = 6, FREQ_128Hz = 7,
  FREQ_256Hz = 8, FREQ_512Hz = 9, FREQ_1024Hz = 10
}
 
enum  OutputValue { RAW = 0, AVERAGE = 1, FIRST_ORDER_FILTERED = 2 }
 
enum  Transform { NONE = 0, SCALE_RANGE = 1, LINEAR_MXB = 2 }
 
- Protected Attributes inherited from SerialWombatPin
uint8_t _pin = 255
 
SerialWombatChip_sw
 
uint8_t _pinMode = 0
 

Detailed Description

This class extends SerialWombatAnalogInput with SW18AB specific capabilities.

Constructor & Destructor Documentation

◆ SerialWombatAnalogInput_18AB()

SerialWombatAnalogInput_18AB::SerialWombatAnalogInput_18AB ( SerialWombatChip serialWombat)

Member Function Documentation

◆ pin()

uint8_t SerialWombatAnalogInput_18AB::pin ( )
inlinevirtual

◆ setInputSource()

int16_t SerialWombatAnalogInput_18AB::setInputSource ( uint8_t  inputSource)

Set the pin to use another pin's public data instead of the A/D converter as input.

Parameters
inputSourcethe pin used as an input source.
Returns
returns a negative number if an error occured.

◆ setQueue()

int16_t SerialWombatAnalogInput_18AB::setQueue ( uint16_t  queueIndex,
uint16_t  msBetweenQueues 
)

Set a Queue in User memory periodically store A/D results (SW18AB only)

This feature allows precisce sampling of an A/D input and storage into a queue on the Serial Wombat chip for retreival by the host. The queue must be a previously configured SerialWombatQueue

Parameters
queueIndexThe index in the User Buffer of the queue.
msBetweenQueuesHow many mS to delay betwen storing values to the queue
Returns
returns a negative number if an error occured.

◆ swPinModeNumber()

uint8_t SerialWombatAnalogInput_18AB::swPinModeNumber ( )
inlinevirtual