Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

boards/turpial: configure CC1190 front end. #99

Merged
merged 13 commits into from
May 28, 2020
Merged
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ targetConfigs/
setenv
.DS_Store
bin/
dist/tools/vaina/target
6 changes: 6 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

menu "Turpial - Radio Firmware Configuration"

config SLIP_LOCAL_ADDR
string "SLIP link local address"
default "fe80::dead:beef:cafe:babe"
help
Default SLIP link local address

rsource "sys/Kconfig"

endmenu
31 changes: 27 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ APPLICATION = radio-firmware

# If no BOARD is found in the environment, use this default:
BOARD ?= turpial
ifeq ($(BOARD),turpial)
BOARDSDIR ?= $(CURDIR)/boards
endif
EXTERNAL_BOARD_DIRS ?= $(CURDIR)/boards

# This has to be the absolute path to the RIOT base directory:
RIOTBASE ?= $(CURDIR)/RIOT
Expand Down Expand Up @@ -42,20 +40,45 @@ USEMODULE += ps
USEMODULE += netstats_l2
USEMODULE += netstats_ipv6

USEMODULE += vaina

USEMODULE += posix_inet

USEMODULE += timex

USEMODULE += slipdev
USEMODULE += slipdev_stdio

# set slip parameters to default values if unset
SLIP_UART ?= "UART_NUMOF-1"
ifeq ($(BOARD),cc2538dk)
SLIP_UART ?= "UART_NUMOF-1"
else
SLIP_UART ?= "0"
endif
SLIP_BAUDRATE ?= 115200

# export slip parameters
CFLAGS += -DSLIP_UART="UART_DEV($(SLIP_UART))"
CFLAGS += -DSLIP_BAUDRATE=$(SLIP_BAUDRATE)

# Enable SLAAC
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_SLAAC=1

CFLAGS += -I$(CURDIR)

.PHONY: host-tools

host-tools:
$(Q)env -u CC -u CFLAGS make -C $(RIOTTOOLS)

sliptty:
$(Q)env -u CC -u CFLAGS make -C $(RIOTTOOLS)/sliptty

IPV6_PREFIX = 2001:db8::/64

# Configure terminal parameters
TERMDEPS += host-tools
TERMPROG ?= sudo sh $(CURDIR)/dist/tools/vaina/start_network.sh
TERMFLAGS ?= $(FLAGS_EXTRAS) $(IPV6_PREFIX) $(PORT) $(SLIP_BAUDRATE)

include $(RIOTBASE)/Makefile.include
2 changes: 1 addition & 1 deletion RIOT
Submodule RIOT updated 182 files
17 changes: 13 additions & 4 deletions boards/turpial/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,22 @@
/**
* @brief Initialise the board.
*/

void board_init(void)
{
cpu_init();

if (MIMIC_LAUNCHPAD) {
gpio_init(LED0_PIN, GPIO_OUT);
gpio_init(LED1_PIN, GPIO_OUT);
jeandudey marked this conversation as resolved.
Show resolved Hide resolved
/* The Turpial board has an integrated Front-End that any CC13x2 is capable
* of controlling by routing specific pins in the IOC
*/
if (IS_USED(MODULE_CC26X2_CC13X2_RF)) {
/* Set to logical 1 the HGM pin, this enables the High-Gain mode.
*
* swrs089a, Controlling the Output Power form CC1190, pag. 8
*/
gpio_init(RF_HGM_PIN, GPIO_OUT);
gpio_set(RF_HGM_PIN);

IOC->CFG[RF_PA_EN_PIN] = IOCFG_PORTID_RFC_GPO1;
IOC->CFG[RF_LNA_EN_PIN] = IOCFG_PORTID_RFC_GPO0;
}
}
26 changes: 4 additions & 22 deletions boards/turpial/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,12 @@ extern "C" {
/** @} */

/**
* @name On-board button configuration
* @name Front-End configuration
* @{
*/
#define BTN0_PIN GPIO_PIN(0, 13)
#define BTN0_MODE GPIO_IN_PU

#define BTN1_PIN GPIO_PIN(0, 14)
#define BTN1_MODE GPIO_IN_PU
/** @} */

/**
* @brief On-board LED configuration and controlling
* @{
*/
#define LED0_PIN GPIO_PIN(0, 6) /**< red */
#define LED1_PIN GPIO_PIN(0, 7) /**< green */

#define LED0_ON gpio_set(LED0_PIN)
#define LED0_OFF gpio_clear(LED0_PIN)
#define LED0_TOGGLE gpio_toggle(LED0_PIN)

#define LED1_ON gpio_set(LED1_PIN)
#define LED1_OFF gpio_clear(LED1_PIN)
#define LED1_TOGGLE gpio_toggle(LED1_PIN)
jeandudey marked this conversation as resolved.
Show resolved Hide resolved
#define RF_PA_EN_PIN GPIO_PIN(0, 28)
#define RF_LNA_EN_PIN GPIO_PIN(0, 29)
#define RF_HGM_PIN GPIO_PIN(0, 30)
/** @} */

/**
Expand Down
226 changes: 226 additions & 0 deletions dist/tools/vaina/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions dist/tools/vaina/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "vaina"
version = "0.1.0"
authors = ["Locha Inc"]
edition = "2018"

[dependencies]
clap = { version = "2", features = ["color", "yaml"] }
bytes = "0.5"
snafu = "0.6"
nix = "0.17"

[patch.crates-io]
nix = { git = "https://github.com/nix-rust/nix" }
Loading