-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards: support for KEA128LEDLIGHTRD board
Signed-off-by: Anton Gerasimov <anton.gerasimov@here.com>
- Loading branch information
Showing
9 changed files
with
258 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MODULE = board | ||
|
||
include $(RIOTBASE)/Makefile.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ifneq (,$(filter can,$(USEMODULE))) | ||
USEMODULE += periph_mscan | ||
CFLAGS += -DCAN_DLL_NUMOF=1 | ||
endif | ||
|
||
USEMODULE += stdio_rtt | ||
|
||
# setup clock to run at 40MHz | ||
CFLAGS += -DCLOCK_SETUP=1 | ||
|
||
include $(RIOTCPU)/kinetis/Makefile.dep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Put defined MCU peripherals here (in alphabetical order) | ||
FEATURES_PROVIDED += periph_timer | ||
|
||
# The board MPU family (used for grouping by the CI system) | ||
FEATURES_MCU_GROUP = cortex_m0+ | ||
|
||
include $(RIOTCPU)/kinetis/Makefile.features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# define the cpu used by the KEA128LEDLIGHTRD board | ||
export CPU = kinetis | ||
export CPU_MODEL = s9keaz128aclh48 | ||
|
||
DEBUG_ADAPTER ?= arm-jtag-swd | ||
OPENOCD_CONFIG ?= ${RIOTBOARD}/kea128ledlightrd/dist/openocd.cfg | ||
|
||
include ${RIOTMAKE}/tools/openocd.inc.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright (C) 2014 Freie Universität Berlin | ||
* Copyright (C) 2014 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. | ||
*/ | ||
|
||
/** | ||
* @ingroup boards_kea128ledlightrd | ||
* @{ | ||
* | ||
* @file | ||
* @brief Board specific implementations for the KEA128LEDLIGHTRD | ||
* | ||
* @author Johann Fischer <j.fischer@phytec.de> | ||
* @author Anton Gerasimov <anton.gerasimov@here.com> | ||
* | ||
* @} | ||
*/ | ||
|
||
#include "board.h" | ||
#include "periph/gpio.h" | ||
#include "tja1042.h" | ||
|
||
extern void SystemInit(void); | ||
|
||
#ifdef MODULE_PERIPH_MSCAN | ||
|
||
static tja1042_trx_t tja1042 = { | ||
.trx.driver = &tja1042_driver, | ||
.stb_pin = GPIO_PIN(PORT_A, 24), | ||
}; | ||
|
||
const candev_kea_conf_t candev_kea_config[] = { | ||
{ | ||
.clock_freq = CLOCK_BUSCLOCK / 2, | ||
.params.name = "can0", | ||
.params.trx = (can_trx_t *)&tja1042, | ||
}, | ||
}; | ||
|
||
#endif | ||
|
||
void board_init(void) | ||
{ | ||
/* initialize clocks */ | ||
SystemInit(); | ||
|
||
/* initialize the CPU core */ | ||
cpu_init(); | ||
|
||
/* disable NMI on the pin used for LED2 */ | ||
SIM->SOPT0 &= (~SIM_SOPT0_NMIE_MASK); | ||
|
||
/* initialize and turn off the on-board RGB-LED */ | ||
gpio_init(LED0_PIN, GPIO_OUT); | ||
gpio_init(LED1_PIN, GPIO_OUT); | ||
gpio_init(LED2_PIN, GPIO_OUT); | ||
gpio_init(LED3_PIN, GPIO_OUT); | ||
gpio_set(LED0_PIN); | ||
gpio_set(LED1_PIN); | ||
gpio_set(LED2_PIN); | ||
gpio_set(LED3_PIN); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Kinetis KE series CPUs | ||
source [find target/ke0x.cfg] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* @defgroup boards_kea128ledlightrd NXP/Freescale KEA128LEDLIGHTRD Board | ||
* @ingroup boards | ||
* @brief Support for the NXP KEA128LEDLIGHTRD | ||
* @{ | ||
* | ||
* @file | ||
* @brief Board specific definitions for the KEA128LEDLIGHTRD | ||
* | ||
* @author Johann Fischer <j.fischer@phytec.de> | ||
* @author Anton Gerasimov <anton.gerasimov@here.com> | ||
*/ | ||
|
||
#ifndef BOARD_H | ||
#define BOARD_H | ||
|
||
#include "cpu.h" | ||
#include "periph_conf.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
/** | ||
* @name LED pin definitions and handlers | ||
* @{ | ||
*/ | ||
#define LED0_PIN GPIO_PIN(PORT_A, 10) | ||
#define LED1_PIN GPIO_PIN(PORT_A, 11) | ||
#define LED2_PIN GPIO_PIN(PORT_A, 12) | ||
#define LED3_PIN GPIO_PIN(PORT_A, 13) | ||
|
||
#define LED0_MASK (1 << 10) | ||
#define LED1_MASK (1 << 11) | ||
#define LED2_MASK (1 << 12) | ||
#define LED3_MASK (1 << 13) | ||
|
||
#define LED0_ON (GPIOA->PCOR = LED0_MASK) | ||
#define LED0_OFF (GPIOA->PSOR = LED0_MASK) | ||
#define LED0_TOGGLE (GPIOA->PTOR = LED0_MASK) | ||
|
||
#define LED1_ON (GPIOA->PCOR = LED1_MASK) | ||
#define LED1_OFF (GPIOA->PSOR = LED1_MASK) | ||
#define LED1_TOGGLE (GPIOA->PTOR = LED1_MASK) | ||
|
||
#define LED2_ON (GPIOA->PCOR = LED2_MASK) | ||
#define LED2_OFF (GPIOA->PSOR = LED2_MASK) | ||
#define LED2_TOGGLE (GPIOA->PTOR = LED2_MASK) | ||
|
||
#define LED3_ON (GPIOA->PCOR = LED3_MASK) | ||
#define LED3_OFF (GPIOA->PSOR = LED3_MASK) | ||
#define LED3_TOGGLE (GPIOA->PTOR = LED3_MASK) | ||
|
||
/** @} */ | ||
|
||
/** | ||
* @name xtimer configuration | ||
* @{ | ||
*/ | ||
#define XTIMER_DEV (TIMER_PIT_DEV(0)) | ||
#define XTIMER_CHAN (0) | ||
/** @} */ | ||
|
||
/** | ||
* @brief Initialize board specific hardware, including clock, LEDs and std-IO | ||
*/ | ||
void board_init(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* BOARD_H */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright (C) 2014 Freie Universität Berlin | ||
* Copyright (C) 2015 PHYTEC Messtechnik GmbH | ||
* Copyright (C) 2018 HERE Deutschland 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. | ||
*/ | ||
|
||
/** | ||
* @ingroup boards_kea128ledlightrd | ||
* @{ | ||
* | ||
* @file | ||
* @name Peripheral MCU configuration for KEA128LEDLIGHTRD | ||
* | ||
* @author Johann Fischer <j.fischer@phytec.de> | ||
* @author Anton Gerasimov <anton.gerasimov@here.com> | ||
*/ | ||
|
||
#ifndef PERIPH_CONF_H | ||
#define PERIPH_CONF_H | ||
|
||
#include "periph_cpu.h" | ||
|
||
#ifdef MODULE_PERIPH_MSCAN | ||
#include "mscan.h" | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
#define CLOCK_CORECLOCK (40000000ul) | ||
#define CLOCK_BUSCLOCK (CLOCK_CORECLOCK / 1) | ||
/** @} */ | ||
|
||
/** | ||
* @name Timer configuration | ||
* @{ | ||
*/ | ||
#define PIT_NUMOF (2U) | ||
#define LPTMR_NUMOF (0U) | ||
#define PIT_CONFIG { \ | ||
{ \ | ||
.prescaler_ch = 0, \ | ||
.count_ch = 1, \ | ||
}, \ | ||
{ \ | ||
.prescaler_ch = 2, \ | ||
.count_ch = 3, \ | ||
}, \ | ||
} | ||
#define TIMER_NUMOF ((PIT_NUMOF)) | ||
|
||
#define PIT_BASECLOCK (CLOCK_BUSCLOCK) | ||
#define PIT_ISR_0 isr_pit1 | ||
#define PIT_ISR_1 isr_pit3 | ||
/** @} */ | ||
|
||
#ifdef MODULE_PERIPH_MSCAN | ||
/** | ||
* @name CAN configuration | ||
* @{ | ||
*/ | ||
|
||
extern const candev_kea_conf_t candev_kea_config[]; | ||
#endif | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* PERIPH_CONF_H */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters