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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? get.c

?? Source code for driving RFM01 fm radio receiver. Code for ATmega microcontrolers with 8bit CRC check
?? C
字號(hào):
/* **********************************************************************
**
**  Copyright (C) 2003  Jesper Hansen <jesperh@telia.com> and 
**      Romuald Bialy (MIS) <romek_b@o2.pl>.
**
*************************************************************************
**
**   This file is part of the yampp system.
**
**  This program is free software; you can redistribute it and/or
**  modify it under the terms of the GNU General Public License
**  as published by the Free Software Foundation; either version 2
**  of the License, or (at your option) any later version.
**
**  This program is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**  GNU General Public License for more details.
**
**  You should have received a copy of the GNU General Public License
**  along with this program; if not, write to the Free Software Foundation, 
**  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
**
*********************************************************************** */

#include "../remote.h"

#if (REMOTE_STD == 1)
/*
  The REC-80 format used by Panasonic is a space coded 48 bit code consisting 
  of a 32 bit group id, followed by a 16 bit commmand word.
  Leading this is a header consisting of a 10T signal and a 4T pause.
  All bits start with a pulse of length T. The length of the pause following
  indicates the bit value. A T pause for a 0-bit and a 3T pause for a 1-bit.
*/

u16 REMOTE_get(void)
{
  u08 i, tmp = 0;
  u08 time;
  u08 T2,T4;
  union u16convert code;

  loop_until_bit_is_set(PIN(REMOTE_PORT), REMOTE_BIT);  // skip leading signal

  TCCR0=4;        //update every 32us
  TCNT0 = 1;

  while (bit_is_set(PIN(REMOTE_PORT), REMOTE_BIT))
  {
    T2 = TCNT0;
    if (T2 >= 100)    // max wait time
      return 0;
  }
  
  // measure time T

  TCNT0 = 1;
  loop_until_bit_is_set(PIN(REMOTE_PORT), REMOTE_BIT);
  
  T2 = TCNT0;    // T is normally around 0E-10 hex = 15 -> 480 uS
  T2 = T2 * 2;
  // max time is 4T
  T4 = T2 * 2;    

  for (i = 0; i < 48; i++)
  {
    TCNT0 = 1;
    while(1)
    {
      time = TCNT0;
      if (time > T4)
        return 0;
      
      // measure time on the lo flank
      if (bit_is_clear(PIN(REMOTE_PORT), REMOTE_BIT))
      {
        tmp <<= 1;
        if (time >= T2)
          tmp++;
        break;
      }
    }

    // save command data as we go
    if( i == 39)
      code.bytes.low = tmp;

    if( i == 47)
      code.bytes.high = tmp;
    
    // syncronize - wait for next hi flank
    loop_until_bit_is_set(REMOTE_PORT - 2, REMOTE_BIT);
  }
  return code.value;
}
#endif // (REMOTE_STD == 1)

//---------------------------------------------------------------------------------------

#if (REMOTE_STD == 2)
/*
  The NEC format is a space coded 32 bit code consisting 
  of a 16 bit group id, followed by a 16 bit commmand word.
  Leading this is a header consisting of a 16T signal and a 8T pause.
  All bits start with a pulse of length T. The length of the pause following
  indicates the bit value. A T pause for a 0-bit and a 3T pause for a 1-bit.

  Modified REC80 format by Will Jenkins, wdj@cus.org.uk
*/

u16 REMOTE_get(void)
{
  u08 i, tmp = 0;
  u08 time;
  u08 T2,T4;
  union u16convert code;

  loop_until_bit_is_set  (PIN(REMOTE_PORT), REMOTE_BIT);    // skip leading signal

  TCCR0 = (4);  //update every 32us
  TCNT0 = 1;

  while (bit_is_set(PIN(REMOTE_PORT), REMOTE_BIT))
  {
    T2 = TCNT0;
    if (T2 >= 140)  // max wait time was 100
      return 0;
  }
  
  // measure time T
  TCNT0 = 1;
  loop_until_bit_is_set(PIN(REMOTE_PORT), REMOTE_BIT);
  
  T2 = TCNT0;    // T is normally around 0E-10 hex = 15 -> 480 uS
  T2 = T2 * 2;
  // max time is 4T
  T4 = T2 * 2;    

  for (i = 0; i < 32; i++)
  {
    TCNT0 = 1;
    while(1)
    {
      time = TCNT0;
    
      if (time > T4)
        return 0;
      
      // measure time on the lo flank
      if (bit_is_clear(PIN(REMOTE_PORT), REMOTE_BIT))
      {
        tmp <<= 1;
        if (time >= T2)
          tmp += 1;
        break;
      }
    }

    // save command data as we go
    if( i == 15)
      code.bytes.high = tmp;

     if( i == 31)
      code.bytes.low = tmp;
    
    // syncronize - wait for next hi flank
    loop_until_bit_is_set(PIN(REMOTE_PORT), REMOTE_BIT);
   }

  return code.value;
 }
#endif // (REMOTE_STD == 2)

//---------------------------------------------------------------------------------------

