• Home
Name Date Size #Lines LOC

..--

BUILD.gnD12-May-2024776 2320

README_zh.mdD12-May-20241.3 KiB3527

random_number_example.cD12-May-20241.5 KiB6036

rng_init.cD12-May-20241 KiB4021

rng_init.hD12-May-2024834 3111

README_zh.md

1# Niobe407开发板OpenHarmony外设编程开发——RNG
2随机数发生器(RNG)是一个以连续模拟噪声为基础的随机数发生器,在主机读数时提供一个 32 位的随机数。
3本示例将演示如何在Niobe407开发板上通过rng获取随机数。
4
5
6## 编译调试
7- 进入//kernel/liteos_m目录, 在menuconfig配置中进入如下选项:
8
9     `(Top) → Platform → Board Selection → select board niobe407 → use talkweb niobe407 application → niobe407 application choose`
10
11- 选择 `102_peripheral_rng_number`
12
13- 回到sdk根目录,执行`hb build -f`脚本进行编译。
14
15### 运行结果
16
17示例代码编译烧录代码后,按下开发板的RESET按键,通过串口助手查看日志
18```
19Generate 32bit Random number is 3939425217
20Generate 32bit Random number is 65643907
21Generate 32bit Random number is 1996657443
22Generate 32bit Random number is 105432700
23Generate 32bit Random number is 3489997754
24Generate 32bit Random number is 4219107597
25Generate 32bit Random number is 2745823547
26Generate 32bit Random number is 1101818015
27Generate 32bit Random number is 2122724804
28Generate 32bit Random number is 2652032502
29Generate 32bit Random number is 2661532219
30Generate 32bit Random number is 3839864595
31Generate 32bit Random number is 2992609050
32Generate 32bit Random number is 2483297994
33Generate 32bit Random number is 2550058723
34```
35