heat control  r71
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
comm.h
Go to the documentation of this file.
1 /*
2  * comm.h
3  *
4  * Created on: Jan 2, 2014
5  * Author: woodz
6  */
7 
8 #ifndef COMM_H_
9 #define COMM_H_
10 
11 #include "types.h"
12 
16 #define DATABIT (PINB & _BV(PCINT8))
17 
20 #define NUM_DB 8
21 
24 #define USI_CNTRNG 16
25 
28 #define SEQ_BUF_SIZE 9
29 
32 #define SEQ_STA 0x02
33 
36 #define SEQ_END 0x03
37 
40 #define TEMP_CH1_VAL_H_ID 1
41 
44 #define TEMP_CH1_VAL_L_ID 2
45 
48 #define TEMP_CH2_VAL_H_ID 3
49 
52 #define TEMP_CH2_VAL_L_ID 4
53 
56 #define SUP_VOLT_VAL_H_ID 5
57 
60 #define SUP_VOLT_VAL_L_ID 6
61 
64 #define CRC_OVER_ALL 7
65 /*receiver plausibility check
66 values below are limits against those any received sequence is checked*/
70 #define MAX_ABS_INNER_TEMP 32500
71 
74 #define MIN_ABS_INNER_TEMP 11900
75 
78 #define MAX_ABS_OUTER_TEMP 32500
79 
82 #define MIN_ABS_OUTER_TEMP (INVALID_VAL_U16 - ((UINT)-15000))
83 
86 #define MAX_DEL_INNER_TEMP 400
87 
90 #define MAX_DEL_OUTER_TEMP 500
91 
93 //#define OAHBT (T0_INC20 + (T0_INC20 / 2))
95 //#define MAX_STB_CNT (T0_TOP - OAHBT)
96 
97 //initialize communication resource
98 void CommInit(void);
99 void EnablePcint8(void);
100 void DisablePcint8(void);
101 void DisableUsi(void);
102 void EnableUsi(void);
103 UCHAR GetSenderValues(UINT* innerTemp, UINT* outerTemp/*, UINT* supVolt*/);
104 UCHAR PlausibilityCheck(UINT innerTemp, UINT outerTemp);
105 UCHAR CalcCrc(void);
106 //UCHAR StartBitElapsed(UCHAR started);
107 
108 #endif /* COMM_H_ */
void DisablePcint8(void)
disable pin change interrupt PCINT8
Definition: comm.c:69
void DisableUsi(void)
disable USI module, there's no specific flag to do so -> disabling what can be done ...
Definition: comm.c:76
#define UCHAR
Definition: types.h:73
void EnableUsi(void)
enable USI module for proper comm
Definition: comm.c:84
UCHAR CalcCrc(void)
Definition: comm.c:180
UCHAR GetSenderValues(UINT *innerTemp, UINT *outerTemp)
establish decimal temperature values form raw stream in sequence
Definition: comm.c:133
#define UINT
Definition: types.h:81
UCHAR PlausibilityCheck(UINT innerTemp, UINT outerTemp)
check plausibility of recently received temperatures against specific limits
Definition: comm.c:162
void CommInit(void)
init as defined in "doc4300.pdf": figure 12. Initialization of the Receive Driver ...
Definition: comm.c:27
void EnablePcint8(void)
enable pin change interrupt PCINT8
Definition: comm.c:60