An RC5 decoder and preamp controller. Written on the LPC11U24, Ported to LPC1114 and now 100% stable (January 2016)
Dependents: AppleRemoteController_copy_Production_Version AppleRemoteController_Reference_Only
rc5codes.h@0:83d4a20e7bc7, 2015-06-16 (annotated)
- Committer:
- andrewcrussell
- Date:
- Tue Jun 16 11:22:55 2015 +0000
- Revision:
- 0:83d4a20e7bc7
- Child:
- 1:bb881a434906
RC5 Decoder with various outputs and inputs to control a preamp
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewcrussell | 0:83d4a20e7bc7 | 1 | /********************************* RC5 control codes ******************************/ |
andrewcrussell | 0:83d4a20e7bc7 | 2 | // The Philips RC5 coce consists of 14 bits delivered in bi-phase Manchester encoding from |
andrewcrussell | 0:83d4a20e7bc7 | 3 | // an IR LED on the remote. This is picked up by a detector (e.g. a Vishay TSOP3741) which |
andrewcrussell | 0:83d4a20e7bc7 | 4 | // outputs the demodulated bit stream as follows:- |
andrewcrussell | 0:83d4a20e7bc7 | 5 | // First 2 bits are start bits - allow the detector AGC to stabilize and trigger decoding process |
andrewcrussell | 0:83d4a20e7bc7 | 6 | // Third bit is the toggle bit - it remains at the same logic level as long as a key is depressed |
andrewcrussell | 0:83d4a20e7bc7 | 7 | // and will change to the alternate state when the key is un/re-depressed or when a different |
andrewcrussell | 0:83d4a20e7bc7 | 8 | // key is depressed |
andrewcrussell | 0:83d4a20e7bc7 | 9 | // Bits 4~8 are the address bits and determine which piece of equipment is being controlled |
andrewcrussell | 0:83d4a20e7bc7 | 10 | // Bits 9~14 are the command bits |
andrewcrussell | 0:83d4a20e7bc7 | 11 | // As long as a key is depressed, the 14 bits will be sent by the remote controller in sequential |
andrewcrussell | 0:83d4a20e7bc7 | 12 | // blocks with a 120ms delay between subsequent block transmissions |
andrewcrussell | 0:83d4a20e7bc7 | 13 | // See http://en.wikipedia.org/wiki/RC-5 for the codes |
andrewcrussell | 0:83d4a20e7bc7 | 14 | |
andrewcrussell | 0:83d4a20e7bc7 | 15 | // 0-9 NUMERIC KEYS 0 - 9 - not used in this implementation |
andrewcrussell | 0:83d4a20e7bc7 | 16 | |
andrewcrussell | 0:83d4a20e7bc7 | 17 | // unused commands and addresses have been commented out - simply un-comment them to use them |
andrewcrussell | 0:83d4a20e7bc7 | 18 | // but note that if you do this, you will have to decode them, otherwise they will just fall through |
andrewcrussell | 0:83d4a20e7bc7 | 19 | // and be ignored by the decoder. Only the ones un-commented out below are active in V1.0 |
andrewcrussell | 0:83d4a20e7bc7 | 20 | // note you will also need to write the associated command processor functions |
andrewcrussell | 0:83d4a20e7bc7 | 21 | |
andrewcrussell | 0:83d4a20e7bc7 | 22 | #define STANDBY 12 // toggle power ON and OFF |
andrewcrussell | 0:83d4a20e7bc7 | 23 | #define MUTE 13 // toggle output signal on and off |
andrewcrussell | 0:83d4a20e7bc7 | 24 | // #define 14 PRESETS |
andrewcrussell | 0:83d4a20e7bc7 | 25 | #define VUP 16 |
andrewcrussell | 0:83d4a20e7bc7 | 26 | #define VDOWN 17 |
andrewcrussell | 0:83d4a20e7bc7 | 27 | // #define 18 BRIGHTNESS + |
andrewcrussell | 0:83d4a20e7bc7 | 28 | // #define 19 BRIGHTNESS - |
andrewcrussell | 0:83d4a20e7bc7 | 29 | // #define 20 COLOR SATURATION + |
andrewcrussell | 0:83d4a20e7bc7 | 30 | // #define 21 COLOR SATURATION - |
andrewcrussell | 0:83d4a20e7bc7 | 31 | // #define BASSUP 22 |
andrewcrussell | 0:83d4a20e7bc7 | 32 | // #define BASSDOWN 23 |
andrewcrussell | 0:83d4a20e7bc7 | 33 | // #define TREBLEUP 24 |
andrewcrussell | 0:83d4a20e7bc7 | 34 | // #define TREBLEDWN 25 |
andrewcrussell | 0:83d4a20e7bc7 | 35 | // #define BALRIGHT 26 |
andrewcrussell | 0:83d4a20e7bc7 | 36 | // #define BALLEFT 27 |
andrewcrussell | 0:83d4a20e7bc7 | 37 | // #define PAUSE 48 |
andrewcrussell | 0:83d4a20e7bc7 | 38 | // #define 50 FAST REVERSE |
andrewcrussell | 0:83d4a20e7bc7 | 39 | // #define 52 FAST FORWARD- |
andrewcrussell | 0:83d4a20e7bc7 | 40 | // #define PLAY 53 |
andrewcrussell | 0:83d4a20e7bc7 | 41 | // #define STOP 54 |
andrewcrussell | 0:83d4a20e7bc7 | 42 | // #define 55 RECORD |
andrewcrussell | 0:83d4a20e7bc7 | 43 | #define SELECT_R 3 // rotates input through inputs - must depress and then release each time |
andrewcrussell | 0:83d4a20e7bc7 | 44 | |
andrewcrussell | 0:83d4a20e7bc7 | 45 | /* RC5 address */ |
andrewcrussell | 0:83d4a20e7bc7 | 46 | // #define 0 TV SET 1 |
andrewcrussell | 0:83d4a20e7bc7 | 47 | // #define 1 TV SET 2 |
andrewcrussell | 0:83d4a20e7bc7 | 48 | // #define 2 VIDEOTEXT |
andrewcrussell | 0:83d4a20e7bc7 | 49 | // #define 3 EXPANSION FOR TV 1 AND 2 |
andrewcrussell | 0:83d4a20e7bc7 | 50 | // #define 4 LASER VIDEO PLAYER |
andrewcrussell | 0:83d4a20e7bc7 | 51 | // #define 5 VIDEO RECORDER 1 (VCR 1) |
andrewcrussell | 0:83d4a20e7bc7 | 52 | // #define 6 VIDEO RECORDER 2 (VCR 2) |
andrewcrussell | 0:83d4a20e7bc7 | 53 | // #define 7 RESERVED |
andrewcrussell | 0:83d4a20e7bc7 | 54 | // #define 8 SAT 1 |
andrewcrussell | 0:83d4a20e7bc7 | 55 | // #define 9 EXPANSION FOR VCR 1 OR 2 |
andrewcrussell | 0:83d4a20e7bc7 | 56 | // #define 10 SAT 2 |
andrewcrussell | 0:83d4a20e7bc7 | 57 | // #define 11 RESERVED |
andrewcrussell | 0:83d4a20e7bc7 | 58 | // #define 12 CD VIDEO |
andrewcrussell | 0:83d4a20e7bc7 | 59 | // #define 13 RESERVED |
andrewcrussell | 0:83d4a20e7bc7 | 60 | // #define 14 CD PHOTO |
andrewcrussell | 0:83d4a20e7bc7 | 61 | // #define RESERVED |
andrewcrussell | 0:83d4a20e7bc7 | 62 | #define PREAMP 16 |
andrewcrussell | 0:83d4a20e7bc7 | 63 | // #define RECEIVER 17 |
andrewcrussell | 0:83d4a20e7bc7 | 64 | // #define 18 TAPE / CASSETE RECORDER |
andrewcrussell | 0:83d4a20e7bc7 | 65 | // #define PRE2 19 |
andrewcrussell | 0:83d4a20e7bc7 | 66 | // #define CD 20 |
andrewcrussell | 0:83d4a20e7bc7 | 67 | // #define AUDIO_RACK 21 |
andrewcrussell | 0:83d4a20e7bc7 | 68 | // #define 22 AUDIO SAT RECEIVER |
andrewcrussell | 0:83d4a20e7bc7 | 69 | // #define 23 DCC RECORDER |
andrewcrussell | 0:83d4a20e7bc7 | 70 | // #define 24 RESERVED |
andrewcrussell | 0:83d4a20e7bc7 | 71 | // #define 25 RESERVED |
andrewcrussell | 0:83d4a20e7bc7 | 72 | // #define 26 WRITABLE CD |
andrewcrussell | 0:83d4a20e7bc7 | 73 | // #define 26-31 RESERVED0 TV SET 1 |
andrewcrussell | 0:83d4a20e7bc7 | 74 | |
andrewcrussell | 0:83d4a20e7bc7 | 75 | |
andrewcrussell | 0:83d4a20e7bc7 | 76 | |
andrewcrussell | 0:83d4a20e7bc7 | 77 | |
andrewcrussell | 0:83d4a20e7bc7 | 78 | |
andrewcrussell | 0:83d4a20e7bc7 | 79 | |
andrewcrussell | 0:83d4a20e7bc7 | 80 | |
andrewcrussell | 0:83d4a20e7bc7 | 81 |