mirror of https://github.com/pikvm/pikvm.git
Update gpio.md
This commit is contained in:
parent
3d00729024
commit
f00878428d
|
|
@ -9,7 +9,8 @@ that can also be used transparently by emulating abstract GPIO API.
|
|||
# Configuration
|
||||
Setting up GPIO is quite complex. The interface is divided into several layers for flexibility. All configuration is performed using a file `/etc/kvmd/override.yaml` which has the [YAML syntax](https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html). We will look at each part of the configuration separately in a small test example.
|
||||
|
||||
* **Drivers** is the first layer that reflects the hardware that represents the IO ports (standard GPIO of Raspberry Pi, USB relay, and so on). Each driver has a type (a plugin that implements the hardware support) and an unique name. Multiple drivers of the same type can be defined at the same time.
|
||||
### Drivers
|
||||
The first layer that reflects the hardware that represents the IO ports (standard GPIO of Raspberry Pi, USB relay, and so on). Each driver has a type (a plugin that implements the hardware support) and an unique name. Multiple drivers of the same type can be defined at the same time.
|
||||
|
||||
For example, you can connect multiple relays and give each one its own name. By default, one driver is configured with the name `__gpio__`, representing the physical GPIO interface of the Raspberry Pi.
|
||||
|
||||
|
|
@ -33,7 +34,8 @@ Setting up GPIO is quite complex. The interface is divided into several layers f
|
|||
device: /dev/hidraw0
|
||||
```
|
||||
|
||||
* **Scheme** is the second layer that reflects how the various driver ports are configured. Each port has a unique name, mode (`input` or `output`), a pin number, and refers to the driver that provides it.
|
||||
### Scheme
|
||||
The second layer that reflects how the various driver ports are configured. Each port has a unique name, mode (`input` or `output`), a pin number, and refers to the driver that provides it.
|
||||
|
||||
Two interaction modes are available for outputs: `pulse` and `switch`. In pulse mode, the output quickly switches its state to logical 1 and back (just like a button). In switch mode, it saves the state that the user set. When KVMD starts and finishes, all output ports are reset to 0. This can be avoided using the `initial` parameter.
|
||||
|
||||
|
|
@ -74,7 +76,8 @@ Setting up GPIO is quite complex. The interface is divided into several layers f
|
|||
max_delay: 2 # The pulse interval can be between min_pulse (0.1 by default) and max_pulse=5
|
||||
```
|
||||
|
||||
* **View** is the visualization layer of the scheme. It describes what the menu with GPIO functions will look like. It is easier to show by example.
|
||||
### View
|
||||
This is the last layer of the scheme. It describes what the menu with GPIO functions will look like. It is easier to show by example.
|
||||
|
||||
```yaml
|
||||
kvmd:
|
||||
|
|
|
|||
Loading…
Reference in New Issue