资源简介

ATSHA204开发源码,以及说明文档,供大家学习参考。

资源截图

代码片段和文件信息

/* ----------------------------------------------------------------------------
 *         ATMEL Microcontroller Software Support
 * ----------------------------------------------------------------------------
 * Copyright (c) 2008 Atmel Corporation
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms with or without
 * modification are permitted provided that the following conditions are met:
 *
 * - Redistributions of source code must retain the above copyright notice
 * this list of conditions and the disclaimer below.
 *
 * Atmel‘s name may not be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL “AS IS“ AND ANY EXPRESS OR
 * IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
 * DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
 * ----------------------------------------------------------------------------
 */

/** \file
 *  \brief  Example of an Application That Uses the SHA204 Library
 *  \author Atmel Crypto Products
 *  \date   November 9 2010
 *  \todo   Add time measuring function to use it for measuring the
 *          time between sending a command to the SHA204 device and
 *          receiving a response.
*/


#include                     // declarations for I/O functions
#include                    // declarations for string functions

#include                 // declarations for debug functions
#include            // declarations for assert functions
#include             // declarations for trace functions
#include   // declarations for timer functions
#include   // declarations of function return codes
#include    // definitions and declarations for the Command module


/** \brief This function evaluates a function return code
 *         and puts the device to sleep if the return code
 *         indicates that the device is awake.
 * \param[in] ret_code return code of the last call to a SHA204 library function
 */
void evaluate_ret_code(uint8_t ret_code)
{
if ((ret_code == SHA204_PARSE_ERROR)
|| (ret_code == SHA204_CMD_FAIL)
|| (ret_code == SHA204_RX_FAIL))
// We got some kind of response. Return codes of
// SHA20

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-02-26 14:56  SHA204LibraryDistributable\doc\
     文件       76631  2009-10-15 16:40  SHA204LibraryDistributable\doc\LicenseAgreement.rtf
     文件      506895  2011-02-26 14:55  SHA204LibraryDistributable\doc\SHA204Library.pdf
     文件      585251  2011-02-26 14:56  SHA204LibraryDistributable\doc\SHA204LibraryExampleAT90USB1287.pdf
     文件      553639  2011-02-26 14:56  SHA204LibraryDistributable\doc\SHA204LibraryExampleAT91SAM9G45.pdf
     目录           0  2011-02-26 15:03  SHA204LibraryDistributable\projects\
     文件        4707  2011-02-07 14:52  SHA204LibraryDistributable\projects\sha204_gpio.aps
     文件         278  2011-02-07 14:53  SHA204LibraryDistributable\projects\sha204_gpio.aws
     文件        3920  2011-02-07 14:35  SHA204LibraryDistributable\projects\sha204_i2c.aps
     文件         217  2011-02-07 14:42  SHA204LibraryDistributable\projects\sha204_i2c.aws
     目录           0  2011-02-26 15:06  SHA204LibraryDistributable\projects\SHA204_SAM9G45\
     文件      144411  2011-02-08 20:43  SHA204LibraryDistributable\projects\SHA204_SAM9G45\.cproject
     文件        2676  2011-02-08 20:43  SHA204LibraryDistributable\projects\SHA204_SAM9G45\.project
     目录           0  2011-02-08 17:00  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\
     目录           0  2011-02-08 17:00  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\
     目录           0  2011-02-08 17:00  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\at91sam9m10\
     文件      587343  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\at91sam9m10\AT91SAM9M10.h
     文件        4395  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\at91sam9m10\chip.h
     文件        1715  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\at91sam9m10\chip.mak
     文件        2868  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\at91sam9m10\ddram.lds
     文件        2165  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\at91sam9m10\ddram.sct
     文件        2998  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\at91sam9m10\sram.lds
     文件        2263  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\at91sam9m10\sram.sct
     文件       30525  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\board.h
     文件        6604  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\board_cstartup.S
     文件        7337  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\board_lowlevel.c
     文件       36676  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\board_memories.c
     文件        2861  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\boards\at91sam9m10-ek\board_memories.h
     目录           0  2011-02-08 17:00  SHA204LibraryDistributable\projects\SHA204_SAM9G45\drivers\
     目录           0  2011-02-08 17:00  SHA204LibraryDistributable\projects\SHA204_SAM9G45\drivers\async\
     文件        2366  2010-11-08 18:21  SHA204LibraryDistributable\projects\SHA204_SAM9G45\drivers\async\async.c
............此处省略70个文件信息

评论

共有 条评论