7 uint8_t Rc5Renderer::T = 1;
17 unsigned int index = 0U;
20 emit(1U, index, pending, repeat);
21 emit(((~F) & 0x40U) >> 6U, index, pending, repeat);
22 emit(T & 1U, index, pending, repeat);
23 emitMsb(D, 5U, index, pending, repeat);
24 emitMsb(F, 6U, index, pending, repeat);
25 emitEnd(index, pending, repeat);
27 return new IrSignal(emptyIrSequence, *repeatSequence, emptyIrSequence, frequency);
30 void Rc5Renderer::emitMsb(
unsigned int x,
unsigned int length,
32 unsigned int mask = 1U << (length - 1U);
34 emit((x & mask) != 0, index, pending, repeat);
39 void Rc5Renderer::emit(
unsigned int x,
unsigned int& index,
int& pending,
43 }
else if ((pending > 0) == ((x & 1) != 0)) {
44 repeat[index] = timebase;
46 repeat[index] = timebase;
49 repeat[index] = 2 * timebase;
52 pending = (x & 1U) ? 1 : -1;
55 void Rc5Renderer::emitEnd(
unsigned int& index,
int& pending,
microseconds_t *repeat) {
57 repeat[index] = timebase; index++;
59 repeat[index] = 0xFFFF; index++;
static const IrSignal * newIrSignal(unsigned int D, unsigned int F, unsigned int T)
Generates an RC5 signal from the RC5 parameters.
uint16_t microseconds_t
Type for durations in micro seconds.
static const IrSequence emptyIrSequence
This class models an IR signal with intro-, repeat-, and ending sequences.
This class consists of a vector of durations.