Serial Wombat Arduino Library
|
Describes a Serial Wombat Pin. Is base class for other pin modes. More...
#include <SerialWombatPin.h>
Public Member Functions | |
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, bool pullDown=false, bool openDrain=false) |
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... | |
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) More... | |
Protected Attributes | |
uint8_t | _pin = 255 |
SerialWombatChip & | _sw |
uint8_t | _pinMode = 0 |
Describes a Serial Wombat Pin. Is base class for other pin modes.
This class describes a Serial Wombat Pin on a Serial Wombat Chip. This class can be used to control a pin as a simple Digital I/O pin. This class is used as a base class for many other pin mode classes.
Digital I/O related members such as digitalWrite or pinMode should not be called against derived classes as this may have unpredicable effects on the state machines run by those derived classes.
|
inline |
Instantiates a Serial Wombat Pin.
serialWombatChip | The chip on which the Serial Wombat Pin exists |
|
inline |
Instantiates a Serial Wombat Pin.
serialWombatChip | The chip on which the Serial Wombat Pin exists |
pin | The pin number of the pin (WP number, not package pin number) of the pin |
|
inline |
Reads the state of the Pin.
This function is based on the pin's public data, not a raw reading.
|
inline |
Set output pin High or Low.
Before calling this function, the pin should be configured as an input or output with pinMode()
pin | The Serial Wombat pin to set. Valid values for SW4A: 0-3 SW4B: 1-3 |
val | Valid values are HIGH or LOW not use SW_INPUT, SW_HIGH or SW_LOW here, as these have different meanings |
|
inline |
Disables the pin mode (if applicable)
|
inline |
|
inline |
|
inline |
|
inline |
Returns the current SW pin number. Used primarily for virtual calls by derived classes.
|
inline |
Set pin to INPUT or OUTPUT, with options for pull Ups and open Drain settings.
mode | Valid values are INPUT, OUTPUT or INPUT_PULLUP as defined by arduino. Do not use SW_INPUT, SW_HIGH or SW_LOW here, as these have different meanings |
pullDown | If True, a weak pull down will be enabled on this pin (No effect on SW4A/SW4B) |
openDrain | If True, output becomes openDrain output rather than push / pull |
|
inline |
Read the 16 Bit public data associated with this pin.
Reads and returns the 16 bit value associated with this pin.
|
inline |
Returns the Mode number. Used primarily by derived classes to populate packet data.
|
inline |
Write a 16 bit value to this pin.
value | The 16 bit value to write |
|
protected |
|
protected |
|
protected |