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

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

?? codehc11.h

?? USB9602 source code for C 8051
?? H
字號:
/**********************************************************************/
/* This is the code that's HC11 specific                              */
/**********************************************************************/


/**********************************************************************/
/* This is the place where we deposit code that MUST be executed right*/
/* at startup.                                                        */
/**********************************************************************/
void _HC11Setup(void)
  {
        INTSOFF;                            /*disable all interrupts  */
        TMSK2=0x03;                         /*program TMSK2           */
  }

/**********************************************************************/
/* This is the unexpected interrupt handler.                          */
/**********************************************************************/
#pragma interrupt_handler unexpih
void unexpih(void)
  {
        while (TRUE)                        /*scream for help         */
          {
            while (!TX_EMPTY) ;
            PUT_TX('U');
            while (!TX_EMPTY) ;
            PUT_TX('I');
          }
  }

/**********************************************************************/
/* This is the serial interface interrupt handler.  It must handle    */
/* both receiver and transmitter interrupts.                          */
/**********************************************************************/
#pragma interrupt_handler sci_ih
void sci_ih(void)
  {
    byte s0sts;
       
      /*Check the receiver for data first *****************************/
        s0sts=SCSR;                         /*get status              */
        if(s0sts & RDRF)                    /*check RX for data       */
          {
            if(s0sts & (FE+OR))             /*if an error occurred    */
              {
              }
            rcveih();                       /*process character       */
          }

      /*Then check if the transmitter is ready ************************/
        s0sts=SCSR;                         /*get status again        */
        if(s0sts & TDRE)                    /*check if TX ready       */
          {
            xmitih();                       /*process interrupt       */
          }

  }

/**********************************************************************/
/* This is the TOC2 interrupt handler, which we expect to service     */
/* every 0.5 seconds.                                                 */
/**********************************************************************/
#pragma interrupt_handler toc2_ih
void toc2_ih(void)
  {
      /*Calculate and set the next Timer Output Compare value.  This  */
      /*is done by adding a new offset, and ignoring the overflow     */
        TOC2+=HALFSEC;                      /*add offset, ign. ovflw  */

        COPRST=0x55;                        /*reset the               */
        COPRST=0xAA;                        /*  COP timer             */

      /*Track the current time                                        */
        trktim();                           /*keep track of real time */

      /*Clean up and go home                                          */
        TFLG1=OC2;                          /*clear the interrupt     */
  }

/**********************************************************************/
/* This is the usb interrupt handler.                                 */
/**********************************************************************/
#pragma interrupt_handler usb_ih
void usb_ih(void)
  {
        usb_isr();                          /*process interrupt       */
  }

/**********************************************************************/
/* This is the initialization code.                                   */
/**********************************************************************/
void init_micro(void)
  {
    int tmp;

      /*Re-establish requisite reset state ****************************/

      /*This defines our TTY initialization code: *********************/
        BAUD=BAUD9600;                      /*9600 baud, 8 MHz proc   */
        SCCR1=0;                            /*8 data bits             */
        GET_RX(tmp);                        /*clear receive buffer    */
        GET_RX(tmp);                        /*  twice                 */
        tmp=SCSR;                           /*clear error bits        */

      /*Configure Port C for totem-pole output buffers, no handshake, */
      /*normal strobe polarity, interrupts OFF                        */
        PIOC=0;                             /*totem pole, no HNDS     */

      /*Enable the SPI port, putting it in Mode 0 (CPOL=0, CPHA=0),   */
      /*Master mode, interrupts OFF, 1 MHz clock (with 8 MHz osc.),   */
      /*Port D totem pole, bit 2 is input, all others outputs         */
      /*Bit 5 is used as the CS* for the USBN9602                     */
        PORTD=0xFF;                         /*set to known value      */
        DDRD=0x3B;                          /*set PORTD[0..5] dir.    */
        SPCR=SPE+MSTR;                      /*enable, in master mode  */
        tmp=SPSR;                           /*flush the               */
        tmp=SPDR;                           /*  SPI port              */

      /*Turn on the A/D unit, make IRQ levl sensitive, turn on STOP   */
      /*exit delay, turn off the clock monitor, and set the COP       */
      /*(deadman) timer to its longest period:                        */
        OPTION=ADPU+DLY+CR1+CR0;            /*prog the OPTION reg     */

      /*Turn on the serial port, enabling only receive interrupts for */
      /*now.  Transmit interrupts will be enabled only when necessary.*/
        SCCR2=RIE+TE+RE;                    /*prog the SCCR2 reg      */

      /*Initialize the timer.  TOC2 is used to provide a 0.5 second   */
      /*interrupt (toggling PA6 in the process)                       */
        PACTL=0;                            /*disable pulse acc.      */
        CFORC=0;                            /*no forced compares      */
        OC1M=0;                             /*no action on OC1        */
        TCTL2=0;                            /*input capture disabled  */
        TCTL1=OL2;                          /*toggle PA6 on OC2       */
        TMSK1=OC2;                          /*enable OC2 interrupts   */
        
      /*Initialize all interrupt vectors to the default handler *******/
        for(tmp=SCI_VECT; tmp<=CLK_MONT; tmp+=3) SETVECT(tmp,unexpih);

      /*Setup specific vectors ****************************************/
        SETVECT(SCI_VECT,sci_ih);           /*set serial intf. vector */
        SETVECT(IRQ_VECT,usb_ih);           /*set external int vector */
        SETVECT(TO_CMP_2,toc2_ih);          /*set timer comp.  vector */

        /*initiate continuous conversions on the first 4 A/D channels */
        ADCTL=SCAN+MULT+0;                  /*cont. scan channels 1-4 */
  }

