Wirepas SDK
random.h
Go to the documentation of this file.
1/* Copyright 2019 Wirepas Ltd. All Rights Reserved.
2 *
3 * See file LICENSE.txt for full license details.
4 *
5 */
6
7#ifndef RANDOM_H
8#define RANDOM_H
9
10#include <stdint.h>
11
17void Random_init(uint32_t seed);
18
19// Macro to get default random value
20#define Random_get() Random_get8()
21
26uint8_t Random_get8(void);
27
32uint16_t Random_get16(void);
33
38uint32_t Random_get32(void);
39
46#define Random_jitter(x) (Random_get32() % (((x) + 1 ) & 0xFFFFFFF))
47
48#endif // RANDOM_H
49
uint16_t Random_get16(void)
Get random number with u16 range.
uint32_t Random_get32(void)
Get random number with u32 range.
uint8_t Random_get8(void)
Get random number with u8 range.
void Random_init(uint32_t seed)
Initialize the random generator.