mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
drivers/kw2xrf: reduce scope of test application
This commit is contained in:
parent
e617d74fa8
commit
598a36b75b
@ -4,49 +4,14 @@ include ../Makefile.tests_common
|
||||
FEATURES_REQUIRED = periph_spi periph_gpio
|
||||
|
||||
BOARD_INSUFFICIENT_MEMORY := stm32f0discovery nucleo-f334 weio
|
||||
# msba2 fails with linker error in cc110x
|
||||
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
USEMODULE += gnrc_netif
|
||||
USEMODULE += gnrc_txtsnd
|
||||
USEMODULE += gnrc_nomac
|
||||
USEMODULE += gnrc_netdev_default
|
||||
USEMODULE += gnrc_pktdump
|
||||
USEMODULE += shell
|
||||
USEMODULE += shell_commands
|
||||
USEMODULE += ps
|
||||
|
||||
# define parameters for selected boards
|
||||
ifneq (,$(filter pba-d-01-kw2x,$(BOARD)))
|
||||
DRIVER := kw2xrf
|
||||
USE_BOARD_PARAMETERS := true
|
||||
endif
|
||||
|
||||
# only set specific parameters if not using board configuration
|
||||
ifneq (true,$(USE_BOARD_PARAMETERS))
|
||||
|
||||
# set default device parameters in case they are undefined
|
||||
DRIVER ?= kw2xrf
|
||||
KW2XRF_SHARED_SPI ?= 1
|
||||
KWRF_SPI ?= SPI_DEV\(0\)
|
||||
KWRF_SPI_SPEED ?= SPI_CLK_5MHZ
|
||||
KWRF_CS ?= GPIO_PIN\(0,0\)
|
||||
KWRF_INT ?= GPIO_PIN\(0,1\)
|
||||
|
||||
# export parameters
|
||||
CFLAGS += -DKW2XRF_SHARED_SPI=$(KW2XRF_SHARED_SPI)
|
||||
CFLAGS += -DKWRF_SPI=$(KWRF_SPI)
|
||||
CFLAGS += -DKWRF_SPI_SPEED=$(KWRF_SPI_SPEED)
|
||||
CFLAGS += -DKWRF_CS=$(KWRF_CS)
|
||||
CFLAGS += -DKWRF_INT=$(KWRF_INT)
|
||||
|
||||
# This adds . to include path so generic kw2xrf_params.h gets picked
|
||||
# up. All boards actually having such a device on board should define
|
||||
# USE_BOARD_PARAMETERS=true above to skip this step, as the board provides
|
||||
# this header.
|
||||
CFLAGS += -I$(CURDIR)
|
||||
|
||||
endif
|
||||
DRIVER ?= kw2xrf
|
||||
|
||||
# finally include the actual chosen driver
|
||||
USEMODULE += $(DRIVER)
|
||||
|
@ -1,12 +1,9 @@
|
||||
# About
|
||||
This is a manual test application for testing the KW2xrf network device driver.
|
||||
This is a manual test application for testing the KW2XRF device driver. It enables several shell commands, allowing for special test modes of that device. Without deeper knowledge about the hardware, this application might be useless except for compile tests. If you want an example to use this radio, check the [examples](../../examples) folder.
|
||||
|
||||
For running this test, you need to connect/configure the following pins of your
|
||||
radio device:
|
||||
radio device. If you are running on a phyNODE, this is already the on-board default.
|
||||
|
||||
- SPI DEV
|
||||
- CS (chip select)
|
||||
- INT (external interrupt)
|
||||
|
||||
# Usage
|
||||
For testing the radio driver you can use the netif and txtsnd shell commands
|
||||
that are included in this application.
|
||||
|
@ -23,11 +23,12 @@
|
||||
#include "kw2xrf.h"
|
||||
#include "shell_commands.h"
|
||||
#include "net/gnrc.h"
|
||||
#include "net/gnrc/pktdump.h"
|
||||
#include "net/gnrc/netif.h"
|
||||
#include "net/gnrc/netapi.h"
|
||||
#include "net/netopt.h"
|
||||
|
||||
#define KW2XRF_TESTMODE (1)
|
||||
|
||||
#ifdef KW2XRF_TESTMODE
|
||||
#include "kw2xrf_tm.h"
|
||||
|
||||
@ -159,15 +160,9 @@ static const shell_command_t shell_commands[] = {
|
||||
|
||||
int main(void)
|
||||
{
|
||||
gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL,
|
||||
gnrc_pktdump_pid);
|
||||
|
||||
puts("KW2XRF device driver test");
|
||||
|
||||
/* register the pktdump thread */
|
||||
puts("Register the packet dump thread for GNRC_NETTYPE_UNDEF packets");
|
||||
gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump);
|
||||
|
||||
/* start the shell */
|
||||
puts("Initialization successful - starting the shell now");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user