Implement CC2538 random driver (#483)

* Implement CC2538 random driver
This commit is contained in:
Lu Wang
2016-09-06 21:57:08 -07:00
committed by Jonathan Hui
parent 6e5a22080e
commit c05c632d2f
7 changed files with 118 additions and 56 deletions
+8
View File
@@ -201,6 +201,14 @@ ThreadError otPlatRadioEnable(void);
*/
ThreadError otPlatRadioDisable(void);
/**
* Check whether radio is enabled or not.
*
* @retval ::true radio is enabled.
* @retval ::false radio is disabled.
*/
bool otPlatRadioIsEnabled(void);
/**
* Transition the radio from Receive to Sleep.
* Turn off the radio.
+10 -10
View File
@@ -55,7 +55,15 @@ extern "C" {
*/
/**
* Get random stream.
* Get a 32-bit random value.
*
* @returns A 32-bit random value.
*
*/
uint32_t otPlatRandomGet(void);
/**
* Get true random stream.
*
* @param[in] aInputLength The expected size of random values.
* @param[out] aOutput A pointer to the buffer for the generated random stream. The pointer should never be NULL.
@@ -67,15 +75,7 @@ extern "C" {
* @retval kThreadError_Fail Generate random fail.
* @retval kThreadError_InvalidArgs Invalid args.
*/
ThreadError otPlatSecureRandomGet(uint16_t aInputLength, uint8_t *aOutput, uint16_t *aOutputLength);
/**
* Get a 32-bit true random value.
*
* @returns A 32-bit true random value.
*
*/
uint32_t otPlatRandomGet(void);
ThreadError otPlatRandomSecureGet(uint16_t aInputLength, uint8_t *aOutput, uint16_t *aOutputLength);
/**
* @}