MCPcopy Create free account
hub / github.com/Arduino-IRremote/Arduino-IRremote / sendLegoPowerFunctions

Method sendLegoPowerFunctions

src/ir_Lego.hpp:113–122  ·  view source on GitHub ↗

* Start of send and decode functions ************************************/ * Here we process the structured data, and call the send raw data function * @param aMode one of LEGO_MODE_EXTENDED, LEGO_MODE_COMBO, LEGO_MODE_SINGLE */

Source from the content-addressed store, hash-verified

111 * @param aMode one of LEGO_MODE_EXTENDED, LEGO_MODE_COMBO, LEGO_MODE_SINGLE
112 */
113void IRsend::sendLegoPowerFunctions(uint8_t aChannel, uint8_t aCommand, uint8_t aMode, bool aDoSend5Times) {
114 aChannel &= 0x0F; // allow toggle and escape bits too
115 aCommand &= 0x0F;
116 aMode &= 0x0F;
117 uint8_t tParity = 0xF ^ aChannel ^ aMode ^ aCommand;
118 // send 4 bit channel, 4 bit mode, 4 bit command, 4 bit parity
119 uint16_t tRawData = (((aChannel << LEGO_MODE_BITS) | aMode) << (LEGO_COMMAND_BITS + LEGO_PARITY_BITS))
120 | (aCommand << LEGO_PARITY_BITS) | tParity;
121 sendLegoPowerFunctions(tRawData, aChannel, aDoSend5Times);
122}
123
124void IRsend::sendLegoPowerFunctions(uint16_t aRawData, uint8_t aChannel, bool aDoSend5Times) {
125

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected