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