-
Notifications
You must be signed in to change notification settings - Fork 7
/
pin_definition.h
79 lines (51 loc) · 2.02 KB
/
pin_definition.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
67
68
69
70
71
72
73
74
75
76
77
78
79
#include "utility.h"
#ifndef _PIN_DEFINITION
#define _PIN_DEFINITION
//TRIAC OUTPUT
#define TRIAC_PORT PORTD
#define TRIAC_STATUS_REG DDRD
#define TRIAC_OUTPUT 7
#define INIT_TRIAC() sbi(TRIAC_STATUS_REG,TRIAC_OUTPUT); cbi(TRIAC_PORT,TRIAC_OUTPUT);
#define TURN_ON_TRIAC() sbi(TRIAC_PORT,TRIAC_OUTPUT)
#define TURN_OFF_TRIAC() cbi(TRIAC_PORT,TRIAC_OUTPUT)
//PROGRAMMING BUTTON
#define PROG_BUTTON_PORT PORTD
#define PROG_BUTTON_STATUS_REG DDRD
#define PROG_PIN 6
#define INIT_PROG_BUTTON() cbi( PROG_BUTTON_STATUS_REG,PROG_PIN); sbi(PROG_BUTTON_PORT,PROG_PIN);
//ZCD
#define ZCD_PORT PORTD
#define ZCD_STATUS_REG DDRD
#define ZCD_INPUT 2
#define INIT_ZCD() cbi( ZCD_STATUS_REG , ZCD_INPUT );
//TACHO
#define TACHO_PORT PORTD
#define TACHO_STATUS_REG DDRD
#define TACHO_INPUT 3
#define INIT_TACHO() cbi( DDRD , TACHO_INPUT ); sbi( PORTD , TACHO_INPUT );
//PORTA READ POT
#define SPEED_READ 0
#define ANALOG_READ() sbi( ADCSRA , 6 )
///////////////////////// LOG ////////////////////
//TRIAC LOG
#define TRIAC_LOG_PORT PORTB
#define TRIAC_LOG_STATUS_REG DDRB
#define TRIAC_LOG 5
#define INIT_TRIAC_LOG() sbi(TRIAC_LOG_STATUS_REG,TRIAC_LOG); cbi(TRIAC_LOG_PORT,TRIAC_LOG);
#define TURN_ON_TRIAC_LOG() sbi( TRIAC_LOG_PORT , TRIAC_LOG )
#define TURN_OFF_TRIAC_LOG() cbi( TRIAC_LOG_PORT , TRIAC_LOG )
//ZERO CROSSING DETECTOR LOG
#define ZCD_LOG_PORT PORTB
#define ZCD_LOG_STATUS_REG DDRB
#define ZCD_LOG 4
#define INIT_ZCD_LOG() sbi(ZCD_LOG_STATUS_REG,TRIAC_LOG); cbi(ZCD_LOG_PORT,TRIAC_LOG);
#define TURN_ON_ZDC_LOG() sbi( ZCD_LOG_PORT , ZCD_LOG )
#define TURN_OFF_ZDC_LOG() cbi( ZCD_LOG_PORT , ZCD_LOG )
//TACHO LOG
#define TACHO_LOG_PORT PORTB
#define TACHO_LOG_STATUS_REG DDRB
#define TACHO_LOG 3
#define INIT_TACHO_LOG() sbi(TACHO_LOG_STATUS_REG,TRIAC_LOG); cbi(TACHO_LOG_PORT,TRIAC_LOG);
#define TURN_ON_TACHO_LOG() sbi( TACHO_LOG_PORT, TACHO_LOG )
#define TURN_OFF_TACHO_LOG() cbi( TACHO_LOG_PORT, TACHO_LOG )
#endif