heat control  r71
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
types.h File Reference
#include <stdint.h>
#include <stdlib.h>
#include <avr/eeprom.h>
#include <avr/interrupt.h>
#include <avr/io.h>
#include "init.h"
Include dependency graph for types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  MEASSET
 
struct  HCREC
 
struct  ENG_TIMER
 
struct  CTRLSET
 

Macros

#define INC_TSEND_INIT   0
 
#define TINY_26   26
 
#define TINY_861   861
 
#define TINYCTRL   TINY_861
 
#define ADC_SR   ADCSRA
 
#define AC_SR   ACSRA
 
#define EE_AR   EEARL
 
#define TCN_T0   TCNT0L
 
#define TCC_R0   TCCR0B
 
#define SP_L   SPL
 
#define AD_FR   ADATE
 
#define USI_SIF   USICIF
 
#define EEM_WE   EEMPE
 
#define EE_WE   EEPE
 
#define CTC0   WGM00
 
#define CHAR   int8_t
 
#define UCHAR   uint8_t
 
#define INT   int16_t
 
#define UINT   uint16_t
 
#define LINT   int32_t
 
#define ULINT   uint32_t
 
#define FALSE   0
 
#define TRUE   1
 
#define BOOL   _Bool
 
#define INVALID_VAL_U16   0xFFFF
 
#define INVALID_VAL_I16   -32768
 
#define OP_MODES   7
 
#define NUM_MS   35
 
#define IV_MEAS   1
 
#define NUM_HR   70
 
#define IV_SHOW   1
 
#define OFF_NEAR   1
 
#define OFF_FAR   100
 
#define DIR_UP   1
 
#define DIR_DOWN   -1
 

Typedefs

typedef enum DATTYPE DATTYPE
 
typedef enum OP_MODE OP_MODE
 
typedef enum ENG_MODE ENG_MODE
 
typedef struct MEASSET MEASSET
 
typedef struct HCREC HCREC
 
typedef enum CTRL_MODE CTRL_MODE
 
typedef enum DEB_STATE DEB_STATE
 
typedef enum BTN_CODE BTN_CODE
 
typedef struct ENG_TIMER ENG_TIMER
 
typedef struct CTRLSET CTRLSET
 

Enumerations

enum  DATTYPE {
  DT_UCHAR = 0, DT_CHAR, DT_UINT, DT_INT,
  DT_FLOAT, DT_STRING, DT_TIME
}
 
enum  OP_MODE {
  OM_TMPCTRL = 0, OM_ENGTEST, OM_SHMEAS, OM_CONTI,
  OM_SENDER, OM_MXPOS, OM_SETUP
}
 
enum  ENG_MODE { EM_STOP = 0, EM_CCW, EM_CW }
 
enum  CTRL_MODE {
  CM_DENY = 0, CM_MEAS, CM_REC, CM_FOR,
  CM_SHDN
}
 
enum  DEB_STATE { DS_DEBOUNCED = 0, DS_DEBOUNCING }
 
enum  BTN_CODE {
  BC_NONE = 0, BC_DN, BC_UP, BC_DNUP,
  BC_DNUP_L
}
 

Functions

UINT SetLimitValue (UINT val, DATTYPE dt, CHAR dir, INT min, INT max)
 limiting values to constraints More...
 
UCHAR FlipByte (UCHAR x)
 reverse bits in a byte (make it RS232 conform for transmission) More...
 
UCHARGetCtrlMode (CTRL_MODE ctm, UCHAR *buf)
 

Macro Definition Documentation

#define AC_SR   ACSRA

Definition at line 44 of file types.h.

Referenced by Init().

#define AD_FR   ADATE

Definition at line 49 of file types.h.

Referenced by AdcInit().

#define ADC_SR   ADCSRA

controller dependent meta register naming

Definition at line 43 of file types.h.

Referenced by AdcInit(), and StartAdcConversion().

#define BOOL   _Bool

data type support for boolean

Definition at line 101 of file types.h.

#define CHAR   int8_t

data type support for signed char

Definition at line 69 of file types.h.

