From 8c40a74f295d93a62a0e7c8a873b6d7abcce19b1 Mon Sep 17 00:00:00 2001 From: Gordon McNab Date: Wed, 6 Oct 2021 17:13:44 +0100 Subject: Sort out board settings. --- hw/bsp/brtmm90x/boards/mm900ev1b/board.h | 56 -------------------------------- hw/bsp/brtmm90x/boards/mm900evxb/board.h | 50 ++++++++++++++++++++++++++++ hw/bsp/brtmm90x/family.c | 6 ++-- src/portable/bridgetek/ft9xx/dcd_ft9xx.c | 3 +- 4 files changed, 55 insertions(+), 60 deletions(-) delete mode 100644 hw/bsp/brtmm90x/boards/mm900ev1b/board.h create mode 100644 hw/bsp/brtmm90x/boards/mm900evxb/board.h diff --git a/hw/bsp/brtmm90x/boards/mm900ev1b/board.h b/hw/bsp/brtmm90x/boards/mm900ev1b/board.h deleted file mode 100644 index 67f61237f..000000000 --- a/hw/bsp/brtmm90x/boards/mm900ev1b/board.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright 2021 Bridgetek Pte Ltd - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * This file is part of the TinyUSB stack. - */ - -#ifndef BOARD_H_ -#define BOARD_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#if defined(__FT900__) -#define GPIO_UART0_TX 48 -#define GPIO_UART0_RX 49 -#define GPIO_ETH_LED0 61 -#define GPIO_ETH_LED1 62 -#define GPIO_REMOTE_WAKEUP_PIN 18 -#define USBD_VBUS_DTC_PIN 3 -#elif defined(__FT930__) -#define GPIO_UART0_TX 23 -#define GPIO_UART0_RX 22 -#define GPIO_ETH_LED0 4 -#define GPIO_ETH_LED1 5 -#define GPIO_REMOTE_WAKEUP_PIN 12 -#define USBD_VBUS_DTC_PIN 39 -#endif - -//#define GPIO_REMOTE_WAKEUP - -#ifdef __cplusplus - } -#endif - -#endif diff --git a/hw/bsp/brtmm90x/boards/mm900evxb/board.h b/hw/bsp/brtmm90x/boards/mm900evxb/board.h new file mode 100644 index 000000000..57936fda5 --- /dev/null +++ b/hw/bsp/brtmm90x/boards/mm900evxb/board.h @@ -0,0 +1,50 @@ +/* + * The MIT License (MIT) + * + * Copyright 2021 Bridgetek Pte Ltd + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * This file is part of the TinyUSB stack. + */ + +#ifndef BOARD_H_ +#define BOARD_H_ + +// Note: This definition file covers all MM900EV1B, MM900EV2B, and MM900EV3B boards. +// Each of these boards has an FT900 device. + +#ifdef __cplusplus + extern "C" { +#endif + +#define GPIO_UART0_TX 48 +#define GPIO_UART0_RX 49 +#define GPIO_ETH_LED0 61 +#define GPIO_ETH_LED1 62 +#define GPIO_REMOTE_WAKEUP_PIN 18 +#define USBD_VBUS_DTC_PIN 3 + +#define GPIO_REMOTE_WAKEUP + +#ifdef __cplusplus + } +#endif + +#endif diff --git a/hw/bsp/brtmm90x/family.c b/hw/bsp/brtmm90x/family.c index 3bd16b817..ed169655e 100644 --- a/hw/bsp/brtmm90x/family.c +++ b/hw/bsp/brtmm90x/family.c @@ -24,10 +24,10 @@ * This file is part of the TinyUSB stack. */ +#include "board.h" +#include "bsp/board.h" #include #include -#include "bsp/board.h" -#include "board.h" #if TUSB_OPT_DEVICE_ENABLED int8_t board_ft90x_vbus(void); // Board specific implementation of VBUS detection for USB device. @@ -42,7 +42,7 @@ volatile unsigned int timer_ms = 0; void board_pm_ISR(void); #define WELCOME_MSG "\x1B[2J\x1B[H" \ - "MM900EV1B board\r\n" + "MM900EVxB board\r\n" // Initialize on-board peripherals : led, button, uart and USB void board_init(void) diff --git a/src/portable/bridgetek/ft9xx/dcd_ft9xx.c b/src/portable/bridgetek/ft9xx/dcd_ft9xx.c index 6dbef1614..9b08702ed 100644 --- a/src/portable/bridgetek/ft9xx/dcd_ft9xx.c +++ b/src/portable/bridgetek/ft9xx/dcd_ft9xx.c @@ -24,8 +24,9 @@ * This file is part of the TinyUSB stack. */ -#include "tusb_option.h" +#include "board.h" #include "bsp/board.h" +#include "tusb_option.h" #if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_FT90X -- cgit v1.3.1