> ## Content Index
> Fetch the complete content index at: https://note.xdq.me/llms.txt
> Use this file to discover other available public pages before exploring further.

# TI CC1310 TRNG使用
- URL: https://note.xdq.me/cc1310-trng-usage/
- Published: 2018-04-12T00:43:47.000Z
- Updated: 2026-10-03T03:00:12.000Z
- Author: xud6
- Tags: MCU, TI, CC1310, #Import 2026-10-03 02:45

## 头文件

```
#include DeviceFamily_constructPath(driverlib/trng.h)

```

## 初始化

```
Power_setDependency(PowerCC26XX_PERIPH_TRNG);
TRNGEnable();
while (!(TRNGStatusGet() & TRNG_NUMBER_READY))
{
    //wait for random number generator
}

```

## 读取低32位

```
TRNGNumberGet(TRNG_LOW_WORD)

```

## 判断是否已经启动

```
if (0 == (HWREG(TRNG_BASE + TRNG_O_CTL) & TRNG_CTL_TRNG_EN))
{
    //trng is disable
}

```

## 关闭

```
TRNGDisable();
Power_releaseDependency(PowerCC26XX_PERIPH_TRNG);

```