Skip to content
Snippets Groups Projects
Verified Commit b191b9d1 authored by Alexander Wellbrock's avatar Alexander Wellbrock
Browse files

Add chardev config option

The libgpiod module requires a chardev added with linux kernel 4.8.
The default chardev is /dev/gpiochip0. Subsequent devices follow this
schema: /dev/gpiochipN.
parent 133fd26f
Branches
Tags
No related merge requests found
...@@ -127,6 +127,10 @@ gpio_modules: ...@@ -127,6 +127,10 @@ gpio_modules:
type: boolean type: boolean
required: no required: no
default: yes default: yes
chip:
type: string
required: no
default: "/dev/gpiochip0"
sensor_modules: sensor_modules:
type: list type: list
......
...@@ -8,6 +8,7 @@ BASE_SCHEMA = { ...@@ -8,6 +8,7 @@ BASE_SCHEMA = {
"name": {"required": True, "empty": False}, "name": {"required": True, "empty": False},
"module": {"required": True, "empty": False}, "module": {"required": True, "empty": False},
"cleanup": {"required": False, "type": "boolean", "default": True}, "cleanup": {"required": False, "type": "boolean", "default": True},
"chip": {"required": False, "type": "string", "default": "/dev/gpiochip0"},
} }
......
...@@ -22,7 +22,7 @@ class GPIO(GenericGPIO): ...@@ -22,7 +22,7 @@ class GPIO(GenericGPIO):
import gpiod as gpio import gpiod as gpio
self.io = gpio self.io = gpio
self.chip = config.chip self.chip = gpio.chip(config["chip"])
self.pins = {} self.pins = {}
self.watchers = {} self.watchers = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment