- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# compiler.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
union | Union32
union | Union16
## Defines
#define | LITTLE_ENDIAN
#define | bool Bool
#define | PASS 0
#define | FAIL 1
#define | _MEM_TYPE_BIT_
#define | _MEM_TYPE_FAST_
#define | _MEM_TYPE_MEDFAST_
#define | _MEM_TYPE_MEDSLOW_
#define | _MEM_TYPE_SLOW_
#define | INTEL_ALIGNMENT LITTLE_ENDIAN
#define | MOTOROLA_ALIGNMENT BIG_ENDIAN
#define | MSB(u16) (((U8* )&u16)[1])
#define | LSB(u16) (((U8* )&u16)[0])
#define | MSW(u32) (((U16*)&u32)[1])
#define | LSW(u32) (((U16*)&u32)[0])
#define | MSB0(u32) (((U8* )&u32)[3])
#define | MSB1(u32) (((U8* )&u32)[2])
#define | MSB2(u32) (((U8* )&u32)[1])
#define | MSB3(u32) (((U8* )&u32)[0])
#define | LSB0(u32) MSB3(u32)
#define | LSB1(u32) MSB2(u32)
#define | LSB2(u32) MSB1(u32)
#define | LSB3(u32) MSB0(u32)
#define | Le16(b)
#define | Le32(b)
#define | htons(a) Le16(a)
#define | ntohs(a) htons(a)
#define | htonl(a) Le32(a)
#define | ntohl(a) htonl(a)
#define | ENABLE 1
#define | ENABLED 1
#define | DISABLED 0
#define | DISABLE 0
#define | FALSE (0==1)
#define | TRUE (1==1)
#define | true TRUE
#define | false FALSE
#define | KO 0
#define | OK 1
#define | OFF 0
#define | ON 1
#define | NULL 0
#define | CLR 0
#define | SET 1
#define | LOW(U16) ((Uchar)U16)
#define | HIGH(U16) ((Uchar)(U16>>8))
#define | TST_BIT_X(addrx, mask) (*addrx & mask)
#define | SET_BIT_X(addrx, mask) (*addrx = (*addrx | mask))
#define | CLR_BIT_X(addrx, mask) (*addrx = (*addrx & ~mask))
#define | OUT_X(addrx, value) (*addrx = value)
#define | IN_X(addrx) (*addrx)
#define | Max(a, b) ( (a)>(b) ? (a) : (b) )
#define | Min(a, b) ( (a)<(b) ? (a) : (b) )
#define | Upper(val, n) ( ((val)+(n)) & ~((n)-1) )
#define | Align_up(val, n) ( ((val)+(n)-1) & ~((n)-1) )
#define | Align_down(val, n) ( (val) & ~((n)-1) )
#define | Long_call(addr) ((*(void (_ConstType_*)(void))(addr))())
#define | SET_SFR_BIT(sfr_reg, bit_pos, bit_val) { sfr_reg &= ~(1<<(bit_pos)); sfr_reg |= ((bit_val)<<(bit_pos));}
#define | bit_is_clear(PORT, POSITION) ((PORT & (1<<POSITION)) == 0 )
#define | bit_is_set(PORT, POSITION) ((PORT & (1<<POSITION)) != 0 )
#define | TID_GUARD(proc) ((__TID__ & 0x7FF0) != ((90 << 8) | ((proc) << 4)))
## Typedefs
typedef float | Float16
typedef unsigned char | U8
typedef unsigned short | U16
typedef unsigned long | U32
typedef signed char | S8
typedef signed short | S16
typedef long | S32
typedef unsigned char | Bool
typedef U8 | Status
typedef Bool | Status_bool
typedef unsigned char | Uchar
typedef unsigned char | Uint8
typedef unsigned int | Uint16
typedef unsigned long int | Uint32
typedef char | Int8
typedef int | Int16
typedef long int | Int32
typedef unsigned char | Byte
typedef unsigned int | Word
typedef unsigned long int | DWord
typedef char | p_uart_ptchar
typedef char | r_uart_ptchar

## Detailed Description

This file redefines dedicated IAR EWAVR and GNU GCC keywords in order to ensure that any source file can be processed by these compilers.

- Compiler: IAR EWAVR and GNU GCC for AVR
- Supported devices: AT90USB1287, AT90USB1286, AT90USB647, AT90USB646

Author:
  Atmel Corporation: http://www.atmel.com
  Support and FAQ: http://support.atmel.no/

Definition in file compiler.h.

## Define Documentation

#define LITTLE_ENDIAN

Definition at line 49 of file compiler.h.

#define bool Bool

Definition at line 65 of file compiler.h.

