版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、版本號:1. 02015-07-251 目錄12錄1言2編寫目的2術語和縮寫詞2目引2.12.234567添加dts3內(nèi)核配置4測試4版本歷史6.7第 1 頁2 引言2.1 編寫目的對于 I2C 不夠用、或速度比較低的特殊場合,有時需要使用 GPIO 來模擬 i2c。目前 Linux內(nèi)核已經(jīng)做了很好的支持,bitbanging(/drivers/i2c/busses/i2c-gpio.c)主要來完成模式 i2c 功能,對此開發(fā)無需再專門寫個驅(qū)動。本文基于 S500介紹供開發(fā)者參考。2.2術語和縮寫詞第 2 頁縮寫和術語解 釋dtsDevice Tree Source,目標板硬件信息3 添加 d
2、tsBitbanging 已經(jīng)實現(xiàn)了 dts 與 platform_data兩種方式,具體查看 i2c-gpio.c 中的i2c_gpio_probe 函數(shù),dts 相對比較簡單,無需修改board 文件,這里以 dts 為例,有興趣的可研究下 platform_data。針對 dts 方式,只需要對應板型的 dts 中添加如下部分:第 3 頁i2c0 /*字符串不能修改,具體見 i2c-gpio.c 中的 i2c_gpio_dt_ids。*如需修改,兩邊 compatible 字段保持同步。*/compatible = i2c-gpio;/*gpio 配置,第一個 gpio 描述 sda,第
3、二個是 scl,別反了*/ gpios = ;/*開漏極配置,其并不是真正的把 gpio 設為開漏極,僅僅是*sda/scl 設為 high。*/i2c-gpio,spen-drain; i2c-gpio,scl-open-drain;/*clk 周期設置*/i2c-gpay-us = ;/* 100 kHz */ #address-cells = ;#size-cells = ;/測試代碼的配置,與標準 i2c 設備配置相同i2cdev50compatible =actions,i2cdev; reg = ;4 內(nèi)核配置默認內(nèi)核是沒打開,需要手動打開:makeconfig或直接修改對應板型的
4、 deconfig 文件,如 kernel/arch/arm/configs/atm7059a_s500_defconfig5 測試完成以上操作,編譯并替換 dtb 與 uImage 文件,使用 i2c_owl_dev.ko 或其它 i2c 測試用例,用示波器測試 sda 與 scl 兩個pin 的波形:第 4 頁# CONFIG_I2C_GPIO is not set修改為: CONFIG_I2C_GPIO=yDevice Drivers- I2C support-I2C Hardware Bupport- GPIO-based bitbanging I2C第 5 頁6 版本歷史第 6 頁日
5、期版本號注釋作者2015-7-261.0建立初始化版本Actduino S500 項目組7DierInformation givenhisis provided just as a reference or exle for thepure of using Actions products, and cannot be treated as a part of any quoion orcontract for sale.Actions products may contain design defects or errors known as anomas or errata which
6、may cause the products functions to deviate from published specifications. Designers mustnot rely on the instructions of Actions products marked “” or “undefined”. Actionsreserves these for future definition and shall have no responsibility whatsoever forsorpatibilities arising from future changes t
7、o them.ACTIONS DIS AND EXCLUDES ANY AND ALL WARRANTIES, INCLUDING WITHOUTLIMIION ANY AND ALL EXPRESS OR IMPD WARRANTIES OF MERCHANTABILITY,ACCURACY, SECURITY, FITNESS FOR A PARTICULAR PURE, TITLE, AND AGAINSTINFRINGEMENT OF ELLECTUAL PROPERTY AND THE LIKE TO THE INFORMATON OF THIS AND ACTIONS PRODUC
8、TS.IN NO EVENT SHALL ACTIONS BE LIABLE FOR ANY DIRECT, INCIDENTAL, INDIRECT, SPEL,PUNITIVE, OR CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING, WITHOUT LIMIIONFOR LOST OF DATA, PROFITS, SAVINGS OR REVENUES OF ANY KIND ARISING FROM USINGTHE INFORMATON OF THIS AND ACTIONS PRODUCTS. REGARDLESS OF THEFORM O
9、F ACTION, WHETHER BASED ON CONTRACT; TORT; NEGLIGENCE OF ACTIONS OROTHERS; STRICT LIABILITY; OR OTHERWISE; WHETHER OR NOT ANY REMEDY OF BUYER ISHELD TO HAVE FAILED OF ITS ESSENTIAL PURE, AND WHETHER ACTIONS HAS BEENADVISED OF THE SIBILITY OF SUCH DAMAGES OR NOT. Actions products are not designed,end
10、ed, authorized or warranted for use in any lifesupport or other application where product failure could cause or contribute toalinjury or severe property damage. Any and all such uses without prior written approval of an Officer of Actions and further testing and/or modification will be fully at the
11、 risk of thecustomer.Ways of obtaining informationCopies of thisand/or other Actions product literature, as well as the Terms andConditions of Sale Agreement, may be obtained by visiting Actions website at: or from an authorized Actions represenive.第 7 頁TrademarksThe word “Actions” and the logo are
12、the trademarks of Actions Semiconductor Co.,and Actions (Zhuhai) Technology Co., Limited is authorized to use them. Word “炬芯” is the trademark of Actions (Zhuhai) Technology Co., Limited. Names and brands of othercompanies and their productst may from time to time descriptively appearhisare the trad
13、emarks of their respective holders, no affiliation, authorization, orendorsement by suchtherein.s are claimed or impd except as may be expressly sedRightsThe proviof thisshall not be deemed to grant buyers any right in and topatent, copyright, trademark, trade secret, know how, and any otherActions
14、or others.ellectual property ofMiscellaneousInformation contained or described herein relates only to the Actions products and as of the release date of this publication, abrogates and supersedes all previously published data andspecifications relating to such products provided by Actions or by any othpurporting to distribute such information.ersonActions reserves the rights to make changes to information described herein at any timewithout notice. Please contact your Actions sales represeninformation before placing your product order.ives to obtahe
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 電子商務軟件售后服務方案
- 城市公共設施通風氣樓改善方案
- 隧道施工中的技術工藝及解決方案
- 2024年稅務代理開票業(yè)務合作協(xié)議
- 貸款協(xié)議2024年翻譯服務條款
- 2024高效節(jié)能變壓器商業(yè)買賣協(xié)議
- 單位就餐服務協(xié)議范本2024
- 公共設施LED顯示屏安裝合同
- 鋼筋工程施工風險評估方案
- 高處作業(yè)圖紙審查方案
- 中藥熱奄包教學課件
- 動物園安全培訓課件
- 電動車與充電樁的火災安全防范課件
- 愛學習愛祖國愛勞動
- 華住集團測評題
- 旅游小程序策劃方案
- 醫(yī)用化學實驗
- 呼吸系統(tǒng)疾病學教案:呼吸系統(tǒng)疾病的診斷與治療
- 員工試用期轉(zhuǎn)正評估問卷調(diào)查(360評估)
- 灼燙事故培訓課件
- 勇往直前追逐夢想主題班會課件
評論
0/150
提交評論