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_uint8_t)zb_random_val(0xFFU) |
#define | ZB_RANDOM_U16() (zb_uint16_t)zb_random_val(0xFFFFU) |
Functions | |
zb_uint32_t | zb_random (void) |
zb_uint32_t | zb_random_val (zb_uint32_t max_value) |
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_uint16_t)zb_random_val(0xFFFFU) |
Generate random 16-bit value
#define ZB_RANDOM_U8 | ( | ) | (zb_uint8_t)zb_random_val(0xFFU) |
Generate random 8-bit value
#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
zb_uint32_t zb_random_val | ( | zb_uint32_t | max_value | ) |
Generate random value between 0 to max_value, inclusively.