Netcruzer Library API  V2.03
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
nz_im2bl.h
Go to the documentation of this file.
1 
52 #ifndef IM2BL_H
53 #define IM2BL_H
54 
55 
56 
58 //Compatibility Tests
59 
60 #if defined(IMOD2_IS_IM2BL)
61 #if ( (!defined(IMOD2_PIN2_IS_DIG) && !defined(IMOD2_PIN2_IS_XDIG)) \
62  || (!defined(IMOD2_PIN3_IS_DIG) && !defined(IMOD2_PIN3_IS_XDIG)) \
63  || (!defined(IMOD2_PIN4_IS_DIG) && !defined(IMOD2_PIN4_IS_XDIG)) \
64  || (!defined(IMOD2_PIN5_IS_DIG) && !defined(IMOD2_PIN5_IS_XDIG)) )
65 #error "iMod port 2 is not compatible with the im2BL module!"
66 #endif
67 #endif
68 
69 
70 
72 //Buttons
73 
74 #if defined(IM2BL_ENABLE_MULTI_PORT_FUNCTIONS)
75 #define im2bl_ReadButton1(port) (imod_GetPin5(port)==0?1:0)
76 #endif
77 
78 #if defined(IM2BL_ENABLE_MULTI_PORT_FUNCTIONS)
79 #define im2bl_ReadButton2(port) (imod_GetPin3(port)==0?1:0)
80 #endif
81 
82 
83 #if defined(IMOD0_IS_IM2BL)
84 #define imod0_ReadButton1() (imod0_GetPin5()==0?1:0)
85 #define im2bl_ReadButton1Imod0() (imod0_GetPin5()==0?1:0)
86 #define imod0_ReadButton2() (imod0_GetPin3()==0?1:0)
87 #define im2bl_ReadButton2Imod0() (imod0_GetPin3()==0?1:0)
88 #define imod0_WriteLed1(val) (imod0_SetPin2(val))
89 #define im2bl_WriteLed1Imod0(val) (imod0_SetPin2(val))
90 #define imod0_WriteLed2(val) (imod0_SetPin4(val))
91 #define im2bl_WriteLed2Imod0(val) (imod0_SetPin4(val))
92 #endif
93 
94 #if defined(IMOD1_IS_IM2BL)
95 #define imod1_ReadButton1() (imod1_ReadPin5()==0?1:0)
96 #define im2bl_ReadButton1Imod1() (imod1_ReadPin5()==0?1:0)
97 #define imod1_ReadButton2() (imod1_ReadPin3()==0?1:0)
98 #define im2bl_ReadButton2Imod1() (imod1_ReadPin3()==0?1:0)
99 #define imod1_WriteLed1(val) (imod1_WritePin2(val))
100 #define im2bl_WriteLed1Imod1(val) (imod1_WritePin2(val))
101 #define imod1_WriteLed2(val) (imod1_WritePin4(val))
102 #define im2bl_WriteLed2Imod1(val) (imod1_WritePin4(val))
103 #endif
104 
105 #if defined(IMOD2_IS_IM2BL)
106 #define imod2_ReadButton1() (imod2_ReadPin5()==0?1:0)
107 #define im2bl_ReadButton1Imod2() (imod2_ReadPin5()==0?1:0)
108 #define imod2_ReadButton2() (imod2_ReadPin3()==0?1:0)
109 #define im2bl_ReadButton2Imod2() (imod2_ReadPin3()==0?1:0)
110 #define imod2_WriteLed1(val) (imod2_WritePin2(val))
111 #define im2bl_WriteLed1Imod2(val) (imod2_WritePin2(val))
112 #define imod2_WriteLed2(val) (imod2_WritePin4(val))
113 #define im2bl_WriteLed2Imod2(val) (imod2_WritePin4(val))
114 #endif
115 
116 #if defined(IMOD3_IS_IM2BL)
117 #define imod3_ReadButton1() (imod3_GetPin5()==0?1:0)
118 #define im2bl_ReadButton1Imod3() (imod3_GetPin5()==0?1:0)
119 #define imod3_ReadButton2() (imod3_GetPin3()==0?1:0)
120 #define im2bl_ReadButton2Imod3() (imod3_GetPin3()==0?1:0)
121 #define imod3_WriteLed1(val) (imod3_SetPin2(val))
122 #define im2bl_WriteLed1Imod3(val) (imod3_SetPin2(val))
123 #define imod3_WriteLed2(val) (imod3_SetPin4(val))
124 #define im2bl_WriteLed2Imod3(val) (imod3_SetPin4(val))
125 #endif
126 
127 #if defined(IMOD4_IS_IM2BL)
128 #define imod4_ReadButton1() (imod4_GetPin5()==0?1:0)
129 #define im2bl_ReadButton1Imod4() (imod4_GetPin5()==0?1:0)
130 #define imod4_ReadButton2() (imod4_GetPin3()==0?1:0)
131 #define im2bl_ReadButton2Imod4() (imod4_GetPin3()==0?1:0)
132 #define imod4_WriteLed1(val) (imod4_SetPin2(val))
133 #define im2bl_WriteLed1Imod4(val) (imod4_SetPin2(val))
134 #define imod4_WriteLed2(val) (imod4_SetPin4(val))
135 #define im2bl_WriteLed2Imod4(val) (imod4_SetPin4(val))
136 #endif
137 
138 #if defined(IMOD5_IS_IM2BL)
139 #define imod5_ReadButton1() (imod5_GetPin5()==0?1:0)
140 #define im2bl_ReadButton1Imod5() (imod5_GetPin5()==0?1:0)
141 #define imod5_ReadButton2() (imod5_GetPin3()==0?1:0)
142 #define im2bl_ReadButton2Imod5() (imod5_GetPin3()==0?1:0)
143 #define imod5_WriteLed1(val) (imod5_SetPin2(val))
144 #define im2bl_WriteLed1Imod5(val) (imod5_SetPin2(val))
145 #define imod5_WriteLed2(val) (imod5_SetPin4(val))
146 #define im2bl_WriteLed2Imod5(val) (imod5_SetPin4(val))
147 #endif
148 
149 #if defined(IMOD6_IS_IM2BL)
150 #define imod6_ReadButton1() (imod6_GetPin5()==0?1:0)
151 #define im2bl_ReadButton1Imod6() (imod6_GetPin5()==0?1:0)
152 #define imod6_ReadButton2() (imod6_GetPin3()==0?1:0)
153 #define im2bl_ReadButton2Imod6() (imod6_GetPin3()==0?1:0)
154 #define imod6_WriteLed1(val) (imod6_SetPin2(val))
155 #define im2bl_WriteLed1Imod6(val) (imod6_SetPin2(val))
156 #define imod6_WriteLed2(val) (imod6_SetPin4(val))
157 #define im2bl_WriteLed2Imod6(val) (imod6_SetPin4(val))
158 #endif
159 
160 #if defined(IMOD7_IS_IM2BL)
161 #define imod7_ReadButton1() (imod7_GetPin5()==0?1:0)
162 #define im2bl_ReadButton1Imod7() (imod7_GetPin5()==0?1:0)
163 #define imod7_ReadButton2() (imod7_GetPin3()==0?1:0)
164 #define im2bl_ReadButton2Imod7() (imod7_GetPin3()==0?1:0)
165 #define imod7_WriteLed1(val) (imod7_SetPin2(val))
166 #define im2bl_WriteLed1Imod7(val) (imod7_SetPin2(val))
167 #define imod7_WriteLed2(val) (imod7_SetPin4(val))
168 #define im2bl_WriteLed2Imod7(val) (imod7_SetPin4(val))
169 #endif
170 
171 #if defined(IMOD8_IS_IM2BL)
172 #define imod8_ReadButton1() (imod8_GetPin5()==0?1:0)
173 #define im2bl_ReadButton1Imod8() (imod8_GetPin5()==0?1:0)
174 #define imod8_ReadButton2() (imod8_GetPin3()==0?1:0)
175 #define im2bl_ReadButton2Imod8() (imod8_GetPin3()==0?1:0)
176 #define imod8_WriteLed1(val) (imod8_SetPin2(val))
177 #define im2bl_WriteLed1Imod8(val) (imod8_SetPin2(val))
178 #define imod8_WriteLed2(val) (imod8_SetPin4(val))
179 #define im2bl_WriteLed2Imod8(val) (imod8_SetPin4(val))
180 #endif
181 
182 #if defined(IMOD9_IS_IM2BL)
183 #define imod9_ReadButton1() (imod9_GetPin5()==0?1:0)
184 #define im2bl_ReadButton1Imod9() (imod9_GetPin5()==0?1:0)
185 #define imod9_ReadButton2() (imod9_GetPin3()==0?1:0)
186 #define im2bl_ReadButton2Imod9() (imod9_GetPin3()==0?1:0)
187 #define imod9_WriteLed1(val) (imod9_SetPin2(val))
188 #define im2bl_WriteLed1Imod9(val) (imod9_SetPin2(val))
189 #define imod9_WriteLed2(val) (imod9_SetPin4(val))
190 #define im2bl_WriteLed2Imod9(val) (imod9_SetPin4(val))
191 #endif
192 
193 #if defined(IMOD10_IS_IM2BL)
194 #define imod10_ReadButton1() (imod10_GetPin5()==0?1:0)
195 #define im2bl_ReadButton1Imod10() (imod10_GetPin5()==0?1:0)
196 #define imod10_ReadButton2() (imod10_GetPin3()==0?1:0)
197 #define im2bl_ReadButton2Imod10() (imod10_GetPin3()==0?1:0)
198 #define imod10_WriteLed1(val) (imod10_SetPin2(val))
199 #define im2bl_WriteLed1Imod10(val) (imod10_SetPin2(val))
200 #define imod10_WriteLed2(val) (imod10_SetPin4(val))
201 #define im2bl_WriteLed2Imod10(val) (imod10_SetPin4(val))
202 #endif
203 
204 
208 void im2bl_Init(BYTE imodPort);
209 
210 
211 
212 
213 
214 
215 #endif