123

Dependencies:   mbed

Fork of LG by igor Apu

DeviceTSS.h

Committer:
Kovalev_D
Date:
2016-10-19
Revision:
197:7a05523bf588
Parent:
174:0f86eedd511c

File content as of revision 197:7a05523bf588:

#ifndef __DEVICE_TSS_H__
#define __DEVICE_TSS_H__

typedef struct _DeviceTSSTransferFunction {
  int32_t points;      //Used points count
  int32_t raw[16];     //ADC code
  int32_t celsius[16]; //Temperature - degrees in 16.16 format
} DeviceTSSTransferFunction;

typedef struct _DeviceTSSTemperatureSettings {
  DeviceTSSTransferFunction transfer;
} DeviceTSSTemperatureSettings;

typedef struct _DeviceTSSTemperatureState {
  int32_t sum;         //Sum of last 32 temperature measurements - ADC code
  int32_t raw;         //Average temperature - ADC code
  int32_t celsius;     //Average temperature - degrees in 16.16 format
} DeviceTSSTemperatureState;

typedef struct _DeviceTSSTemperature {
  DeviceTSSTemperatureSettings settings;
  DeviceTSSTemperatureState state;
} DeviceTSSTemperature;

typedef struct _DeviceTSSGradientSettings {
  DeviceTSSTransferFunction transfer;
} DeviceTSSGradientSettings;

typedef struct _DeviceTSSGradientState {
  int32_t sum;         //Sum of last 32 gradient measurements - ADC code
  int32_t raw;         //Average gradient - ADC code
  int32_t celsius;     //Average gradient - degrees in 16.16 format
} DeviceTSSGradientState;

typedef struct _DeviceTSSGradient {
  DeviceTSSGradientSettings settings;
  DeviceTSSGradientState state;
} DeviceTSSGradient;

typedef struct _DeviceTSS {
  DeviceTSSTemperature temperature;
  DeviceTSSGradient gradient;
} DeviceTSS;

void InitTSSDefaultSettings(void);
void InitTSSState(void);
void DeviceStartTSS(void);

void tssProcess(void);

#endif  /* __DEVICE_TSS_H__ */