r/lambdachip • u/nanbuwks • Nov 05 '21
How get gpio input?
Gpio function are below:
(gpio-set! gpio-name value)
(device-configure! gpio-name)
(gpio-toggle! gpio-name)
So, how do I input gpio values?
2
Upvotes
1
u/Rafael_Lee Nov 08 '21
This is a missing API. I will add it soon.
1
u/Rafael_Lee Nov 09 '21
gpio-get! API is added.
laco (https://www.gitlab.com/lambdachip/laco.git) e663ecc - (87 minutes ago) Add primitive gpio-get! - Rafael Lee (HEAD -> dev, origin/dev)
lambdachip (https://www.gitlab.com/lambdachip/lambdachip.git) b49ef4d - (78 minutes ago) Add primitive gpio-get! - Rafael Lee (HEAD -> dev, origin/dev)
Actually, user doesn't need to configure GPIO pins which used as GPIO as default in scheme.For other pins (default function are I2C or SPI, they need to configure using device-configure!)
Pre configured pins are list here
I'm not quite sure about Zephyr default behavior of configure GPIO,I2C and SPI devices. The device configuring of Zephyr has changed a lot from v2.4.0 to v2.7.0. I'll figure it out soon.