Subversion Repositories svnkaklik

Rev

Rev 410 | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
484 kaklik 1
GAS LISTING /tmp/ccowxWMg.s 			page 1
174 kaklik 2
 
3
 
4
   1               	# 1 "CamInterfaceAsm.S"
5
   2               	# 1 "<built-in>"
151 kaklik 6
   1               	;
174 kaklik 7
 
8
 
151 kaklik 9
   2               	;    Copyright (C) 2004    John Orlando
10
   3               	;    
11
   4               	;   AVRcam: a small real-time image processing engine.
12
   5               	
13
   6               	;    This program is free software; you can redistribute it and/or
14
   7               	;    modify it under the terms of the GNU General Public
15
   8               	;    License as published by the Free Software Foundation; either
16
   9               	;    version 2 of the License, or (at your option) any later version.
17
  10               	
18
  11               	;    This program is distributed in the hope that it will be useful,
19
  12               	;    but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  13               	;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21
  14               	;    General Public License for more details.
22
  15               	
23
  16               	;    You should have received a copy of the GNU General Public
24
  17               	;    License along with this program; if not, write to the Free Software
25
  18               	;    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
  19               	
27
  20               	;   For more information on the AVRcam, please contact:
28
  21               	
29
  22               	;   john@jrobot.net
30
  23               	
31
  24               	;   or go to www.jrobot.net for more details regarding the system.
32
  25               	;**********************************************************************
33
  26               	;       Module Name: CanInterfaceAsm.S
34
  27               	;       Module Date: 04/14/2004
35
  28               	;       Module Auth: John Orlando
36
  29               	;
37
  30               	;       Description: This module provides the low-level interface
38
  31               	;       to the OV6620 camera hardware.  It is responsible for
39
  32               	;   	acquiring each pixel block (R,G,B), performing the mapping
40
  33               	;       into an actual color (orange, purple, etc), run-length
41
  34               	;       encoding the data, and storing the info off to the appropriate
42
  35               	;       line buffer.  This routine is synchronized with the pixel data
43
  36               	;       so that no polling of the camera data needs to be done (the
44
  37               	;       OV6620 is clocked off of the same crystal source as the mega8,
45
  38               	;       thus providing inherent synchronization between the two).
46
  39               	;
47
  40               	;       Revision History:
48
  41               	;       Date        Rel Ver.    Notes
49
  42               	;       4/10/2004      0.1     Module created
50
  43               	;       6/30/2004      1.0     Initial release for Circuit Cellar
51
  44               	;                              contest.
52
  45               	;       1/16/2005      1.4     Fixed issue with the TCCR1B register
53
  46               	;                              where PCLK was getting routed to the
54
  47               	;                              timer1 even when it wasn't needed.
55
  48               	;                              This caused excessive counter overflow
56
  49               	;                              interrupts, and caused problems.  Now,
57
  50               	;                              the "PCLK" pipe feeds timer1 when needed,
58
  51               	;                              and is turned off when it isn't needed.
59
  52               	
60
  53               	#include <avr/io.h>
484 kaklik 61
GAS LISTING /tmp/ccowxWMg.s 			page 2
174 kaklik 62
 
63
 
64
   1               	/* Copyright (c) 2002,2003,2005,2006, Marek Michalkiewicz, Joerg Wunsch
65
   2               	   All rights reserved.
66
   3               	
67
   4               	   Redistribution and use in source and binary forms, with or without
68
   5               	   modification, are permitted provided that the following conditions are met:
69
   6               	
70
   7               	   * Redistributions of source code must retain the above copyright
71
   8               	     notice, this list of conditions and the following disclaimer.
72
   9               	
73
  10               	   * Redistributions in binary form must reproduce the above copyright
74
  11               	     notice, this list of conditions and the following disclaimer in
75
  12               	     the documentation and/or other materials provided with the
76
  13               	     distribution.
77
  14               	
78
  15               	   * Neither the name of the copyright holders nor the names of
79
  16               	     contributors may be used to endorse or promote products derived
80
  17               	     from this software without specific prior written permission.
81
  18               	
82
  19               	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
83
  20               	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
84
  21               	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
85
  22               	  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
86
  23               	  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
87
  24               	  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
88
  25               	  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
89
  26               	  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
90
  27               	  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
91
  28               	  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
92
  29               	  POSSIBILITY OF SUCH DAMAGE. */
93
  30               	
484 kaklik 94
  31               	/* $Id: io.h,v 1.24.2.9 2006/09/13 20:41:41 arcanum Exp $ */
174 kaklik 95
  32               	
96
  33               	/** \defgroup avr_io <avr/io.h>: AVR device-specific IO definitions
97
  34               	    \code #include <avr/io.h> \endcode
98
  35               	
99
  36               	    This header file includes the apropriate IO definitions for the
100
  37               	    device that has been specified by the <tt>-mmcu=</tt> compiler
101
  38               	    command-line switch.  This is done by diverting to the appropriate
102
  39               	    file <tt>&lt;avr/io</tt><em>XXXX</em><tt>.h&gt;</tt> which should
103
  40               	    never be included directly.  Some register names common to all
104
  41               	    AVR devices are defined directly within <tt>&lt;avr/io.h&gt;</tt>,
105
  42               	    but most of the details come from the respective include file.
106
  43               	
107
  44               	    Note that this file always includes
108
  45               	    \code #include <avr/sfr_defs.h> \endcode
109
  46               	    See \ref avr_sfr for the details.
110
  47               	
111
  48               	    Included are definitions of the IO register set and their
112
  49               	    respective bit values as specified in the Atmel documentation.
113
  50               	    Note that Atmel is not very consistent in its naming conventions,
114
  51               	    so even identical functions sometimes get different names on
115
  52               	    different devices.
116
  53               	
117
  54               	    Also included are the specific names useable for interrupt
118
  55               	    function definitions as documented
119
  56               	    \ref avr_signames "here".
120
  57               	
484 kaklik 121
GAS LISTING /tmp/ccowxWMg.s 			page 3
174 kaklik 122
 
123
 
124
  58               	    Finally, the following macros are defined:
125
  59               	
126
  60               	    - \b RAMEND
127
  61               	    <br>
128
  62               	    A constant describing the last on-chip RAM location.
129
  63               	    <br>
130
  64               	    - \b XRAMEND
131
  65               	    <br>
132
  66               	    A constant describing the last possible location in RAM.
133
  67               	    This is equal to RAMEND for devices that do not allow for
134
  68               	    external RAM.
135
  69               	    <br>
136
  70               	    - \b E2END
137
  71               	    <br>
138
  72               	    A constant describing the address of the last EEPROM cell.
139
  73               	    <br>
140
  74               	    - \b FLASHEND
141
  75               	    <br>
142
  76               	    A constant describing the last byte address in flash ROM.
143
  77               	    <br>
144
  78               	    - \b SPM_PAGESIZE
145
  79               	    <br>
146
  80               	    For devices with bootloader support, the flash pagesize
147
  81               	    (in bytes) to be used for the \c SPM instruction. */
148
  82               	
149
  83               	#ifndef _AVR_IO_H_
150
  84               	#define _AVR_IO_H_
151
  85               	
152
  86               	#include <avr/sfr_defs.h>
153
   1               	/* Copyright (c) 2002, Marek Michalkiewicz <marekm@amelek.gda.pl>
154
   2               	   All rights reserved.
155
   3               	
156
   4               	   Redistribution and use in source and binary forms, with or without
157
   5               	   modification, are permitted provided that the following conditions are met:
158
   6               	
159
   7               	   * Redistributions of source code must retain the above copyright
160
   8               	     notice, this list of conditions and the following disclaimer.
161
   9               	
162
  10               	   * Redistributions in binary form must reproduce the above copyright
163
  11               	     notice, this list of conditions and the following disclaimer in
164
  12               	     the documentation and/or other materials provided with the
165
  13               	     distribution.
166
  14               	
167
  15               	   * Neither the name of the copyright holders nor the names of
168
  16               	     contributors may be used to endorse or promote products derived
169
  17               	     from this software without specific prior written permission.
170
  18               	
171
  19               	   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
172
  20               	   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
173
  21               	   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
174
  22               	   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
175
  23               	   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
176
  24               	   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
177
  25               	   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
178
  26               	   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
179
  27               	   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
180
  28               	   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
484 kaklik 181
GAS LISTING /tmp/ccowxWMg.s 			page 4
174 kaklik 182
 
183
 
184
  29               	   POSSIBILITY OF SUCH DAMAGE.  */
185
  30               	
186
  31               	/* avr/sfr_defs.h - macros for accessing AVR special function registers */
187
  32               	
484 kaklik 188
  33               	/* $Id: sfr_defs.h,v 1.16.2.2 2006/05/17 08:25:10 joerg_wunsch Exp $ */
174 kaklik 189
  34               	
190
  35               	#ifndef _AVR_SFR_DEFS_H_
191
  36               	#define _AVR_SFR_DEFS_H_ 1
192
  37               	
193
  38               	/** \defgroup avr_sfr_notes Additional notes from <avr/sfr_defs.h>
194
  39               	    \ingroup avr_sfr
195
  40               	
196
  41               	   The \c <avr/sfr_defs.h> file is included by all of the \c <avr/ioXXXX.h>
197
  42               	   files, which use macros defined here to make the special function register
198
  43               	   definitions look like C variables or simple constants, depending on the
484 kaklik 199
  44               	   <tt>_SFR_ASM_COMPAT</tt> define.  Some examples from \c <avr/iocanxx.h> to
174 kaklik 200
  45               	   show how to define such macros:
201
  46               	
202
  47               	\code
484 kaklik 203
  48               	#define PORTA   _SFR_IO8(0x02)
204
  49               	#define EEAR    _SFR_IO16(0x21)
205
  50               	#define UDR0    _SFR_MEM8(0xC6)
206
  51               	#define TCNT3   _SFR_MEM16(0x94)
207
  52               	#define CANIDT  _SFR_MEM32(0xF0)
208
  53               	\endcode
209
  54               	
210
  55               	   If \c _SFR_ASM_COMPAT is not defined, C programs can use names like
211
  56               	   <tt>PORTA</tt> directly in C expressions (also on the left side of
212
  57               	   assignment operators) and GCC will do the right thing (use short I/O
213
  58               	   instructions if possible).  The \c __SFR_OFFSET definition is not used in
214
  59               	   any way in this case.
215
  60               	
216
  61               	   Define \c _SFR_ASM_COMPAT as 1 to make these names work as simple constants
217
  62               	   (addresses of the I/O registers).  This is necessary when included in
218
  63               	   preprocessed assembler (*.S) source files, so it is done automatically if
219
  64               	   \c __ASSEMBLER__ is defined.  By default, all addresses are defined as if
220
  65               	   they were memory addresses (used in \c lds/sts instructions).  To use these
221
  66               	   addresses in \c in/out instructions, you must subtract 0x20 from them.
222
  67               	
223
  68               	   For more backwards compatibility, insert the following at the start of your
224
  69               	   old assembler source file:
225
  70               	
226
  71               	\code
227
  72               	#define __SFR_OFFSET 0
228
  73               	\endcode
229
  74               	
230
  75               	   This automatically subtracts 0x20 from I/O space addresses, but it's a
231
  76               	   hack, so it is recommended to change your source: wrap such addresses in
232
  77               	   macros defined here, as shown below.  After this is done, the
233
  78               	   <tt>__SFR_OFFSET</tt> definition is no longer necessary and can be removed.
234
  79               	
235
  80               	   Real example - this code could be used in a boot loader that is portable
236
  81               	   between devices with \c SPMCR at different addresses.
237
  82               	
238
  83               	\verbatim
239
  84               	<avr/iom163.h>: #define SPMCR _SFR_IO8(0x37)
240
  85               	<avr/iom128.h>: #define SPMCR _SFR_MEM8(0x68)
241
GAS LISTING /tmp/ccowxWMg.s 			page 5
174 kaklik 242
 
243
 
484 kaklik 244
  86               	\endverbatim
174 kaklik 245
  87               	
484 kaklik 246
  87               	
174 kaklik 247
  88               	#ifndef __AVR_HAVE_MOVW__
248
  89               	#  if  defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
249
  90               	#   define __AVR_HAVE_MOVW__ 1
250
  91               	#  endif
251
  92               	#endif
252
  93               	
253
  94               	#ifndef __AVR_HAVE_LPMX__
254
  95               	# if  defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
255
  96               	#  define __AVR_HAVE_LPMX__ 1
256
  97               	# endif
257
  98               	#endif
258
  99               	
259
 100               	/*
260
 101               	 * Registers common to all AVR devices.
261
 102               	 */
