mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/periph_qdec: Add modded qdec-enabled nrf52840dk variant
This commit is contained in:
parent
3b1bdd6b3c
commit
f123341057
@ -5,4 +5,7 @@ FEATURES_REQUIRED = periph_qdec
|
||||
|
||||
USEMODULE += xtimer
|
||||
|
||||
# include boards that have are modified to add a qdec peripheral
|
||||
EXTERNAL_BOARD_DIRS = $(CURDIR)/boards_modded
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
21
tests/periph_qdec/boards_modded/nrf52840dk/Kconfig
Normal file
21
tests/periph_qdec/boards_modded/nrf52840dk/Kconfig
Normal file
@ -0,0 +1,21 @@
|
||||
# Copyright (c) 2020 HAW Hamburg
|
||||
#
|
||||
# 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.
|
||||
|
||||
config BOARD
|
||||
default "nrf52840dk" if BOARD_NRF52840DK
|
||||
|
||||
config BOARD_NRF52840DK
|
||||
bool
|
||||
default y
|
||||
select BOARDS_COMMON_NRF52XXXDK
|
||||
select CPU_MODEL_NRF52840XXAA
|
||||
select HAS_PERIPH_PWM
|
||||
select HAS_PERIPH_QDEC
|
||||
select HAS_PERIPH_USBDEV
|
||||
select HAS_VDD_LC_FILTER_REG0
|
||||
select HAVE_MTD_SPI_NOR
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52xxxdk/Kconfig"
|
6
tests/periph_qdec/boards_modded/nrf52840dk/Makefile
Normal file
6
tests/periph_qdec/boards_modded/nrf52840dk/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
# This must be a different name than 'board' as it is implemented by 'native'
|
||||
MODULE = board_nrf52840dk_qdec
|
||||
|
||||
DIRS += $(RIOTBOARD)/nrf52840dk
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
4
tests/periph_qdec/boards_modded/nrf52840dk/Makefile.dep
Normal file
4
tests/periph_qdec/boards_modded/nrf52840dk/Makefile.dep
Normal file
@ -0,0 +1,4 @@
|
||||
# This must be a different name than 'board' as it is implemented by 'native'
|
||||
USEMODULE += board_nrf52840dk_qdec
|
||||
|
||||
include $(RIOTBOARD)/nrf52840dk/Makefile.dep
|
@ -0,0 +1,3 @@
|
||||
FEATURES_PROVIDED += periph_qdec
|
||||
|
||||
include $(RIOTBOARD)/nrf52840dk/Makefile.features
|
@ -0,0 +1 @@
|
||||
include $(RIOTBOARD)/nrf52840dk/Makefile.include
|
1
tests/periph_qdec/boards_modded/nrf52840dk/include/board.h
Symbolic link
1
tests/periph_qdec/boards_modded/nrf52840dk/include/board.h
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../../boards/nrf52840dk/include/board.h
|
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Koen Zandberg <koen@bergzand.net>
|
||||
*
|
||||
* 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_nrf52840dk_modded
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Minimal peripheral set for the nRF52840 DK with quadrature
|
||||
* decoder enabled
|
||||
*
|
||||
* @author Koen Zandberg <koen@bergzand.net>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PERIPH_CONF_H
|
||||
#define PERIPH_CONF_H
|
||||
|
||||
#include "kernel_defines.h"
|
||||
#include "periph_conf_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name QDEC configuration
|
||||
*/
|
||||
static const qdec_conf_t qdec_config[] = {
|
||||
{
|
||||
.a_pin = GPIO_PIN(0, 11), /* Button 1 */
|
||||
.b_pin = GPIO_PIN(0, 12), /* Button 2 */
|
||||
.led_pin = GPIO_PIN(0, 13), /* And the first LED */
|
||||
.sample_period = QDEC_SAMPLEPER_SAMPLEPER_128us,
|
||||
.debounce_filter = true,
|
||||
},
|
||||
};
|
||||
#define QDEC_NUMOF ARRAY_SIZE(qdec_config)
|
||||
/** @} **/
|
||||
|
||||
/**
|
||||
* @name UART configuration
|
||||
* @{
|
||||
*/
|
||||
static const uart_conf_t uart_config[] = {
|
||||
{ /* Mapped to USB virtual COM port */
|
||||
.dev = NRF_UARTE0,
|
||||
.rx_pin = GPIO_PIN(0,8),
|
||||
.tx_pin = GPIO_PIN(0,6),
|
||||
#ifdef MODULE_PERIPH_UART_HW_FC
|
||||
.rts_pin = GPIO_UNDEF,
|
||||
.cts_pin = GPIO_UNDEF,
|
||||
#endif
|
||||
.irqn = UARTE0_UART0_IRQn,
|
||||
},
|
||||
};
|
||||
|
||||
#define UART_0_ISR (isr_uart0)
|
||||
|
||||
#define UART_NUMOF ARRAY_SIZE(uart_config)
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PERIPH_CONF_H */
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user