Skip to content

Commit 1a8c460

Browse files
committed
Update to Gecko SDK 5.1.2
Updating emlib
1 parent 0e09867 commit 1a8c460

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+6243
-1271
lines changed

targets/TARGET_Silicon_Labs/TARGET_EFM32/emlib/Changes_emlib.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,45 @@
11
================ Revision history ============================================
2+
5.1.2:
3+
Misc. bugfixes and improvements.
4+
5+
5.1.1:
6+
- Enabled errata CMU_E113 workaround for EFM32GG revE.
7+
8+
5.1.0:
9+
- em_timer: Added support for WTIMER0 and WTIMER1. Added EFM_ASSERT in
10+
em_timer to check that operations on a 16 bit timer is always <= 0xFFFF.
11+
- em_usart: Updated the baudrate sync calculation in USART_BaudrateSyncSet().
12+
The calculated baudrate is not using any fractional bits and it is always
13+
lower than or equal to the specified frequency.
14+
- em_emu: added function EMU_DCDCConductionModeSet() to allow switching
15+
between DCDC Low-Noise Continuous Conduction Mode (CCM) and
16+
Discontinuous Conduction Mode (DCM).
17+
- SYSTEM_GetSRAMSize() updated to return size of SRAM excluding RAMH for EFR32xG1.
18+
- em_csen: Added support for CSEN (Capacitive Sense Module).
19+
- em_adc: updated ADC_PosSel_TypeDef enum names.
20+
- em_vdac: Added support for VDAC (voltage DAC).
21+
- em_smu: Added support for SMU (Security Management Unit) module.
22+
SMU is used to restrict access to device peripherals.
23+
- Updated emlib to use the _SILICON_LABS_32B_SERIES_x,
24+
_SILICON_LABS_32B_SERIES_x_CONFIG and _SILICON_LABS_GECKO_INTERNAL_SDID_x
25+
macros instead of the _SILICON_LABS_32B_PLATFORM_x and
26+
_SILICON_LABS_32B_PLATFORM_x_GEN_x macros.
27+
- em_rtcc: added workarounds for errata RTCC_E203 and RTCC_E204 for
28+
EFR32xG12, EFM32xG12, EFR32xG13 and EFM32xG13 devices.
29+
- em_lesense: added LESENSE_DecoderPrsOut() for configuring PRS output
30+
from the LESENSE decoder on EFM32xG12 and EFR32xG12.
31+
- em_lesense: added support for the new evaluation modes for EFM32xG12 and
32+
EFR32xG12.
33+
- em_emu: added EMU_RamPowerDown() function for powering down a memory range
34+
and deprecating EMU_MemPwrDown().
35+
- em_emu: added support for voltage scaling.
36+
- em_emu: added support for EM2 and 3 peripheral retention control.
37+
- em_chip: added current consumption fixes for EFM32xG12 and EFR32xG12.
38+
- em_emu: added support for DCDC EM01-LP mode.
39+
- em_lesense: Support for Series 1 devices
40+
- em_acmp: Added ACMP_ExternalInputSelect() which is used when the ACMP is
41+
controlled by an external module like LESENSE.
42+
243
5.0.0:
344
- em_core: New module, contains API for enabling/disabling interrupts
445
and implementing critical regions.

targets/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_acmp.h

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***************************************************************************//**
22
* @file em_acmp.h
33
* @brief Analog Comparator (ACMP) peripheral API
4-
* @version 5.0.0
4+
* @version 5.1.2
55
*******************************************************************************
66
* @section License
77
* <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>
@@ -283,7 +283,7 @@ typedef enum
283283
} ACMP_VLPInput_Typedef;
284284
#endif
285285

