Subversion Repositories svnkaklik

Compare Revisions

Ignore whitespace Rev 483 → Rev 484

/programy/C/avr/AVRcam/CamInterfaceAsm.lst
1,4 → 1,4
GAS LISTING /tmp/ccCMjSjd.s page 1
GAS LISTING /tmp/ccowxWMg.s page 1
 
 
1 # 1 "CamInterfaceAsm.S"
58,7 → 58,7
51 ; and is turned off when it isn't needed.
52
53 #include <avr/io.h>
GAS LISTING /tmp/ccCMjSjd.s page 2
GAS LISTING /tmp/ccowxWMg.s page 2
 
 
1 /* Copyright (c) 2002,2003,2005,2006, Marek Michalkiewicz, Joerg Wunsch
91,7 → 91,7
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 POSSIBILITY OF SUCH DAMAGE. */
30
31 /* $Id: io.h,v 1.24.2.7 2006/04/19 16:53:25 aesok Exp $ */
31 /* $Id: io.h,v 1.24.2.9 2006/09/13 20:41:41 arcanum Exp $ */
32
33 /** \defgroup avr_io <avr/io.h>: AVR device-specific IO definitions
34 \code #include <avr/io.h> \endcode
118,7 → 118,7
55 function definitions as documented
56 \ref avr_signames "here".
57
GAS LISTING /tmp/ccCMjSjd.s page 3
GAS LISTING /tmp/ccowxWMg.s page 3
 
 
58 Finally, the following macros are defined:
178,7 → 178,7
26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
GAS LISTING /tmp/ccCMjSjd.s page 4
GAS LISTING /tmp/ccowxWMg.s page 4
 
 
29 POSSIBILITY OF SUCH DAMAGE. */
185,7 → 185,7
30
31 /* avr/sfr_defs.h - macros for accessing AVR special function registers */
32
33 /* $Id: sfr_defs.h,v 1.16 2005/09/10 21:31:13 joerg_wunsch Exp $ */
33 /* $Id: sfr_defs.h,v 1.16.2.2 2006/05/17 08:25:10 joerg_wunsch Exp $ */
34
35 #ifndef _AVR_SFR_DEFS_H_
36 #define _AVR_SFR_DEFS_H_ 1
196,54 → 196,54
41 The \c <avr/sfr_defs.h> file is included by all of the \c <avr/ioXXXX.h>
42 files, which use macros defined here to make the special function register
43 definitions look like C variables or simple constants, depending on the
44 <tt>_SFR_ASM_COMPAT</tt> define. Some examples from \c <avr/iom128.h> to
44 <tt>_SFR_ASM_COMPAT</tt> define. Some examples from \c <avr/iocanxx.h> to
45 show how to define such macros:
46
47 \code
48 #define PORTA _SFR_IO8(0x1b)
49 #define TCNT1 _SFR_IO16(0x2c)
50 #define PORTF _SFR_MEM8(0x61)
51 #define TCNT3 _SFR_MEM16(0x88)
52 \endcode
53
54 If \c _SFR_ASM_COMPAT is not defined, C programs can use names like
55 <tt>PORTA</tt> directly in C expressions (also on the left side of
56 assignment operators) and GCC will do the right thing (use short I/O
57 instructions if possible). The \c __SFR_OFFSET definition is not used in
58 any way in this case.
59
60 Define \c _SFR_ASM_COMPAT as 1 to make these names work as simple constants
61 (addresses of the I/O registers). This is necessary when included in
62 preprocessed assembler (*.S) source files, so it is done automatically if
63 \c __ASSEMBLER__ is defined. By default, all addresses are defined as if
64 they were memory addresses (used in \c lds/sts instructions). To use these
65 addresses in \c in/out instructions, you must subtract 0x20 from them.
66
67 For more backwards compatibility, insert the following at the start of your
68 old assembler source file:
69
70 \code
71 #define __SFR_OFFSET 0
72 \endcode
73
74 This automatically subtracts 0x20 from I/O space addresses, but it's a
75 hack, so it is recommended to change your source: wrap such addresses in
76 macros defined here, as shown below. After this is done, the
77 <tt>__SFR_OFFSET</tt> definition is no longer necessary and can be removed.
78
79 Real example - this code could be used in a boot loader that is portable
80 between devices with \c SPMCR at different addresses.
81
82 \verbatim
83 <avr/iom163.h>: #define SPMCR _SFR_IO8(0x37)
84 <avr/iom128.h>: #define SPMCR _SFR_MEM8(0x68)
85 \endverbatim
GAS LISTING /tmp/ccCMjSjd.s page 5
48 #define PORTA _SFR_IO8(0x02)
49 #define EEAR _SFR_IO16(0x21)
50 #define UDR0 _SFR_MEM8(0xC6)
51 #define TCNT3 _SFR_MEM16(0x94)
52 #define CANIDT _SFR_MEM32(0xF0)
53 \endcode
54
55 If \c _SFR_ASM_COMPAT is not defined, C programs can use names like
56 <tt>PORTA</tt> directly in C expressions (also on the left side of
57 assignment operators) and GCC will do the right thing (use short I/O
58 instructions if possible). The \c __SFR_OFFSET definition is not used in
59 any way in this case.
60
61 Define \c _SFR_ASM_COMPAT as 1 to make these names work as simple constants
62 (addresses of the I/O registers). This is necessary when included in
63 preprocessed assembler (*.S) source files, so it is done automatically if
64 \c __ASSEMBLER__ is defined. By default, all addresses are defined as if
65 they were memory addresses (used in \c lds/sts instructions). To use these
66 addresses in \c in/out instructions, you must subtract 0x20 from them.
67
68 For more backwards compatibility, insert the following at the start of your
69 old assembler source file:
70
71 \code
72 #define __SFR_OFFSET 0
73 \endcode
74
75 This automatically subtracts 0x20 from I/O space addresses, but it's a
76 hack, so it is recommended to change your source: wrap such addresses in
77 macros defined here, as shown below. After this is done, the
78 <tt>__SFR_OFFSET</tt> definition is no longer necessary and can be removed.
79
80 Real example - this code could be used in a boot loader that is portable
81 between devices with \c SPMCR at different addresses.
82
83 \verbatim
84 <avr/iom163.h>: #define SPMCR _SFR_IO8(0x37)
85 <avr/iom128.h>: #define SPMCR _SFR_MEM8(0x68)
GAS LISTING /tmp/ccowxWMg.s page 5
 
 
86
87 \code
86 \endverbatim
87
87
88 #ifndef __AVR_HAVE_MOVW__
89 # if defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
90 # define __AVR_HAVE_MOVW__ 1
298,7 → 298,7
139 #define YL r28
140 #define YH r29
141 #endif /* #if __AVR_ARCH__ != 1 */
GAS LISTING /tmp/ccCMjSjd.s page 6
GAS LISTING /tmp/ccowxWMg.s page 6
 
 
142 #define ZL r30
350,78 → 350,86
188 # include <avr/iom1280.h>
189 #elif defined (__AVR_ATmega1281__)
190 # include <avr/iom1281.h>
191 #elif defined (__AVR_AT90CAN32__)
192 # include <avr/iocan32.h>
193 #elif defined (__AVR_AT90CAN64__)
194 # include <avr/iocan64.h>
195 #elif defined (__AVR_AT90CAN128__)
196 # include <avr/iocan128.h>
197 #elif defined (__AVR_AT90USB646__)
198 # include <avr/iousb646.h>
GAS LISTING /tmp/ccCMjSjd.s page 7
191 #elif defined (__AVR_ATmega2560__)
192 # include <avr/iom2560.h>
193 #elif defined (__AVR_ATmega2561__)
194 # include <avr/iom2561.h>
195 #elif defined (__AVR_AT90CAN32__)
196 # include <avr/iocan32.h>
197 #elif defined (__AVR_AT90CAN64__)
198 # include <avr/iocan64.h>
GAS LISTING /tmp/ccowxWMg.s page 7
 
 
199 #elif defined (__AVR_AT90USB647__)
200 # include <avr/iousb647.h>
201 #elif defined (__AVR_AT90USB1286__)
202 # include <avr/iousb1286.h>
203 #elif defined (__AVR_AT90USB1287__)
204 # include <avr/iousb1287.h>
205 #elif defined (__AVR_ATmega64__)
206 # include <avr/iom64.h>
207 #elif defined (__AVR_ATmega640__)
208 # include <avr/iom640.h>
209 #elif defined (__AVR_ATmega644__)
210 # include <avr/iom644.h>
211 #elif defined (__AVR_ATmega644P__)
212 # include <avr/iom644.h>
213 #elif defined (__AVR_ATmega645__)
214 # include <avr/iom645.h>
215 #elif defined (__AVR_ATmega6450__)
216 # include <avr/iom6450.h>
217 #elif defined (__AVR_ATmega649__)
218 # include <avr/iom649.h>
219 #elif defined (__AVR_ATmega6490__)
220 # include <avr/iom6490.h>
221 #elif defined (__AVR_ATmega103__)
222 # include <avr/iom103.h>
223 #elif defined (__AVR_ATmega32__)
224 # include <avr/iom32.h>
225 #elif defined (__AVR_ATmega323__)
226 # include <avr/iom323.h>
227 #elif defined (__AVR_ATmega324P__)
228 # include <avr/iom324.h>
229 #elif defined (__AVR_ATmega325__)
230 # include <avr/iom325.h>
231 #elif defined (__AVR_ATmega3250__)
232 # include <avr/iom3250.h>
233 #elif defined (__AVR_ATmega329__)
234 # include <avr/iom329.h>
235 #elif defined (__AVR_ATmega3290__)
236 # include <avr/iom3290.h>
237 #elif defined (__AVR_ATmega406__)
238 # include <avr/iom406.h>
239 #elif defined (__AVR_ATmega16__)
240 # include <avr/iom16.h>
241 #elif defined (__AVR_ATmega161__)
242 # include <avr/iom161.h>
243 #elif defined (__AVR_ATmega162__)
244 # include <avr/iom162.h>
245 #elif defined (__AVR_ATmega163__)
246 # include <avr/iom163.h>
247 #elif defined (__AVR_ATmega164P__)
248 # include <avr/iom164.h>
249 #elif defined (__AVR_ATmega165__)
250 # include <avr/iom165.h>
251 #elif defined (__AVR_ATmega168__)
252 # include <avr/iom168.h>
253 #elif defined (__AVR_ATmega169__)
254 # include <avr/iom169.h>
255 #elif defined (__AVR_ATmega8__)
GAS LISTING /tmp/ccCMjSjd.s page 8
199 #elif defined (__AVR_AT90CAN128__)
200 # include <avr/iocan128.h>
201 #elif defined (__AVR_AT90USB646__)
202 # include <avr/iousb646.h>
203 #elif defined (__AVR_AT90USB647__)
204 # include <avr/iousb647.h>
205 #elif defined (__AVR_AT90USB1286__)
206 # include <avr/iousb1286.h>
207 #elif defined (__AVR_AT90USB1287__)
208 # include <avr/iousb1287.h>
209 #elif defined (__AVR_ATmega64__)
210 # include <avr/iom64.h>
211 #elif defined (__AVR_ATmega640__)
212 # include <avr/iom640.h>
213 #elif defined (__AVR_ATmega644__)
214 # include <avr/iom644.h>
215 #elif defined (__AVR_ATmega644P__)
216 # include <avr/iom644.h>
217 #elif defined (__AVR_ATmega645__)
218 # include <avr/iom645.h>
219 #elif defined (__AVR_ATmega6450__)
220 # include <avr/iom6450.h>
221 #elif defined (__AVR_ATmega649__)
222 # include <avr/iom649.h>
223 #elif defined (__AVR_ATmega6490__)
224 # include <avr/iom6490.h>
225 #elif defined (__AVR_ATmega103__)
226 # include <avr/iom103.h>
227 #elif defined (__AVR_ATmega32__)
228 # include <avr/iom32.h>
229 #elif defined (__AVR_ATmega323__)
230 # include <avr/iom323.h>
231 #elif defined (__AVR_ATmega324P__)
232 # include <avr/iom324.h>
233 #elif defined (__AVR_ATmega325__)
234 # include <avr/iom325.h>
235 #elif defined (__AVR_ATmega3250__)
236 # include <avr/iom3250.h>
237 #elif defined (__AVR_ATmega329__)
238 # include <avr/iom329.h>
239 #elif defined (__AVR_ATmega3290__)
240 # include <avr/iom3290.h>
241 #elif defined (__AVR_ATmega406__)
242 # include <avr/iom406.h>
243 #elif defined (__AVR_ATmega16__)
244 # include <avr/iom16.h>
245 #elif defined (__AVR_ATmega161__)
246 # include <avr/iom161.h>
247 #elif defined (__AVR_ATmega162__)
248 # include <avr/iom162.h>
249 #elif defined (__AVR_ATmega163__)
250 # include <avr/iom163.h>
251 #elif defined (__AVR_ATmega164P__)
252 # include <avr/iom164.h>
253 #elif defined (__AVR_ATmega165__)
254 # include <avr/iom165.h>
255 #elif defined (__AVR_ATmega165P__)
GAS LISTING /tmp/ccowxWMg.s page 8
 
 
256 # include <avr/iom8.h>
256 # include <avr/iom165p.h>
257 #elif defined (__AVR_ATmega168__)
258 # include <avr/iom168.h>
259 #elif defined (__AVR_ATmega169__)
260 # include <avr/iom169.h>
261 #elif defined (__AVR_ATmega169P__)
262 # include <avr/iom169p.h>
263 #elif defined (__AVR_ATmega8__)
264 # include <avr/iom8.h>
1 /* Copyright (c) 2002, Marek Michalkiewicz
2 All rights reserved.
3
470,6 → 478,9
46 #else
47 # error "Attempt to include more than one <avr/ioXXX.h> file."
48 #endif
GAS LISTING /tmp/ccowxWMg.s page 9
 
 
49
50 /* I/O registers */
51
478,9 → 489,6
54 #define TWSR _SFR_IO8(0x01)
55 #define TWAR _SFR_IO8(0x02)
56 #define TWDR _SFR_IO8(0x03)
GAS LISTING /tmp/ccCMjSjd.s page 9
 
 
57
58 /* ADC */
59 #define ADCW _SFR_IO16(0x04)
530,6 → 538,9
103
104 /* EEPROM Address Register */
105 #define EEAR _SFR_IO16(0x1E)
GAS LISTING /tmp/ccowxWMg.s page 10
 
 
106 #define EEARL _SFR_IO8(0x1E)
107 #define EEARH _SFR_IO8(0x1F)
108
538,9 → 549,6
111
112 #define WDTCR _SFR_IO8(0x21)
113 #define ASSR _SFR_IO8(0x22)
GAS LISTING /tmp/ccCMjSjd.s page 10
 
 
114
115 /* Timer 2 */
116 #define OCR2 _SFR_IO8(0x23)
590,6 → 598,9
160 /* 0x3D..0x3E SP */
161
162 /* 0x3F SREG */
GAS LISTING /tmp/ccowxWMg.s page 11
 
 
163
164 /* Interrupt vectors */
165
598,9 → 609,6
168 #define SIG_INTERRUPT0 _VECTOR(1)
169
170 /* External Interrupt Request 1 */
GAS LISTING /tmp/ccCMjSjd.s page 11
 
 
171 #define INT1_vect _VECTOR(2)
172 #define SIG_INTERRUPT1 _VECTOR(2)
173
650,6 → 658,9
217
218 /* ADC Conversion Complete */
219 #define ADC_vect _VECTOR(14)
GAS LISTING /tmp/ccowxWMg.s page 12
 
 
220 #define SIG_ADC _VECTOR(14)
221
222 /* EEPROM Ready */
658,9 → 669,6
225
226 /* Analog Comparator */
227 #define ANA_COMP_vect _VECTOR(16)
GAS LISTING /tmp/ccCMjSjd.s page 12
 
 
228 #define SIG_COMPARATOR _VECTOR(16)
229
230 /* 2-wire Serial Interface */
691,81 → 699,92
255 #define TICIE1 5
256 #define OCIE1A 4
257 #define OCIE1B 3
257 #elif defined (__AVR_ATmega48__)
258 # include <avr/iom48.h>
259 #elif defined (__AVR_ATmega88__)
260 # include <avr/iom88.h>
261 #elif defined (__AVR_ATmega8515__)
262 # include <avr/iom8515.h>
263 #elif defined (__AVR_ATmega8535__)
264 # include <avr/iom8535.h>
265 #elif defined (__AVR_AT90S8535__)
266 # include <avr/io8535.h>
267 #elif defined (__AVR_AT90C8534__)
268 # include <avr/io8534.h>
269 #elif defined (__AVR_AT90S8515__)
270 # include <avr/io8515.h>
271 #elif defined (__AVR_AT90S4434__)
272 # include <avr/io4434.h>
273 #elif defined (__AVR_AT90S4433__)
274 # include <avr/io4433.h>
275 #elif defined (__AVR_AT90S4414__)
276 # include <avr/io4414.h>
277 #elif defined (__AVR_ATtiny22__)
278 # include <avr/iotn22.h>
279 #elif defined (__AVR_ATtiny26__)
280 # include <avr/iotn26.h>
281 #elif defined (__AVR_AT90S2343__)
282 # include <avr/io2343.h>
283 #elif defined (__AVR_AT90S2333__)
GAS LISTING /tmp/ccCMjSjd.s page 13
258 #define TOIE1 2
259 /* bit 1 reserved (OCIE0?) */
260 #define TOIE0 0
261
262 /* TIFR */
263 #define OCF2 7
264 #define TOV2 6
265 #define ICF1 5
265 #elif defined (__AVR_ATmega48__)
266 # include <avr/iom48.h>
267 #elif defined (__AVR_ATmega88__)
268 # include <avr/iom88.h>
269 #elif defined (__AVR_ATmega8515__)
270 # include <avr/iom8515.h>
271 #elif defined (__AVR_ATmega8535__)
272 # include <avr/iom8535.h>
273 #elif defined (__AVR_AT90S8535__)
274 # include <avr/io8535.h>
275 #elif defined (__AVR_AT90C8534__)
GAS LISTING /tmp/ccowxWMg.s page 13
 
 
284 # include <avr/io2333.h>
285 #elif defined (__AVR_AT90S2323__)
286 # include <avr/io2323.h>
287 #elif defined (__AVR_AT90S2313__)
288 # include <avr/io2313.h>
289 #elif defined (__AVR_ATtiny2313__)
290 # include <avr/iotn2313.h>
291 #elif defined (__AVR_ATtiny13__)
292 # include <avr/iotn13.h>
293 #elif defined (__AVR_ATtiny25__)
294 # include <avr/iotn25.h>
295 #elif defined (__AVR_ATtiny45__)
296 # include <avr/iotn45.h>
297 #elif defined (__AVR_ATtiny85__)
298 # include <avr/iotn85.h>
299 #elif defined (__AVR_ATtiny24__)
300 # include <avr/iotn24.h>
301 #elif defined (__AVR_ATtiny44__)
302 # include <avr/iotn44.h>
303 #elif defined (__AVR_ATtiny84__)
304 # include <avr/iotn84.h>
305 #elif defined (__AVR_ATtiny261__)
306 # include <avr/iotn261.h>
307 #elif defined (__AVR_ATtiny461__)
308 # include <avr/iotn461.h>
309 #elif defined (__AVR_ATtiny861__)
310 # include <avr/iotn861.h>
311 /* avr1: the following only supported for assembler programs */
312 #elif defined (__AVR_ATtiny28__)
313 # include <avr/iotn28.h>
314 #elif defined (__AVR_AT90S1200__)
315 # include <avr/io1200.h>
316 #elif defined (__AVR_ATtiny15__)
317 # include <avr/iotn15.h>
318 #elif defined (__AVR_ATtiny12__)
319 # include <avr/iotn12.h>
320 #elif defined (__AVR_ATtiny11__)
321 # include <avr/iotn11.h>
322 #else
323 # if !defined(__COMPILING_AVR_LIBC__)
324 # warning "device type not defined"
325 # endif
326 #endif
327
328 #include <avr/portpins.h>
276 # include <avr/io8534.h>
277 #elif defined (__AVR_AT90S8515__)
278 # include <avr/io8515.h>
279 #elif defined (__AVR_AT90S4434__)
280 # include <avr/io4434.h>
281 #elif defined (__AVR_AT90S4433__)
282 # include <avr/io4433.h>
283 #elif defined (__AVR_AT90S4414__)
284 # include <avr/io4414.h>
285 #elif defined (__AVR_ATtiny22__)
286 # include <avr/iotn22.h>
287 #elif defined (__AVR_ATtiny26__)
288 # include <avr/iotn26.h>
289 #elif defined (__AVR_AT90S2343__)
290 # include <avr/io2343.h>
291 #elif defined (__AVR_AT90S2333__)
292 # include <avr/io2333.h>
293 #elif defined (__AVR_AT90S2323__)
294 # include <avr/io2323.h>
295 #elif defined (__AVR_AT90S2313__)
296 # include <avr/io2313.h>
297 #elif defined (__AVR_ATtiny2313__)
298 # include <avr/iotn2313.h>
299 #elif defined (__AVR_ATtiny13__)
300 # include <avr/iotn13.h>
301 #elif defined (__AVR_ATtiny25__)
302 # include <avr/iotn25.h>
303 #elif defined (__AVR_ATtiny45__)
304 # include <avr/iotn45.h>
305 #elif defined (__AVR_ATtiny85__)
306 # include <avr/iotn85.h>
307 #elif defined (__AVR_ATtiny24__)
308 # include <avr/iotn24.h>
309 #elif defined (__AVR_ATtiny44__)
310 # include <avr/iotn44.h>
311 #elif defined (__AVR_ATtiny84__)
312 # include <avr/iotn84.h>
313 #elif defined (__AVR_ATtiny261__)
314 # include <avr/iotn261.h>
315 #elif defined (__AVR_ATtiny461__)
316 # include <avr/iotn461.h>
317 #elif defined (__AVR_ATtiny861__)
318 # include <avr/iotn861.h>
319 /* avr1: the following only supported for assembler programs */
320 #elif defined (__AVR_ATtiny28__)
321 # include <avr/iotn28.h>
322 #elif defined (__AVR_AT90S1200__)
323 # include <avr/io1200.h>
324 #elif defined (__AVR_ATtiny15__)
325 # include <avr/iotn15.h>
326 #elif defined (__AVR_ATtiny12__)
327 # include <avr/iotn12.h>
328 #elif defined (__AVR_ATtiny11__)
329 # include <avr/iotn11.h>
330 #else
331 # if !defined(__COMPILING_AVR_LIBC__)
332 # warning "device type not defined"
GAS LISTING /tmp/ccowxWMg.s page 14
 
 
333 # endif
334 #endif
335
336 #include <avr/portpins.h>
1 /* Copyright (c) 2003 Theodore A. Roth
2 All rights reserved.
3
778,9 → 797,6
10 * Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in
12 the documentation and/or other materials provided with the
GAS LISTING /tmp/ccCMjSjd.s page 14
 
 
13 distribution.
14
15 * Neither the name of the copyright holders nor the names of
822,6 → 838,9
51 #define PORT1 1
52 #define PORT0 0
53
GAS LISTING /tmp/ccowxWMg.s page 15
 
 
54 /* Port Data Direction Register (generic) */
55 #define DD7 7
56 #define DD6 6
838,9 → 857,6
67 #define PIN5 5
68 #define PIN4 4
69 #define PIN3 3
GAS LISTING /tmp/ccCMjSjd.s page 15
 
 
70 #define PIN2 2
71 #define PIN1 1
72 #define PIN0 0
882,6 → 898,9
108 #if defined(PB1)
109 # define PORTB1 PB1
110 #endif
GAS LISTING /tmp/ccowxWMg.s page 16
 
 
111 #if defined(PB2)
112 # define PORTB2 PB2
113 #endif
898,9 → 917,6
124 # define PORTB6 PB6
125 #endif
126 #if defined(PB7)
GAS LISTING /tmp/ccCMjSjd.s page 16
 
 
127 # define PORTB7 PB7
128 #endif
129
942,6 → 958,9
165 #if defined(PD2)
166 # define PORTD2 PD2
167 #endif
GAS LISTING /tmp/ccowxWMg.s page 17
 
 
168 #if defined(PD3)
169 # define PORTD3 PD3
170 #endif
958,9 → 977,6
181 # define PORTD7 PD7
182 #endif
183
GAS LISTING /tmp/ccCMjSjd.s page 17
 
 
184 /* PORT E */
185
186 #if defined(PE0)
1002,6 → 1018,9
222 #if defined(PF3)
223 # define PORTF3 PF3
224 #endif
GAS LISTING /tmp/ccowxWMg.s page 18
 
 
225 #if defined(PF4)
226 # define PORTF4 PF4
227 #endif
1018,9 → 1037,6
238 /* PORT G */
239
240 #if defined(PG0)
GAS LISTING /tmp/ccCMjSjd.s page 18
 
 
241 # define PORTG0 PG0
242 #endif
243 #if defined(PG1)
1062,6 → 1078,9
279 #if defined(PH4)
280 # define PORTH4 PH4
281 #endif
GAS LISTING /tmp/ccowxWMg.s page 19
 
 
282 #if defined(PH5)
283 # define PORTH5 PH5
284 #endif
1078,9 → 1097,6
295 # define PORTJ0 PJ0
296 #endif
297 #if defined(PJ1)
GAS LISTING /tmp/ccCMjSjd.s page 19
 
 
298 # define PORTJ1 PJ1
299 #endif
300 #if defined(PJ2)
1113,16 → 1129,27
327 #if defined(PK2)
328 # define PORTK2 PK2
329 #endif
329
330 #if __AVR_ARCH__ != 1
331 # if XRAMEND < 0x100 && !defined(__COMPILING_AVR_LIBC__)
332 # undef SP
333 # define SP _SFR_IO8(0x3D)
334 # undef SPH
335 # endif
336 #endif
330 #if defined(PK3)
331 # define PORTK3 PK3
332 #endif
333 #if defined(PK4)
334 # define PORTK4 PK4
335 #endif
336 #if defined(PK5)
337 # define PORTK5 PK5
337
338 #include <avr/version.h>
GAS LISTING /tmp/ccowxWMg.s page 20
 
 
338 #if __AVR_ARCH__ != 1
339 # if XRAMEND < 0x100 && !defined(__COMPILING_AVR_LIBC__)
340 # undef SP
341 # define SP _SFR_IO8(0x3D)
342 # undef SPH
343 # endif
344 #endif
345
346 #include <avr/version.h>
1 /* Copyright (c) 2005, Joerg Wunsch -*- c -*-
2 All rights reserved.
3
1138,9 → 1165,6
13 distribution.
14
15 * Neither the name of the copyright holders nor the names of
GAS LISTING /tmp/ccCMjSjd.s page 20
 
 
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
18
1174,6 → 1198,9
46 portable tests can be implemented using \c <avr/io.h> that can be
47 used in code that wants to remain backwards-compatible to library
48 versions prior to the date when the library version API had been
GAS LISTING /tmp/ccowxWMg.s page 21
 
 
49 added, as referenced but undefined C preprocessor macros
50 automatically evaluate to 0.
51 */
1183,7 → 1210,7
55
56 /** \ingroup avr_version
57 String literal representation of the current library version. */
58 #define __AVR_LIBC_VERSION_STRING__ "1.4.4"
58 #define __AVR_LIBC_VERSION_STRING__ "1.4.5"
59
60 /** \ingroup avr_version
61 Numerical representation of the current library version.
1193,18 → 1220,15
65 added. It is intented to provide a monotonically increasing
66 numerical value that can easily be used in numerical checks.
67 */
68 #define __AVR_LIBC_VERSION__ 10404UL
68 #define __AVR_LIBC_VERSION__ 10405UL
69
70 /** \ingroup avr_version
71 String literal representation of the release date. */
72 #define __AVR_LIBC_DATE_STRING__ "20060420"
GAS LISTING /tmp/ccCMjSjd.s page 21
 
 
72 #define __AVR_LIBC_DATE_STRING__ "20061009"
73
74 /** \ingroup avr_version
75 Numerical representation of the release date. */
76 #define __AVR_LIBC_DATE_ 20060420UL
76 #define __AVR_LIBC_DATE_ 20061009UL
77
78 /** \ingroup avr_version
79 Library major version number. */
1216,11 → 1240,11
85
86 /** \ingroup avr_version
87 Library revision number. */
88 #define __AVR_LIBC_REVISION__ 4
88 #define __AVR_LIBC_REVISION__ 5
89
90 #endif /* _AVR_VERSION_H_ */
91 ...
339
347
54 #include "Events.h"
1 #ifndef EVENTS_H
2 #define EVENTS_H
1234,6 → 1258,9
10 modify it under the terms of the GNU General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
GAS LISTING /tmp/ccowxWMg.s page 22
 
 
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
1258,9 → 1285,6
34 Description: This file provides the external interface
35 to the events that can be published/processed in the
36 system. It is specifically by itself (and nothing
GAS LISTING /tmp/ccCMjSjd.s page 22
 
 
37 else should be defined in here) so that both .c and
38 .S (assembly) files can include this file without
39 a problem.
1294,6 → 1318,9
66 ; to overflow after 176 (horizontal) pixels
67
68 #define RED_MEM_OFFSET 0x00
GAS LISTING /tmp/ccowxWMg.s page 23
 
 
69 #define GREEN_MEM_OFFSET 0x10
70 #define BLUE_MEM_OFFSET 0x20
71
1318,9 → 1345,6
90
91 ; As pixel blocks are sampled, the red, green, and blue values are
92 ; used to index into their respective color maps. The color maps
GAS LISTING /tmp/ccCMjSjd.s page 23
 
 
93 ; return values that can be logically ANDed together so that a
94 ; particular RGB triplet will result in a single bit being set
95 ; after the AND operation. This single bit indicates which color
1354,6 → 1378,9
123 tmp2 = 20
124 color = 19
125 greenData = 20
GAS LISTING /tmp/ccowxWMg.s page 24
 
 
126 blueData = 21
127 colorMapLow = 22
128 colorMapHigh = 23
1378,9 → 1405,6
147 ;*****************************************************************
148 ; Function Name: CamIntAsm_waitForNewTrackingFrame
149 ; Function Description: This function is responsible for
GAS LISTING /tmp/ccCMjSjd.s page 24
 
 
150 ; going to sleep until a new frame begins (indicated by
151 ; VSYNC transitioning from low to high. This will wake
152 ; the "VSYNC sleep" up and allow it to continue with
1414,6 → 1438,9
180:CamInterfaceAsm.S **** brts _cleanUp
181 ;sbi _SFR_IO_ADDR(PORTD),PD6 ; For testing...
182 ;cbi _SFR_IO_ADDR(PORTD),PD6
GAS LISTING /tmp/ccowxWMg.s page 25
 
 
183
184:CamInterfaceAsm.S **** in tmp1,_SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually
185:CamInterfaceAsm.S **** ori tmp1, 0x07 ; feed Timer1
1438,9 → 1465,6
204:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TIMSK),tmp1 ; overflow
205
206:CamInterfaceAsm.S **** ldi tmp1,PIXEL_RUN_START_INITIAL ; set up the TCNT1 to overflow (and
GAS LISTING /tmp/ccCMjSjd.s page 25
 
 
207:CamInterfaceAsm.S **** ldi tmp2,0xFF ; interrupts) after 176 pixels
208:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TCNT1H),tmp2
209:CamInterfaceAsm.S **** out _SFR_IO_ADDR(TCNT1L),tmp1
1474,6 → 1498,9
237 ; of NOPs was determined emperically by trial and error.
238:CamInterfaceAsm.S **** nop
239:CamInterfaceAsm.S **** nop
GAS LISTING /tmp/ccowxWMg.s page 26
 
 
240 _acquirePixelBlock: ; Clock Cycle Count
241:CamInterfaceAsm.S **** in ZL,RB_PORT ; sample the red value (PINB) (1)
242:CamInterfaceAsm.S **** in YL,G_PORT ; sample the green value (PINC) (1)
1498,9 → 1525,6
261:CamInterfaceAsm.S **** sbi _SFR_IO_ADDR(PORTD),PD6
262:CamInterfaceAsm.S **** nop
263:CamInterfaceAsm.S **** cbi _SFR_IO_ADDR(PORTD),PD6
GAS LISTING /tmp/ccCMjSjd.s page 26
 
 
264
265:CamInterfaceAsm.S **** mov tmp2,pixelRunStart ; get the count value of the
266 ; current pixel run
1534,6 → 1558,9
294 ; get a EV_SERIAL_DATA_RECEIVED event, and the T bit set so we will end the
295 ; line's processing...however, the PCLK will keep on ticking for the rest of
296 ; the frame/line, which will cause the TCNT to eventually overflow and
GAS LISTING /tmp/ccowxWMg.s page 27
 
 
297 ; interrupt us, generating a EV_ACQUIRE_LINE_COMPLETE event. We don't want
298 ; this, so we need to actually turn off the PCLK counting each time we exit
299 ; this loop, and only turn it on when we begin acquiring lines....
1558,9 → 1585,6
318
319 ;*****************************************************************
320 ; Function Name: CamIntAsm_waitForNewDumpFrame
GAS LISTING /tmp/ccCMjSjd.s page 27
 
 
321 ; Function Description: This function is responsible for
322 ; going to sleep until a new frame begins (indicated by
323 ; VSYNC transitioning from low to high. This will wake
1594,6 → 1618,9
351:CamInterfaceAsm.S **** mov XL,currLineBuffLow ; buffer into the X pointer regs
352
353:CamInterfaceAsm.S **** mov YH,prevLineBuffHigh ; Load the pointer to the previous line
GAS LISTING /tmp/ccowxWMg.s page 28
 
 
354:CamInterfaceAsm.S **** mov YL,prevLineBuffLow ; buffer into the Y pointer regs
355
356:CamInterfaceAsm.S **** ldi tmp1,PIXEL_RUN_START_INITIAL ; set up the TCNT1 to overflow (and
1618,9 → 1645,6
375
376 ;*******************************************************************************************
377 ; Dump Frame handler
GAS LISTING /tmp/ccCMjSjd.s page 28
 
 
378 ;*******************************************************************************************
379
380 _dumpFrame:
1654,6 → 1678,9
408
409 ; if we make it here, it means the T flag is set, and we must have been interrupted
410 ; so we need to exit (what if we were interrupted for serial? should we disable it?)
GAS LISTING /tmp/ccowxWMg.s page 29
 
 
411:CamInterfaceAsm.S **** rjmp _cleanUpDumpLine
412
413 ;***********************************************************
1678,9 → 1705,6
432 ; whenever the HREF transitions (meaning the pixels
433 ; are starting after VSYNC transitioned, and we need to
434 ; start acquiring the pixel blocks
GAS LISTING /tmp/ccCMjSjd.s page 29
 
 
435 ; Inputs: none
436 ; Outputs: none
437 ;***********************************************************
1714,6 → 1738,9
465 ; Function Name: <interrupt handler for Timer1 overflow>
466 ; Function Description: This function is responsible
467 ; for handling the Timer1 overflow (hooked up to indicate
GAS LISTING /tmp/ccowxWMg.s page 30
 
 
468 ; when we have reached the end of a line of pixel data,
469 ; since PCLK is hooked up to overflow TCNT1 after 176
470 ; pixels). This routine generates an acquire line complete
1737,7 → 1764,7
488:CamInterfaceAsm.S **** reti
489
490 .end
GAS LISTING /tmp/ccCMjSjd.s page 30
GAS LISTING /tmp/ccowxWMg.s page 31
 
 
DEFINED SYMBOLS