SYSTEMEMLIB
Detailed Description
System API.
This module contains functions to read information such as RAM and Flash size, device unique ID, chip revision, family and part number from the DEVINFO and SCB blocks. Functions to configure and read status from the FPU are available for compatible devices.
Data Structures | |
struct | SYSTEM_CalAddrVal_TypeDef |
struct | SYSTEM_ChipRevision_TypeDef |
Enumerations | |
enum | SYSTEM_FpuAccess_TypeDef { fpuAccessDenied = (0x0 << 20), fpuAccessPrivilegedOnly = (0x5 << 20), fpuAccessReserved = (0xA << 20), fpuAccessFull = (0xF << 20) } |
enum | SYSTEM_PartFamily_TypeDef { systemPartFamilyEfm32Gecko = _DEVINFO_PART_DEVICE_FAMILY_EFM32G, systemPartFamilyEfm32Giant = _DEVINFO_PART_DEVICE_FAMILY_EFM32GG, systemPartFamilyEfm32Giant11B = _DEVINFO_PART_DEVICE_FAMILY_EFM32GG11B, systemPartFamilyEfm32Tiny = _DEVINFO_PART_DEVICE_FAMILY_EFM32TG, systemPartFamilyEfm32Tiny11B = _DEVINFO_PART_DEVICE_FAMILY_EFM32TG11B, systemPartFamilyEfm32Leopard = _DEVINFO_PART_DEVICE_FAMILY_EFM32LG, systemPartFamilyEfm32Wonder = _DEVINFO_PART_DEVICE_FAMILY_EFM32WG, systemPartFamilyEfm32Zero = _DEVINFO_PART_DEVICE_FAMILY_EFM32ZG, systemPartFamilyEfm32Happy = _DEVINFO_PART_DEVICE_FAMILY_EFM32HG, systemPartFamilyEfm32Pearl1B = _DEVINFO_PART_DEVICE_FAMILY_EFM32PG1B, systemPartFamilyEfm32Jade1B = _DEVINFO_PART_DEVICE_FAMILY_EFM32JG1B, systemPartFamilyEfm32Pearl12B = _DEVINFO_PART_DEVICE_FAMILY_EFM32PG12B, systemPartFamilyEfm32Jade12B = _DEVINFO_PART_DEVICE_FAMILY_EFM32JG12B, systemPartFamilyEzr32Wonder = _DEVINFO_PART_DEVICE_FAMILY_EZR32WG, systemPartFamilyEzr32Leopard = _DEVINFO_PART_DEVICE_FAMILY_EZR32LG, systemPartFamilyEzr32Happy = _DEVINFO_PART_DEVICE_FAMILY_EZR32HG, systemPartFamilyMighty1P = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG1P, systemPartFamilyMighty1B = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG1B, systemPartFamilyMighty1V = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG1V, systemPartFamilyBlue1P = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG1P, systemPartFamilyBlue1B = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG1B, systemPartFamilyBlue1V = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG1V, systemPartFamilyFlex1P = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG1P, systemPartFamilyFlex1B = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG1B, systemPartFamilyFlex1V = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG1V, systemPartFamilyMighty12P = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG12P, systemPartFamilyMighty12B = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG12B, systemPartFamilyMighty12V = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG12V, systemPartFamilyBlue12P = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG12P, systemPartFamilyBlue12B = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG12B, systemPartFamilyBlue12V = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG12V, systemPartFamilyFlex12P = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG12P, systemPartFamilyFlex12B = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG12B, systemPartFamilyFlex12V = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG12V, systemPartFamilyMighty13P = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG13P, systemPartFamilyMighty13B = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG13B, systemPartFamilyMighty13V = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG13V, systemPartFamilyBlue13P = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG13P, systemPartFamilyBlue13B = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG13B, systemPartFamilyBlue13V = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG13V, systemPartFamilyFlex13P = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG13P, systemPartFamilyFlex13B = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG13B, systemPartFamilyFlex13V = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG13V, systemPartFamilyMighty14P = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG14P, systemPartFamilyMighty14B = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG14B, systemPartFamilyMighty14V = _DEVINFO_PART_DEVICE_FAMILY_EFR32MG14V, systemPartFamilyBlue14P = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG14P, systemPartFamilyBlue14B = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG14B, systemPartFamilyBlue14V = _DEVINFO_PART_DEVICE_FAMILY_EFR32BG14V, systemPartFamilyFlex14P = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG14P, systemPartFamilyFlex14B = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG14B, systemPartFamilyFlex14V = _DEVINFO_PART_DEVICE_FAMILY_EFR32FG14V, systemPartFamilyGecko = _DEVINFO_PART_DEVICE_FAMILY_G, systemPartFamilyGiant = _DEVINFO_PART_DEVICE_FAMILY_GG, systemPartFamilyTiny = _DEVINFO_PART_DEVICE_FAMILY_TG, systemPartFamilyLeopard = _DEVINFO_PART_DEVICE_FAMILY_LG, systemPartFamilyWonder = _DEVINFO_PART_DEVICE_FAMILY_WG, systemPartFamilyZero = _DEVINFO_PART_DEVICE_FAMILY_ZG, systemPartFamilyHappy = _DEVINFO_PART_DEVICE_FAMILY_HG, systemPartFamilyUnknown = 0xFF } |
Functions | |
void | SYSTEM_ChipRevisionGet (SYSTEM_ChipRevision_TypeDef *rev) |
Get chip major/minor revision. | |
__STATIC_INLINE void | SYSTEM_FpuAccessModeSet (SYSTEM_FpuAccess_TypeDef accessMode) |
Set floating point coprocessor (FPU) access mode. | |
__STATIC_INLINE uint8_t | SYSTEM_GetCalibrationTemperature (void) |
Get the calibration temperature (in degrees Celsius). | |
bool | SYSTEM_GetCalibrationValue (volatile uint32_t *regAddress) |
Get factory calibration value for a given peripheral register. | |
__STATIC_INLINE uint8_t | SYSTEM_GetDevinfoRev (void) |
Get DEVINFO revision. | |
__STATIC_INLINE SYSTEM_PartFamily_TypeDef | SYSTEM_GetFamily (void) |
Get family identifier of the MCU. | |
__STATIC_INLINE uint32_t | SYSTEM_GetFlashPageSize (void) |
Get the flash page size in bytes. | |
__STATIC_INLINE uint16_t | SYSTEM_GetFlashSize (void) |
Get the flash size (in KB). | |
__STATIC_INLINE uint16_t | SYSTEM_GetPartNumber (void) |
Get part number of the MCU. | |
__STATIC_INLINE uint8_t | SYSTEM_GetProdRev (void) |
Get the production revision for this part. | |
__STATIC_INLINE uint16_t | SYSTEM_GetSRAMSize (void) |
Get the SRAM size (in KB). | |
__STATIC_INLINE uint64_t | SYSTEM_GetUnique (void) |
Get the unique number for this device. | |
Enumeration Type Documentation
Floating point coprocessor access modes.
Definition at line 266
of file em_system.h
.
Family identifiers.
Definition at line 64
of file em_system.h
.
Function Documentation
void SYSTEM_ChipRevisionGet | ( | SYSTEM_ChipRevision_TypeDef * | rev | ) |
Get chip major/minor revision.
- Parameters
-
[out] rev
Location to place chip revision info.
Definition at line 58
of file em_system.c
.
References _ROMTABLE_PID0_FAMILYLSB_MASK, _ROMTABLE_PID0_FAMILYLSB_SHIFT, _ROMTABLE_PID0_REVMAJOR_MASK, _ROMTABLE_PID0_REVMAJOR_SHIFT, _ROMTABLE_PID1_FAMILYMSB_MASK, _ROMTABLE_PID1_FAMILYMSB_SHIFT, _ROMTABLE_PID2_REVMINORMSB_MASK, _ROMTABLE_PID2_REVMINORMSB_SHIFT, _ROMTABLE_PID3_REVMINORLSB_MASK, _ROMTABLE_PID3_REVMINORLSB_SHIFT, SYSTEM_ChipRevision_TypeDef::family, SYSTEM_ChipRevision_TypeDef::major, SYSTEM_ChipRevision_TypeDef::minor, and ROMTABLE.
Referenced by CHIP_Init(), and errataInit().
__STATIC_INLINE void SYSTEM_FpuAccessModeSet | ( | SYSTEM_FpuAccess_TypeDef | accessMode | ) |
Set floating point coprocessor (FPU) access mode.
- Parameters
-
[in] accessMode
Floating point coprocessor access mode. See SYSTEM_FpuAccess_TypeDef for details.
Definition at line 297
of file em_system.h
.
__STATIC_INLINE uint8_t SYSTEM_GetCalibrationTemperature | ( | void |
| ) |
Get the calibration temperature (in degrees Celsius).
- Returns
- The calibration temperature in Celsius.
Definition at line 480
of file em_system.h
.
References _DEVINFO_CAL_TEMP_MASK, _DEVINFO_CAL_TEMP_SHIFT, and DEVINFO.
bool SYSTEM_GetCalibrationValue | ( | volatile uint32_t * | regAddress | ) |
Get factory calibration value for a given peripheral register.
- Parameters
-
[in] regAddress
Peripheral calibration register address to get calibration value for. If a calibration value is found then this register is updated with the calibration value.
- Returns
- True if a calibration value exists, false otherwise.
Definition at line 97
of file em_system.c
.
References SYSTEM_CalAddrVal_TypeDef::address, SYSTEM_CalAddrVal_TypeDef::calValue, and DEVINFO_BASE.
__STATIC_INLINE uint8_t SYSTEM_GetDevinfoRev | ( | void |
| ) |
Get DEVINFO revision.
- Returns
- Revision of the DEVINFO contents.
Definition at line 432
of file em_system.h
.
References _DEVINFO_DEVINFOREV_DEVINFOREV_MASK, _DEVINFO_DEVINFOREV_DEVINFOREV_SHIFT, and DEVINFO.
__STATIC_INLINE SYSTEM_PartFamily_TypeDef SYSTEM_GetFamily | ( | void |
| ) |
Get family identifier of the MCU.
- Note
- This function retrievs the family id by reading the chip's device info structure in flash memory. The user can retrieve the family id directly by reading the DEVINFO->PART item and decode with the mask and shift #defines defined in <part_family>_devinfo.h (please refer to code below for details).
- Returns
- The family identifier of the MCU.
Definition at line 466
of file em_system.h
.
References _DEVINFO_PART_DEVICE_FAMILY_MASK, _DEVINFO_PART_DEVICE_FAMILY_SHIFT, and DEVINFO.
__STATIC_INLINE uint32_t SYSTEM_GetFlashPageSize | ( | void |
| ) |
Get the flash page size in bytes.
- Note
- This function retrievs the correct value by reading the chip device info structure. If your binary is made for one specific device only, FLASH_PAGE_SIZE can be used instead.
- Returns
- The page size of the internal flash in bytes.
Definition at line 400
of file em_system.h
.
References _DEVINFO_MEMINFO_FLASH_PAGE_SIZE_MASK, _DEVINFO_MEMINFO_FLASH_PAGE_SIZE_SHIFT, DEVINFO, FLASH_PAGE_SIZE, and SYSTEM_GetProdRev().
Referenced by nvm3_halGetPageSize().
__STATIC_INLINE uint16_t SYSTEM_GetFlashSize | ( | void |
| ) |
Get the flash size (in KB).
- Note
- This function retrievs the correct value by reading the chip device info structure. If your binary is made for one specific device only, FLASH_SIZE can be used instead.
- Returns
- The size of the internal flash (in KB).
Definition at line 375
of file em_system.h
.
References _DEVINFO_MSIZE_FLASH_MASK, _DEVINFO_MSIZE_FLASH_SHIFT, _DEVINFO_MSIZE_SRAM_MASK, _DEVINFO_MSIZE_SRAM_SHIFT, DEVINFO, and SYSTEM_GetProdRev().
__STATIC_INLINE uint16_t SYSTEM_GetPartNumber | ( | void |
| ) |
Get part number of the MCU.
- Returns
- The part number of the MCU.
Definition at line 446
of file em_system.h
.
References _DEVINFO_PART_DEVICE_NUMBER_MASK, _DEVINFO_PART_DEVICE_NUMBER_SHIFT, and DEVINFO.
__STATIC_INLINE uint8_t SYSTEM_GetProdRev | ( | void |
| ) |
Get the production revision for this part.
- Returns
- Production revision for this part.
Definition at line 323
of file em_system.h
.
References _DEVINFO_PART_PROD_REV_MASK, _DEVINFO_PART_PROD_REV_SHIFT, and DEVINFO.
Referenced by CHIP_Init(), SYSTEM_GetFlashPageSize(), SYSTEM_GetFlashSize(), and SYSTEM_GetSRAMSize().
__STATIC_INLINE uint16_t SYSTEM_GetSRAMSize | ( | void |
| ) |
Get the SRAM size (in KB).
- Note
- This function retrievs the correct value by reading the chip device info structure. If your binary is made for one specific device only, SRAM_SIZE can be used instead.
- Returns
- The size of the internal SRAM (in KB).
Definition at line 341
of file em_system.h
.
References _DEVINFO_MSIZE_FLASH_MASK, _DEVINFO_MSIZE_FLASH_SHIFT, _DEVINFO_MSIZE_SRAM_MASK, _DEVINFO_MSIZE_SRAM_SHIFT, DEVINFO, and SYSTEM_GetProdRev().
__STATIC_INLINE uint64_t SYSTEM_GetUnique | ( | void |
| ) |
Get the unique number for this device.
- Returns
- Unique number for this device.
Definition at line 310
of file em_system.h
.
References DEVINFO.