286-
#if defined(_SILICON_LABS_32B_PLATFORM_2)
286+
#if defined(_ACMP_INPUTSEL_POSSEL_APORT0XCH0)
287287
/** ACMP Input Selection */
288288
typedef enum
289289
{
@@ -447,8 +447,12 @@ typedef enum
447447
acmpInputAPORT4YCH14 = _ACMP_INPUTSEL_POSSEL_APORT4YCH14,
448448
acmpInputAPORT4XCH15 = _ACMP_INPUTSEL_POSSEL_APORT4XCH15,
449449
acmpInputAPORT4XCH31 = _ACMP_INPUTSEL_POSSEL_APORT4XCH31,
450+
#if defined(_ACMP_INPUTSEL_POSSEL_DACOUT0)
450451
acmpInputDACOUT0 = _ACMP_INPUTSEL_POSSEL_DACOUT0,
452+
#endif
453+
#if defined(_ACMP_INPUTSEL_POSSEL_DACOUT1)
451454
acmpInputDACOUT1 = _ACMP_INPUTSEL_POSSEL_DACOUT1,
455+
#endif
452456
acmpInputVLP = _ACMP_INPUTSEL_POSSEL_VLP,
453457
acmpInputVBDIV = _ACMP_INPUTSEL_POSSEL_VBDIV,
454458
acmpInputVADIV = _ACMP_INPUTSEL_POSSEL_VADIV,
@@ -500,6 +504,31 @@ typedef enum
500504
} ACMP_Channel_TypeDef;
501505
#endif
502506

507+
#if defined(_ACMP_EXTIFCTRL_MASK)
508+
/**
509+
* ACMP External input select. This type is used to select which APORT that is
510+
* used by an external module like LESENSE when it's taking control over
511+
* the ACMP input.
512+
*/
513+
typedef enum
514+
{
515+
acmpExternalInputAPORT0X = _ACMP_EXTIFCTRL_APORTSEL_APORT0X,
516+
acmpExternalInputAPORT0Y = _ACMP_EXTIFCTRL_APORTSEL_APORT0Y,
517+
acmpExternalInputAPORT1X = _ACMP_EXTIFCTRL_APORTSEL_APORT1X,
518+
acmpExternalInputAPORT1Y = _ACMP_EXTIFCTRL_APORTSEL_APORT1Y,
519+
acmpExternalInputAPORT1XY = _ACMP_EXTIFCTRL_APORTSEL_APORT1XY,
520+
acmpExternalInputAPORT2X = _ACMP_EXTIFCTRL_APORTSEL_APORT2X,
521+
acmpExternalInputAPORT2Y = _ACMP_EXTIFCTRL_APORTSEL_APORT2Y,
522+
acmpExternalInputAPORT2YX = _ACMP_EXTIFCTRL_APORTSEL_APORT2YX,
523+
acmpExternalInputAPORT3X = _ACMP_EXTIFCTRL_APORTSEL_APORT3X,
524+
acmpExternalInputAPORT3Y = _ACMP_EXTIFCTRL_APORTSEL_APORT3Y,
525+
acmpExternalInputAPORT3XY = _ACMP_EXTIFCTRL_APORTSEL_APORT3XY,
526+
acmpExternalInputAPORT4X = _ACMP_EXTIFCTRL_APORTSEL_APORT4X,
527+
acmpExternalInputAPORT4Y = _ACMP_EXTIFCTRL_APORTSEL_APORT4Y,
528+
acmpExternalInputAPORT4YX = _ACMP_EXTIFCTRL_APORTSEL_APORT4YX,
529+
} ACMP_ExternalInput_Typedef;
530+
#endif
531+
503532
/*******************************************************************************
504533
****************************** STRUCTS ************************************
505534
******************************************************************************/
@@ -824,6 +853,9 @@ void ACMP_CapsenseChannelSet(ACMP_TypeDef *acmp, ACMP_Channel_TypeDef channel);
824853
void ACMP_ChannelSet(ACMP_TypeDef *acmp, ACMP_Channel_TypeDef negSel, ACMP_Channel_TypeDef posSel);
825854
void ACMP_Disable(ACMP_TypeDef *acmp);
826855
void ACMP_Enable(ACMP_TypeDef *acmp);
856+
#if defined(_ACMP_EXTIFCTRL_MASK)
857+
void ACMP_ExternalInputSelect(ACMP_TypeDef *acmp, ACMP_ExternalInput_Typedef aport);
858+
#endif
827859
void ACMP_GPIOSetup(ACMP_TypeDef *acmp, uint32_t location, bool enable, bool invert);
828860
void ACMP_Init(ACMP_TypeDef *acmp, const ACMP_Init_TypeDef *init);
829861
void ACMP_Reset(ACMP_TypeDef *acmp);

