From 226b3e19792f5a8f29fac5da8c8f6ef199d3cdcb Mon Sep 17 00:00:00 2001 From: Not Black Magic <57921089+NotBlackMagic@users.noreply.github.com> Date: Sat, 30 Jul 2022 07:06:09 +0100 Subject: [PATCH] [bsp/imxrt/imxrt/imxrt1060-nxp-evk] (#6195) Fix BSP bugs: -Added Touch INT GPIO Init code to pin_mux.c -Added new delay code for touch/video driver, using the rt-thread delay, in touchpad.c/.h --- .../imxrt1060-nxp-evk/board/MCUX_Config/pin_mux.c | 13 +++++++++++++ bsp/imxrt/imxrt1060-nxp-evk/board/ports/touchpad.c | 7 +++++++ bsp/imxrt/imxrt1060-nxp-evk/board/ports/touchpad.h | 1 + 3 files changed, 21 insertions(+) diff --git a/bsp/imxrt/imxrt1060-nxp-evk/board/MCUX_Config/pin_mux.c b/bsp/imxrt/imxrt1060-nxp-evk/board/MCUX_Config/pin_mux.c index 97683c20be..b843c47b6e 100644 --- a/bsp/imxrt/imxrt1060-nxp-evk/board/MCUX_Config/pin_mux.c +++ b/bsp/imxrt/imxrt1060-nxp-evk/board/MCUX_Config/pin_mux.c @@ -104,6 +104,9 @@ void BOARD_InitPins(void) { IOMUXC_SetPinMux( IOMUXC_GPIO_AD_B0_02_GPIO1_IO02, /* GPIO_AD_B0_02 is configured as GPIO1_IO02 */ 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_AD_B0_11_GPIO1_IO11, /* GPIO_AD_B0_02 is configured as GPIO1_IO02 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ IOMUXC_SetPinMux( IOMUXC_GPIO_AD_B0_12_LPUART1_TX, /* GPIO_AD_B0_12 is configured as LPUART1_TX */ 0U); /* Software Input On Field: Input Path is determined by functionality */ @@ -183,6 +186,16 @@ void BOARD_InitPins(void) { Pull / Keep Select Field: Keeper Pull Up / Down Config. Field: 100K Ohm Pull Down Hyst. Enable Field: Hysteresis Disabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_AD_B0_11_GPIO1_IO11, /* GPIO_AD_B0_11 PAD functional properties : */ + 0x10B0u); /* Slew Rate Field: Slow Slew Rate + Drive Strength Field: R0/6 + Speed Field: medium(100MHz) + Open Drain Enable Field: Open Drain Disabled + Pull / Keep Enable Field: Pull/Keeper Enabled + Pull / Keep Select Field: Keeper + Pull Up / Down Config. Field: 100K Ohm Pull Down + Hyst. Enable Field: Hysteresis Disabled */ IOMUXC_SetPinConfig( IOMUXC_GPIO_AD_B0_12_LPUART1_TX, /* GPIO_AD_B0_12 PAD functional properties : */ 0x10B0u); /* Slew Rate Field: Slow Slew Rate diff --git a/bsp/imxrt/imxrt1060-nxp-evk/board/ports/touchpad.c b/bsp/imxrt/imxrt1060-nxp-evk/board/ports/touchpad.c index 6f8b4e5975..ab95df1ec2 100644 --- a/bsp/imxrt/imxrt1060-nxp-evk/board/ports/touchpad.c +++ b/bsp/imxrt/imxrt1060-nxp-evk/board/ports/touchpad.c @@ -6,6 +6,13 @@ */ #include "touchpad.h" +#include + +void BOARD_Delay(uint32_t ms) +{ + //VIDEO_DelayMs(ms); + rt_thread_mdelay(ms); +} void BOARD_LPI2C_Init(LPI2C_Type *base, uint32_t clkSrc_Hz) { diff --git a/bsp/imxrt/imxrt1060-nxp-evk/board/ports/touchpad.h b/bsp/imxrt/imxrt1060-nxp-evk/board/ports/touchpad.h index bb57d957a6..54681dbc4b 100644 --- a/bsp/imxrt/imxrt1060-nxp-evk/board/ports/touchpad.h +++ b/bsp/imxrt/imxrt1060-nxp-evk/board/ports/touchpad.h @@ -24,6 +24,7 @@ extern "C" { #define BOARD_TOUCH_INT_GPIO GPIO1 #define BOARD_TOUCH_INT_PIN 11 +void BOARD_Delay(uint32_t ms); void BOARD_LPI2C_Init(LPI2C_Type *base, uint32_t clkSrc_Hz); status_t BOARD_LPI2C_Send(LPI2C_Type *base, uint8_t deviceAddress,