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

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

?? rfcom.c

?? RF part of msp430f1612 + cc2420 receiver
?? C
字號:
/*******************************************************************************************************
 *                                                                                                     *
 *        **********                                                                                   *
 *       ************                                                                                  *
 *      ***        ***                                                                                 *
 *      ***   +++   ***                                                                                *
 *      ***   + +   ***                                                                                *
 *      ***   +                                   CHIPCON CC2420DBK EXAMPLES                           *
 *      ***   + +   ***                  RF Blinking LED Demo - Application Note 033                   *
 *      ***   +++   ***                                                                                *
 *      ***        ***                                                                                 *
 *       ************                                                                                  *
 *        **********                                                                                   *
 *                                                                                                     *
 *******************************************************************************************************
 * This program demonstrates the use of the CC2420DB library, including the basic RF library. The      *
 * packet protocol being used is a small subset of the IEEE 802.15.4 standard. It uses an 802.15.4 MAC *
 * compatible frame format, but does not implement any other MAC functions/mechanisms (e.g. CSMA-CA).  *
 * The basic RF library can thus not be used to communicate with compliant 802.15.4 networks.          *
 *                                                                                                     *
 * A MSP430F1611 running this program will establish a point-to-point RF link on channel 26 with       *
 * a CC2420DB using the following node addresses:                                                      *
 * - PAN ID: 0x2420 (both nodes)                                                                       *
 * - Short address:                                                                                    *
 *		0x5678                                                                  	       *
 * Destination address: 0x1234                                                                         *
 *                                                                                                     *
 * This application is intended to work with the blinking LED application on a CC2420DB.               *
 * The pot-meter on the CC2420DB can be used to change the blinking frequency of the diode on          *
 * the MSP-FET430P140 board.                                                                           *
 * Please note that there is no so-called (PAN) coordinator.                                           *
 *                                                                                                     *
 * INSTRUCTIONS:                                                                                       *
 * Outgoing data packets containing a 10-byte payload will be transmitted each 50th cycle of the       *
 * main program loop. Byte 0 contains the LED dimmer value to the CC2420DBB, byte 1 contains the       *
 * status byte from CC2420 and bytes 2/3 the number of packets received from the CC2420DB.             *
 * This application uses the value of byte 0 FROM the CC2420DB to regulate the blinking frequency of   *
 * the LED on the MSP-FET430P140.                                                                      *                                                                                                     *
 * This example is based on the blinking LED example for the CC2420DB board.                           *
 *******************************************************************************************************
 * Compiler: MSP430 IAR C/C++ compiler  or msp430-gcc GNU C compiler                                   *
 * Target platform: MSP-FET430P140 (can easily be ported to other platforms)                           *
 *******************************************************************************************************
 * Revision history:                                                                                   *
 *                                                                                                     *
 *******************************************************************************************************/


//-------------------------------------------------------------------------------------------------------
// Include section
//-------------------------------------------------------------------------------------------------------
#include "rfcom.h"

//-------------------------------------------------------------------------------------------------------
// Defintions used locally in this file
//-------------------------------------------------------------------------------------------------------
#define PAYLOAD_SIZE	   10
#define RF_CHANNEL	   26
#define NUMBER_OF_BYTES    8         // Number of bytes in packet

static BYTE bytesCount = 0;        // Bytes Counter

//-------------------------------------------------------------------------------------------------------
// Functions prototypes section
//-------------------------------------------------------------------------------------------------------
void ledFlash (UINT16, UINT16);


//-------------------------------------------------------------------------------------------------------
// Basic RF transmission and reception structures
//-------------------------------------------------------------------------------------------------------
BASIC_RF_RX_INFO rfRxInfo;
BASIC_RF_TX_INFO rfTxInfo;
//BYTE pTxBuffer[BASIC_RF_MAX_PAYLOAD_SIZE];
//BYTE pRxBuffer[BASIC_RF_MAX_PAYLOAD_SIZE];
BYTE pTxBuffer[PAYLOAD_SIZE];
BYTE pRxBuffer[PAYLOAD_SIZE];




