Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "RockpiN10/dev/libmraa"

< RockpiN10‎ | dev
(Created page with "{{rockpiN10_header}} {{Languages|rockpiN10/dev/libmraa}} ROCK Pi N10 > Development > Install Libmraa =...")
 
Line 40: Line 40:
  
 
===== Hardware V11 =====
 
===== Hardware V11 =====
 +
 +
25 GPIO:
 +
    PIN03      GPIO2_A7
 +
    PIN05      GPIO2_B0
 +
    PIN07      GPIO2_B5
 +
    PIN08      GPIO4_C4
 +
    PIN10      GPIO4_C3
 +
    PIN11      GPIO4_C2
 +
    PIN12      GPIO0_B1
 +
    PIN13      GPIO4_C6
 +
    PIN15      GPIO4_C5
 +
    PIN16      GPIO0_B0
 +
    PIN18      GPIO2_A6
 +
    PIN19      GPIO1_B0
 +
    PIN21      GPIO1_A7
 +
    PIN22      GPIO3_D4
 +
    PIN23      GPIO1_B1
 +
    PIN24      GPIO1_B2
 +
    PIN29      GPIO2_B2
 +
    PIN31      GPIO2_B1
 +
    PIN32      GPIO3_D5
 +
    PIN33      GPIO2_D5
 +
    PIN35      GPIO2_A4
 +
    PIN36      GPIO2_A2
 +
    PIN37      GPIO3_D6
 +
    PIN38      GPIO2_A3
 +
    PIN40      GPIO1_A2
 +
 +
3 I2C:
 +
    PIN27      I2C'''2'''_SDA
 +
    PIN28      I2C'''2'''_SCL
 +
    PIN29      I2C'''6'''_SCL
 +
    PIN31      I2C'''6'''_SDA
 +
    PIN3        I2C'''7'''_SDA
 +
    PIN5        I2C'''7'''_SCL
 +
 
 +
1 SPI:
 +
    PIN19      SPI'''1'''TX        //must disable UART4
 +
    PIN21      SPI'''1'''RX        //must disable UART4
 +
    PIN23      SPI'''1'''CLK
 +
    PIN24      SPI'''1'''CSN
 +
 +
2 UART:
 +
    PIN8      UART'''2'''_TX
 +
    PIN10      UART'''2'''_RX
 +
    PIN19      UART'''4'''_TX  //must disable SPI1
 +
    PIN21      UART'''4'''_RX  //must disable SPI1
 +
 
 +
2 PWM:
 +
    PIN11      PWM'''0'''
 +
    PIN13      PWM'''1'''
 +
 +
1 ADC:
 +
    PIN26      ADC_IN1          //the measure voltage must lower than 1.8v
 +
 +
For those ROCK Pi N10 system images released after March 1st, 2020, the configuration file is /boot/uEnv.txt. For more details, follow this guide, [https://wiki.radxa.com/Device-tree-overlays Device tree overlays].
 +
 +
For those ROCK Pi N10 system images released before March 1st, 2020, the configuration file is /boot/hw_intfc.conf.

Revision as of 06:20, 12 October 2020

    ROCK Pi N10 >  Development >  Install Libmraa 

Libmraa on ROCK Pi N10

This guide describes how to use libmraa on ROCK Pi N10.

Install essential packages

Package libmraa is in the Radxa APT bionic-stable and buster-stable repositories.

Execute the following commands to add Radxa APT

rock@rockpin10:~$ export DISTRO=bionic-testing      # for Bionic

or

rock@rockpin10:~$ export DISTRO= buster-testing      # for Buster
rock@rockpin10:~$ echo "deb http://apt.radxa.com/$DISTRO/ ${DISTRO%-*} main" | sudo tee -a /etc/apt/sources.list.d/apt-radxa-com.list

Get the pub key

rock@rockpin10:~$  wget -O -  apt.radxa.com/buster-testing/public.key | sudo apt-key add -

Install essential packages:

rock@rockpin10:~$ sudo apt-get update
rock@rockpin10:~$ sudo apt-get install -y rockchip-overlay rockpin10-dtbo libmraa # libmraa version: >=0.4
rock@rockpin10:~$ sudo apt-get install -y linux-4.4-rockpin10-latest # ROCK Pi N10 kernel version: >= 4.4.167-14

Install compiler:

rock@rockpin10:~$ sudo apt install -y build-essential

Enable interface

See ROCK Pi N10 GPIO pintout. ROCK Pi N10 has a 40-pin colorful expansion header. Each pin is distinguished by color. mraa define is shown below:

Hardware V11

25 GPIO:

   PIN03      GPIO2_A7
   PIN05      GPIO2_B0
   PIN07      GPIO2_B5
   PIN08      GPIO4_C4
   PIN10      GPIO4_C3
   PIN11      GPIO4_C2
   PIN12      GPIO0_B1
   PIN13      GPIO4_C6
   PIN15      GPIO4_C5
   PIN16      GPIO0_B0
   PIN18      GPIO2_A6
   PIN19      GPIO1_B0
   PIN21      GPIO1_A7
   PIN22      GPIO3_D4
   PIN23      GPIO1_B1
   PIN24      GPIO1_B2
   PIN29      GPIO2_B2
   PIN31      GPIO2_B1
   PIN32      GPIO3_D5
   PIN33      GPIO2_D5
   PIN35      GPIO2_A4
   PIN36      GPIO2_A2
   PIN37      GPIO3_D6
   PIN38      GPIO2_A3
   PIN40      GPIO1_A2 

3 I2C:

   PIN27      I2C2_SDA
   PIN28      I2C2_SCL
   PIN29      I2C6_SCL
   PIN31      I2C6_SDA
   PIN3        I2C7_SDA
   PIN5        I2C7_SCL
  

1 SPI:

   PIN19      SPI1TX        //must disable UART4
   PIN21      SPI1RX        //must disable UART4
   PIN23      SPI1CLK
   PIN24      SPI1CSN

2 UART:

   PIN8       UART2_TX
   PIN10      UART2_RX
   PIN19      UART4_TX  //must disable SPI1
   PIN21      UART4_RX  //must disable SPI1
  

2 PWM:

   PIN11      PWM0
   PIN13      PWM1

1 ADC:

   PIN26      ADC_IN1          //the measure voltage must lower than 1.8v

For those ROCK Pi N10 system images released after March 1st, 2020, the configuration file is /boot/uEnv.txt. For more details, follow this guide, Device tree overlays.

For those ROCK Pi N10 system images released before March 1st, 2020, the configuration file is /boot/hw_intfc.conf.