Skip to content

Commit c9c6428

Browse files
authored
Merge pull request #3122 from SiliconLabs/SiliconLabs-cleanup-rebase
[Silicon Labs] Update of Silicon Labs HAL
2 parents 4198222 + 8b36d9c commit c9c6428

File tree

706 files changed

+467018
-26741
lines changed

Some content is hidden

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

706 files changed

+467018
-26741
lines changed

Diff for: cmsis/core_cm0.h

+8
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@
197197
#define __O volatile /*!< Defines 'write only' permissions */
198198
#define __IO volatile /*!< Defines 'read / write' permissions */
199199

200+
#ifdef __cplusplus
201+
#define __IM volatile /*!< Defines 'read only' permissions */
202+
#else
203+
#define __IM volatile const /*!< Defines 'read only' permissions */
204+
#endif
205+
#define __OM volatile /*!< Defines 'write only' permissions */
206+
#define __IOM volatile /*!< Defines 'read / write' permissions */
207+
200208
/*@} end of group Cortex_M0 */
201209

202210

Diff for: cmsis/core_cm0plus.h

+8
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@
207207
#define __O volatile /*!< Defines 'write only' permissions */
208208
#define __IO volatile /*!< Defines 'read / write' permissions */
209209

210+
#ifdef __cplusplus
211+
#define __IM volatile /*!< Defines 'read only' permissions */
212+
#else
213+
#define __IM volatile const /*!< Defines 'read only' permissions */
214+
#endif
215+
#define __OM volatile /*!< Defines 'write only' permissions */
216+
#define __IOM volatile /*!< Defines 'read / write' permissions */
217+
210218
/*@} end of group Cortex-M0+ */
211219

212220

Diff for: cmsis/core_cm3.h

+8
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,14 @@
202202
#define __O volatile /*!< Defines 'write only' permissions */
203203
#define __IO volatile /*!< Defines 'read / write' permissions */
204204

205+
#ifdef __cplusplus
206+
#define __IM volatile /*!< Defines 'read only' permissions */
207+
#else
208+
#define __IM volatile const /*!< Defines 'read only' permissions */
209+
#endif
210+
#define __OM volatile /*!< Defines 'write only' permissions */
211+
#define __IOM volatile /*!< Defines 'read / write' permissions */
212+
205213
/*@} end of group Cortex_M3 */
206214

207215

Diff for: cmsis/core_cm4.h

+8
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,14 @@
248248
#define __O volatile /*!< Defines 'write only' permissions */
249249
#define __IO volatile /*!< Defines 'read / write' permissions */
250250

251+
#ifdef __cplusplus
252+
#define __IM volatile /*!< Defines 'read only' permissions */
253+
#else
254+
#define __IM volatile const /*!< Defines 'read only' permissions */
255+
#endif
256+
#define __OM volatile /*!< Defines 'write only' permissions */
257+
#define __IOM volatile /*!< Defines 'read / write' permissions */
258+
251259
/*@} end of group Cortex_M4 */
252260

253261

Diff for: cmsis/core_cm7.h

+8
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,14 @@
263263
#define __O volatile /*!< Defines 'write only' permissions */
264264
#define __IO volatile /*!< Defines 'read / write' permissions */
265265

266+
#ifdef __cplusplus
267+
#define __IM volatile /*!< Defines 'read only' permissions */
268+
#else
269+
#define __IM volatile const /*!< Defines 'read only' permissions */
270+
#endif
271+
#define __OM volatile /*!< Defines 'write only' permissions */
272+
#define __IOM volatile /*!< Defines 'read / write' permissions */
273+
266274
/*@} end of group Cortex_M7 */
267275

268276

Diff for: features/unsupported/USBDevice/USBDevice/TARGET_Silicon_Labs/inc/em_usb.h

+12
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@
3333
#include <string.h>
3434
#include <stddef.h>
3535
#include "em_common.h"
36+
/* Workaround for em_common naming change so that we don't need to rework the
37+
entire USB HAL */
38+
#define EFM32_PACK_START(x) SL_PACK_START(x)
39+
#define EFM32_PACK_END() SL_PACK_END()
40+
#define EFM32_MIN(a, b) SL_MIN(a, b)
41+
#define EFM32_MAX(a, b) SL_MAX(a, b)
42+
#define EFM32_ATTRIBUTE_PACKED SL_ATTRIBUTE_PACKED
43+
#define EFM32_ATTRIBUTE_ALIGN(X) SL_ATTRIBUTE_ALIGN(X)
44+
#define EFM32_ALIGN(X) SL_ALIGN(X)
45+
#define EFM32_WEAK SL_WEAK
46+
#define EFM32_ATTRIBUTE_SECTION(X) SL_ATTRIBUTE_SECTION(X)
47+
3648
#include "em_int.h"
3749