targets/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_adc.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***************************************************************************//**
22
* @file em_adc.h
33
* @brief Analog to Digital Converter (ADC) peripheral API
4-
* @version 5.0.0
4+
* @version 5.1.2
55
*******************************************************************************
66
* @section License
77
* <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>
@@ -494,25 +494,26 @@ typedef enum
494494
adcPosSelAPORT4YCH30 = _ADC_SINGLECTRL_POSSEL_APORT4YCH30,
495495
adcPosSelAPORT4XCH31 = _ADC_SINGLECTRL_POSSEL_APORT4XCH31,
496496
adcPosSelAVDD = _ADC_SINGLECTRL_POSSEL_AVDD,
497-
adcPosSelBU = _ADC_SINGLECTRL_POSSEL_BU,
498-
adcPosSelAREG = _ADC_SINGLECTRL_POSSEL_AREG,
499-
adcPosSelVREGOUTPA = _ADC_SINGLECTRL_POSSEL_VREGOUTPA,
500-
adcPosSelPDBU = _ADC_SINGLECTRL_POSSEL_PDBU,
501-
adcPosSelIO0 = _ADC_SINGLECTRL_POSSEL_IO0,
502-
adcPosSelIO1 = _ADC_SINGLECTRL_POSSEL_IO1,
503-
adcPosSelVSP = _ADC_SINGLECTRL_POSSEL_VSP,
497+
adcPosSelDVDD = _ADC_SINGLECTRL_POSSEL_AREG,
498+
adcPosSelPAVDD = _ADC_SINGLECTRL_POSSEL_VREGOUTPA,
499+
adcPosSelDECOUPLE = _ADC_SINGLECTRL_POSSEL_PDBU,
500+
adcPosSelIOVDD = _ADC_SINGLECTRL_POSSEL_IO0,
504501
adcPosSelOPA2 = _ADC_SINGLECTRL_POSSEL_OPA2,
505502
adcPosSelOPA3 = _ADC_SINGLECTRL_POSSEL_OPA3,
506503
adcPosSelTEMP = _ADC_SINGLECTRL_POSSEL_TEMP,
507504
adcPosSelDAC0OUT0 = _ADC_SINGLECTRL_POSSEL_DAC0OUT0,
508-
adcPosSelTESTP = _ADC_SINGLECTRL_POSSEL_TESTP,
509-
adcPosSelSP1 = _ADC_SINGLECTRL_POSSEL_SP1,
510-
adcPosSelSP2 = _ADC_SINGLECTRL_POSSEL_SP2,
511505
adcPosSelDAC0OUT1 = _ADC_SINGLECTRL_POSSEL_DAC0OUT1,
512506
adcPosSelSUBLSB = _ADC_SINGLECTRL_POSSEL_SUBLSB,
513507
adcPosSelDEFAULT = _ADC_SINGLECTRL_POSSEL_DEFAULT,
514508
adcPosSelVSS = _ADC_SINGLECTRL_POSSEL_VSS
515509
} ADC_PosSel_TypeDef;
510+
511+
/* Map legacy or incorrectly named select enums to correct enums. */
512+
#define adcPosSelIO0 adcPosSelIOVDD
513+
#define adcPosSelVREGOUTPA adcPosSelPAVDD
514+
#define adcPosSelAREG adcPosSelDVDD
515+
#define adcPosSelPDBU adcPosSelDECOUPLE
516+
516517
#endif
517518

518519