#if (REMOTE_STD == 3) || (REMOTE_STD == 4)
/*
  The SONY format is a pulse coded 12 or 15 bit code consisting 
  of a 6 bit device code, followed by a 6 or 9 bit commmand word.
  Leading this is a header consisting of a 4T signal pulse.
  All bits are composed of a pulse of either 1T or 2T in length followed by a
  1T pause. A 2T pulse indicates a 1 bit, and a 1T pulse is a 0 bit.
*/ 

u16 REMOTE_get(void)
{
  u08  d, T2;
  u16 tmp;
  union u16convert code;

  code.value = 0;
  TCCR0 = (4);  //update every 32us
  TCNT0 = 1;
  loop_until_bit_is_set(PIN(REMOTE_PORT), REMOTE_BIT);  // leading signal
  if (TCNT0 <= 60) return 0;      // is it the leading Signal ?      

  // now looking for the Data-bits
#if (REMOTE_STD == 3)
  for(d=0; d < 14; d++)
#else
  for(d=0; d < 11; d++)
#endif
  {
    tmp = 1;
    while (bit_is_set(PIN(REMOTE_PORT), REMOTE_BIT))
    {
      T2 = TCNT0;
      if (T2 >= 140)      // max wait time
        return 0;
    }
    TCNT0 = 1;
    while (bit_is_clear(PIN(REMOTE_PORT), REMOTE_BIT))
    {
      T2 = TCNT0;
      if (T2 >= 140)      // max wait time
        return 0;
    }
    if (TCNT0 >= 35)      // pulse longer than 1 ms? then logic "1"
      code.value += (tmp << d);  // the device code 

  }

  return code.value;
}
#endif // (REMOTE_STD == 3) || (REMOTE_STD == 4)

//---------------------------------------------------------------------------------------

#if (REMOTE_STD == 5)
/*
  The RC-5 format used by Philips is bi-phase coded 13 bit code consisting 
  of a 7 bit device code, followed by 6 bit commmand word. Highest two bits of
  device code is startbit and troggle bit. Troggle bit must be masked out 
  because  its change after any keypress.
*/ 

u16 REMOTE_get(void)
{
  u08 i, time, T2, tmp = 0;
  union u16convert code;

  TCCR0 = (4);        //update every 32us
  loop_until_bit_is_set(PIN(REMOTE_PORT), REMOTE_BIT);  // skip leading signal
  for(i=0; i<13; i++)
  {
    if(bit_is_clear(PIN(REMOTE_PORT), REMOTE_BIT) )
      T2 = 0;
    else
      T2 = 1;

    TCNT0 = 1;
    while(1)
    {
      time=TCNT0;
      if(time > 0x21)
        return 0;

      if(bit_is_clear(PIN(REMOTE_PORT), REMOTE_BIT) && (T2==1) )
      {
        tmp <<= 1;
        tmp++;
        break;
      }
      else if(bit_is_set(PIN(REMOTE_PORT), REMOTE_BIT) && (T2==0) )
      {
        tmp <<= 1;
        break;
      }
    }

    //save address data
    if(i == 6)
    {
      code.bytes.high = (tmp & 0x5f);    // save address and cut troggle bit
      tmp=0;
    }

    //delay
    TCNT0 = 1;
    while(1)
    {
      time=TCNT0;
      if(time > 0x21)
        break;
    }
  }
  code.bytes.low = tmp;

  return code.value;
}

#endif // (REMOTE_STD == 5)

