linux gpio debug log(AM335X)

來源:互聯網
上載者:User

mail:bookworepeng@Hotmail.com

qq:196568501

author:DriveMonkey

承接各類嵌入式外包項目(phone:13410905075)

linux 調試 GPIO 有兩個工具可以使用

一個就是dubugfs

另外一個就是linux自身帶的gpio驅動架構

首先說一下debugfs 對於gpio調試的用法

1.mount 上 debugfs   

mount -t debugfs debugfs /sys/kernel/debug

2. 找到引腳多路配置選項

     我的路徑是 ../debug/omap_mux

     裡面可以查看當前gpio的所有配置

另外一種方法在linux 核心提供的驅動架構裡調試

1.找到驅動提供給應用的檔案介面路徑

   /sys/class/gpio

  gpio 下各個檔案使用嗯方法如下:

$ echo 30 > /sys/class/gpio/export
Change the GPIO pin direction to in/out
$ echo "out" > /sys/class/gpio/gpio30/direction

or

$ echo "in" > /sys/class/gpio/gpio30/direction
Change the value
$ echo 1 > /sys/class/gpio/gpio30/value

or

$ echo 0 > /sys/class/gpio/gpio30/value
Unexport the GPIO pin
$ echo 30 > /sys/class/gpio/unexport

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.