Skip to content

Commit

Permalink
boards: add nucleo144-f413 initial support
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Dupont committed Feb 23, 2017
1 parent efbad0d commit fc24355
Show file tree
Hide file tree
Showing 8 changed files with 410 additions and 0 deletions.
3 changes: 3 additions & 0 deletions boards/nucleo144-f413/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = board

include $(RIOTBASE)/Makefile.base
1 change: 1 addition & 0 deletions boards/nucleo144-f413/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(RIOTBOARD)/nucleo-common/Makefile.dep
15 changes: 15 additions & 0 deletions boards/nucleo144-f413/Makefile.features
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_pwm

# load the common Makefile.features for Nucleo boards
include $(RIOTBOARD)/nucleo-common/Makefile.features

# The board MPU family (used for grouping by the CI system)
FEATURES_MCU_GROUP = cortex_m4_3
6 changes: 6 additions & 0 deletions boards/nucleo144-f413/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# define the cpu used by the nucleo-f446 board
export CPU = stm32f4
export CPU_MODEL = stm32f413zh

# load the common Makefile.include for Nucleo boards
include $(RIOTBOARD)/nucleo-common/Makefile.include
35 changes: 35 additions & 0 deletions boards/nucleo144-f413/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2016 Inria
* 2017 OTA keys S.A.
*
* 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_nucleo144-f413
* @{
*
* @file
* @brief Board specific implementations for the nucleo144-f413 board
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
* @author Vincent Dupont <vincent@otakeys.com>
*
* @}
*/

#include "board.h"
#include "periph/gpio.h"

void board_init(void)
{
/* initialize the CPU */
cpu_init();

/* initialize the boards LEDs */
gpio_init(LED0_PIN, GPIO_OUT);
gpio_init(LED1_PIN, GPIO_OUT);
gpio_init(LED2_PIN, GPIO_OUT);
}
1 change: 1 addition & 0 deletions boards/nucleo144-f413/dist/openocd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source [find board/st_nucleo_f4.cfg]
81 changes: 81 additions & 0 deletions boards/nucleo144-f413/include/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright (C) 2016 Inria
* 2017 OTA keys S.A.
*
* 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.
*/

/**
* @defgroup boards_nucleo144-f413 Nucleo-F413
* @ingroup boards
* @brief Board specific files for the nucleo144-f413 board
* @{
*
* @file
* @brief Board specific definitions for the nucleo144-f413 board
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
* @author Vincent Dupont <vincent@otakeys.com>
*/

#ifndef BOARD_H
#define BOARD_H

#ifdef __cplusplus
extern "C" {
#endif

/**
* @name xtimer configuration
* @{
*/
#define XTIMER_DEV TIMER_DEV(0)
#define XTIMER_CHAN (0)
#define XTIMER_OVERHEAD (6)
#define XTIMER_BACKOFF (5)
/** @} */

/**
* @brief LED pin definitions and handlers
* @{
*/
#define LED_CREG BSRRH
#define LED_SREG BSRRL

#define LED0_PIN GPIO_PIN(PORT_B, 0)
#define LED0_MASK (1 << 0)
#define LED0_ON (GPIOA->LED_SREG = LED0_MASK)
#define LED0_OFF (GPIOA->LED_CREG = LED0_MASK)
#define LED0_TOGGLE (GPIOA->ODR ^= LED0_MASK)

#define LED1_PIN GPIO_PIN(PORT_B, 7)
#define LED1_MASK (1 << 7)
#define LED1_OFF (GPIOA->LED_CREG = LED1_MASK)
#define LED1_ON (GPIOA->LED_SREG = LED1_MASK)
#define LED1_TOGGLE (GPIOA->ODR ^= LED1_MASK)

#define LED2_PIN GPIO_PIN(PORT_B, 14)
#define LED2_MASK (1 << 14)
#define LED2_ON (GPIOA->LED_SREG = LED2_MASK)
#define LED2_OFF (GPIOA->LED_CREG = LED2_MASK)
#define LED2_TOGGLE (GPIOA->ODR ^= LED2_MASK)
/** @} */

/**
* @brief User button
*/
#define BTN_B1_PIN GPIO_PIN(PORT_C, 13)

/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
void board_init(void);

#ifdef __cplusplus
}
#endif

#endif /* BOARD_H */
/** @} */
Loading

0 comments on commit fc24355

Please sign in to comment.