Infrared4Arduino
Nec1Renderer.h
Go to the documentation of this file.
1 #ifndef NEC1RENDERER_H
2 #define NEC1RENDERER_H
3 
4 #include <IrSignal.h>
5 
11 class Nec1Renderer {
12 private:
13  static const frequency_t frequency = 38400U;
14  static const size_t introLength = 68U;
15  static const size_t repeatLength = 4U;
16 
17 public:
18 
27  static const IrSignal *newIrSignal(unsigned int D, unsigned int S, unsigned int F);
28 
36  static const IrSignal *newIrSignal(unsigned int D, unsigned int F) {
37  return newIrSignal(D, 255-D, F);
38  };
39 
40 private:
41  Nec1Renderer();
42  static const microseconds_t repeatData[repeatLength];
43  static const IrSequence repeat;
44  static void lsbByte(microseconds_t *intro, unsigned int& i, uint32_t& sum, unsigned int D);
45  static void process(microseconds_t *intro, unsigned int& i, uint32_t& sum, unsigned int data);
46 };
47 
48 #endif /* NEC1RENDERER_H */
49 
uint16_t microseconds_t
Type for durations in micro seconds.
Definition: InfraredTypes.h:16
A static class consisting of two functions that generate IrSignal-s from the NEC1 protocol parameters...
Definition: Nec1Renderer.h:11
This class models an IR signal with intro-, repeat-, and ending sequences.
Definition: IrSignal.h:11
uint16_t frequency_t
Type for modulation frequency in Hz.
Definition: InfraredTypes.h:33
static const IrSignal * newIrSignal(unsigned int D, unsigned int F)
Generates am IrSignal from the NEC1 parameters.
Definition: Nec1Renderer.h:36
This class consists of a vector of durations.
Definition: IrSequence.h:12
static const IrSignal * newIrSignal(unsigned int D, unsigned int S, unsigned int F)
Generates am IrSignal from the NEC1 parameters.