Wbincludes:Peripherals/en

Материал из Wiren Board
Версия от 22:26, 28 сентября 2022; Matveevrj (обсуждение | вклад) (Новая страница: «Most of the peripherals described in this article are also described in the /wirenboard node in the controller's Device Tree. Services wb-mqtt-gpio, wb-mqtt-adc, etc. [https://github.com/wirenboard/wb-mqtt-gpio/blob/master/generate-system-config.sh take] the description of the peripherals from there, reading the description every time the controller starts. This method is also preferred for third party software to maintain compatibility with past and future...»)

Изменение этого включения повлияет на несколько страниц

Introduction

This article is intended primarily for developers of third-party software for Wiren Board controllers.

The easiest and most convenient way to work with the controller hardware is via MQTT, by contacting wb services: wb-mqtt-gpio, wb-mqtt-adc, wb-mqtt-gpio, etc. wb- services allow you to work with hardware through a unified interface MQTT and hide hardware differences between hardware revisions controllers.

Work bypassing the standard wb- services is usually used when the software is running on different Linux controllers from different vendors, and work through the corresponding kernel interfaces is already implemented in the software. This article contains a description of the peripherals needed to work with them through the standard kernel interfaces. When working with kernel interfaces, don't forget to disable the corresponding wb- service.

Most of the peripherals described in this article are also described in the /wirenboard node in the controller's Device Tree. Services wb-mqtt-gpio, wb-mqtt-adc, etc. take the description of the peripherals from there, reading the description every time the controller starts. This method is also preferred for third party software to maintain compatibility with past and future hardware revisions hardware.

Working with GPIOs in Linux

GPIO (General-purpose input / output - general-purpose input / output) is an electrical circuit contact that can take one of two logical states - one or zero. The user can set and read the GPIO state.

В разных устройствах высокий логический уровень может представляться разным напряжением — следите за этим. В контроллерах Wiren Board логическая единица — это 3.3 В.

ВНИМАНИЕ: не подключайте напрямую к GPIO контроллера сигналы с напряжением больше 3.3 В! Если нужно подключить устройство, которое выдает сигнал с более высоким напряжением — используйте схемы согласования. В некоторых случаях, если напряжение сигнала не больше 5 В, то можно согласовать сигналы через резистор на 20 кОм.

О работе с GPIO в Linux читайте в документации к ядру. Также можно почитать устаревшую инструкцию в нашей Wiki — Работа с GPIO.

Для других версий контроллера смотрите Таблицы GPIO разных версий контроллера.