Home
CrossWorks for AVR Reference Manual
CrossWorks for AVR
Introduction
Release notes
Previous
Up
Next
CrossWorks for AVR Reference Manual
CrossWorks for AVR
Introduction
What is CrossWorks?
What we don't tell you
Activating your product
Text conventions
Additional resources
Release notes
CrossStudio Tutorial
Activating CrossWorks
Managing support packages
Creating a project
Managing files in a project
Setting project options
Building projects
Exploring projects
Using the debugger
Low-level debugging
Debugging externally built applications
CrossStudio User Guide
CrossStudio standard layout
Menu bar
Title bar
Status bar
Editing workspace
Docking windows
Dashboard
CrossStudio help and assistance
Creating and managing projects
Solutions and projects
Creating a project
Adding existing files to a project
Adding new files to a project
Removing a file, folder, project, or project link
Project macros
Building your application
Creating variants using configurations
Project properties
Unique properties
Aggregate properties
Configurations and property values
Dependencies and build order
Linking and section placement
Using source control
Source control capabilities
Choosing your source-control provider
Connecting to the source-control system
Opening a project from source control
Files source-control status
Source-control operations
Adding files to source control
Checking files out
Checking files in
Undoing a check out
Getting the latest version
Showing differences between files
Merging files
Source-control explorer
Source-control properties
Visual SourceSafe provider
SourceOffSite provider
Subversion provider
CVS provider
Package management
Exploring your application
Project explorer
Source navigator window
Symbol browser
Memory usage window
Editing your code
Basic editing
Moving the insertion point
Selecting text
Adding text
Deleting text
Using the clipboard
Undo and redo
Drag and drop
Searching
Advanced editing
Indenting source code
Commenting out sections of code
Changing letter case
Indenting
Bookmarks
Find and Replace window
Clipboard-ring window
Regular expressions
Debugging windows
Locals window
Globals window
Watch window
Register window
Memory window
Breakpoints window
Call Stack window
Threads window
Execution Profile window
Trace window
Debug file search editor
Breakpoint expressions
Debug expressions
Utility windows
Output window
Properties window
Targets window
Terminal emulator window
Script Console window
Debug Immediate window
Downloads window
Latest News window
Memory-map editor
Environment options dialog
Building Environment Options
Debugging Environment Options
IDE Environment Options
Programming Language Environment Options
Source Control Environment Options
Text Editor Environment Options
Windows Environment Options
Target interfaces
AVR Core Simulator Target Interface
JTAG ICE Target Interface
JTAGICE mkII (Serial Port to JTAG) Target Interface
JTAGICE mkII (Serial Port to debugWIRE) Target Interface
JTAGICE mkII (Serial Port to ISP) Target Interface
JTAGICE mkII (Serial Port to PDI) Target Interface
JTAGICE mkII (USB to JTAG) Target Interface
JTAGICE mkII (USB to debugWIRE) Target Interface
JTAGICE mkII (USB to ISP) Target Interface
JTAGICE mkII (USB to PDI) Target Interface
AVRDragon (JTAG) Target Interface
AVRDragon (debugWIRE) Target Interface
AVRDragon (ISP) Target Interface
STK500-High Voltage Target Interface
STK500-ISP Target Interface
AVRISP Target Interface
AVRISP mkII Target Interface
Parallel Port JTAG Target Interface
CrossConnect JTAG Target Interface
Arduino Target Interface
Using an external AVR GCC toolchain
C Compiler User Guide
Command line options
-ansi (Warn about potential ANSI problems)
-D (Define macro symbol)
-g (Generate debugging information)
-I (Define user include directories)
-J (Define system include directories)
-mxmega (Enable XMEGA processor)
-m (Set AVR code memory size)
-msd (Treat double as float)
-o (Set output file name)
-O (Optimize code generation)
-Or (Optimize register allocation)
-Rc (Set default code section name)
-Rd (Set default initialized data section name)
-Ri (Set default ISR section name)
-Rk (Set default read-only section name)
-Rv (Set default vector section name)
-Rz (Set default zeroed section name)
-V (Version information)
-w (Suppress warnings)
-we (Treat warnings as errors)
Preprocessor predefined symbols
Pragmas
#pragma codeseg
#pragma dataseg
#pragma constseg
#pragma zeroedseg
#pragma vectorseg
#pragma isrseg
#pragma vector
Section control
Section overrides
Absolute data object placement
Type-based enumerations
Code-space strings
Special functions
Interrupt functions
Monitor functions
Top-level functions
External naming convention
Data representation
Register use
Assembler User Guide
Command-line syntax
-D (Define macro symbol)
-g (Generate debugging information)
-I (Define user include directories)
-J (Define system include directories)
-o (Set output file name)
-Rc (Set default code section name)
-Rd (Set default initialized data section name)
-Ri (Set default ISR section name)
-Rk (Set default read-only section name)
-Rv (Set default vector section name)
-Rz (Set default zeroed section name)
-V (Version information)
-w (Suppress warnings)
-we (Treat warnings as errors)
Source format
Types
Built-in types
Array types
Pointer types
Structure types
Compilation units and libraries
Directive reference
ALIGN
BREAK
BSS
CODE
CONST
DATA
DB
DC.B
DC.W
DC.L
DL
DS.B
DSECT
DS.L
DS.W
DV
DW
ELSE
END
ENDIF
EQU
EVEN
EXPORT
FILL
IF
IMPORT
INCLUDE
INCLUDEBIN
INIT
ISR
KEEP
PSECT
RMB
RML
RMW
RODATA
ROOT
RSEG
SET
TEXT
USECT
VECTORS
ZDATA
Expressions
Labels
Operators
!
$
+
-
*
/
%
^
&
&&
==
!=
<
<=
<<
>
>=
>>
|
||
ASHR
DEFINED
ENDOF
EQ
GE
GT
HBYTE
HIGH
HWORD
LAND
LBYTE
LE
LNOT
LOR
LT
LHALF
LOW
LWORD
NE
OR
SHL
SHR
SIZEOF
STARTOF
THIS
UHALF
XOR
Macros
C Library User Guide
Floating point
Single and double precision
Multithreading
Thread safety in the CrossWorks library
Implementing mutual exclusion in the C library
Input and output
Customizing putchar
Complete API reference
<assert.h>
__assert
assert
<cross_studio_io.h>
debug_abort
debug_break
debug_clearerr
debug_enabled
debug_exit
debug_fclose
debug_feof
debug_ferror
debug_fflush
debug_fgetc
debug_fgetpos
debug_fgets
debug_filesize
debug_fopen
debug_fprintf
debug_fprintf_c
debug_fputc
debug_fputs
debug_fread
debug_freopen
debug_fscanf
debug_fscanf_c
debug_fseek
debug_fsetpos
debug_ftell
debug_fwrite
debug_getargs
debug_getch
debug_getchar
debug_getd
debug_getenv
debug_getf
debug_geti
debug_getl
debug_getll
debug_gets
debug_getu
debug_getul
debug_getull
debug_kbhit
debug_loadsymbols
debug_perror
debug_printf
debug_printf_c
debug_putchar
debug_puts
debug_remove
debug_rename
debug_rewind
debug_runtime_error
debug_scanf
debug_scanf_c
debug_system
debug_time
debug_tmpfile
debug_tmpnam
debug_ungetc
debug_unloadsymbols
debug_vfprintf
debug_vfscanf
debug_vprintf
debug_vscanf
<cruntime.h>
__float32_add
__float32_add_1
__float32_add_asgn
__float32_div
__float32_div_asgn
__float32_eq
__float32_eq_0
__float32_lt
__float32_lt_0
__float32_mul
__float32_mul_asgn
__float32_neg
__float32_sqr
__float32_sub
__float32_sub_asgn
__float32_to_float64
__float32_to_int16
__float32_to_int32
__float32_to_int64
__float32_to_uint16
__float32_to_uint32
__float32_to_uint64
__float64_add
__float64_add_1
__float64_add_asgn
__float64_div
__float64_div_asgn
__float64_eq
__float64_eq_0
__float64_lt
__float64_lt_0
__float64_mul
__float64_mul_asgn
__float64_neg
__float64_sqr
__float64_sub
__float64_sub_asgn
__float64_to_float32
__int16_asr
__int16_asr_asgn
__int16_div
__int16_div_asgn
__int16_lsl
__int16_lsl_asgn
__int16_lsr
__int16_lsr_asgn
__int16_mod
__int16_mod_asgn
__int16_mul
__int16_mul_8x8
__int16_mul_asgn
__int16_to_float32
__int16_to_float64
__int32_asr
__int32_asr_asgn
__int32_div
__int32_div_asgn
__int32_lsl
__int32_lsl_asgn
__int32_lsr
__int32_lsr_asgn
__int32_mod
__int32_mod_asgn
__int32_mul
__int32_mul_16x16
__int32_mul_asgn
__int32_to_float32
__int32_to_float64
__int64_asr
__int64_asr_asgn
__int64_div
__int64_div_asgn
__int64_lsl
__int64_lsl_asgn
__int64_lsr
__int64_lsr_asgn
__int64_mod
__int64_mod_asgn
__int64_mul
__int64_mul_32x32
__int64_mul_asgn
__int64_to_float32
__int64_to_float64
__uint16_div
__uint16_div_asgn
__uint16_mod
__uint16_mod_asgn
__uint16_mul_8x8
__uint16_to_float32
__uint16_to_float64
__uint32_div
__uint32_div_asgn
__uint32_mod
__uint32_mod_asgn
__uint32_mul_16x16
__uint32_to_float32
__uint32_to_float64
__uint64_div
__uint64_div_asgn
__uint64_mod
__uint64_mod_asgn
__uint64_mul_32x32
__uint64_to_float32
__uint64_to_float64
<ctype.h>
isalnum
isalpha
isblank
iscntrl
isdigit
isgraph
islower
isprint
ispunct
isspace
isupper
isxdigit
tolower
toupper
<errno.h>
EDOM
EILSEQ
ERANGE
__errno
errno
<float.h>
DBL_DIG
DBL_EPSILON
DBL_MANT_DIG
DBL_MAX
DBL_MAX_10_EXP
DBL_MAX_EXP
DBL_MIN
DBL_MIN_10_EXP
DBL_MIN_EXP
DECIMAL_DIG
FLT_DIG
FLT_EPSILON
FLT_EVAL_METHOD
FLT_MANT_DIG
FLT_MAX
FLT_MAX_10_EXP
FLT_MAX_EXP
FLT_MIN
FLT_MIN_10_EXP
FLT_MIN_EXP
FLT_RADIX
FLT_ROUNDS
<ina90.h>
_BREAK
_CLI
_NOP
_OPC
_SEI
_SLEEP
_WDR
disable_interrupt
enable_interrupt
<inavr.h>
__bic_SR_register
__bis_SR_register
__breakpoint
__delay_cycles
__disable_interrupt
__enable_interrupt
__insert_opcode
__no_operation
__restore_interrupt
__save_interrupt
__sleep
__swap_bytes
__swap_bytes_long
__swap_nibbles
__swap_words
__watchdog_reset
<iso646.h>
and
and_eq
bitand
bitor
compl
not
not_eq
or
or_eq
xor
xor_eq
<limits.h>
CHAR_BIT
CHAR_MAX
CHAR_MIN
INT_MAX
INT_MIN
LLONG_MAX
LLONG_MIN
LONG_MAX
LONG_MIN
SCHAR_MAX
SCHAR_MIN
SHRT_MAX
SHRT_MIN
UCHAR_MAX
UINT_MAX
ULLONG_MAX
ULONG_MAX
USHRT_MAX
<locale.h>
lconv
localeconv
setlocale
<math.h>
acos
acosf
acosh
acoshf
asin
asinf
asinh
asinhf
atan
atan2
atan2f
atanf
atanh
atanhf
cbrt
cbrtf
ceil
ceilf
cos
cosf
cosh
coshf
exp
expf
fabs
fabsf
floor
floorf
fmax
fmaxf
fmin
fminf
fmod
fmodf
fpclassify
frexp
frexpf
hypot
hypotf
isfinite
isinf
isnan
isnormal
ldexp
ldexpf
log
log10
log10f
logf
modf
modff
pow
powf
scalbn
scalbnf
signbit
sin
sinf
sinh
sinhf
sqrt
sqrtf
tan
tanf
tanh
tanhf
<pgmspace.h>
memcmp_P
memcpy_P
printf_P
puts_P
scanf_P
snprintf_P
sprintf_P
sscanf_P
strcat_P
strcmp_P
strcpy_P
strlen_P
strncmp_P
strncpy_P
vprintf_P
vscanf_P
vsnprintf_P
vsprintf_P
vsscanf_P
<setjmp.h>
longjmp
setjmp
<stdarg.h>
va_arg
va_copy
va_end
va_start
<stddef.h>
NULL
offsetof
ptrdiff_t
size_t
wchar_t
<stdio.h>
getchar
gets
printf
putchar
puts
scanf
snprintf
sprintf
sscanf
vprintf
vscanf
vsnprintf
vsprintf
vsscanf
<stdio_c.h>
printf_c
puts_c
scanf_c
snprintf_c
sprintf_c
sscanf_c
vprintf_c
vscanf_c
vsnprintf_c
vsprintf_c
vsscanf_c
<stdlib.h>
EXIT_FAILURE
EXIT_SUCCESS
RAND_MAX
abs
atexit
atof
atoi
atol
atoll
bsearch
calloc
div
div_t
exit
free
itoa
labs
ldiv
ldiv_t
llabs
lldiv
lldiv_t
lltoa
ltoa
malloc
qsort
rand
realloc
srand
strtod
strtof
strtol
strtoll
strtoul
strtoull
ulltoa
ultoa
utoa
<string.h>
memccpy
memchr
memcmp
memcpy
memmove
mempcpy
memset
strcasecmp
strcasestr
strcat
strchr
strcmp
strcpy
strcspn
strdup
strerror
strlcat
strlcpy
strlen
strncasecmp
strncasestr
strncat
strnchr
strncmp
strncpy
strndup
strnlen
strnstr
strpbrk
strrchr
strsep
strspn
strstr
strtok
strtok_r
<string_c.h>
memcmp_c
memcpy_c
strcat_c
strcmp_c
strcpy_c
strlen_c
strncmp_c
strncpy_c
<time.h>
asctime
asctime_r
clock_t
ctime
ctime_r
difftime
gmtime
gmtime_r
localtime
localtime_r
mktime
strftime
time_t
tm
<wchar.h>
WCHAR_MAX
WCHAR_MIN
WEOF
wchar_t
wcscat
wcschr
wcscmp
wcscpy
wcscspn
wcsdup
wcslen
wcsncat
wcsnchr
wcsncmp
wcsncpy
wcsnlen
wcsnstr
wcspbrk
wcsrchr
wcsspn
wcsstr
wcstok
wcstok_r
wint_t
wmemccpy
wmemchr
wmemcmp
wmemcpy
wmemmove
wmempcpy
wmemset
wstrsep
Tasking Library User Guide
Overview
Tasks
Event sets
Semaphores
Mutexes
Message queues
Byte queues
Timers and interrupts
Global interrupts control
Timer support
Interrupt service routines
Memory areas
Task scheduling example
AVR implementation details
CTL Revisions
Complete API reference
<ctl.h>
CTL_BYTE_QUEUE_t
CTL_ERROR_CODE_t
CTL_EVENT_SET_t
CTL_EVENT_WAIT_TYPE_t
CTL_MEMORY_AREA_t
CTL_MESSAGE_QUEUE_t
CTL_MUTEX_t
CTL_SEMAPHORE_t
CTL_STATE_t
CTL_TASK_t
CTL_TIMEOUT_t
CTL_TIME_t
ctl_byte_queue_init
ctl_byte_queue_num_free
ctl_byte_queue_num_used
ctl_byte_queue_post
ctl_byte_queue_post_multi
ctl_byte_queue_post_multi_nb
ctl_byte_queue_post_nb
ctl_byte_queue_receive
ctl_byte_queue_receive_multi
ctl_byte_queue_receive_multi_nb
ctl_byte_queue_receive_nb
ctl_byte_queue_setup_events
ctl_current_time
ctl_events_init
ctl_events_pulse
ctl_events_set_clear
ctl_events_wait
ctl_get_current_time
ctl_global_interrupts_disable
ctl_global_interrupts_enable
ctl_global_interrupts_set
ctl_handle_error
ctl_increment_tick_from_isr
ctl_interrupt_count
ctl_last_schedule_time
ctl_memory_area_allocate
ctl_memory_area_free
ctl_memory_area_init
ctl_memory_area_setup_events
ctl_message_queue_init
ctl_message_queue_num_free
ctl_message_queue_num_used
ctl_message_queue_post
ctl_message_queue_post_multi
ctl_message_queue_post_multi_nb
ctl_message_queue_post_nb
ctl_message_queue_receive
ctl_message_queue_receive_multi
ctl_message_queue_receive_multi_nb
ctl_message_queue_receive_nb
ctl_message_queue_setup_events
ctl_mutex_init
ctl_mutex_lock
ctl_mutex_unlock
ctl_reschedule_on_last_isr_exit
ctl_semaphore_init
ctl_semaphore_signal
ctl_semaphore_wait
ctl_task_die
ctl_task_executing
ctl_task_init
ctl_task_list
ctl_task_remove
ctl_task_reschedule
ctl_task_restore
ctl_task_run
ctl_task_set_priority
ctl_task_switch_callout
ctl_time_increment
ctl_timeout_wait
ctl_timeslice_period
Utilities Reference
Compiler driver
File naming conventions
Command-line options
-ansi (Warn about potential ANSI problems)
-ar (Archive output)
-c (Compile to object code, do not link)
-d (Define linker symbol)
-D (Define macro symbol)
-E (Preprocess)
-F (Set output format)
-g (Generate debugging information)
-help (Display help information)
-io (Select I/O library implementation)
-I (Define user include directories)
-I- (Exclude standard include directories)
-J (Define system include directories)
-K (Keep linker symbol)
-L (Set library directory path)
-l- (Do not link standard libraries)
-mboot (Generate boot loader code)
-msize (Set code size)
-mmpy (Generate multiplier instructions)
-mxmega (Generate xmega code)
-make (Make-style build)
-M (Display linkage map)
-n (Dry run, no execution)
-nostderr (No stderr output)
-o (Set output file name)
-O (Optimize output)
-printf (Select printf capability)
-R (Set section name)
-scanf (Select scanf capability)
-sd (Treat double as float)
-v (Verbose execution)
-w (Suppress warnings)
-we (Treat warnings as errors)
-Wa (Pass option to tool)
-x (Specify file types)
-y (Use project template)
-z (Set project property)
Compiler driver
File naming conventions
Command-line options
-ansi (Warn about potential ANSI problems)
-ar (Archive output)
-c (Compile to object code, do not link)
-g (Generate debugging information)
-D (Define macro symbol)
-F (Set output format)
-h (Display help information)
-I (Define user include directories)
-J (Define system include directories)
-K (Keep linker symbol)
-l (Link library)
-L (Set library directory path)
-I- (Exclude standard include directories)
-l- (Do not link standard libraries)
-m (Machine-level options)
-M (Display linkage map)
-n (Dry run, no execution)
-o (Set output file name)
-O (Optimize output)
-R (Set section name)
-s- (Exclude standard startup code)
-v (Verbose execution)
-V (Display version)
-w (Suppress warnings)
-we (Treat warnings as errors)
-Wa (Pass option to assembler)
-Wc (Pass option to compiler)
-Wl (Pass option to linker)
Linker
Command line syntax
Command line options
-D (Define linker symbol)
-F (Set output format)
-g (Propagate debugging information)
-K (Keep linker symbol)
-l- (Do not link standard libraries)
-l (Link library)
-L (Set library directory path)
-M (Display linkage map)
-m8k (Generate for 8K part)
-m128k (Generate for 128K part)
-m8m (Generate for 8M part)
-o (Set output file name)
-Obl (Enable block locality optimization)
-Ocm (Enable code motion optimization)
-Oxc (Enable code factoring optimization)
-Oxcp (Set code factoring passes)
-Oxcx (Enable extreme code factoring optimization)
-Oph (Enable peephole optimization)
-Oxj (Cross jumping optimization)
-Osf (Enable subroutine flattening optimizations)
-Ojc (Enable jump chaining optimization)
-Ojt (Enable jump threading optimization)
-Ojt (Enable jump threading optimization)
-T (Locate sections)
-we (Treat warnings as errors)
-w (Suppress warnings)
-v (Verbose execution)
-V (Display version)
Hex extractor
Command line options
-W (Set bus width)
-T (Extract named section)
-F (Set output format)
-o (Set output prefix)
-V (Display version)
Librarian
-c (Create archive)
-r (Add or replace archive member)
-d (Delete archive members)
-t (List archive members)
CrossBuild
Building with a CrossStudio project file
Building without a CrossStudio project file
Command-line options
-batch (Batch build)
-config (Select build configuration)
-clean (Remove output files)
-define (Define macro)
-echo (Show command lines)
-file (Build a named file)
-packagesdir (Specify packages directory)
-project (Specify project to build)
-property (Set project property)
-rebuild (Always rebuild)
-show (Dry run, don't execute)
-solution (Specify solution to build)
-studiodir (Specify CrossStudio directory)
-template (Specify project template)
-type (Specify project type)
-verbose (Show build information)
CrossLoad
Command line debugging
Managing breakpoints
Displaying state
Locating the current context
Controlling execution
Command-line options
-break (Stop execution at symbol)
-config (Specify build configuration)
-debug (Enter command line debugging)
-eraseall (Erase all flash memory)
-filetype (Specify load file type)
-help (Display help)
-listfiletypes (Display supported load file types)
-listprops (Display target properties)
-listtargets (Display supported target interfaces)
-loadaddress (Set load address)
-loader (Specify loader configuration)
-nodifferential (Inhibit differential download)
-nodisconnect (Inhibit target disconnection)
-nodownload (Inhibit download)
-noverify (Inhibit verification)
-packagesdir (Specify package directory)
-project (Specify project name)
-quiet (Be silent)
-script (Execute debug script)
-serve (Run semihosting server)
-setprop (Set target interface property)
-solution (Specify solution file)
-studiodir (Specify Studio directory)
-target (Specify target interface)
-verbose (Display additional status)
CrossScript
Command-line options
-define (Define global variable)
-help (Show usage)
-load (Load script file)
-define (Verbose output)
CrossScript classes
Example uses
Embed
Header file generator
Using the header generator
Command line options
-regbaseoffsets (Use offsets from peripheral base)
-nobitfields (Inhibit bitfield macros)
Package generator
Appendices
Legal
Copyright, disclaimer, and trademarks
Rowley Associates license statement
Technical
File formats
Memory Map file format
Section Placement file format
Project file format
Project Templates file format
Property Groups file format
Package Description file format
External Tools file format
Property categories
General Build Properties
Combining Project Properties
Compilation Properties
Debugging Properties
Externally Built Executable Project Properties
File and Folder Properties
Library Project Properties
Executable Project Properties
Staging Project Properties
Macros
System Macros
Build Macros
Script classes
BinaryFile
CWSys
Debug
WScript