123

Dependencies:   mbed

Fork of LG by igor Apu

Device.h

Committer:
Diletant
Date:
2016-02-27
Revision:
74:f4d9c3403578
Child:
76:1c54a614564d

File content as of revision 74:f4d9c3403578:

#ifndef __DEVICE_H__
#define __DEVICE_H__

#include "DeviceSettings.h"
#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
} DeviceLatchMode;

typedef enum _DeviceDeltaMode {
    DeviceDeltaModePS,
    DeviceDeltaModeBINS,
    DeviceDeltaModeSF
} DeviceDeltaMode;

typedef struct _DeviceLatchState {
    //Latch mode
    DeviceLatchMode mode;
} DeviceLatchState;

typedef struct _DeviceCountersState {
    //Latch
    DeviceLatchState latch;
    //Delta command mode
    DeviceDeltaMode deltaMode;
} DeviceCountersState;

typedef struct _Device {
  DeviceSettings settings;
  
  DeviceRequest request;
  DeviceResponse response;
  DeviceProtocolDecoder decoder;
  DeviceProtocolEncoder encoder;
  
  DeviceCountersState counters;
} Device;

#endif  /* __DEVICE_H__ */