21#ifndef _CURRENT_SOURCE_NOISY_H_
22#define _CURRENT_SOURCE_NOISY_H_
39static bool current_source_noisy_init(uint32_t n_noisy_sources, uint32_t *next) {
40 noisy_source = spin1_malloc(n_noisy_sources *
sizeof(uint32_t*));
41 for (uint32_t n_noisy=0; n_noisy < n_noisy_sources; n_noisy++) {
43 if (noisy_source[n_noisy] == NULL) {
44 log_error(
"Unable to allocate DC source parameters - out of DTCM");
52static bool current_source_noisy_load_parameters(
53 address_t cs_address, uint32_t n_noisy_sources, uint32_t *next) {
54 for (uint32_t n_noisy=0; n_noisy < n_noisy_sources; n_noisy++) {
61static REAL current_source_noisy_get_offset(uint32_t cs_index, uint32_t time) {
62 if ((time >= noisy_source[cs_index]->start) && (time < noisy_source[cs_index]->stop)) {
65 REAL noisy_current_offset = noisy_source[cs_index]->mean + (
66 noisy_source[cs_index]->stdev * random_value);
67 return noisy_current_offset;
void log_error(const char *message,...)
accum REAL
Type used for "real" numbers.
uint32_t mars_kiss64_seed(mars_kiss64_seed_t seed)
uint32_t mars_kiss64_seed_t[4]
static mars_kiss64_seed_t seed
YUCK copy and pasted RNG to allow inlining and also to avoid horrific executable bloat.
void spin1_memcpy(void *dst, void const *src, uint len)