Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mbed-os-example-blinky-gr-lychee GR-Boads_Camera_sample GR-Boards_Audio_Recoder GR-Boads_Camera_DisplayApp ... more
targets/TARGET_RENESAS/TARGET_RZA1XX/trng_api.c@0:f782d9c66c49, 2018-02-02 (annotated)
- Committer:
- dkato
- Date:
- Fri Feb 02 05:42:23 2018 +0000
- Revision:
- 0:f782d9c66c49
mbed-os for GR-LYCHEE
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dkato | 0:f782d9c66c49 | 1 | /* mbed Microcontroller Library |
dkato | 0:f782d9c66c49 | 2 | * Copyright (c) 2006-2017 ARM Limited |
dkato | 0:f782d9c66c49 | 3 | * |
dkato | 0:f782d9c66c49 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
dkato | 0:f782d9c66c49 | 5 | * you may not use this file except in compliance with the License. |
dkato | 0:f782d9c66c49 | 6 | * You may obtain a copy of the License at |
dkato | 0:f782d9c66c49 | 7 | * |
dkato | 0:f782d9c66c49 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
dkato | 0:f782d9c66c49 | 9 | * |
dkato | 0:f782d9c66c49 | 10 | * Unless required by applicable law or agreed to in writing, software |
dkato | 0:f782d9c66c49 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
dkato | 0:f782d9c66c49 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
dkato | 0:f782d9c66c49 | 13 | * See the License for the specific language governing permissions and |
dkato | 0:f782d9c66c49 | 14 | * limitations under the License. |
dkato | 0:f782d9c66c49 | 15 | */ |
dkato | 0:f782d9c66c49 | 16 | |
dkato | 0:f782d9c66c49 | 17 | #if defined(DEVICE_TRNG) |
dkato | 0:f782d9c66c49 | 18 | #include "trng_api.h" |
dkato | 0:f782d9c66c49 | 19 | |
dkato | 0:f782d9c66c49 | 20 | #if defined(TARGET_GR_LYCHEE) |
dkato | 0:f782d9c66c49 | 21 | |
dkato | 0:f782d9c66c49 | 22 | extern void trng_init_esp32(void); |
dkato | 0:f782d9c66c49 | 23 | extern void trng_free_esp32(void); |
dkato | 0:f782d9c66c49 | 24 | extern int trng_get_bytes_esp32(uint8_t *output, size_t length, size_t *output_length); |
dkato | 0:f782d9c66c49 | 25 | |
dkato | 0:f782d9c66c49 | 26 | void trng_init(trng_t *obj) { |
dkato | 0:f782d9c66c49 | 27 | trng_init_esp32(); |
dkato | 0:f782d9c66c49 | 28 | } |
dkato | 0:f782d9c66c49 | 29 | |
dkato | 0:f782d9c66c49 | 30 | void trng_free(trng_t *obj) { |
dkato | 0:f782d9c66c49 | 31 | trng_free_esp32(); |
dkato | 0:f782d9c66c49 | 32 | } |
dkato | 0:f782d9c66c49 | 33 | |
dkato | 0:f782d9c66c49 | 34 | int trng_get_bytes(trng_t *obj, uint8_t *output, size_t length, size_t *output_length) { |
dkato | 0:f782d9c66c49 | 35 | return trng_get_bytes_esp32(output, length, output_length); |
dkato | 0:f782d9c66c49 | 36 | } |
dkato | 0:f782d9c66c49 | 37 | #else |
dkato | 0:f782d9c66c49 | 38 | #error "There is no initialization processing." |
dkato | 0:f782d9c66c49 | 39 | #endif |
dkato | 0:f782d9c66c49 | 40 | #endif |