Serial Wombat Arduino Library
|
A class for the Serial Wombat SW8B or SW18AB chips which received IR remote signals. Currently only NEC protocol is supported. More...
#include <SerialWombatIRRx.h>
Public Types | |
enum | publicDataOutput { COMMAND = 0 , ADDRESS = 1 , DATACOUNT = 2 } |
Public Member Functions | |
SerialWombatIRRx (SerialWombatChip &sw) | |
Constructor for the SerialWombatIRRx class. | |
int16_t | begin (uint8_t pin, uint8_t irMode=0, bool useRepeat=true, SerialWombatPinState_t activeState=SW_LOW, uint16_t publicDataTimeoutPeriod_mS=1000, uint16_t publicDataTimeoutValue=0xFFFF, bool useAddressFilter=false, uint16_t addressFilterValue=0x1234, SerialWombatIRRx::publicDataOutput dataOutput=SerialWombatIRRx::publicDataOutput::COMMAND) |
Initalize the SerialWombatIRRx. | |
int | available () |
int | read () |
Reads a byte from the SerialWombatIRRx queue. | |
void | flush () |
Discard all bytes from the SerialWombatIRRx queue. | |
int | peek () |
Query the SerialWombatIRRx queue for the next avaialble byte, but don't remove it from the queue. | |
size_t | write (uint8_t data) |
Write a byte to the SerialWombatIRRx queue (Does Nothing) | |
size_t | write (const uint8_t *buffer, size_t size) |
Write bytes to the SerialWombatIRRx queue (Does nothing) | |
int | availableForWrite () |
Number of bytes avaialble to write to SerialWombatIRRx queue. Returns 0. | |
size_t | readBytes (char *buffer, size_t length) |
Reads a specified number of bytes from the SerialWombatIRRx queue queue. | |
void | setTimeout (long timeout_mS) |
implemented to fulfill Stream requirement. | |
SerialWombatIRRx | operator= (SerialWombatIRRx &irrx) |
used to allow reference copy. Not for user use. | |
uint16_t | readAddress () |
uint16_t | readDataCount () |
![]() | |
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. | |
Protected Attributes | |
uint32_t | timeout = 1 |
![]() | |
uint8_t | _pin = 255 |
SerialWombatChip & | _sw |
uint8_t | _pinMode = 0 |
A class for the Serial Wombat SW8B or SW18AB chips which received IR remote signals. Currently only NEC protocol is supported.
A Tutorial video is avaialble:
COMING SOON
The class inherits from the Arduino Stream class, so queued button presses can be read like a Serial port.
Definition at line 47 of file SerialWombatIRRx.h.
Definition at line 51 of file SerialWombatIRRx.h.
|
inline |
Constructor for the SerialWombatIRRx class.
serialWombat | The Serial Wombat Chip on which the SerialWombatUART instance will run. |
Definition at line 62 of file SerialWombatIRRx.h.
|
inline |
Definition at line 125 of file SerialWombatIRRx.h.
|
inline |
Number of bytes avaialble to write to SerialWombatIRRx queue. Returns 0.
Definition at line 211 of file SerialWombatIRRx.h.
|
inline |
Initalize the SerialWombatIRRx.
controlPin | Keypad scanning transitions will occur while this pin is being serviced by the Serial Wombat executive. Typically this will be the same as the row0 pin |
row0pin | pin attached to the topmost keypad row. On many marked keypads this row has 1,2,3 and A in it. Enter 255 if this column is unused |
row1pin | pin attached to the topcenter keypad row. On many marked keypads this row has 4,5,6 and B in it. Enter 255 if this row is unused |
row2pin | pin attached to the topmost keypad row. On many marked keypads this row has 7,8,9 and C in it. Enter 255 if this row is unused |
row3pin | pin attached to the topmost keypad row. On many marked keypads this row has *,0,# and D in it. Enter 255 if this row is unused |
column0pin | pin attached to the leftmost keypad column. On many marked keypads this column has 1,4,7 and * in it. Enter 255 if this column is unused |
column1pin | pin attached to the leftcenter keypad column. On many marked keypads this column has 1,5,8 and 0 in it. Enter 255 if this column is unused |
column2pin | pin attached to the rightcenter keypad column. On many marked keypads this column has 3,5,9 and # in it. Enter 255 if this column is unused |
column3pin | pin attached to the rightmost keypad column. On many marked keypads this column has A,B,C and D in it. Enter 255 if this column is unused |
bufferMode | 0: Public data is Binary of 16 keys (Default) 1: Public data is last key index pressed 2: Public data is last key pressed or 16 for no key index 3: Public data is Ascii of last key pressed |
queueMode | 0: Button presses are queued as indexes 1: Button Presses are queued as ASCII |
rowTiming | mS to delay after setting a pin row low before reading columns |
Definition at line 80 of file SerialWombatIRRx.h.
|
inline |
Discard all bytes from the SerialWombatIRRx queue.
Definition at line 156 of file SerialWombatIRRx.h.
|
inline |
used to allow reference copy. Not for user use.
Definition at line 291 of file SerialWombatIRRx.h.
|
inline |
Query the SerialWombatIRRx queue for the next avaialble byte, but don't remove it from the queue.
Definition at line 164 of file SerialWombatIRRx.h.
|
inline |
Reads a byte from the SerialWombatIRRx queue.
Definition at line 137 of file SerialWombatIRRx.h.
|
inline |
Definition at line 297 of file SerialWombatIRRx.h.
|
inline |
Reads a specified number of bytes from the SerialWombatIRRx queue queue.
buffer | An array into which to put received bytes |
length | The maximum number of bytes to be received |
This function will read bytes from the SerialWombatIRRx queue into buffer. If 'length' characters are not available to read then the value returned will be less than length.
Definition at line 226 of file SerialWombatIRRx.h.
|
inline |
Definition at line 308 of file SerialWombatIRRx.h.
|
inline |
implemented to fulfill Stream requirement.
Definition at line 275 of file SerialWombatIRRx.h.
|
inline |
Write bytes to the SerialWombatIRRx queue (Does nothing)
buffer | An array of uint8_t bytes to send |
size | the number of bytes to send |
This function exists to fully implement the Stream class. It throws away the bytes.
Definition at line 201 of file SerialWombatIRRx.h.
|
inline |
Write a byte to the SerialWombatIRRx queue (Does Nothing)
data | Byte to write |
This function exists to fully implement the Stream class. It throws away the byte.
Definition at line 186 of file SerialWombatIRRx.h.
|
protected |
Definition at line 319 of file SerialWombatIRRx.h.