1 /****************************************************************************** 2 * Copyright (c) 2022 Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK") 3 * All rights reserved. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 *****************************************************************************/ 18 /** @page TRNG 19 * 20 * Introduction 21 * =============== 22 * TLSRB91 supports hardware trng. 23 * 24 * API Reference 25 * =============== 26 * Header File: trng.h 27 */ 28 #ifndef TRNG_H_ 29 #define TRNG_H_ 30 31 #include "reg_include/register_b91.h" 32 #include "stimer.h" 33 #include "sys.h" 34 35 /********************************************************************************************************************** 36 * global constants * 37 *********************************************************************************************************************/ 38 39 /********************************************************************************************************************** 40 * global macro * 41 *********************************************************************************************************************/ 42 43 /********************************************************************************************************************** 44 * global data type * 45 *********************************************************************************************************************/ 46 47 /********************************************************************************************************************** 48 * global variable declaration * 49 *********************************************************************************************************************/ 50 51 /********************************************************************************************************************** 52 * global function prototype * 53 *********************************************************************************************************************/ 54 55 /** 56 * @brief This function performs to get one random number.If chip in suspend TRNG module should be close. 57 * else its current will be larger. 58 * @return none 59 **/ 60 void trng_init(void); 61 62 /** 63 * @brief This function performs to get one random number. 64 * @return the value of one random number 65 **/ 66 unsigned int trng_rand(void); 67 68 #endif 69