]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sha.h
Add SAMA5D2 Xplained IAR demo.
[freertos] / FreeRTOS / Demo / CORTEX_A5_SAMA5D2x_Xplained_IAR / AtmelFiles / drivers / peripherals / sha.h
diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sha.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sha.h
new file mode 100644 (file)
index 0000000..184689a
--- /dev/null
@@ -0,0 +1,98 @@
+/* ----------------------------------------------------------------------------\r
+ *         SAM Software Package License\r
+ * ----------------------------------------------------------------------------\r
+ * Copyright (c) 2015, Atmel Corporation\r
+ *\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions are met:\r
+ *\r
+ * - Redistributions of source code must retain the above copyright notice,\r
+ * this list of conditions and the disclaimer below.\r
+ *\r
+ * Atmel's name may not be used to endorse or promote products derived from\r
+ * this software without specific prior written permission.\r
+ *\r
+ * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR\r
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
+ * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,\r
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\r
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ * ----------------------------------------------------------------------------\r
+ */\r
+\r
+#ifndef _SHA_\r
+#define _SHA_\r
+\r
+/*------------------------------------------------------------------------------\r
+ *         Headers\r
+ *----------------------------------------------------------------------------*/\r
+\r
+#include "chip.h"\r
+\r
+/*----------------------------------------------------------------------------*/\r
+/*         Exported functions                                                 */\r
+/*----------------------------------------------------------------------------*/\r
+\r
+/**\r
+ * \brief Starts Manual hash algorithm process.\r
+ */\r
+extern void sha_start(void);\r
+\r
+/**\r
+ * \brief Resets the SHA. A software triggered hardware reset of the\r
+ * SHA interface is performed.\r
+ */\r
+extern void sha_soft_reset(void);\r
+\r
+/**\r
+ * \brief Indicates that the next block to process is the first one of\r
+ * a message.\r
+ */\r
+extern void sha_first_block(void);\r
+\r
+/**\r
+ * \brief Configures an SHA peripheral with the specified parameters.\r
+ *  \param mode  Desired value for the SHA mode register (see the datasheet).\r
+ */\r
+extern void sha_configure(uint32_t mode);\r
+\r
+/**\r
+ * \brief Enables the selected interrupts sources on a SHA peripheral.\r
+ * \param sources  Bitwise OR of selected interrupt sources.\r
+ */\r
+extern void sha_enable_it(uint32_t sources);\r
+\r
+/**\r
+ * \brief Disables the selected interrupts sources on a SHA peripheral.\r
+ * \param sources  Bitwise OR of selected interrupt sources.\r
+ */\r
+extern void sha_disable_it(uint32_t sources);\r
+\r
+/**\r
+ * \brief Get the current status register of the given SHA peripheral.\r
+ * \return  SHA status register.\r
+ */\r
+extern uint32_t sha_get_status(void);\r
+\r
+/**\r
+ * \brief Set the 32-bit Input Data registers allow to load the data block used for hash processing.\r
+ * \param data Pointer data block.\r
+ * \param len 512/1024-bits block size\r
+ */\r
+extern void sha_set_input(uint32_t * data, uint8_t len);\r
+\r
+/**\r
+ * \brief Getread the resulting message digest and to write the second part of the message block when the\r
+* SHA algorithm is SHA-384 or SHA-512.\r
+ * \param data pointer to the word that has been encrypted/decrypted..\r
+ */\r
+extern void sha_get_output(uint32_t * data);\r
+\r
+#endif                         /* #ifndef _SHA_ */\r