//-------------------------------------------------------------------------------------------------------
//  BASIC_RF_RX_INFO* basicRfReceivePacket(BASIC_RF_RX_INFO *pRRI)
//
//  DESCRIPTION:
//      This function is a part of the basic RF library, but must be declared by the application. Once
//		the application has turned on the receiver, using basicRfReceiveOn(), all incoming packets will
//		be received by the FIFOP interrupt service routine. When finished, the ISR will call the
//		basicRfReceivePacket() function. Please note that this function must return quickly, since the
//		next received packet will overwrite the active BASIC_RF_RX_INFO structure (pointed to by pRRI).
//
//  ARGUMENTS:
//		BASIC_RF_RX_INFO *pRRI
//	      	The reception structure, which contains all relevant info about the received packet.
//
//  RETURN VALUE:
//     BASIC_RF_RX_INFO*
//			The pointer to the next BASIC_RF_RX_INFO structure to be used by the FIFOP ISR. If there is
//			only one buffer, then return pRRI.
//-------------------------------------------------------------------------------------------------------
BASIC_RF_RX_INFO* basicRfReceivePacket(BASIC_RF_RX_INFO *pRRI)
{

//    Continue using the (one and only) reception structure
    return pRRI;
} // basicRfReceivePacket



//--------------------------------------------------------------------------------------------------------
//                                   MAIN 
//--------------------------------------------------------------------------------------------------------
int main(void)
{

// Initalize basic clock module
    WDTCTL   = WDTPW + WDTHOLD;                       // Stop WDT
    BCSCTL1 &= ~XT2OFF;                               // XT2= HF XTAL

    do
    {
    IFG1 &= ~OFIFG;                                   // Clear OSCFault flag
    for (int i = 0xFF; i > 0; i--);                   // Time for flag to set
    }
    while ((IFG1 & OFIFG));                           // OSCFault flag still set?

    BCSCTL2 |= SELM_2 + SELS + DIVM_0 + DIVS_0;       // MCLK = XT2 = 8MHz = 8MHz(safe); SMCLK = XT2/1 = 1MHz



// Initalize ports for communication with CC2420 and other peripheral units
    PORT_INIT();
    SPI_INIT();


        
// Wait for the user to select node address, and initialize for basic RF operation
    halWait(1000);
    basicRfInit(&rfRxInfo, RF_CHANNEL, 0x2420, 0x5678);

// Initalize common protocol parameters
    rfTxInfo.destAddr   = 0x1234;
    rfTxInfo.length     = PAYLOAD_SIZE;
    rfTxInfo.ackRequest = FALSE;
    rfTxInfo.pPayload   = pTxBuffer;

    rfRxInfo.pPayload   = pRxBuffer;

    basicRfReceiveOn();

//Initialize UART 115200 bod, 8bit, no parity, 2 stop bits.
    P3SEL  |= 0x30;
    ME1    |= UTXE0 + URXE0;
    UCTL0  |= CHAR + SPB;
    UTCTL0 |= SSEL1;
    UBR00   = 0x45;                             // 8MHz 115200
    UBR10   = 0x00;                             // 8MHz 115200
    UMCTL0  = 0x6B;                             // 8MHz 115200 modulation
    UCTL0  &= ~SWRST;       
    IE1    |= URXIE0;
  
    ENABLE_GLOBAL_INT();

    for (;;)
    {
/*      while (BUTTON_PRESSED)
      {

        for (int i=1; i<=10000; i++)
        {          
          pTxBuffer[0] = i;
          pTxBuffer[1] = 0x01;

          basicRfSendPacket(&rfTxInfo);
        

        for (int k=1; k<=50; k++)
          {
              halWait(5000);
          }
          
          TOGGLE_LED1();
        }      
        
      }
*/
       

        while (bytesCount == NUMBER_OF_BYTES)
        {
            bytesCount = 0;
            basicRfSendPacket(&rfTxInfo);
            TOGGLE_LED1();
        }
        
    } // for(;;)

} // main

