/* * Copyright 2020 NXP * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef _BOARD_H_ #define _BOARD_H_ #include "clock_config.h" #include "fsl_common.h" #include "fsl_gpio.h" #include "fsl_clock.h" /******************************************************************************* * Definitions ******************************************************************************/ /*! @brief The board name */ #define BOARD_NAME "MIMXRT1170-EVK" #ifndef DEBUG_CONSOLE_UART_INDEX #define DEBUG_CONSOLE_UART_INDEX 1 #endif /* The UART to use for debug messages. */ #define BOARD_DEBUG_UART_TYPE kSerialPort_Uart #define BOARD_DEBUG_UART_CLK_FREQ 24000000 #if DEBUG_CONSOLE_UART_INDEX == 1 #define BOARD_DEBUG_UART_BASEADDR (uint32_t) LPUART1 #define BOARD_DEBUG_UART_INSTANCE 1U #define BOARD_UART_IRQ LPUART1_IRQn #define BOARD_UART_IRQ_HANDLER LPUART1_IRQHandler #elif DEBUG_CONSOLE_UART_INDEX == 2 #define BOARD_DEBUG_UART_BASEADDR (uint32_t) LPUART2 #define BOARD_DEBUG_UART_INSTANCE 2U #define BOARD_UART_IRQ LPUART2_IRQn #define BOARD_UART_IRQ_HANDLER LPUART2_IRQHandler #elif DEBUG_CONSOLE_UART_INDEX == 12 #define BOARD_DEBUG_UART_BASEADDR (uint32_t) LPUART12 #define BOARD_DEBUG_UART_INSTANCE 12U #define BOARD_UART_IRQ LPUART12_IRQn #define BOARD_UART_IRQ_HANDLER LPUART12_IRQHandler #else #error "Unsupported UART" #endif #ifndef BOARD_DEBUG_UART_BAUDRATE #define BOARD_DEBUG_UART_BAUDRATE (115200U) #endif /* BOARD_DEBUG_UART_BAUDRATE */ /* Definitions for eRPC MU transport layer */ #if defined(FSL_FEATURE_MU_SIDE_A) #define MU_BASE MUA #define MU_IRQ MUA_IRQn #define MU_IRQ_HANDLER MUA_IRQHandler #endif #if defined(FSL_FEATURE_MU_SIDE_B) #define MU_BASE MUB #define MU_IRQ MUB_IRQn #define MU_IRQ_HANDLER MUB_IRQHandler #endif #define MU_IRQ_PRIORITY (2) /*! @brief The USER_LED used for board */ #define LOGIC_LED_ON (0U) #define LOGIC_LED_OFF (1U) #ifndef BOARD_USER_LED_GPIO #define BOARD_USER_LED_GPIO GPIO9 #endif #ifndef BOARD_USER_LED_GPIO_PIN #define BOARD_USER_LED_GPIO_PIN (3U) #endif #define USER_LED_INIT(output) \ GPIO_PinWrite(BOARD_USER_LED_GPIO, BOARD_USER_LED_GPIO_PIN, output); \ BOARD_USER_LED_GPIO->GDIR |= (1U << BOARD_USER_LED_GPIO_PIN) /*!< Enable target USER_LED */ #define USER_LED_OFF() \ GPIO_PortClear(BOARD_USER_LED_GPIO, 1U << BOARD_USER_LED_GPIO_PIN) /*!< Turn off target USER_LED */ #define USER_LED_ON() GPIO_PortSet(BOARD_USER_LED_GPIO, 1U << BOARD_USER_LED_GPIO_PIN) /*!