1      Hardware Overview

gpio interface,pin map:

AM335X_I2C0_W_C----------------------MCASP0_AXR1

/*4g-power*/

AM335X_MMC2_DAT0------------------GPMC_A1

/*4g-reset*/

AM335X_MMC2_DAT2------------------GPMC_A3

/*wifi-led*/

AM335X_WIFI------------------------------GPMC_A2

/*system-led*/

AM335X_XDMA_EVENT_INTR1------XDMA_EVENT_INTR1

/*key2 button*/

AM335X_SPI0_CS1-----------------------SPI0_CS1

2   GPIO DRIVER Overview

The gpio-leds driver provide userspace access gpio interface, for example: /sys/class/leds/4g-reset dir,  under the dir have brightness、trigger, led trigger mode current triggers are:

"backlight" - LED will act as a back-light, controlled by the framebuffer system

"default-on" - LED will turn on (but for leds-gpio see "default-state"

property in Documentation/devicetree/bindings/gpio/led.txt)

"heartbeat" - LED "double" flashes at a load average based rate

"disk-activity" - LED indicates disk activity

"ide-disk" - LED indicates IDE disk activity (deprecated),in new implementations use "disk-activity"

"timer" - LED flashes at a fixed, configurable rate

The gpio driver can be used to pullup/pulldown led(io) from the User interface as shown by the below diagram..

3  Kernel GPIO porting

PIN MUX

user_leds_s0: user_leds_s0 {
pinctrl-single,pins = <
AM33XX_IOPAD(0x9a8, PIN_OUTPUT_PULLUP | MUX_MODE7) /* mcasp0_axr1.gpio3_20 ----> eeprom_write_control*/
AM33XX_IOPAD(0x844, PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a1.gpio1_17 ----> 4g-power*/
AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a3.gpio1_19 ---->4g-reset*/
AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a2.gpio1_18 ---->wifi-led*/
AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLUP | MUX_MODE7) /* xdma_event_intr1.gpio0_20 ---->system-led*/
AM33XX_IOPAD(0x960, PIN_INPUT_PULLUP | MUX_MODE7) /* spi0_cs1.gpio0_6 ----> button */
>;
};

GPIO DTS NODE

leds {
pinctrl-names = "default";
pinctrl-0 = <&user_leds_s0>;

compatible = "gpio-leds";

led1 {
label = "heartbeat";
gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
};

led2 {
label = "eeprom-write-control";
gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>;
default-state = "off";
};

led3 {
label = "4g-power";
gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
default-state = "on";
};

led4 {
label = "4g-reset";
gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
default-state = "off";
};

led5 {
label = "wif-led";
gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
default-state = "off";
};
};

4    User Space Interface

root@am335x-evm:/sys/class/leds/4g-reset# ls

brightness      device          max_brightness  power           subsystem       trigger         uevent

am335x system upgrade kernel gpio(九)的更多相关文章

  1. am335x system upgrade kernel tf(五)

    1      Scope of Document This document describes TF hardware design 2      Requiremen 2.1     Functi ...

  2. am335x system upgrade kernel ethernet(四)

    1      Scope of Document This document describes ethernet hardware design and porting KZS8081 to ubo ...

  3. am335x system upgrade kernel can(八)

    1      Scope of Document This document describes can bus hardware design and can bus driver developm ...

  4. am335x system upgrade kernel uart(七)

    1      Scope of Document This document describes UART hardware design, uart driver porting 2      Re ...

  5. am335x system upgrade kernel i2c rtc eeprom(六)

    1      Scope of Document This document describes i2c bus hardware design and support i2c-devices: ee ...

  6. am335x system upgrade kernel ec20 simcom7600ce(十一)

    1      Scope of Document This document describes 4G hardware design, support quectel ec20 4G module/ ...

  7. am335x system upgrade kernel usb stroage(十)

    1      Scope of Document This document describes USB hardware design, support stardard usb2.0 port o ...

  8. am335x system upgrade kernel f-ram fm25l16b(十六)

    1      Scope of Document This document describes SPI F-RAM hardware design 2      Requiremen 2.1     ...

  9. am335x system upgrade kernel emmc(十八)

    1      Scope of Document This document describes EMMC hardware design 2      Requiremen 2.1     Func ...

随机推荐

  1. pyenv基本使用

    pyenv使用 1.安装: git clone https://github.com/pyenv/pyenv.git 2.配置pyenv环境变量 echo 'export PYENV_ROOT=&qu ...

  2. TiDB基本架构简单总结

    TiDB特点 高可用 水平拓展 事务 SQL支持 TiDB架构 ​ 和MySql不同,TiDB是一个分布式的数据库而不是单个进程,所以整个TiDB是由以下角色组成: TiKV, PD, TiDB, T ...

  3. as3鱼眼放大镜

    package { //hi.baidu.com/inuko //bitmapdata fisheye magnifier //原创代码,如有雷同,纯属巧合 /* 本例是使用近似算法,只是最简单的鱼眼 ...

  4. git重置账号密码

    1.打开控制面板(快捷打开win+R,输入control) 2.点击打开用户账户 3.点击凭据管理器 4.点击windows凭据删除你的git凭据即可

  5. MVC-08模型

    部分7:添加数据模型. MVC模型 MVC模型包含所有应用程序逻辑(业务逻辑.验证逻辑.数据访问逻辑),除了纯视图和控制器逻辑. 通过MVC,模型可保存并操作应用程序数据. Models文件夹 Mod ...

  6. linux设备模型与内核中的面向对象思想

    linux内核用C语言实现了C++面向对象的大部分特性:封装,继承,多态.在看内核的过程中,开始追寻其中的设计思想,封装.继承.多态.恰好今天又在看Linux设备模型,找了很多资料.总结如下: 1.l ...

  7. java数据库数据导入excel

    data导出入excel中 controller: package com.longfor.hrssc.api.controller; import com.longfor.hrssc.api.mod ...

  8. 【转】如何使用jupyter编写数学公式(译)

    [1.如何使用jupyter编写数学公式(译)][1] [1]: https://www.jianshu.com/p/93ccc63e5a1b

  9. python相关软件安装

    一. python 3 安装 Python官网 在官网下载对应系统的安装包 安装步骤 注意:有的时候安装完后会出现"Disable path length limit"的按钮,如果 ...

  10. 交叉编译openssl1.1.1a

    ​ 交叉编译openssl1.1.1a的时候遇到的问题,记录一下,方便下次查找 一.下载源码 1.打开openssl官网,下载openssl-1.1.1.tar.gz源码包. 2.执行下面的命令解压源 ...