Infrared remote test functions (11/26/2010)
Infrared.h@1:d1764facee30, 2010-12-04 (annotated)
- Committer:
- AndyHope
- Date:
- Sat Dec 04 22:47:38 2010 +0000
- Revision:
- 1:d1764facee30
- Parent:
- 0:e526ff8f7602
new revision for version control
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AndyHope | 0:e526ff8f7602 | 1 | #ifndef MBED_IR_H |
AndyHope | 0:e526ff8f7602 | 2 | #define MBED_IR_H |
AndyHope | 0:e526ff8f7602 | 3 | |
AndyHope | 0:e526ff8f7602 | 4 | #include "mbed.h" |
AndyHope | 0:e526ff8f7602 | 5 | #include "SDFileSystem.h" |
AndyHope | 0:e526ff8f7602 | 6 | |
AndyHope | 0:e526ff8f7602 | 7 | class Infrared { |
AndyHope | 0:e526ff8f7602 | 8 | public: |
AndyHope | 0:e526ff8f7602 | 9 | |
AndyHope | 0:e526ff8f7602 | 10 | // these declared values will eventually be read off the SD micro card |
AndyHope | 0:e526ff8f7602 | 11 | |
AndyHope | 0:e526ff8f7602 | 12 | // format |
AndyHope | 0:e526ff8f7602 | 13 | int name, flags, eps, aeps; |
AndyHope | 0:e526ff8f7602 | 14 | |
AndyHope | 0:e526ff8f7602 | 15 | // Timing |
AndyHope | 0:e526ff8f7602 | 16 | double phead, shead, pone, sone; // values are time in us |
AndyHope | 0:e526ff8f7602 | 17 | double pzero, szero, ptoggle, stoggle, frequency; |
AndyHope | 1:d1764facee30 | 18 | double ptrail, plead, foot, gap1, gap2; |
AndyHope | 0:e526ff8f7602 | 19 | double irPeriod, cycleOn, cycleOff; |
AndyHope | 0:e526ff8f7602 | 20 | |
AndyHope | 0:e526ff8f7602 | 21 | // data |
AndyHope | 0:e526ff8f7602 | 22 | int postdata, toggleMask, data, code, invCode, preData, command, dutycycle, inversionMask; |
AndyHope | 0:e526ff8f7602 | 23 | char preDataBits, dataBits, postDataBits, repeat; |
AndyHope | 0:e526ff8f7602 | 24 | unsigned long int MSB; |
AndyHope | 0:e526ff8f7602 | 25 | |
AndyHope | 0:e526ff8f7602 | 26 | // commands |
AndyHope | 0:e526ff8f7602 | 27 | int on, off, chup, chdn, volup, voldn; |
AndyHope | 0:e526ff8f7602 | 28 | int one, two, three, four, five, six; |
AndyHope | 0:e526ff8f7602 | 29 | int seven, eight, nine, zero; |
AndyHope | 0:e526ff8f7602 | 30 | int up, down, left, right, mute; |
AndyHope | 0:e526ff8f7602 | 31 | int enter, cancel, menu, info; |
AndyHope | 0:e526ff8f7602 | 32 | |
AndyHope | 0:e526ff8f7602 | 33 | // assigns specifier to output pin |
AndyHope | 0:e526ff8f7602 | 34 | Infrared(PinName pin); |
AndyHope | 0:e526ff8f7602 | 35 | |
AndyHope | 0:e526ff8f7602 | 36 | void header(void); |
AndyHope | 0:e526ff8f7602 | 37 | void strobeSpace(void); |
AndyHope | 0:e526ff8f7602 | 38 | void strobeRC6(void); |
AndyHope | 0:e526ff8f7602 | 39 | void pulse(double pulseL); |
AndyHope | 0:e526ff8f7602 | 40 | void sendCodeDish(unsigned long int command); |
AndyHope | 0:e526ff8f7602 | 41 | void sendCodeGETV(unsigned long int command); |
AndyHope | 0:e526ff8f7602 | 42 | void sendCodeSharpTV(unsigned long int command); |
AndyHope | 0:e526ff8f7602 | 43 | void convertTiming(); |
AndyHope | 0:e526ff8f7602 | 44 | void maskBit(void); |
AndyHope | 0:e526ff8f7602 | 45 | void invertCode(int mask, int invertData); |
AndyHope | 1:d1764facee30 | 46 | double constLength(int sent); |
AndyHope | 0:e526ff8f7602 | 47 | |
AndyHope | 0:e526ff8f7602 | 48 | private: |
AndyHope | 0:e526ff8f7602 | 49 | DigitalOut irLed; |
AndyHope | 0:e526ff8f7602 | 50 | }; |
AndyHope | 0:e526ff8f7602 | 51 | |
AndyHope | 0:e526ff8f7602 | 52 | #endif |