Programu Iliyopachikwa - libgpiod skrini ya manjano na maandishi nyeusi

libgpiod

zana za kuingiliana na kifaa cha Linux GPIO

libgpiod yocto

Utekelezaji wa Libpgiod katika Yocto

Jumuisha maktaba za libgpiod na tegemezi kwenye picha yako na mpangilio ufuatao:

IMAGE_INSTALL:append = " libgpiod libgpiod-dev libgpiod-tools"

Upimaji wa libgpiod

Baadhi ya amri za kujaribu libgpiod

Ingia kwenye mfumo wako wa kawaida uliopachikwa au unganisha kupitia SSH.

Sasa unaweza kutumia amri za libgpiod na uone ikiwa utekelezaji ulifanikiwa.

Ripoti ya benki za gpio

Kwanza kabisa, unaweza kugundua ni benki ngapi za gpio zimewekwa. Tumia amri ifuatayo:

gpiodetect

Matokeo yanapaswa kuonekana kama hii:

gpiochip0 [gpio0] (32 lines)
gpiochip1 [gpio1] (32 lines)
gpiochip2 [gpio2] (32 lines)
gpiochip3 [gpio3] (32 lines)
gpiochip4 [gpio4] (32 lines)

Pata mipangilio yote

Ili kupata mipangilio yote, tumia amri ifuatayo:

gpioinfo

Matokeo yanapaswa kuonekana kama hii:

gpiochip0 - 32 lines:
	line   0:      unnamed       unused   input  active-high 
	... 
	line   4:      unnamed "host-wakeup" input active-high [used]
	line   5:      unnamed       unused   input  active-high 
	line   6:      unnamed       unused   input  active-high 
	line   7:      unnamed         "cd"   input   active-low [used]
	line   8:      unnamed       unused   input  active-high 
	line   9:      unnamed   "shutdown"  output  active-high [used]
	line  10:      unnamed      "reset"  output   active-low [used]
	...
gpiochip1 - 32 lines:
	line   0:      unnamed       unused   input  active-high 
	... 
	line  31:      unnamed       unused   input  active-high 
gpiochip2 - 32 lines:
	line   0:      unnamed       unused   input  active-high 
	...
	line  31:      unnamed       unused   input  active-high 
gpiochip3 - 32 lines:
	line   0:      unnamed       unused   input  active-high 
	...
	line  31:      unnamed       unused   input  active-high 
gpiochip4 - 32 lines:
	line   0:      unnamed       unused   input  active-high 
	...
	line  29:   "GPIO4_D5"       unused   input  active-high 

Weka mstari mmoja wa GPIO

Ili kuweka mstari wa GPIO 29 kwenye gpiochip4 ili kutoa na juu, tumia amri ifuatayo:

gpioset gpiochip4 29=1

Leseni ya Hakimiliki

Copyright © 2022 Interelectronix e.K.
Msimbo huu wa chanzo cha Mradi una leseni chini ya leseni ya GPL-3.0.