262
 103               	
263
 104               	#if __AVR_ARCH__ != 1
264
 105               	/*
265
 106               	 * AVR architecture 1 has no RAM, thus no stack pointer.
266
 107               	 *
267
 108               	 * All other archs do have a stack pointer.  Some devices have only
268
 109               	 * less than 256 bytes of possible RAM locations (128 Bytes of SRAM
269
 110               	 * and no option for external RAM), thus SPH is officially "reserved"
270
 111               	 * for them.  We catch this case below after including the
271
 112               	 * device-specific ioXXXX.h file, by examining XRAMEND, and
272
 113               	 * #undef-ining SP and SPH in that case.
273
 114               	 */
274
 115               	/* Stack Pointer */
275
 116               	#define SP        _SFR_IO16(0x3D)
276
 117               	#define SPL       _SFR_IO8(0x3D)
277
 118               	#define SPH       _SFR_IO8(0x3E)
278
 119               	#endif /* #if __AVR_ARCH__ != 1 */
279
 120               	
280
 121               	/* Status REGister */
281
 122               	#define SREG      _SFR_IO8(0x3F)
282
 123               	
283
 124               	/* Status Register - SREG */
284
 125               	#define    SREG_I       7
285
 126               	#define    SREG_T       6
286
 127               	#define    SREG_H       5
287
 128               	#define    SREG_S       4
288
 129               	#define    SREG_V       3
289
 130               	#define    SREG_N       2
290
 131               	#define    SREG_Z       1
291
 132               	#define    SREG_C       0
292
 133               	
293
 134               	/* Pointer definition */
294
 135               	#if __AVR_ARCH__ != 1
295
 136               	/* avr1 has only the Z pointer */
296
 137               	#define    XL           r26
297
 138               	#define    XH           r27
298
 139               	#define    YL           r28
299
 140               	#define    YH           r29
300
 141               	#endif /* #if __AVR_ARCH__ != 1 */
484 kaklik 301
GAS LISTING /tmp/ccowxWMg.s 			page 6
174 kaklik 302
 
303
 
304
 142               	#define    ZL           r30
305
 143               	#define    ZH           r31
306
 144               	
307
 145               	/*
308
 146               	 * Only few devices come without EEPROM.  In order to assemble the
309
 147               	 * EEPROM library components without defining a specific device, we
310
 148               	 * keep the EEPROM-related definitions here.
311
 149               	 */
312
 150               	#if defined(__COMPILING_AVR_LIBC__)
313
 151               	
314
 152               	/* EEPROM Control Register */
315
 153               	#define EECR	_SFR_IO8(0x1C)
316
 154               	
317
 155               	/* EEPROM Data Register */
318
 156               	#define EEDR	_SFR_IO8(0x1D)
319
 157               	
320
 158               	/* EEPROM Address Register */
321
 159               	#define EEAR	_SFR_IO16(0x1E)
322
 160               	#define EEARL	_SFR_IO8(0x1E)
323
 161               	#define EEARH	_SFR_IO8(0x1F)
324
 162               	
325
 163               	/* EEPROM Control Register */
326
 164               	#define    EERIE        3
327
 165               	#define    EEMWE        2
328
 166               	#define    EEWE         1
329
 167               	#define    EERE         0
330
 168               	
331
 169               	#endif /* __COMPILING_AVR_LIBC__ */
332
 170               	
333
 171               	#if defined (__AVR_AT94K__)
334
 172               	#  include <avr/ioat94k.h>
335
 173               	#elif defined (__AVR_AT43USB320__)
336
 174               	#  include <avr/io43u32x.h>
337
 175               	#elif defined (__AVR_AT43USB355__)
338
 176               	#  include <avr/io43u35x.h>
339
 177               	#elif defined (__AVR_AT76C711__)
340
 178               	#  include <avr/io76c711.h>
341
 179               	#elif defined (__AVR_AT86RF401__)
342
 180               	#  include <avr/io86r401.h>
343
 181               	#elif defined (__AVR_AT90PWM2__)
344
 182               	#  include <avr/io90pwmx.h>
345
 183               	#elif defined (__AVR_AT90PWM3__)
346
 184               	#  include <avr/io90pwmx.h>
347
 185               	#elif defined (__AVR_ATmega128__)
348
 186               	#  include <avr/iom128.h>
349
 187               	#elif defined (__AVR_ATmega1280__)
350
 188               	#  include <avr/iom1280.h>
351
 189               	#elif defined (__AVR_ATmega1281__)
352
 190               	#  include <avr/iom1281.h>
484 kaklik 353
 191               	#elif defined (__AVR_ATmega2560__)
354
 192               	#  include <avr/iom2560.h>
355
 193               	#elif defined (__AVR_ATmega2561__)
356
 194               	#  include <avr/iom2561.h>
357
 195               	#elif defined (__AVR_AT90CAN32__)
358
 196               	#  include <avr/iocan32.h>
359
 197               	#elif defined (__AVR_AT90CAN64__)
360
 198               	#  include <avr/iocan64.h>
361
GAS LISTING /tmp/ccowxWMg.s 			page 7
174 kaklik 362
 
363
 
484 kaklik 364
 199               	#elif defined (__AVR_AT90CAN128__)
365
 200               	#  include <avr/iocan128.h>
366
 201               	#elif defined (__AVR_AT90USB646__)
367
 202               	#  include <avr/iousb646.h>
368
 203               	#elif defined (__AVR_AT90USB647__)
369
 204               	#  include <avr/iousb647.h>
370
 205               	#elif defined (__AVR_AT90USB1286__)
371
 206               	#  include <avr/iousb1286.h>
372
 207               	#elif defined (__AVR_AT90USB1287__)
373
 208               	#  include <avr/iousb1287.h>
374
 209               	#elif defined (__AVR_ATmega64__)
375
 210               	#  include <avr/iom64.h>
376
 211               	#elif defined (__AVR_ATmega640__)
377
 212               	#  include <avr/iom640.h>
378
 213               	#elif defined (__AVR_ATmega644__)
379
 214               	#  include <avr/iom644.h>
380
 215               	#elif defined (__AVR_ATmega644P__)
381
 216               	#  include <avr/iom644.h>
382
 217               	#elif defined (__AVR_ATmega645__)
383
 218               	#  include <avr/iom645.h>
384
 219               	#elif defined (__AVR_ATmega6450__)
385
 220               	#  include <avr/iom6450.h>
386
 221               	#elif defined (__AVR_ATmega649__)
387
 222               	#  include <avr/iom649.h>
388
 223               	#elif defined (__AVR_ATmega6490__)
389
 224               	#  include <avr/iom6490.h>
390
 225               	#elif defined (__AVR_ATmega103__)
391
 226               	#  include <avr/iom103.h>
392
 227               	#elif defined (__AVR_ATmega32__)
393
 228               	#  include <avr/iom32.h>
394
 229               	#elif defined (__AVR_ATmega323__)
395
 230               	#  include <avr/iom323.h>
396
 231               	#elif defined (__AVR_ATmega324P__)
397
 232               	#  include <avr/iom324.h>
398
 233               	#elif defined (__AVR_ATmega325__)
399
 234               	#  include <avr/iom325.h>
400
 235               	#elif defined (__AVR_ATmega3250__)
401
 236               	#  include <avr/iom3250.h>
402
 237               	#elif defined (__AVR_ATmega329__)
403
 238               	#  include <avr/iom329.h>
404
 239               	#elif defined (__AVR_ATmega3290__)
405
 240               	#  include <avr/iom3290.h>
406
 241               	#elif defined (__AVR_ATmega406__)
407
 242               	#  include <avr/iom406.h>
408
 243               	#elif defined (__AVR_ATmega16__)
409
 244               	#  include <avr/iom16.h>
410
 245               	#elif defined (__AVR_ATmega161__)
411
 246               	#  include <avr/iom161.h>
412
 247               	#elif defined (__AVR_ATmega162__)
413
 248               	#  include <avr/iom162.h>
414
 249               	#elif defined (__AVR_ATmega163__)
415
 250               	#  include <avr/iom163.h>
416
 251               	#elif defined (__AVR_ATmega164P__)
417
 252               	#  include <avr/iom164.h>
418
 253               	#elif defined (__AVR_ATmega165__)
419
 254               	#  include <avr/iom165.h>
420
 255               	#elif defined (__AVR_ATmega165P__)
421
GAS LISTING /tmp/ccowxWMg.s 			page 8
174 kaklik 422
 
423
 
484 kaklik 424
 256               	#  include <avr/iom165p.h>
425
 257               	#elif defined (__AVR_ATmega168__)
426
 258               	#  include <avr/iom168.h>
427
 259               	#elif defined (__AVR_ATmega169__)
428
 260               	#  include <avr/iom169.h>
429
 261               	#elif defined (__AVR_ATmega169P__)
430
 262               	#  include <avr/iom169p.h>
431
 263               	#elif defined (__AVR_ATmega8__)
432
 264               	#  include <avr/iom8.h>
174 kaklik 433
   1               	/* Copyright (c) 2002, Marek Michalkiewicz
434
   2               	   All rights reserved.
435
   3               	
436
   4               	   Redistribution and use in source and binary forms, with or without
437
   5               	   modification, are permitted provided that the following conditions are met:
438
   6               	
439
   7               	   * Redistributions of source code must retain the above copyright
440
   8               	     notice, this list of conditions and the following disclaimer.
441
   9               	
442
  10               	   * Redistributions in binary form must reproduce the above copyright
443
  11               	     notice, this list of conditions and the following disclaimer in
444
  12               	     the documentation and/or other materials provided with the
445
  13               	     distribution.
446
  14               	
447
  15               	   * Neither the name of the copyright holders nor the names of
448
  16               	     contributors may be used to endorse or promote products derived
449
  17               	     from this software without specific prior written permission.
450
  18               	
451
  19               	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
452
  20               	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
453
  21               	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
454
  22               	  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
455
  23               	  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
456
  24               	  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
457
  25               	  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
458
  26               	  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
459
  27               	  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
460
  28               	  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
461
  29               	  POSSIBILITY OF SUCH DAMAGE. */
462
  30               	
463
  31               	/* $Id: iom8.h,v 1.13 2005/10/30 22:11:23 joerg_wunsch Exp $ */
464
  32               	
465
  33               	/* avr/iom8.h - definitions for ATmega8 */
466
  34               	
467
  35               	#ifndef _AVR_IOM8_H_
468
  36               	#define _AVR_IOM8_H_ 1
469
  37               	
470
  38               	/* This file should only be included from <avr/io.h>, never directly. */
471
  39               	
472
  40               	#ifndef _AVR_IO_H_
473
  41               	#  error "Include <avr/io.h> instead of this file."
474
  42               	#endif
475
  43               	
476
  44               	#ifndef _AVR_IOXXX_H_
477
  45               	#  define _AVR_IOXXX_H_ "iom8.h"
478
  46               	#else
479
  47               	#  error "Attempt to include more than one <avr/ioXXX.h> file."
480
  48               	#endif 
484 kaklik 481
GAS LISTING /tmp/ccowxWMg.s 			page 9
482
 
483
 
174 kaklik 484
  49               	
485
  50               	/* I/O registers */
486
  51               	
487
  52               	/* TWI stands for "Two Wire Interface" or "TWI Was I2C(tm)" */
488
  53               	#define TWBR	_SFR_IO8(0x00)
