Firefly Open Source Community

Title: how to control GPIO in Android application? [Print This Page]

Author: zamster    Time: 9/7/2015 09:34
Title: how to control GPIO in Android application?
Hi,
I want to create android application that is able to control GPIO, LED, Serial port.
I've searched a lot but can't get enough good answer.

I know it uses JNI interface in android app, but do now know in driver side.

would you give me effective example?

thanks
Jay

Author: busybee    Time: 9/7/2015 18:02
Last edited by busybee In 9/7/2015 18:10 Editor

Please reference:
- http://falsinsoft.blogspot.jp/20 ... nux-user-space.html
- http://android.serverbox.ch/?p=972

Make sure your program has access permission to the files.
Author: zamster    Time: 9/9/2015 10:09
thanks for your reply.

would you give me more explanation?
how can I access UART serial by using TX, RX, GRD?
I need a specific guide or code..
Author: busybee    Time: 9/11/2015 10:33
zamster Posted at 9/9/2015 10:09
thanks for your reply.

would you give me more explanation?

First refer to the uart driver wiki:
http://wiki.t-firefly.com/index.php/Firefly-RK3288/UART/en

If you are using uart3, you can access /dev/ttyS3.
Then google for "Linux serial programming", which will give you a bunch of
documents and examples. One is:

http://www.comptechdoc.org/os/li ... inux_pgcserial.html

Author: zamster    Time: 9/11/2015 16:27
busybee Posted at 9/11/2015 10:33
First refer to the uart driver wiki:
http://wiki.t-firefly.com/index.php/Firefly-RK3288/UART/en
...

thanks.

one more question.
Do I have to make new uart driver for uart communications?
(if I'm using uart3 I can just access /dev/ttyS3 without making new uart driver..)
Author: busybee    Time: 9/11/2015 17:42
Same uart driver is already configured builtin for all the uart devices.  
No need to make new one.
Author: zamster    Time: 9/11/2015 17:59
Last edited by zamster In 9/11/2015 18:23 Editor

in the middle of page (http://wiki.t-firefly.com/index.php/Firefly-RK3288/UART/en),
what is meaning of "Turn on CONFIG_SERIAL_ROCKCHIP in kernel configuration"?

Compile and Flash KernelTurn on CONFIG_SERIAL_ROCKCHIP in kernel configuration, which will add corresponding drivers/tty/serial/rk_serial.c to kernel. Then compile the kernel as followed:
make firefly-rk3288.img
Author: busybee    Time: 9/12/2015 10:53
Add:
  CONFIG_SERIAL_ROCKCHIP=y
in your kernel/.config file
Author: ronmill274    Time: 1/15/2026 10:25
This article was really shocking; thank you for sharing! Best wishes for your exams! Here¡¯s the free Latest test PL-600 questions and answers resource.
Author: billros681    Time: 1/25/2026 21:54
This is a truly magnificent article, thank you for sharing your thoughts. The CPCE valid exam sample online content is amazing, and you can get it for free.
Author: polly394    Time: 2/23/2026 19:46
Great topic! Controlling GPIO in an Android application can open up powerful possibilities for hardware integration and IoT projects. It¡¯s especially interesting when working with embedded systems or Android-based development boards. Clear documentation and proper permission handling are key to making it work smoothly and securely. IV Therapy Santa Monica




Welcome Firefly Open Source Community (https://bbs.t-firefly.com/) Powered by Discuz! X3.1