Dmitry Kovalev / Mbed 2 deprecated LGfiltr

Dependencies:   mbed

Fork of LGstaandart by Dmitry Kovalev

DevicePLCS.h

Committer:
Diletant
Date:
2016-05-15
Revision:
161:efd949e8d536
Parent:
156:e68ee0bcdcda
Child:
166:c3c0b8a90d81

File content as of revision 161:efd949e8d536:

#ifndef __DEVICE_PLCS_H__
#define __DEVICE_PLCS_H__

//Path length control amplifier (DAC - amplifier - control unit - drive) typedefs
typedef struct _DevicePathLengthControlAmplifierSettings {
  uint32_t reference; //Reference voltage
  uint32_t gain;      //Amplifier gain
} DevicePathLengthControlAmplifierSettings;

typedef struct _DevicePathLengthControlAmplifier {
  DevicePathLengthControlAmplifierSettings settings;
} DevicePathLengthControlAmplifier;

//Path length control reset typedefs
typedef struct _DevicePathLengthControlResetDelaySettings {
  uint32_t center;   //reset delay in mks for normal conditions
  uint32_t slope;   //signed 16.16 format output voltage reset level correction per correction interval
} DevicePathLengthControlResetDelaySettings;

typedef struct _DevicePathLengthControlResetLevelSettings {
  uint32_t center;   //signed 16.16 format output voltage reset level
  uint32_t slope;   //signed 16.16 format output voltage reset level correction per correction interval
} DevicePathLengthControlResetLevelSettings;

typedef struct _DevicePathLengthControlResetConditionSettings {
  DevicePathLengthControlResetDelaySettings delay;
  DevicePathLengthControlResetLevelSettings level;
} DevicePathLengthControlResetConditionSettings;

typedef struct _DevicePathLengthControlResetSettings {
  DevicePathLengthControlResetConditionSettings cooling;
  DevicePathLengthControlResetConditionSettings heating;
} DevicePathLengthControlResetSettings;

typedef struct _DevicePathLengthControlResetState {
  uint32_t delay;   //reset delay in mks
  uint32_t level;   //signed 16.16 format output voltage reset level
} DevicePathLengthControlResetState;

typedef struct _DevicePathLengthControlReset {
  DevicePathLengthControlResetSettings settings;
  DevicePathLengthControlResetState state;
} DevicePathLengthControlReset;

//Path length control system modulator typedefs
typedef struct _DevicePathLengthControlModulatorSettings {
  uint8_t enabled;
} DevicePathLengthControlModulatorSettings;

typedef struct _DevicePathLengthControlModulatorState {
  uint8_t enabled;
} DevicePathLengthControlModulatorState;

typedef struct _DevicePathLengthControlModulator {
  DevicePathLengthControlModulatorSettings settings;
  DevicePathLengthControlModulatorState state;
} DevicePathLengthControlModulator;

//Path length control system regulator typedefs
typedef struct _DevicePathLengthControlRegulatorSettings {
  uint8_t enabled;
  uint32_t reference; //signed 16.16 format reference voltage
  uint32_t scale;     //signed 16.16 format regulator scale factor
} DevicePathLengthControlRegulatorSettings;

typedef struct _DevicePathLengthControlRegulatorState {
  uint8_t enabled;
  uint32_t reference; //signed 16.16 format reference voltage
  uint32_t scale;     //signed 16.16 format regulator scale factor
  uint32_t error;     //signed 16.16 format regulator error
} DevicePathLengthControlRegulatorState;

typedef struct _DevicePathLengthControlRegulator {
  DevicePathLengthControlRegulatorSettings settings;
  DevicePathLengthControlRegulatorState state;
} DevicePathLengthControlRegulator;

//Path length control system typedefs
//  Output signal ADC: device.controller.SSP.ADC[4]
//  Path length control system DAC: device.controller.SSP.DAC[1]
typedef struct _DevicePathLengthControlSystem {
  DevicePathLengthControlModulator modulator;
  DevicePathLengthControlAmplifier amplifier;
  DevicePathLengthControlReset reset;
  DevicePathLengthControlRegulator regulator;
} DevicePathLengthControlSystem;

//Path length control system functions
void InitPathLengthControlSystemWithDefaults(void);
void InitPathLengthControlSystem(void);
void StartPathLengthControlSystem(void);

#endif  /* __DEVICE_PLCS_H__ */