MAX32655 Peripheral Driver API
Peripheral Driver API for the MAX32655
trng.h
1 
6 /* ****************************************************************************
7  * Copyright (C) 2018 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$
38  * $Revision$
39  *
40  *************************************************************************** */
41 
42 #ifndef _TRNG_H_
43 #define _TRNG_H_
44 
45 /***** Includes *****/
46 #include "trng_regs.h"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
58 /* IN ADDITION TO THIS HEADER, FCL WILL BE SUPPORTED AND PROVIDED IN BINARY FORM */
59 
60 /***** Function Prototypes *****/
61 typedef void (*mxc_trng_complete_t) (void* req, int result);
62 
63 /* ************************************************************************* */
64 /* Global Control/Configuration functions */
65 /* ************************************************************************* */
66 
72 int MXC_TRNG_Init ();
73 
79 void MXC_TRNG_IntEnable ();
80 
86 int MXC_TRNG_Shutdown ();
87 
92 void MXC_TRNG_Handler (void);
93 
94 /* ************************************************************************* */
95 /* True Random Number Generator (TRNG) functions */
96 /* ************************************************************************* */
97 
103 int MXC_TRNG_RandomInt (void);
104 
113 int MXC_TRNG_Random (uint8_t* data, uint32_t len);
114 
124 void MXC_TRNG_RandomAsync (uint8_t* data, uint32_t len, mxc_trng_complete_t callback);
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
131 #endif /* _TRNG_H_ */
int MXC_TRNG_Init()
Enable portions of the TRNG.
void MXC_TRNG_Handler(void)
This function should be called from the TRNG ISR Handler when using Async functions.
void MXC_TRNG_IntEnable()
Enable TRNG Interrupts.
void MXC_TRNG_RandomAsync(uint8_t *data, uint32_t len, mxc_trng_complete_t callback)
Get a random number of length len, do not block while generating data.
int MXC_TRNG_RandomInt(void)
Get a random number.
int MXC_TRNG_Random(uint8_t *data, uint32_t len)
Get a random number of length len.
int MXC_TRNG_Shutdown()
Disable and reset portions of the TRNG.