在哪里可以找到SAMA5D27-SOM1-EK1设备及其GPIOS的映射? [英] Where can I find the mapping of SAMA5D27-SOM1-EK1 devices and it's GPIOS?

查看:126
本文介绍了在哪里可以找到SAMA5D27-SOM1-EK1设备及其GPIOS的映射?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 SAMA5D27-SOM-EK1 嵌入式板。
我使用 YOCTO 项目版本SUMO为它构建了 Linux 映像操作系统。

I am using SAMA5D27-SOM-EK1 embedded board. I build for it Linux image OS using YOCTO project version SUMO.

我需要知道设备的 GPIOS (特别是gpios-led和gpios键)和板子的映射。

I need to know device's GPIOS ( gpios-leds and gpios keys specialy) and the mapping of the board.

例如,在板终端中输入 / sys / firmware / devicetree / base / leds / red 时,我可以找到gpio文件,但是当我打开它时我看不懂的符号。
我想我可以在生成的设备树中找到这些东西,但是我找不到它的路径!

When I enter in /sys/firmware/devicetree/base/leds/red for example in the board terminal I can find gpio file but when i open it there are symbols which i can't read. I think that I can find such things in the generated Device Tree but i can't find its path!

请帮助我出来

推荐答案

以下是原始dts: https://elixir.bootlin.com/linux/v5.2/source/arch/arm /boot/dts/at91-sama5d27_som1_ek.dts#L510

相关部分是:

    leds {
    compatible = "gpio-leds";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_led_gpio_default>;
    status = "okay"; /* Conflict with pwm0. */

    red {
        label = "red";
        gpios = <&pioA PIN_PA10 GPIO_ACTIVE_HIGH>;
    };

    green {
        label = "green";
        gpios = <&pioA PIN_PB1 GPIO_ACTIVE_HIGH>;
    };

    blue {
        label = "blue";
        gpios = <&pioA PIN_PA31 GPIO_ACTIVE_HIGH>;
        linux,default-trigger = "heartbeat";
    };
};

这表明红色LED连接到PA10 gpio,绿色在PB1上,蓝色在PA31上

This shows that the red LED is connected to the PA10 gpio, green is on PB1 and blue on PA31.

查找信息的另一种方法是在此处查看原理图:
http://ww1.microchip.com/downloads/zh-CN/DeviceDoc/SAMA5D27-SOM1-EK1_Board%20Files_1.BBzip

The other way to find the info is to look at the schematics here: http://ww1.microchip.com/downloads/en/DeviceDoc/SAMA5D27-SOM1-EK1_Board%20Files_1.B.B.zip

SAMA5D27-SOM1-EK1_REVB.pdf的第3页总结了引脚混合,第8页显示了实际的连接。

Page 3 of SAMA5D27-SOM1-EK1_REVB.pdf sums the pinmuxing and page 8 shows the actual connection.

关于您想做什么(如果我没记错的话,切换LED),您只需看一下 / sys / class / leds / red /亮度在该文件中写入0将在写入1时将其关闭,然后将其打开。

Regarding what you want to do (toggling the led if I remember correctly), you can simply have a look at /sys/class/leds/red/brightness writing 0 in that file will turn it off while writing 1, will turn it on.

这篇关于在哪里可以找到SAMA5D27-SOM1-EK1设备及其GPIOS的映射?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