亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.lst

?? 達拉斯 1-Wire 主機通信 這份資料展示了如何把 1-Wire 主機通信在應用到一個AVR系統中
?? LST
?? 第 1 頁 / 共 4 頁
字號:
##############################################################################
#                                                                            #
# IAR Atmel AVR C/EC++ Compiler V3.20A/W32             19/Aug/2004  16:08:04 #
# Copyright 1996-2004 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Source file  =  Z:\qvcs\AVR318 Dallas 1-wire Communication              #
#                    Interface\Source Code\IAR\polled\main.c                 #
#    Command line =  --cpu=m32 -ms -o "Z:\qvcs\AVR318 Dallas 1-wire          #
#                    Communication Interface\Source                          #
#                    Code\IAR\polled\Debug\Obj\" -lC "Z:\qvcs\AVR318 Dallas  #
#                    1-wire Communication Interface\Source                   #
#                    Code\IAR\polled\Debug\List\" -lA "Z:\qvcs\AVR318        #
#                    Dallas 1-wire Communication Interface\Source            #
#                    Code\IAR\polled\Debug\List\" --initializers_in_flash    #
#                    --root_variables -z2 --no_cse --no_inline               #
#                    --no_code_motion --no_cross_call --no_clustering        #
#                    --debug -DENABLE_BIT_DEFINITIONS -e -I "C:\Program      #
#                    Files\IAR Systems\Embedded Workbench 3.2\avr\INC\" -I   #
#                    "C:\Program Files\IAR Systems\Embedded Workbench        #
#                    3.2\avr\INC\CLIB\" --eeprom_size 1024 "Z:\qvcs\AVR318   #
#                    Dallas 1-wire Communication Interface\Source            #
#                    Code\IAR\polled\main.c"                                 #
#    List file    =  Z:\qvcs\AVR318 Dallas 1-wire Communication              #
#                    Interface\Source Code\IAR\polled\Debug\List\main.lst    #
#    Object file  =  Z:\qvcs\AVR318 Dallas 1-wire Communication              #
#                    Interface\Source Code\IAR\polled\Debug\Obj\main.r90     #
#                                                                            #
#                                                                            #
##############################################################################

