在結束 Armbian 篇章前,略為說說 ROCK64 GPIO ,如是方能完整介紹這個開發平台吧。
藉著匯流排說明文件︰
可知其設計盡量依循樹莓派的 GPIO 慣例也。
這可從 RPi.GPIO 程式庫之改寫看的更清楚︰
/Rock64-R64.GPIO
Python GPIO library for the Rock64 SBC (RPi.GPIO clone)
Rock64-R64.GPIO
A Python GPIO library for the Rock64 single-board computer (RPi.GPIO clone).
Python Libraries and Scripts
R64.GPIO
A re-implementation of the RPi.GPIO library for the Rock64. Currently under development.
See the wiki for documentation on Functions and GPIO Modes.
R64-GPIO-test.py
A simple test script. Outputs a list of internal vars, sets the GPIO mode to “BOARD”, sets up a GPIO output (blinks an LED if connected to pin 16), sets up a GPIO input (pulls-up and reports the state of pin 18), then cleans up all GPIO exports and exits.
Library Installation and Usage:
Importing R64.GPIO
Below is the reccomended method for importing this library into your project. For alternate methods, see the Installation and Usagepage in the wiki.
- Download the entire “R64” folder from the repo.
- Place the “R64” folder in the same directory as the Python script you’re working with.
- Within your script, substitute the traditional “
import RPi.GPIO as GPIO
” line for “import R64.GPIO as GPIO
“.
Once imported, syntax for implemented functions should be identical to RPi.GPIO.
※ 參考︰
rock64@rock64:~/Rock64-R64.GPIO$ sudo python3 R64-GPIO-test.py [sudo] password for rock64: Testing R64.GPIO Module... Module Variables: Name Value ---- ----- GPIO.ROCK ROCK GPIO.BOARD BOARD GPIO.BCM BCM GPIO.OUT out GPIO.IN in GPIO.HIGH 1 GPIO.LOW 0 GPIO.PUD_UP 0 GPIO.PUD_DOWN 1 GPIO.VERSION 0.6.3 GPIO.RPI_INFO {'TYPE': 'Pi 3 Model B', 'MANUFACTURER': 'Embest', 'RAM': '1024M', 'REVISION': 'a22082', 'PROCESSOR': 'BCM2837', 'P1_REVISION': 3} Testing GPIO Input/Output: Output State : 1 Input State : 1 Waiting 3 seconds for interrupt... Timeout! Testing PWM Output - DutyCycle - High Precision: 60Hz at 50% duty cycle for 1 second 60Hz at 25% duty cycle for 1 second 60Hz at 10% duty cycle for 1 second 60Hz at 1% duty cycle for 1 second Testing PWM Output - DutyCycle - Low Precision: 60Hz at 50% duty cycle for 1 second 60Hz at 25% duty cycle for 1 second 60Hz at 10% duty cycle for 1 second 60Hz at 1% duty cycle for 1 second Testing PWM Output - Frequency - Low Precision: 60Hz at 50% duty cycle for 1 second 30Hz at 50% duty cycle for 1 second 20Hz at 50% duty cycle for 1 second 10Hz at 50% duty cycle for 1 second Test Complete
有興趣應用者,最好先讀讀
Rock64 single-board computer
This is a cousin of the Pine A64 board; it has made by the same people, and like the Pine A64, it has a 4-core, 64-bit processor. There are 3 variants available, with 1, 2 or 4 GB of memory. I have the ones with 4 GB, identified as ROCK64_V2.0 2017-0713 written on the circuit board, right above the location of the Rockchip RK3328.
This is where OS-developments are happening: https://github.com/ayufan-rock64/linux-build/releases. Kernel 4.4.70 is what is being used here at present.
There is quite a lot of development going on, so this info may change frequently as new versions come into existence.
文本,有個好開始呦☆