Wayne 1fb3f1fcec
[bsp/nuvoton] Update. (#6022)
1. Sync 4.1.1+.
2. Add SDIO drivers for M480/M2354 platforms.
3. Update LVGL porting.
4. Add N9H30 FMI NAND driver.

Co-authored-by: Wayne Lin <wclin@nuvoton.com>
2022-06-03 10:01:15 +08:00

51 lines
1.2 KiB
C

/**************************************************************************//**
*
* @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-7-4 YCHuang12 First version
* 2022-3-15 Wayne Remove SW rand function
*
******************************************************************************/
#include <rtconfig.h>
#if (defined(BSP_USING_TRNG) && defined(RT_HWCRYPTO_USING_RNG))
#include <rtdevice.h>
#include "NuMicro.h"
#define NU_CRYPTO_TRNG_NAME "nu_TRNG"
#define LOG_TAG "TRNG"
#define DBG_ENABLE
#define DBG_SECTION_NAME "TRNG"
#define DBG_LEVEL DBG_INFO
#define DBG_COLOR
#include <rtdbg.h>
/* Private variables ------------------------------------------------------------*/
rt_err_t nu_trng_init(void)
{
CLK_EnableModuleClock(TRNG_MODULE);
SYS_ResetModule(TRNG_RST);
TRNG_Open();
return RT_EOK;
}
rt_uint32_t nu_trng_rand(struct hwcrypto_rng *ctx)
{
uint32_t u32RNGValue;
TRNG_GenWord(&u32RNGValue);
return u32RNGValue;
}
#endif //#if (defined(BSP_USING_TRNG) && defined(RT_HWCRYPTO_USING_RNG))