项目作者: Seeed-Studio

项目描述 :
Grove linux driver for Grove-Base-Cape
高级语言: C
项目地址: git://github.com/Seeed-Studio/grove-linux-driver.git
创建时间: 2019-01-03T07:03:27Z
项目社区:https://github.com/Seeed-Studio/grove-linux-driver

开源协议:MIT License

下载


Grove Linux Driver

Here is the Grove Linux Driver, currently it only support some grove devices on below platforms:



Installation

Below steps will prepare all grove device tree blob object(.dtbo) to
/lib/firmware/ on BB Series or /boot/overlays/ on RPi,
and grove device kernel module(.ko) to /lib/modules/<kernel version>/ or it’s sub-folder.

  1. Clone this repo

    1. cd
    2. git clone https://github.com/Seeed-Studio/grove-linux-driver.git
  2. Begin install

    1. cd ~/grove-linux-driver
    2. sudo ./install.sh



Usage

After installation, the driver is prepared well, then we need to enable specific
grove device in system configuration file.

BB Series

  • Append below line to the configuration file
    /boot/uEnv.txt:

    1. uboot_overlay_addr<n>=/lib/firmware/<Device-Tree-Blob-Name>.dtbo

    <n>: is in 0..7 which not be used in the uEnv.txt.

    <Device-Tree-Blob-Name>: refer to Grove Device Table.

    example:

  1. # If you plugin Grove LED to slot 1057 of Pocket Beagle Grove Cape,
  2. # and uboot_overlay_addr0 is unused, append the line:
  3. uboot_overlay_addr0=/lib/firmware/BB-GPIO-GROVE-LED.dtbo

RPi Series

  • Append below line to the configuration file
    /boot/config.txt

    1. dtoverlay=<Device-Tree-Blob-Name>,<param0>=<value0>,<param1>=<value1>,...

    <Device-Tree-Blob-Name>,<paramN>, <valueN>:
    refer to specific usage in Grove Device Table

    example:

  1. # If you connect Grove Button to gpio 5 of Raspberry Pi, append the line:
  2. dtoverlay=gpio-key,gpio=5
  3. # The default keycode is KEY_POWER, so the pressing will result in a power off.

User interface



Grove Device Table











































































Grove Devices Device Tree Blob Device Driver Specific Usage

Red LED

Green LED

Purple LED

White LED

BB : BB-GPIO-GROVE-LED

RPi: grove-led
inner drivers/leds/leds-gpio.c Click
Button
BB : BB-GPIO-GROVE-BUTTON

RPi: gpio-key
inner drivers/input/keyboard/gpio_keys.c Click
Ultrasonic Ranger BB-GPIO-HCSR04 src/hcsr04/hcsr04.c Click
Temp&Humi&Barometer Sensor (BME280) BB-I2C1-BME280 inner drivers/iio/pressure/bmp280-i2c.c Click

16 x 2 LCD (Black on Red)

16 x 2 LCD (Black on Yellow)

16 x 2 LCD (White on Blue)
BB-I2C1-JHD1802 src/hd44780/hd44780-i2c.c Click
3-Axis Digital Accelerometer (±16g) BB-I2C2-ADXL34X src/adxl34x/adxl34x-i2c.c Click
3-Axis Digital Accelerometer (±400g) BB-I2C2-LIS331DLH inner drivers/iio/accel/st_accel_i2c.c Click
Temperature & Humidity Sensor (SHT31) BB-I2C2-SHT3X src/sht3x/sht3x.c Click
Time of Flight Distance Sensor (VL53L0X) BB-I2C2-VL53L0X src/vl53l0x/vl53l0x.c Click

Triple Color E-Ink Display 1.54”

Triple Color E-Ink Display 2.13”

BB-UART4-E-INK src/e-ink/eink-tty.c

Chainable RGB LED

Chainable RGB Led V2.0

BB-GPIO-P9813 src/p9813/p9813.c Click

Note:
inner means the device driver integreted into linux kernel image,
no need driver source code in this repo.