489
  54               	#define TWSR	_SFR_IO8(0x01)
490
  55               	#define TWAR	_SFR_IO8(0x02)
491
  56               	#define TWDR	_SFR_IO8(0x03)
492
  57               	
493
  58               	/* ADC */
494
  59               	#define ADCW	_SFR_IO16(0x04)
495
  60               	#ifndef __ASSEMBLER__
496
  61               	#define ADC	_SFR_IO16(0x04)
497
  62               	#endif
498
  63               	#define ADCL	_SFR_IO8(0x04)
499
  64               	#define ADCH	_SFR_IO8(0x05)
500
  65               	#define ADCSR	_SFR_IO8(0x06)
501
  66               	#define ADCSRA	_SFR_IO8(0x06)  /* Changed in 2486H-AVR-09/02 */
502
  67               	#define ADMUX	_SFR_IO8(0x07)
503
  68               	
504
  69               	/* analog comparator */
505
  70               	#define ACSR	_SFR_IO8(0x08)
506
  71               	
507
  72               	/* USART */
508
  73               	#define UBRRL	_SFR_IO8(0x09)
509
  74               	#define UCSRB	_SFR_IO8(0x0A)
510
  75               	#define UCSRA	_SFR_IO8(0x0B)
511
  76               	#define UDR	_SFR_IO8(0x0C)
512
  77               	
513
  78               	/* SPI */
514
  79               	#define SPCR	_SFR_IO8(0x0D)
515
  80               	#define SPSR	_SFR_IO8(0x0E)
516
  81               	#define SPDR	_SFR_IO8(0x0F)
517
  82               	
518
  83               	/* Port D */
519
  84               	#define PIND	_SFR_IO8(0x10)
520
  85               	#define DDRD	_SFR_IO8(0x11)
521
  86               	#define PORTD	_SFR_IO8(0x12)
522
  87               	
523
  88               	/* Port C */
524
  89               	#define PINC	_SFR_IO8(0x13)
525
  90               	#define DDRC	_SFR_IO8(0x14)
526
  91               	#define PORTC	_SFR_IO8(0x15)
527
  92               	
528
  93               	/* Port B */
529
  94               	#define PINB	_SFR_IO8(0x16)
530
  95               	#define DDRB	_SFR_IO8(0x17)
531
  96               	#define PORTB	_SFR_IO8(0x18)
532
  97               	
533
  98               	/* EEPROM Control Register */
534
  99               	#define EECR	_SFR_IO8(0x1C)
535
 100               	
536
 101               	/* EEPROM Data Register */
537
 102               	#define EEDR	_SFR_IO8(0x1D)
538
 103               	
539
 104               	/* EEPROM Address Register */
540
 105               	#define EEAR	_SFR_IO16(0x1E)
484 kaklik 541
GAS LISTING /tmp/ccowxWMg.s 			page 10
542
 
543
 
174 kaklik 544
 106               	#define EEARL	_SFR_IO8(0x1E)
545
 107               	#define EEARH	_SFR_IO8(0x1F)
546
 108               	
547
 109               	#define UCSRC	_SFR_IO8(0x20)
548
 110               	#define UBRRH	_SFR_IO8(0x20)
549
 111               	
550
 112               	#define WDTCR	_SFR_IO8(0x21)
551
 113               	#define ASSR	_SFR_IO8(0x22)
552
 114               	
553
 115               	/* Timer 2 */
554
 116               	#define OCR2	_SFR_IO8(0x23)
555
 117               	#define TCNT2	_SFR_IO8(0x24)
556
 118               	#define TCCR2	_SFR_IO8(0x25)
557
 119               	
558
 120               	/* Timer 1 */
559
 121               	#define ICR1	_SFR_IO16(0x26)
560
 122               	#define ICR1L	_SFR_IO8(0x26)
561
 123               	#define ICR1H	_SFR_IO8(0x27)
562
 124               	#define OCR1B	_SFR_IO16(0x28)
563
 125               	#define OCR1BL	_SFR_IO8(0x28)
564
 126               	#define OCR1BH	_SFR_IO8(0x29)
565
 127               	#define OCR1A	_SFR_IO16(0x2A)
566
 128               	#define OCR1AL	_SFR_IO8(0x2A)
567
 129               	#define OCR1AH	_SFR_IO8(0x2B)
568
 130               	#define TCNT1	_SFR_IO16(0x2C)
569
 131               	#define TCNT1L	_SFR_IO8(0x2C)
570
 132               	#define TCNT1H	_SFR_IO8(0x2D)
571
 133               	#define TCCR1B	_SFR_IO8(0x2E)
572
 134               	#define TCCR1A	_SFR_IO8(0x2F)
573
 135               	
574
 136               	#define SFIOR	_SFR_IO8(0x30)
575
 137               	
576
 138               	#define OSCCAL	_SFR_IO8(0x31)
577
 139               	
578
 140               	/* Timer 0 */
579
 141               	#define TCNT0	_SFR_IO8(0x32)
580
 142               	#define TCCR0	_SFR_IO8(0x33)
581
 143               	
582
 144               	#define MCUCSR	_SFR_IO8(0x34)
583
 145               	#define MCUCR	_SFR_IO8(0x35)
584
 146               	
585
 147               	#define TWCR	_SFR_IO8(0x36)
586
 148               	
587
 149               	#define SPMCR	_SFR_IO8(0x37)
588
 150               	
589
 151               	#define TIFR	_SFR_IO8(0x38)
590
 152               	#define TIMSK	_SFR_IO8(0x39)
591
 153               	
592
 154               	#define GIFR	_SFR_IO8(0x3A)
593
 155               	#define GIMSK	_SFR_IO8(0x3B)
594
 156               	#define GICR	_SFR_IO8(0x3B)   /* Changed in 2486H-AVR-09/02 */
595
 157               	
596
 158               	/* 0x3C reserved (OCR0?) */
597
 159               	
598
 160               	/* 0x3D..0x3E SP */
599
 161               	
600
 162               	/* 0x3F SREG */
484 kaklik 601
GAS LISTING /tmp/ccowxWMg.s 			page 11
602
 
603
 
174 kaklik 604
 163               	
605
 164               	/* Interrupt vectors */
606
 165               	
607
 166               	/* External Interrupt Request 0 */
608
 167               	#define INT0_vect			_VECTOR(1)
609
 168               	#define SIG_INTERRUPT0			_VECTOR(1)
610
 169               	
611
 170               	/* External Interrupt Request 1 */
612
 171               	#define INT1_vect			_VECTOR(2)
613
 172               	#define SIG_INTERRUPT1			_VECTOR(2)
614
 173               	
615
 174               	/* Timer/Counter2 Compare Match */
616
 175               	#define TIMER2_COMP_vect		_VECTOR(3)
617
 176               	#define SIG_OUTPUT_COMPARE2		_VECTOR(3)
618
 177               	
619
 178               	/* Timer/Counter2 Overflow */
620
 179               	#define TIMER2_OVF_vect			_VECTOR(4)
621
 180               	#define SIG_OVERFLOW2			_VECTOR(4)
622
 181               	
623
 182               	/* Timer/Counter1 Capture Event */
624
 183               	#define TIMER1_CAPT_vect		_VECTOR(5)
625
 184               	#define SIG_INPUT_CAPTURE1		_VECTOR(5)
626
 185               	
627
 186               	/* Timer/Counter1 Compare Match A */
628
 187               	#define TIMER1_COMPA_vect		_VECTOR(6)
629
 188               	#define SIG_OUTPUT_COMPARE1A		_VECTOR(6)
630
 189               	
631
 190               	/* Timer/Counter1 Compare Match B */
632
 191               	#define TIMER1_COMPB_vect		_VECTOR(7)
633
 192               	#define SIG_OUTPUT_COMPARE1B		_VECTOR(7)
634
 193               	
635
 194               	/* Timer/Counter1 Overflow */
636
 195               	#define TIMER1_OVF_vect			_VECTOR(8)
637
 196               	#define SIG_OVERFLOW1			_VECTOR(8)
638
 197               	
639
 198               	/* Timer/Counter0 Overflow */
640
 199               	#define TIMER0_OVF_vect			_VECTOR(9)
641
 200               	#define SIG_OVERFLOW0			_VECTOR(9)
642
 201               	
643
 202               	/* Serial Transfer Complete */
644
 203               	#define SPI_STC_vect			_VECTOR(10)
645
 204               	#define SIG_SPI				_VECTOR(10)
646
 205               	
647
 206               	/* USART, Rx Complete */
648
 207               	#define USART_RXC_vect			_VECTOR(11)
649
 208               	#define SIG_UART_RECV			_VECTOR(11)
650
 209               	
651
 210               	/* USART Data Register Empty */
652
 211               	#define USART_UDRE_vect			_VECTOR(12)
653
 212               	#define SIG_UART_DATA			_VECTOR(12)
654
 213               	
655
 214               	/* USART, Tx Complete */
656
 215               	#define USART_TXC_vect			_VECTOR(13)
657
 216               	#define SIG_UART_TRANS			_VECTOR(13)
658
 217               	
659
 218               	/* ADC Conversion Complete */
660
 219               	#define ADC_vect			_VECTOR(14)
484 kaklik 661
GAS LISTING /tmp/ccowxWMg.s 			page 12
662
 
663
 
174 kaklik 664
 220               	#define SIG_ADC				_VECTOR(14)
665
 221               	
666
 222               	/* EEPROM Ready */
667
 223               	#define EE_RDY_vect			_VECTOR(15)
668
 224               	#define SIG_EEPROM_READY		_VECTOR(15)
669
 225               	
670
 226               	/* Analog Comparator */
671
 227               	#define ANA_COMP_vect			_VECTOR(16)
672
 228               	#define SIG_COMPARATOR			_VECTOR(16)
673
 229               	
674
 230               	/* 2-wire Serial Interface */
675
 231               	#define TWI_vect			_VECTOR(17)
676
 232               	#define SIG_2WIRE_SERIAL		_VECTOR(17)
677
 233               	
678
 234               	/* Store Program Memory Ready */
679
 235               	#define SPM_RDY_vect			_VECTOR(18)
680
 236               	#define SIG_SPM_READY			_VECTOR(18)
681
 237               	
682
 238               	#define _VECTORS_SIZE 38
683
 239               	
684
 240               	/* Bit numbers */
685
 241               	
686
 242               	/* GIMSK / GICR */
687
 243               	#define INT1	7
688
 244               	#define INT0	6
689
 245               	#define IVSEL	1
690
 246               	#define IVCE	0
691
 247               	
692
 248               	/* GIFR */
693
 249               	#define INTF1	7
694
 250               	#define INTF0	6
695
 251               	
696
 252               	/* TIMSK */
697
 253               	#define OCIE2	7
698
 254               	#define TOIE2	6
699
 255               	#define TICIE1	5
700
 256               	#define OCIE1A	4
701
 257               	#define OCIE1B	3
484 kaklik 702
 258               	#define TOIE1	2
703
 259               	/* bit 1 reserved (OCIE0?) */
704
 260               	#define TOIE0	0
705
 261               	
706
 262               	/* TIFR */
707
 263               	#define OCF2	7
708
 264               	#define TOV2	6
709
 265               	#define ICF1	5
710
 265               	#elif defined (__AVR_ATmega48__)
711
 266               	#  include <avr/iom48.h>
712
 267               	#elif defined (__AVR_ATmega88__)
713
 268               	#  include <avr/iom88.h>
714
 269               	#elif defined (__AVR_ATmega8515__)
715
 270               	#  include <avr/iom8515.h>
716
 271               	#elif defined (__AVR_ATmega8535__)
717
 272               	#  include <avr/iom8535.h>
718
 273               	#elif defined (__AVR_AT90S8535__)
719
 274               	#  include <avr/io8535.h>
720
 275               	#elif defined (__AVR_AT90C8534__)
721
GAS LISTING /tmp/ccowxWMg.s 			page 13
174 kaklik 722
 
723
 
