1 |
/* mija 2009 - header for proces.c |
1 |
/* mija 2009 - header for proces.c |
2 |
|
2 |
|
3 |
SW pro ATmega8 mereni + regulace teploty |
3 |
SW pro ATmega8 mereni + regulace teploty |
4 |
Fosc = 8192000Hz externi krystal |
4 |
Fosc = 8192000Hz externi krystal |
5 |
|
5 |
|
6 |
ver.: 0.0 - start |
6 |
ver.: 0.0 - start |
7 |
|
7 |
|
8 |
*/ |
8 |
*/ |
9 |
|
9 |
|
10 |
#ifndef __process_h_included__ |
10 |
#ifndef __process_h_included__ |
11 |
#define __process_h_included__ |
11 |
#define __process_h_included__ |
12 |
|
12 |
|
13 |
#include "clock.h" // struc Clock_t |
13 |
#include "clock.h" // struc Clock_t |
14 |
|
14 |
|
15 |
#define POSITIVTIME 15 //minuty |
15 |
#define POSITIVTIME 15 //minuty |
16 |
#define DRYTIME 120 //minuty |
16 |
#define DRYTIME 120 //minuty |
17 |
|
17 |
|
18 |
#define POSITIVTEMP 70 //°C |
18 |
#define POSITIVTEMP 70 //°C |
19 |
#define DRYTEMP 80 //°C |
19 |
#define DRYTEMP 80 //°C |
20 |
|
20 |
|
21 |
#define PREHEATTEMPSTART 100 |
21 |
#define PREHEATTEMPSTART 100 |
22 |
#define PREHEATTEMPSTOP 150 |
22 |
#define PREHEATTEMPSTOP 150 |
23 |
#define PREHEATTIMEOFF 50 //sec |
23 |
#define PREHEATTIMEOFF 50 //sec |
24 |
|
24 |
|
25 |
#define PREHEATTEMP 126 //°C |
25 |
#define PREHEATTEMP 126 //°C |
26 |
|
26 |
|
27 |
#define PREHEATTIME 120 //sec |
27 |
#define PREHEATTIME 120 //sec |
28 |
|
28 |
|
29 |
#define SOLDERTEMPSTART 183 |
29 |
#define SOLDERTEMPSTART 183 |
30 |
#define SOLDERTEMPSTOP 180 |
30 |
#define SOLDERTEMPSTOP 180 |
31 |
|
31 |
|
32 |
#define SOLDERTEMP 206 //°C |
32 |
#define SOLDERTEMP 206 //°C |
33 |
#define SOLDERTIME 10 //sec |
33 |
#define SOLDERTIME 10 //sec |
34 |
|
34 |
|
35 |
#define COOLTEMP 50 //°C |
35 |
#define COOLTEMP 50 //°C |
36 |
#define COOLTIME 10 //sec |
36 |
#define COOLTIME 10 //sec |
37 |
|
37 |
|
38 |
#define HEAT PD7 |
38 |
#define HEAT PD7 |
39 |
#define HEAT_DDR DDRD |
39 |
#define HEAT_DDR DDRD |
40 |
#define HEAT_PORT PORTD |
40 |
#define HEAT_PORT PORTD |
41 |
|
41 |
|
42 |
#define MAXDISPLBUFFER 20 //buffer pro lcd display |
42 |
#define MAXDISPLBUFFER 20 //buffer pro lcd display |
43 |
|
43 |
|
44 |
enum{START=0,SOLDER,POSITIV,DRY}; //main proces |
44 |
enum{START=0,SOLDER,POSITIV,DRY}; //main proces |
45 |
|
45 |
|
46 |
uint8_t ProcesStart(char *buffer,uint8_t key,uint16_t temp); |
46 |
uint8_t ProcesStart(char *buffer,uint8_t key,uint16_t temp); |
47 |
uint8_t ProcesSolder(char *buffer,uint8_t key,uint16_t temp,Clockt_t *clock); |
47 |
uint8_t ProcesSolder(char *buffer,uint8_t key,uint16_t temp,Clockt_t *clock); |
48 |
uint8_t ProcesPositiv(char *buffer,uint8_t key,uint16_t temp,Clockt_t *clock); |
48 |
uint8_t ProcesPositiv(char *buffer,uint8_t key,uint16_t temp,Clockt_t *clock); |
49 |
uint8_t ProcesDry(char *buffer,uint8_t key,uint16_t temp,Clockt_t *clock); |
49 |
uint8_t ProcesDry(char *buffer,uint8_t key,uint16_t temp,Clockt_t *clock); |
50 |
|
50 |
|
51 |
void ProcesDispl(char *data); |
51 |
void ProcesDispl(char *data); |
52 |
void ProcesTemp(uint16_t adc,uint16_t *temp); |
52 |
void ProcesTemp(uint16_t adc,uint16_t *temp); |
53 |
void ProcesHeat(uint16_t temp,uint16_t ActualTemp); |
53 |
void ProcesHeat(uint16_t temp,uint16_t ActualTemp); |
54 |
|
54 |
|
55 |
#define HeatInit() HEAT_DDR|=_BV(HEAT) |
55 |
#define HeatInit() HEAT_DDR|=_BV(HEAT) |
56 |
#define HeatOn() HEAT_PORT|=_BV(HEAT) |
56 |
#define HeatOn() HEAT_PORT|=_BV(HEAT) |
57 |
#define HeatOff() HEAT_PORT &= (~(_BV(HEAT))) |
57 |
#define HeatOff() HEAT_PORT &= (~(_BV(HEAT))) |
58 |
|
58 |
|
59 |
#endif /* __process_h_included__ */ |
59 |
#endif /* __process_h_included__ */ |