EFM32 Jade Gecko 12 Software Documentation  efm32jg12-doc-5.1.2
COMMON

Detailed Description

General purpose utilities and cross-compiler support.

This SDK supports the following compilers/IDEs:

Certain compiler features such as alignment is implemented differently in the tools. Therefore, macros such as SL_ALIGN are provided to enable compiler independent code.

Note
RAM code macros are implemented in a separate module RAMFUNC. Cross-compiler RAM code support needs extended documentation and it is therefore implemented as a separate module.

Macros

#define SL_ALIGN(X)
 Macro for aligning a variable.
Use this macro before the variable definition.
X denotes the storage alignment value in bytes.
To be gcc compatible use SL_ATTRIBUTE_ALIGN(X) before the ; on normal variables. Use SL_ATTRIBUTE_ALIGN(X) before the opening { on struct variables.
 
#define SL_ATTRIBUTE_ALIGN(X)   __attribute__ ((aligned(X)))
 GCC style macro for aligning a variable.
 
#define SL_ATTRIBUTE_PACKED   __attribute__ ((packed))
 GCC style macro for handling packed structs.
 
#define SL_ATTRIBUTE_SECTION(X)   __attribute__ ((section(X)))
 
#define SL_MAX(a, b)   __extension__({__typeof__(a) _a = (a); __typeof__(b) _b = (b); _a > _b ? _a : _b;})
 Macro for getting maximum value. No sideeffects, a and b are evaluated once only.
 
#define SL_MIN(a, b)   __extension__({__typeof__(a) _a = (a); __typeof__(b) _b = (b); _a < _b ? _a : _b;})
 Macro for getting minimum value. No sideeffects, a and b are evaluated once only.
 
#define SL_NORETURN   __attribute__ ((noreturn))
 Macro for handling non-returning functions.
 
#define SL_PACK_END()
 Macro for handling packed structs.
Use this macro after the struct definition.
With GCC, add SL_ATTRIBUTE_PACKED after the closing } of the struct definition.
 
#define SL_PACK_START(x)
 Macro for handling packed structs.
Use this macro before the struct definition.
X denotes the maximum alignment of struct members. X is not supported with GCC. GCC always use 1 byte maximum alignment.
 
#define SL_WEAK   __attribute__ ((weak))
 Macro for defining a weak symbol.
 

Functions

__STATIC_INLINE uint32_t EFM32_CTZ (uint32_t value)
 
__STATIC_INLINE uint32_t SL_CTZ (uint32_t value)
 Count trailing number of zeros. Use CLZ instruction if available. More...
 

Macro Definition Documentation

#define SL_ATTRIBUTE_SECTION (   X)    __attribute__ ((section(X)))

Macro for placing a variable in a section.
Use this macro after the variable definition, before the = or ;.
X denotes the section to place the variable in.

Definition at line 180 of file em_common.h.

Function Documentation

__STATIC_INLINE uint32_t SL_CTZ ( uint32_t  value)

Count trailing number of zeros. Use CLZ instruction if available.

Parameters
[in]valueData value to check for number of trailing zero bits.
Returns
Number of trailing zeros in value.

Definition at line 194 of file em_common.h.

Referenced by GPIOINT_CallbackRegister(), and RMU_ResetControl().