06-18-2016, 08:03 PM
There is two spots on the board for LEDs. Do they have a predetermined function?
LEDs
|
06-18-2016, 08:03 PM
There is two spots on the board for LEDs. Do they have a predetermined function?
06-18-2016, 09:51 PM
Look at the labels :
Chgled Power Reset The leds are for the PMIC and on-board battery charger, and the power and reset positions connect to the PMIC for obvious functionality. I have not tested the switches yet (they're on their way in the mails) and I have not tried to install the LEDs yet either, but I'm assuming they have similar functionality to any tablet or phone when its plugged in to let you know its charging, and when its finished. (06-18-2016, 09:51 PM)MarkHaysHarris777 Wrote: Look at the labels : Haven't tested the reset switch, but I presume it does work! The power switch indeed does turn the power on if the pine64 has been shut down... what a shock! The LEDs are sore point for me atm... tllim said in another thread that the led next to the charge led is 'software programmable, and no dedicate assigned function' - and I presume it is the system led also brought out on the exp connector, but I am probably wrong on that point! Regardless of which, I can't get either to blink, flash or let magic smoke out! And no real idea what to do in software to make the darn thing work! The Charge LED on the other hand, appears to be directly connected to the APX208's charge led port... but do you think I can get the darn thing to do anything? Even with trying to follow the schematic on p12 as far as a 1K resistor, etc. That's it... I'm stuck!
06-20-2016, 08:00 AM
(06-20-2016, 05:17 AM)pfeerick Wrote:(06-18-2016, 09:51 PM)MarkHaysHarris777 Wrote: Look at the labels : Good morning-- this is interesting! I may work on it today. It would be nice to have an 'activity' LED similar to the RPi activity green. 'Software programmable' can mean anything from driver code, firmware, or even user high level code... what specifically have you tried? Thanks for the tip into tllim's thread...
06-20-2016, 12:17 PM
Yes, according to schematic, the D63 is attached to PL7 GPIO.
06-20-2016, 12:32 PM
(06-20-2016, 12:17 PM)martinayotte Wrote: Yes, according to schematic, the D63 is attached to PL7 GPIO. Yes, pin(2) on the Exp connector; the question is what is the software interface for PL7 ? Using RPi.GPIO, which BOARD number, or pad number, whatever is the PL7 pin ? How to find out... can this pin be set|unset without messing with the system... if set, will the system unset it?
06-20-2016, 01:41 PM
(This post was last modified: 06-20-2016, 01:43 PM by martinayotte.)
The logic is in the RPi.GPIO-PineA64-master/source/common.c file, but of course PL7 isn't there, although it could be added later.
For now, I would go with the sysfs, where GPIOs can be exported, set direction, and then state value. The pin number would be for PL7 is ("L"-"A")*32+7 = 359 ... I've verified on real hardware and it is working. echo 359 > /sys/class/gpio/export echo out > /sys/class/gpio359/direction echo 1 > /sys/class/gpio359/value (06-20-2016, 01:41 PM)martinayotte Wrote: The logic is in the RPi.GPIO-PineA64-master/source/common.c file, but of course PL7 isn't there, although it could be added later. Thanks a lot for the info and testing, I was just about to go figure out the number Time to solder some LEDs to that board...
Come have a chat in the Pine IRC channel >>
06-20-2016, 02:11 PM
I made some script a while ago which computes gpio sysfs numbers from pin names.
See https://gist.github.com/longsleep/6ab752...5d3f6a4764
06-20-2016, 09:15 PM
(This post was last modified: 06-20-2016, 11:23 PM by MarkHaysHarris777.)
(06-20-2016, 01:41 PM)martinayotte Wrote: The logic is in the RPi.GPIO-PineA64-master/source/common.c file, but of course PL7 isn't there, although it could be added later. @martinayotte, thanks much... I was in the process of studying the codes for RPi.GPIO/ you saved me a ton of work figuring out the 'number' from name, bank, pin &c. I did have to make the change above to include the /gpio folder under /class (I assume it was just a typo... I tried this on the debian image, have not tried it on the ubuntu image yet-- see above). Again, thanks it was a big help ! @longsleep, thanks for the formula script to go from name -> pin number ! voila, wishes do come true ! I should note (even though its probably obvious) the LED lights on value = 0; because we're providing the ground shot for DCDC1. I won't be soldering my test LED in; going to use a smaller (3mm) green LED coming soon. edit: here's the final 3mm green: |