/**********************************************************************/
/* This subroutine delays 10 ms (approximately).                      */
/**********************************************************************/
void ee_wait(void)
  {
    int dlyindx;

    for(dlyindx=0; dlyindx<700; dlyindx++); /*assumes 8Mhz proc       */
  }

/**********************************************************************/
/* This subroutine erases does a byte or bulk erase of the EEPROM.    */
/* Note that adr is an offset, not an absolute address.               */
/**********************************************************************/
void ee_erase(byte adr, byte bulkmode)
  {
    byte modebit;
        if(bulkmode) modebit=0; else modebit=P_BYTE;

        PPROG=modebit+P_ERASE+EELAT;        /*set to proper erase mode*/
        *(byte *)(_EE_BASE+adr)=0;          /*write any data to EEPROM*/
        PPROG=modebit+P_ERASE+EELAT+EEPGM;  /*set to bulk erase mode  */
        ee_wait();                          /*wait 10 ms              */
        PPROG=0;                            /*voltage off, read mode  */
  }

/**********************************************************************/
/* This subroutine erases the specified EE 'register' which is 16 bits*/
/* and composed of two adjacent eeprom locations.                     */
/**********************************************************************/
void eerase(byte adr)
  {
#define BYTEMODE FALSE

        adr=adr << 1;                       /*adjust base address     */
        ee_erase(adr  ,BYTEMODE);           /*erase low order byte    */
        ee_erase(adr+1,BYTEMODE);           /*erase hi  order byte    */
  }

/**********************************************************************/
/* This subroutine bulk erases the EEPROM:                            */
/**********************************************************************/
void eebulk(void)
  {
#define BULKMODE TRUE

        ee_erase(0,BULKMODE);               /*bulk erase EEPROM       */
  }

/**********************************************************************/
/* This subroutine reads the specified EE 'register'                  */
/**********************************************************************/
void eergrd(byte adr)
  {
        adr=adr << 1;                       /*adjust base address     */
        eebufl= *(byte *)(_EE_BASE+adr);    /*get low order byte      */
        eebufh= *(byte *)(_EE_BASE+adr+1);  /*get hi  order byte      */
  }

/**********************************************************************/
/* This subroutine writes the EE byte whose address is in B on entry: */
/**********************************************************************/
void eebytewr(byte adr, byte dta)
  {
        PPROG=EELAT;                        /*set to proper prgrm mode*/
        *(byte *)(_EE_BASE+adr)=dta;        /*write data to EEPROM    */
        PPROG=EELAT+EEPGM;                  /*set to program bit      */
        ee_wait();                          /*wait 10 ms              */
        PPROG=0;                            /*voltage off, read mode  */
  }

/**********************************************************************/
/* This subroutine writes the EE 'register' whose address is in B on  */
/* entry:                                                             */
/**********************************************************************/
void eergwr(byte adr)
  {
        adr=adr << 1;                       /*adjust base address     */
        eebytewr(adr,  eebufl);             /*program low order byte  */
        eebytewr(adr+1,eebufh);             /*program hi  order byte  */
  }

