![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K82F/drivers/fsl_trng.h@3:f3764f852aa8, 2018-10-11 (annotated)
- Committer:
- kadonotakashi
- Date:
- Thu Oct 11 02:27:46 2018 +0000
- Revision:
- 3:f3764f852aa8
- Parent:
- 0:8fdf9a60065b
Nucreo 446 + SSD1331 test version;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kadonotakashi | 0:8fdf9a60065b | 1 | /* |
kadonotakashi | 0:8fdf9a60065b | 2 | * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. |
kadonotakashi | 0:8fdf9a60065b | 3 | * All rights reserved. |
kadonotakashi | 0:8fdf9a60065b | 4 | * |
kadonotakashi | 0:8fdf9a60065b | 5 | * Redistribution and use in source and binary forms, with or without modification, |
kadonotakashi | 0:8fdf9a60065b | 6 | * are permitted provided that the following conditions are met: |
kadonotakashi | 0:8fdf9a60065b | 7 | * |
kadonotakashi | 0:8fdf9a60065b | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
kadonotakashi | 0:8fdf9a60065b | 9 | * of conditions and the following disclaimer. |
kadonotakashi | 0:8fdf9a60065b | 10 | * |
kadonotakashi | 0:8fdf9a60065b | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
kadonotakashi | 0:8fdf9a60065b | 12 | * list of conditions and the following disclaimer in the documentation and/or |
kadonotakashi | 0:8fdf9a60065b | 13 | * other materials provided with the distribution. |
kadonotakashi | 0:8fdf9a60065b | 14 | * |
kadonotakashi | 0:8fdf9a60065b | 15 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
kadonotakashi | 0:8fdf9a60065b | 16 | * contributors may be used to endorse or promote products derived from this |
kadonotakashi | 0:8fdf9a60065b | 17 | * software without specific prior written permission. |
kadonotakashi | 0:8fdf9a60065b | 18 | * |
kadonotakashi | 0:8fdf9a60065b | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
kadonotakashi | 0:8fdf9a60065b | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
kadonotakashi | 0:8fdf9a60065b | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
kadonotakashi | 0:8fdf9a60065b | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
kadonotakashi | 0:8fdf9a60065b | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
kadonotakashi | 0:8fdf9a60065b | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
kadonotakashi | 0:8fdf9a60065b | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
kadonotakashi | 0:8fdf9a60065b | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
kadonotakashi | 0:8fdf9a60065b | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
kadonotakashi | 0:8fdf9a60065b | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
kadonotakashi | 0:8fdf9a60065b | 29 | */ |
kadonotakashi | 0:8fdf9a60065b | 30 | #ifndef _FSL_TRNG_DRIVER_H_ |
kadonotakashi | 0:8fdf9a60065b | 31 | #define _FSL_TRNG_DRIVER_H_ |
kadonotakashi | 0:8fdf9a60065b | 32 | |
kadonotakashi | 0:8fdf9a60065b | 33 | #include "fsl_common.h" |
kadonotakashi | 0:8fdf9a60065b | 34 | |
kadonotakashi | 0:8fdf9a60065b | 35 | #if defined(FSL_FEATURE_SOC_TRNG_COUNT) && FSL_FEATURE_SOC_TRNG_COUNT |
kadonotakashi | 0:8fdf9a60065b | 36 | |
kadonotakashi | 0:8fdf9a60065b | 37 | /*! |
kadonotakashi | 0:8fdf9a60065b | 38 | * @addtogroup trng_driver |
kadonotakashi | 0:8fdf9a60065b | 39 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 40 | */ |
kadonotakashi | 0:8fdf9a60065b | 41 | |
kadonotakashi | 0:8fdf9a60065b | 42 | |
kadonotakashi | 0:8fdf9a60065b | 43 | /******************************************************************************* |
kadonotakashi | 0:8fdf9a60065b | 44 | * Definitions |
kadonotakashi | 0:8fdf9a60065b | 45 | *******************************************************************************/ |
kadonotakashi | 0:8fdf9a60065b | 46 | |
kadonotakashi | 0:8fdf9a60065b | 47 | /*! @name Driver version */ |
kadonotakashi | 0:8fdf9a60065b | 48 | /*@{*/ |
kadonotakashi | 0:8fdf9a60065b | 49 | /*! @brief TRNG driver version 2.0.1. |
kadonotakashi | 0:8fdf9a60065b | 50 | * |
kadonotakashi | 0:8fdf9a60065b | 51 | * Current version: 2.0.1 |
kadonotakashi | 0:8fdf9a60065b | 52 | * |
kadonotakashi | 0:8fdf9a60065b | 53 | * Change log: |
kadonotakashi | 0:8fdf9a60065b | 54 | * - Version 2.0.1 |
kadonotakashi | 0:8fdf9a60065b | 55 | * - add support for KL8x and KL28Z |
kadonotakashi | 0:8fdf9a60065b | 56 | * - update default OSCDIV for K81 to divide by 2 |
kadonotakashi | 0:8fdf9a60065b | 57 | */ |
kadonotakashi | 0:8fdf9a60065b | 58 | #define FSL_TRNG_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) |
kadonotakashi | 0:8fdf9a60065b | 59 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 60 | |
kadonotakashi | 0:8fdf9a60065b | 61 | /*! @brief TRNG sample mode. Used by trng_config_t. */ |
kadonotakashi | 0:8fdf9a60065b | 62 | typedef enum _trng_sample_mode |
kadonotakashi | 0:8fdf9a60065b | 63 | { |
kadonotakashi | 0:8fdf9a60065b | 64 | kTRNG_SampleModeVonNeumann = 0U, /*!< Use von Neumann data in both Entropy shifter and Statistical Checker. */ |
kadonotakashi | 0:8fdf9a60065b | 65 | kTRNG_SampleModeRaw = 1U, /*!< Use raw data into both Entropy shifter and Statistical Checker. */ |
kadonotakashi | 0:8fdf9a60065b | 66 | kTRNG_SampleModeVonNeumannRaw = |
kadonotakashi | 0:8fdf9a60065b | 67 | 2U /*!< Use von Neumann data in Entropy shifter. Use raw data into Statistical Checker. */ |
kadonotakashi | 0:8fdf9a60065b | 68 | } trng_sample_mode_t; |
kadonotakashi | 0:8fdf9a60065b | 69 | |
kadonotakashi | 0:8fdf9a60065b | 70 | /*! @brief TRNG clock mode. Used by trng_config_t. */ |
kadonotakashi | 0:8fdf9a60065b | 71 | typedef enum _trng_clock_mode |
kadonotakashi | 0:8fdf9a60065b | 72 | { |
kadonotakashi | 0:8fdf9a60065b | 73 | kTRNG_ClockModeRingOscillator = 0U, /*!< Ring oscillator is used to operate the TRNG (default). */ |
kadonotakashi | 0:8fdf9a60065b | 74 | kTRNG_ClockModeSystem = 1U /*!< System clock is used to operate the TRNG. This is for test use only, and |
kadonotakashi | 0:8fdf9a60065b | 75 | indeterminate results may occur. */ |
kadonotakashi | 0:8fdf9a60065b | 76 | } trng_clock_mode_t; |
kadonotakashi | 0:8fdf9a60065b | 77 | |
kadonotakashi | 0:8fdf9a60065b | 78 | /*! @brief TRNG ring oscillator divide. Used by trng_config_t. */ |
kadonotakashi | 0:8fdf9a60065b | 79 | typedef enum _trng_ring_osc_div |
kadonotakashi | 0:8fdf9a60065b | 80 | { |
kadonotakashi | 0:8fdf9a60065b | 81 | kTRNG_RingOscDiv0 = 0U, /*!< Ring oscillator with no divide */ |
kadonotakashi | 0:8fdf9a60065b | 82 | kTRNG_RingOscDiv2 = 1U, /*!< Ring oscillator divided-by-2. */ |
kadonotakashi | 0:8fdf9a60065b | 83 | kTRNG_RingOscDiv4 = 2U, /*!< Ring oscillator divided-by-4. */ |
kadonotakashi | 0:8fdf9a60065b | 84 | kTRNG_RingOscDiv8 = 3U /*!< Ring oscillator divided-by-8. */ |
kadonotakashi | 0:8fdf9a60065b | 85 | } trng_ring_osc_div_t; |
kadonotakashi | 0:8fdf9a60065b | 86 | |
kadonotakashi | 0:8fdf9a60065b | 87 | /*! @brief Data structure for definition of statistical check limits. Used by trng_config_t. */ |
kadonotakashi | 0:8fdf9a60065b | 88 | typedef struct _trng_statistical_check_limit |
kadonotakashi | 0:8fdf9a60065b | 89 | { |
kadonotakashi | 0:8fdf9a60065b | 90 | uint32_t maximum; /*!< Maximum limit.*/ |
kadonotakashi | 0:8fdf9a60065b | 91 | uint32_t minimum; /*!< Minimum limit.*/ |
kadonotakashi | 0:8fdf9a60065b | 92 | } trng_statistical_check_limit_t; |
kadonotakashi | 0:8fdf9a60065b | 93 | |
kadonotakashi | 0:8fdf9a60065b | 94 | /*! |
kadonotakashi | 0:8fdf9a60065b | 95 | * @brief Data structure for the TRNG initialization |
kadonotakashi | 0:8fdf9a60065b | 96 | * |
kadonotakashi | 0:8fdf9a60065b | 97 | * This structure initializes the TRNG by calling the the TRNG_Init() function. |
kadonotakashi | 0:8fdf9a60065b | 98 | * It contains all TRNG configurations. |
kadonotakashi | 0:8fdf9a60065b | 99 | */ |
kadonotakashi | 0:8fdf9a60065b | 100 | typedef struct _trng_user_config |
kadonotakashi | 0:8fdf9a60065b | 101 | { |
kadonotakashi | 0:8fdf9a60065b | 102 | bool lock; /*!< @brief Disable programmability of TRNG registers. */ |
kadonotakashi | 0:8fdf9a60065b | 103 | trng_clock_mode_t clockMode; /*!< @brief Clock mode used to operate TRNG.*/ |
kadonotakashi | 0:8fdf9a60065b | 104 | trng_ring_osc_div_t ringOscDiv; /*!< @brief Ring oscillator divide used by TRNG. */ |
kadonotakashi | 0:8fdf9a60065b | 105 | trng_sample_mode_t sampleMode; /*!< @brief Sample mode of the TRNG ring oscillator. */ |
kadonotakashi | 0:8fdf9a60065b | 106 | /* Seed Control*/ |
kadonotakashi | 0:8fdf9a60065b | 107 | uint16_t |
kadonotakashi | 0:8fdf9a60065b | 108 | entropyDelay; /*!< @brief Entropy Delay. Defines the length (in system clocks) of each Entropy sample taken. */ |
kadonotakashi | 0:8fdf9a60065b | 109 | uint16_t sampleSize; /*!< @brief Sample Size. Defines the total number of Entropy samples that will be taken during |
kadonotakashi | 0:8fdf9a60065b | 110 | Entropy generation. */ |
kadonotakashi | 0:8fdf9a60065b | 111 | uint16_t |
kadonotakashi | 0:8fdf9a60065b | 112 | sparseBitLimit; /*!< @brief Sparse Bit Limit which defines the maximum number of |
kadonotakashi | 0:8fdf9a60065b | 113 | * consecutive samples that may be discarded before an error is generated. |
kadonotakashi | 0:8fdf9a60065b | 114 | * This limit is used only for during von Neumann sampling (enabled by TRNG_HAL_SetSampleMode()). |
kadonotakashi | 0:8fdf9a60065b | 115 | * Samples are discarded if two consecutive raw samples are both 0 or both 1. If |
kadonotakashi | 0:8fdf9a60065b | 116 | * this discarding occurs for a long period of time, it indicates that there is |
kadonotakashi | 0:8fdf9a60065b | 117 | * insufficient Entropy. */ |
kadonotakashi | 0:8fdf9a60065b | 118 | /* Statistical Check Parameters.*/ |
kadonotakashi | 0:8fdf9a60065b | 119 | uint8_t retryCount; /*!< @brief Retry count. It defines the number of times a statistical check may fails |
kadonotakashi | 0:8fdf9a60065b | 120 | * during the TRNG Entropy Generation before generating an error. */ |
kadonotakashi | 0:8fdf9a60065b | 121 | uint8_t longRunMaxLimit; /*!< @brief Largest allowable number of consecutive samples of all 1, or all 0, |
kadonotakashi | 0:8fdf9a60065b | 122 | * that is allowed during the Entropy generation. */ |
kadonotakashi | 0:8fdf9a60065b | 123 | trng_statistical_check_limit_t |
kadonotakashi | 0:8fdf9a60065b | 124 | monobitLimit; /*!< @brief Maximum and minimum limits for statistical check of number of ones/zero detected |
kadonotakashi | 0:8fdf9a60065b | 125 | during entropy generation. */ |
kadonotakashi | 0:8fdf9a60065b | 126 | trng_statistical_check_limit_t |
kadonotakashi | 0:8fdf9a60065b | 127 | runBit1Limit; /*!< @brief Maximum and minimum limits for statistical check of number of runs of length 1 |
kadonotakashi | 0:8fdf9a60065b | 128 | detected during entropy generation. */ |
kadonotakashi | 0:8fdf9a60065b | 129 | trng_statistical_check_limit_t |
kadonotakashi | 0:8fdf9a60065b | 130 | runBit2Limit; /*!< @brief Maximum and minimum limits for statistical check of number of runs of length 2 |
kadonotakashi | 0:8fdf9a60065b | 131 | detected during entropy generation. */ |
kadonotakashi | 0:8fdf9a60065b | 132 | trng_statistical_check_limit_t |
kadonotakashi | 0:8fdf9a60065b | 133 | runBit3Limit; /*!< @brief Maximum and minimum limits for statistical check of number of runs of length 3 |
kadonotakashi | 0:8fdf9a60065b | 134 | detected during entropy generation. */ |
kadonotakashi | 0:8fdf9a60065b | 135 | trng_statistical_check_limit_t |
kadonotakashi | 0:8fdf9a60065b | 136 | runBit4Limit; /*!< @brief Maximum and minimum limits for statistical check of number of runs of length 4 |
kadonotakashi | 0:8fdf9a60065b | 137 | detected during entropy generation. */ |
kadonotakashi | 0:8fdf9a60065b | 138 | trng_statistical_check_limit_t |
kadonotakashi | 0:8fdf9a60065b | 139 | runBit5Limit; /*!< @brief Maximum and minimum limits for statistical check of number of runs of length 5 |
kadonotakashi | 0:8fdf9a60065b | 140 | detected during entropy generation. */ |
kadonotakashi | 0:8fdf9a60065b | 141 | trng_statistical_check_limit_t runBit6PlusLimit; /*!< @brief Maximum and minimum limits for statistical check of |
kadonotakashi | 0:8fdf9a60065b | 142 | number of runs of length 6 or more detected during entropy |
kadonotakashi | 0:8fdf9a60065b | 143 | generation. */ |
kadonotakashi | 0:8fdf9a60065b | 144 | trng_statistical_check_limit_t |
kadonotakashi | 0:8fdf9a60065b | 145 | pokerLimit; /*!< @brief Maximum and minimum limits for statistical check of "Poker Test". */ |
kadonotakashi | 0:8fdf9a60065b | 146 | trng_statistical_check_limit_t |
kadonotakashi | 0:8fdf9a60065b | 147 | frequencyCountLimit; /*!< @brief Maximum and minimum limits for statistical check of entropy sample frequency |
kadonotakashi | 0:8fdf9a60065b | 148 | count. */ |
kadonotakashi | 0:8fdf9a60065b | 149 | } trng_config_t; |
kadonotakashi | 0:8fdf9a60065b | 150 | |
kadonotakashi | 0:8fdf9a60065b | 151 | /******************************************************************************* |
kadonotakashi | 0:8fdf9a60065b | 152 | * API |
kadonotakashi | 0:8fdf9a60065b | 153 | *******************************************************************************/ |
kadonotakashi | 0:8fdf9a60065b | 154 | |
kadonotakashi | 0:8fdf9a60065b | 155 | #if defined(__cplusplus) |
kadonotakashi | 0:8fdf9a60065b | 156 | extern "C" { |
kadonotakashi | 0:8fdf9a60065b | 157 | #endif |
kadonotakashi | 0:8fdf9a60065b | 158 | |
kadonotakashi | 0:8fdf9a60065b | 159 | /*! |
kadonotakashi | 0:8fdf9a60065b | 160 | * @brief Initializes the user configuration structure to default values. |
kadonotakashi | 0:8fdf9a60065b | 161 | * |
kadonotakashi | 0:8fdf9a60065b | 162 | * This function initializes the configuration structure to default values. The default |
kadonotakashi | 0:8fdf9a60065b | 163 | * values are as follows. |
kadonotakashi | 0:8fdf9a60065b | 164 | * @code |
kadonotakashi | 0:8fdf9a60065b | 165 | * user_config->lock = 0; |
kadonotakashi | 0:8fdf9a60065b | 166 | * user_config->clockMode = kTRNG_ClockModeRingOscillator; |
kadonotakashi | 0:8fdf9a60065b | 167 | * user_config->ringOscDiv = kTRNG_RingOscDiv0; Or to other kTRNG_RingOscDiv[2|8] depending on the platform. |
kadonotakashi | 0:8fdf9a60065b | 168 | * user_config->sampleMode = kTRNG_SampleModeRaw; |
kadonotakashi | 0:8fdf9a60065b | 169 | * user_config->entropyDelay = 3200; |
kadonotakashi | 0:8fdf9a60065b | 170 | * user_config->sampleSize = 2500; |
kadonotakashi | 0:8fdf9a60065b | 171 | * user_config->sparseBitLimit = TRNG_USER_CONFIG_DEFAULT_SPARSE_BIT_LIMIT; |
kadonotakashi | 0:8fdf9a60065b | 172 | * user_config->retryCount = 63; |
kadonotakashi | 0:8fdf9a60065b | 173 | * user_config->longRunMaxLimit = 34; |
kadonotakashi | 0:8fdf9a60065b | 174 | * user_config->monobitLimit.maximum = 1384; |
kadonotakashi | 0:8fdf9a60065b | 175 | * user_config->monobitLimit.minimum = 1116; |
kadonotakashi | 0:8fdf9a60065b | 176 | * user_config->runBit1Limit.maximum = 405; |
kadonotakashi | 0:8fdf9a60065b | 177 | * user_config->runBit1Limit.minimum = 227; |
kadonotakashi | 0:8fdf9a60065b | 178 | * user_config->runBit2Limit.maximum = 220; |
kadonotakashi | 0:8fdf9a60065b | 179 | * user_config->runBit2Limit.minimum = 98; |
kadonotakashi | 0:8fdf9a60065b | 180 | * user_config->runBit3Limit.maximum = 125; |
kadonotakashi | 0:8fdf9a60065b | 181 | * user_config->runBit3Limit.minimum = 37; |
kadonotakashi | 0:8fdf9a60065b | 182 | * user_config->runBit4Limit.maximum = 75; |
kadonotakashi | 0:8fdf9a60065b | 183 | * user_config->runBit4Limit.minimum = 11; |
kadonotakashi | 0:8fdf9a60065b | 184 | * user_config->runBit5Limit.maximum = 47; |
kadonotakashi | 0:8fdf9a60065b | 185 | * user_config->runBit5Limit.minimum = 1; |
kadonotakashi | 0:8fdf9a60065b | 186 | * user_config->runBit6PlusLimit.maximum = 47; |
kadonotakashi | 0:8fdf9a60065b | 187 | * user_config->runBit6PlusLimit.minimum = 1; |
kadonotakashi | 0:8fdf9a60065b | 188 | * user_config->pokerLimit.maximum = 26912; |
kadonotakashi | 0:8fdf9a60065b | 189 | * user_config->pokerLimit.minimum = 24445; |
kadonotakashi | 0:8fdf9a60065b | 190 | * user_config->frequencyCountLimit.maximum = 25600; |
kadonotakashi | 0:8fdf9a60065b | 191 | * user_config->frequencyCountLimit.minimum = 1600; |
kadonotakashi | 0:8fdf9a60065b | 192 | * @endcode |
kadonotakashi | 0:8fdf9a60065b | 193 | * |
kadonotakashi | 0:8fdf9a60065b | 194 | * @param user_config User configuration structure. |
kadonotakashi | 0:8fdf9a60065b | 195 | * @return If successful, returns the kStatus_TRNG_Success. Otherwise, it returns an error. |
kadonotakashi | 0:8fdf9a60065b | 196 | */ |
kadonotakashi | 0:8fdf9a60065b | 197 | status_t TRNG_GetDefaultConfig(trng_config_t *userConfig); |
kadonotakashi | 0:8fdf9a60065b | 198 | |
kadonotakashi | 0:8fdf9a60065b | 199 | /*! |
kadonotakashi | 0:8fdf9a60065b | 200 | * @brief Initializes the TRNG. |
kadonotakashi | 0:8fdf9a60065b | 201 | * |
kadonotakashi | 0:8fdf9a60065b | 202 | * This function initializes the TRNG. |
kadonotakashi | 0:8fdf9a60065b | 203 | * When called, the TRNG entropy generation starts immediately. |
kadonotakashi | 0:8fdf9a60065b | 204 | * |
kadonotakashi | 0:8fdf9a60065b | 205 | * @param base TRNG base address |
kadonotakashi | 0:8fdf9a60065b | 206 | * @param userConfig Pointer to the initialization configuration structure. |
kadonotakashi | 0:8fdf9a60065b | 207 | * @return If successful, returns the kStatus_TRNG_Success. Otherwise, it returns an error. |
kadonotakashi | 0:8fdf9a60065b | 208 | */ |
kadonotakashi | 0:8fdf9a60065b | 209 | status_t TRNG_Init(TRNG_Type *base, const trng_config_t *userConfig); |
kadonotakashi | 0:8fdf9a60065b | 210 | |
kadonotakashi | 0:8fdf9a60065b | 211 | /*! |
kadonotakashi | 0:8fdf9a60065b | 212 | * @brief Shuts down the TRNG. |
kadonotakashi | 0:8fdf9a60065b | 213 | * |
kadonotakashi | 0:8fdf9a60065b | 214 | * This function shuts down the TRNG. |
kadonotakashi | 0:8fdf9a60065b | 215 | * |
kadonotakashi | 0:8fdf9a60065b | 216 | * @param base TRNG base address. |
kadonotakashi | 0:8fdf9a60065b | 217 | */ |
kadonotakashi | 0:8fdf9a60065b | 218 | void TRNG_Deinit(TRNG_Type *base); |
kadonotakashi | 0:8fdf9a60065b | 219 | |
kadonotakashi | 0:8fdf9a60065b | 220 | /*! |
kadonotakashi | 0:8fdf9a60065b | 221 | * @brief Gets random data. |
kadonotakashi | 0:8fdf9a60065b | 222 | * |
kadonotakashi | 0:8fdf9a60065b | 223 | * This function gets random data from the TRNG. |
kadonotakashi | 0:8fdf9a60065b | 224 | * |
kadonotakashi | 0:8fdf9a60065b | 225 | * @param base TRNG base address. |
kadonotakashi | 0:8fdf9a60065b | 226 | * @param data Pointer address used to store random data. |
kadonotakashi | 0:8fdf9a60065b | 227 | * @param dataSize Size of the buffer pointed by the data parameter. |
kadonotakashi | 0:8fdf9a60065b | 228 | * @return random data |
kadonotakashi | 0:8fdf9a60065b | 229 | */ |
kadonotakashi | 0:8fdf9a60065b | 230 | status_t TRNG_GetRandomData(TRNG_Type *base, void *data, size_t dataSize); |
kadonotakashi | 0:8fdf9a60065b | 231 | |
kadonotakashi | 0:8fdf9a60065b | 232 | #if defined(__cplusplus) |
kadonotakashi | 0:8fdf9a60065b | 233 | } |
kadonotakashi | 0:8fdf9a60065b | 234 | #endif |
kadonotakashi | 0:8fdf9a60065b | 235 | |
kadonotakashi | 0:8fdf9a60065b | 236 | /*! @}*/ |
kadonotakashi | 0:8fdf9a60065b | 237 | |
kadonotakashi | 0:8fdf9a60065b | 238 | #endif /* FSL_FEATURE_SOC_TRNG_COUNT */ |
kadonotakashi | 0:8fdf9a60065b | 239 | #endif /*_FSL_TRNG_H_*/ |