123

Dependencies:   mbed

Fork of LG by igor Apu

Committer:
Diletant
Date:
Sun Mar 06 19:09:51 2016 +0000
Revision:
78:0ea9d02b7b46
Parent:
77:8d582faecf6b
Child:
82:82d7073d36ef
Device&Settings&Protocol&UART update. Not final!!!

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Diletant 74:f4d9c3403578 1 #ifndef __DEVICE_H__
Diletant 74:f4d9c3403578 2 #define __DEVICE_H__
Diletant 74:f4d9c3403578 3
Diletant 74:f4d9c3403578 4 #include "DeviceSettings.h"
Diletant 74:f4d9c3403578 5 #include "DeviceProtocol.h"
Diletant 78:0ea9d02b7b46 6 #include "DeviceUART.h"
Diletant 74:f4d9c3403578 7
Diletant 74:f4d9c3403578 8 typedef enum _DeviceLatchMode {
Diletant 77:8d582faecf6b 9 DeviceLatch10kHz, //internal latch by pulses 10 kHz (power on default mode)
Diletant 77:8d582faecf6b 10 DeviceLatchMeander, //internal latch by signed meander pulses (not used?)
Diletant 77:8d582faecf6b 11 DeviceLatchRS422, //external latch by RS422 request
Diletant 77:8d582faecf6b 12 DeviceLatchPin //external latch by hardware pin request
Diletant 74:f4d9c3403578 13 } DeviceLatchMode;
Diletant 74:f4d9c3403578 14
Diletant 77:8d582faecf6b 15 typedef enum _DeviceLatchFormat {
Diletant 77:8d582faecf6b 16 DeviceLatchFormatDeltaPS, //latch data in DELTA_PS response format
Diletant 77:8d582faecf6b 17 DeviceLatchFormatDeltaBINS, //latch data in DELTA_BINS response format
Diletant 77:8d582faecf6b 18 DeviceLatchFormatDeltaSF //latch data in DELTA_SF response format
Diletant 77:8d582faecf6b 19 } DeviceLatchFormat;
Diletant 74:f4d9c3403578 20
Diletant 74:f4d9c3403578 21 typedef struct _DeviceLatchState {
Diletant 76:1c54a614564d 22 uint8_t ready;
Diletant 77:8d582faecf6b 23 DeviceLatchMode mode; //latch source
Diletant 77:8d582faecf6b 24 DeviceLatchFormat format; //data to latch
Diletant 77:8d582faecf6b 25 uint8_t reset; //set to reset counters on each latch (default), clear to keep (DELTA_SF)
Diletant 74:f4d9c3403578 26 } DeviceLatchState;
Diletant 74:f4d9c3403578 27
Diletant 74:f4d9c3403578 28 typedef struct _DeviceCountersState {
Diletant 77:8d582faecf6b 29
Diletant 74:f4d9c3403578 30 } DeviceCountersState;
Diletant 74:f4d9c3403578 31
Diletant 77:8d582faecf6b 32 typedef struct _DevicePhotoDetectorState {
Diletant 77:8d582faecf6b 33
Diletant 77:8d582faecf6b 34 } DevicePhotoDetectorState;
Diletant 77:8d582faecf6b 35
Diletant 77:8d582faecf6b 36 typedef struct _DeviceLightUpState {
Diletant 77:8d582faecf6b 37
Diletant 77:8d582faecf6b 38 } DeviceLightUpState;
Diletant 77:8d582faecf6b 39
Diletant 77:8d582faecf6b 40 typedef struct _DeviceHFOState {
Diletant 77:8d582faecf6b 41
Diletant 77:8d582faecf6b 42 } DeviceHFOState;
Diletant 77:8d582faecf6b 43
Diletant 77:8d582faecf6b 44 typedef struct _DevicePLCSState {
Diletant 77:8d582faecf6b 45
Diletant 77:8d582faecf6b 46 } DevicePLCSState;
Diletant 77:8d582faecf6b 47
Diletant 77:8d582faecf6b 48 typedef struct _DeviceDitherState {
Diletant 77:8d582faecf6b 49
Diletant 77:8d582faecf6b 50 } DeviceDitherState;
Diletant 77:8d582faecf6b 51
Diletant 74:f4d9c3403578 52 typedef struct _Device {
Diletant 77:8d582faecf6b 53 //Settings
Diletant 74:f4d9c3403578 54 DeviceSettings settings;
Diletant 77:8d582faecf6b 55 //Communication
Diletant 78:0ea9d02b7b46 56 DeviceUARTState uart;
Diletant 74:f4d9c3403578 57 DeviceRequest request;
Diletant 74:f4d9c3403578 58 DeviceResponse response;
Diletant 74:f4d9c3403578 59 DeviceProtocolDecoder decoder;
Diletant 74:f4d9c3403578 60 DeviceProtocolEncoder encoder;
Diletant 77:8d582faecf6b 61 //Counting
Diletant 77:8d582faecf6b 62 DeviceLatchState latch;
Diletant 74:f4d9c3403578 63 DeviceCountersState counters;
Diletant 77:8d582faecf6b 64 //Regulators
Diletant 77:8d582faecf6b 65 DevicePhotoDetectorState detector;
Diletant 77:8d582faecf6b 66 DeviceLightUpState lightUp;
Diletant 77:8d582faecf6b 67 DeviceHFOState hfo;
Diletant 77:8d582faecf6b 68 DevicePLCSState plcs;
Diletant 77:8d582faecf6b 69 DeviceDitherState dither;
Diletant 74:f4d9c3403578 70 } Device;
Diletant 74:f4d9c3403578 71
Diletant 74:f4d9c3403578 72 #endif /* __DEVICE_H__ */