#define PASS 0

Definition at line 66 of file compiler.h.

#define FAIL 1

Definition at line 67 of file compiler.h.

#define _MEM_TYPE_BIT_

Definition at line 78 of file compiler.h.

#define _MEM_TYPE_FAST_

Definition at line 79 of file compiler.h.

Referenced by fat_cluster_list(), fat_cluster_val(), and file_read_buf().

#define _MEM_TYPE_MEDFAST_

Definition at line 80 of file compiler.h.

#define _MEM_TYPE_MEDSLOW_

Definition at line 81 of file compiler.h.

#define _MEM_TYPE_SLOW_

Definition at line 82 of file compiler.h.

Referenced by nav_file_name(), nav_getcwd(), nav_partition_label(), and nav_setcwd().

#define INTEL_ALIGNMENT LITTLE_ENDIAN

Definition at line 194 of file compiler.h.

#define MOTOROLA_ALIGNMENT BIG_ENDIAN

Definition at line 195 of file compiler.h.

#define MSB | ( | u16 |  | ) | (((U8* )&u16)[1])

Definition at line 199 of file compiler.h.

Referenced by fat_cluster_val(), fat_entry_longname(), fat_entry_shortname(), fat_mount(), firm_upgrade_readhexline(), flash_wr_block(), host_check_class(), host_check_VID_PID(), host_send_control(), sbc_read_10(), sbc_write_10(), usb_get_descriptor(), usb_get_interface(), usb_set_interface(), and usb_user_read_request().

#define LSB | ( | u16 |  | ) | (((U8* )&u16)[0])

Definition at line 200 of file compiler.h.

Referenced by fat_entry_longname(), fat_mount(), firm_upgrade_readhexline(), flash_wr_block(), host_check_class(), host_check_VID_PID(), host_send_control(), sbc_read_10(), sbc_write_10(), usb_get_descriptor(), usb_get_interface(), usb_set_interface(), and usb_user_read_request().

#define MSW | ( | u32 |  | ) | (((U16*)&u32)[1])

Definition at line 201 of file compiler.h.

#define LSW | ( | u32 |  | ) | (((U16*)&u32)[0])

Definition at line 202 of file compiler.h.

#define MSB0 | ( | u32 |  | ) | (((U8* )&u32)[3])

Definition at line 203 of file compiler.h.

Referenced by fat_cluster_list(), host_mem_mem_2_ram(), host_mem_ram_2_mem(), host_mem_read_capacity(), sbc_read_10(), sbc_read_capacity(), and sbc_write_10().

#define MSB1 | ( | u32 |  | ) | (((U8* )&u32)[2])

Definition at line 204 of file compiler.h.

Referenced by df_read_open(), df_write_open(), host_mem_mem_2_ram(), host_mem_ram_2_mem(), host_mem_read_capacity(), sbc_read_10(), sbc_read_capacity(), and sbc_write_10().

#define MSB2 | ( | u32 |  | ) | (((U8* )&u32)[1])

Definition at line 205 of file compiler.h.

Referenced by df_host_read_sector(), df_host_write_sector(), df_read_open(), df_read_sector(), df_write_close(), df_write_open(), df_write_sector(), host_mem_mem_2_ram(), host_mem_ram_2_mem(), host_mem_read_capacity(), sbc_read_10(), sbc_read_capacity(), and sbc_write_10().

#define MSB3 | ( | u32 |  | ) | (((U8* )&u32)[0])

Definition at line 206 of file compiler.h.

Referenced by df_read_open(), df_write_close(), df_write_open(), host_mem_mem_2_ram(), host_mem_ram_2_mem(), host_mem_read_capacity(), sbc_read_10(), sbc_read_capacity(), and sbc_write_10().

#define LSB0 | ( | u32 |  | ) | MSB3(u32)

Definition at line 207 of file compiler.h.

Referenced by df_host_read_10(), df_read_10(), df_read_open(), df_write_10(), df_write_open(), fat_cluster_list(), fat_cluster_readnext(), fat_cluster_val(), fat_get_entry_info(), fat_mount(), get_port_status(), usb_mass_storage_cbw(), and usb_mass_storage_csw().

#define LSB1 | ( | u32 |  | ) | MSB2(u32)

Definition at line 208 of file compiler.h.

Referenced by fat_cluster_readnext(), fat_cluster_val(), fat_get_entry_info(), fat_mount(), file_read(), get_port_status(), usb_mass_storage_cbw(), and usb_mass_storage_csw().

#define LSB2 | ( | u32 |  | ) | MSB1(u32)

Definition at line 209 of file compiler.h.

