freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

計算機畢業(yè)設(shè)計外文翻譯--1-wire搜索算法(文件)

2025-06-10 17:13 上一頁面

下一頁面
 

【正文】 rection of the search. All devices with this bit stay in the search and the rest go into a wait state for a 1Wire reset. There are two basic types of operations that can be performed by using the search algorithm by manipulating the LastDiscrepancy, LastFamilyDiscrepancy, LastDeviceFlag, and ROM_NO register values (see Table 4). These operations concern basic discovery of the ROM numbers of 1Wire The 39。 operation is to search on the 1Wire for the next device. This search is usually performed after a 39。 operation. It is performed by leaving the state unchanged from the previous search and performing another search. The resulting ROM number can then be read from the ROM_NO register. If the previous search was the last device on the 1Wire then the result will be FALSE and the condition will be set to execute a 39。 operation verifies if a device with a known ROM number is currently connected to the 1 Wire. It is acplished by supplying the ROM number and doing a targeted search on that number to verify it is present. First, set the ROM_NO register to the known ROM number. Then set the LastDiscrepancy to 64 (40 hex) and the LastDeviceFlag to 0. Perform the search operation and then read the ROM_NO result. If the search was successful and the ROM_NO remains the ROM number that was being searched for, then the device is currently on the 1Wire. Target Setup The 39。 operation sets the search state to skip all of the devices that have the family code that was found in the previous search. This operation can only be performed after a search. It is acplished by copying the LastFamilyDiscrepancy into the LastDiscrepancy and clearing out the LastDeviceFlag. The next search will then find devices that e after the current family code. If the current family code group was the last group in the search then the search will retur n with the LastDeviceFlag set. Table5 Search Variations State Setup LastDiscrepancy LastFamily LastDeviceFlag ROM_NO Discrepancy FIRST 0 0 0 result NEXT leave unchanged leave unchanged leave unchanged result VERIFY 64 random 0 set with ROM to verify, check if same after search TARGET SETUP 64 0 0 set first byte to family code, set rest to zeros FAMILY SKIP SETUP copy from LastFamilyDiscrepancy leave unchanged 0 leave unchanged Conclusion The supplied search algorithm allows the discovery of the individually unique ROM numbers from any given group of 1Wire devices. This is essential to any multidrop 1Wire application. With the ROM numbers in hand, each 1Wire device can be selected individually for operations. This document also discussed search variations to find or skip particular 1Wire device types. See Appendix for a 39。在 1Wire網(wǎng)絡(luò)中注冊碼用于 1Wire主機對從機器件進行逐一尋址。 搜索算法首先通過復(fù)位 (Reset)和在線應(yīng)答脈沖 (Presence Pulse)時隙將1Wire總線上的所有器件復(fù)位;成功地執(zhí)行該操作后,發(fā)送 1個字節(jié)的搜索命令;搜索命令使 1Wire器件準(zhǔn)備、就緒開始進行搜索操作。 與所有的 1Wire通信一樣無論是讀取數(shù)據(jù)還是向從機器件寫數(shù)據(jù),都由 1Wire主機啟動每一位操作。 表 2 檢索信息位 位 (實際值 ) 位 (補碼 ) 結(jié)論 0 0 從機 ROM碼 中的當(dāng)前位既有 0,也有 1;即存在差異 0 1 從機 ROM碼中的當(dāng)前位均為 0。在后續(xù)搜索過程中,選用不同的路徑 (或分支 )來查找其它器件的 ROM碼。 讀第 1 位的 AND 從機發(fā)送 ROM 碼的第 1 位。 讀第 64 位補碼的 AND 從機發(fā)送 ROM 碼的第 64 位的補碼。搜索算法指定在第一輪查詢中若出現(xiàn)差異 (數(shù)據(jù)位 /補碼 = 0/0), 則選用‘ 0’路徑。記 錄家族碼的最后一次差異可以用于有選擇性地跳過 1Wire器件的整個分組。用來指明 LastDiscrepancy是否是在ROM碼中前 8位家族碼內(nèi)和其位置 last_zero—— 上次被寫入 0的值差異位的位置 ROM_NO—— 記錄當(dāng)前正在查找的 ROM,注冊碼的 8字節(jié)緩沖器 search_direction—— 位變量其值用來指明搜索方向具有此數(shù)據(jù)位規(guī)定值的所有器件繼續(xù)響應(yīng)搜索操作其它器件轉(zhuǎn)入等待狀態(tài)直到下一次 1Wire復(fù)位搜 索算法通過對 LastDiscrepancy、 LastFamilyDiscrepancy、 LastDeviceFlag 和 ROM_NO 值 (參見表 4)的處理利用上述流程實現(xiàn)了兩個不同類型的搜索操作;這兩個操作是搜索 1Wire 器件 ROM 碼的基礎(chǔ)。若 1Wire總線上沒有器件,復(fù)位序列就檢測不到應(yīng)答脈沖,搜索過程中止。 以下例舉了三個器件的搜索過程,為便于說明,設(shè)器件的 ROM碼只有 2位。 TARGET SETUP ‘ TARGET SETUP’操作就是用預(yù)置搜索狀態(tài)的方式首先查找一個特殊的家族類型,每個 1Wire器件都有一個字節(jié)的家族碼內(nèi)嵌在 ROM碼中 (參見圖 1),主機可以通過家族碼來識別器件所具有的特性和功能。 FAMILY SKIP SETUP ‘ FAMILY SKIP SETUP’操作用來設(shè)置搜索狀態(tài) 以便跳過搜索到的指定家族中的所有器件,此操作只有在一個搜索過程結(jié)束后才能使用。本文還對一些變量搜索算法做了詳細論述,這些變量搜索算法能夠查找或跳過特定類型的 1Wire器件。如果當(dāng)前家族碼分組是搜索過程中的最后一組,那么搜索過程結(jié)束并將 LastDeviceFlag 置位。在執(zhí)行下一次搜索算法時就能找出所期望的產(chǎn)品類型的第一個器件;并將此值存入 ROM_NO寄存器。 VERIFY ‘ VERIFY’ 操作用來檢驗已知 ROM碼的器件是否連接在 1Wire總線上,通過提供ROM碼并對 該碼進行目標(biāo)搜索就可確定此器件是否在線。之后從 ROM_NO寄存器中來讀出新一個 ROM碼。該操作是通過將LastDiscrepancy、 LastFamilyDiscrepancy和 LastDeviceFlag置零,然后進行搜索完成的。 64位 ROM碼中包含 8位循環(huán)冗余校驗碼 (CRC); CRC值用于驗證是否搜索到正確的 ROM碼注釋對實例中出現(xiàn)的符號進行了說明;在本文檔的源代碼附錄中也將用到這些專用符號。記錄最后一次值差異的位置以供下一次搜索使用,表 3列出了出現(xiàn)值差異時路徑的選取情況。 從表 4 可以看出:如果所有總線上的器件在當(dāng)前位具有相同值,那么只有一條分支路徑可選;總線上沒有器件響應(yīng)的情況是一種異常狀態(tài),可能是要查找的器件在搜尋過程中與 1Wire 總線脫離。 寫第 1 位指定位 (依照算法 ) 從機接
點擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1