Keisuke Sehara
/
STM32_Whisking
fast-feedback virtual target task code on STM Nucleo
Diff: core/random.h
- Revision:
- 26:b4421d1ee57a
- Parent:
- 13:8ea85a33e37a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/random.h Thu Jul 05 20:15:37 2018 +0000 @@ -0,0 +1,18 @@ +#ifndef RANDOM_H__ +#define RANDOM_H__ + +#define RANDOM_NOISE_PIN PA_0 +#include "inttypes.h" + +namespace random +{ + typedef unsigned short uint16_t; + + const unsigned int MAX_RESOLUTION = 65535; + + void init(); + uint32_t unif(const uint32_t& nlevels); + uint32_t exponential(const uint32_t& tau, const uint32_t& cutoff, const unsigned int& resolution=MAX_RESOLUTION); +} + +#endif \ No newline at end of file