//---------------------------------------------------------------------------------------

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产激情视频一区二区在线观看 | 在线视频综合导航| 国产精品香蕉一区二区三区| av资源网一区| 91在线你懂得| 91在线视频免费91| 色婷婷激情一区二区三区| 色婷婷综合久久久中文一区二区| 色综合久久66| 欧美日韩国产首页| 欧美美女bb生活片| 欧美va亚洲va| 国产网站一区二区| 国产精品色在线观看| 亚洲欧美日韩一区| 亚洲小少妇裸体bbw| 日韩高清不卡一区| 国内精品伊人久久久久av影院| 国产伦精一区二区三区| 国产精品一区二区无线| 成人性生交大合| 91视频免费看| 欧美精品v国产精品v日韩精品 | 日本怡春院一区二区| 免费观看一级欧美片| 国产大陆a不卡| 91片黄在线观看| 欧美日韩一区不卡| 亚洲精品在线观看网站| 国产精品入口麻豆原神| 亚洲乱码国产乱码精品精小说 | 国产精品毛片大码女人 | 色88888久久久久久影院野外| 欧美性猛交xxxx黑人交| 欧美一区二区三区免费视频| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 色综合咪咪久久| 欧美天天综合网| wwwwxxxxx欧美| 亚洲老妇xxxxxx| 美女视频黄久久| 成人性视频网站| 欧美日韩久久久| 蓝色福利精品导航| 国产成人自拍在线| 欧美日韩一区二区三区免费看 | 麻豆精品新av中文字幕| 成人h动漫精品一区二区| 欧美色区777第一页| 久久久www免费人成精品| 日韩伦理免费电影| 久久精品72免费观看| 色呦呦一区二区三区| 精品播放一区二区| 亚洲精品高清视频在线观看| 裸体歌舞表演一区二区| 91亚洲国产成人精品一区二三| 日韩欧美国产麻豆| 一区二区三区日本| 国产99久久久久| 91麻豆精品国产自产在线 | 亚洲天堂福利av| 九九热在线视频观看这里只有精品| 91麻豆国产自产在线观看| 日韩欧美一区二区在线视频| 亚洲天堂中文字幕| 国产不卡一区视频| 欧美一级在线观看| 一区二区三区中文字幕电影 | 久久久亚洲精品石原莉奈| 亚洲精品免费视频| 成人综合激情网| 精品国产三级电影在线观看| 五月天激情综合| 在线视频你懂得一区二区三区| 国产午夜精品一区二区| 蜜臀av性久久久久蜜臀aⅴ| 欧美在线不卡一区| 亚洲欧洲成人av每日更新| 国产激情一区二区三区| 精品播放一区二区| 久久不见久久见免费视频1| 国产精品不卡视频| 激情欧美一区二区| 日韩三级视频中文字幕| 婷婷开心激情综合| 欧美亚一区二区| 亚洲一区影音先锋| 91黄色免费版| 亚洲精品中文字幕乱码三区| 不卡一二三区首页| 国产精品污网站| 懂色中文一区二区在线播放| 久久久午夜精品| 国产成人综合自拍| 91黄色免费看| 色拍拍在线精品视频8848| 久久精品综合网| 国产一区二区三区美女| 日韩精品在线一区| 麻豆精品新av中文字幕| 精品动漫一区二区三区在线观看| 日本欧美一区二区三区| 5858s免费视频成人| 免费观看久久久4p| 欧美mv和日韩mv的网站| 国产精品一色哟哟哟| 久久亚洲精品小早川怜子| 国内精品第一页| 日本一区二区三区四区| 大胆欧美人体老妇| 亚洲精品久久嫩草网站秘色| 在线免费观看日本欧美| 午夜精品一区二区三区电影天堂| 欧美乱妇15p| 蜜臀av性久久久久蜜臀av麻豆| 精品久久久久久久久久久久久久久 | 天天综合日日夜夜精品| 7777精品伊人久久久大香线蕉 | 久久精品免费在线观看| 成人午夜在线播放| 亚洲黄网站在线观看| 欧美亚洲禁片免费| 免费高清在线视频一区·| 久久久久9999亚洲精品| av色综合久久天堂av综合| 亚洲综合av网| 日韩精品一区在线| 成人免费视频国产在线观看| 夜夜操天天操亚洲| 这里只有精品免费| 国产成人精品www牛牛影视| 亚洲三级视频在线观看| 欧美精品一二三| 国产大陆a不卡| 亚洲综合在线免费观看| 欧美一区二区视频在线观看| 国产盗摄女厕一区二区三区 | 一本大道久久a久久综合婷婷| 亚洲成人激情社区| 久久婷婷国产综合精品青草| 色哟哟亚洲精品| 六月丁香婷婷久久| 亚洲免费色视频| 日韩精品自拍偷拍| eeuss鲁一区二区三区| 亚洲gay无套男同| 国产嫩草影院久久久久| 欧美二区三区91| 成人精品一区二区三区中文字幕 | thepron国产精品| 五月天激情小说综合| 国产精品欧美极品| 日韩欧美一卡二卡| 99re在线精品| 精品亚洲国产成人av制服丝袜| 中文字幕日韩av资源站| 精品蜜桃在线看| 在线视频国内自拍亚洲视频| 国产麻豆精品一区二区| 亚洲一二三级电影| 国产日韩在线不卡| 制服.丝袜.亚洲.中文.综合| 99精品视频一区二区三区| 狠狠色丁香婷综合久久| 午夜影院久久久| 亚洲同性gay激情无套| 久久蜜臀精品av| 欧美一区中文字幕| 在线区一区二视频| www.性欧美| 国产精品白丝jk黑袜喷水| 午夜精品一区二区三区免费视频 | 久久99精品久久久久久动态图| 日韩理论电影院| 久久九九全国免费| 日韩欧美电影一二三| 欧美日韩一区二区三区在线| 91在线你懂得| 成人在线视频一区| 国内精品视频666| 美女在线观看视频一区二区| 亚洲图片欧美一区| 亚洲嫩草精品久久| 亚洲精品第1页| 国产日韩欧美精品一区| 欧美一级午夜免费电影| 99精品欧美一区二区三区小说| 午夜精品视频在线观看| 亚洲乱码一区二区三区在线观看| 久久综合色综合88| 99久久精品国产精品久久| 奇米精品一区二区三区在线观看| 精品sm在线观看| 欧美猛男gaygay网站| 99久久精品国产观看| 亚洲一区二区黄色| 精品国产麻豆免费人成网站| 国产成人精品免费在线| 亚洲欧美色图小说|