Add shared waveform processing, generation and firmware image support
This commit is contained in:
24
c/set-protocol/include/set_signal.h
Normal file
24
c/set-protocol/include/set_signal.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/** @file set_signal.h Portable interpolation and DAC waveform preparation. */
|
||||
#ifndef SET_SIGNAL_H
|
||||
#define SET_SIGNAL_H
|
||||
#include "pcan_abi.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
enum { SET_SIGNAL_POLYNOMIAL, SET_SIGNAL_LINEAR, SET_SIGNAL_PCHIP, SET_SIGNAL_SPLINE };
|
||||
/* Caller-owned workspace: at least 14*count+128 doubles. No heap or globals.
|
||||
* Inputs may be unsorted; duplicate times are averaged. No extrapolation.
|
||||
* meta[0..2] = original count, unique count, RMSE at original measurements.
|
||||
* endpoint=1 includes the last time; 0 samples a cyclic period [first,last).
|
||||
* Return: 0 success, 1 bounds, 2 nonfinite/degenerate data, 3 rank deficient. */
|
||||
PCAN_ABI_API int set_signal_reconstruct(const double *x, const double *y, size_t count,
|
||||
int method, unsigned degree, size_t output_count, int endpoint,
|
||||
double *out_x, double *out_y, double *meta, double *work, size_t work_count);
|
||||
/* Reject out-of-range voltages, never silently clip. vref must be positive.
|
||||
* All input is validated before any output is written. */
|
||||
PCAN_ABI_API int set_signal_dac12(const double *volts, size_t count, double vref,
|
||||
uint16_t *codes);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user