gr55xx_hal_rng.h File Reference

Header file containing functions prototypes of RNG HAL library. More...

#include "gr55xx_ll_rng.h"
#include "gr55xx_hal_def.h"
+ Include dependency graph for gr55xx_hal_rng.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _rng_init
 RNG init structure definition. More...
 
struct  _rng_handle
 RNG handle Structure definition. More...
 
struct  _hal_rng_callback
 HAL_RNG Callback function definition. More...
 

Macros

#define RNG_SEED_FR0_S0   LL_RNG_SEED_FR0_S0
 LFSR seed is from the switching oscillator S0. More...
 
#define RNG_SEED_USER   LL_RNG_SEED_USER
 LFSR seed is configured by users. More...
 
#define RNG_LFSR_MODE_59BIT   LL_RNG_LFSR_MODE_59BIT
 59-bit LFSR. More...
 
#define RNG_LFSR_MODE_128BIT   LL_RNG_LFSR_MODE_128BIT
 128-bit LFSR. More...
 
#define RNG_POST_PRO_NOT   LL_RNG_POST_PRO_NOT
 No post process. More...
 
#define RNG_POST_PRO_SKIPPING   LL_RNG_POST_PRO_SKIPPING
 bit skipping. More...
 
#define RNG_POST_PRO_COUNTING   LL_RNG_POST_PRO_COUNTING
 bit counting. More...
 
#define RNG_POST_PRO_NEUMANN   LL_RNG_POST_PRO_NEUMANN
 Von-Neumann. More...
 
#define RNG_OUTPUT_FR0_S0   LL_RNG_OUTPUT_FR0_S0
 Digital RNG direct output, for ring oscillator S0 LFSR seed. More...
 
#define RNG_OUTPUT_CYCLIC_PARITY   LL_RNG_OUTPUT_CYCLIC_PARITY
 LFSR and RNG cyclic sampling and parity generation. More...
 
#define RNG_OUTPUT_CYCLIC   LL_RNG_OUTPUT_CYCLIC
 LFSR and RNG cyclic sampling. More...
 
#define RNG_OUTPUT_LFSR_RNG   LL_RNG_OUTPUT_LFSR_RNG
 LFSR ⊕ RNG. More...
 
#define RNG_OUTPUT_LFSR   LL_RNG_OUTPUT_LFSR
 LFSR direct output. More...
 

Typedefs

typedef struct _rng_init rng_init_t
 RNG init structure definition. More...
 
typedef struct _rng_handle rng_handle_t
 RNG handle Structure definition. More...
 
typedef struct _hal_rng_callback hal_rng_callback_t
 HAL_RNG Callback function definition. More...
 

Enumerations

enum  hal_rng_state_t {
  HAL_RNG_STATE_RESET = 0x00, HAL_RNG_STATE_READY = 0x01, HAL_RNG_STATE_BUSY = 0x02, HAL_RNG_STATE_TIMEOUT = 0x03,
  HAL_RNG_STATE_ERROR = 0x04
}
 HAL RNG State Enumerations definition. More...
 

Functions

hal_status_t hal_rng_init (rng_handle_t *p_rng)
 Initialize the RNG according to the specified parameters in the rng_init_t of associated handle. More...
 
hal_status_t hal_rng_deinit (rng_handle_t *p_rng)
 De-initialize the RNG peripheral. More...
 
void hal_rng_msp_init (rng_handle_t *p_rng)
 Initialize the RNG MSP. More...
 
void hal_rng_msp_deinit (rng_handle_t *p_rng)
 De-initialize the RNG MSP. More...
 
hal_status_t hal_rng_generate_random_number (rng_handle_t *p_rng, uint16_t *p_seed, uint32_t *p_random32bit)
 Generate a 32-bit random number. More...
 
hal_status_t hal_rng_generate_random_number_it (rng_handle_t *p_rng, uint16_t *p_seed)
 Generate a 32-bit random number in interrupt mode. More...
 
uint32_t hal_rng_read_last_random_number (rng_handle_t *p_rng)
 Read the latest generated random number. More...
 
void hal_rng_irq_handler (rng_handle_t *p_rng)
 Handle RNG interrupt request. More...
 
void hal_rng_ready_data_callback (rng_handle_t *p_rng, uint32_t random32bit)
 Data Ready callback in non-blocking mode. More...
 
hal_rng_state_t hal_rng_get_state (rng_handle_t *p_rng)
 Return the RNG handle state. More...
 
hal_status_t hal_rng_suspend_reg (rng_handle_t *p_rng)
 Suspend some registers related to RNG configuration before sleep. More...
 
hal_status_t hal_rng_resume_reg (rng_handle_t *p_rng)
 Restore some registers related to RNG configuration after sleep. More...
 

Detailed Description

Header file containing functions prototypes of RNG HAL library.

Author
BLE Driver Team
Attention
Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file gr55xx_hal_rng.h.