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
17
void
Random_init
(uint32_t seed);
18
19
// Macro to get default random value
20
#define Random_get() Random_get8()
21
26
uint8_t
Random_get8
(
void
);
27
32
uint16_t
Random_get16
(
void
);
33
38
uint32_t
Random_get32
(
void
);
39
46
#define Random_jitter(x) (Random_get32() % (((x) + 1 ) & 0xFFFFFFF))
47
48
#endif // RANDOM_H
49
Random_get8
uint8_t Random_get8(void)
Get random number with u8 range.
Random_init
void Random_init(uint32_t seed)
Initialize the random generator.
Random_get16
uint16_t Random_get16(void)
Get random number with u16 range.
Random_get32
uint32_t Random_get32(void)
Get random number with u32 range.