Infrared remote test functions (11/26/2010)
Infrared.h@0:e526ff8f7602, 2010-11-26 (annotated)
- Committer:
- AndyHope
- Date:
- Fri Nov 26 18:43:44 2010 +0000
- Revision:
- 0:e526ff8f7602
- Child:
- 1:d1764facee30
Camoson Final Project 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 | 0:e526ff8f7602 | 18 | double ptrail, plead, foot, gap; |
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 | 0:e526ff8f7602 | 46 | |
AndyHope | 0:e526ff8f7602 | 47 | private: |
AndyHope | 0:e526ff8f7602 | 48 | DigitalOut irLed; |
AndyHope | 0:e526ff8f7602 | 49 | }; |
AndyHope | 0:e526ff8f7602 | 50 | |
AndyHope | 0:e526ff8f7602 | 51 | #endif |