targets/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_aes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***************************************************************************//**
22
* @file em_aes.h
33
* @brief Advanced encryption standard (AES) accelerator peripheral API.
4-
* @version 5.0.0
4+
* @version 5.1.2
55
*******************************************************************************
66
* @section License
77
* <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>

targets/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_assert.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***************************************************************************//**
22
* @file em_assert.h
33
* @brief Emlib peripheral API "assert" implementation.
4-
* @version 5.0.0
4+
* @version 5.1.2
55
*******************************************************************************
66
* @section License
77
* <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>

targets/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_burtc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***************************************************************************//**
22
* @file em_burtc.h
33
* @brief Backup Real Time Counter (BURTC) peripheral API
4-
* @version 5.0.0
4+
* @version 5.1.2
55
*******************************************************************************
66
* @section License
77
* <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>

targets/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_bus.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***************************************************************************//**
22
* @file em_bus.h
33
* @brief RAM and peripheral bit-field set and clear API
4-
* @version 5.0.0
4+
* @version 5.1.2
55
*******************************************************************************
66
* @section License
77
* <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>
@@ -30,8 +30,8 @@
3030
*
3131
******************************************************************************/
3232

33-
#ifndef EM_BUS__
34-
#define EM_BUS__
33+
#ifndef EM_BUS_H
34+
#define EM_BUS_H
3535

3636
#include "em_device.h"
3737

