aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/boards/hvpkv11z75m/project_template/board.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/boards/hvpkv11z75m/project_template/board.h')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/boards/hvpkv11z75m/project_template/board.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/boards/hvpkv11z75m/project_template/board.h b/lib/chibios-contrib/ext/mcux-sdk/boards/hvpkv11z75m/project_template/board.h
new file mode 100644
index 000000000..8d1f8257a
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/boards/hvpkv11z75m/project_template/board.h
@@ -0,0 +1,88 @@
1/*
2 * Copyright (c) 2015, Freescale Semiconductor, Inc.
3 * Copyright 2016-2018 NXP
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8
9#ifndef _BOARD_H_
10#define _BOARD_H_
11
12#include "clock_config.h"
13#include "fsl_gpio.h"
14
15/*******************************************************************************
16 * Definitions
17 ******************************************************************************/
18/*! @brief The board name */
19#define BOARD_NAME "HVP-KV11Z75M"
20
21/*! @brief The UART to use for debug messages. */
22#define BOARD_USE_UART
23#define BOARD_DEBUG_UART_TYPE kSerialPort_Uart
24#define BOARD_DEBUG_UART_BASEADDR (uint32_t) UART1
25#define BOARD_DEBUG_UART_INSTANCE 1U
26#define BOARD_DEBUG_UART_CLKSRC BUS_CLK
27#define BOARD_DEBUG_UART_CLK_FREQ CLOCK_GetBusClkFreq()
28#define BOARD_UART_IRQ UART1_IRQn
29#define BOARD_UART_IRQ_HANDLER UART1_IRQHandler
30
31#ifndef BOARD_DEBUG_UART_BAUDRATE
32#define BOARD_DEBUG_UART_BAUDRATE 115200
33#endif /* BOARD_DEBUG_UART_BAUDRATE */
34
35/*! @brief The instances of peripherals used for dac_adc_demo */
36#define BOARD_ADC_USE_ALT_VREF 1U
37
38/* Board led color mapping */
39#define LOGIC_LED_ON 1U
40#define LOGIC_LED_OFF 0U
41#ifndef BOARD_LED_RED_GPIO
42#define BOARD_LED_RED_GPIO GPIOC
43#endif
44#define BOARD_LED_RED_GPIO_PORT PORTC
45#ifndef BOARD_LED_RED_GPIO_PIN
46#define BOARD_LED_RED_GPIO_PIN 3U
47#endif
48#ifndef BOARD_LED_GREEN_GPIO
49#define BOARD_LED_GREEN_GPIO GPIOD
50#endif
51#define BOARD_LED_GREEN_GPIO_PORT PORTD
52#ifndef BOARD_LED_GREEN_GPIO_PIN
53#define BOARD_LED_GREEN_GPIO_PIN 2U
54#endif
55
56#define LED_RED_INIT(output) \
57 GPIO_PinWrite(BOARD_LED_RED_GPIO, BOARD_LED_RED_GPIO_PIN, output); \
58 BOARD_LED_RED_GPIO->PDDR |= (1U << BOARD_LED_RED_GPIO_PIN) /*!< Enable target LED_RED */
59#define LED_RED_ON() GPIO_PortClear(BOARD_LED_RED_GPIO, 1U << BOARD_LED_RED_GPIO_PIN) /*!< Turn on target LED_RED */
60#define LED_RED_OFF() GPIO_PortSet(BOARD_LED_RED_GPIO, 1U << BOARD_LED_RED_GPIO_PIN) /*!< Turn off target LED_RED */
61#define LED_RED_TOGGLE() \
62 GPIO_PortToggle(BOARD_LED_RED_GPIO, 1U << BOARD_LED_RED_GPIO_PIN) /*!< Toggle on target LED_RED */
63
64#define LED_GREEN_INIT(output) \
65 GPIO_PinWrite(BOARD_LED_GREEN_GPIO, BOARD_LED_GREEN_GPIO_PIN, output); \
66 BOARD_LED_GREEN_GPIO->PDDR |= (1U << BOARD_LED_GREEN_GPIO_PIN) /*!< Enable target LED_GREEN */
67#define LED_GREEN_ON() \
68 GPIO_PortClear(BOARD_LED_GREEN_GPIO, 1U << BOARD_LED_GREEN_GPIO_PIN) /*!< Turn on target LED_GREEN */
69#define LED_GREEN_OFF() \
70 GPIO_PortSet(BOARD_LED_GREEN_GPIO, 1U << BOARD_LED_GREEN_GPIO_PIN) /*!< Turn off target LED_GREEN */
71#define LED_GREEN_TOGGLE() \
72 GPIO_PortToggle(BOARD_LED_GREEN_GPIO, 1U << BOARD_LED_GREEN_GPIO_PIN) /*!< Toggle on target LED_GREEN */
73
74#if defined(__cplusplus)
75extern "C" {
76#endif /* __cplusplus */
77
78/*******************************************************************************
79 * API
80 ******************************************************************************/
81
82void BOARD_InitDebugConsole(void);
83
84#if defined(__cplusplus)
85}
86#endif /* __cplusplus */
87
88#endif /* _BOARD_H_ */