21 #ifndef _CURRENT_SOURCE_DC_H_
22 #define _CURRENT_SOURCE_DC_H_
32 static bool current_source_dc_init(uint32_t n_dc_sources, uint32_t *next) {
33 dc_source = spin1_malloc(n_dc_sources *
sizeof(uint32_t*));
34 for (uint32_t n_dc=0; n_dc < n_dc_sources; n_dc++) {
35 dc_source[n_dc] = spin1_malloc(
sizeof(
dc_source_t));
36 if (dc_source[n_dc] == NULL) {
37 log_error(
"Unable to allocate DC source parameters - out of DTCM");
45 static bool current_source_dc_load_parameters(
46 address_t cs_address, uint32_t n_dc_sources, uint32_t *next) {
47 for (uint32_t n_dc=0; n_dc < n_dc_sources; n_dc++) {
48 spin1_memcpy(dc_source[n_dc], &cs_address[*next],
sizeof(
dc_source_t));
54 static REAL current_source_dc_get_offset(uint32_t cs_index, uint32_t
time) {
55 if ((
time >= dc_source[cs_index]->start) && (
time < dc_source[cs_index]->stop)) {
56 return dc_source[cs_index]->amplitude;
static uint32_t time
Simulation time.
accum REAL
Type used for "real" numbers.