Z:\qvcs\AVR318 Dallas 1-wire Communication Interface\Source Code\IAR\polled\main.c
      1          // This file has been prepared for Doxygen automatic documentation generation.
      2          /*! \file ********************************************************************
      3          *
      4          * Atmel Corporation
      5          *
      6          * \li File:               main.c
      7          * \li Compiler:           IAR EWAAVR 3.20a
      8          * \li Support mail:       avr@atmel.com
      9          *
     10          * \li Supported devices:  All AVRs.
     11          *
     12          * \li Application Note:   AVR318 - Dallas 1-Wire(R) master.
     13          *                         
     14          *
     15          * \li Description:        Example on how to use the 1-Wire(R) interface
     16          *                         master.
     17          *
     18          *                         $Revision: 1.6 $
     19          *                         $Date: Thursday, August 19, 2004 09:02:02 UTC $
     20          ****************************************************************************/
     21          
     22          #include <ioavr.h>
     23          #include <inavr.h>
     24          
     25          #include "OWIPolled.h"
     26          #include "OWIHighLevelFunctions.h"
     27          #include "OWIBitFunctions.h"
     28          #include "..\common_files\OWIcrc.h"
     29          
     30          #include <string.h> // Used for memcpy.
     31          
     32          
     33          // Defines used only in code example.
     34          #define DS1820_FAMILY_ID                0x10 
     35          #define DS1820_START_CONVERSION         0x44
     36          #define DS1820_READ_SCRATCHPAD          0xbe
     37          #define DS1820_ERROR                    -1000   // Return code. Outside temperature range.
     38          
     39          #define DS2890_FAMILY_ID                0x2c
     40          #define DS2890_WRITE_CONTROL_REGISTER   0X55
     41          #define DS2890_RELEASE_CODE             0x96
     42          #define DS2890_WRITE_POSITION           0x0f
     43          
     44          #define SEARCH_SUCCESSFUL               0x00
     45          #define SEARCH_CRC_ERROR                0x01
     46          
     47          #define FALSE       0
     48          #define TRUE        1
     49          
     50          #define MAX_DEVICES 8       //!< Max number of devices to search for.
     51          
     52          #define BUSES   (OWI_PIN_0 | OWI_PIN_1) //!< Buses to search.
     53          
     54          
     55          /*! \brief  Data type used to hold information about slave devices.
     56           *  
     57           *  The OWI_device data type holds information about what bus each device
     58           *  is connected to, and its 64 bit identifier.
     59           */
     60          typedef struct
     61          {
     62              unsigned char bus;      //!< A bitmask of the bus the device is connected to.
     63              unsigned char id[8];    //!< The 64 bit identifier.
     64          } OWI_device;
     65          
     66          
     67          // Prototypes of functions used in exemples.
     68          unsigned char SearchBuses(OWI_device * devices, unsigned char len, unsigned char buses);
     69          OWI_device * FindFamily(unsigned char familyID, OWI_device * devices, unsigned char size);
     70          signed int DS1820_ReadTemperature(unsigned char bus, unsigned char * id);
     71          void DS2890_SetWiperPosition(unsigned char position, unsigned char bus, unsigned char * id);
     72          
     73          
     74          /*! \brief  Example application for the polled drivers.
     75           *
     76           *  Example application for the software only and polled UART driver.
     77           *  This example application will find all devices (upper bounded by MAX_DEVICES) 
     78           *  on the buses defined by BUSES. It then tries to find either a DS1820 or DS2890 
     79           *  device on a bus, and communicate with them to read temperature (DS1820) or 
     80           *  set wiper position (DS2890).
     81           *  This example is not written in a very optimal way. It is merely intended to show
     82           *  how the polled 1-Wire(R) driver can be used.
     83           */

   \                                 In segment CODE, align 2, keep-with-next
     84          void main(void)
   \                     main:
     85          {
   \   00000000   ........                   CALL    ?PROLOGUE7_L09
   \   00000004                              REQUIRE ?Register_R4_is_cg_reg
   \   00000004                              REQUIRE ?Register_R5_is_cg_reg
   \   00000004                              REQUIRE ?Register_R6_is_cg_reg
     86              static OWI_device devices[MAX_DEVICES];
     87              OWI_device * ds1820;
     88              OWI_device * ds2890;
     89              signed int temperature = 0;
   \   00000004   2444                       CLR     R4
   \   00000006   2455                       CLR     R5
     90              unsigned char wiperPos = 0;
   \   00000008   2466                       CLR     R6
     91              
     92              // Initialize PORTB as output. Can be used to display values on
     93              // the LEDs on a STK500 development board.
     94              DDRB = 0xff;
   \   0000000A   EF0F                       LDI     R16,255
   \   0000000C   BB07                       OUT     0x17,R16
     95          
     96              OWI_Init(BUSES);
   \   0000000E   E003                       LDI     R16,3
   \   00000010   ........                   CALL    OWI_Init
     97              
     98              // Do the bus search until all ids are read without crc error.    
     99              while(SearchBuses(devices, MAX_DEVICES, BUSES) != SEARCH_SUCCESSFUL)
   \                     ??main_0:
   \   00000014   E033                       LDI     R19,3
   \   00000016   E028                       LDI     R18,8
   \   00000018   ....                       LDI     R16,LOW(??devices)
   \   0000001A   ....                       LDI     R17,(??devices) >> 8
   \   0000001C   ....                       RCALL   SearchBuses
   \   0000001E   2300                       TST     R16
   \   00000020   F7C9                       BRNE    ??main_0
    100              {
    101              
    102              }
    103              
    104              // See if there is a DS1820 or DS2890 on a bus.
    105              ds1820 = FindFamily(DS1820_FAMILY_ID, devices, MAX_DEVICES);
   \   00000022   E018                       LDI     R17,8
   \   00000024   ....                       LDI     R18,LOW(??devices)
   \   00000026   ....                       LDI     R19,(??devices) >> 8
   \   00000028   E100                       LDI     R16,16
   \   0000002A   ....                       RCALL   FindFamily
   \   0000002C   01C8                       MOVW    R25 : R24,R17 : R16
    106              ds2890 = FindFamily(DS2890_FAMILY_ID, devices, MAX_DEVICES);
   \   0000002E   E018                       LDI     R17,8
   \   00000030   ....                       LDI     R18,LOW(??devices)
   \   00000032   ....                       LDI     R19,(??devices) >> 8
   \   00000034   E20C                       LDI     R16,44
   \   00000036   ....                       RCALL   FindFamily
   \   00000038   01D8                       MOVW    R27 : R26,R17 : R16
    107              
    108              // Do something useful with the slave devices in an eternal loop.
    109              for (;;)
    110              {
    111                  // If there is a DS1820 temperature sensor on a bus, read the
    112                  // temperature.
    113                  // The DS1820 must have Vdd pin connected for this code to work.
    114                  if (ds1820 != NULL)
   \                     ??main_1:
   \   0000003A   2F08                       MOV     R16,R24
   \   0000003C   2B09                       OR      R16,R25
   \   0000003E   F039                       BREQ    ??main_2
    115                  {
    116                      temperature = DS1820_ReadTemperature((*ds1820).bus, (*ds1820).id);
   \   00000040   019C                       MOVW    R19 : R18,R25 : R24
   \   00000042   5F2F                       SUBI    R18,255
   \   00000044   4F3F                       SBCI    R19,255
   \   00000046   01FC                       MOVW    R31 : R30,R25 : R24
   \   00000048   8100                       LD      R16,Z
   \   0000004A   ....                       RCALL   DS1820_ReadTemperature
   \   0000004C   0128                       MOVW    R5 : R4,R17 : R16
    117                  }        
    118                  // If there is a DS2890 digital potentiometer, increment the
    119                  // wiper value.
    120                  if (ds2890 != NULL)
   \                     ??main_2:
   \   0000004E   2F0A                       MOV     R16,R26
   \   00000050   2B0B                       OR      R16,R27
   \   00000052   F039                       BREQ    ??main_3
    121                  {
    122                      DS2890_SetWiperPosition(wiperPos++, (*ds2890).bus, (*ds2890).id);
   \   00000054   019D                       MOVW    R19 : R18,R27 : R26
   \   00000056   5F2F                       SUBI    R18,255
   \   00000058   4F3F                       SBCI    R19,255
   \   0000005A   911C                       LD      R17,X
   \   0000005C   2D06                       MOV     R16,R6
   \   0000005E   ....                       RCALL   DS2890_SetWiperPosition
   \   00000060   9463                       INC     R6
    123                  }
    124                  
    125                  // Discard lsb of temperature and output to PORTB.
    126                  PORTB = ~(temperature >> 1);
   \                     ??main_3:
   \   00000062   0182                       MOVW    R17 : R16,R5 : R4
   \   00000064   9515                       ASR     R17
   \   00000066   9507                       ROR     R16
   \   00000068   9500                       COM     R16
   \   0000006A   BB08                       OUT     0x18,R16
   \   0000006C   CFE6                       RJMP    ??main_1
    127              }
    128          }

   \                                 In segment NEAR_Z, align 1, keep-with-next, root
   \   00000000                              REQUIRE `?<Segment init: NEAR_Z>`
   \                     ??devices:
   \   00000000                              DS 72
    129          
    130          
    131          /*! \brief  Perform a 1-Wire search
    132           *
    133           *  This function shows how the OWI_SearchRom function can be used to 
    134           *  discover all slaves on the bus. It will also CRC check the 64 bit
    135           *  identifiers.
    136           *
    137           *  \param  devices Pointer to an array of type OWI_device. The discovered 
    138           *                  devices will be placed from the beginning of this array.
    139           *
    140           *  \param  len     The length of the device array. (Max. number of elements).
    141           *
    142           *  \param  buses   Bitmask of the buses to perform search on.
    143           *
    144           *  \retval SEARCH_SUCCESSFUL   Search completed successfully.
    145           *  \retval SEARCH_CRC_ERROR    A CRC error occured. Probably because of noise
    146           *                              during transmission.
    147           */

   \                                 In segment CODE, align 2, keep-with-next
    148          unsigned char SearchBuses(OWI_device * devices, unsigned char len, unsigned char buses)
   \                     SearchBuses:
    149          {
   \   00000000   ........                   CALL    ?PROLOGUE15_L09
   \   00000004                              REQUIRE ?Register_R4_is_cg_reg
   \   00000004                              REQUIRE ?Register_R5_is_cg_reg
   \   00000004                              REQUIRE ?Register_R6_is_cg_reg
   \   00000004                              REQUIRE ?Register_R7_is_cg_reg
   \   00000004                              REQUIRE ?Register_R8_is_cg_reg
   \   00000004                              REQUIRE ?Register_R9_is_cg_reg
   \   00000004                              REQUIRE ?Register_R10_is_cg_reg
   \   00000004                              REQUIRE ?Register_R11_is_cg_reg
   \   00000004                              REQUIRE ?Register_R12_is_cg_reg
   \   00000004                              REQUIRE ?Register_R13_is_cg_reg
   \   00000004                              REQUIRE ?Register_R14_is_cg_reg
   \   00000004   01C8                       MOVW    R25 : R24,R17 : R16
   \   00000006   2ED2                       MOV     R13,R18
    150              unsigned char i, j;
    151              unsigned char presence;
    152              unsigned char * newID;
    153              unsigned char * currentID;
    154              unsigned char currentBus;
    155              unsigned char lastDeviation;
    156              unsigned char numDevices;
    157              
    158              // Initialize all addresses as zero, on bus 0 (does not exist).
    159              // Do a search on the bus to discover all addresses.    
    160              for (i = 0; i < len; i++)
   \   00000008   E0B0                       LDI     R27,0
   \                     ??SearchBuses_0:
   \   0000000A   15BD                       CP      R27,R13
   \   0000000C   F520                       BRCC    ??SearchBuses_1
    161              {
    162                  devices[i].bus = 0x00;
   \   0000000E   E000                       LDI     R16,0
   \   00000010   2E90                       MOV     R9,R16
   \   00000012   2F4B                       MOV     R20,R27
   \   00000014   E050                       LDI     R21,0
   \   00000016   E009                       LDI     R16,9
   \   00000018   E010                       LDI     R17,0
   \   0000001A   ........                   CALL    ?S_EC_MUL_L02

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久这里只有精品首页| www.一区二区| 日韩欧美视频在线| 亚洲成av人综合在线观看| 欧美日韩国产综合一区二区| 五月激情综合婷婷| 欧美一区二区美女| 国产精品99精品久久免费| 国产精品色哟哟| 日韩欧美国产小视频| 日韩成人一区二区| 久久综合久久综合久久综合| 成人毛片在线观看| 一区二区三区日本| 欧美一区二区三区在线电影| 国产精品一线二线三线精华| 亚洲少妇30p| 欧美一级搡bbbb搡bbbb| 国产成人鲁色资源国产91色综| 中文在线资源观看网站视频免费不卡| 91在线精品秘密一区二区| 亚洲高清在线精品| 久久中文娱乐网| 在线观看国产精品网站| 精品在线免费观看| 亚洲天堂免费看| 日韩免费看的电影| 国产不卡视频在线观看| 亚洲午夜激情网站| 久久免费电影网| 在线观看亚洲a| 国产精品亚洲成人| 亚洲综合色区另类av| 久久综合久久99| 欧美午夜不卡在线观看免费| 国产精品综合网| 亚洲成人免费影院| 国产精品国产三级国产三级人妇| 69成人精品免费视频| 成人网男人的天堂| 蜜臀久久久久久久| 一区二区三区四区五区视频在线观看| 7777精品伊人久久久大香线蕉经典版下载 | 色婷婷激情综合| 久久精品国产色蜜蜜麻豆| 亚洲黄一区二区三区| 国产亚洲人成网站| 欧美一区二区视频网站| 日本乱码高清不卡字幕| 成人午夜视频在线观看| 久草中文综合在线| 午夜精品一区在线观看| 亚洲人一二三区| 国产欧美日韩激情| 久久久久久久久一| 日韩视频在线永久播放| 欧美午夜寂寞影院| 91蜜桃网址入口| 大胆欧美人体老妇| 国产麻豆精品theporn| 免费成人结看片| 日韩黄色小视频| 性做久久久久久免费观看| 亚洲最大成人网4388xx| 综合久久久久综合| 国产精品二三区| 欧美国产欧美亚州国产日韩mv天天看完整| 精品国产乱码久久| 久久综合久久综合亚洲| 久久尤物电影视频在线观看| 欧美tickling挠脚心丨vk| 制服丝袜日韩国产| 欧美一区午夜精品| 日韩你懂的在线观看| 欧美一区二区三区四区在线观看 | 日本亚洲三级在线| 亚洲国产日韩a在线播放性色| 一区二区三区在线视频免费| 亚洲欧美日韩电影| 玉米视频成人免费看| 悠悠色在线精品| 午夜一区二区三区在线观看| 亚洲成av人片观看| 日韩国产在线一| 老司机精品视频导航| 精品一区二区久久| 国产精品伊人色| 成人蜜臀av电影| av福利精品导航| 在线观看国产日韩| 欧美一区二区三区日韩视频| 欧美成人性战久久| 国产精品免费视频网站| 亚洲啪啪综合av一区二区三区| 亚洲卡通动漫在线| 日韩avvvv在线播放| 国产自产高清不卡| a在线欧美一区| 欧美亚男人的天堂| 日韩欧美电影在线| 国产人伦精品一区二区| 一区二区三区欧美激情| 天堂久久一区二区三区| 精品亚洲aⅴ乱码一区二区三区| 国产.欧美.日韩| 欧洲色大大久久| 日韩免费在线观看| 亚洲色图视频网| 免费看日韩a级影片| 国产91精品一区二区麻豆网站 | 亚洲18女电影在线观看| 精品亚洲国产成人av制服丝袜 | 国产精品欧美久久久久一区二区| 国产精品动漫网站| 天堂成人国产精品一区| 国产精品77777| 欧美色图在线观看| 26uuu精品一区二区| 樱桃视频在线观看一区| 极品少妇一区二区| 91久久精品一区二区| 久久久久久久综合日本| 亚洲制服丝袜在线| 国产91精品精华液一区二区三区| 在线视频你懂得一区二区三区| 精品少妇一区二区三区| 一区二区三区免费在线观看| 欧美在线free| 精品处破学生在线二十三| 亚洲精品日韩一| 国产成人免费视频网站 | 久久精品视频在线免费观看| 亚洲丝袜制服诱惑| 国模冰冰炮一区二区| 欧美日韩电影一区| 中文字幕在线不卡| 国产真实乱子伦精品视频| 在线成人av影院| 亚洲毛片av在线| 国产 日韩 欧美大片| 欧美一激情一区二区三区| 亚洲三级小视频| 国产不卡在线视频| 久久这里只精品最新地址| 日韩成人午夜电影| 在线观看视频91| 亚洲激情成人在线| 91首页免费视频| 国产精品色婷婷久久58| 国产精品一区二区三区网站| 精品免费国产一区二区三区四区| 亚洲成av人片| 欧美日韩国产一二三| 亚洲精品欧美专区| 99精品国产91久久久久久| 国产精品系列在线| 丁香婷婷综合色啪| 日本一区二区在线不卡| 国产一区二区三区高清播放| 日韩免费一区二区| 久久精品噜噜噜成人88aⅴ | 欧洲一区二区三区在线| 亚洲欧美精品午睡沙发| aaa亚洲精品一二三区| 中文字幕一区二区不卡| 不卡在线视频中文字幕| 国产精品欧美综合在线| 97se亚洲国产综合自在线| 国产精品美女一区二区| 丁香六月久久综合狠狠色| 亚洲国产精华液网站w| 波波电影院一区二区三区| 国产精品久久久久四虎| 99这里都是精品| 亚洲国产另类av| 日韩一区二区在线播放| 久久国产精品72免费观看| 精品国产一区二区亚洲人成毛片| 韩国毛片一区二区三区| 国产精品卡一卡二| 一本色道久久加勒比精品 | 精品亚洲porn| 欧美国产一区视频在线观看| 成人福利视频在线看| 亚洲免费观看高清完整版在线观看熊 | 中文字幕在线观看不卡| 色婷婷综合中文久久一本| 亚洲一区二区在线视频| 在线成人小视频| 激情欧美一区二区三区在线观看| 久久婷婷久久一区二区三区| 成人午夜大片免费观看| 亚洲一区二区av电影| 日韩一区二区三| 成人天堂资源www在线| 一区二区三区欧美在线观看| 欧美一区二区三区视频免费播放| 国产不卡视频一区二区三区| 一区二区三区资源| 日韩一区二区免费电影|