21#ifndef _CURRENT_SOURCE_DC_H_
22#define _CURRENT_SOURCE_DC_H_
32static 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");
45static 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++) {
54static 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;
void log_error(const char *message,...)
accum REAL
Type used for "real" numbers.
void spin1_memcpy(void *dst, void const *src, uint len)