2015-01-06 00:22:42 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Freie Universität Berlin
|
|
|
|
* Copyright (C) 2015 PHYTEC Messtechnik GmbH
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2017-04-13 17:08:13 +02:00
|
|
|
* @defgroup boards_pba-d-01-kw2x phyWAVE-KW22 Board
|
2015-01-06 00:22:42 +01:00
|
|
|
* @ingroup boards
|
2018-01-23 07:00:17 +01:00
|
|
|
* @brief Support for the phyWAVE evaluation board
|
2015-01-06 00:22:42 +01:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Board specific definitions for the phyWAVE evaluation board
|
|
|
|
*
|
|
|
|
* @author Johann Fischer <j.fischer@phytec.de>
|
2017-06-20 21:11:34 +02:00
|
|
|
* @author Sebastian Meiling <s@mlng.net>
|
2015-01-06 00:22:42 +01:00
|
|
|
*/
|
|
|
|
|
2017-01-18 13:00:05 +01:00
|
|
|
#ifndef BOARD_H
|
|
|
|
#define BOARD_H
|
2015-01-06 00:22:42 +01:00
|
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "periph_conf.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2017-02-21 10:19:04 +01:00
|
|
|
* @name LED pin definitions and handlers
|
2015-01-06 00:22:42 +01:00
|
|
|
* @{
|
|
|
|
*/
|
2017-02-21 10:19:53 +01:00
|
|
|
#define LED0_PIN GPIO_PIN(PORT_D, 6)
|
2016-03-11 18:04:26 +01:00
|
|
|
#define LED1_PIN GPIO_PIN(PORT_D, 4)
|
2017-02-21 10:19:53 +01:00
|
|
|
#define LED2_PIN GPIO_PIN(PORT_A, 4)
|
2015-01-06 00:22:42 +01:00
|
|
|
|
2016-03-11 18:04:26 +01:00
|
|
|
#define LED0_MASK (1 << 6)
|
|
|
|
#define LED1_MASK (1 << 4)
|
|
|
|
#define LED2_MASK (1 << 4)
|
|
|
|
|
|
|
|
#define LED0_ON (GPIOD->PCOR = LED0_MASK)
|
|
|
|
#define LED0_OFF (GPIOD->PSOR = LED0_MASK)
|
|
|
|
#define LED0_TOGGLE (GPIOD->PTOR = LED0_MASK)
|
|
|
|
|
|
|
|
#define LED1_ON (GPIOD->PCOR = LED1_MASK)
|
|
|
|
#define LED1_OFF (GPIOD->PSOR = LED1_MASK)
|
|
|
|
#define LED1_TOGGLE (GPIOD->PTOR = LED1_MASK)
|
2015-01-06 00:22:42 +01:00
|
|
|
|
2016-03-11 18:04:26 +01:00
|
|
|
#define LED2_ON (GPIOA->PCOR = LED2_MASK)
|
|
|
|
#define LED2_OFF (GPIOA->PSOR = LED2_MASK)
|
|
|
|
#define LED2_TOGGLE (GPIOA->PTOR = LED2_MASK)
|
2015-01-06 00:22:42 +01:00
|
|
|
/** @} */
|
|
|
|
|
2016-02-17 21:38:42 +01:00
|
|
|
/**
|
|
|
|
* @name Macro for button S1/S2.
|
|
|
|
* @{
|
|
|
|
*/
|
2017-06-20 21:11:34 +02:00
|
|
|
#define BTN0_PORT PORTD
|
|
|
|
#define BTN0_PIN GPIO_PIN(PORT_D, 1)
|
|
|
|
#define BTN0_MODE GPIO_IN_PU
|
2016-02-17 21:38:42 +01:00
|
|
|
/** @} */
|
|
|
|
|
2017-06-07 11:45:22 +02:00
|
|
|
/**
|
|
|
|
* @name Macro for capacitive sensor button.
|
|
|
|
* @{
|
|
|
|
*/
|
2017-06-20 21:11:34 +02:00
|
|
|
#define BTN1_PORT PORTC
|
|
|
|
#define BTN1_PIN GPIO_PIN(PORT_C, 6)
|
|
|
|
#define BTN1_MODE GPIO_IN
|
2017-06-07 11:45:22 +02:00
|
|
|
/** @} */
|
|
|
|
|
2015-05-17 15:21:49 +02:00
|
|
|
/**
|
2017-02-07 14:39:09 +01:00
|
|
|
* @name KW2XRF configuration
|
|
|
|
*
|
|
|
|
* {spi bus, cs pin, int pin, spi speed,}
|
2016-02-15 15:43:20 +01:00
|
|
|
* @{
|
|
|
|
*/
|
2018-02-28 18:29:33 +01:00
|
|
|
#define KW2XRF_PARAM_SPI SPI_DEV(1)
|
|
|
|
#define KW2XRF_PARAM_SPI_CLK (SPI_CLK_10MHZ)
|
|
|
|
#define KW2XRF_PARAM_CS GPIO_PIN(KW2XDRF_PORT, KW2XDRF_PCS0_PIN)
|
|
|
|
#define KW2XRF_PARAM_INT GPIO_PIN(KW2XDRF_PORT, KW2XDRF_IRQ_PIN)
|
|
|
|
#define KW2XRF_SHARED_SPI (0)
|
|
|
|
/** @}*/
|
2016-02-15 15:43:20 +01:00
|
|
|
|
2015-01-06 00:22:42 +01:00
|
|
|
/**
|
|
|
|
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
|
|
|
|
*/
|
|
|
|
void board_init(void);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-01-18 15:07:35 +01:00
|
|
|
#endif /* BOARD_H */
|
2015-01-06 00:22:42 +01:00
|
|
|
/** @} */
|