79 int16_t
begin( uint8_t
pin, uint16_t address , uint8_t irMode = 0)
85 uint8_t tx[8] = { 200,
_pin,
_pinMode, 0,0x55,0x55,0x55, 0x55 };
87 return _sw.sendPacket(tx, rx);
98 uint8_t tx[8] = { 220,
_pin,
_pinMode,0x55,0x55,0x55, 0x55,0x55 };
100 return _sw.sendPacket(tx, rx);
108 int sendMessage(uint8_t command, int32_t address = -1, uint8_t repeat = 0)
110 uint8_t peektx[8] = { 203,
_pin,
_pinMode,0x55,0x55,0x55,0x55,0x55 };
112 _sw.sendPacket(peektx, peekrx);
123 _sw.sendPacket(tx,rx);
190 virtual size_t write(
const uint8_t* buffer,
size_t size)
194 for (bytesSent = 0; bytesSent < size ;)
196 size_t result =
write(buffer[bytesSent]);
211 uint8_t peektx[8] = { 203,
_pin,
_pinMode,0x55,0x55,0x55,0x55,0x55 };
213 _sw.sendPacket(peektx, peekrx);
Class for a Serial Wombat chip. Each Serial Wombat chip on a project should have its own instance.
virtual size_t readBytes(char *buffer, size_t length)
This function exists to satisfy stream requirements, and always returns 0.
int16_t begin(uint8_t pin, uint16_t address, uint8_t irMode=0)
virtual int availableForWrite()
Queries the SerialWombatUART for the amount of free TX queue space.
virtual void setTimeout(long timeout_mS)
This function exists to satisfy stream requirements.
int sendMessage(uint8_t command, int32_t address=-1, uint8_t repeat=0)
Write a byte to the SerialWombatIRTx for Transmit as a command using the prior specified address.
virtual size_t write(uint8_t data)
Write a byte to the SerialWombatIRTx for Transmit as a command using the prior specified address.
virtual int peek()
This function exists to satisfy stream requirements, and always returns -1.
virtual size_t write(const uint8_t *buffer, size_t size)
Write bytes to the SerialWombatUART for Transmit.
virtual void flush()
Discard all received bytes. Does nothing, exists to satisfy stream requirements.
virtual int read()
This function exists to satisfy stream requirements, and always returns -1.
virtual int available()
This function exists to satisfy stream requirements, and always returns 0.
int16_t enableSW8b38KHzWP6()
Causes pin WP6 on the Serial Wombat 8B to generate a 38kHz carrier wave.
SerialWombatIRTx(SerialWombatChip &serialWombat)
Constructor for the SerialWombatIRTx class.
SerialWombatPin(SerialWombatChip &serialWombatChip)
Instantiates a Serial Wombat Pin.
uint8_t pin()
Returns the current SW pin number. Used primarily for virtual calls by derived classes.