Rahul Dahiya / Mbed OS STM32F7 Ethernet
Committer:
rahul_dahiya
Date:
Wed Jan 15 15:57:15 2020 +0530
Revision:
0:fb8047b156bb
STM32F7 LWIP

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rahul_dahiya 0:fb8047b156bb 1
rahul_dahiya 0:fb8047b156bb 2 /** \addtogroup hal */
rahul_dahiya 0:fb8047b156bb 3 /** @{*/
rahul_dahiya 0:fb8047b156bb 4 /* mbed Microcontroller Library
rahul_dahiya 0:fb8047b156bb 5 * Copyright (c) 2016 ARM Limited
rahul_dahiya 0:fb8047b156bb 6 *
rahul_dahiya 0:fb8047b156bb 7 * Licensed under the Apache License, Version 2.0 (the "License");
rahul_dahiya 0:fb8047b156bb 8 * you may not use this file except in compliance with the License.
rahul_dahiya 0:fb8047b156bb 9 * You may obtain a copy of the License at
rahul_dahiya 0:fb8047b156bb 10 *
rahul_dahiya 0:fb8047b156bb 11 * http://www.apache.org/licenses/LICENSE-2.0
rahul_dahiya 0:fb8047b156bb 12 *
rahul_dahiya 0:fb8047b156bb 13 * Unless required by applicable law or agreed to in writing, software
rahul_dahiya 0:fb8047b156bb 14 * distributed under the License is distributed on an "AS IS" BASIS,
rahul_dahiya 0:fb8047b156bb 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rahul_dahiya 0:fb8047b156bb 16 * See the License for the specific language governing permissions and
rahul_dahiya 0:fb8047b156bb 17 * limitations under the License.
rahul_dahiya 0:fb8047b156bb 18 */
rahul_dahiya 0:fb8047b156bb 19 #ifndef MBED_TRNG_API_H
rahul_dahiya 0:fb8047b156bb 20 #define MBED_TRNG_API_H
rahul_dahiya 0:fb8047b156bb 21
rahul_dahiya 0:fb8047b156bb 22 #include <stddef.h>
rahul_dahiya 0:fb8047b156bb 23 #include "device.h"
rahul_dahiya 0:fb8047b156bb 24
rahul_dahiya 0:fb8047b156bb 25 #if DEVICE_TRNG
rahul_dahiya 0:fb8047b156bb 26
rahul_dahiya 0:fb8047b156bb 27 /** TRNG HAL structure. trng_s is declared in the target's HAL
rahul_dahiya 0:fb8047b156bb 28 */
rahul_dahiya 0:fb8047b156bb 29 typedef struct trng_s trng_t;
rahul_dahiya 0:fb8047b156bb 30
rahul_dahiya 0:fb8047b156bb 31 #ifdef __cplusplus
rahul_dahiya 0:fb8047b156bb 32 extern "C" {
rahul_dahiya 0:fb8047b156bb 33 #endif
rahul_dahiya 0:fb8047b156bb 34
rahul_dahiya 0:fb8047b156bb 35 /**
rahul_dahiya 0:fb8047b156bb 36 * \defgroup hal_trng TRNG hal functions
rahul_dahiya 0:fb8047b156bb 37 * @{
rahul_dahiya 0:fb8047b156bb 38 */
rahul_dahiya 0:fb8047b156bb 39
rahul_dahiya 0:fb8047b156bb 40 /** Initialize the TRNG peripheral
rahul_dahiya 0:fb8047b156bb 41 *
rahul_dahiya 0:fb8047b156bb 42 * @param obj The TRNG object
rahul_dahiya 0:fb8047b156bb 43 */
rahul_dahiya 0:fb8047b156bb 44 void trng_init(trng_t *obj);
rahul_dahiya 0:fb8047b156bb 45
rahul_dahiya 0:fb8047b156bb 46 /** Deinitialize the TRNG peripheral
rahul_dahiya 0:fb8047b156bb 47 *
rahul_dahiya 0:fb8047b156bb 48 * @param obj The TRNG object
rahul_dahiya 0:fb8047b156bb 49 */
rahul_dahiya 0:fb8047b156bb 50 void trng_free(trng_t *obj);
rahul_dahiya 0:fb8047b156bb 51
rahul_dahiya 0:fb8047b156bb 52 /** Get random data from TRNG peripheral
rahul_dahiya 0:fb8047b156bb 53 *
rahul_dahiya 0:fb8047b156bb 54 * @param obj The TRNG object
rahul_dahiya 0:fb8047b156bb 55 * @param output The pointer to an output array
rahul_dahiya 0:fb8047b156bb 56 * @param length The size of output data, to avoid buffer overwrite
rahul_dahiya 0:fb8047b156bb 57 * @param output_length The length of generated data
rahul_dahiya 0:fb8047b156bb 58 * @return 0 success, -1 fail
rahul_dahiya 0:fb8047b156bb 59 */
rahul_dahiya 0:fb8047b156bb 60 int trng_get_bytes(trng_t *obj, uint8_t *output, size_t length, size_t *output_length);
rahul_dahiya 0:fb8047b156bb 61
rahul_dahiya 0:fb8047b156bb 62 /**@}*/
rahul_dahiya 0:fb8047b156bb 63
rahul_dahiya 0:fb8047b156bb 64 #ifdef __cplusplus
rahul_dahiya 0:fb8047b156bb 65 }
rahul_dahiya 0:fb8047b156bb 66 #endif
rahul_dahiya 0:fb8047b156bb 67
rahul_dahiya 0:fb8047b156bb 68 #endif
rahul_dahiya 0:fb8047b156bb 69
rahul_dahiya 0:fb8047b156bb 70 #endif
rahul_dahiya 0:fb8047b156bb 71
rahul_dahiya 0:fb8047b156bb 72 /** @}*/