2014-04-17 19:41:19 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2015-02-12 13:55:17 +01:00
|
|
|
* @defgroup boards_stm32f0discovery STM32F0Discovery
|
2014-04-17 19:41:19 +02:00
|
|
|
* @ingroup boards
|
|
|
|
* @brief Support for the STM32F0Discovery board
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Board specific definitions for the STM32F0Discovery evaluation board.
|
|
|
|
*
|
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
|
|
*/
|
|
|
|
|
2015-04-23 05:00:54 +02:00
|
|
|
#ifndef BOARD_H_
|
|
|
|
#define BOARD_H_
|
2014-04-17 19:41:19 +02:00
|
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
|
2014-10-13 15:25:50 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2014-04-17 19:41:19 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @name LED pin definitions
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define LED_PORT GPIOC
|
|
|
|
#define LD3_PIN (1 << 9)
|
|
|
|
#define LD4_PIN (1 << 8)
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name Macros for controlling the on-board LEDs.
|
|
|
|
* @{
|
|
|
|
*/
|
2016-02-12 06:02:16 +01:00
|
|
|
#define LD3_ON (LED_PORT->BSRR = LD3_PIN)
|
|
|
|
#define LD3_OFF (LED_PORT->BSRR = (LD3_PIN << 16))
|
2014-04-17 19:41:19 +02:00
|
|
|
#define LD3_TOGGLE (LED_PORT->ODR ^= LD3_PIN)
|
2016-02-12 06:02:16 +01:00
|
|
|
#define LD4_ON (LED_PORT->BSRR = LD4_PIN)
|
|
|
|
#define LD4_OFF (LED_PORT->BSRR = (LD4_PIN << 16))
|
2014-04-17 19:41:19 +02:00
|
|
|
#define LD4_TOGGLE (LED_PORT->ODR ^= LD4_PIN)
|
|
|
|
|
|
|
|
/* for compatibility to other boards */
|
2015-05-11 10:11:56 +02:00
|
|
|
#define LED_GREEN_ON LD3_ON
|
|
|
|
#define LED_GREEN_OFF LD3_OFF
|
|
|
|
#define LED_GREEN_TOGGLE LD3_TOGGLE
|
|
|
|
#define LED_RED_ON LD4_ON
|
|
|
|
#define LED_RED_OFF LD4_OFF
|
|
|
|
#define LED_RED_TOGGLE LD4_TOGGLE
|
2014-04-17 19:41:19 +02:00
|
|
|
/** @} */
|
|
|
|
|
2016-03-02 12:11:34 +01:00
|
|
|
/**
|
|
|
|
* @brief User button
|
|
|
|
*/
|
|
|
|
#define BTN_B1_PIN GPIO_PIN(PORT_A, 0)
|
|
|
|
|
2014-04-17 19:41:19 +02:00
|
|
|
/**
|
|
|
|
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
|
|
|
|
*/
|
|
|
|
void board_init(void);
|
|
|
|
|
2014-10-13 15:25:50 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-05-26 22:03:40 +02:00
|
|
|
#endif /* BOARD_H_ */
|
2014-04-17 19:41:19 +02:00
|
|
|
/** @} */
|