Wbincludes:Peripherals/en: различия между версиями

Материал из Wiren Board
(Новая страница: «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.»)
Строка 5: Строка 5:
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 [[Controller_hardware_revisions|hardware revisions]] 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 [[Controller_hardware_revisions|hardware revisions]] controllers.


<div lang="ru" dir="ltr" class="mw-content-ltr">
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.
Работать в обход стандартных сервисов wb- обычно используется, когда программное обеспечение выполняется на разных Linux-контроллерах разных вендоров, и работа через соответсвующие интерфейсы ядра уже реализована в ПО. Данная статья содержит описание периферии, нужное для работы с ней через стандартные интерфейсы ядра. При работе с ядерными интерфейсами не забудьте отключить соответствующий сервис wb-.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<div lang="ru" dir="ltr" class="mw-content-ltr">

Версия 22:25, 28 сентября 2022

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

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.

Большая часть периферии, описанной в этой статье, описана также в ноде /wirenboard в Devicee Tree контроллера. Сервисы wb-mqtt-gpio, wb-mqtt-adc и т.д. берут описание периферии именно оттуда, считывая описание каждый раз при старте контроллера. Этот способ является предпочтительным и для стороннего ПО, чтобы сохранить совместимость с прошлыми и будущими аппаратными ревизиями оборудования.

Работа с GPIO в Linux

GPIO (General-purpose input/output — ввод/вывод общего назначения) — контакт электрической схемы, который может принимать одно из двух логических состояний — единицу или ноль. Пользователь может устанавливать и считывать состояние GPIO.

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

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

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

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