Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards/qn9080dk: New board for the QN908x
The QN9080DK is the developer board reference from NXP for the QN908x CPUs. The developer kit comes with two boards: a larger PCB with many peripherals and a much smaller "USB dongle". This board adds initial support for the larger "DK board". At the moment, with the minimal CPU support this board only configures the GPIOs available in the board, namely the RGB LED and the two user buttons.
- Loading branch information
Showing
10 changed files
with
334 additions
and
0 deletions.
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,21 @@ | ||
# Copyright (c) 2020 iosabi | ||
# | ||
# 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. | ||
# | ||
|
||
config BOARD | ||
default "qn9080dk" if BOARD_QN9080DK | ||
|
||
config BOARD_QN9080DK | ||
bool | ||
default y | ||
select BOARD_COMMON_QN908X | ||
select CPU_MODEL_QN9080XHN | ||
|
||
# Put defined MCU peripherals here (in alphabetical order) | ||
select BOARD_HAS_XTAL32K | ||
select BOARD_HAS_XTAL_32M | ||
|
||
source "$(RIOTBOARD)/common/qn908x/Kconfig" |
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,6 @@ | ||
MODULE = board | ||
|
||
# Use the common qn908x board. | ||
DIRS += $(RIOTBOARD)/common/qn908x | ||
|
||
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,3 @@ | ||
ifneq (,$(filter saul_default,$(USEMODULE))) | ||
USEMODULE += saul_gpio | ||
endif |
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 @@ | ||
CPU = qn908x | ||
CPU_MODEL = qn9080xhn | ||
|
||
# Put defined MCU peripherals here (in alphabetical order) | ||
FEATURES_PROVIDED += periph_gpio periph_gpio_irq | ||
|
||
# Include the common qn908x board features. | ||
include $(RIOTBOARD)/common/qn908x/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 @@ | ||
CFLAGS += \ | ||
-DCONFIG_BOARD_HAS_XTAL \ | ||
-DCONFIG_BOARD_HAS_XTAL32K \ | ||
-DCONFIG_BOARD_HAS_XTAL_32M \ | ||
# | ||
|
||
# Include default QN908x board config | ||
include $(RIOTBOARD)/common/qn908x/Makefile.include |
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,37 @@ | ||
/* | ||
* Copyright (C) 2020 iosabi | ||
* | ||
* 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_qn9080dk | ||
* @{ | ||
* | ||
* @file | ||
* @brief Board specific implementations for the QN9080DK base board | ||
* | ||
* @author iosabi <iosabi@protonmail.com> | ||
* | ||
* @} | ||
*/ | ||
|
||
#include "cpu.h" | ||
#include "board.h" | ||
|
||
#include "periph/gpio.h" | ||
|
||
void board_init(void) | ||
{ | ||
/* Initialize LEDs and Buttons. */ | ||
gpio_init(LED_RED_PIN, GPIO_OUT); | ||
gpio_init(LED_GREEN_PIN, GPIO_OUT); | ||
gpio_init(LED_BLUE_PIN, GPIO_OUT); | ||
gpio_init(BTN1_PIN, BTN1_MODE); | ||
gpio_init(BTN2_PIN, BTN2_MODE); | ||
|
||
/* initialize the CPU */ | ||
cpu_init(); | ||
} |
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,62 @@ | ||
/** | ||
@defgroup boards_qn9080dk QN9080DK base board | ||
@ingroup boards | ||
@brief Support for the QN9080DK base board. | ||
|
||
### General information | ||
|
||
The QN9080DK is the developer board reference from NXP for the QN908x CPUs. | ||
The developer kit comes with two boards: a larger PCB with a QFN "module" | ||
including a QN9080DHN soldered onto it, altogether referred as the "base | ||
board"; and separately a much smaller USB dongle with another QN9080 cpu. | ||
This board module supports the "base board" only, including the definitions | ||
of the gpio, buttons and LEDs specific to this board. | ||
|
||
This board packs a few peripherals and many GPIOs: | ||
|
||
* MMA8652FC, a 12-bit accelerometer | ||
* | ||
|
||
The board also features a dedicated programmer hardware implemented using NXP's | ||
LPC4322, with its dedicated USB port for connecting to a computer on one end | ||
and the SWD port and one UART RX/TX pair connected to the QN9080 on the other | ||
end. The LPC4322 also has a fast (50 ksps) ADC ADC122S021 connected to a | ||
current sense amplifier to monitor the QN9080 current profile directly on | ||
the board. | ||
|
||
For more information visit NXP's product description page for the | ||
[QN9080-DK](https://www.nxp.com/QN9080DK) where you can find the User's | ||
Guide. | ||
|
||
### User Interface | ||
|
||
Buttons: | ||
|
||
| Label | RIOT OS macro | MCU PIN | Function | | ||
|:----- |:------------- |:-------- |:--------- | | ||
| SW1 | BTN1_PIN | PA24 | User defined | | ||
| SW2 | BTN2_PIN | PA19 | User defined | | ||
| SW3 | | nRESET | QN9080 reset | | ||
|
||
|
||
One RGB led, controlled by three GPIOs | ||
|
||
| Label | RIOT OS macro | MCU PIN | | ||
|:----- |:------------- |:-------- | | ||
| red | LED_RED_PIN | PA31 | | ||
| green | LED_GREEN_PIN | PA25 | | ||
| blue | LED_BLUE_PIN | PA13 | | ||
|
||
### Pinout | ||
|
||
Button1: | ||
|
||
### Flash the board | ||
|
||
The board can be flashed using the internal LPC4322 JTAG/SWD debugger or an | ||
external debugger connected to P1, selected using JP2. | ||
|
||
OpenOCD support for the QN908x is experimental and available as pending | ||
[patch](http://openocd.zylin.com/#/c/5584/). | ||
|
||
*/ |
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,69 @@ | ||
/* | ||
* Copyright (C) 2020 iosabi | ||
* | ||
* 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_qn9080dk | ||
* @{ | ||
* | ||
* @file | ||
* @brief Board specific definitions for the QN9080DK base board | ||
* | ||
* @author iosabi <iosabi@protonmail.com> | ||
*/ | ||
|
||
#ifndef BOARD_H | ||
#define BOARD_H | ||
|
||
#include "cpu.h" | ||
#include "periph_conf.h" | ||
#include "periph_cpu.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @name Clock configuration | ||
* @{ | ||
*/ | ||
#ifndef CLOCK_CORECLOCK | ||
/* Using 32MHz internal oscillator as default clock source */ | ||
#define CLOCK_CORECLOCK (32000000ul) | ||
#endif | ||
/** @} */ | ||
|
||
/** | ||
* @name LED configuration | ||
* @{ | ||
*/ | ||
#define LED_RED_PIN GPIO_PIN(PORT_A, 31) | ||
#define LED_GREEN_PIN GPIO_PIN(PORT_A, 25) | ||
#define LED_BLUE_PIN GPIO_PIN(PORT_A, 13) | ||
/** @} */ | ||
|
||
/** | ||
* @name User buttons | ||
* @{ | ||
*/ | ||
#define BTN1_PIN GPIO_PIN(PORT_A, 24) | ||
#define BTN1_MODE GPIO_IN_PU | ||
#define BTN2_PIN GPIO_PIN(PORT_A, 19) | ||
#define BTN2_MODE GPIO_IN_PU | ||
/** @} */ | ||
|
||
/** | ||
* @brief Initialize board specific hardware | ||
*/ | ||
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,71 @@ | ||
/* | ||
* Copyright (C) 2020 iosabi | ||
* | ||
* 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_qn9080dk | ||
* @{ | ||
* | ||
* @file | ||
* @brief Board specific configuration of direct mapped GPIOs | ||
* | ||
* @author iosabi <iosabi@protonmail.com> | ||
*/ | ||
|
||
#ifndef GPIO_PARAMS_H | ||
#define GPIO_PARAMS_H | ||
|
||
#include "board.h" | ||
#include "saul/periph.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief GPIO pin configuration | ||
*/ | ||
static const saul_gpio_params_t saul_gpio_params[] = | ||
{ | ||
{ | ||
.name = "LED red", | ||
.pin = LED_RED_PIN, | ||
.mode = GPIO_OUT, | ||
.flags = SAUL_GPIO_INIT_CLEAR, | ||
}, | ||
{ | ||
.name = "LED green", | ||
.pin = LED_GREEN_PIN, | ||
.mode = GPIO_OUT, | ||
.flags = SAUL_GPIO_INIT_CLEAR, | ||
}, | ||
{ | ||
.name = "LED blue", | ||
.pin = LED_BLUE_PIN, | ||
.mode = GPIO_OUT, | ||
.flags = SAUL_GPIO_INIT_CLEAR, | ||
}, | ||
{ | ||
.name = "Button(SW1)", | ||
.pin = BTN1_PIN, | ||
.mode = BTN1_MODE, | ||
.flags = SAUL_GPIO_INVERTED, | ||
}, | ||
{ | ||
.name = "Button(SW2)", | ||
.pin = BTN2_PIN, | ||
.mode = BTN2_MODE, | ||
.flags = SAUL_GPIO_INVERTED, | ||
}, | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* GPIO_PARAMS_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,49 @@ | ||
/* | ||
* Copyright (C) 2020 iosabi | ||
* | ||
* 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_qn9080dk | ||
* @{ | ||
* | ||
* @file | ||
* @brief Configuration of CPU peripherals for QN9080DK base board board | ||
* | ||
* @author iosabi <iosabi@protonmail.com> | ||
*/ | ||
|
||
#ifndef PERIPH_CONF_H | ||
#define PERIPH_CONF_H | ||
|
||
#include <stdint.h> | ||
|
||
#include "cpu.h" | ||
#include "periph_cpu.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* put here the board peripherals definitions: | ||
- Available clocks | ||
- Timers | ||
- UARTs | ||
- PWMs | ||
- SPIs | ||
- I2C | ||
- ADC | ||
- RTC | ||
- RTT | ||
etc | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* PERIPH_CONF_H */ | ||
/** @} */ |