/**********************************************************************/
/* This subroutine does an A-to-D conversion on the requested channel */
/* and then returns the 8-bit result.                                 */
/**********************************************************************/
byte A2D_conv(byte chnl)
  {
        if(chnl) return(ADR2); else return (ADR3);    /*send back data*/
  }

/**********************************************************************/
/* This subroutine reads the USB register whose address is given.     */
/**********************************************************************/
byte read_usb(byte adr)
  {
        USBCSON;                            /*turn on CS              */
        SPIADRCMD(adr,USBREAD);             /*send cmd and addr       */
        SPIOUT(0);                          /*send dummy data         */
        USBCSOFF;                           /*turn off CS             */
        return(SPDR);                       /*return the result       */
  }

/**********************************************************************/
/* This subroutine writes the USB register whose address is given.    */
/**********************************************************************/
void write_usb(byte adr, byte dta)
  {
        USBCSON;                            /*turn on CS              */
        SPIADRCMD(adr,USBWRITE);            /*send cmd and addr       */
        SPIOUT(dta);                        /*send the data           */
        USBCSOFF;                           /*turn off CS             */
  }

/**********************************************************************/
/* This subroutine checks the joystick switches.                      */
/**********************************************************************/
void chk_sw(void)
  {
    byte rpt_sw;                            /*temp switch value       */
        rpt_sw =PORTE;                      /*get the switch data     */

        rpt_sw ^=0xF0;                      /*flip to proper polarity */
        rpt_sw &=BIT5+BIT4;                 /*isolate the bits        */

        TSTSWITCH;                          /*store and send if dif.  */
  }