Referenced by CalcPrevIndex(), main(), and SetLimitValue().

#define CTC0   WGM00

Definition at line 53 of file types.h.

Referenced by TimerInit().

#define DIR_DOWN   -1

value signaling down direction

Definition at line 382 of file types.h.

Referenced by DoSetup().

#define DIR_UP   1

value signaling up direction

Definition at line 378 of file types.h.

Referenced by DoSetup(), and main().

#define EE_AR   EEARL

Definition at line 45 of file types.h.

#define EE_WE   EEPE

Definition at line 52 of file types.h.

#define EEM_WE   EEMPE

Definition at line 51 of file types.h.

#define FALSE   0

data type support for boolean false

Definition at line 93 of file types.h.

Referenced by DecodeButton(), GetSenderValues(), ISR(), main(), and PlausibilityCheck().

#define INC_TSEND_INIT   0

control application data inclusion INC_TSEND_INIT = 1 -> project is being built for tsend, for heat control otherwise

Definition at line 13 of file types.h.

Referenced by ProcessNextConversion().

#define INT   int16_t

data type support for signed integer

Definition at line 77 of file types.h.

Referenced by DoControl(), FindForeRun(), and SetLimitValue().

#define INVALID_VAL_I16   -32768

invalid value signed integer

Definition at line 109 of file types.h.

Referenced by Init(), and main().

#define INVALID_VAL_U16   0xFFFF

invalid value unsigned integer

Definition at line 105 of file types.h.

Referenced by CalcAdcTemp(), CalcSupplyVoltage(), DoControl(), FindForeRun(), GetSenderValues(), Init(), main(), PlausibilityCheck(), and ProcessNextConversion().

#define IV_MEAS   1

measurement interval (minutes)

Definition at line 228 of file types.h.

#define IV_SHOW   1

SMI: interval in seconds to show meas values from memory

Definition at line 282 of file types.h.

#define LINT   int32_t

data type support for signed long integer

Definition at line 85 of file types.h.

#define NUM_HR   70

number of heating curve recordings

Definition at line 249 of file types.h.

Referenced by DoControl(), and main().

#define NUM_MS   35

number of measurement sets (limited by available RAM)

Definition at line 223 of file types.h.

Referenced by CalcPrevIndex(), Init(), ISR(), and main().

#define OFF_FAR   100

large offset value

Definition at line 374 of file types.h.

Referenced by SetLimitValue().

#define OFF_NEAR   1

small offset value

Definition at line 370 of file types.h.

Referenced by SetLimitValue().

#define OP_MODES   7

number of operation modes, must always match the number of defined ones in struct OP_MODE

Definition at line 184 of file types.h.

Referenced by DoSetup(), and main().

#define SP_L   SPL

Definition at line 48 of file types.h.

#define TCC_R0   TCCR0B

Definition at line 47 of file types.h.

Referenced by TimerInit().

#define TCN_T0   TCNT0L

Definition at line 46 of file types.h.

Referenced by EnableUsi().

#define TINY_26   26

application specific data for heat control compiler switch tiny26

Definition at line 30 of file types.h.

#define TINY_861   861

compiler switch tiny861

Definition at line 34 of file types.h.

#define TINYCTRL   TINY_861

use of compiler switch tiny26/tiny861

Definition at line 38 of file types.h.

#define TRUE   1

data type support for boolean true

Definition at line 97 of file types.h.

Referenced by DecodeButton(), DoControl(), GetSenderValues(), ISR(), main(), PlausibilityCheck(), PrintPage(), SetMux(), SetupInit(), and StartAdcConversion().

#define UINT   uint16_t

data type support for unsigned integer

Definition at line 81 of file types.h.

Referenced by _exp10(), CalcAdcTemp(), CalcSupplyVoltage(), DecodeButton(), DoControl(), ISR(), main(), ntofa(), PlausibilityCheck(), and SetLimitValue().

#define ULINT   uint32_t

data type support for unsigned long integer

Definition at line 89 of file types.h.

#define USI_SIF   USICIF

Definition at line 50 of file types.h.

Typedef Documentation