484 kaklik 724
 276               	#  include <avr/io8534.h>
725
 277               	#elif defined (__AVR_AT90S8515__)
726
 278               	#  include <avr/io8515.h>
727
 279               	#elif defined (__AVR_AT90S4434__)
728
 280               	#  include <avr/io4434.h>
729
 281               	#elif defined (__AVR_AT90S4433__)
730
 282               	#  include <avr/io4433.h>
731
 283               	#elif defined (__AVR_AT90S4414__)
732
 284               	#  include <avr/io4414.h>
733
 285               	#elif defined (__AVR_ATtiny22__)
734
 286               	#  include <avr/iotn22.h>
735
 287               	#elif defined (__AVR_ATtiny26__)
736
 288               	#  include <avr/iotn26.h>
737
 289               	#elif defined (__AVR_AT90S2343__)
738
 290               	#  include <avr/io2343.h>
739
 291               	#elif defined (__AVR_AT90S2333__)
740
 292               	#  include <avr/io2333.h>
741
 293               	#elif defined (__AVR_AT90S2323__)
742
 294               	#  include <avr/io2323.h>
743
 295               	#elif defined (__AVR_AT90S2313__)
744
 296               	#  include <avr/io2313.h>
745
 297               	#elif defined (__AVR_ATtiny2313__)
746
 298               	#  include <avr/iotn2313.h>
747
 299               	#elif defined (__AVR_ATtiny13__)
748
 300               	#  include <avr/iotn13.h>
749
 301               	#elif defined (__AVR_ATtiny25__)
750
 302               	#  include <avr/iotn25.h>
751
 303               	#elif defined (__AVR_ATtiny45__)
752
 304               	#  include <avr/iotn45.h>
753
 305               	#elif defined (__AVR_ATtiny85__)
754
 306               	#  include <avr/iotn85.h>
755
 307               	#elif defined (__AVR_ATtiny24__)
756
 308               	#  include <avr/iotn24.h>
757
 309               	#elif defined (__AVR_ATtiny44__)
758
 310               	#  include <avr/iotn44.h>
759
 311               	#elif defined (__AVR_ATtiny84__)
760
 312               	#  include <avr/iotn84.h>
761
 313               	#elif defined (__AVR_ATtiny261__)
762
 314               	#  include <avr/iotn261.h>
763
 315               	#elif defined (__AVR_ATtiny461__)
764
 316               	#  include <avr/iotn461.h>
765
 317               	#elif defined (__AVR_ATtiny861__)
766
 318               	#  include <avr/iotn861.h>
767
 319               	/* avr1: the following only supported for assembler programs */
768
 320               	#elif defined (__AVR_ATtiny28__)
769
 321               	#  include <avr/iotn28.h>
770
 322               	#elif defined (__AVR_AT90S1200__)
771
 323               	#  include <avr/io1200.h>
772
 324               	#elif defined (__AVR_ATtiny15__)
773
 325               	#  include <avr/iotn15.h>
774
 326               	#elif defined (__AVR_ATtiny12__)
775
 327               	#  include <avr/iotn12.h>
776
 328               	#elif defined (__AVR_ATtiny11__)
777
 329               	#  include <avr/iotn11.h>
778
 330               	#else
779
 331               	#  if !defined(__COMPILING_AVR_LIBC__)
780
 332               	#    warning "device type not defined"
781
GAS LISTING /tmp/ccowxWMg.s 			page 14
782
 
783
 
784
 333               	#  endif
785
 334               	#endif
786
 335               	
787
 336               	#include <avr/portpins.h>
174 kaklik 788
   1               	/* Copyright (c) 2003  Theodore A. Roth
789
   2               	   All rights reserved.
790
   3               	
791
   4               	   Redistribution and use in source and binary forms, with or without
792
   5               	   modification, are permitted provided that the following conditions are met:
793
   6               	
794
   7               	   * Redistributions of source code must retain the above copyright
795
   8               	     notice, this list of conditions and the following disclaimer.
796
   9               	
797
  10               	   * Redistributions in binary form must reproduce the above copyright
798
  11               	     notice, this list of conditions and the following disclaimer in
799
  12               	     the documentation and/or other materials provided with the
800
  13               	     distribution.
801
  14               	
802
  15               	   * Neither the name of the copyright holders nor the names of
803
  16               	     contributors may be used to endorse or promote products derived
804
  17               	     from this software without specific prior written permission.
805
  18               	
806
  19               	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
807
  20               	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
808
  21               	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
809
  22               	  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
810
  23               	  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
811
  24               	  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
812
  25               	  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
813
  26               	  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
814
  27               	  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
815
  28               	  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
816
  29               	  POSSIBILITY OF SUCH DAMAGE. */
817
  30               	
818
  31               	/* $Id: portpins.h,v 1.3.4.1 2006/03/10 16:22:38 aesok Exp $ */
819
  32               	
820
  33               	#ifndef _AVR_PORTPINS_H_
821
  34               	#define _AVR_PORTPINS_H_ 1
822
  35               	
823
  36               	/* This file should only be included from <avr/io.h>, never directly. */
824
  37               	
825
  38               	#ifndef _AVR_IO_H_
826
  39               	#  error "Include <avr/io.h> instead of this file."
827
  40               	#endif
828
  41               	
829
  42               	/* Define Generic PORTn, DDn, and PINn values. */
830
  43               	
831
  44               	/* Port Data Register (generic) */
832
  45               	#define    PORT7        7
833
  46               	#define    PORT6        6
834
  47               	#define    PORT5        5
835
  48               	#define    PORT4        4
836
  49               	#define    PORT3        3
837
  50               	#define    PORT2        2
838
  51               	#define    PORT1        1
839
  52               	#define    PORT0        0
840
  53               	
484 kaklik 841
GAS LISTING /tmp/ccowxWMg.s 			page 15
842
 
843
 
174 kaklik 844
  54               	/* Port Data Direction Register (generic) */
845
  55               	#define    DD7          7
846
  56               	#define    DD6          6
847
  57               	#define    DD5          5
848
  58               	#define    DD4          4
849
  59               	#define    DD3          3
850
  60               	#define    DD2          2
851
  61               	#define    DD1          1
852
  62               	#define    DD0          0
853
  63               	
854
  64               	/* Port Input Pins (generic) */
855
  65               	#define    PIN7         7
856
  66               	#define    PIN6         6
857
  67               	#define    PIN5         5
858
  68               	#define    PIN4         4
859
  69               	#define    PIN3         3
860
  70               	#define    PIN2         2
861
  71               	#define    PIN1         1
862
  72               	#define    PIN0         0
863
  73               	
864
  74               	/* Define PORTxn values for all possible port pins. */
865
  75               	
866
  76               	/* PORT A */
867
  77               	
868
  78               	#if defined(PA0)
869
  79               	#  define PORTA0 PA0
870
  80               	#endif
871
  81               	#if defined(PA1)
872
  82               	#  define PORTA1 PA1
873
  83               	#endif
874
  84               	#if defined(PA2)
875
  85               	#  define PORTA2 PA2
876
  86               	#endif
877
  87               	#if defined(PA3)
878
  88               	#  define PORTA3 PA3
879
  89               	#endif
880
  90               	#if defined(PA4)
881
  91               	#  define PORTA4 PA4
882
  92               	#endif
883
  93               	#if defined(PA5)
884
  94               	#  define PORTA5 PA5
885
  95               	#endif
886
  96               	#if defined(PA6)
887
  97               	#  define PORTA6 PA6
888
  98               	#endif
889
  99               	#if defined(PA7)
890
 100               	#  define PORTA7 PA7
891
 101               	#endif
892
 102               	
893
 103               	/* PORT B */
894
 104               	
895
 105               	#if defined(PB0)
896
 106               	#  define PORTB0 PB0
897
 107               	#endif
898
 108               	#if defined(PB1)
899
 109               	#  define PORTB1 PB1
900
 110               	#endif
484 kaklik 901
GAS LISTING /tmp/ccowxWMg.s 			page 16
902
 
903
 
174 kaklik 904
 111               	#if defined(PB2)
905
 112               	#  define PORTB2 PB2
906
 113               	#endif
907
 114               	#if defined(PB3)
908
 115               	#  define PORTB3 PB3
909
 116               	#endif
910
 117               	#if defined(PB4)
911
 118               	#  define PORTB4 PB4
912
 119               	#endif
913
 120               	#if defined(PB5)
914
 121               	#  define PORTB5 PB5
915
 122               	#endif
916
 123               	#if defined(PB6)
917
 124               	#  define PORTB6 PB6
918
 125               	#endif
919
 126               	#if defined(PB7)
920
 127               	#  define PORTB7 PB7
921
 128               	#endif
922
 129               	
923
 130               	/* PORT C */
924
 131               	
925
 132               	#if defined(PC0)
926
 133               	#  define PORTC0 PC0
927
 134               	#endif
928
 135               	#if defined(PC1)
929
 136               	#  define PORTC1 PC1
930
 137               	#endif
931
 138               	#if defined(PC2)
932
 139               	#  define PORTC2 PC2
933
 140               	#endif
934
 141               	#if defined(PC3)
935
 142               	#  define PORTC3 PC3
936
 143               	#endif
937
 144               	#if defined(PC4)
938
 145               	#  define PORTC4 PC4
939
 146               	#endif
940
 147               	#if defined(PC5)
941
 148               	#  define PORTC5 PC5
942
 149               	#endif
943
 150               	#if defined(PC6)
944
 151               	#  define PORTC6 PC6
945
 152               	#endif
946
 153               	#if defined(PC7)
947
 154               	#  define PORTC7 PC7
948
 155               	#endif
949
 156               	
950
 157               	/* PORT D */
951
 158               	
952
 159               	#if defined(PD0)
953
 160               	#  define PORTD0 PD0
954
 161               	#endif
955
 162               	#if defined(PD1)
956
 163               	#  define PORTD1 PD1
957
 164               	#endif
958
 165               	#if defined(PD2)
959
 166               	#  define PORTD2 PD2
960
 167               	#endif
484 kaklik 961
GAS LISTING /tmp/ccowxWMg.s 			page 17
962
 
963
 
174 kaklik 964
 168               	#if defined(PD3)
965
 169               	#  define PORTD3 PD3
966
 170               	#endif
967
 171               	#if defined(PD4)
968
 172               	#  define PORTD4 PD4
969
 173               	#endif
970
 174               	#if defined(PD5)
971
 175               	#  define PORTD5 PD5
972
 176               	#endif
973
 177               	#if defined(PD6)
974
 178               	#  define PORTD6 PD6
975
 179               	#endif
976
 180               	#if defined(PD7)
977
 181               	#  define PORTD7 PD7
978
 182               	#endif
979
 183               	
980
 184               	/* PORT E */
981
 185               	
982
 186               	#if defined(PE0)
983
 187               	#  define PORTE0 PE0
984
 188               	#endif
985
 189               	#if defined(PE1)
986
 190               	#  define PORTE1 PE1
987
 191               	#endif
988
 192               	#if defined(PE2)
989
 193               	#  define PORTE2 PE2
990
 194               	#endif
991
 195               	#if defined(PE3)
992
 196               	#  define PORTE3 PE3
993
 197               	#endif
994
 198               	#if defined(PE4)
995
 199               	#  define PORTE4 PE4
996
 200               	#endif
997
 201               	#if defined(PE5)
998
 202               	#  define PORTE5 PE5
999
 203               	#endif
1000
 204               	#if defined(PE6)
1001
 205               	#  define PORTE6 PE6
1002
 206               	#endif
1003
 207               	#if defined(PE7)
1004
 208               	#  define PORTE7 PE7
1005
 209               	#endif
1006
 210               	
1007
 211               	/* PORT F */
1008
 212               	
1009
 213               	#if defined(PF0)
1010
 214               	#  define PORTF0 PF0
1011
 215               	#endif
1012
 216               	#if defined(PF1)
1013
 217               	#  define PORTF1 PF1
1014
 218               	#endif
1015
 219               	#if defined(PF2)
