[PATCH] Coffee Cooker (GPIO) on SmartXX - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +--- Thread: [PATCH] Coffee Cooker (GPIO) on SmartXX (/showthread.php?tid=37066) |
[PATCH] Coffee Cooker (GPIO) on SmartXX - tinux - 2008-09-13 For people who have a SmartXX v3 and (not tested) LT OPX, I have made a patch which enables you to use the general I/O (GPIO, known as Coffee Cooker). The ticket number is 4870. I've also posted a demonstration video (switching LEDS) on YouTube. You can activate an output with the following command: System.CoffeeCooker( port, value ) Where port is 0..3 for the port number. and value is 0 or 1 to switch it off or on. Direct commands: (http):http://xbox/xbmcCmds/xbmcHttp?command=ExecBuiltIn¶meter=system.coffeecooker(3,1) (ftp):site System.CoffeeCooker(3,1) (python):xbmc.executebuiltin( 'System.CoffeeCooker(3,1)' ) Also in Python, you can use xbmc.getGPIOState(3) to read the current port state, which you can use to highlight a button. The hardware is simple: it's similar to the PWMControl hardware pins, so if you connect LEDs, you must add a resistor. The four switches available all switch to ground, which means you have to supply a positive voltage. In the video I used +5v with 220 ohm resistors on each green LED connected to a rj45 (network) socket, so I can abuse plain network cables Cheers, Tinux - jmarshall - 2008-09-13 Thanks for the patch. It will be reviewed following the atlantis release. - tinux - 2008-09-13 Thanks for the quick respond. Note that the patch includes some comments. I hoped there was a way to let general purpose commands return a value, but I noticed that this would include a callback system. Therefore, I commented the 'else' case out, and made an extra python call. Also I'm not aware of API calling conventions, so both commands may be subject to change if someone has better names for them. Cheers, Tinux - tinux - 2008-09-13 err.. it was late again last night: "general purpose commands" means "built-in commands" more..coffeecooker - lagwagon667 - 2008-09-14 cool, this also sounds interesting, if you want to build a "stereo-ambilight" (needs to utilize a external microcontroller for pwm) will try it out soon... - bob.smith - 2008-12-29 Hi Tinux, you got it working! I'll merge this into my working copy tonight (hopefully) and try it out. I read your comments in the code, and i also had problems when i was playing with the I/O ports, so i emailed Franz Lehner (and anyone else i could track down from the smartxx team), he sent some replies saying he had data, and code etc, but in the end this was all i got: Quote:Look, we have released almost everything. From my own experiments i had a good idea of how the registers were arrange and how they were applying bit masking techniques, i will see if i can find my notes from last year. BOB.SMITH |