typedef enum BTN_CODE BTN_CODE

button codes

typedef enum CTRL_MODE CTRL_MODE

control modes

typedef struct CTRLSET CTRLSET

control set, puts all control parameters together

typedef enum DATTYPE DATTYPE

supported data types

typedef enum DEB_STATE DEB_STATE

debounce states

typedef enum ENG_MODE ENG_MODE

engine driver mode

typedef struct ENG_TIMER ENG_TIMER

time dependent mixer engine control

typedef struct HCREC HCREC

unit for heating curve recording (in eeprom)

typedef struct MEASSET MEASSET

unit for time based temperature measurement

typedef enum OP_MODE OP_MODE

operation modes

Enumeration Type Documentation

enum BTN_CODE

button codes

Enumerator
BC_NONE 

no button

BC_DN 

just the down button

BC_UP 

just the up button

BC_DNUP 

up and down button simultaneously

BC_DNUP_L 

up and down button simultaneously for a longer period of time

Definition at line 299 of file types.h.

enum CTRL_MODE

control modes

Enumerator
CM_DENY 

disallow any controlling

CM_MEAS 

measurement mode (capturing new temp values)

CM_REC 

recording mode (record heating curve)

CM_FOR 

controlling the forerun temperature

CM_SHDN 

system is shutting or shut down

Definition at line 253 of file types.h.

enum DATTYPE

supported data types

Enumerator
DT_UCHAR 

unsigned character

DT_CHAR 

signed character

DT_UINT 

unsigned integer

DT_INT 

signed integer

DT_FLOAT 

floating point number

DT_STRING 

text based ascii string

DT_TIME 

time stamp

Definition at line 113 of file types.h.

enum DEB_STATE

debounce states

Enumerator
DS_DEBOUNCED 

debouncing is done (debounce counter runs untriggered)

DS_DEBOUNCING 

debouncing is currenly active (debounce counter running triggered - from init value)

Definition at line 286 of file types.h.

enum ENG_MODE

engine driver mode

Enumerator
EM_STOP 

run counter clockwise (opening the mixer valve)

EM_CCW 

engine stopped (most common case of controlling)

EM_CW 

run clockwise (closing the mixer valve)

Definition at line 188 of file types.h.

enum OP_MODE

operation modes

Enumerator
OM_TMPCTRL 

temperature controlling (m0)

OM_ENGTEST 

mixer engine testing (m1)

OM_SHMEAS 

show measurement values (from RAM) (m2)

OM_CONTI 

show control mode continuous measurement (m3)

OM_SENDER 

show meas values from temperature sender (m4)

OM_MXPOS 

show mixer step, representing position as angle (m5)

OM_SETUP 

setting up measurement and control defaults (m6)

Definition at line 146 of file types.h.

Function Documentation

UCHAR FlipByte ( UCHAR  x)

reverse bits in a byte (make it RS232 conform for transmission)

Parameters
xbyte to be reversed
Returns
the flipped byte

Definition at line 53 of file types.c.

Referenced by ISR().

Here is the caller graph for this function:

UCHAR* GetCtrlMode ( CTRL_MODE  ctm,
UCHAR buf 
)

resolve a control mode to hrf string

Parameters
ctmcontrol mode to resolve
bufresolved control mode, must have at least 5 bytes allocated

Definition at line 65 of file types.c.

References CM_DENY, CM_FOR, CM_MEAS, CM_REC, CM_SHDN, and UCHAR.

Referenced by main().

Here is the caller graph for this function:

UINT SetLimitValue ( UINT  val,
DATTYPE  dt,
CHAR  dir,
INT  min,
INT  max 
)

limiting values to constraints

Parameters
valvalue to be limited
dtdata type of value val
dirdirection (increment=1 or decrement=-1) of value modification
minlower value limit
maxupper value limit
Returns

Definition at line 13 of file types.c.

References CHAR, DT_CHAR, DT_INT, DT_UCHAR, DT_UINT, INT, OFF_FAR, OFF_NEAR, UCHAR, and UINT.

Referenced by DoSetup(), and main().

Here is the caller graph for this function: