Skip to content

Commit

Permalink
Merge PR RIOT-OS#9212 "drivers/rail: add efr32 radio driver"
Browse files Browse the repository at this point in the history
  • Loading branch information
kaibeckmann authored and benemorius committed Jul 10, 2020
1 parent c784c01 commit 9edaf96
Show file tree
Hide file tree
Showing 24 changed files with 3,191 additions and 1 deletion.
6 changes: 6 additions & 0 deletions boards/common/slwstk6000b/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ USEMODULE += boards_common_silabs
USEMODULE += silabs_aem
USEMODULE += silabs_bc

ifneq (,$(filter netdev_default,$(USEMODULE)))
ifeq (1,$(EFM32_RADIO))
USEMODULE += rail
endif
endif

# include board common dependencies
include $(RIOTBOARD)/common/silabs/Makefile.dep
15 changes: 15 additions & 0 deletions boards/ikea-tradfri/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

ifneq (,$(filter netdev_default,$(USEMODULE)))
USEMODULE += rail
endif

ifneq (,$(filter rail,$(USEMODULE)))
USEMODULE += gecko_sdk_emlib
USEMODULE += gecko_sdk_emlib_extra
endif

ifneq (,$(filter gecko_sdk_librail,$(USEMODULE)))
CFLAGS_FPU = -mfloat-abi=softfp -mfpu=fpv4-sp-d16
# Blacklisted for llvm because `CFLAGS_FPU` is used before its final value set here
TOOLCHAINS_BLACKLIST += llvm
endif
1 change: 1 addition & 0 deletions boards/ikea-tradfri/Makefile.features
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CPU = efm32
CPU_FAM = efr32mg1p
export EFM32_FAMILY = efr32mg1p
CPU_MODEL = efr32mg1p132f256gm32

# Put defined MCU peripherals here (in alphabetical order)
Expand Down
2 changes: 1 addition & 1 deletion boards/ikea-tradfri/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern "C" {
* @{
*/
#ifndef CLOCK_HF
#define CLOCK_HF cmuSelect_HFRCO
#define CLOCK_HF cmuSelect_HFXO
#endif
#ifndef CLOCK_CORE_DIV
#define CLOCK_CORE_DIV cmuClkDiv_1
Expand Down
67 changes: 67 additions & 0 deletions boards/ikea-tradfri/include/rail_radio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (C) 2018 Hochschule RheinMain
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @ingroup boards_ikea-tradfri
* @{
*
* @file
* @brief Board specific definitions for the radio transceiver of the
* Ikea Tradfi module
*
* @author Kai Beckmann <[email protected]>
**/

#ifndef RAIL_RADIO_H
#define RAIL_RADIO_H

#include "cpu.h"

#include "periph_conf.h"
#include "periph/gpio.h"
#include "periph/spi.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Select radio frequency
*
* ikea tradfri supports only 2.4 GHz
*/
#define RAIL_RADIO_BAND (2400)

/**
* @brief Setting for the radio PA voltage in mV
*
* voltage of the radio PA in mV
*
* The setting depends on the module.
*
* the tradfi modules embedded in lamps are
* connected to th external dc-dc, therefore 3.3V
*/
#define RAIL_RADIO_PA_VOLTAGE (3300)

/**
* @brief Packet Trace Interface
*
* The Tradfri doesn't support PTI,
* so don't enable it.
*/
#ifndef RAIL_PTI_ENABLED
#define RAIL_PTI_ENABLED (0)
#endif

#ifdef __cplusplus
}
#endif

#endif /* RAIL_RADIO_H */
/** @} */
4 changes: 4 additions & 0 deletions boards/sltb001a/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ endif
USEMODULE += boards_common_silabs
USEMODULE += silabs_pic

ifneq (,$(filter netdev_default,$(USEMODULE)))
USEMODULE += rail
endif

# include board common dependencies
include $(RIOTBOARD)/common/silabs/Makefile.dep
89 changes: 89 additions & 0 deletions boards/sltb001a/include/rail_radio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* Copyright (C) 2018 Hochschule RheinMain
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @ingroup boards_sltb001a
* @{
*
* @file
* @brief Board specific definitions for the radio transceiver of the
* SLTB001A starter kit
*
* @author Kai Beckmann <[email protected]>
**/

#ifndef RAIL_RADIO_H
#define RAIL_RADIO_H

#include "cpu.h"

#include "periph_conf.h"
#include "periph/gpio.h"
#include "periph/spi.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Select radio frequency
*
* the SLTB001A supports only 2.4 GHz
*/
#define RAIL_RADIO_BAND (2400)

/**
* @brief Setting for the radio PA voltage in mV
*
* voltage of the radio PA in mV
*
* The setting depends on the module.
*
* TODO what voltage has the SLTB001A?
*/
#define RAIL_RADIO_PA_VOLTAGE (1800)

/**
* @brief Packet Trace Interface
*
* To enable the PTI set vaule to 1.
* In RAIL_PTI_CONFIG the correct pins
* have to be configured
*
* Enable only for the SLTB001a if external debugger is
* used.
*/
#ifndef RAIL_PTI_ENABLED
#define RAIL_PTI_ENABLED (0)
#endif

/* c&p from gecko-sdk BSP for EFR32MG1_BRD4154A */
/* should work for sltb001a as well */
#if !defined(RAIL_PTI_CONFIG)
#define RAIL_PTI_CONFIG \
{ \
RAIL_PTI_MODE_UART, /* Only supported output mode for the WSTK*/ \
1600000, /* Choose 1.6 MHz for best the WSTK */ \
6, /* WSTK uses location 6 for DOUT PB12 */ \
gpioPortB, /* FRC_DOUT#6 is PB12 */ \
12, /* FRC_DOUT#6 is PB12 */ \
6, /* UNUSED IN UART MODE */ \
gpioPortB, /* UNUSED IN UART MODE */ \
11, /* UNUSED IN UART MODE */ \
6, /* WSTK uses location 6 for DFRAME */ \
gpioPortB, /* RC_DOUT#6 is PB13 */ \
13, /* RC_DOUT#6 is PB13 */ \
}
#endif

#ifdef __cplusplus
}
#endif

#endif /* RAIL_RADIO_H */
/** @} */
93 changes: 93 additions & 0 deletions boards/slwstk6000b-slwrb4150a/include/rail_radio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Copyright (C) 2017-2018 Hochschule RheinMain
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @defgroup boards_slwstk6000b Silicon Labs SLWSTK6000B starter kit
* @ingroup boards
* @brief Support for the Silicon Labs SLWRB4150a module
* @{
*
* @file
* @brief Board specific definitions for the radio transceicer of the
* SLWRB4150a module
*
* @author Kai Beckmann <[email protected]>
**/

#ifndef RAIL_RADIO_H
#define RAIL_RADIO_H

#include "cpu.h"

#include "periph_conf.h"
#include "periph/gpio.h"
#include "periph/spi.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Select radio frequency
*
* SLWRB4150a supports 2400, 868, 915
*
*/
#ifndef RAIL_RADIO_BAND
#define RAIL_RADIO_BAND (868)
#endif

/**
* @brief Setting for the radio PA voltage in mV
*
* voltage of the radio PA in mV
*
* The setting depends on the module.
*
* The silabs dev modules are connected to
* the internal dc/dc -> 1.8V
*/
#define RAIL_RADIO_PA_VOLTAGE (1800)

/**
* @brief Packet Trace Interface
*
* To enable the PTI set vaule to 1.
* In RAIL_PTI_CONFIG the correct pins
* have to be configured
*/
#ifndef RAIL_PTI_ENABLED
#define RAIL_PTI_ENABLED (0)
#endif

/**
* c&p from gecko-sdk BSP for EFR32MG1_BRD4154A
*/
#if !defined(RAIL_PTI_CONFIG)
#define RAIL_PTI_CONFIG \
{ \
RAIL_PTI_MODE_UART, /* Only supported output mode for the WSTK*/ \
1600000, /* Choose 1.6 MHz for best the WSTK */ \
6, /* WSTK uses location 6 for DOUT PB12 */ \
gpioPortB, /* FRC_DOUT#6 is PB12 */ \
12, /* FRC_DOUT#6 is PB12 */ \
6, /* UNUSED IN UART MODE */ \
gpioPortB, /* UNUSED IN UART MODE */ \
11, /* UNUSED IN UART MODE */ \
6, /* WSTK uses location 6 for DFRAME */ \
gpioPortB, /* RC_DOUT#6 is PB13 */ \
13, /* RC_DOUT#6 is PB13 */ \
}
#endif

#ifdef __cplusplus
}
#endif

#endif /* RAIL_RADIO_H */
/** @} */
90 changes: 90 additions & 0 deletions boards/slwstk6000b-slwrb4162a/include/rail_radio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
* Copyright (C) 2017-2018 Hochschule RheinMain
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @defgroup boards_slwstk6000b Silicon Labs SLWSTK6000B starter kit
* @ingroup boards
* @brief Support for the Silicon Labs SLWRB4162a module
* @{
*
* @file
* @brief Board specific definitions for the radio transceicer of the
* SLWRB4162a module
*
* @author Kai Beckmann <[email protected]>
**/

#ifndef RAIL_RADIO_H
#define RAIL_RADIO_H

#include "cpu.h"

#include "periph_conf.h"
#include "periph/gpio.h"
#include "periph/spi.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Select radio frequency
*
* SLWRB4162a supports only 2.4 GHz
*/
#define RAIL_RADIO_BAND (2400)

/**
* @brief Setting for the radio PA voltage in mV
*
* voltage of the radio PA in mV
*
* The setting depends on the module.
*
* The silabs dev modules are connected to
* the internal dc/dc -> 1.8V
*/
#define RAIL_RADIO_PA_VOLTAGE (1800)

/**
* @brief Packet Trace Interface
*
* To enable the PTI set vaule to 1.
* In RAIL_PTI_CONFIG the correct pins
* have to be configured
*/
#ifndef RAIL_PTI_ENABLED
#define RAIL_PTI_ENABLED (0)
#endif

/**
* c&p from gecko-sdk BSP for EFR32MG1_BRD4154A
*/
#if !defined(RAIL_PTI_CONFIG)
#define RAIL_PTI_CONFIG \
{ \
RAIL_PTI_MODE_UART, /* Only supported output mode for the WSTK*/ \
1600000, /* Choose 1.6 MHz for best the WSTK */ \
6, /* WSTK uses location 6 for DOUT PB12 */ \
gpioPortB, /* FRC_DOUT#6 is PB12 */ \
12, /* FRC_DOUT#6 is PB12 */ \
6, /* UNUSED IN UART MODE */ \
gpioPortB, /* UNUSED IN UART MODE */ \
11, /* UNUSED IN UART MODE */ \
6, /* WSTK uses location 6 for DFRAME */ \
gpioPortB, /* RC_DOUT#6 is PB13 */ \
13, /* RC_DOUT#6 is PB13 */ \
}
#endif

#ifdef __cplusplus
}
#endif

#endif /* RAIL_RADIO_H */
/** @} */
Loading

0 comments on commit 9edaf96

Please sign in to comment.