Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions i18n/en/docusaurus-plugin-content-docs/current/devices/plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,20 @@ It is particularly suitable for Raspberry Pi and similar single-board computers.

**Parameters**:

| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ---------------------------------------- |
| function | string | yes | Mode: `read` (input) or `write` (output) |
| pin | int | yes | Pin number (BCM numbering, e.g. GPIO 17) |
| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ------------------------------------------------------------------ |
| function | string | yes | Mode: `read` (input) or `write` (output) |
| pin | int | yes | Pin number (BCM numbering, e.g. GPIO 17) |
| activelow | bool | no | If `true`, pin will be `true` when at 0 V and `false` at VCC. |
| bias | string | no | `as-is`, `disabled`, `pull-up` (default for `read`), `pull-down` |
| chip | string | no | GPIO device (default: `gpiochip0`) |

**How it works**:

- **Reading** (`function: read`): Reads the state of a GPIO pin as a boolean value (`true` = HIGH, `false` = LOW)
- **Writing** (`function: write`): Sets a GPIO pin to HIGH (`true`) or LOW (`false`)
- **Reading** (`function: read`): Reads the state of a GPIO pin as a boolean
value (`true` = HIGH, `false` = LOW, and the other way around if `activelow` is set)
- **Writing** (`function: write`): Sets a GPIO pin to HIGH (`true`) or LOW
(`false`), and vice-versa if `activelow`

Pin numbering follows the BCM scheme (Broadcom numbers, not the physical pin position).
For a Raspberry Pi pinout, see e.g. [pinout.xyz](https://pinout.xyz/).
Expand All @@ -399,6 +404,11 @@ function: read
pin: 17 # BCM pin number
```

:::note
For legacy reasons the default is active high *with internal pullup resistor*,
which means if you don't connect anything to the pin, it will be `1` aka `true`.
:::

**Writing Example**:

```yaml
Expand All @@ -408,7 +418,7 @@ pin: 27 # BCM pin number
```

:::note
This plugin only works on Linux systems with access to `/dev/gpiomem`.
This plugin only works on Linux systems with access to `/dev/gpiochip0`.
:::

### Go <Tag label="read" category="read" /> <Tag label="write" category="write" /> {#go}
Expand Down