Microchip® Advanced Software Framework

tal_rand.c File Reference

This file implements the random seed function.

Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include "pal.h"
#include "return_val.h"
#include "tal.h"
#include "tal_config.h"
#include "tal_internal.h"

Functions

retval_t tal_generate_rand_seed (void)
 Generates a 16-bit random number used as initial seed for srand() More...
 

retval_t tal_generate_rand_seed ( void  )

Generates a 16-bit random number used as initial seed for srand()

This function generates a 16-bit random number by means of using the Random Number Generator from the transceiver.

The generated random 16-bit number is feed into function srand() as initial seed.

References MAC_SUCCESS, pal_timer_delay, RF09, RF24, RF_BASE_ADDR_OFFSET, RF_NOP, RF_RX, RF_TRXOFF, RG_RF09_RNDV, RG_RF09_RXBWC, SR_BBC0_PC_BBEN, SR_RF09_CMD_CMD, switch_to_txprep(), TAL_BUSY, TAL_IDLE, TAL_SLEEP, tal_state, TAL_TRX_ASLEEP, trx_bit_write(), trx_reg_read(), trx_reg_write(), and trx_state.

Referenced by tal_init().