//-------------------------------------------------------------------------------------------------------
//	void ledFlash(UINT16 cycles, UINT16 period)
//
//  DESCRIPTION:
//      Toggles the led 'cycles' times with a half-cycle duration of 'period' uSeconds.
//
//  ARGUMENTS:
//		UINT16 cycles
//	      	Number of times to toggle the LED
//      UINT16 period
//          Half-cycle period, i.e the time the LED is on respectively off.
//
//-------------------------------------------------------------------------------------------------------

void ledFlash(UINT16 cycles, UINT16 period) 
{
    for (int i=0; i < cycles; i++)
    {
        TOGGLE_LED1();
    	if (period > 0)
        {
    	    halWait(period);
        }
    }
    
}

//-------------------------------------------------------------------------------------------------------
//                                 INTERRUPT
//-------------------------------------------------------------------------------------------------------

#pragma vector=UART0RX_VECTOR
__interrupt void usart0_rx (void)
{
    pTxBuffer[bytesCount++] = RXBUF0; // 耥圜嚯

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人在线网站| 在线不卡免费av| 欧美在线三级电影| 久久综合国产精品| 亚洲精品中文在线观看| 欧美aⅴ一区二区三区视频| 91丨九色丨黑人外教| 欧美日韩你懂得| 国产亚洲短视频| 青草国产精品久久久久久| 成人av在线电影| 欧美日本一道本| 欧美午夜一区二区| 久久嫩草精品久久久精品| 亚洲免费在线看| 国产麻豆精品在线观看| 精品国产自在久精品国产| 亚洲男人天堂av| 国产高清无密码一区二区三区| 欧美丰满美乳xxx高潮www| 中文字幕一区二区三区不卡| 精品在线一区二区三区| 777a∨成人精品桃花网| 国产亚洲婷婷免费| 日韩精品国产欧美| 在线视频你懂得一区| 亚洲国产高清不卡| 成人午夜av电影| 久久色中文字幕| 日韩有码一区二区三区| 4438成人网| 亚洲成av人片在线观看无码| www.在线成人| 亚洲免费毛片网站| 成人不卡免费av| 国产性天天综合网| 粉嫩欧美一区二区三区高清影视| 91精品国产麻豆国产自产在线 | 日韩欧美中文字幕精品| 一区二区在线观看av| 91网站在线播放| 国产精品久久久久毛片软件| 国产一区二三区| 国产欧美视频在线观看| 国产精品自拍av| 久久综合五月天婷婷伊人| 亚洲欧美在线观看| 91福利精品第一导航| 亚洲女女做受ⅹxx高潮| 99国产一区二区三精品乱码| 亚洲综合色噜噜狠狠| 色婷婷激情久久| 一区二区在线观看免费 | 亚洲摸摸操操av| 91视频在线看| 亚洲欧美成aⅴ人在线观看 | 免费精品99久久国产综合精品| 欧美午夜一区二区三区| 国产精品欧美极品| 一本一道综合狠狠老| 亚洲一区中文在线| 欧美日韩国产大片| 日本午夜一本久久久综合| 精品久久久久久亚洲综合网 | 91精品婷婷国产综合久久竹菊| 亚洲国产精品天堂| 欧美在线你懂得| 韩国精品久久久| 日本一区二区三区电影| 国产精品白丝jk黑袜喷水| 亚洲精品写真福利| 日韩午夜在线观看| 成人一区二区视频| 免费xxxx性欧美18vr| 久久久美女毛片| 色综合久久久网| 久久99精品久久久久久| 中文字幕成人在线观看| 国产伦精品一区二区三区免费迷 | 一区二区三区高清不卡| 欧美丰满美乳xxx高潮www| 国产一区二区三区在线观看免费| 一区二区三区四区在线播放| 91精品国产色综合久久不卡电影| 国产精品中文字幕日韩精品 | 欧美激情中文不卡| 欧美日本韩国一区| 色综合久久中文综合久久牛| 日本中文一区二区三区| 中文字幕一区在线观看| 国产亚洲一二三区| 欧美日韩国产天堂| 成人av在线网| 精品一区二区三区免费| 欧美高清在线精品一区| 欧美日韩一区二区三区免费看| 国产在线精品一区二区夜色 | 欧美一区三区二区| 成人av在线影院| 亚洲国产精品麻豆| 国产精品五月天| 亚洲精品一区二区三区蜜桃下载 | 91国偷自产一区二区三区成为亚洲经典| 日本免费在线视频不卡一不卡二| 国产精品毛片大码女人| 久久久国产午夜精品| 欧美日本在线一区| 色综合久久久久综合99| 97se狠狠狠综合亚洲狠狠| 国产一区欧美二区| 天天操天天干天天综合网| 亚洲同性gay激情无套| 亚洲精品在线电影| 欧美大片免费久久精品三p| 国产成人精品影院| 麻豆高清免费国产一区| 天堂在线一区二区| 亚洲第一在线综合网站| 亚洲另类在线视频| 久久综合网色—综合色88| 欧美久久久久中文字幕| 欧美影院午夜播放| 日本高清成人免费播放| 丁香啪啪综合成人亚洲小说| 国产福利一区二区三区视频在线| 黄色日韩三级电影| 国产白丝网站精品污在线入口| 激情综合网最新| 久久99精品久久久久久国产越南| 国产一区二区在线看| 看电视剧不卡顿的网站| 日本午夜精品视频在线观看 | 精品在线免费视频| 国产精品一区二区免费不卡| 经典三级视频一区| 国产精品一区二区在线观看网站| 福利一区福利二区| 成人不卡免费av| 一本大道久久a久久精品综合| 欧美日精品一区视频| 欧美日韩卡一卡二| 日韩精品最新网址| 中文字幕av免费专区久久| 亚洲色欲色欲www| 亚洲福利一二三区| 精品一区二区免费视频| 国产精品88888| 波多野结衣欧美| 91麻豆精品久久久久蜜臀| 日韩一区二区三免费高清| 2020日本不卡一区二区视频| 久久久精品人体av艺术| 中文字幕在线观看不卡| 亚洲一区二区高清| 激情综合色综合久久综合| 99久久免费精品高清特色大片| 在线观看网站黄不卡| 久久综合成人精品亚洲另类欧美 | 亚洲一区欧美一区| 日韩精品福利网| 国产成人在线视频网站| 91麻豆国产福利精品| 欧美精品一区二区在线观看| 亚洲欧美一区二区在线观看| 亚洲高清免费在线| av一二三不卡影片| 日韩视频免费观看高清在线视频| 国产亚洲精久久久久久| 国产成人精品在线看| 欧美日韩精品一区二区天天拍小说| 国产成人综合在线观看| 北岛玲一区二区三区四区| 欧美午夜免费电影| 国产日韩欧美a| 亚洲成人777| a在线播放不卡| 久久影院午夜片一区| 首页国产丝袜综合| 欧美在线观看视频一区二区| 久久综合九色综合97婷婷女人 | 69久久夜色精品国产69蝌蚪网| 久久久久久久久伊人| 免费在线一区观看| 欧美日韩一卡二卡| 一区二区三区自拍| 色综合中文综合网| 国产精品视频麻豆| 精东粉嫩av免费一区二区三区| 欧美老肥妇做.爰bbww视频| 一区二区三区在线不卡| 99久久精品免费| 国产精品―色哟哟| 国产一区二区中文字幕| 精品美女被调教视频大全网站| 日本亚洲视频在线| 日韩限制级电影在线观看| 视频一区在线视频| 欧美精品在线视频| 亚洲国产精品麻豆| 欧美日韩国产片|