7#define MIN(a, b) ((a) < (b) ? (a) : (b))
12 uint32_t sum = 9024U + 4512U + 564U;
13 introData[i] = 9024U; i++;
14 introData[i] = 4512U; i++;
15 lsbByte(introData, i, sum, D);
16 lsbByte(introData, i, sum, S);
17 lsbByte(introData, i, sum, F);
18 lsbByte(introData, i, sum, 255U-F);
19 introData[i] = 564U; i++;
22 repeatData[0] = 9024U;
23 repeatData[1] = 2256U;
26 return new IrSignal(introData, introLength, repeatData, repeatLength, frequency, dutyCycle);
29void Nec1Renderer::lsbByte(
microseconds_t *intro,
unsigned int& i, uint32_t& sum,
unsigned int X) {
30 for (
unsigned int index = 0; index < 8U; index++) {
31 transmitBit(intro, i, sum, X & 1U);
36void inline Nec1Renderer::transmitBit(
microseconds_t *intro,
unsigned int& i, uint32_t& sum,
unsigned int data) {
38 intro[i++] = data ? 1692U : 564U;
39 sum += data ? 564U+1692U : 564U+564U;
static constexpr microseconds_t MICROSECONDS_T_MAX
Largest microseconds_t number possible.
uint16_t microseconds_t
Type for durations in micro seconds.
This class models an IR signal with intro-, repeat-, and ending sequences.
static const IrSignal * newIrSignal(unsigned int D, unsigned int S, unsigned int F)
Generates am IrSignal from the NEC1 parameters.