You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "rushabhvg (via GitHub)" <gi...@apache.org> on 2024/07/03 04:59:38 UTC
[PR] risc-v/ox64: Add LED Driver [nuttx]
rushabhvg opened a new pull request, #12614:
URL: https://github.com/apache/nuttx/pull/12614
## Summary
- This PR adds the LED Driver for Ox64 Board (User LEDs and Auto LEDs)
- Ox64 LED Driver will be used by the Rust Blinky App for Google Summer of Code
- User LED 1 is configured for GPIO 29. Other User LEDs and Auto LEDs shall be configured by the NuttX Dev.
- The code is derived from NuttX PinePhone LED Driver
## Modified Files in boards:
- `Kconfig`: Added ARCH_HAVE_LEDS for Ox64
## Modified Files in boards/risc-v/bl808/ox64:
- `configs/nsh/defconfig`: Added CONFIG_USERLED
- `include/board.h`: Added LED Definitions
## Modified Files in boards/risc-v/bl808/ox64/src:
- `Makefile`: Added source files for User LEDs and Auto LEDs
- `bl808_appinit.c`: Init User LEDs at startup
## Added Files in boards/risc-v/bl808/ox64/src:
- `bl808_autoleds.c`: Ox64 Driver for Auto LEDs
- `bl808_userleds.c`: Ox64 Driver for User LEDs
## Impact
- With this PR, NuttX for Ox64 will be able to access LEDs
- No impact on existing code, since the Ox64 LED Driver source files are not used by existing code
## Testing
We tested the BL808 Driver on Ox64 Emulator. Rust Blinky blinks the Simulated LED correctly:
- [Test Log for Ox64 Emulator](https://github.com/rushabhvg/rushabhvg.github.io/blob/master/nuttx/GPIO%20and%20LED%20Driver/build%20log%203ee5f0c36d.txt)
- [Test Log for Ox64 board](https://gist.github.com/lupyuen/37a271f3d4f71a9f1e2fde2ec9f625e0)
- [Source Files](https://github.com/rushabhvg/nuttx/tree/gpio3)
- [Rust Blinky](https://github.com/rushabhvg/nuttx-apps/blob/gpio/examples/hello_rust/hello_rust_main.rs)
- [Demo Video](https://drive.google.com/file/d/1Fm6HkLVFNpiEd0EMGnQw05mYtlPyf5wJ/view?usp=drive_link)
```text
$ tools/configure.sh ox64:nsh
$ make
## Omitted: Build NuttX Apps and bundle into NuttX Image
$ ./temu nuttx.cfg
TinyEMU Emulator for Ox64 BL808 RISC-V SBC
NuttShell (NSH)
nsh> nx_start: CPU0: Beginning Idle Loop
nsh> uname -a
NuttX 0.0.0 3ee5f0c36d Jul 2 2024 20:25:48 risc-v ox64
nsh> hello_rust
nxtask_activate: hello_rust pid=4,TCB=0x5040b290
nxsig_tcbdispatch: TCB=0x5040b290 pid=4 signo=0 code=0 value=0 masked=NO
Hello, Rust!!
Opening /dev/userleds
Set LED 0 to 1
{"nuttxemu":{"gpio29":1}}
Waiting...
Set LED 0 to 0
{"nuttxemu":{"gpio29":0}}
nxsig_tcbdispatch: TCB=0x5040af80 pid=3 signo=17 code=5 value=0 masked=NO
nxtask_exit: hello_rust pid=4,TCB=0x5040b290
nxsig_tcbdispatch: TCB=0x5040af80 pid=3 signo=17 code=5 value=0 masked=NO
nsh> virtio_console_resize_event
Terminated
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] risc-v/ox64: Add LED Driver [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #12614:
URL: https://github.com/apache/nuttx/pull/12614
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org