mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Wed Feb 20 22:31:08 2019 +0000
Revision:
189:f392fc9709a3
Parent:
149:156823d33999
mbed library release version 165

Who changed what in which revision?

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