Zephyr RTOS 和 i.MX RT1020 评估板通过设备树访问 Arduino 接头引脚

问题描述

我正在考虑使用带有 RT 1020 处理器的 NXP 评估板做一个项目。我想尝试并熟悉 Zephyr RTOS。

在代码中,我将如何使用给定的设备树代码段访问各种 Arduino 标头 PINS?

    arduino_header: connector {
    compatible = "arduino-header-r3";
    #gpio-cells = < 0x2 >;
    gpio-map-mask = < 0xffffffff 0xffffffc0 >;
    gpio-map-pass-thru = < 0x0 0x3f >;
    gpio-map = < 0x0 0x0 &gpio1 0x1a 0x0 >,< 0x1 0x0 &gpio1 0x1b 0x0 >,< 0x2 0x0 &gpio1 0x1c 0x0 >,< 0x3 0x0 &gpio1 0x1d 0x0 >,< 0x4 0x0 &gpio1 0x1f 0x0 >,< 0x5 0x0 &gpio1 0x1e 0x0 >,< 0x6 0x0 &gpio1 0x19 0x0 >,< 0x7 0x0 &gpio1 0x18 0x0 >,< 0x8 0x0 &gpio1 0x9 0x0 >,< 0x9 0x0 &gpio1 0x7 0x0 >,< 0xa 0x0 &gpio1 0x5 0x0 >,< 0xb 0x0 &gpio1 0x6 0x0 >,< 0xc 0x0 &gpio1 0xe 0x0 >,< 0xd 0x0 &gpio1 0x16 0x0 >,< 0xe 0x0 &gpio1 0x17 0x0 >,< 0xf 0x0 &gpio1 0xf 0x0 >,< 0x10 0x0 &gpio1 0xb 0x0 >,< 0x11 0x0 &gpio1 0xc 0x0 >,< 0x12 0x0 &gpio1 0xd 0x0 >,< 0x13 0x0 &gpio1 0xa 0x0 >,< 0x14 0x0 &gpio3 0x17 0x0 >,< 0x15 0x0 &gpio3 0x16 0x0 >;
};

我知道我可以通过具有设备树别名的单个引脚轻松地将 device_get_binding()gpio_pin_configure()DT_GPIO_LABELDT_GPIO_PIN 一起使用。

我不清楚如何从上面的设备树片段访问 Arduino 接头引脚。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...