-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.h
66 lines (54 loc) · 1.15 KB
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef MAIN_H
#define MAIN_H
#ifndef F_CPU
#define F_CPU 16000000UL
#endif
#include <avr/io.h>
#include <stdbool.h>
#include <util/delay.h>
#include <avr/sleep.h>
#include <avr/interrupt.h>
// 3LB
#define PORT_3LB PORTB
#define DDR_3LB DDRB
#define EN PB2 //INT2
#define DATA PB5 //MOSI
#define CLK PB7 //SCK
#define AUX 1
#define NOT_AUX 0
#define AUX_INFO 2
#define AUX_NR 3
// Shutdown Pi
#define PIPORT PORTB
#define PIPIN PINB
#define PIDDR DDRB
#define PIACTIVE PB3
#define PISHUTDOWN PB1
#define PIREADY PB0
// Start Pi
#define PISTARTPDDR DDRD
#define PISTARTPORT PORTD
#define PISTART PD6
#define ZV_PIN PIND
#define ZV_ZU PD2
#define AMP_PIN PIND
#define AMP_ON PD3
// cool Pi
#define PWM OCR2
#define PWM_HIGH 255
#define PWM_MED 128
#define PWM_LOW 64
#define PWM_OFF 0
#define TEMP_HIGH 350
#define TEMP_MED 300
#define TEMP_LOW 275
#define PI_TEMP PA5
#define TIMEOUT_10MIN 600 //10 min (100ms * 600)
uint8_t read_3lb(void);
extern volatile uint16_t pi_shutdown_count;
extern volatile uint16_t pi_start_count;
extern volatile uint8_t data_3lb[20];
extern volatile bool status;
extern uint8_t count_3lb;
extern volatile uint32_t spi_timeout;
#endif