RGB Linux Kernel Code
I'm trying to learn OpenWRT using Omega1 and I'm trying to track down the code declaration for the RGB LED (described here https://wiki.onion.io/Tutorials/Controlling-RGB-LED) but looking at mach-onion-omega.c code I can't see the declaration for GPIO 15,16 and 17. Can anyone help me to point me to the correct file containing the code ?
Looking at fast-gpio code the way it is controlling the RGB is using register defined in fastgpioomega.h
#define REGISTER_BLOCK_ADDR 0x18040000
#define REGISTER_BLOCK_SIZE 0x30
is the datasheet available for the SoC to learn more about the available registers ?
Found an interesting wiki page comparing speed between setting GPIO via sysfs and register http://www.unwireddevices.com/wiki/index.php/Working_with_GPIOs_(C/C%2B%2B)
Sorry didn't realise the SoC datasheet was made available https://wiki.onion.io/Documentation/Hardware/ar9331_datasheet.pdf
Thought I share the diagram I created to make it easier for me to learn the GPIO registers as most of the time will be using GPIO pins to control external 'thing'.
@SydMan If it is of any use to you, you will find some code I produced for controlling GPIO from C++ at https://github.com/KitBishop/Omega-GPIO-I2C-Arduino/tree/master/libnewgpio
@Kit-Bishop That's awesome. Thanks for the link
@Kit-Bishop went through the code and I have a question regarding the shiftOut (..) function inside GPIOAccess.cpp can this function be used to drive like the MAX7129 LED matrix.?
@SydMan Just to check, I think you mean MAX7219 LED matrix - can you confirm? (MAX7129 is something quite different.)
If so, then my answer is yes, the shiftOut code should be suitable for driving it - my code for the Omega is based on the functionality of the shiftOut function for the Arduino.
Some sample code for driving the MAX7219 from the Arduino can be found at http://electronics.stackexchange.com/questions/188/how-to-connect-led-matrix-into-arduino-using-max-7219 - this should be easily adaptable for the Omega using my libnewgpio library code.
@Kit-Bishop sorry yeah you are right is' the MAX7219 (late night coding is not helping with the hand and eye co-ordination)
Will check the Arduino code and experiment with it. Thanks
Some sample code for driving the MAX7219 from the Arduino can be found at
@Kit-Bishop just bought this MAX7219EWG module and was able to drive it using Arduino (using the LedControl library). Now planning to play around with it using your library. Need help to check if the below table wiring is correct (not sure about the CS)
LED Matrix <----> Omega
VCC <---> 5V
GND <----> GND
DIN <-----> 6
CLK <-----> 7
CS <-----> ??