Skip to content

[Silicon Labs] Update of Silicon Labs HAL #3122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Oct 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions cmsis/core_cm0.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@
#define __O volatile /*!< Defines 'write only' permissions */
#define __IO volatile /*!< Defines 'read / write' permissions */

#ifdef __cplusplus
#define __IM volatile /*!< Defines 'read only' permissions */
#else
#define __IM volatile const /*!< Defines 'read only' permissions */
#endif
#define __OM volatile /*!< Defines 'write only' permissions */
#define __IOM volatile /*!< Defines 'read / write' permissions */

/*@} end of group Cortex_M0 */


Expand Down
8 changes: 8 additions & 0 deletions cmsis/core_cm0plus.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@
#define __O volatile /*!< Defines 'write only' permissions */
#define __IO volatile /*!< Defines 'read / write' permissions */

#ifdef __cplusplus
#define __IM volatile /*!< Defines 'read only' permissions */
#else
#define __IM volatile const /*!< Defines 'read only' permissions */
#endif
#define __OM volatile /*!< Defines 'write only' permissions */
#define __IOM volatile /*!< Defines 'read / write' permissions */

/*@} end of group Cortex-M0+ */


Expand Down
8 changes: 8 additions & 0 deletions cmsis/core_cm3.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@
#define __O volatile /*!< Defines 'write only' permissions */
#define __IO volatile /*!< Defines 'read / write' permissions */

#ifdef __cplusplus
#define __IM volatile /*!< Defines 'read only' permissions */
#else
#define __IM volatile const /*!< Defines 'read only' permissions */
#endif
#define __OM volatile /*!< Defines 'write only' permissions */
#define __IOM volatile /*!< Defines 'read / write' permissions */

/*@} end of group Cortex_M3 */


Expand Down
8 changes: 8 additions & 0 deletions cmsis/core_cm4.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@
#define __O volatile /*!< Defines 'write only' permissions */
#define __IO volatile /*!< Defines 'read / write' permissions */

#ifdef __cplusplus
#define __IM volatile /*!< Defines 'read only' permissions */
#else
#define __IM volatile const /*!< Defines 'read only' permissions */
#endif
#define __OM volatile /*!< Defines 'write only' permissions */
#define __IOM volatile /*!< Defines 'read / write' permissions */

/*@} end of group Cortex_M4 */


Expand Down
8 changes: 8 additions & 0 deletions cmsis/core_cm7.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@
#define __O volatile /*!< Defines 'write only' permissions */
#define __IO volatile /*!< Defines 'read / write' permissions */

#ifdef __cplusplus
#define __IM volatile /*!< Defines 'read only' permissions */
#else
#define __IM volatile const /*!< Defines 'read only' permissions */
#endif
#define __OM volatile /*!< Defines 'write only' permissions */
#define __IOM volatile /*!< Defines 'read / write' permissions */

/*@} end of group Cortex_M7 */


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
#include <string.h>
#include <stddef.h>
#include "em_common.h"
/* Workaround for em_common naming change so that we don't need to rework the
entire USB HAL */
#define EFM32_PACK_START(x) SL_PACK_START(x)
#define EFM32_PACK_END() SL_PACK_END()
#define EFM32_MIN(a, b) SL_MIN(a, b)
#define EFM32_MAX(a, b) SL_MAX(a, b)
#define EFM32_ATTRIBUTE_PACKED SL_ATTRIBUTE_PACKED
#define EFM32_ATTRIBUTE_ALIGN(X) SL_ATTRIBUTE_ALIGN(X)
#define EFM32_ALIGN(X) SL_ALIGN(X)
#define EFM32_WEAK SL_WEAK
#define EFM32_ATTRIBUTE_SECTION(X) SL_ATTRIBUTE_SECTION(X)

#include "em_int.h"

#if defined( USB_USE_PRINTF )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ typedef enum {
LEUART_1 = LEUART1_BASE
} UARTName;

#define STDIO_UART_TX USBTX
#define STDIO_UART_RX USBRX
#define STDIO_UART UART0

typedef enum {
SPI_0 = USART0_BASE,
SPI_1 = USART1_BASE,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/***************************************************************************//**
* @file PinNames.h
*******************************************************************************
* @section License
* <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
#ifndef MBED_PINNAMES_H
#define MBED_PINNAMES_H

#include "CommonPinNames.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
EFM32_STANDARD_PIN_DEFINITIONS,

/* Starter Kit says LED0 and LED1, but mbed expects 1 and 2. This way using 1 and 2 or 0 and 1 will work. */
LED0 = PE2,
LED1 = PE3,
LED2 = LED0,
LED3 = LED0,
LED4 = LED1,

/* Push Buttons */
SW0 = PB9,
SW1 = PB10,
BTN0 = SW0,
BTN1 = SW1,

/* Serial */
SERIAL_TX = PD0,
SERIAL_RX = PD1,
USBTX = PE0,
USBRX = PE1,

/* Board Controller */
STDIO_UART_TX = USBTX,
STDIO_UART_RX = USBRX,
EFM_BC_EN = PF7
} PinName;

#ifdef __cplusplus
}
#endif

#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************//**
* @file device.h
* @file device_peripherals.h
*******************************************************************************
* @section License
* <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
Expand All @@ -20,30 +20,20 @@
* limitations under the License.
*
******************************************************************************/
#ifndef MBED_DEVICE_H
#define MBED_DEVICE_H
#ifndef MBED_DEVICE_PERIPHERALS_H
#define MBED_DEVICE_PERIPHERALS_H

/* us ticker */
#define US_TICKER_TIMER TIMER0
#define US_TICKER_TIMER_CLOCK cmuClock_TIMER0
#define US_TICKER_TIMER_IRQ TIMER0_IRQn

/* PWM */
#define PWM_TIMER TIMER2
#define PWM_TIMER_CLOCK cmuClock_TIMER2
#define PWM_ROUTE TIMER_ROUTE_LOCATION_LOC1













// Redefine OPEN_MAX from sys_limits.h to save on RAM.
// Effect: maximum amount of file handlers = OPEN_MAX
// This is not going to have an impact, since this is a RAM-limited part anyway.
#define OPEN_MAX 24

#include "objects.h"
#include "Modules.h"
#include "device_peripherals.h"
/* USB */
#define USB_TIMER USB_TIMER1

#endif
Loading