MAX32680 Peripheral Driver API
Peripheral Driver API for the MAX32680
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
trng.h
1
6/******************************************************************************
7 *
8 * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
9 * Analog Devices, Inc.),
10 * Copyright (C) 2023-2024 Analog Devices, Inc.
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 ******************************************************************************/
25
26#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_TRNG_H_
27#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_TRNG_H_
28
29/***** Includes *****/
30#include "trng_regs.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
42/* IN ADDITION TO THIS HEADER, FCL WILL BE SUPPORTED AND PROVIDED IN BINARY FORM */
43
44/***** Function Prototypes *****/
45typedef void (*mxc_trng_complete_t)(void *req, int result);
46
47/* ************************************************************************* */
48/* Global Control/Configuration functions */
49/* ************************************************************************* */
50
56int MXC_TRNG_Init(void);
57
63
69
76
82
83/* ************************************************************************* */
84/* True Random Number Generator (TRNG) functions */
85/* ************************************************************************* */
86
93
102int MXC_TRNG_Random(uint8_t *data, uint32_t len);
103
113void MXC_TRNG_RandomAsync(uint8_t *data, uint32_t len, mxc_trng_complete_t callback);
114
119
126
127#ifdef __cplusplus
128}
129#endif
132#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_TRNG_H_
void MXC_TRNG_Handler(void)
This function should be called from the TRNG ISR Handler when using Async functions.
int MXC_TRNG_Shutdown(void)
Disable and reset portions of the TRNG.
int MXC_TRNG_Init(void)
Enable portions of the TRNG.
int MXC_TRNG_HealthTest(void)
Perform health test of the TRNG entropy source.
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.
void MXC_TRNG_GenerateKey(void)
Generate an AES key and transfer to the AES block.
void MXC_TRNG_DisableInt(void)
Disable TRNG Interrupts.
int MXC_TRNG_Random(uint8_t *data, uint32_t len)
Get a random number of length len.
void MXC_TRNG_EnableInt(void)
Enable TRNG Interrupts.
int MXC_TRNG_RandomInt(void)
Get a random number.
Registers, Bit Masks and Bit Positions for the TRNG Peripheral Module.