Alarm Sensor Module  0.1
⇒ back to Project Page
port_definitions.h
Go to the documentation of this file.
1 
28 
29 #ifndef PORT_DEFINITIONS_H_INCLUDED
30 #define PORT_DEFINITIONS_H_INCLUDED
31 
32 
33 
34 
36 
37 // Symbol Pin No. Description
38 //
39 // Vss 1 Ground
40 // Vdd 2 Supply Voltage for Logic
41 // Vo 3 Supply Voltage for LCD
42 // RS 4 Register Select (RS=0: Instruction Register, RS=1: Data Register)
43 // R/W 5 Read/Write (R/W=0: write, R/W=1: read)
44 // E 6 Enable
45 // D0 to D7 7 to 14 Bi-directional Data Bus
46 // BL- 15 Backlight supply terminal (Anode)
47 // BL+ 16 Backlight supply terminal (Cathode)
48 
49 
50 
51 
53 
54 //LCD
55 #define LCD_PORT PORTD //Controller Port for LCD Output
56 #define LCD_DDR DDRD //DDR Register of Controller Port for LCD Output
57 #define LCD_RS PD0 //Pin for RS (Register Select)
58 #define LCD_RW PD6 //Pin for R/W (Read/Write)
59 #define LCD_EN PD1 //Pin for E (Enable)
60 
61 
62 #define LCD_DB4 PD2 //Pin for D4 (Data, Bit 4)
63 #define LCD_DB5 PD3 //Pin for D5 (Data, Bit 5)
64 #define LCD_DB6 PD4 //Pin for D6 (Data, Bit 6)
65 #define LCD_DB7 PD5 //Pin for D7 (Data, Bit 7)
66 
67 #define LCDBL_PORT PORTD
68 #define LCDBL_DDR DDRD
69 #define LCDBL_CTRL PD7
70 
71 
72 //LED
73 #define LED_PORT PORTB
74 #define LED_DDR DDRB
75 #define LED_ADDR PB6
76 
77 
78 //A/D Conversion
79 #define ADC_PORT PORTC //PORTx of Port which is connected to A/D converter (e.g. Port A of ATmega16)
80 #define ADC_DDR DDRC //DDR of Port which is connected to A/D converter (e.g. Port A of ATmega16)
81 #define ADC_PIN PC2 //used input pin for A/D conversion
82 
83 
84 //Bat Drive
85 #define BAT_PORT PORTC
86 #define BAT_DDR DDRC
87 #define BAT_PIN PC5
88 
89 //Reed Sensor 1 (Driver)
90 #define SEN1_DRV_PORT PORTC
91 #define SEN1_DRV_DDR DDRC
92 #define SEN1_DRV_PIN PC3
93 
94 //Reed Sensor 2 (Driver)
95 #define SEN2_DRV_PORT PORTC
96 #define SEN2_DRV_DDR DDRC
97 #define SEN2_DRV_PIN PC4
98 
99 //Reed Sensor 1 (Input)
100 #define SEN1_IN_PORT PORTC
101 #define SEN1_IN_INPORT PINC
102 #define SEN1_IN_DDR DDRC
103 #define SEN1_IN_PIN PC0
104 
105 //Reed Sensor 2 (Input)
106 #define SEN2_IN_PORT PORTC
107 #define SEN2_IN_INPORT PINC
108 #define SEN2_IN_DDR DDRC
109 #define SEN2_IN_PIN PC1
110 
111 
112 //RFM12 Wireless Module
113 #define RFM12_PORT PORTB //Port for RFM12 Module
114 #define RFM12_PIN PINB //PIN for RFM12 Module
115 #define RFM12_DDR DDRB //DDR Register of Port for RFM12 Module
116 #define RFM12_LEDG PB7 //LED (green) for receiving messages indication
117 #define RFM12_LEDY PB6 //LED (yellow) for sending messages indication
118 #define RFM12_nIRQ PB0 //Interrupt Signal from RFM12 (low active)
119 #define RFM12_nRES PB1 //Reset Signal to RFM12 (low active)
120 #define RFM12_nSEL PB2 //Slave Select Signal to RFM12 (low active)
121 #define RFM12_SDI PB3 //Slave Data Input Signal (MOSI) to RFM12
122 #define RFM12_SDO PB4 //Slave Data Output Signal (MISO) from RFM12
123 #define RFM12_SCK PB5 //Clock Signal to RFM12
124 
125 
126 
127 
128 #endif // PORT_DEFINITIONS_H_INCLUDED