@@ -46,9 +46,9 @@ extern "C" {
4646

4747
/***************************************************************************//**
4848
* @addtogroup BUS
49-
* @brief BUS RAM and register bit/field read/write API
49+
* @brief BUS register and RAM bit/field read/write API
5050
* @details
51-
* API to perform bitbanded and masked accesses to SRAM and peripheral memory.
51+
* API to perform bit-band and field set/clear access to RAM and peripherals.
5252
* @{
5353
******************************************************************************/
5454

@@ -280,7 +280,10 @@ __STATIC_INLINE void BUS_RegMaskedClear(volatile uint32_t *addr,
280280
* @param[in] mask Peripheral register mask
281281
*
282282
* @param[in] val Peripheral register value. The value must be shifted to the
283-
correct bit position in the register.
283+
correct bit position in the register corresponding to the field
284+
defined by the mask parameter. The register value must be
285+
contained in the field defined by the mask parameter. This
286+
function is not performing masking of val internally.
284287
******************************************************************************/
285288
__STATIC_INLINE void BUS_RegMaskedWrite(volatile uint32_t *addr,
286289
uint32_t mask,
@@ -326,4 +329,4 @@ __STATIC_INLINE uint32_t BUS_RegMaskedRead(volatile const uint32_t *addr,
326329
}
327330
#endif
328331

329-
#endif /* EM_BUS__ */
332+
#endif /* EM_BUS_H */

targets/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_chip.h

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***************************************************************************//**
22
* @file em_chip.h
33
* @brief Chip Initialization API
4-
* @version 5.0.0
4+
* @version 5.1.2
55
*******************************************************************************
66
* @section License
77
* <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>
@@ -49,7 +49,7 @@ extern "C" {
4949

5050
/***************************************************************************//**
5151
* @addtogroup CHIP
52-
* @brief Chip Initialization API
52+
* @brief Chip errata workarounds initialization API
5353
* @details
5454
* API to initialize chip for errata workarounds.
5555
* @{
@@ -69,7 +69,7 @@ extern "C" {
6969
*****************************************************************************/
7070
__STATIC_INLINE void CHIP_Init(void)
7171
{
72-
#if defined(_EFM32_GECKO_FAMILY)
72+
#if defined(_SILICON_LABS_32B_SERIES_0) && defined(_EFM32_GECKO_FAMILY)
7373
uint32_t rev;
7474
SYSTEM_ChipRevision_TypeDef chipRev;
7575
volatile uint32_t *reg;
@@ -161,26 +161,31 @@ __STATIC_INLINE void CHIP_Init(void)
161161
}
162162
#endif
163163

164-
#if defined(_EFM32_GIANT_FAMILY)
165-
uint32_t rev;
164+
#if defined(_SILICON_LABS_32B_SERIES_0) && defined(_EFM32_GIANT_FAMILY)
165+
166+
/****************************/
167+
/* Fix for errata CMU_E113. */
168+
169+
uint8_t prodRev;
166170
SYSTEM_ChipRevision_TypeDef chipRev;
167171

168-
rev = *(volatile uint32_t *)(0x0FE081FC);
172+
prodRev = SYSTEM_GetProdRev();
169173
SYSTEM_ChipRevisionGet(&chipRev);
170174

171-
if (((rev >> 24) > 15) && (chipRev.minor == 3))
175+
if ((prodRev >= 16) && (chipRev.minor >= 3))
172176
{
173177
/* This fixes an issue with the LFXO on high temperatures. */
174178
*(volatile uint32_t*)0x400C80C0 =
175-
( *(volatile uint32_t*)0x400C80C0 & ~(1<<6) ) | (1<<4);
179+
( *(volatile uint32_t*)0x400C80C0 & ~(1 << 6) ) | (1 << 4);
176180
}
177181
#endif
178182

179-
#if defined(_EFM32_HAPPY_FAMILY)
180-
uint32_t rev;
181-
rev = *(volatile uint32_t *)(0x0FE081FC);
183+
#if defined(_SILICON_LABS_32B_SERIES_0) && defined(_EFM32_HAPPY_FAMILY)
184+
185+
uint8_t prodRev;
186+
prodRev = SYSTEM_GetProdRev();
182187

183-
if ((rev >> 24) <= 129)
188+
if (prodRev <= 129)
184189
{
185190
/* This fixes a mistaken internal connection between PC0 and PC4 */
186191
/* This disables an internal pulldown on PC4 */
@@ -190,7 +195,7 @@ __STATIC_INLINE void CHIP_Init(void)
190195
}
191196
#endif
192197

193-
#if defined(_SILICON_LABS_32B_PLATFORM_2_GEN_1)
198+
#if defined(_SILICON_LABS_GECKO_INTERNAL_SDID_80)
194199

195200
/****************************
196201
* Fixes for errata GPIO_E201 (slewrate) and
@@ -244,11 +249,33 @@ __STATIC_INLINE void CHIP_Init(void)
244249
}
245250
#endif
246251

247-
#if defined(_SILICON_LABS_32B_PLATFORM_2_GEN_2)
252+
#if defined(_SILICON_LABS_GECKO_INTERNAL_SDID_84)
248253

249-
/* No fixes required. */
254+
uint8_t prodRev = SYSTEM_GetProdRev();
250255

256+
/* EM2 current fixes for early samples */
257+
if (prodRev == 0)
258+
{
259+
*(volatile uint32_t *)(EMU_BASE + 0x190) = 0x0000ADE8UL;
260+
*(volatile uint32_t *)(EMU_BASE + 0x198) |= (0x1 << 2);
261+
*(volatile uint32_t *)(EMU_BASE + 0x190) = 0x0;
262+
}
263+
if (prodRev < 2)
264+
{
265+
*(volatile uint32_t *)(EMU_BASE + 0x164) |= (0x1 << 13);
266+
}
267+
268+
/* Set optimal LFRCOCTRL VREFUPDATE and enable duty cycling of vref */
269+
CMU->LFRCOCTRL = (CMU->LFRCOCTRL & ~_CMU_LFRCOCTRL_VREFUPDATE_MASK)
270+
| CMU_LFRCOCTRL_VREFUPDATE_64CYCLES
271+
| CMU_LFRCOCTRL_ENVREF;
251272
#endif
273+
274+
#if defined(_EFR_DEVICE) && (_SILICON_LABS_GECKO_INTERNAL_SDID >= 84)
275+
MSC->CTRL |= 0x1 << 8;
276+
#endif
277+
278+
252279
}
253280

254281
/** @} (end addtogroup CHIP) */

0 commit comments

Comments
 (0)