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

Обновление для соответствия новой версии исходной страницы.
(Новая страница: «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.»)
(Обновление для соответствия новой версии исходной страницы.)
Метки: правка с мобильного устройства правка из мобильной версии
 
(не показано 7 промежуточных версий 1 участника)
Строка 1: Строка 1:
<div class="mw-translate-fuzzy">
<noinclude>{{Warning Editing Inсlude}}</noinclude>
<noinclude>{{Warning Editing Inсlude}}</noinclude>
<h2>Introduction</h2>
<h2>Introduction</h2>
This article is intended primarily for developers of third-party software for Wiren Board controllers.  
This article is intended primarily for developers of third-party software for Wiren Board controllers.
</div>


<div class="mw-translate-fuzzy">
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>


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


<div lang="ru" dir="ltr" class="mw-content-ltr">
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 [[Controller_hardware_revisions|hardware revisions]] hardware.
Большая часть периферии, описанной в этой статье, описана также в ноде /wirenboard в Devicee Tree контроллера. Сервисы wb-mqtt-gpio, wb-mqtt-adc и т.д. [https://github.com/wirenboard/wb-mqtt-gpio/blob/master/generate-system-config.sh берут] описание периферии именно оттуда, считывая описание каждый раз при старте контроллера. Этот способ является предпочтительным и для стороннего ПО, чтобы сохранить совместимость с прошлыми и будущими [[Controller_hardware_revisions|аппаратными ревизиями]] оборудования.
 
</div>
<h2> Working with GPIOs in Linux </h2>
'''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.


<div lang="ru" dir="ltr" class="mw-content-ltr">
In different devices, a high logic level can be represented by different voltages - keep an eye on this. In Wiren Board controllers, the logical unit is 3.3 V.  
<h2> Работа с GPIO в Linux </h2>
'''GPIO ''' (''General-purpose input/output — ввод/вывод общего назначения'') — контакт электрической схемы, который может принимать одно из двух логических состояний — единицу или ноль. Пользователь может устанавливать и считывать состояние GPIO.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
'''WARNING:''' do not directly connect signals with a voltage greater than 3.3V to the controller's GPIO! If you need to connect a device that produces a signal with a higher voltage, use matching circuits. In some cases, if the signal voltage is not more than 5 V, then it is possible to match the signals through a 20 kΩ resistor.
В разных устройствах высокий логический уровень может представляться разным напряжением — следите за этим. В контроллерах Wiren Board логическая единица — это 3.3 В.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<div class="mw-translate-fuzzy">
'''ВНИМАНИЕ:''' не подключайте напрямую к GPIO контроллера сигналы с напряжением больше 3.3 В! Если нужно подключить устройство, которое выдает сигнал с более высоким напряжением — используйте схемы согласования. В некоторых случаях, если напряжение сигнала не больше 5 В, то можно согласовать сигналы через резистор на 20 кОм.
For working with GPIO on Linux, see [https://www.kernel.org/doc/Documentation/gpio/sysfs.txt kernel documentation]. You can also read the obsolete instruction in our Wiki - [[Работа с GPIO|Working with GPIO]].
</div>
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
For other controller versions see [[GPIO | GPIO tables of different controller versions]].
О работе с GPIO в Linux читайте в [https://www.kernel.org/doc/Documentation/gpio/sysfs.txt документации к ядру]. Также можно почитать устаревшую инструкцию в нашей Wiki — [[Работа с GPIO|Работа с GPIO]].
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<div lang="ru" dir="ltr" class="mw-content-ltr">
Для других версий контроллера смотрите [[GPIO | Таблицы GPIO разных версий контроллера]].
Посмотреть таблицу GPIO можно командой <code>cat /sys/kernel/debug/gpio</code>, или в разделе ниже.
</div>
</div>
wb_editors
14 355

правок