![]() |
Serial Wombat Arduino Library
|
A Class that consumes CPU time on the Serial Wombat chip in order to facilitate testing. More...
#include <SerialWombatThroughputConsumer.h>
Public Member Functions | |
SerialWombatThroughputConsumer (SerialWombatChip &serialWombat) | |
Constructor for SerialWombatThroughputConsumer class. More... | |
int16_t | begin (uint8_t pin) |
Initialize an instance of the Throughput Conumer class. All delays are set to 0. More... | |
int16_t | writeAll (uint16_t delay) |
Set all delay times to a specified number of uS. More... | |
int16_t | write (uint8_t frame, uint16_t delay) |
Set a frame delay time to a specified number of uS. More... | |
int16_t | delayInCommProcessing (uint16_t delay) |
Delay a specified number of uS within the packet processing routine. More... | |
![]() | |
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 |
A Class that consumes CPU time on the Serial Wombat chip in order to facilitate testing.
This class is only supported on the Serial Wombat SW18AB chip. It is not supported on the Serial Wombat 4X line.
This class provides a means to consume throughput inside of a pin in order to test different CPU loading secenarios.
This class provides an array of 16 delays measured in uS. When each frame runs the cumulative frame counter is taken mod 16 to determine which delay to use. During this delay the pin goes high and waits in a loop for approximately the specified number of uS.
SerialWombatThroughputConsumer::SerialWombatThroughputConsumer | ( | SerialWombatChip & | serialWombat | ) |
Constructor for SerialWombatThroughputConsumer class.
serialWombat | SerialWombatChip on which the ThroughputConsumer will run |
int16_t SerialWombatThroughputConsumer::begin | ( | uint8_t | pin | ) |
Initialize an instance of the Throughput Conumer class. All delays are set to 0.
int16_t SerialWombatThroughputConsumer::delayInCommProcessing | ( | uint16_t | delay | ) |
Delay a specified number of uS within the packet processing routine.
delay | The number of uS to delay in each frame |
int16_t SerialWombatThroughputConsumer::write | ( | uint8_t | frame, |
uint16_t | delay | ||
) |
Set a frame delay time to a specified number of uS.
frame | The frame number (0-15) to set |
delay | The number of uS to delay in each frame |
int16_t SerialWombatThroughputConsumer::writeAll | ( | uint16_t | delay | ) |
Set all delay times to a specified number of uS.
delay | The number of uS to delay in each frame |