Developing with ZBOSS for Zigbee
|
Macros | |
#define | ZB_RAND_MAX ((zb_uint32_t)~0U) |
#define | ZB_RANDOM_VALUE(max_value) zb_random_val(max_value) |
#define | ZB_RANDOM_U8() zb_random_u8() |
#define | ZB_RANDOM_U16() zb_random_u16() |
Functions | |
zb_uint32_t | zb_random (void) |
zb_uint32_t | zb_random_val (zb_uint32_t max_value) |
zb_uint8_t | zb_random_u8 (void) |
zb_uint16_t | zb_random_u16 (void) |
void | zb_bzero_volatile (volatile void *s, zb_uint_t size) |
void | zb_generate_prbs9 (zb_uint8_t *dest, zb_uint16_t cnt, zb_uint16_t seed) |
Fill in memory with PRBS9 pattern using linear-feedback shift registers. More... | |
#define ZB_RAND_MAX ((zb_uint32_t)~0U) |
Maximal possible value for randomly generated (32-bit) value
#define ZB_RANDOM_U16 | ( | ) | zb_random_u16() |
Equivalent of zb_random_u16(). The macro is left for compatibility reasons.
#define ZB_RANDOM_U8 | ( | ) | zb_random_u8() |
Equivalent of zb_random_u8(). The macro is left for compatibility reasons.
#define ZB_RANDOM_VALUE | ( | max_value | ) | zb_random_val(max_value) |
Equivalent of zb_random_val(). The macro is left for compatibility reasons.
void zb_bzero_volatile | ( | volatile void * | s, |
zb_uint_t | size | ||
) |
Analogue of bzero() for volatile data.
A custom version should be implemented because there is no standard library function for that purpose. Also, this function is not platform-dependent in contrast to ZB_BZERO() macro and therefore can't be overridden by specific ZBOSS platform.
The function sets individually every byte of provided memory region to zero.
void zb_generate_prbs9 | ( | zb_uint8_t * | dest, |
zb_uint16_t | cnt, | ||
zb_uint16_t | seed | ||
) |
Fill in memory with PRBS9 pattern using linear-feedback shift registers.
dest | - Pointer to the block of memory to fill. |
cnt | - Number of bytes to be set. |
seed | - Random seed |
zb_uint32_t zb_random | ( | void | ) |
Generate random 32-bit value using zb_random_val() with ZB_UINT32_MAX
zb_uint16_t zb_random_u16 | ( | void | ) |
Generate random 16-bit value using zb_random_val() with ZB_UINT16_MAX
zb_uint8_t zb_random_u8 | ( | void | ) |
Generate random 8-bit value using zb_random_val() with ZB_UINT8_MAX
zb_uint32_t zb_random_val | ( | zb_uint32_t | max_value | ) |
Generate random value between 0 to max_value, inclusively.
Internal software algorithm using LFSRs can be overridden by define ZB_RANDOM_HARDWARE