1016
 220               	#  define PORTF2 PF2
1017
 221               	#endif
1018
 222               	#if defined(PF3)
1019
 223               	#  define PORTF3 PF3
1020
 224               	#endif
484 kaklik 1021
GAS LISTING /tmp/ccowxWMg.s 			page 18
1022
 
1023
 
174 kaklik 1024
 225               	#if defined(PF4)
1025
 226               	#  define PORTF4 PF4
1026
 227               	#endif
1027
 228               	#if defined(PF5)
1028
 229               	#  define PORTF5 PF5
1029
 230               	#endif
1030
 231               	#if defined(PF6)
1031
 232               	#  define PORTF6 PF6
1032
 233               	#endif
1033
 234               	#if defined(PF7)
1034
 235               	#  define PORTF7 PF7
1035
 236               	#endif
1036
 237               	
1037
 238               	/* PORT G */
1038
 239               	
1039
 240               	#if defined(PG0)
1040
 241               	#  define PORTG0 PG0
1041
 242               	#endif
1042
 243               	#if defined(PG1)
1043
 244               	#  define PORTG1 PG1
1044
 245               	#endif
1045
 246               	#if defined(PG2)
1046
 247               	#  define PORTG2 PG2
1047
 248               	#endif
1048
 249               	#if defined(PG3)
1049
 250               	#  define PORTG3 PG3
1050
 251               	#endif
1051
 252               	#if defined(PG4)
1052
 253               	#  define PORTG4 PG4
1053
 254               	#endif
1054
 255               	#if defined(PG5)
1055
 256               	#  define PORTG5 PG5
1056
 257               	#endif
1057
 258               	#if defined(PG6)
1058
 259               	#  define PORTG6 PG6
1059
 260               	#endif
1060
 261               	#if defined(PG7)
1061
 262               	#  define PORTG7 PG7
1062
 263               	#endif
1063
 264               	
1064
 265               	/* PORT H */
1065
 266               	
1066
 267               	#if defined(PH0)
1067
 268               	#  define PORTH0 PH0
1068
 269               	#endif
1069
 270               	#if defined(PH1)
1070
 271               	#  define PORTH1 PH1
1071
 272               	#endif
1072
 273               	#if defined(PH2)
1073
 274               	#  define PORTH2 PH2
1074
 275               	#endif
1075
 276               	#if defined(PH3)
1076
 277               	#  define PORTH3 PH3
1077
 278               	#endif
1078
 279               	#if defined(PH4)
1079
 280               	#  define PORTH4 PH4
1080
 281               	#endif
484 kaklik 1081
GAS LISTING /tmp/ccowxWMg.s 			page 19
1082
 
1083
 
174 kaklik 1084
 282               	#if defined(PH5)
1085
 283               	#  define PORTH5 PH5
1086
 284               	#endif
1087
 285               	#if defined(PH6)
1088
 286               	#  define PORTH6 PH6
1089
 287               	#endif
1090
 288               	#if defined(PH7)
1091
 289               	#  define PORTH7 PH7
1092
 290               	#endif
1093
 291               	
1094
 292               	/* PORT J */
1095
 293               	
1096
 294               	#if defined(PJ0)
1097
 295               	#  define PORTJ0 PJ0
1098
 296               	#endif
1099
 297               	#if defined(PJ1)
1100
 298               	#  define PORTJ1 PJ1
1101
 299               	#endif
1102
 300               	#if defined(PJ2)
1103
 301               	#  define PORTJ2 PJ2
1104
 302               	#endif
1105
 303               	#if defined(PJ3)
1106
 304               	#  define PORTJ3 PJ3
1107
 305               	#endif
1108
 306               	#if defined(PJ4)
1109
 307               	#  define PORTJ4 PJ4
1110
 308               	#endif
1111
 309               	#if defined(PJ5)
1112
 310               	#  define PORTJ5 PJ5
1113
 311               	#endif
1114
 312               	#if defined(PJ6)
1115
 313               	#  define PORTJ6 PJ6
1116
 314               	#endif
1117
 315               	#if defined(PJ7)
1118
 316               	#  define PORTJ7 PJ7
1119
 317               	#endif
1120
 318               	
1121
 319               	/* PORT K */
1122
 320               	
1123
 321               	#if defined(PK0)
1124
 322               	#  define PORTK0 PK0
1125
 323               	#endif
1126
 324               	#if defined(PK1)
1127
 325               	#  define PORTK1 PK1
1128
 326               	#endif
1129
 327               	#if defined(PK2)
1130
 328               	#  define PORTK2 PK2
1131
 329               	#endif
484 kaklik 1132
 330               	#if defined(PK3)
1133
 331               	#  define PORTK3 PK3
1134
 332               	#endif
1135
 333               	#if defined(PK4)
1136
 334               	#  define PORTK4 PK4
1137
 335               	#endif
1138
 336               	#if defined(PK5)
1139
 337               	#  define PORTK5 PK5
174 kaklik 1140
 337               	
484 kaklik 1141
GAS LISTING /tmp/ccowxWMg.s 			page 20
1142
 
1143
 
1144
 338               	#if __AVR_ARCH__ != 1
1145
 339               	#  if XRAMEND < 0x100 && !defined(__COMPILING_AVR_LIBC__)
1146
 340               	#    undef SP
1147
 341               	#    define SP     _SFR_IO8(0x3D)
1148
 342               	#    undef SPH
1149
 343               	#  endif
1150
 344               	#endif
1151
 345               	
1152
 346               	#include <avr/version.h>
174 kaklik 1153
   1               	/* Copyright (c) 2005, Joerg Wunsch                               -*- c -*-
1154
   2               	   All rights reserved.
1155
   3               	
1156
   4               	   Redistribution and use in source and binary forms, with or without
1157
   5               	   modification, are permitted provided that the following conditions are met:
1158
   6               	
1159
   7               	   * Redistributions of source code must retain the above copyright
1160
   8               	     notice, this list of conditions and the following disclaimer.
1161
   9               	
1162
  10               	   * Redistributions in binary form must reproduce the above copyright
1163
  11               	     notice, this list of conditions and the following disclaimer in
1164
  12               	     the documentation and/or other materials provided with the
1165
  13               	     distribution.
1166
  14               	
1167
  15               	   * Neither the name of the copyright holders nor the names of
1168
  16               	     contributors may be used to endorse or promote products derived
1169
  17               	     from this software without specific prior written permission.
1170
  18               	
1171
  19               	  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1172
  20               	  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1173
  21               	  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1174
  22               	  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
1175
  23               	  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1176
  24               	  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1177
  25               	  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1178
  26               	  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1179
  27               	  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1180
  28               	  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1181
  29               	  POSSIBILITY OF SUCH DAMAGE. */
1182
  30               	
1183
  31               	/* $Id: version.h.in,v 1.1 2005/09/12 20:18:12 joerg_wunsch Exp $ */
1184
  32               	
1185
  33               	/** \defgroup avr_version <avr/version.h>: avr-libc version macros
1186
  34               	    \code #include <avr/version.h> \endcode
1187
  35               	
1188
  36               	    This header file defines macros that contain version numbers and
1189
  37               	    strings describing the current version of avr-libc.
1190
  38               	
1191
  39               	    The version number itself basically consists of three pieces that
1192
  40               	    are separated by a dot: the major number, the minor number, and
1193
  41               	    the revision number.  For development versions (which use an odd
1194
  42               	    minor number), the string representation additionally gets the
1195
  43               	    date code (YYYYMMDD) appended.
1196
  44               	
1197
  45               	    This file will also be included by \c <avr/io.h>.  That way,
1198
  46               	    portable tests can be implemented using \c <avr/io.h> that can be
1199
  47               	    used in code that wants to remain backwards-compatible to library
1200
  48               	    versions prior to the date when the library version API had been
484 kaklik 1201
GAS LISTING /tmp/ccowxWMg.s 			page 21
1202
 
1203
 
174 kaklik 1204
  49               	    added, as referenced but undefined C preprocessor macros
1205
  50               	    automatically evaluate to 0.
1206
  51               	*/
1207
  52               	
1208
  53               	#ifndef _AVR_VERSION_H_
1209
  54               	#define _AVR_VERSION_H_
1210
  55               	
1211
  56               	/** \ingroup avr_version
1212
  57               	    String literal representation of the current library version. */
484 kaklik 1213
  58               	#define __AVR_LIBC_VERSION_STRING__ "1.4.5"
174 kaklik 1214
  59               	
1215
  60               	/** \ingroup avr_version
1216
  61               	    Numerical representation of the current library version.
1217
  62               	
1218
  63               	    In the numerical representation, the major number is multiplied by
1219
  64               	    10000, the minor number by 100, and all three parts are then
1220
  65               	    added.  It is intented to provide a monotonically increasing
1221
  66               	    numerical value that can easily be used in numerical checks.
1222
  67               	 */
484 kaklik 1223
  68               	#define __AVR_LIBC_VERSION__        10405UL
174 kaklik 1224
  69               	
1225
  70               	/** \ingroup avr_version
1226
  71               	    String literal representation of the release date. */
484 kaklik 1227
  72               	#define __AVR_LIBC_DATE_STRING__    "20061009"
174 kaklik 1228
  73               	
1229
  74               	/** \ingroup avr_version
1230
  75               	    Numerical representation of the release date. */
484 kaklik 1231
  76               	#define __AVR_LIBC_DATE_            20061009UL
174 kaklik 1232
  77               	
1233
  78               	/** \ingroup avr_version
1234
  79               	    Library major version number. */
1235
  80               	#define __AVR_LIBC_MAJOR__          1
1236
  81               	
1237
  82               	/** \ingroup avr_version
1238
  83               	    Library minor version number. */
1239
  84               	#define __AVR_LIBC_MINOR__          4
1240
  85               	
1241
  86               	/** \ingroup avr_version
1242
  87               	    Library revision number. */
484 kaklik 1243
  88               	#define __AVR_LIBC_REVISION__       5
174 kaklik 1244
  89               	
1245
  90               	#endif /* _AVR_VERSION_H_ */
1246
  91               	...
484 kaklik 1247
 347               	
151 kaklik 1248
  54               	#include "Events.h"
1249
   1               	#ifndef EVENTS_H
1250
   2               	#define EVENTS_H
1251
   3               	
1252
   4               	/*
1253
   5               	    Copyright (C) 2004    John Orlando
1254
   6               	    
1255
   7               	   AVRcam: a small real-time image processing engine.
1256
   8               	
1257
   9               	    This program is free software; you can redistribute it and/or
1258
  10               	    modify it under the terms of the GNU General Public
1259
  11               	    License as published by the Free Software Foundation; either
1260
  12               	    version 2 of the License, or (at your option) any later version.
484 kaklik 1261
GAS LISTING /tmp/ccowxWMg.s 			page 22
1262
 
1263
 
151 kaklik 1264
  13               	
1265
  14               	    This program is distributed in the hope that it will be useful,
1266
  15               	    but WITHOUT ANY WARRANTY; without even the implied warranty of
1267
  16               	    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1268
  17               	    General Public License for more details.
1269
  18               	
1270
  19               	    You should have received a copy of the GNU General Public
1271
  20               	    License along with this program; if not, write to the Free Software
1272
  21               	    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1273
  22               	
1274
  23               	   For more information on the AVRcam, please contact:
1275
  24               	
1276
  25               	   john@jrobot.net
1277
  26               	
1278
  27               	   or go to www.jrobot.net for more details regarding the system.
1279
  28               	*/
1280
  29               	/*********************************************************** 
1281
  30               		Module Name: Events.h
1282
  31               		Module Date: 05/23/2004
1283
  32               		Module Auth: John Orlando
1284
  33               		
1285
  34               		Description: This file provides the external interface
1286
  35               		to the events that can be published/processed in the
1287
  36               		system.  It is specifically by itself (and nothing
1288
  37               		else should be defined in here) so that both .c and
1289
  38               		.S (assembly) files can include this file without
1290
  39               		a problem.
1291
  40               	    
1292
  41               	    Revision History:
1293
  42               	    Date        Rel Ver.    Notes
1294
  43               	    4/10/2004      0.1     Module created
1295
  44               	    6/30/2004      1.0     Initial release for Circuit Cellar
1296
  45               	                           contest.
1297
  46               	    *******************************************************/
