资源简介
使用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个文件信息
相关资源
- 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温湿度传感器例程
- 基于cc2530的温湿度检测点对点无线传
- 基于CC2530的温湿度数据采集系统
- 数字温湿度传感器DHT11详解及例程利用
- 基于cc2530的zigbee的无线led灯控制程序
- TI公司推出的CCS3.3开发环境中文入门指
- STM32DHT11程序
- 基于Zigbee的室内自定位
- 里程表 STM32+霍尔传感器+EEPROM+LCD+DHT
- stm32f103+dht11温湿度传感器例程
- DHT11.rar
- 完整工程串口12、DHT11、BH1750、mh-z14
- 温湿度传感器DHT11资料+程序
- Zigbee CC2530 振动传感器开发源码 项目
- Zigbee CC2530 酒精传感器开发源码
- Zigbee CC2530 火焰传感器开发源码
- 乐鑫Esp8266驱动 ds18b20、dht11 温湿度传
- STM32F103C8T6按键调整参数断电保护,温
- CC2530+DHT11温湿度传感器+HC-SR04超声波传
评论
共有 条评论