Skip to content
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

drivers/rail: efr32 radio driver #9212

Closed
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 5 additions & 0 deletions boards/ikea-tradfri/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

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

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 */
/** @} */
12 changes: 12 additions & 0 deletions drivers/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,18 @@ ifneq (,$(filter atwinc15x0,$(USEMODULE)))
FEATURES_REQUIRED += periph_spi
endif

kaibeckmann marked this conversation as resolved.
Show resolved Hide resolved
ifneq (,$(filter rail,$(USEMODULE)))
USEPKG += gecko_sdk
USEMODULE += xtimer
USEMODULE += luid
USEMODULE += netif
USEMODULE += ieee802154
USEMODULE += netdev_ieee802154
USEMODULE += gecko_sdk_librail
USEMODULE += netopt
USEMODULE += core_thread_flags
endif

ifneq (,$(filter bh1750fvi,$(USEMODULE)))
USEMODULE += xtimer
FEATURES_REQUIRED += periph_i2c
Expand Down
Loading