This repository has been archived on 2023-07-17. You can view files and clone it, but cannot push or open issues or pull requests.
bl_mcu_sdk/drivers/lhal/include/bflb_sec_trng.h

69 lines
1.1 KiB
C
Raw Normal View History

#ifndef _BFLB_SEC_TRNG_H
#define _BFLB_SEC_TRNG_H
#include "bflb_core.h"
/** @addtogroup LHAL
* @{
*/
/** @addtogroup TRNG
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Read trng data.
*
* @param [in] dev device handle
* @param [in] data pointer to trng data
* @return A negated errno value on failure.
*/
2022-10-29 13:33:23 +08:00
int bflb_trng_read(struct bflb_device_s *dev, uint8_t data[32]);
/**
* @brief Read trng data with custom length.
*
* @param [in] data pointer to trng data
* @param [in] len length to read
* @return A negated errno value on failure.
*/
2022-10-29 13:33:23 +08:00
int bflb_trng_readlen(uint8_t *data, uint32_t len);
/**
* @brief Get trng data.
*
* @return trng data with word
*/
2022-10-29 13:33:23 +08:00
long random(void);
/**
* @brief Enable trng in group0.
*
* @param [in] dev device handle
*/
2022-10-29 13:33:23 +08:00
void bflb_group0_request_trng_access(struct bflb_device_s *dev);
/**
* @brief Disable trng in group0.
*
* @param [in] dev device handle
*/
2022-10-29 13:33:23 +08:00
void bflb_group0_release_trng_access(struct bflb_device_s *dev);
#ifdef __cplusplus
}
#endif
/**
* @}
*/
/**
* @}
*/
#endif