⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 非常全的nrf2401设计资料
💻 C
字号:
/* Copyright (c) 2008 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is confidential property of Nordic 
 * Semiconductor. The use, copying, transfer or disclosure of such information 
 * is prohibited except by express written agreement with Nordic Semiconductor.
 *
 * $LastChangedRevision:$
 */

/** @file
 * The nRF24LE1 example application main file
 *
 * @author Rune Brandsegg
 * @author Ivar C. OEsthus (added AES encr.)
 */
 
#include <Nordic\reg24le1.h>
#include "hal_nrf.h"
#include "radio.h"
#include "application.h"
#include "system.h"
#include "lib_crypt.h"

static xdata uint8_t AES_Key[16]  	 = {0xcc,0x77,0x44,0x18,0x87,0x56,0xb3,0x7d,0x99,0x10,0xc7,0xcc,0x13,0x14,0x15,0x16};
static xdata uint8_t AES_Counter[16] = {0xfa,0xff,0xff,0xff,0xff,0xcc,0xcc,0x00,0x20,0xff,0xff,0xff,0xff,0x22,0x02,0x01};

void main(void) 
{ 
  mcu_init();
  lib_crypt_init(AES_Key,AES_Counter);  // Initialize the encryption                                            
  
  EA = 1;                               // Global interrupt enable
  boot_mess();

  if(!B0)                               // Pressed B0 during "boot":
  {                                     // Enter PRX mode (Receiver)        
    radio_init(RECEIVER);
    receiver_mode();                  
  }  
  else                                  // Released B0 during "boot":
  {                                     // Enter PTX mode (Transmitter)
    radio_init(TRANSMITTER);
    transmitter_mode();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -