heat control
r71
|
#include "types.h"
Go to the source code of this file.
Macros | |
#define | DATABIT (PINB & _BV(PCINT8)) |
#define | NUM_DB 8 |
#define | USI_CNTRNG 16 |
#define | SEQ_BUF_SIZE 9 |
#define | SEQ_STA 0x02 |
#define | SEQ_END 0x03 |
#define | TEMP_CH1_VAL_H_ID 1 |
#define | TEMP_CH1_VAL_L_ID 2 |
#define | TEMP_CH2_VAL_H_ID 3 |
#define | TEMP_CH2_VAL_L_ID 4 |
#define | SUP_VOLT_VAL_H_ID 5 |
#define | SUP_VOLT_VAL_L_ID 6 |
#define | CRC_OVER_ALL 7 |
#define | MAX_ABS_INNER_TEMP 32500 |
#define | MIN_ABS_INNER_TEMP 11900 |
#define | MAX_ABS_OUTER_TEMP 32500 |
#define | MIN_ABS_OUTER_TEMP (INVALID_VAL_U16 - ((UINT)-15000)) |
#define | MAX_DEL_INNER_TEMP 400 |
#define | MAX_DEL_OUTER_TEMP 500 |
Functions | |
void | CommInit (void) |
init as defined in "doc4300.pdf": figure 12. Initialization of the Receive Driver More... | |
void | EnablePcint8 (void) |
enable pin change interrupt PCINT8 More... | |
void | DisablePcint8 (void) |
disable pin change interrupt PCINT8 More... | |
void | DisableUsi (void) |
disable USI module, there's no specific flag to do so -> disabling what can be done More... | |
void | EnableUsi (void) |
enable USI module for proper comm More... | |
UCHAR | GetSenderValues (UINT *innerTemp, UINT *outerTemp) |
establish decimal temperature values form raw stream in sequence More... | |
UCHAR | PlausibilityCheck (UINT innerTemp, UINT outerTemp) |
check plausibility of recently received temperatures against specific limits More... | |
UCHAR | CalcCrc (void) |
#define CRC_OVER_ALL 7 |
#define DATABIT (PINB & _BV(PCINT8)) |
#define MAX_ABS_INNER_TEMP 32500 |
#define MAX_ABS_OUTER_TEMP 32500 |
#define MAX_DEL_INNER_TEMP 400 |
maximum allowed inner delta temperature between two measurements
Definition at line 86 of file comm.h.
Referenced by PlausibilityCheck().
#define MAX_DEL_OUTER_TEMP 500 |
minimum allowed outer delta temperature between two measurements
Definition at line 90 of file comm.h.
Referenced by DoControl(), and PlausibilityCheck().
#define MIN_ABS_INNER_TEMP 11900 |
minimum allowed absolute inner temperature
Definition at line 74 of file comm.h.
Referenced by PlausibilityCheck().
#define MIN_ABS_OUTER_TEMP (INVALID_VAL_U16 - ((UINT)-15000)) |
minimum allowed absolute outer temperature
Definition at line 82 of file comm.h.
Referenced by PlausibilityCheck().
#define NUM_DB 8 |
number of data bits in serial frame (asynchronous parameter)
Definition at line 20 of file comm.h.
Referenced by EnableUsi().
#define SEQ_BUF_SIZE 9 |
#define SEQ_END 0x03 |
#define SEQ_STA 0x02 |
#define SUP_VOLT_VAL_H_ID 5 |
#define SUP_VOLT_VAL_L_ID 6 |
#define TEMP_CH1_VAL_H_ID 1 |
temperature high byte positioning ch1
Definition at line 40 of file comm.h.
Referenced by CalcCrc(), and GetSenderValues().
#define TEMP_CH1_VAL_L_ID 2 |
temperature low byte positioning ch1
Definition at line 44 of file comm.h.
Referenced by CalcCrc(), and GetSenderValues().
#define TEMP_CH2_VAL_H_ID 3 |
temperature high byte positioning ch2
Definition at line 48 of file comm.h.
Referenced by CalcCrc(), and GetSenderValues().
#define TEMP_CH2_VAL_L_ID 4 |
temperature low byte positioning ch2
Definition at line 52 of file comm.h.
Referenced by CalcCrc(), and GetSenderValues().
#define USI_CNTRNG 16 |
UCHAR CalcCrc | ( | void | ) |
Definition at line 180 of file comm.c.
References CRC_OVER_ALL, g_seq, SUP_VOLT_VAL_H_ID, SUP_VOLT_VAL_L_ID, TEMP_CH1_VAL_H_ID, TEMP_CH1_VAL_L_ID, TEMP_CH2_VAL_H_ID, TEMP_CH2_VAL_L_ID, and UCHAR.
Referenced by GetSenderValues().
void CommInit | ( | void | ) |
init as defined in "doc4300.pdf": figure 12. Initialization of the Receive Driver
Definition at line 27 of file comm.c.
References DisableUsi(), and EnablePcint8().
Referenced by Init().
void DisablePcint8 | ( | void | ) |
void DisableUsi | ( | void | ) |
disable USI module, there's no specific flag to do so -> disabling what can be done
Definition at line 76 of file comm.c.
Referenced by CommInit(), and ISR().
void EnablePcint8 | ( | void | ) |
enable pin change interrupt PCINT8
Definition at line 60 of file comm.c.
Referenced by CommInit(), and ISR().
void EnableUsi | ( | void | ) |
establish decimal temperature values form raw stream in sequence
innerTemp | buffer to inner temperature |
outerTemp | buffer to outer temperature |
Definition at line 133 of file comm.c.
References CalcCrc(), FALSE, g_seq, g_seqReady, INVALID_VAL_U16, TEMP_CH1_VAL_H_ID, TEMP_CH1_VAL_L_ID, TEMP_CH2_VAL_H_ID, TEMP_CH2_VAL_L_ID, TRUE, and UCHAR.
Referenced by main().
check plausibility of recently received temperatures against specific limits
innerTemp | inner temperature |
outerTemp | outer temperature |
Definition at line 162 of file comm.c.
References FALSE, INVALID_VAL_U16, MAX_DEL_INNER_TEMP, MAX_DEL_OUTER_TEMP, MIN_ABS_INNER_TEMP, MIN_ABS_OUTER_TEMP, TRUE, UCHAR, and UINT.