heat control  r71
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
comm.c File Reference
#include "comm.h"
#include "timer.h"
#include <util/crc16.h>
Include dependency graph for comm.c:

Go to the source code of this file.

Functions

void CommInit (void)
 init as defined in "doc4300.pdf": figure 12. Initialization of the Receive Driver More...
 
 ISR (PCINT_vect)
 pin change (PCINT8) interrupt service 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...
 
 ISR (USI_OVF_vect)
 USI counter overflow interrupt service - signals reception of one byte. 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)
 

Variables

UCHAR g_seq [SEQ_BUF_SIZE]
 
UCHAR volatile g_seqReady = FALSE
 

Function Documentation

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void DisablePcint8 ( void  )

disable pin change interrupt PCINT8

Definition at line 69 of file comm.c.

Referenced by ISR().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

void EnablePcint8 ( void  )

enable pin change interrupt PCINT8

Definition at line 60 of file comm.c.

Referenced by CommInit(), and ISR().

Here is the caller graph for this function:

void EnableUsi ( void  )

enable USI module for proper comm

Definition at line 84 of file comm.c.

References NUM_DB, T0_INC20, TCN_T0, and USI_CNTRNG.

Referenced by ISR().

Here is the caller graph for this function:

UCHAR GetSenderValues ( UINT innerTemp,
UINT outerTemp 
)

establish decimal temperature values form raw stream in sequence

Parameters
innerTempbuffer to inner temperature
outerTempbuffer to outer temperature
Returns
TRUE if both temperatures were valid, FALSE otherwise

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().

Here is the call graph for this function:

Here is the caller graph for this function:

ISR ( PCINT_vect  )

pin change (PCINT8) interrupt service

Parameters
PCINT_vectpin change interrupt vector

Definition at line 46 of file comm.c.

References DATABIT, DisablePcint8(), EnableUsi(), and TRUE.

Here is the call graph for this function:

ISR ( USI_OVF_vect  )

USI counter overflow interrupt service - signals reception of one byte.

Parameters
USI_OVF_vectusi counter overflow interrupt vector

Definition at line 101 of file comm.c.

References DisableUsi(), EnablePcint8(), FlipByte(), g_seq, g_seqReady, SEQ_BUF_SIZE, SEQ_END, SEQ_STA, TRUE, and UCHAR.

Here is the call graph for this function:

UCHAR PlausibilityCheck ( UINT  innerTemp,
UINT  outerTemp 
)

check plausibility of recently received temperatures against specific limits

Parameters
innerTempinner temperature
outerTempouter temperature
Returns
TRUE if both are plausible, FALSE otherwise

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.

Variable Documentation

indicator for available remote temperatures sequence buffer

Definition at line 18 of file comm.c.

Referenced by CalcCrc(), GetSenderValues(), and ISR().

UCHAR volatile g_seqReady = FALSE

indicator for a total received sequence

Definition at line 22 of file comm.c.

Referenced by GetSenderValues(), and ISR().