MAX32665 SDK Documentation  0.2
Software Development Kit Overview and API Documentation
crc.h
1 
6 /* ****************************************************************************
7  * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a
10  * copy of this software and associated documentation files (the "Software"),
11  * to deal in the Software without restriction, including without limitation
12  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13  * and/or sell copies of the Software, and to permit persons to whom the
14  * Software is furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
23  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  *
27  * Except as contained in this notice, the name of Maxim Integrated
28  * Products, Inc. shall not be used except as stated in the Maxim Integrated
29  * Products, Inc. Branding Policy.
30  *
31  * The mere transfer of this software does not imply any licenses
32  * of trade secrets, proprietary technology, copyrights, patents,
33  * trademarks, maskwork rights, or any other form of intellectual
34  * property whatsoever. Maxim Integrated Products, Inc. retains all
35  * ownership rights.
36  *
37  * $Date: 2018-11-08 15:08:58 -0600 (Thu, 08 Nov 2018) $
38  * $Revision: 39056 $
39  *
40  *************************************************************************** */
41 
42 #ifndef _CRC_H_
43 #define _CRC_H_
44 
45 #include <stdint.h>
46 #include "tpu_regs.h"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
58 /* ****** MACROS ****** */
59 // CRC Polynomials
60 #define TPU_CRC32_ETHERNET 0xEDB88320
61 #define TPU_CRC_CCITT 0x00008408
62 #define TPU_CRC16 0x0000A001
63 #define TPU_USBDATA 0x80050000
64 #define TPU_PARITY 0x00000001
65 
66 /***************************************************************************************************************
67  DATA STRUCTURES FOR CRYPTO INITIALIZATION
68 ***************************************************************************************************************/
69 
70 /***************************************************************************************************************
71  DRIVER EXPOSED API's
72 ***************************************************************************************************************/
76 void TPU_CRC_Reset(void);
77 
81 void TPU_CRC_Shutdown(void);
82 
87 int TPU_CRC_Config(void);
88 
98 int TPU_CRC(const uint8_t *src, uint32_t len, uint32_t poly, uint32_t *crc);
99 
104 int TPU_Ham_Config(void);
105 
114 int TPU_Ham(const uint8_t *src, uint32_t len, uint32_t *ecc);
115 
116 #ifdef __cplusplus
117 }
118 #endif
119 
121 #endif /* _CRC_H_ */
int TPU_Ham(const uint8_t *src, uint32_t len, uint32_t *ecc)
Test the CRC process.
int TPU_CRC_Config(void)
Configure crypto CRC operation.
void TPU_CRC_Shutdown(void)
Shutdown crypto controller.
int TPU_CRC(const uint8_t *src, uint32_t len, uint32_t poly, uint32_t *crc)
Test the CRC process.
void TPU_CRC_Reset(void)
Reset the crypto accelerator.
int TPU_Ham_Config(void)
Configure crypto HAM operation.