I found a couple of interesting "facts" on a couple of pages. I liked what I read and I liked what I watched on this specific instance of ideas.
and ultimately here…
If you catch up to these ideas and want to use the idea of a character device instead of a sysfs entry on GPIO, awesome! Oh and if not, that is okay too!
you should be able to build the tests from
and use those tools to light up a LED.
Also, if the above statements do not work correctly, try to use this cmd:
and that should do it for setting up your libgpiod utility. Oh! If you do not have the prerequisites for this idea, you may need to get autoconf and m4. A quick search will guide you through those two libraries and the set up that must ensue. Okay!
After looking over the ideas on brgl/libgpiod on GitHub.com, please follow these instructions which can be found at the same place:
To build the project (including command-line utilities) run:
./autogen.sh --enable-tools=yes --prefix=<install path>
Where it states "–prefix=<install path>", please install whichever path you see as easy to view and move around in w/ Linux and your terminal.
Next, type gpioinfo at your command prompt/terminal.
You will get a list of ideas pertaining to your gpiochips and line numbers which will inevitably be used to acquire your correct pin name and header, e.g. P8_xx and/or P9_xx.
gpioinfo will accumulate a bunch of ideas on your terminal. See below:
I will be making my 3.3v from my BeagleBone Black Wireless run a LED via character device and libgpiod.
So now, w/ the help of libgpiod and the tools installed, we can finally make our LED light up like Christmas. Here goes it but first…we need to use another cmd:
gpioset --mode=wait gpiochip1 28=0
So, for this cmd, we are calling gpioset at the cmd line, setting –mode=wait which waits for a return key to be pressed for cancellation, and then using our gpiochip1 and line 28 values b/c we have our LED hooked up to P9_12 which is line 28 on gpiochip1. On my BBB/BBBW, I have four different gpiochip values all w/ corresponding line numbers.
So, I am going to run the cmd gpioset –mode=wait gpiochip1 28=0 and it should, if all things are set up correctly, light up the LED and stay lit until I press the return key/enter. A photo should render this to be true. If you are in doubt, please consult someone of higher knowledge than I or give me a shout out and let me know what is happening to your side of things.
Here, you can see the difference in what is going on in the terminal when I run the character device/libgpiod set of instructions and while the command is actually being ran!
This was me running a set of cmds and seeing the output. The first line in this set of cmds blinked the LED while the second line did nothing. I blinked the LED once more and then allowed the LED to stay on w/ gpioset –mode=wait gpiochip1 28=0.
In this example, I did all of what I described earlier but allowed for the –mode=wait option to hold my LED on and I did not press the return key. Enter was pressed afterwards to cancel the LED lighting.
So…I think that is it.
P.S. Oh and depending on if your gpiochip and line number of which header and pin number are equaling, use =0 or =1 after the line number to pick if you want the LED on or off. Um…yep! That is all for now!