2016-03-11 15:01:58 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Freie Universität Berlin
|
|
|
|
*
|
|
|
|
* 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-07-05 09:17:57 +02:00
|
|
|
* @defgroup boards_nucleo STM Nucleo boards
|
2017-02-07 11:16:50 +01:00
|
|
|
* @ingroup boards
|
2017-07-05 09:17:57 +02:00
|
|
|
* @brief STM Nucleo boards
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup boards_nucleo64_common STM Nucleo 64 boards common
|
|
|
|
* @ingroup boards_nucleo
|
|
|
|
* @brief Common files for STM Nucleo 64 boards
|
2016-03-11 15:01:58 +01:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Common pin definitions and board configuration options
|
|
|
|
*
|
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
2017-06-20 21:11:34 +02:00
|
|
|
* @author Sebastian Meiling <s@mlng.net>
|
2016-03-11 15:01:58 +01:00
|
|
|
*/
|
|
|
|
|
2017-03-13 23:49:10 +01:00
|
|
|
#ifndef BOARD_COMMON_H
|
|
|
|
#define BOARD_COMMON_H
|
2016-03-11 15:01:58 +01:00
|
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "periph_conf.h"
|
2017-03-27 09:46:06 +02:00
|
|
|
#include "arduino_pinmap.h"
|
2016-03-11 15:01:58 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief LED pin definitions and handlers
|
|
|
|
* @{
|
|
|
|
*/
|
2017-03-27 13:10:53 +02:00
|
|
|
#ifdef CPU_MODEL_STM32F302R8
|
2017-08-21 14:55:01 +02:00
|
|
|
#define LED0_PORT GPIOB
|
2017-03-27 13:10:53 +02:00
|
|
|
#define LED0_PIN GPIO_PIN(PORT_B, 13)
|
|
|
|
#define LED0_MASK (1 << 13)
|
|
|
|
#else
|
2017-08-21 14:55:01 +02:00
|
|
|
#define LED0_PORT GPIOA
|
2016-03-11 15:01:58 +01:00
|
|
|
#define LED0_PIN GPIO_PIN(PORT_A, 5)
|
|
|
|
#define LED0_MASK (1 << 5)
|
2017-03-27 13:10:53 +02:00
|
|
|
#endif
|
2016-03-11 15:01:58 +01:00
|
|
|
|
2017-08-21 14:55:01 +02:00
|
|
|
#define LED0_ON (LED0_PORT->BSRR = LED0_MASK)
|
|
|
|
#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16))
|
|
|
|
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
|
2016-03-11 15:01:58 +01:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief User button
|
2017-06-20 21:11:34 +02:00
|
|
|
* @{
|
2016-03-11 15:01:58 +01:00
|
|
|
*/
|
2017-06-20 21:11:34 +02:00
|
|
|
#define BTN0_PIN GPIO_PIN(PORT_C, 13)
|
|
|
|
#define BTN0_MODE GPIO_IN_PU
|
|
|
|
/** @} */
|
2016-03-11 15:01:58 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
|
|
|
|
*/
|
|
|
|
void board_init(void);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-03-13 23:49:10 +01:00
|
|
|
#endif /* BOARD_COMMON_H */
|
2016-03-11 15:01:58 +01:00
|
|
|
/** @} */
|