123

Dependencies:   mbed

Fork of LG by igor Apu

Revision:
182:2bd8ec44998f
Parent:
177:672ef279c8e0
Child:
183:c7a9c309086c
--- a/Device.h	Fri Jul 08 14:58:17 2016 +0000
+++ b/Device.h	Sun Jul 10 05:35:08 2016 +0000
@@ -5,7 +5,7 @@
 //#include "system_LPC17xx.h"
 #include "DeviceController.h"
 //#include "DeviceDAC.h"
-#include "DeviceUserProtocol.h"
+#include "DeviceUser.h"
 #include "DeviceCounters.h"
 #include "DeviceDither.h"
 #include "DeviceLightUp.h"
@@ -17,36 +17,12 @@
 #include "DeviceErrorModel.h"
 //#include "DeviceDebug.h"
 
-typedef enum _DeviceLatchMode {
-  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 _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;       //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 enum _DeviceCountingSource {
-  DeviceCountingSourceReference, //Accumulate pulses using reference +/- counters as source
-  DeviceCountingSourceDither,    //Accumulate pulses using dither counters as source
-} DeviceCountingSource;
-
-//Device service communication typedefs
-typedef struct _Service {
+//Device service communication interface typedefs
+typedef struct _DeviceService {
   char buffer[512];
   uint16_t position; //Transmission position
-} Service;
+  DeviceServicePort port;
+} DeviceService;
 
 //Device measurement cycle typedefs
 typedef struct _DeviceMeasurementCycle {
@@ -91,14 +67,13 @@
   DeviceMeasurementCycle measurement;
   //Control cycle
   DeviceRegularCycle regular;
-  //Counting
-  //DeviceLatchState latch;
+  //Counters
   DeviceCounters counters;
   //Controller
   DeviceController controller;
-  //Protocols
-  Service service;            //Service communication protocol - asynchronous serial port 0
-  DeviceUserProtocol user;    //User communication protocol - asynchronous serial port 1
+  //Interfaces
+  DeviceService service;      //Service communication interface - asynchronous serial port 0
+  DeviceUser user;            //User communication interface - asynchronous serial port 1
   //Units
   DeviceSensor sensor;        //Sensor info
   DeviceLightUp lightUp;      //Light-up system
@@ -120,7 +95,7 @@
   uint32_t size;
 } HashParam;
 
-#define HASH_PARAM_COUNT 884
+#define HASH_PARAM_COUNT 886
 
 typedef struct _HashFunc {
   uint32_t hash;