Referenced by fat_cluster_readnext(), fat_cluster_val(), fat_get_entry_info(), fat_mount(), get_port_status(), usb_mass_storage_cbw(), and usb_mass_storage_csw().

#define LSB3 | ( | u32 |  | ) | MSB0(u32)

Definition at line 210 of file compiler.h.

Referenced by fat_cluster_readnext(), fat_cluster_val(), fat_get_entry_info(), fat_mount(), get_port_status(), usb_mass_storage_cbw(), and usb_mass_storage_csw().

#define Le16 | ( | b |  | ) |

Value:

    (  ((U16)(     (b) &   0xFF) << 8)  \
       |  (     ((U16)(b) & 0xFF00) >> 8)  \
       )

Definition at line 227 of file compiler.h.

#define Le32 | ( | b |  | ) |

Value:

    (  ((U32)(     (b) &       0xFF) << 24)  \
       |  ((U32)((U16)(b) &     0xFF00) <<  8)  \
       |  (     ((U32)(b) &   0xFF0000) >>  8)  \
       |  (     ((U32)(b) & 0xFF000000) >> 24)  \
       )

Definition at line 231 of file compiler.h.

#define htons | ( | a |  | ) | Le16(a)

Definition at line 243 of file compiler.h.

#define ntohs | ( | a |  | ) | htons(a)

Definition at line 244 of file compiler.h.

#define htonl | ( | a |  | ) | Le32(a)

Definition at line 245 of file compiler.h.

#define ntohl | ( | a |  | ) | htonl(a)

Definition at line 246 of file compiler.h.

#define ENABLE 1

Definition at line 256 of file compiler.h.

Referenced by host_get_data_interrupt(), host_send_data_interrupt(), is_any_interrupt_pipe_active(), and usb_general_interrupt().

#define ENABLED 1

Definition at line 257 of file compiler.h.

Referenced by usb_clear_feature(), usb_general_interrupt(), usb_generate_remote_wakeup(), and usb_set_feature().

#define DISABLED 0

Definition at line 258 of file compiler.h.

Referenced by usb_clear_feature(), usb_device_task(), usb_generate_remote_wakeup(), and usb_set_feature().

#define DISABLE 0

Definition at line 259 of file compiler.h.

Referenced by reset_it_pipe_str(), usb_general_interrupt(), and usb_pipe_interrupt().

#define FALSE (0==1)

Definition at line 260 of file compiler.h.

Referenced by copy_dir(), df_host_read_sector(), df_host_write_sector(), df_read_sector(), df_removal(), fat_cache_clusterlist_reset(), fat_cache_clusterlist_update_read(), fat_cache_flush(), fat_cache_read_sector(), fat_cache_reset(), fat_check_device(), fat_check_is_file(), fat_check_mount(), fat_check_mount_noopen(), fat_check_mount_select(), fat_check_mount_select_noopen(), fat_check_mount_select_open(), fat_check_noopen(), fat_check_open(), fat_check_select(), fat_cluster_list(), fat_cluster_readnext(), fat_cluster_val(), fat_entry_check(), fat_entry_checkext(), fat_entry_longname(), fat_entry_shortname(), fat_get_date(), fat_get_nbpartition(), fat_getfreespace(), fat_getfreespace_percent(), fat_mount(), fat_read_dir(), fat_read_file(), file_ispresent(), file_open(), file_read(), file_read_buf(), file_seek(), firm_upgrade_readhexline(), firm_upgrade_searchfile(), flash_wr_block(), host_auto_configure_endpoint(), host_get_data(), host_get_data_interrupt(), host_mem_csw_read(), host_mem_install(), host_mem_mem_2_ram(), host_mem_mem_2_ram_stop(), host_mem_select_lun(), host_mem_test_unit_ready(), host_mem_uninstall(), host_ms_task(), host_send_control(), host_send_data(), host_send_data_interrupt(), is_any_interrupt_pipe_active(), mystrncmp(), nav_checkdisk_enable(), nav_copy(), nav_dir_cd(), nav_dir_gotoparent(), nav_dir_is_root(), nav_dir_name(), nav_drive_set(), nav_file_checkext(), nav_file_dateget(), nav_file_getname(), nav_file_name(), nav_filelist_bol(), nav_filelist_eol(), nav_filelist_findname(), nav_filelist_first(), nav_filelist_goto(), nav_filelist_last(), nav_filelist_reset(), nav_filelist_set(), nav_filelist_single_disable(), nav_filelist_single_enable(), nav_getcwd(), nav_gotoindex(), nav_partition_label(), nav_partition_mount(), nav_partition_serialnumber(), nav_partition_set(), nav_reset(), nav_select(), nav_setcwd(), nav_string_ascii(), nav_string_length_disable(), sbc_inquiry(), sbc_mode_sense(), sbc_read_10(), sbc_read_capacity(), sbc_write_10(), scsi_decode_command(), usb_clear_feature(), usb_device_task(), usb_general_interrupt(), usb_generate_remote_wakeup(), usb_get_descriptor(), usb_get_interface(), usb_get_status(), usb_host_task(), usb_init_device(), usb_mass_storage_cbw(), usb_pipe_interrupt(), usb_set_configuration(), usb_set_feature(), usb_set_interface(), usb_user_get_descriptor(), usb_user_read_request(), ushell_cmd_append_file(), ushell_cmd_cat(), ushell_cmd_cd(), ushell_cmd_copy(), ushell_cmd_ls(), ushell_cmd_perform(), ushell_cmd_perform_alloc(), ushell_cmd_rename(), ushell_cmd_rm(), ushell_cmd_scan(), ushell_cmd_sync(), ushell_cmddfu_load(), ushell_task(), and ushell_task_init().

