123

Dependencies:   mbed

Fork of LG by igor Apu

Revision:
77:8d582faecf6b
Parent:
76:1c54a614564d
Child:
78:0ea9d02b7b46
diff -r 1c54a614564d -r 8d582faecf6b Device.h
--- a/Device.h	Mon Feb 29 02:43:14 2016 +0000
+++ b/Device.h	Sat Mar 05 14:36:42 2016 +0000
@@ -5,39 +5,66 @@
 #include "DeviceProtocol.h"
 
 typedef enum _DeviceLatchMode {
-    DeviceLatch10kHz,//internal latch  by pulses 10 kHz (power on default mode)
-    DeviceLatchMeander,   //internal latch by signed meander pulses
-    DeviceLatchRS422,     //external latch by RS422 B_Delta_PS request
-    DeviceLatchPulse      //external latch by pulse request
+    DeviceLatch10kHz,   //internal latch  by pulses 10 kHz (power on default mode)
+    DeviceLatchMeander, //internal latch by signed meander pulses (not used?)
+    DeviceLatchRS422,   //external latch by RS422 request
+    DeviceLatchPin      //external latch by hardware pin request
 } DeviceLatchMode;
 
-typedef enum _DeviceDeltaMode {
-    DeviceDeltaModePS,
-    DeviceDeltaModeBINS,
-    DeviceDeltaModeSF
-} DeviceDeltaMode;
+typedef enum _DeviceLatchFormat {
+    DeviceLatchFormatDeltaPS,   //latch data in DELTA_PS response format
+    DeviceLatchFormatDeltaBINS, //latch data in DELTA_BINS response format
+    DeviceLatchFormatDeltaSF    //latch data in DELTA_SF response format
+} DeviceLatchFormat;
 
 typedef struct _DeviceLatchState {
     uint8_t ready;
-    DeviceLatchMode mode;
+    DeviceLatchMode mode;     //latch source
+    DeviceLatchFormat format; //data to latch
+    uint8_t reset;            //set to reset counters on each latch (default), clear to keep (DELTA_SF)
 } DeviceLatchState;
 
 typedef struct _DeviceCountersState {
-    //Latch
-    DeviceLatchState latch;
-    //Delta command mode
-    DeviceDeltaMode deltaMode;
+    
 } DeviceCountersState;
 
+typedef struct _DevicePhotoDetectorState {
+    
+} DevicePhotoDetectorState;
+
+typedef struct _DeviceLightUpState {
+    
+} DeviceLightUpState;
+
+typedef struct _DeviceHFOState {
+
+} DeviceHFOState;
+
+typedef struct _DevicePLCSState {
+    
+} DevicePLCSState;
+
+typedef struct _DeviceDitherState {
+    
+} DeviceDitherState;
+
 typedef struct _Device {
+  //Settings
   DeviceSettings settings;
-  
+  //Communication
   DeviceRequest request;
   DeviceResponse response;
   DeviceProtocolDecoder decoder;
   DeviceProtocolEncoder encoder;
-  
+  //Counting
+  DeviceLatchState latch;
   DeviceCountersState counters;
+  //Regulators
+  DevicePhotoDetectorState detector;
+  DeviceLightUpState lightUp;
+  DeviceHFOState hfo;
+  DevicePLCSState plcs;
+  DeviceDitherState dither;
 } Device;
 
 #endif  /* __DEVICE_H__ */
\ No newline at end of file