How to access softled1(D3) on minimorph via gpio?

Home Forums MIPS Insider Meta Insider How to access softled1(D3) on minimorph via gpio?

This topic contains 2 replies, has 2 voices, and was last updated by  Sean 4 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #64722

    abhilashtuse
    Participant

    I want to access softled1 (D3) using gpio. Reference manual says it can be done using UART0_RTS (GPIO 23).
    But GPIO-23 is reserved. It cannot be accessed via sysfs. So how can we access gpio-23 to actually set LED values(blinking)?

    #64724

    Sean
    Moderator

    What version of the SDK are you using? Assuming 1r9 in the answer below.

    The script in /etc/init.d/flashleds gives you an example of driving the LED.

    If you log into the Minimorph and kill the script (run at startup), you can control the LED as follows:
    On:

    # echo 1 > /sys/class/gpio/gpio11/value

    Off:

    # echo 0 > /sys/class/gpio/gpio11/value

    So in a C program, open a file handle to that file and write the value to it.

    The flashleds script sets up the GPIO for you. If you stop this script from launching at startup, you’ll need to set it up yourself:

    LED=11
    GPIO_SYSFS=/sys/class/gpio

    echo $LED > $GPIO_SYSFS/export

    To use the other LED, it is currently setup to indicate SD card activity so disable that and set brightness:

    # cat /sys/class/leds/01xx::softled1/trigger
    none [mmc0]
    # echo none > /sys/class/leds/01xx::softled1/trigger
    # cat /sys/class/leds/01xx::softled1/trigger
    [none] mmc0
    # echo 1 > /sys/class/leds/01xx::softled1/brightness
    #64723

    abhilashtuse
    Participant

    Thanks..:) I am using SDK 1r9.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.