Led
Led
LED, Drivers Enablement
Compile your kernel, once compiled we enable all needed drivers via menuconfig
user@Minnowboard:~$ cd linux
user@Minnowboard:~$ make menuconfig
@Linux Kernel Menuconfig > Device Drivers
Symbol: NEW_LEDS [=y]
Prompt: LED Support
@Linux Kernel Menuconfig > Device Drivers > LED Support
Symbol: LEDS_CLASS [=y]
Prompt: LED Class Support
@Linux Kernel Menuconfig > Device Drivers > LED Support
Symbol: LEDS_GPIO [=m]
Prompt: LED Support for GPIO connected LEDs
@Linux Kernel Menuconfig > Device Drivers > LED Support > LED Trigger support
Symbol: LEDS_TRIGGERS [=y]
Prompt: LED Trigger supportAnd within this "LED Trigger support" section select a variety of triggers to work with, let's start with Hearbeat and OneShot
Once configured, we save the changes, compile and reboot
LED, Module Test
Download, modify and compile the following code: https://github.com/mjoldfield/seabass/blob/master/seabass-leds/seabass-leds.c You might need to specify different GPIO numbers. Wait! There is an easy way to do that
Now insert and make use of both triggers, ledtrig_heartbeat and ledtrig_oneshot. You can also go back to your kernel menuconfig and enable the rest of the triggers
Resources
End of File
Last updated