/**********************************************************************/
/* This subroutine puts the board to sleep, to reduce the overall     */
/* current consumption in the suspend mode.                           */
/**********************************************************************/
void deep_sleep(void)
  {
  }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区免费在线观看| 亚洲婷婷综合色高清在线| 国产欧美精品一区二区色综合朱莉| 国产欧美日产一区| 午夜av电影一区| 91网页版在线| 国产精品视频线看| 九九视频精品免费| 欧美日本在线播放| 亚洲欧美二区三区| 9久草视频在线视频精品| xvideos.蜜桃一区二区| 奇米综合一区二区三区精品视频| 99久久99精品久久久久久| 欧美精品一区视频| 麻豆精品国产传媒mv男同| 宅男噜噜噜66一区二区66| 一区二区三区免费看视频| 97se狠狠狠综合亚洲狠狠| 中文字幕国产精品一区二区| 国内精品免费在线观看| 日韩久久久精品| 免费久久99精品国产| 欧美年轻男男videosbes| 久久超碰97中文字幕| 日韩欧美精品三级| 蜜臀av一级做a爰片久久| 91精品国产综合久久国产大片| 一区二区三区欧美| 欧美三级视频在线观看| 亚洲国产精品影院| 欧美日韩一卡二卡三卡| 午夜伦欧美伦电影理论片| 欧美日韩亚洲综合一区二区三区| 亚洲一区av在线| 欧美三级电影精品| 日日摸夜夜添夜夜添国产精品| 欧美三电影在线| 免费av成人在线| 精品奇米国产一区二区三区| 激情丁香综合五月| 国产精品沙发午睡系列990531| www.视频一区| 一区二区在线观看视频在线观看| 91国偷自产一区二区三区观看 | 久久亚洲私人国产精品va媚药| 蜜桃久久精品一区二区| 久久综合久久99| 本田岬高潮一区二区三区| 亚洲欧美日本韩国| 777午夜精品视频在线播放| 看片的网站亚洲| 亚洲国产精品成人综合色在线婷婷| av成人免费在线| 亚洲成人在线免费| 久久久久久久久久久久电影 | 欧美精品久久久久久久久老牛影院| 亚洲第一成人在线| 久久综合久久综合久久综合| 99在线热播精品免费| 午夜精品福利一区二区三区蜜桃| 精品国产人成亚洲区| 不卡av在线免费观看| 亚洲高清一区二区三区| 国产亚洲精品久| 欧美日韩国产精选| 成人污污视频在线观看| 亚洲成人中文在线| 国产精品三级在线观看| 制服视频三区第一页精品| 不卡一二三区首页| 免费成人你懂的| 亚洲人亚洲人成电影网站色| 日韩一级片网址| 91国偷自产一区二区开放时间| 久88久久88久久久| 亚洲国产日韩a在线播放| 久久久99免费| 91麻豆精品国产91久久久久 | 一区二区三区产品免费精品久久75| 日韩一级片网址| 欧美在线视频日韩| 成人小视频在线观看| 婷婷综合久久一区二区三区| 亚洲欧美一区二区三区久本道91 | 一区二区理论电影在线观看| 久久新电视剧免费观看| 欧美精品日日鲁夜夜添| 91国产免费观看| 东方aⅴ免费观看久久av| 免费观看日韩电影| 在线免费av一区| 成人毛片视频在线观看| 乱一区二区av| 日韩精品福利网| 亚洲国产色一区| 一区二区国产视频| 中文字幕一区在线| 国产精品欧美久久久久无广告| 日韩欧美的一区二区| 777色狠狠一区二区三区| 欧美三级一区二区| 欧美在线免费播放| 欧洲一区二区三区在线| 色噜噜夜夜夜综合网| 91蝌蚪porny| 91在线观看高清| 91片在线免费观看| a4yy欧美一区二区三区| 99精品视频在线播放观看| 大尺度一区二区| av资源网一区| 91色九色蝌蚪| 91福利国产精品| 欧美无砖砖区免费| 在线电影院国产精品| 欧美喷水一区二区| 日韩午夜小视频| 亚洲精品在线电影| 国产日韩欧美亚洲| 国产精品天天看| 亚洲免费伊人电影| 亚洲一二三四区不卡| 亚洲在线视频免费观看| www.亚洲色图| 一本大道综合伊人精品热热| 色综合久久久久久久久久久| 色av成人天堂桃色av| 欧美日韩成人综合| 欧美成人一区二区| 国产亚洲自拍一区| 亚洲少妇中出一区| 午夜婷婷国产麻豆精品| 久久精品国产久精国产| 成人免费看片app下载| 色综合久久久久综合| 欧美一区二区精美| 国产婷婷色一区二区三区在线| 亚洲四区在线观看| 亚洲成人免费电影| 国产在线播放一区三区四| 成人av影院在线| 欧美日韩精品免费观看视频| 日韩一区二区三区视频| 国产精品丝袜黑色高跟| 亚洲v中文字幕| 国产aⅴ精品一区二区三区色成熟| 91在线porny国产在线看| 欧美日韩黄视频| 国产精品美女久久久久久2018 | 精品亚洲国内自在自线福利| 成人在线视频首页| 在线不卡免费欧美| 国产精品入口麻豆九色| 日日夜夜一区二区| gogo大胆日本视频一区| 日韩一区二区三区免费看| 日韩码欧中文字| 九九九精品视频| 欧美午夜精品理论片a级按摩| 久久综合久久鬼色中文字| 亚洲一区视频在线观看视频| 国产精品综合视频| 7777精品伊人久久久大香线蕉最新版| 日本一区免费视频| 制服丝袜中文字幕一区| 亚洲欧洲国产日本综合| 精品亚洲欧美一区| 69精品人人人人| 一区二区三区在线观看网站| 狠狠色丁香久久婷婷综合_中| 欧美日韩视频第一区| 亚洲三级电影网站| 粉嫩av一区二区三区在线播放 | 国产一区不卡视频| 91精品国产丝袜白色高跟鞋| 亚洲日本成人在线观看| 国产成人综合自拍| 精品日产卡一卡二卡麻豆| 午夜激情一区二区三区| 欧美亚洲国产一区在线观看网站| 国产欧美日韩在线看| 极品少妇xxxx精品少妇| 日韩欧美在线1卡| 日本成人中文字幕在线视频| 欧美日韩午夜在线| 亚洲一卡二卡三卡四卡| 色菇凉天天综合网| 亚洲精品菠萝久久久久久久| 不卡的av中国片| 中文字幕欧美一区| 99久久国产免费看| 日韩理论片网站| 91麻豆swag| 亚洲另类色综合网站| av电影在线观看完整版一区二区| 中文字幕免费不卡在线| 成人中文字幕电影| 亚洲色图欧美在线| 欧美在线观看视频一区二区|