#define TRUE (1==1)

Definition at line 261 of file compiler.h.

Referenced by copy_dir(), enumerate_hub_port_device(), fat_cache_clusterlist_reset(), fat_cache_clusterlist_update_read(), fat_cache_flush(), fat_cache_read_sector(), fat_check_device(), fat_check_is_file(), fat_check_mount(), fat_check_noopen(), fat_check_open(), fat_check_select(), fat_cluster_list(), fat_cluster_readnext(), fat_cluster_val(), fat_entry_checkext(), fat_entry_longname(), fat_entry_shortname(), fat_get_date(), fat_get_nbpartition(), fat_getfreespace_percent(), fat_mount(), fat_read_dir(), fat_read_file(), file_open(), file_read(), file_seek(), firm_upgrade_searchfile(), flash_wr_block(), host_mem_csw_read(), host_mem_install(), host_mem_mem_2_ram(), host_mem_removal(), host_mem_select_lun(), host_mem_test_unit_ready(), host_mem_uninstall(), host_mem_wr_protect(), host_mem_wr_protect_cache(), host_ms_task(), host_send_control(), is_any_interrupt_pipe_active(), mystrncmp(), nav_checkdisk_disable(), nav_copy(), nav_dir_cd(), nav_dir_gotoparent(), nav_dir_name(), nav_drive_set(), nav_file_checkext(), nav_file_dateget(), nav_file_isreadonly(), nav_file_name(), nav_filelist_bol(), nav_filelist_eol(), nav_filelist_findname(), nav_filelist_first(), nav_filelist_goto(), nav_filelist_last(), nav_filelist_reset(), nav_filelist_set(), nav_filelist_single_enable(), nav_getcwd(), nav_gotoindex(), nav_partition_label(), nav_partition_mount(), nav_partition_set(), nav_reset(), nav_select(), nav_setcwd(), nav_string_length_enable(), nav_string_unicode(), sbc_inquiry(), sbc_mode_sense(), sbc_prevent_allow_medium_removal(), sbc_read_10(), sbc_read_capacity(), sbc_request_sense(), sbc_test_unit_ready(), sbc_write_10(), scsi_decode_command(), uart_init(), usb_clear_feature(), usb_device_task(), usb_general_interrupt(), usb_get_descriptor(), usb_get_interface(), usb_get_status(), usb_host_task(), usb_mass_storage_cbw(), usb_pipe_interrupt(), usb_set_configuration(), usb_set_feature(), usb_set_interface(), usb_user_get_descriptor(), usb_user_read_request(), ushell_cmd_append_file(), ushell_cmd_cat(), ushell_cmd_cd(), ushell_cmd_copy(), ushell_cmd_ls(), ushell_cmd_perform(), ushell_cmd_rename(), ushell_cmd_rm(), ushell_cmd_scan(), ushell_cmd_sync(), ushell_cmddfu_load(), and ushell_task().

#define true TRUE

Definition at line 262 of file compiler.h.

#define false FALSE

Definition at line 263 of file compiler.h.

#define KO 0

Definition at line 266 of file compiler.h.

Referenced by df_mem_check(), df_read_10(), df_read_sector(), df_write_10(), and df_write_sector().

#define OK 1

Definition at line 267 of file compiler.h.

Referenced by df_host_read_sector(), df_host_write_sector(), df_mem_check(), df_read_10(), df_read_open(), df_read_sector(), df_read_sector_2_ram(), df_test_unit_ready(), df_write_open(), df_write_sector(), and df_write_sector_from_ram().

#define OFF 0

Definition at line 268 of file compiler.h.

#define ON 1

