IAR PLATFORM_HEADER Configuration#
Compiler and Platform specific definitions and typedefs for the IAR ARM C compiler.
Note
iar.h should be included first in all source files by setting the preprocessor macro PLATFORM_HEADER to point to it. iar.h automatically includes platform-common.h.
See iar.h and platform-common.h for source code.
Master Variable Types#
LEGACY_PHY_BUILDThese are a set of typedefs to make the size of all variable declarations explicitly known.
A typedef to make the size of the variable explicitly known.
Denotes that this platform supports 64-bit data-types.
Denotes that this platform supports 64-bit data-types.
Denotes that this platform supports 64-bit data-types.
Denotes that this platform supports 64-bit data-types.
Denotes that this platform supports 64-bit data-types.
Denotes that this platform supports 64-bit data-types.
Denotes that this platform supports 64-bit data-types.
Denotes that this platform supports 64-bit data-types.
Denotes that this platform supports 64-bit data-types.
Denotes that this platform supports 64-bit data-types.
Use the Master Program Memory Declarations from platform-common.h.
Miscellaneous Macros#
A prototype definition for use by the assert macro. (see hal/micro/micro.h)
Macro to reset the watchdog timer. Note: be very very careful when using this as you can easily get into an infinite loop if you are not careful.
A convenient method for code to know what endiannes processor it is running on. For the Cortex-M3, we are little endian.
Define intrinsics for NTOHL and NTOHS to save code space by making endian.c compile to nothing.
A convenient method for code to know what endiannes processor it is running on. For the Cortex-M3, we are little endian.
A friendlier name for the compiler's intrinsic for not stripping.
A friendlier name for the compiler's intrinsic for eeprom reference.
The SOURCEFILE macro is used by asserts to list the filename if it isn't otherwise defined, set it to the compiler intrinsic which specifies the whole filename and path of the sourcefile.
A custom implementation of the C language assert macro. This macro implements the conditional evaluation and calls the function halInternalAssertFailed(). (see hal/micro/micro.h)
A convenient method for code to know what endiannes processor it is running on. For the Cortex-M3, we are little endian.
Declare a variable as unused to avoid a warning. Has no effect in IAR builds.
Some platforms need to cast enum values that have the high bit set.
Define the magic value that is interpreted by IAR C-SPY's Stack View.
Define a generic RAM function identifier to a compiler specific one.
Define a generic no operation identifier to a compiler specific one.
A convenience macro that makes it easy to change the field of a register to any unsigned value.
A convenience macro that makes it easy to change a register using the provided mask(s) and value(s). Example: SET_CMSIS_REG(GPIO->P[1].CFGH, (_GPIO_P_CFGH_Px5_MASK | _GPIO_P_CFGH_Px6_MASK), (GPIO_P_CFGH_Px5_OUT | GPIO_P_CFGH_Px6_OUT));.
A convenience macro that makes it easy to change the field of a register, as defined in CMSIS Device headers, to any unsigned value. Example using EM35xx: SET_CMSIS_REG_FIELD(GPIO->P[0].CFGL, GPIO_P_CFGL_Px0, _GPIO_P_CFGL_Px0_OUT);.
Stub for code not running in simulation.
Stub for code not running in simulation.
Stub for code not running in simulation.
Use the Divide and Modulus Operations from platform-common.h.
Provide a portable way to specify the segment where a variable lives.
Convinience macro for turning a token into a string.
Provide a portable way to align data.
Provide a portable way to specify a symbol as weak.
Provide a portable way to specify a non initialized symbol.
Provide a portable way to specify a compile time assert.
External Declarations#
If the line below is uncommented we will use Ember memory APIs, otherwise, we will use the C Standard library (memset,memcpy,memmove) APIs.These are routines that are defined in certain header files that we don't want to include, e.g. stdlib.h
Returns the absolute value of I (also called the magnitude of I). That is, if I is negative, the result is the opposite of I, but if I is nonnegative the result is I.
Include platform-common.h last to pick up defaults and common definitions.
The kind of arguments the main function takes.
Include platform-common.h last to pick up defaults and common definitions.
Portable segment names#
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Portable segment names.
Functions#
Master Variable Types Documentation#
_HAL_USE_COMMON_PGM_#
#define _HAL_USE_COMMON_PGM_
Use the Master Program Memory Declarations from platform-common.h.
Miscellaneous Macros Documentation#
halInternalAssertFailed#
void halInternalAssertFailed (const char * filename, int linenumber)
A prototype definition for use by the assert macro. (see hal/micro/micro.h)
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| const char * | N/A | filename | |
| int | N/A | linenumber |
halInternalResetWatchDog#
void halInternalResetWatchDog (void )
Macro to reset the watchdog timer. Note: be very very careful when using this as you can easily get into an infinite loop if you are not careful.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
BIGENDIAN_CPU#
#define BIGENDIAN_CPUValue:
false
A convenient method for code to know what endiannes processor it is running on. For the Cortex-M3, we are little endian.
NTOHS#
#define NTOHSValue:
(val)
Define intrinsics for NTOHL and NTOHS to save code space by making endian.c compile to nothing.
NTOHL#
#define NTOHLValue:
(val)
A convenient method for code to know what endiannes processor it is running on. For the Cortex-M3, we are little endian.
NO_STRIPPING#
#define NO_STRIPPINGValue:
__root
A friendlier name for the compiler's intrinsic for not stripping.
EEPROM#
#define EEPROMValue:
errorerror
A friendlier name for the compiler's intrinsic for eeprom reference.
__SOURCEFILE__#
#define __SOURCEFILE__Value:
__FILE__
The SOURCEFILE macro is used by asserts to list the filename if it isn't otherwise defined, set it to the compiler intrinsic which specifies the whole filename and path of the sourcefile.
assert#
#define assert
A custom implementation of the C language assert macro. This macro implements the conditional evaluation and calls the function halInternalAssertFailed(). (see hal/micro/micro.h)
halResetWatchdog#
#define halResetWatchdogValue:
()
A convenient method for code to know what endiannes processor it is running on. For the Cortex-M3, we are little endian.
STACK_FILL_VALUE#
#define STACK_FILL_VALUEValue:
0xCDCDCDCDU
Define the magic value that is interpreted by IAR C-SPY's Stack View.
RAMFUNC#
#define RAMFUNCValue:
__ramfunc
Define a generic RAM function identifier to a compiler specific one.
NO_OPERATION#
#define NO_OPERATIONValue:
()
Define a generic no operation identifier to a compiler specific one.
SET_REG_FIELD#
#define SET_REG_FIELDValue:
A convenience macro that makes it easy to change the field of a register to any unsigned value.
SET_CMSIS_REG#
#define SET_CMSIS_REGValue:
A convenience macro that makes it easy to change a register using the provided mask(s) and value(s). Example: SET_CMSIS_REG(GPIO->P[1].CFGH, (_GPIO_P_CFGH_Px5_MASK | _GPIO_P_CFGH_Px6_MASK), (GPIO_P_CFGH_Px5_OUT | GPIO_P_CFGH_Px6_OUT));.
SET_CMSIS_REG_FIELD#
#define SET_CMSIS_REG_FIELDValue:
A convenience macro that makes it easy to change the field of a register, as defined in CMSIS Device headers, to any unsigned value. Example using EM35xx: SET_CMSIS_REG_FIELD(GPIO->P[0].CFGL, GPIO_P_CFGL_Px0, _GPIO_P_CFGL_Px0_OUT);.
_HAL_USE_COMMON_DIVMOD_#
#define _HAL_USE_COMMON_DIVMOD_
Use the Divide and Modulus Operations from platform-common.h.
VAR_AT_SEGMENT#
#define VAR_AT_SEGMENTValue:
(__variableDeclaration, __segmentName)
Provide a portable way to specify the segment where a variable lives.
STATIC_ASSERT#
#define STATIC_ASSERTValue:
(__condition, __errorstr)
Provide a portable way to specify a compile time assert.
External Declarations Documentation#
abs#
int abs (int I)
Returns the absolute value of I (also called the magnitude of I). That is, if I is negative, the result is the opposite of I, but if I is nonnegative the result is I.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| int | N/A | I | An integer. |
Returns
A nonnegative integer.
PLATCOMMONOKTOINCLUDE#
#define PLATCOMMONOKTOINCLUDE
Include platform-common.h last to pick up defaults and common definitions.
MAIN_FUNCTION_PARAMETERS#
#define MAIN_FUNCTION_PARAMETERSValue:
void
The kind of arguments the main function takes.
MAIN_FUNCTION_ARGUMENTS#
#define MAIN_FUNCTION_ARGUMENTS
Include platform-common.h last to pick up defaults and common definitions.
Portable segment names Documentation#
__DLIB_PERTHREAD_INIT__#
#define __DLIB_PERTHREAD_INIT__Value:
"__DLIB_PERTHREAD_init"
Portable segment names.
__DLIB_PERTHREAD_INITIALIZED_DATA__#
#define __DLIB_PERTHREAD_INITIALIZED_DATA__Value:
"DLIB_PERTHREAD_INITIALIZED_DATA"
Portable segment names.
__DLIB_PERTHREAD_ZERO_DATA__#
#define __DLIB_PERTHREAD_ZERO_DATA__Value:
"DLIB_PERTHREAD_ZERO_DATA"
Portable segment names.
__LOCKBITS_IN_MAINFLASH__#
#define __LOCKBITS_IN_MAINFLASH__Value:
"LOCKBITS_IN_MAINFLASH"
Portable segment names.
_NO_INIT_SEGMENT_BEGIN#
#define _NO_INIT_SEGMENT_BEGINValue:
__segment_begin(__NO_INIT__)
Portable segment names.
_DEBUG_CHANNEL_SEGMENT_BEGIN#
#define _DEBUG_CHANNEL_SEGMENT_BEGINValue:
__segment_begin(__DEBUG_CHANNEL__)
Portable segment names.
_INTVEC_SEGMENT_BEGIN#
#define _INTVEC_SEGMENT_BEGINValue:
__segment_begin(__INTVEC__)
Portable segment names.
_CSTACK_SEGMENT_BEGIN#
#define _CSTACK_SEGMENT_BEGINValue:
__segment_begin(__CSTACK__)
Portable segment names.
_RESETINFO_SEGMENT_BEGIN#
#define _RESETINFO_SEGMENT_BEGINValue:
__segment_begin(__RESETINFO__)
Portable segment names.
_DATA_INIT_SEGMENT_BEGIN#
#define _DATA_INIT_SEGMENT_BEGINValue:
__segment_begin(__DATA_INIT__)
Portable segment names.
_DATA_SEGMENT_BEGIN#
#define _DATA_SEGMENT_BEGINValue:
__segment_begin(__DATA__)
Portable segment names.
_CONST_SEGMENT_BEGIN#
#define _CONST_SEGMENT_BEGINValue:
__segment_begin(__CONST__)
Portable segment names.
_TEXT_SEGMENT_BEGIN#
#define _TEXT_SEGMENT_BEGINValue:
__segment_begin(__TEXT__)
Portable segment names.
_TEXTRW_INIT_SEGMENT_BEGIN#
#define _TEXTRW_INIT_SEGMENT_BEGINValue:
__segment_begin(__TEXTRW_INIT__)
Portable segment names.
_TEXTRW_SEGMENT_BEGIN#
#define _TEXTRW_SEGMENT_BEGINValue:
__segment_begin(__TEXTRW__)
Portable segment names.
_BAT_INIT_SEGMENT_BEGIN#
#define _BAT_INIT_SEGMENT_BEGINValue:
__segment_begin(__BAT_INIT__)
Portable segment names.
_SIMEE_SEGMENT_BEGIN#
#define _SIMEE_SEGMENT_BEGINValue:
__segment_begin(__SIMEE__)
Portable segment names.
_PSSTORE_SEGMENT_BEGIN#
#define _PSSTORE_SEGMENT_BEGINValue:
__segment_begin(__PSSTORE__)
Portable segment names.
_LONGTOKEN_SEGMENT_BEGIN#
#define _LONGTOKEN_SEGMENT_BEGINValue:
__segment_begin(__LONGTOKEN__)
Portable segment names.
_EMHEAP_SEGMENT_BEGIN#
#define _EMHEAP_SEGMENT_BEGINValue:
__segment_begin(__EMHEAP__)
Portable segment names.
_GUARD_REGION_SEGMENT_BEGIN#
#define _GUARD_REGION_SEGMENT_BEGINValue:
__segment_begin(__GUARD_REGION__)
Portable segment names.
_DLIB_PERTHREAD_INIT_SEGMENT_BEGIN#
#define _DLIB_PERTHREAD_INIT_SEGMENT_BEGINValue:
__segment_begin(__DLIB_PERTHREAD_INIT__)
Portable segment names.
_DLIB_PERTHREAD_INITIALIZED_DATA_SEGMENT_BEGIN#
#define _DLIB_PERTHREAD_INITIALIZED_DATA_SEGMENT_BEGINValue:
__segment_begin(__DLIB_PERTHREAD_INITIALIZED_DATA__)
Portable segment names.
_DLIB_PERTHREAD_ZERO_DATA_SEGMENT_BEGIN#
#define _DLIB_PERTHREAD_ZERO_DATA_SEGMENT_BEGINValue:
__segment_begin(__DLIB_PERTHREAD_ZERO_DATA__)
Portable segment names.
_INTERNAL_STORAGE_SEGMENT_BEGIN#
#define _INTERNAL_STORAGE_SEGMENT_BEGINValue:
__segment_begin(__INTERNAL_STORAGE__)
Portable segment names.
_LOCKBITS_IN_MAINFLASH_SEGMENT_BEGIN#
#define _LOCKBITS_IN_MAINFLASH_SEGMENT_BEGINValue:
__segment_begin(__LOCKBITS_IN_MAINFLASH__)
Portable segment names.
_UNRETAINED_RAM_SEGMENT_BEGIN#
#define _UNRETAINED_RAM_SEGMENT_BEGINValue:
__segment_begin(__UNRETAINED_RAM__)
Portable segment names.
_NO_INIT_SEGMENT_END#
#define _NO_INIT_SEGMENT_ENDValue:
__segment_end(__NO_INIT__)
Portable segment names.
_DEBUG_CHANNEL_SEGMENT_END#
#define _DEBUG_CHANNEL_SEGMENT_ENDValue:
__segment_end(__DEBUG_CHANNEL__)
Portable segment names.
_INTVEC_SEGMENT_END#
#define _INTVEC_SEGMENT_ENDValue:
__segment_end(__INTVEC__)
Portable segment names.
_CSTACK_SEGMENT_END#
#define _CSTACK_SEGMENT_ENDValue:
__segment_end(__CSTACK__)
Portable segment names.
_RESETINFO_SEGMENT_END#
#define _RESETINFO_SEGMENT_ENDValue:
__segment_end(__RESETINFO__)
Portable segment names.
_DATA_INIT_SEGMENT_END#
#define _DATA_INIT_SEGMENT_ENDValue:
__segment_end(__DATA_INIT__)
Portable segment names.
_TEXTRW_INIT_SEGMENT_END#
#define _TEXTRW_INIT_SEGMENT_ENDValue:
__segment_end(__TEXTRW_INIT__)
Portable segment names.
_TEXTRW_SEGMENT_END#
#define _TEXTRW_SEGMENT_ENDValue:
__segment_end(__TEXTRW__)
Portable segment names.
_BAT_INIT_SEGMENT_END#
#define _BAT_INIT_SEGMENT_ENDValue:
__segment_end(__BAT_INIT__)
Portable segment names.
_PSSTORE_SEGMENT_END#
#define _PSSTORE_SEGMENT_ENDValue:
__segment_end(__PSSTORE__)
Portable segment names.
_LONGTOKEN_SEGMENT_END#
#define _LONGTOKEN_SEGMENT_ENDValue:
__segment_end(__LONGTOKEN__)
Portable segment names.
_EMHEAP_SEGMENT_END#
#define _EMHEAP_SEGMENT_ENDValue:
__segment_end(__EMHEAP__)
Portable segment names.
_GUARD_REGION_SEGMENT_END#
#define _GUARD_REGION_SEGMENT_ENDValue:
__segment_end(__GUARD_REGION__)
Portable segment names.
_DLIB_PERTHREAD_INIT_SEGMENT_END#
#define _DLIB_PERTHREAD_INIT_SEGMENT_ENDValue:
__segment_end(__DLIB_PERTHREAD_INIT__)
Portable segment names.
_DLIB_PERTHREAD_INITIALIZED_DATA_SEGMENT_END#
#define _DLIB_PERTHREAD_INITIALIZED_DATA_SEGMENT_ENDValue:
__segment_end(__DLIB_PERTHREAD_INITIALIZED_DATA__)
Portable segment names.
_DLIB_PERTHREAD_ZERO_DATA_SEGMENT_END#
#define _DLIB_PERTHREAD_ZERO_DATA_SEGMENT_ENDValue:
__segment_end(__DLIB_PERTHREAD_ZERO_DATA__)
Portable segment names.
_INTERNAL_STORAGE_SEGMENT_END#
#define _INTERNAL_STORAGE_SEGMENT_ENDValue:
__segment_end(__INTERNAL_STORAGE__)
Portable segment names.
_LOCKBITS_IN_MAINFLASH_SEGMENT_END#
#define _LOCKBITS_IN_MAINFLASH_SEGMENT_ENDValue:
__segment_end(__LOCKBITS_IN_MAINFLASH__)
Portable segment names.
_UNRETAINED_RAM_SEGMENT_END#
#define _UNRETAINED_RAM_SEGMENT_ENDValue:
__segment_end(__UNRETAINED_RAM__)
Portable segment names.
_NO_INIT_SEGMENT_SIZE#
#define _NO_INIT_SEGMENT_SIZEValue:
__segment_size(__NO_INIT__)
Portable segment names.
_DEBUG_CHANNEL_SEGMENT_SIZE#
#define _DEBUG_CHANNEL_SEGMENT_SIZEValue:
__segment_size(__DEBUG_CHANNEL__)
Portable segment names.
_INTVEC_SEGMENT_SIZE#
#define _INTVEC_SEGMENT_SIZEValue:
__segment_size(__INTVEC__)
Portable segment names.
_CSTACK_SEGMENT_SIZE#
#define _CSTACK_SEGMENT_SIZEValue:
__segment_size(__CSTACK__)
Portable segment names.
_RESETINFO_SEGMENT_SIZE#
#define _RESETINFO_SEGMENT_SIZEValue:
__segment_size(__RESETINFO__)
Portable segment names.
_DATA_INIT_SEGMENT_SIZE#
#define _DATA_INIT_SEGMENT_SIZEValue:
__segment_size(__DATA_INIT__)
Portable segment names.
_CONST_SEGMENT_SIZE#
#define _CONST_SEGMENT_SIZEValue:
__segment_size(__CONST__)
Portable segment names.
_TEXTRW_INIT_SEGMENT_SIZE#
#define _TEXTRW_INIT_SEGMENT_SIZEValue:
__segment_size(__TEXTRW_INIT__)
Portable segment names.
_TEXTRW_SEGMENT_SIZE#
#define _TEXTRW_SEGMENT_SIZEValue:
__segment_size(__TEXTRW__)
Portable segment names.
_BAT_INIT_SEGMENT_SIZE#
#define _BAT_INIT_SEGMENT_SIZEValue:
__segment_size(__BAT_INIT__)
Portable segment names.
_SIMEE_SEGMENT_SIZE#
#define _SIMEE_SEGMENT_SIZEValue:
__segment_size(__SIMEE__)
Portable segment names.
_PSSTORE_SEGMENT_SIZE#
#define _PSSTORE_SEGMENT_SIZEValue:
__segment_size(__PSSTORE__)
Portable segment names.
_LONGTOKEN_SEGMENT_SIZE#
#define _LONGTOKEN_SEGMENT_SIZEValue:
__segment_size(__LONGTOKEN__)
Portable segment names.
_EMHEAP_SEGMENT_SIZE#
#define _EMHEAP_SEGMENT_SIZEValue:
__segment_size(__EMHEAP__)
Portable segment names.
_GUARD_REGION_SEGMENT_SIZE#
#define _GUARD_REGION_SEGMENT_SIZEValue:
__segment_size(__GUARD_REGION__)
Portable segment names.
_DLIB_PERTHREAD_INIT_SEGMENT_SIZE#
#define _DLIB_PERTHREAD_INIT_SEGMENT_SIZEValue:
__segment_size(__DLIB_PERTHREAD_INIT__)
Portable segment names.
_DLIB_PERTHREAD_INITIALIZED_DATA_SEGMENT_SIZE#
#define _DLIB_PERTHREAD_INITIALIZED_DATA_SEGMENT_SIZEValue:
__segment_size(__DLIB_PERTHREAD_INITIALIZED_DATA__)
Portable segment names.
_DLIB_PERTHREAD_ZERO_DATA_SEGMENT_SIZE#
#define _DLIB_PERTHREAD_ZERO_DATA_SEGMENT_SIZEValue:
__segment_size(__DLIB_PERTHREAD_ZERO_DATA__)
Portable segment names.
_INTERNAL_STORAGE_SEGMENT_SIZE#
#define _INTERNAL_STORAGE_SEGMENT_SIZEValue:
__segment_size(__INTERNAL_STORAGE__)
Portable segment names.
_LOCKBITS_IN_MAINFLASH_SEGMENT_SIZE#
#define _LOCKBITS_IN_MAINFLASH_SEGMENT_SIZEValue:
__segment_size(__LOCKBITS_IN_MAINFLASH__)
Portable segment names.
_UNRETAINED_RAM_SEGMENT_SIZE#
#define _UNRETAINED_RAM_SEGMENT_SIZEValue:
__segment_size(__UNRETAINED_RAM__)
Portable segment names.