1298
  47               	
1299
  48               	/* Definitions */
1300
  49               	/* Originally, all events were passed in a bitmask...however,
1301
  50               	an event FIFO was finally used, but the coding of the event
1302
  51               	definitions were never translated back....doesn't make a
1303
  52               	difference, but looks a little weird */
1304
  53               	#define EV_SERIAL_DATA_RECEIVED		0x01
1305
  54               	#define EV_DUMP_FRAME				0x02
1306
  55               	#define EV_PROCESS_FRAME_COMPLETE	0x04
1307
  55               			
1308
  56               			.extern fastEventBitmask    ; This is the flag used to indicate to the rest
1309
  57               										; of the system that the line is complete
1310
  58               									
1311
  59               	#define HREF_INTERRUPT_ENABLE_MASK   0x80
1312
  60               	#define HREF_INTERRUPT_DISABLE_MASK  0x7F
1313
  61               	#define ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK  0x04
1314
  62               	#define DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK 0xFB
1315
  63               	#define G_PORT						_SFR_IO_ADDR(PINC)  
1316
  64               	#define RB_PORT						_SFR_IO_ADDR(PINB)  
1317
  65               	#define PIXEL_RUN_START_INITIAL     0x50     	; This value causes our pixel counter (TCNT1)
1318
  66               													; to overflow after 176 (horizontal) pixels
1319
  67               	
1320
  68               	#define RED_MEM_OFFSET				0x00
484 kaklik 1321
GAS LISTING /tmp/ccowxWMg.s 			page 23
1322
 
1323
 
151 kaklik 1324
  69               	#define GREEN_MEM_OFFSET			0x10
1325
  70               	#define BLUE_MEM_OFFSET				0x20
1326
  71               	
1327
  72               	; A pixelBlock is defined as a contiguous group of 4 pixels that are combined 
1328
  73               	; together to form a specific color.  Typically, this is formed by sampling a
1329
  74               	; a green value, followed by a red and blue value (since we are dealing
1330
  75               	; with Bayer color data).  We could optionally sample a second green with
1331
  76               	; the red and average the greens, because the eye is more sensitive to
1332
  77               	; green, but for speed we don't do this.  These three values (RGB) are then
1333
  78               	; used as indices into the color membership lookup table (memLookup) to
1334
  79               	; determine which color the pixelBlock maps into.  The memLookup table is
1335
  80               	; manually generated for now (though it will hopefully be modified over
1336
  81               	; the serial interface eventually).
1337
  82               	;
1338
  83               	; Here is a pixel block:
1339
  84               	; ...G  G  G  G...  (row x)
1340
  85               	; ...B  R  B  R...  (row x+1)
1341
  86               	;    |  |  |  |--this is skipped 
1342
  87               	;    |  |  |--this is skipped
1343
  88               	;    |  |--this is sampled
1344
  89               	;    |--this is sampled
1345
  90               	
1346
  91               	; As pixel blocks are sampled, the red, green, and blue values are
1347
  92               	; used to index into their respective color maps.  The color maps
1348
  93               	; return values that can be logically ANDed together so that a 
1349
  94               	; particular RGB triplet will result in a single bit being set
1350
  95               	; after the AND operation.  This single bit indicates which color
1351
  96               	; the RGB triplet represents.  It is also possible for no bits to
1352
  97               	; be set after the AND process, indicating that the RGB triplet
1353
  98               	; does not map to any of the colors configured in the color map.
1354
  99               	; This isn't quite as fast as a pure RGB lookup table, but
1355
 100               	; it then again it doesn't require 2^12 (4-bits for each color
1356
 101               	; channel) bytes to store the lookup table.  It takes just a few
1357
 102               	; more cycles, and only requires 48 bytes of precious RAM (16
1358
 103               	; per color channel, since our resolution on each color channel
1359
 104               	; is only 4-bits).  Not bad....for more information, see:
1360
 105               	; http://www.cs.cmu.edu/~trb/papers/wirevision00.pdf for more
1361
 106               	; information on this color segmentation technique.
1362
 107               	
1363
 108               	; One other note: this code does depend on the colorMap residing
1364
 109               	; at a well-defined position in memory; specifically, it mus
1365
 110               	; start at a 256-byte boundary so that the lowest byte in the
1366
 111               	; map is set to 0x00.  Currently, the colorMap is forced to
1367
 112               	; start at RAM location 0x300.  This could potentially be changed
1368
 113               	; by the developer if needed, but offsets would have to be added
1369
 114               	; in to the colorMap look-up code below to make it work.
1370
 115               	
1371
 116               	
1372
 117               	; These are the registers that will be used throughout this
1373
 118               	; module for acquiring each line of pixel data
1374
 119               	pixelCount			= 16
1375
 120               	pixelRunStart		= 17
1376
 121               	lastColor     		= 18
1377
 122               	tmp1				= 19	; be sure to not use tmp1 and color simultaneously
1378
 123               	tmp2				= 20
1379
 124               	color           	= 19
1380
 125               	greenData       	= 20
484 kaklik 1381
GAS LISTING /tmp/ccowxWMg.s 			page 24
1382
 
1383
 
151 kaklik 1384
 126               	blueData        	= 21
1385
 127               	colorMapLow	  		= 22
1386
 128               	colorMapHigh		= 23
1387
 129               	prevLineBuffLow  	= 22  	; overlaps with memLookupLow (but orthogonal)
1388
 130               	prevLineBuffHigh	= 23	; overlaps with memLookupHigh (but orthogonal)
1389
 131               	currLineBuffLow     = 24
1390
 132               	currLineBuffHigh  	= 25
1391
 133               	
1392
 134               	        .section .text
1393
 135               	
1394
 136               	; These are the global assembly function names that are accessed via other
1395
 137               	; C functions
1396
 138               	        .global CamIntAsm_waitForNewTrackingFrame
1397
 139               			.global CamIntAsm_waitForNewDumpFrame
1398
 140               			.global CamIntAsm_acquireDumpLine
1399
 141               			.global CamIntAsm_acquireTrackingLine
1400
 142               			.global SIG_INTERRUPT0
1401
 143               			.global SIG_INTERRUPT1
1402
 144               			.global SIG_OVERFLOW0
1403
 145               			.global SIG_OVERFLOW1
1404
 146               			
1405
 147               	;*****************************************************************		
1406
 148               	;   	Function Name: CamIntAsm_waitForNewTrackingFrame
1407
 149               	;       Function Description: This function is responsible for