Definition at line 269 of file compiler.h.

#define NULL 0

Definition at line 271 of file compiler.h.

Referenced by host_get_data(), host_mem_mem_2_ram(), host_mem_mem_2_ram_stop(), and nav_partition_label().

#define CLR 0

Definition at line 274 of file compiler.h.

#define SET 1

Definition at line 275 of file compiler.h.

#define LOW | ( | U16 |  | ) | ((Uchar)U16)

Definition at line 279 of file compiler.h.

Referenced by flash_wr_block().

#define HIGH | ( | U16 |  | ) | ((Uchar)(U16>>8))

Definition at line 280 of file compiler.h.

#define TST_BIT_X | ( | addrx,
|  | mask |  | ) | (*addrx & mask)

Definition at line 281 of file compiler.h.

#define SET_BIT_X | ( | addrx,
|  | mask |  | ) | (*addrx = (*addrx | mask))

Definition at line 282 of file compiler.h.

#define CLR_BIT_X | ( | addrx,
|  | mask |  | ) | (*addrx = (*addrx & ~mask))

Definition at line 283 of file compiler.h.

#define OUT_X | ( | addrx,
|  | value |  | ) | (*addrx = value)

Definition at line 284 of file compiler.h.

#define IN_X | ( | addrx |  | ) | (*addrx)

Definition at line 285 of file compiler.h.

#define Max | ( | a,
|  | b |  | ) | ( (a)>(b) ? (a) : (b) )

Definition at line 287 of file compiler.h.

#define Min | ( | a,
|  | b |  | ) | ( (a)<(b) ? (a) : (b) )

Definition at line 288 of file compiler.h.

#define Upper | ( | val,
|  | n |  | ) | ( ((val)+(n)) & ~((n)-1) )

Definition at line 297 of file compiler.h.

#define Align_up | ( | val,
|  | n |  | ) | ( ((val)+(n)-1) & ~((n)-1) )

Definition at line 306 of file compiler.h.

#define Align_down | ( | val,
|  | n |  | ) | ( (val) & ~((n)-1) )

Definition at line 315 of file compiler.h.

#define Long_call | ( | addr |  | ) | ((*(void (_ConstType_*)(void))(addr))())

Definition at line 332 of file compiler.h.

#define SET_SFR_BIT | ( | sfr_reg,
|  | bit_pos,
|  | bit_val |  | ) | { sfr_reg &= ~(1<<(bit_pos)); sfr_reg |= ((bit_val)<<(bit_pos));}

Definition at line 344 of file compiler.h.

#define bit_is_clear | ( | PORT,
|  | POSITION |  | ) | ((PORT & (1<<POSITION)) == 0 )

Definition at line 354 of file compiler.h.

#define bit_is_set | ( | PORT,
|  | POSITION |  | ) | ((PORT & (1<<POSITION)) != 0 )

Definition at line 364 of file compiler.h.

#define TID_GUARD | ( | proc |  | ) | ((__TID__ & 0x7FF0) != ((90 << 8) | ((proc) << 4)))

Definition at line 370 of file compiler.h.

## Typedef Documentation

typedef float Float16

Definition at line 52 of file compiler.h.

typedef unsigned char U8

Definition at line 54 of file compiler.h.

typedef unsigned short U16

Definition at line 55 of file compiler.h.

typedef unsigned long U32

Definition at line 56 of file compiler.h.

typedef signed char S8

Definition at line 57 of file compiler.h.

typedef signed short S16

Definition at line 58 of file compiler.h.

typedef long S32

Definition at line 59 of file compiler.h.

typedef unsigned char Bool

Definition at line 60 of file compiler.h.

typedef U8 Status

Definition at line 63 of file compiler.h.

typedef Bool Status_bool

Definition at line 64 of file compiler.h.

typedef unsigned char Uchar

Definition at line 85 of file compiler.h.

typedef unsigned char Uint8

Definition at line 88 of file compiler.h.

typedef unsigned int Uint16

Definition at line 89 of file compiler.h.

typedef unsigned long int Uint32

Definition at line 90 of file compiler.h.

typedef char Int8

Definition at line 92 of file compiler.h.

typedef int Int16

Definition at line 93 of file compiler.h.

typedef long int Int32

Definition at line 94 of file compiler.h.

typedef unsigned char Byte

Definition at line 96 of file compiler.h.

typedef unsigned int Word

Definition at line 97 of file compiler.h.

typedef unsigned long int DWord

Definition at line 98 of file compiler.h.

typedef char p_uart_ptchar

Definition at line 124 of file compiler.h.

typedef char r_uart_ptchar

Definition at line 125 of file compiler.h.