Commit | Line | Data |
---|---|---|
d81ef559 MCC |
1 | The controls for the mux are GPIO [0,1] for source, and GPIO 2 for muting. |
2 | ||
3 | GPIO0 GPIO1 | |
4 | 0 0 TV Audio | |
5 | 1 0 FM radio | |
6 | 0 1 Line-In | |
7 | 1 1 Mono tuner bypass or CD passthru (tuner specific) | |
8 | ||
9 | GPIO 16(i believe) is tied to the IR port (if present). | |
10 | ||
11 | ------------------------------------------------------------------------------------ | |
12 | ||
13 | >From the data sheet: | |
14 | Register 24'h20004 PCI Interrupt Status | |
15 | bit [18] IR_SMP_INT Set when 32 input samples have been collected over | |
16 | gpio[16] pin into GP_SAMPLE register. | |
17 | ||
18 | What's missing from the data sheet: | |
19 | ||
20 | Setup 4KHz sampling rate (roughly 2x oversampled; good enough for our RC5 | |
21 | compat remote) | |
22 | set register 0x35C050 to 0xa80a80 | |
23 | ||
24 | enable sampling | |
25 | set register 0x35C054 to 0x5 | |
26 | ||
27 | Of course, enable the IRQ bit 18 in the interrupt mask register .(and | |
28 | provide for a handler) | |
29 | ||
30 | GP_SAMPLE register is at 0x35C058 | |
31 | ||
32 | Bits are then right shifted into the GP_SAMPLE register at the specified | |
d6bc8ac9 | 33 | rate; you get an interrupt when a full DWORD is received. |
d81ef559 MCC |
34 | You need to recover the actual RC5 bits out of the (oversampled) IR sensor |
35 | bits. (Hint: look for the 0/1and 1/0 crossings of the RC5 bi-phase data) An | |
36 | actual raw RC5 code will span 2-3 DWORDS, depending on the actual alignment. | |
37 | ||
38 | I'm pretty sure when no IR signal is present the receiver is always in a | |
39 | marking state(1); but stray light, etc can cause intermittent noise values | |
40 | as well. Remember, this is a free running sample of the IR receiver state | |
41 | over time, so don't assume any sample starts at any particular place. | |
42 | ||
43 | http://www.atmel.com/dyn/resources/prod_documents/doc2817.pdf | |
44 | This data sheet (google search) seems to have a lovely description of the | |
45 | RC5 basics | |
46 | ||
0ea6e611 | 47 | http://www.nenya.be/beor/electronics/rc5.htm and more data |
d81ef559 MCC |
48 | |
49 | http://www.ee.washington.edu/circuit_archive/text/ir_decode.txt | |
50 | and even a reference to how to decode a bi-phase data stream. | |
51 | ||
52 | http://www.xs4all.nl/~sbp/knowledge/ir/rc5.htm | |
53 | still more info | |
54 |