1408
 150               	;       going to sleep until a new frame begins (indicated by
1409
 151               	;    	VSYNC transitioning from low to high.  This will wake
1410
 152               	;       the "VSYNC sleep" up and allow it to continue with 
1411
 153               	;       the acquireLine function, where the system waits for
1412
 154               	;       an "HREF sleep" that we use to synchronize with the
1413
 155               	;       data.  
1414
 156               	;       Inputs:  r25 - MSB of currentLineBuffer
1415
 157               	;                r24 - LSB of currentLineBuffer
1416
 158               	;				 r23 - MSB of colorMap
1417
 159               	; 				 r22 - LSB of colorMap
1418
 160               	;       Outputs: none
1419
 161               	;       NOTES: This function doesn't really return...it sorta just
1420
 162               	;       floats into the acquireLine function after the "VSYNC sleep"
1421
 163               	;       is awoken, then begins processing the line data.  Once
1422
 164               	;		176 pixels are sampled (and the counter overflows), then
1423
 165               	;		an interrupt will occur, the 'T' bit in the SREG will be
1424
 166               	;		set, and the function will return.
1425
 167               	;*****************************************************************
1426
 168               			
1427
 169               	CamIntAsm_waitForNewTrackingFrame:
1428
 170:CamInterfaceAsm.S **** 		sbi		_SFR_IO_ADDR(PORTD),PD6  ; For testing...
1429
 171:CamInterfaceAsm.S **** 		cbi		_SFR_IO_ADDR(PORTD),PD6		
1430
 172:CamInterfaceAsm.S **** 		sleep
1431
 173               	
1432
 174               	;*****************************************************************
1433
 175               	; REMEMBER...everything from here on out is critically timed to be
1434
 176               	; synchronized with the flow of pixel data from the camera...
1435
 177               	;*****************************************************************
1436
 178               	
1437
 179               	CamIntAsm_acquireTrackingLine:
1438
 180:CamInterfaceAsm.S **** 		brts	_cleanUp
1439
 181               			;sbi		_SFR_IO_ADDR(PORTD),PD6 ; For testing...
1440
 182               			;cbi		_SFR_IO_ADDR(PORTD),PD6
484 kaklik 1441
GAS LISTING /tmp/ccowxWMg.s 			page 25
1442
 
1443
 
151 kaklik 1444
 183               	        
1445
 184:CamInterfaceAsm.S ****         in      tmp1,_SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually
1446
 185:CamInterfaceAsm.S ****         ori     tmp1, 0x07                 ; feed Timer1
1447
 186:CamInterfaceAsm.S ****         out     _SFR_IO_ADDR(TCCR1B),tmp1 
1448
 187               											; The line is about to start...		
1449
 188:CamInterfaceAsm.S **** 		ldi     pixelCount,0			; Initialize the RLE stats...
1450
 189:CamInterfaceAsm.S **** 		ldi		pixelRunStart,PIXEL_RUN_START_INITIAL  	; Remember, we always calculate
1451
 190               															; the pixel run length as
1452
 191               															; TCNT1L - pixelRunStart
1453
 192               			
1454
 193:CamInterfaceAsm.S **** 		ldi		lastColor,0x00				; clear out the last color before we start
1455
 194               			
1456
 195:CamInterfaceAsm.S **** 		mov   	XH,currLineBuffHigh    	; Load the pointer to the current line
1457
 196:CamInterfaceAsm.S **** 		mov		XL,currLineBuffLow		; buffer into the X pointer regs		 
1458
 197               			
1459
 198:CamInterfaceAsm.S **** 		mov   	ZH,colorMapHigh      	; Load the pointers to the membership
1460
 199:CamInterfaceAsm.S **** 		mov		ZL,colorMapLow			; lookup tables (ZL and YL will be overwritten
1461
 200:CamInterfaceAsm.S **** 		mov 	YH,colorMapHigh	 		; as soon as we start reading data) to Z and Y
1462
 201               			
1463
 202:CamInterfaceAsm.S **** 		in		tmp1, _SFR_IO_ADDR(TIMSK)			; enable TIMER1 to start counting
1464
 203:CamInterfaceAsm.S **** 		ori		tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK 	; external PCLK pulses and interrupt on 
1465
 204:CamInterfaceAsm.S **** 		out		_SFR_IO_ADDR(TIMSK),tmp1			; overflow
1466
 205               			
1467
 206:CamInterfaceAsm.S **** 		ldi 	tmp1,PIXEL_RUN_START_INITIAL	; set up the TCNT1 to overflow (and
1468
 207:CamInterfaceAsm.S **** 		ldi 	tmp2,0xFF 						; interrupts) after 176 pixels		
1469
 208:CamInterfaceAsm.S **** 		out 	_SFR_IO_ADDR(TCNT1H),tmp2		
1470
 209:CamInterfaceAsm.S **** 		out 	_SFR_IO_ADDR(TCNT1L),tmp1				
1471
 210               			
1472
 211:CamInterfaceAsm.S **** 		mov		YL,colorMapLow		
1473
 212               			
1474
 213:CamInterfaceAsm.S **** 		in 		tmp1, _SFR_IO_ADDR(GICR)	; enable the HREF interrupt...remember, we
1475
 214               												; only use this interrupt to synchronize
1476
 215               												; the beginning of the line
1477
 216:CamInterfaceAsm.S **** 		ori 	tmp1, HREF_INTERRUPT_ENABLE_MASK
1478
 217:CamInterfaceAsm.S **** 		out		_SFR_IO_ADDR(GICR), tmp1
1479
 218               			
1480
 219               	;*******************************************************************************************
1481
 220               	;   Track Frame handler 
1482
 221               	;*******************************************************************************************		
1483
 222               			
1484
 223               	_trackFrame:		
1485
 224:CamInterfaceAsm.S **** 		sbi		_SFR_IO_ADDR(PORTD),PD6
1486
 225:CamInterfaceAsm.S **** 		sleep   ; ...And we wait...
1487
 226               			
1488
 227               		; Returning from the interrupt/sleep wakeup will consume
1489
 228               		; 14 clock cycles (7 to wakeup from idle sleep, 3 to vector, and 4 to return)	
1490
 229               	
1491
 230               		; Disable the HREF interrupt
1492
 231:CamInterfaceAsm.S **** 		cbi		_SFR_IO_ADDR(PORTD),PD6
1493
 232:CamInterfaceAsm.S **** 		in 		tmp1, _SFR_IO_ADDR(GICR)
1494
 233:CamInterfaceAsm.S **** 		andi 	tmp1, HREF_INTERRUPT_DISABLE_MASK
1495
 234:CamInterfaceAsm.S **** 		out		_SFR_IO_ADDR(GICR), tmp1
1496
 235               			
1497
 236               		; A couple of NOPs are needed here to sync up the pixel data...the number (2)
1498
 237               		; of NOPs was determined emperically by trial and error.
1499
 238:CamInterfaceAsm.S **** 		nop
1500
 239:CamInterfaceAsm.S **** 		nop
484 kaklik 1501
GAS LISTING /tmp/ccowxWMg.s 			page 26
1502
 
1503
 
151 kaklik 1504
 240               	_acquirePixelBlock:							;							Clock Cycle Count
1505
 241:CamInterfaceAsm.S **** 		in		ZL,RB_PORT         			; sample the red value (PINB)		(1)
1506
 242:CamInterfaceAsm.S **** 		in		YL,G_PORT         			; sample the green value (PINC)		(1)
1507
 243:CamInterfaceAsm.S **** 		andi	YL,0x0F            			; clear the high nibble				(1)
1508
 244:CamInterfaceAsm.S **** 		ldd		color,Z+RED_MEM_OFFSET  	; lookup the red membership			(2)
1509
 245:CamInterfaceAsm.S **** 		in		ZL,RB_PORT         			; sample the blue value (PINB)		(1)
1510
 246:CamInterfaceAsm.S **** 		ldd		greenData,Y+GREEN_MEM_OFFSET; lookup the green membership		(2)
1511
 247:CamInterfaceAsm.S **** 		ldd		blueData,Z+BLUE_MEM_OFFSET	; lookup the blue membership		(2)
1512
 248:CamInterfaceAsm.S **** 		and		color,greenData 			; mask memberships together			(1)
1513
 249:CamInterfaceAsm.S **** 		and		color,blueData  			; to produce the final color		(1)
1514
 250:CamInterfaceAsm.S **** 		brts    _cleanUpTrackingLine		; if some interrupt routine has		(1...not set)
1515
 251               												; come in and set our T flag in 
1516
 252               												; SREG, then we need to hop out
1517
 253               												; and blow away this frames data (common cleanup)									
1518
 254:CamInterfaceAsm.S **** 		cp		color,lastColor     		; check to see if the run continues	(1)
1519
 255:CamInterfaceAsm.S **** 		breq    _acquirePixelBlock  		;									(2...equal)
1520
 256               												;									___________
1521
 257               												;								16 clock cycles 		
1522
 258               												; (16 clock cycles = 1 uS = 1 pixelBlock time)
1523
 259               			
1524
 260               			; Toggle the debug line to indicate a color change
1525
 261:CamInterfaceAsm.S **** 		sbi     _SFR_IO_ADDR(PORTD),PD6
1526
 262:CamInterfaceAsm.S **** 		nop
1527
 263:CamInterfaceAsm.S **** 		cbi		_SFR_IO_ADDR(PORTD),PD6
1528
 264               			
1529
 265:CamInterfaceAsm.S **** 		mov		tmp2,pixelRunStart				; get the count value of the
1530
 266               													; current pixel run
1531
 267:CamInterfaceAsm.S **** 		in		pixelCount,_SFR_IO_ADDR(TCNT1L)	; get the current TCNT1 value 
1532
 268:CamInterfaceAsm.S **** 		mov   	pixelRunStart,pixelCount		; reload pixelRunStart for the
1533
 269               													; next run
1534
 270:CamInterfaceAsm.S **** 		sub		pixelCount,tmp2     			; pixelCount = TCNT1L - pixelRunStart
1535
 271               											
1536
 272:CamInterfaceAsm.S **** 		st		X+,lastColor			; record the color run in the current line buffer
1537
 273:CamInterfaceAsm.S **** 		st		X+,pixelCount			; with its length
1538
 274:CamInterfaceAsm.S **** 		mov		lastColor,color			; set lastColor so we can figure out when it changes
1539
 275               			
1540
 276:CamInterfaceAsm.S **** 		nop								; waste one more cycle for a total of 16
1541
 277:CamInterfaceAsm.S **** 		rjmp	_acquirePixelBlock	
1542
 278               			
1543
 279               	; _cleanUpTrackingLine is used to write the last run length block off to the currentLineBuffer so
1544
 280               	; that all 176 pixels in the line are accounted for.
1545
 281               	_cleanUpTrackingLine:		
1546
 282:CamInterfaceAsm.S **** 		ldi		pixelCount,0xFF		; the length of the last run is ALWAYS 0xFF minus the last
1547
 283:CamInterfaceAsm.S **** 		sub		pixelCount,pixelRunStart  	; pixelRunStart
1548
 284               			
1549
 285:CamInterfaceAsm.S **** 		inc		pixelCount				; increment pixelCount since we actually need to account
1550
 286               											; for the overflow of TCNT1
1551
 287               											
1552
 288:CamInterfaceAsm.S **** 		st		X+,color				; record the color run in the current line buffer
1553
 289:CamInterfaceAsm.S **** 		st		X,pixelCount		
1554
 290:CamInterfaceAsm.S **** 		rjmp	_cleanUp
1555
 291               			
1556
 292               	_cleanUpDumpLine:		
1557
 293               			; NOTE: If serial data is received, to interrupt the tracking of a line, we'll
1558
 294               			; get a EV_SERIAL_DATA_RECEIVED event, and the T bit set so we will end the
1559
 295               			; line's processing...however, the PCLK will keep on ticking for the rest of
1560
 296               			; the frame/line, which will cause the TCNT to eventually overflow and
484 kaklik 1561
GAS LISTING /tmp/ccowxWMg.s 			page 27
1562
 
1563
 
151 kaklik 1564
 297               			; interrupt us, generating a EV_ACQUIRE_LINE_COMPLETE event.  We don't want
1565
 298               			; this, so we need to actually turn off the PCLK counting each time we exit
1566
 299               			; this loop, and only turn it on when we begin acquiring lines....
1567
 300               	        ; NOT NEEDED FOR NOW...
1568
 301               			;in		tmp1, _SFR_IO_ADDR(TIMSK)			; disable TIMER1 to stop counting
1569
 302               			;andi	tmp1, DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK 	; external PCLK pulses
1570
 303               			;out		_SFR_IO_ADDR(TIMSK),tmp1
1571
 304               	
1572
 305               	_cleanUp:
1573
 306               	        ; Disable the external clocking of the Timer1 counter 
1574
 307:CamInterfaceAsm.S ****         in      tmp1, _SFR_IO_ADDR(TCCR1B)
1575
 308:CamInterfaceAsm.S ****         andi    tmp1, 0xF8
1576
 309:CamInterfaceAsm.S ****         out     _SFR_IO_ADDR(TCCR1B),tmp1
1577
 310               			
1578
 311               			; Toggle the debug line to indicate the line is complete
1579
 312:CamInterfaceAsm.S **** 		sbi     _SFR_IO_ADDR(PORTD),PD6
1580
 313:CamInterfaceAsm.S **** 		cbi		_SFR_IO_ADDR(PORTD),PD6
1581
 314:CamInterfaceAsm.S **** 		clt				; clear out the T bit since we have detected
1582
 315               							; the interruption and are exiting to handle it
1583
 316               	_exit:
1584
 317:CamInterfaceAsm.S **** 		ret
1585
 318               			
1586
 319               	;*****************************************************************		
1587
 320               	;   	Function Name: CamIntAsm_waitForNewDumpFrame
1588
 321               	;       Function Description: This function is responsible for
1589
 322               	;       going to sleep until a new frame begins (indicated by
1590
 323               	;    	VSYNC transitioning from low to high.  This will wake
1591
 324               	;       the "VSYNC sleep" up and allow it to continue with 
1592
 325               	;       acquiring a line of pixel data to dump out to the UI.
1593
 326               	;       Inputs:  r25 - MSB of currentLineBuffer
1594
 327               	;                r24 - LSB of currentLineBuffer
1595
 328               	;				 r23 - MSB of prevLineBuffer
1596
 329               	;				 r22 - LSB of prevLineBuffer
1597
 330               	;       Outputs: none
1598
 331               	;       NOTES: This function doesn't really return...it sorta just
1599
 332               	;       floats into the acquireDumpLine function after the "VSYNC sleep"
1600
 333               	;       is awoken.
1601
 334               	;*****************************************************************		
1602
 335               	CamIntAsm_waitForNewDumpFrame:
1603
 336:CamInterfaceAsm.S **** 		sbi		_SFR_IO_ADDR(PORTD),PD6  ; For testing...
1604
 337:CamInterfaceAsm.S **** 		cbi		_SFR_IO_ADDR(PORTD),PD6
1605
 338:CamInterfaceAsm.S **** 		sleep
1606
 339               	
1607
 340               	;*****************************************************************
1608
 341               	; REMEMBER...everything from here on out is critically timed to be
1609
 342               	; synchronized with the flow of pixel data from the camera...
1610
 343               	;*****************************************************************
1611
 344               	
1612
 345               	CamIntAsm_acquireDumpLine:
1613
 346:CamInterfaceAsm.S **** 		brts	_cleanUp
1614
 347               			;sbi		_SFR_IO_ADDR(PORTD),PD6 ; For testing...
1615
 348               			;cbi		_SFR_IO_ADDR(PORTD),PD6
1616
 349               			
1617
 350:CamInterfaceAsm.S **** 		mov   	XH,currLineBuffHigh    	; Load the pointer to the current line
1618
 351:CamInterfaceAsm.S **** 		mov		XL,currLineBuffLow		; buffer into the X pointer regs
1619
 352               	
1620
 353:CamInterfaceAsm.S **** 		mov		YH,prevLineBuffHigh		; Load the pointer to the previous line
484 kaklik 1621
GAS LISTING /tmp/ccowxWMg.s 			page 28
1622
 
1623
 
151 kaklik 1624
 354:CamInterfaceAsm.S **** 		mov		YL,prevLineBuffLow  	; buffer into the Y pointer regs
1625
 355               			
1626
 356:CamInterfaceAsm.S **** 		ldi 	tmp1,PIXEL_RUN_START_INITIAL	; set up the TCNT1 to overflow (and
1627
 357:CamInterfaceAsm.S **** 		ldi 	tmp2,0xFF 						; interrupts) after 176 pixels		
1628
 358:CamInterfaceAsm.S **** 		out 	_SFR_IO_ADDR(TCNT1H),tmp2		
1629
 359:CamInterfaceAsm.S **** 		out 	_SFR_IO_ADDR(TCNT1L),tmp1		
1630
 360               			
1631
 361:CamInterfaceAsm.S ****         in      tmp1, _SFR_IO_ADDR(TCCR1B) ; Enable the PCLK line to actually
1632
 362:CamInterfaceAsm.S ****         ori     tmp1, 0x07                 ; feed Timer1
1633
 363:CamInterfaceAsm.S ****         out     _SFR_IO_ADDR(TCCR1B),tmp1
1634
 364:CamInterfaceAsm.S ****         nop
1635
 365               	        
1636
 366:CamInterfaceAsm.S **** 		in		tmp1, _SFR_IO_ADDR(TIMSK)			; enable TIMER1 to start counting
1637
 367:CamInterfaceAsm.S **** 		ori		tmp1, ENABLE_PCLK_TIMER1_OVERFLOW_BITMASK 	; external PCLK pulses and interrupt on 
1638
 368:CamInterfaceAsm.S **** 		out		_SFR_IO_ADDR(TIMSK),tmp1			; overflow			
1639
 369               			
1640
 370:CamInterfaceAsm.S **** 		in 		tmp1, _SFR_IO_ADDR(GICR)	; enable the HREF interrupt...remember, we
1641
 371               												; only use this interrupt to synchronize
1642
 372               												; the beginning of the line
1643
 373:CamInterfaceAsm.S **** 		ori 	tmp1, HREF_INTERRUPT_ENABLE_MASK
1644
 374:CamInterfaceAsm.S **** 		out		_SFR_IO_ADDR(GICR), tmp1
1645
 375               			
1646
 376               	;*******************************************************************************************
1647
 377               	;   Dump Frame handler 
1648
 378               	;*******************************************************************************************		
1649
 379               			
1650
 380               	_dumpFrame:		
1651
 381:CamInterfaceAsm.S **** 		sbi		_SFR_IO_ADDR(PORTD),PD6
1652
 382:CamInterfaceAsm.S **** 		sleep   ; ...And we wait...
1653
 383               	
1654
 384:CamInterfaceAsm.S **** 		cbi		_SFR_IO_ADDR(PORTD),PD6
1655
 385:CamInterfaceAsm.S **** 		in 		tmp1, _SFR_IO_ADDR(GICR)			; disable the HREF interrupt
1656
 386:CamInterfaceAsm.S **** 		andi 	tmp1, HREF_INTERRUPT_DISABLE_MASK  	; so we don't get interrupted
1657
 387:CamInterfaceAsm.S **** 		out		_SFR_IO_ADDR(GICR), tmp1			; while dumping the line
1658
 388               		
1659
 389:CamInterfaceAsm.S **** 		nop		; Remember...if we ever remove the "cbi" instruction above,
1660
 390               					; we need to add two more NOPs to cover this
1661
 391               	    
1662
 392               	; Ok...the following loop needs to run in 8 clock cycles, so we can get every
1663
 393               	; pixel in the line...this shouldn't be a problem, since the PCLK timing was
1664
 394               	; reduced by a factor of 2 whenever we go to dump a line (this is to give us
1665
 395               	; enough time to do the sampling and storing of the pixel data).  In addition,
1666
 396               	; it is assumed that we will have to do some minor processing on the data right
1667
 397               	; before we send it out, like mask off the top 4-bits of each, and then pack both
1668
 398               	; low nibbles into a single byte for transmission...we just don't have time to
1669
 399               	; do that here (only 8 instruction cycles :-)  )
1670
 400               	_sampleDumpPixel:
1671
 401:CamInterfaceAsm.S **** 		in		tmp1,G_PORT				; sample the G value					(1)
1672
 402:CamInterfaceAsm.S **** 		in		tmp2,RB_PORT			; sample the R/B value					(1)
1673
 403:CamInterfaceAsm.S **** 		st		X+,tmp1					; store to the currLineBuff and inc ptrs(2)
1674
 404:CamInterfaceAsm.S **** 		st		Y+,tmp2					; store to the prevLineBuff and inc ptrs(2)
1675
 405:CamInterfaceAsm.S **** 		brtc	_sampleDumpPixel		; loop back unless flag is set			(2...if not set)
1676
 406               											;									___________
1677
 407               											;									8 cycles normally
1678
 408               																				
1679
 409               			; if we make it here, it means the T flag is set, and we must have been interrupted
1680
 410               			; so we need to exit (what if we were interrupted for serial? should we disable it?)
484 kaklik 1681
GAS LISTING /tmp/ccowxWMg.s 			page 29
1682
 
1683
 
151 kaklik 1684
 411:CamInterfaceAsm.S **** 		rjmp	_cleanUpDumpLine
1685
 412               	
1686
 413               	;***********************************************************
1687
 414               	;	Function Name: <interrupt handler for External Interrupt0> 
1688
 415               	;	Function Description: This function is responsible
1689
 416               	;	for handling a rising edge on the Ext Interrupt 0.  This
1690
 417               	;	routine simply returns, since we just want to wake up
1691
 418               	;	whenever the VSYNC transitions (meaning the start of a new
1692
 419               	;	frame).
1693
 420               	;	Inputs:  none
1694
 421               	;	Outputs: none
1695
 422               	;***********************************************************
1696
 423               	SIG_INTERRUPT0:
1697
 424               	; This will wake us up when VSYNC transitions high...we just want to return
1698
 425:CamInterfaceAsm.S **** 		reti
1699
 426               			
1700
 427               	;***********************************************************
1701
 428               	;	Function Name: <interrupt handler for External Interrupt1> 
1702
 429               	;	Function Description: This function is responsible
1703
 430               	;	for handling a falling edge on the Ext Interrupt 1.  This
1704
 431               	;	routine simply returns, since we just want to wake up
1705
 432               	;	whenever the HREF transitions (meaning the pixels 
1706
 433               	;	are starting after VSYNC transitioned, and we need to
1707
 434               	; 	start acquiring the pixel blocks
1708
 435               	;	Inputs:  none
1709
 436               	;	Outputs: none
1710
 437               	;***********************************************************	
1711
 438               	SIG_INTERRUPT1:
1712
 439               	; This will wake us up when HREF transitions high...we just want to return
1713
 440:CamInterfaceAsm.S **** 		reti
1714
 441               			
1715
 442               	;***********************************************************
1716
 443               	;	Function Name: <interrupt handler for Timer0 overflow>
1717
 444               	;	Function Description: This function is responsible
1718
 445               	;	for handling the Timer0 overflow (hooked up to indicate
1719
 446               	;	when we have reached the number of HREFs required in a
1720
 447               	;	single frame).  We set the T flag in the SREG to
1721
 448               	;	indicate to the _acquirePixelBlock routine that it needs
1722
 449               	;	to exit, and then set the appropriate action to take in
1723
 450               	;	the eventList of the Executive module.
1724
 451               	;	Inputs:  none
1725
 452               	;	Outputs: none
1726
 453               	;   Note: Originally, the HREF pulses were also going to
1727
 454               	;   be counted by a hardware counter, but it didn't end up
1728
 455               	;   being necessary
1729
 456               	;***********************************************************
1730
 457               	;SIG_OVERFLOW0:
1731
 458               	;		set				; set the T bit in SREG
1732
 459               	;		lds		tmp1,eventBitmask
1733
 460               	;		ori		tmp1,EV_ACQUIRE_FRAME_COMPLETE
1734
 461               	;		sts		eventBitmask,tmp1
1735
 462               	;		reti
1736
 463               			
1737
 464               	;***********************************************************
1738
 465               	;	Function Name: <interrupt handler for Timer1 overflow>
1739
 466               	;	Function Description: This function is responsible
1740
 467               	;	for handling the Timer1 overflow (hooked up to indicate
484 kaklik 1741
GAS LISTING /tmp/ccowxWMg.s 			page 30
1742
 
1743
 
151 kaklik 1744
 468               	;	when we have reached the end of a line of pixel data,
1745
 469               	;	since PCLK is hooked up to overflow TCNT1 after 176 
1746
 470               	;	pixels).  This routine generates an acquire line complete
1747
 471               	;	event in the fastEventBitmask, which is streamlined for
1748
 472               	;	efficiency reasons.
1749
 473               	;***********************************************************
1750
 474               	SIG_OVERFLOW1:				
1751
 475:CamInterfaceAsm.S **** 		lds		tmp1,fastEventBitmask   		; set a flag indicating
1752
 476:CamInterfaceAsm.S **** 		ori		tmp1,FEV_ACQUIRE_LINE_COMPLETE	; a line is complete
1753
 477:CamInterfaceAsm.S **** 		sts		fastEventBitmask,tmp1
1754
 478:CamInterfaceAsm.S **** 		set		; set the T bit in SREG 
1755
 479               			;sbi		_SFR_IO_ADDR(PORTD),PD6 ; For testing...
1756
 480               			;cbi		_SFR_IO_ADDR(PORTD),PD6 ; For testing...
1757
 481               	
1758
 482:CamInterfaceAsm.S **** 		reti
1759
 483               	
1760
 484               	; This is the default handler for all interrupts that don't
1761
 485               	; have handler routines specified for them.
1762
 486               	        .global __vector_default              
1763
 487               	__vector_default:
1764
 488:CamInterfaceAsm.S ****         reti
1765
 489               	
1766
 490               	        .end
484 kaklik 1767
GAS LISTING /tmp/ccowxWMg.s 			page 31
174 kaklik 1768
 
1769
 
1770
DEFINED SYMBOLS
1771
                            *ABS*:00000000 CamInterfaceAsm.S
1772
   CamInterfaceAsm.S:119    *ABS*:00000010 pixelCount
1773
   CamInterfaceAsm.S:120    *ABS*:00000011 pixelRunStart
1774
   CamInterfaceAsm.S:121    *ABS*:00000012 lastColor
1775
   CamInterfaceAsm.S:122    *ABS*:00000013 tmp1
1776
   CamInterfaceAsm.S:123    *ABS*:00000014 tmp2
1777
   CamInterfaceAsm.S:124    *ABS*:00000013 color
1778
   CamInterfaceAsm.S:125    *ABS*:00000014 greenData
1779
   CamInterfaceAsm.S:126    *ABS*:00000015 blueData
1780
   CamInterfaceAsm.S:127    *ABS*:00000016 colorMapLow
1781
   CamInterfaceAsm.S:128    *ABS*:00000017 colorMapHigh
1782
   CamInterfaceAsm.S:129    *ABS*:00000016 prevLineBuffLow
1783
   CamInterfaceAsm.S:130    *ABS*:00000017 prevLineBuffHigh
1784
   CamInterfaceAsm.S:131    *ABS*:00000018 currLineBuffLow
1785
   CamInterfaceAsm.S:132    *ABS*:00000019 currLineBuffHigh
1786
   CamInterfaceAsm.S:169    .text:00000000 CamIntAsm_waitForNewTrackingFrame
1787
   CamInterfaceAsm.S:335    .text:0000008e CamIntAsm_waitForNewDumpFrame
1788
   CamInterfaceAsm.S:345    .text:00000094 CamIntAsm_acquireDumpLine
1789
   CamInterfaceAsm.S:179    .text:00000006 CamIntAsm_acquireTrackingLine
1790
   CamInterfaceAsm.S:423    .text:000000d4 __vector_1
1791
   CamInterfaceAsm.S:438    .text:000000d6 __vector_2
1792
   CamInterfaceAsm.S:474    .text:000000d8 __vector_8
1793
   CamInterfaceAsm.S:305    .text:00000080 _cleanUp
1794
   CamInterfaceAsm.S:223    .text:00000034 _trackFrame
1795
   CamInterfaceAsm.S:240    .text:00000044 _acquirePixelBlock
1796
   CamInterfaceAsm.S:281    .text:00000074 _cleanUpTrackingLine
1797
   CamInterfaceAsm.S:292    .text:00000080 _cleanUpDumpLine
1798
   CamInterfaceAsm.S:316    .text:0000008c _exit
1799
   CamInterfaceAsm.S:380    .text:000000ba _dumpFrame
1800
   CamInterfaceAsm.S:400    .text:000000c8 _sampleDumpPixel
1801
   CamInterfaceAsm.S:487    .text:000000e6 __vector_default
1802
 
1803
UNDEFINED SYMBOLS
1804
__vector_9
1805
fastEventBitmask