123

Dependencies:   mbed

Fork of LG by igor Apu

Revision:
166:c3c0b8a90d81
Parent:
161:efd949e8d536
Child:
167:bedc0a9d559a
diff -r b2bd0c810a4f -r c3c0b8a90d81 DeviceISACS.h
--- a/DeviceISACS.h	Fri May 20 14:03:58 2016 +0000
+++ b/DeviceISACS.h	Sun May 22 18:59:20 2016 +0000
@@ -8,43 +8,79 @@
 //  regulator
 //  output(voltage - code - DAC - Amplifier - control unit - hfo)
 
+//Information signal amplitude control system input ( = ADC - low pass filter - code - voltage) typedefs
+typedef struct _DeviceISACSInputInterpolatorSettings {
+  uint32_t points;     //Number of actual control points (up to 16)
+  int32_t voltage[16]; //Output voltage control points in signed 16.16 fixed point format
+  int32_t code[16];    //DAC code control points
+} DeviceISACSInputInterpolatorSettings;
+
+typedef struct _DeviceISACSInputInterpolator {
+  DeviceISACSInputInterpolatorSettings settings;
+} DeviceISACSInputInterpolator;
+
+typedef struct _DeviceISACSInput {
+  int32_t voltage;
+  int32_t sum;
+  int32_t average;
+  DeviceISACSInputInterpolator interpolator;
+  //DeviceISACSFilter filter;
+} DeviceISACSInput;
+
 //Information signal amplitude control system output ( = DAC + amplifier + control unit + hfo) typedefs
-typedef struct _DeviceISACSOutputSettings {
+typedef struct _DeviceISACSOutputInterpolatorSettings {
   uint32_t points;      //Number of actual control points (up to 16)
-  uint32_t voltage[16]; //Output voltage control points in signed 16.16 fixed point format
-  uint32_t code[16];    //DAC code control points
+  int32_t voltage[16]; //Output voltage control points in signed 16.16 fixed point format
+  int32_t code[16];    //DAC code control points
+} DeviceISACSOutputInterpolatorSettings;
+
+typedef struct _DeviceISACSOutputInterpolator {
+  DeviceISACSOutputInterpolatorSettings settings;
+} DeviceISACSOutputInterpolator;
+
+/*
+typedef struct _DeviceISACSOutputConditionSettings {
+  int32_t voltage; //Output voltage in signed 16.16 fixed point format
+} DeviceISACSOutputConditionSettings;
+
+typedef struct _DeviceISACSOutputSettings {
+  DeviceISACSOutputInterpolatorSettings interpolator;
+  DeviceISACSOutputConditionSettings start;
+  DeviceISACSOutputConditionSettings reset;
 } DeviceISACSOutputSettings;
+*/
 
-typedef struct _DeviceISACSOutputState {
+typedef struct _DeviceISACSOutputStartSettings {
   uint32_t voltage;     //Output voltage
-  uint32_t code;        //DAC code
-} DeviceISACSOutputState;
+} DeviceISACSOutputStartSettings;
+
+typedef struct _DeviceISACSOutputStart {
+  DeviceISACSOutputStartSettings settings;
+} DeviceISACSOutputStart;
+
+typedef struct _DeviceISACSOutputResetSettings {
+  uint32_t voltage;     //Output voltage
+} DeviceISACSOutputResetSettings;
+
+typedef struct _DeviceISACSOutputReset {
+  DeviceISACSOutputResetSettings settings;
+} DeviceISACSOutputReset;
 
 typedef struct _DeviceISACSOutput {
-  DeviceISACSOutputSettings settings;
-  DeviceISACSOutputState state;
+  int32_t voltage;  //Output value - constant for measurement cycle
+  DeviceISACSOutputInterpolator interpolator;
+  DeviceISACSOutputStart start;
+  DeviceISACSOutputReset reset;
 } DeviceISACSOutput;
 
-/*
-//Information signal amplitude control system control amplifier (DAC - amplifier - control unit - hfo) typedefs
-typedef struct _DeviceISASAmplifierSettings {
-  uint32_t reference; //Reference voltage
-  uint32_t gain;      //Amplifier gain
-} DeviceISASAmplifierSettings;
-
-typedef struct _DeviceISASAmplifier {
-  DeviceISASAmplifierSettings settings;
-} DeviceISASAmplifier;
-*/
-
 //Information signal amplitude control system regulator typedefs
 typedef struct _DeviceISACSRegulatorConditionSettings {
+  uint8_t enabled;
   uint32_t reference; //signed 16.16 format reference voltage
   uint32_t scale;     //signed 16.16 format regulator scale factor
 } DeviceISACSRegulatorConditionSettings;
 
 typedef struct _DeviceISACSRegulatorSettings {
-  uint8_t enabled;
   DeviceISACSRegulatorConditionSettings start;   //settings for PLCS system in start condition
   DeviceISACSRegulatorConditionSettings regular; //settings for PLCS system in normal condition
   DeviceISACSRegulatorConditionSettings reset;   //settings for PLCS system in reset condition
@@ -63,13 +99,14 @@
 } DeviceISACSRegulator;
 
 //Information signal amplitude control system typedefs
-//  Information signal amplitude control system ADC: device.controller.SSP.ADC[4]
+//  Information signal amplitude ADC: device.controller.SSP.ADC[4]
 //  Information signal amplitude control system DAC: device.controller.SSP.DAC[0]
 typedef struct _DeviceISACS {
   DeviceISACSPotentiometers potentiometers;
   //DeviceISASAmplifier amplifier;
+  DeviceISACSInput input;
+  DeviceISACSRegulator regulator;
   DeviceISACSOutput output;
-  DeviceISACSRegulator regulator;
 } DeviceISACS;
 
 //Information signal amplitude stabilizer functions
@@ -86,4 +123,6 @@
 void InitISACS(void);
 void StartISACS(void);
 
+void isacsProcess(void);
+
 #endif  /* __DEVICE_ISACS_H__ */
\ No newline at end of file