MAX32672 Peripheral Driver API
Peripheral Driver API for the MAX32672
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
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_MAX32672_TRNG_H_
27#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32672_TRNG_H_
28
29/***** Includes *****/
30#include "trng_regs.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
42/***** Function Prototypes *****/
43typedef void (*mxc_trng_complete_t)(void *req, int result);
44
45/* ************************************************************************* */
46/* Global Control/Configuration functions */
47/* ************************************************************************* */
48
54int MXC_TRNG_Init(void);
55
61
67
74
80
81/* ************************************************************************* */
82/* True Random Number Generator (TRNG) functions */
83/* ************************************************************************* */
84
91
100int MXC_TRNG_Random(uint8_t *data, uint32_t len);
101
111void MXC_TRNG_RandomAsync(uint8_t *data, uint32_t len, mxc_trng_complete_t callback);
112
119
120#ifdef __cplusplus
121}
122#endif
125#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32672_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_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.