3850
#if defined( USB_USE_PRINTF )

Diff for: targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/PeripheralNames.h renamed to targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/PeripheralNames.h

-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ typedef enum {
6060
LEUART_1 = LEUART1_BASE
6161
} UARTName;
6262

63-
#define STDIO_UART_TX USBTX
64-
#define STDIO_UART_RX USBRX
65-
#define STDIO_UART UART0
66-
6763
typedef enum {
6864
SPI_0 = USART0_BASE,
6965
SPI_1 = USART1_BASE,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/***************************************************************************//**
2+
* @file PinNames.h
3+
*******************************************************************************
4+
* @section License
5+
* <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
6+
*******************************************************************************
7+
*
8+
* SPDX-License-Identifier: Apache-2.0
9+
*
10+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
11+
* not use this file except in compliance with the License.
12+
* You may obtain a copy of the License at
13+
*
14+
* http://www.apache.org/licenses/LICENSE-2.0
15+
*
16+
* Unless required by applicable law or agreed to in writing, software
17+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
* See the License for the specific language governing permissions and
20+
* limitations under the License.
21+
*
22+
******************************************************************************/
23+
#ifndef MBED_PINNAMES_H
24+
#define MBED_PINNAMES_H
25+
26+
#include "CommonPinNames.h"
27+
28+
#ifdef __cplusplus
29+
extern "C" {
30+
#endif
31+
32+
typedef enum {
33+
EFM32_STANDARD_PIN_DEFINITIONS,
34+
35+
/* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */
36+
LED0 = PE2,
37+
LED1 = PE3,
38+
LED2 = LED0,
39+
LED3 = LED0,
40+
LED4 = LED1,
41+
42+
/* Push Buttons */
43+
SW0 = PB9,
44+
SW1 = PB10,
45+
BTN0 = SW0,
46+
BTN1 = SW1,
47+
48+
/* Serial */
49+
SERIAL_TX = PD0,
50+
SERIAL_RX = PD1,
51+
USBTX = PE0,
52+
USBRX = PE1,
53+
54+
/* Board Controller */
55+
STDIO_UART_TX = USBTX,
56+
STDIO_UART_RX = USBRX,
57+
EFM_BC_EN = PF7
58+
} PinName;
59+
60+
#ifdef __cplusplus
61+
}
62+
#endif
63+
64+
#endif
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************//**
2-
* @file device.h
2+
* @file device_peripherals.h
33
*******************************************************************************
44
* @section License
55
* <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
@@ -20,30 +20,20 @@
2020
* limitations under the License.
2121
*
2222
******************************************************************************/
23-
#ifndef MBED_DEVICE_H
24-
#define MBED_DEVICE_H
23+
#ifndef MBED_DEVICE_PERIPHERALS_H
24+
#define MBED_DEVICE_PERIPHERALS_H
2525

26+
/* us ticker */
27+
#define US_TICKER_TIMER TIMER0
28+
#define US_TICKER_TIMER_CLOCK cmuClock_TIMER0
29+
#define US_TICKER_TIMER_IRQ TIMER0_IRQn
2630

31+
/* PWM */
32+
#define PWM_TIMER TIMER2
33+
#define PWM_TIMER_CLOCK cmuClock_TIMER2
34+
#define PWM_ROUTE TIMER_ROUTE_LOCATION_LOC1
2735

28-
29-
30-
31-
32-
33-
34-
35-
36-
37-
38-
39-
40-
// Redefine OPEN_MAX from sys_limits.h to save on RAM.
41-
// Effect: maximum amount of file handlers = OPEN_MAX
42-
// This is not going to have an impact, since this is a RAM-limited part anyway.
43-
#define OPEN_MAX 24
44-
45-
#include "objects.h"
46-
#include "Modules.h"
47-
#include "device_peripherals.h"
36+
/* USB */
37+
#define USB_TIMER USB_TIMER1
4838

4939
#endif

0 commit comments

Comments
 (0)