Keisuke Sehara
/
STM32_Whisking
fast-feedback virtual target task code on STM Nucleo
core/random.h@26:b4421d1ee57a, 2018-07-05 (annotated)
- Committer:
- gwappa
- Date:
- Thu Jul 05 20:15:37 2018 +0000
- Revision:
- 26:b4421d1ee57a
- Parent:
- random.h@13:8ea85a33e37a
transform event feature into the InterruptHandler class; organize files a little bit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gwappa | 0:f736749c33d2 | 1 | #ifndef RANDOM_H__ |
gwappa | 0:f736749c33d2 | 2 | #define RANDOM_H__ |
gwappa | 0:f736749c33d2 | 3 | |
gwappa | 0:f736749c33d2 | 4 | #define RANDOM_NOISE_PIN PA_0 |
gwappa | 13:8ea85a33e37a | 5 | #include "inttypes.h" |
gwappa | 0:f736749c33d2 | 6 | |
gwappa | 0:f736749c33d2 | 7 | namespace random |
gwappa | 0:f736749c33d2 | 8 | { |
gwappa | 0:f736749c33d2 | 9 | typedef unsigned short uint16_t; |
gwappa | 0:f736749c33d2 | 10 | |
gwappa | 0:f736749c33d2 | 11 | const unsigned int MAX_RESOLUTION = 65535; |
gwappa | 0:f736749c33d2 | 12 | |
gwappa | 0:f736749c33d2 | 13 | void init(); |
gwappa | 13:8ea85a33e37a | 14 | uint32_t unif(const uint32_t& nlevels); |
gwappa | 13:8ea85a33e37a | 15 | uint32_t exponential(const uint32_t& tau, const uint32_t& cutoff, const unsigned int& resolution=MAX_RESOLUTION); |
gwappa | 0:f736749c33d2 | 16 | } |
gwappa | 0:f736749c33d2 | 17 | |
gwappa | 0:f736749c33d2 | 18 | #endif |