资源简介
使用IAR环境打开,工程路径:
work1-读取温湿度并发送数据\project\iar\simple\contiki_cc2530.eww

代码片段和文件信息
/*
* Copyright (c) 2008 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms with or without
* modification are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ‘‘AS IS‘‘ AND
* ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL
* DAMAGES (INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT
* LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*
*/
/**
* \file
* AES encryption functions.
* \author
* Adam Dunkels
*/
#include “contiki.h“
#include “dev/cc2420.h“
#include “dev/cc2420-aes.h“
#include “dev/spi.h“
#define KEYLEN 16
#define MAX_DATALEN 16
#define CC2420_WRITE_RAM_REV(bufferadrcount) \
do { \
uint8_t i; \
CC2420_SPI_ENABLE(); \
SPI_WRITE_FAST(0x80 | (adr & 0x7f)); \
SPI_WRITE_FAST((adr >> 1) & 0xc0); \
for(i = (count); i > 0; i--) { \
SPI_WRITE_FAST(((uint8_t*)(buffer))[i - 1]); \
} \
SPI_WAITFORTx_ENDED(); \
CC2420_SPI_DISABLE(); \
} while(0)
#define MIN(ab) ((a) < (b)? (a): (b))
/*---------------------------------------------------------------------------*/
void
cc2420_aes_set_key(const uint8_t *key int index)
{
switch(index) {
case 0:
CC2420_WRITE_RAM_REV(key CC2420RAM_KEY0 KEYLEN);
break;
case 1:
CC2420_WRITE_RAM_REV(key CC2420RAM_KEY1 KEYLEN);
break;
}
}
/*--------------------------------------------------
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 174 2016-02-02 13:33 work1-读取温湿度并发送数据\.hg_archival.txt
文件 9896 2016-02-02 13:33 work1-读取温湿度并发送数据\core\contiki-default-conf.h
文件 1907 2016-02-02 13:33 work1-读取温湿度并发送数据\core\contiki-lib.h
文件 2196 2016-02-02 13:33 work1-读取温湿度并发送数据\core\contiki-net.h
文件 1890 2016-02-02 13:33 work1-读取温湿度并发送数据\core\contiki-version.h
文件 2121 2016-02-02 13:33 work1-读取温湿度并发送数据\core\contiki.h
文件 2022 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\battery-sensor.h
文件 1843 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\button-sensor.h.old
文件 4093 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\cc2420-aes.c
文件 3016 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\cc2420-aes.h
文件 22594 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\cc2420.c
文件 8912 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\cc2420.h
文件 4427 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\cc2420_const.h
文件 22246 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\cc2520.c
文件 9302 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\cc2520.h
文件 8740 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\cc2520_const.h
文件 6375 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\ds2411.c
文件 1780 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\ds2411.h
文件 3254 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\eeprom.h
文件 3863 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\leds.c
文件 2864 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\leds.h
文件 1794 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\nullradio.c
文件 142 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\nullradio.h
文件 1950 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\radio-sensor.h
文件 3132 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\radio.h
文件 1815 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\rom.h
文件 4391 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\serial-line.c
文件 2813 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\serial-line.h
文件 3157 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\sht11-sensor.c
文件 2108 2016-02-02 13:33 work1-读取温湿度并发送数据\core\dev\sht11-sensor.h
............此处省略958个文件信息
相关资源
- cc2530寄存器手册
- IEEE 802.15.4的CC2530无线数据收发设计
- IEEE 802.15.4的CC2530无线数据收发设计
- ZStack-CC2530-2.5.1a
- 基于ZigBee温室环境监测系统电路设计
- 智能分户供暖监控系统的无线温控器
- CC2530的分布式无线数据采集系统设计
- STM32+DHT11+OLED+RTC+MQ2+NRF24L01+串口12
- proteus仿真、keil4、DHT11、LCD1602
- DHT11 21 22库文件
- 基于zigbee温湿度传输及控制带wifiAPP查
- stm32之传感器DHT11.zip
- DS18B20温度+DHT11湿度+LCD1602
- DHT11温湿度传感器项目代码.rar
- STM32F103C8T6+DHT11+SGP30+CH340+ADC
- STM32F103C8T6+DHT11+OLED
- 基于STM32的DHT11的温湿度采集GSM报警系
- CC2530 BasicRFTI源文件
- STM32温湿度传感器DHT11代码,通过串口
- 基于proteus 的 STM32 采集DHT11 仿真 +
- CC2530中文数据手册完全版.pdf
- DTH11温湿度显示在IIC_OLED上,好用,自
- CC2530 (zigbee) 中文数据手册完全版
- STM32F103C8T6-DHT11温湿度传感器.rar
- 基于FPGA的DHT11的温湿度数据采集
- SampleApp_dht11.zip
- STM32-UCOSIII实战-----RTC+DHT11+按键+LCD显示
- 基于STC89C52的温湿度检测
- zigbee基于cc2530指导
- DHT11温湿度传感器例程
评论
共有 条评论