diff --git a/bsp/imxrt1052-evk/.config b/bsp/imxrt1052-evk/.config index a0e1bf8e61ca7e366905c980c737a27d722b8cee..1f147564556a50f90ab7849cc6fcf4abe406aa10 100644 --- a/bsp/imxrt1052-evk/.config +++ b/bsp/imxrt1052-evk/.config @@ -93,11 +93,11 @@ CONFIG_RT_USING_DFS_ELMFAT=y # CONFIG_RT_DFS_ELM_CODE_PAGE=437 CONFIG_RT_DFS_ELM_WORD_ACCESS=y -CONFIG_RT_DFS_ELM_USE_LFN_0=y +# CONFIG_RT_DFS_ELM_USE_LFN_0 is not set # CONFIG_RT_DFS_ELM_USE_LFN_1 is not set # CONFIG_RT_DFS_ELM_USE_LFN_2 is not set -# CONFIG_RT_DFS_ELM_USE_LFN_3 is not set -CONFIG_RT_DFS_ELM_USE_LFN=0 +CONFIG_RT_DFS_ELM_USE_LFN_3=y +CONFIG_RT_DFS_ELM_USE_LFN=3 CONFIG_RT_DFS_ELM_MAX_LFN=255 CONFIG_RT_DFS_ELM_DRIVES=2 CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=512 @@ -117,7 +117,8 @@ CONFIG_RT_USING_DEVICE_IPC=y CONFIG_RT_USING_SERIAL=y # CONFIG_RT_USING_CAN is not set # CONFIG_RT_USING_HWTIMER is not set -# CONFIG_RT_USING_I2C is not set +CONFIG_RT_USING_I2C=y +CONFIG_RT_USING_I2C_BITOPS=y # CONFIG_RT_USING_PIN is not set # CONFIG_RT_USING_MTD_NOR is not set # CONFIG_RT_USING_MTD_NAND is not set @@ -157,7 +158,6 @@ CONFIG_RT_LWIP_DNS=y CONFIG_RT_LWIP_DHCP=y CONFIG_IP_SOF_BROADCAST=1 CONFIG_IP_SOF_BROADCAST_RECV=1 -# CONFIG_LWIP_USING_DHCPD is not set # # Static IPv4 Address @@ -169,8 +169,7 @@ CONFIG_RT_LWIP_UDP=y CONFIG_RT_LWIP_TCP=y # CONFIG_RT_LWIP_RAW is not set # CONFIG_RT_LWIP_PPP is not set -# CONFIG_RT_LWIP_PPPOE is not set -# CONFIG_RT_LWIP_PPPOS is not set +CONFIG_RT_MEMP_NUM_NETCONN=8 CONFIG_RT_LWIP_PBUF_NUM=16 CONFIG_RT_LWIP_RAW_PCB_NUM=4 CONFIG_RT_LWIP_UDP_PCB_NUM=4 @@ -195,12 +194,29 @@ CONFIG_LWIP_SO_RCVBUF=1 # Modbus master and slave stack # # CONFIG_RT_USING_MODBUS is not set +# CONFIG_LWIP_USING_DHCPD is not set # CONFIG_RT_USING_NETUTILS is not set # # RT-Thread UI Engine # -# CONFIG_RT_USING_GUIENGINE is not set +CONFIG_RT_USING_GUIENGINE=y +CONFIG_RTGUI_NAME_MAX=16 +CONFIG_RTGUI_USING_TTF=y +CONFIG_UTF8_TO_UNICODE=y +CONFIG_RTGUI_USING_FONT16=y +CONFIG_RTGUI_USING_FONT12=y +# CONFIG_RTGUI_USING_FONTHZ is not set +# CONFIG_RTGUI_IMAGE_XPM is not set +CONFIG_RTGUI_IMAGE_JPEG_NONE=y +# CONFIG_RTGUI_IMAGE_JPEG is not set +# CONFIG_RTGUI_IMAGE_TJPGD is not set +# CONFIG_RTGUI_IMAGE_PNG_NONE is not set +# CONFIG_RTGUI_IMAGE_PNG is not set +CONFIG_RTGUI_IMAGE_LODEPNG=y +# CONFIG_RTGUI_IMAGE_BMP is not set +CONFIG_RTGUI_IMAGE_CONTAINER=y +# CONFIG_RTGUI_USING_DEMO is not set # # VBUS(Virtual Software BUS) @@ -240,6 +256,7 @@ CONFIG_LWIP_SO_RCVBUF=1 # # CONFIG_PKG_USING_MBEDTLS is not set # CONFIG_PKG_USING_libsodium is not set +# CONFIG_PKG_USING_TINYCRYPT is not set # # language packages @@ -250,6 +267,7 @@ CONFIG_LWIP_SO_RCVBUF=1 # # multimedia packages # +# CONFIG_PKG_USING_OPENMV is not set # # tools packages @@ -257,6 +275,7 @@ CONFIG_LWIP_SO_RCVBUF=1 # CONFIG_PKG_USING_CMBACKTRACE is not set # CONFIG_PKG_USING_EASYLOGGER is not set # CONFIG_PKG_USING_SYSTEMVIEW is not set +# CONFIG_PKG_USING_IPERF is not set # # miscellaneous packages diff --git a/bsp/imxrt1052-evk/drivers/SConscript b/bsp/imxrt1052-evk/drivers/SConscript index 8d3ac8f41ece0c581df43d84a89043a2964c4e12..6b15f249eafbfd9126276ddc343782db5b42eef1 100644 --- a/bsp/imxrt1052-evk/drivers/SConscript +++ b/bsp/imxrt1052-evk/drivers/SConscript @@ -21,6 +21,9 @@ if GetDepend('RT_USING_LWIP'): if GetDepend('RT_USING_SDIO'): src += ['drv_sdio.c'] + +if GetDepend('RT_USING_RTGUI') or GetDepend('RT_USING_GUIENGINE'): + src += ['drv_lcd.c', 'drv_ft5406.c', 'drv_i2c.c'] group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES) diff --git a/bsp/imxrt1052-evk/drivers/board.c b/bsp/imxrt1052-evk/drivers/board.c index 23da11c539abccecb966b9587792a5a53ddf4b25..e5d192f96284ebf080b40c75dcbb1e860bcb293a 100644 --- a/bsp/imxrt1052-evk/drivers/board.c +++ b/bsp/imxrt1052-evk/drivers/board.c @@ -173,7 +173,6 @@ void rt_hw_board_init() { BOARD_BootClockRUN(); - SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND); #ifdef RT_USING_COMPONENTS_INIT @@ -193,4 +192,24 @@ void rt_hw_board_init() #endif } +#ifdef RT_USING_GUIENGINE +#include +#include "drv_lcd.h" + +/* initialize for gui driver */ +int rtgui_lcd_init(void) +{ + rt_device_t device; + + imxrt_hw_lcd_init(); + + device = rt_device_find("lcd"); + /* set graphic device */ + rtgui_graphic_set_device(device); + + return 0; +} +INIT_DEVICE_EXPORT(rtgui_lcd_init); +#endif + /*@}*/ diff --git a/bsp/imxrt1052-evk/drivers/drv_eth.c b/bsp/imxrt1052-evk/drivers/drv_eth.c index 79139753d9d611990ab652c95be70f0a3994a27b..2678336c8397e74630795b405ac3969112f24766 100644 --- a/bsp/imxrt1052-evk/drivers/drv_eth.c +++ b/bsp/imxrt1052-evk/drivers/drv_eth.c @@ -36,8 +36,6 @@ #define PHY_ADDRESS 0x02u - - /* debug option */ //#define ETH_RX_DUMP //#define ETH_TX_DUMP @@ -50,7 +48,6 @@ #define MAX_ADDR_LEN 6 - struct rt_imxrt_eth { /* inherit from ethernet device */ @@ -63,6 +60,9 @@ struct rt_imxrt_eth rt_bool_t tx_is_waiting; struct rt_semaphore tx_wait; + + enet_mii_speed_t speed; + enet_mii_duplex_t duplex; }; ALIGN(ENET_BUFF_ALIGNMENT) enet_tx_bd_struct_t g_txBuffDescrip[ENET_TXBD_NUM] SECTION("NonCacheable"); @@ -351,10 +351,6 @@ static void _enet_config(void) { enet_config_t config; uint32_t sysClock; - status_t status; - phy_speed_t speed; - phy_duplex_t duplex; - bool link = false; /* prepare the buffer configuration. */ enet_buffer_config_t buffConfig = { @@ -378,48 +374,26 @@ static void _enet_config(void) ENET_GetDefaultConfig(&config); config.interrupt = kENET_TxFrameInterrupt | kENET_RxFrameInterrupt; //config.interrupt = 0xFFFFFFFF; + config.miiSpeed = imxrt_eth_device.speed; + config.miiDuplex = imxrt_eth_device.duplex; /* Set SMI to get PHY link status. */ sysClock = CLOCK_GetFreq(kCLOCK_AhbClk); - status = PHY_Init(imxrt_eth_device.enet_base, PHY_ADDRESS, sysClock); - - if (status == kStatus_Success) - { - PHY_GetLinkStatus(imxrt_eth_device.enet_base, PHY_ADDRESS, &link); - if (link) - { - /* Get the actual PHY link speed. */ - PHY_GetLinkSpeedDuplex(imxrt_eth_device.enet_base, PHY_ADDRESS, &speed, &duplex); - /* Change the MII speed and duplex for actual link status. */ - config.miiSpeed = (enet_mii_speed_t)speed; - config.miiDuplex = (enet_mii_duplex_t)duplex; - } - - dbg_log(DBG_LOG, "PHY Auto-negotiation success.\n"); - eth_device_linkchange(&imxrt_eth_device.parent, RT_TRUE); - } - else - { - config.miiSpeed = kENET_MiiSpeed10M; - config.miiDuplex = kENET_MiiHalfDuplex; - - dbg_log(DBG_WARNING, "PHY Auto-negotiation failed. Please check the cable connection and link partner setting.\n"); - eth_device_linkchange(&imxrt_eth_device.parent, RT_FALSE); - } - + dbg_log(DBG_LOG, "deinit\n"); + ENET_Deinit(imxrt_eth_device.enet_base); + dbg_log(DBG_LOG, "init\n"); ENET_Init(imxrt_eth_device.enet_base, &imxrt_eth_device.enet_handle, &config, &buffConfig, &imxrt_eth_device.dev_addr[0], sysClock); + dbg_log(DBG_LOG, "set call back\n"); ENET_SetCallback(&imxrt_eth_device.enet_handle, _enet_callback, &imxrt_eth_device); + dbg_log(DBG_LOG, "active read\n"); ENET_ActiveRead(imxrt_eth_device.enet_base); } /* initialize the interface */ static rt_err_t rt_imxrt_eth_init(rt_device_t dev) { - _enet_io_init(); - _enet_clk_init(); - _enet_phy_reset_by_gpio(); - + dbg_log(DBG_LOG, "rt_imxrt_eth_init...\n"); _enet_config(); return RT_EOK; @@ -576,10 +550,81 @@ struct pbuf *rt_imxrt_eth_rx(rt_device_t dev) return NULL; } +static void phy_monitor_thread_entry(void *parameter) +{ + + phy_speed_t speed; + phy_duplex_t duplex; + bool link = false; + + _enet_phy_reset_by_gpio(); + + PHY_Init(imxrt_eth_device.enet_base, PHY_ADDRESS, CLOCK_GetFreq(kCLOCK_AhbClk)); + + while (1) + { + bool new_link = false; + status_t status = PHY_GetLinkStatus(imxrt_eth_device.enet_base, PHY_ADDRESS, &new_link); + + if ((status == kStatus_Success) && (link != new_link)) + { + link = new_link; + + if (link) // link up + { + PHY_GetLinkSpeedDuplex(imxrt_eth_device.enet_base, PHY_ADDRESS, &speed, &duplex); + + if (kENET_MiiSpeed10M == speed) + { + dbg_log(DBG_LOG, "10M\n"); + } + else + { + dbg_log(DBG_LOG, "100M\n"); + } + + if (kENET_MiiHalfDuplex == duplex) + { + dbg_log(DBG_LOG, "half dumplex\n"); + } + else + { + dbg_log(DBG_LOG, "full dumplex\n"); + } + + if ((imxrt_eth_device.speed != speed) || (imxrt_eth_device.duplex != duplex)) + { + imxrt_eth_device.speed = (enet_mii_speed_t)speed; + imxrt_eth_device.duplex = (enet_mii_duplex_t)duplex; + + dbg_log(DBG_LOG, "link up, and update eth mode.\n"); + rt_imxrt_eth_init((rt_device_t)&imxrt_eth_device); + } + else + { + dbg_log(DBG_LOG, "link up, eth not need re-config.\n"); + } + dbg_log(DBG_LOG, "link up.\n"); + eth_device_linkchange(&imxrt_eth_device.parent, RT_TRUE); + } + else // link down + { + dbg_log(DBG_LOG, "link down.\n"); + eth_device_linkchange(&imxrt_eth_device.parent, RT_FALSE); + } + } + + rt_thread_delay(RT_TICK_PER_SECOND * 2); + } +} + static int rt_hw_imxrt_eth_init(void) { rt_err_t state; + _enet_io_init(); + _enet_clk_init(); + /* OUI 00-80-E1 STMICROELECTRONICS. */ imxrt_eth_device.dev_addr[0] = 0x00; imxrt_eth_device.dev_addr[1] = 0x80; @@ -588,6 +633,9 @@ static int rt_hw_imxrt_eth_init(void) imxrt_eth_device.dev_addr[3] = 0x12; imxrt_eth_device.dev_addr[4] = 0x34; imxrt_eth_device.dev_addr[5] = 0x56; + + imxrt_eth_device.speed = kENET_MiiSpeed100M; + imxrt_eth_device.duplex = kENET_MiiFullDuplex; imxrt_eth_device.enet_base = ENET; @@ -617,6 +665,22 @@ static int rt_hw_imxrt_eth_init(void) { dbg_log(DBG_LOG, "eth_device_init faild: %d\r\n", state); } + + eth_device_linkchange(&imxrt_eth_device.parent, RT_FALSE); + + /* start phy monitor */ + { + rt_thread_t tid; + tid = rt_thread_create("phy", + phy_monitor_thread_entry, + RT_NULL, + 512, + RT_THREAD_PRIORITY_MAX - 2, + 2); + if (tid != RT_NULL) + rt_thread_startup(tid); + } + return state; } INIT_DEVICE_EXPORT(rt_hw_imxrt_eth_init); diff --git a/bsp/imxrt1052-evk/drivers/drv_ft5406.c b/bsp/imxrt1052-evk/drivers/drv_ft5406.c new file mode 100644 index 0000000000000000000000000000000000000000..3acfe2db59606cae15220f720fb981ed2cb0b378 --- /dev/null +++ b/bsp/imxrt1052-evk/drivers/drv_ft5406.c @@ -0,0 +1,358 @@ +/* + * File : drv_ft5406.c + * FT5406 touch driver + * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Change Logs: + * Date Author Notes + * 2017-08-08 Yang the first version + */ + +#include +#include +#include + +#define RT_USING_RTGUI + +#ifdef RT_USING_RTGUI +#include +#include +#endif + +#include "board.h" + +#include "fsl_gpio.h" +#include "fsl_lpi2c.h" + +#define BSP_TOUCH_SAMPLE_HZ 30 + +#define I2CBUS_NAME "i2c0" + +#if 0 +#define FTDEBUG rt_kprintf +#else +#define FTDEBUG(...) +#endif + +#define TOUCH_SLP_TIME (RT_TICK_PER_SECOND * 5) + +#define FT5206_TS_ADDR 0x38 +#define TP_MAX_TOUCH_POINT 2 + +enum ft5x0x_ts_regs +{ + FT5X0X_REG_THGROUP = 0x80, + FT5X0X_REG_THPEAK = 0x81, + FT5X0X_REG_THCAL = 0x82, + FT5X0X_REG_THWATER = 0x83, + FT5X0X_REG_THTEMP = 0x84, + FT5X0X_REG_THDIFF = 0x85, + FT5X0X_REG_CTRL = 0x86, + FT5X0X_REG_TIMEENTERMONITOR = 0x87, + FT5X0X_REG_PERIODACTIVE = 0x88, + FT5X0X_REG_PERIODMONITOR = 0x89, + FT5X0X_REG_HEIGHT_B = 0x8a, + FT5X0X_REG_MAX_FRAME = 0x8b, + FT5X0X_REG_DIST_MOVE = 0x8c, + FT5X0X_REG_DIST_POINT = 0x8d, + FT5X0X_REG_FEG_FRAME = 0x8e, + FT5X0X_REG_SINGLE_CLICK_OFFSET = 0x8f, + FT5X0X_REG_DOUBLE_CLICK_TIME_MIN = 0x90, + FT5X0X_REG_SINGLE_CLICK_TIME = 0x91, + FT5X0X_REG_LEFT_RIGHT_OFFSET = 0x92, + FT5X0X_REG_UP_DOWN_OFFSET = 0x93, + FT5X0X_REG_DISTANCE_LEFT_RIGHT = 0x94, + FT5X0X_REG_DISTANCE_UP_DOWN = 0x95, + FT5X0X_REG_ZOOM_DIS_SQR = 0x96, + FT5X0X_REG_RADIAN_VALUE = 0x97, + FT5X0X_REG_MAX_X_HIGH = 0x98, + FT5X0X_REG_MAX_X_LOW = 0x99, + FT5X0X_REG_MAX_Y_HIGH = 0x9a, + FT5X0X_REG_MAX_Y_LOW = 0x9b, + FT5X0X_REG_K_X_HIGH = 0x9c, + FT5X0X_REG_K_X_LOW = 0x9d, + FT5X0X_REG_K_Y_HIGH = 0x9e, + FT5X0X_REG_K_Y_LOW = 0x9f, + FT5X0X_REG_AUTO_CLB_MODE = 0xa0, + FT5X0X_REG_LIB_VERSION_H = 0xa1, + FT5X0X_REG_LIB_VERSION_L = 0xa2, + FT5X0X_REG_CIPHER = 0xa3, + FT5X0X_REG_G_MODE = 0xa4, + FT5X0X_REG_PMODE = 0xa5, /* Power Consume Mode */ + FT5X0X_REG_FIRMID = 0xa6, + FT5X0X_REG_STATE = 0xa7, + FT5X0X_REG_VENDID = 0xa8, + FT5X0X_REG_ERR = 0xa9, + FT5X0X_REG_CLB = 0xaa, +}; + +#define CTRL_NOAUTO_MONITOR 0x00 +#define CTRL_AUTO_MONITOR 0x01 + +#define PMODE_ACTIVE 0x00 +#define PMODE_MONITOR 0x01 +#define PMODE_STANDBY 0x02 +#define PMODE_HIBERNATE 0x03 + +#define G_MODE_POLLING 0x00 +#define G_MODE_TRIGGER 0x01 + +typedef enum _touch_event +{ + kTouch_Down = 0, /*!< The state changed to touched. */ + kTouch_Up = 1, /*!< The state changed to not touched. */ + kTouch_Contact = 2, /*!< There is a continuous touch being detected. */ + kTouch_Reserved = 3 /*!< No touch information available. */ +} touch_event_t; + +typedef struct _touch_point +{ + touch_event_t TOUCH_EVENT; /*!< Indicates the state or event of the touch point. */ + uint8_t TOUCH_ID; /*!< Id of the touch point. This numeric value stays constant between down and up event. */ + uint16_t TOUCH_X; /*!< X coordinate of the touch point */ + uint16_t TOUCH_Y; /*!< Y coordinate of the touch point */ +} touch_point_t; + +typedef struct _ft5406_touch_point +{ + uint8_t XH; + uint8_t XL; + uint8_t YH; + uint8_t YL; + uint8_t RESERVED[2]; +} ft5406_touch_point_t; + +typedef struct _ft5406_touch_data +{ + uint8_t DEVIDE_MODE; + uint8_t GEST_ID; + uint8_t TD_STATUS; + ft5406_touch_point_t TOUCH; +} ft5406_touch_data_t; + +#define TOUCH_POINT_GET_EVENT(T) ((touch_event_t)((T).XH >> 6)) +#define TOUCH_POINT_GET_ID(T) ((T).YH >> 4) +#define TOUCH_POINT_GET_X(T) ((((T).XH & 0x0f) << 8) | (T).XL) +#define TOUCH_POINT_GET_Y(T) ((((T).YH & 0x0f) << 8) | (T).YL) + +static struct rt_i2c_bus_device *_i2c_bus; +static struct rt_semaphore _tp_sem; + +static int _ft5406_read(unsigned char cmd, + void *buf, + size_t len) +{ + struct rt_i2c_msg msgs[2]; + + msgs[0].addr = FT5206_TS_ADDR; + msgs[0].flags = RT_I2C_WR; + msgs[0].buf = &cmd; + msgs[0].len = sizeof(cmd); + + msgs[1].addr = FT5206_TS_ADDR; + msgs[1].flags = RT_I2C_RD; + msgs[1].buf = buf; + msgs[1].len = len; + + if (rt_i2c_transfer(_i2c_bus, msgs, 2) == 2) + return len; + else + return -1; +} + +static int ft5406_read_touch(touch_point_t *dp) +{ + ft5406_touch_data_t touch_data; + + _ft5406_read(0, &touch_data, sizeof(ft5406_touch_data_t)); + + FTDEBUG("GEST_ID: %02x, TD_STATUS: %02x\n", touch_data.GEST_ID, touch_data.TD_STATUS); + FTDEBUG("XH: %02x, XL: %02x, XH: %02x, XH: %02x, XH: %02x, RESERVED[0]: %02x, RESERVED[1]: %02x\n", + touch_data.TOUCH.XH, touch_data.TOUCH.XL, + touch_data.TOUCH.YH, touch_data.TOUCH.YL, + touch_data.TOUCH.RESERVED[0], touch_data.TOUCH.RESERVED[1]); + + dp->TOUCH_X = TOUCH_POINT_GET_Y(touch_data.TOUCH); + dp->TOUCH_Y = TOUCH_POINT_GET_X(touch_data.TOUCH); + + FTDEBUG(" ==> status : %d (%d, %d)\n", touch_data.TD_STATUS, dp->TOUCH_X, dp->TOUCH_Y); + + if (touch_data.TD_STATUS != 0) + return 0; + else + return -1; +} + +static void _touch_session() +{ + touch_point_t tpd; +#ifdef RT_USING_RTGUI + struct rtgui_event_mouse emouse; +#endif + + ft5406_read_touch(&tpd); + +#ifdef RT_USING_RTGUI + emouse.parent.sender = RT_NULL; + emouse.wid = RT_NULL; + + emouse.parent.type = RTGUI_EVENT_MOUSE_BUTTON; + emouse.button = RTGUI_MOUSE_BUTTON_LEFT | RTGUI_MOUSE_BUTTON_DOWN; + emouse.x = tpd.TOUCH_X; + emouse.y = tpd.TOUCH_Y; + emouse.ts = rt_tick_get(); + emouse.id = emouse.ts; + if (emouse.id == 0) emouse.id = 1; + rtgui_server_post_event(&emouse.parent, sizeof(emouse)); +#endif + + do + { + rt_thread_delay(RT_TICK_PER_SECOND / BSP_TOUCH_SAMPLE_HZ); + if (ft5406_read_touch(&tpd) != 0) + break; + +#ifdef RT_USING_RTGUI + emouse.parent.type = RTGUI_EVENT_MOUSE_MOTION; + emouse.x = tpd.TOUCH_X; + emouse.y = tpd.TOUCH_Y; + emouse.ts = rt_tick_get(); + rtgui_server_post_event(&emouse.parent, sizeof(emouse)); +#endif + } + while (1); + +#ifdef RT_USING_RTGUI + /* Always send touch up event. */ + emouse.parent.type = RTGUI_EVENT_MOUSE_BUTTON; + emouse.button = RTGUI_MOUSE_BUTTON_LEFT | RTGUI_MOUSE_BUTTON_UP; + emouse.x = tpd.TOUCH_X; + emouse.y = tpd.TOUCH_Y; + emouse.ts = rt_tick_get(); + rtgui_server_post_event(&emouse.parent, sizeof(emouse)); +#endif + + //} while (rt_sem_take(&_tp_sem, TOUCH_SLP_TIME) == RT_EOK); +} + +void touch_down(void) +{ + rt_sem_release(&_tp_sem); +} + +static void _touch(void *p) +{ + int io_s; + + gpio_pin_config_t pin_config = + { + kGPIO_DigitalInput, 0, + }; + + IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_11_GPIO1_IO11, 0U); + + /* Enable touch panel controller */ + GPIO_PinInit(GPIO1, 11, &pin_config); + + while(1) + { + rt_thread_delay(RT_TICK_PER_SECOND / 60); + + io_s = GPIO_ReadPinInput(GPIO1, 11); + if (io_s == 0) + { + _touch_session(); + } + else + continue; + } +} + +static rt_device_t _i2c_find(const char *name) +{ + rt_device_t dev; + + dev = rt_device_find(name); + if (!dev) + { + rt_kprintf("search device failed: %s\n", name); + return RT_NULL; + } + + if (rt_device_open(dev, RT_DEVICE_OFLAG_RDWR) != RT_EOK) + { + rt_kprintf("open device failed: %s\n", name); + return RT_NULL; + } + + rt_kprintf("open i2c bus: %s\n", name); + + return dev; +} + +static void ft5406_hw_reset(void) +{ + gpio_pin_config_t pin_config = + { + kGPIO_DigitalOutput, 0, + }; + + CLOCK_EnableClock(kCLOCK_Gpio1); + + IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_02_GPIO1_IO02, 0U); + IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_02_GPIO1_IO02, 0x10B0u); + + /* Enable touch panel controller */ + GPIO_PinInit(GPIO1, 2, &pin_config); + GPIO_WritePinOutput(GPIO1, 2, 1); + rt_thread_delay(RT_TICK_PER_SECOND / 20); + GPIO_WritePinOutput(GPIO1, 2, 0); + rt_thread_delay(RT_TICK_PER_SECOND / 20); + GPIO_WritePinOutput(GPIO1, 2, 1); +} + +int ft5406_hw_init(void) +{ + rt_thread_t tid; + + rt_device_t dev = _i2c_find(I2CBUS_NAME); + if (dev == RT_NULL) + { + FTDEBUG("search i2c device faild: %s\n", I2CBUS_NAME); + return -1; + } + else + { + FTDEBUG("ft5406 set i2c bus to %s\n", I2CBUS_NAME); + _i2c_bus = (struct rt_i2c_bus_device *)dev; + } + + ft5406_hw_reset(); + + rt_sem_init(&_tp_sem, "touch", 0, RT_IPC_FLAG_FIFO); + tid = rt_thread_create("touch", _touch, RT_NULL, 2048, 10, 20); + if (!tid) + { + rt_device_close(dev); + return -1; + } + + rt_thread_startup(tid); + + return 0; +} +INIT_APP_EXPORT(ft5406_hw_init); diff --git a/bsp/imxrt1052-evk/drivers/drv_i2c.c b/bsp/imxrt1052-evk/drivers/drv_i2c.c new file mode 100644 index 0000000000000000000000000000000000000000..38a3c45482b0e6b50882348814a916912ded1d2d --- /dev/null +++ b/bsp/imxrt1052-evk/drivers/drv_i2c.c @@ -0,0 +1,266 @@ +/* + * File : drv_i2c.c + * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Change Logs: + * Date Author Notes + * 2017-08-08 Yang the first version + */ + +#include +#include +#include "board.h" +#include "fsl_gpio.h" +#include "fsl_lpi2c.h" + +//#define DRV_I2C_DEBUG + +#ifdef RT_USING_I2C + +#ifdef RT_USING_I2C_BITOPS + +#define I2CBUS_NAME "i2c0" + +struct stm32_i2c_bit_data +{ + struct + { + GPIO_Type *base; + uint32_t pin; + } scl, sda; +}; + +static void gpio_udelay(rt_uint32_t us) +{ + volatile rt_int32_t i; + for (; us > 0; us--) + { + i = 1000; + while (i--); + } +} + +static void gpio_set_input(GPIO_Type* base, uint32_t pin) +{ + if (base->GDIR & (1 << pin)) //output mode + { + base->GDIR &= ~(1 << pin); + gpio_udelay(5); + } +} + +static void gpio_set_output(GPIO_Type* base, uint32_t pin) +{ + if (!(base->GDIR & (1 << pin))) //input mode + { + base->GDIR |= (1 << pin); + gpio_udelay(5); + } +} + +static void gpio_set_sda(void *data, rt_int32_t state) +{ + struct stm32_i2c_bit_data *bd = data; + + gpio_set_output(bd->sda.base, bd->sda.pin); + + GPIO_PinWrite(bd->sda.base, bd->sda.pin, !!state); +} + +static void gpio_set_scl(void *data, rt_int32_t state) +{ + struct stm32_i2c_bit_data *bd = data; + + gpio_set_output(bd->scl.base, bd->scl.pin); + + GPIO_PinWrite(bd->scl.base, bd->scl.pin, !!state); +} + +static rt_int32_t gpio_get_sda(void *data) +{ + struct stm32_i2c_bit_data *bd = data; + + gpio_set_input(bd->sda.base, bd->sda.pin); + + return GPIO_ReadPinInput(bd->sda.base, bd->sda.pin); +} + +static rt_int32_t gpio_get_scl(void *data) +{ + struct stm32_i2c_bit_data *bd = data; + + gpio_set_input(bd->scl.base, bd->scl.pin); + + return GPIO_ReadPinInput(bd->scl.base, bd->scl.pin); +} + + +#else /* RT_USING_I2C_BITOPS */ + // todo : add hardware i2c +#endif /* RT_USING_I2C_BITOPS */ + +int rt_hw_i2c_init(void) +{ +#ifdef RT_USING_I2C_BITOPS + /* register I2C1: SCL/P0_20 SDA/P0_19 */ + { + static struct rt_i2c_bus_device i2c_device; + + static const struct stm32_i2c_bit_data _i2c_bdata = + { + /* SCL */ {GPIO1, 16}, + /* SDA */ {GPIO1, 17}, + }; + + static const struct rt_i2c_bit_ops _i2c_bit_ops = + { + (void*)&_i2c_bdata, + gpio_set_sda, + gpio_set_scl, + gpio_get_sda, + gpio_get_scl, + + gpio_udelay, + + 50, + 1000 + }; + + gpio_pin_config_t pin_config = { + kGPIO_DigitalOutput, 0, + }; + + CLOCK_EnableClock(kCLOCK_Iomuxc); + + IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_00_GPIO1_IO16, 1U); + IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_00_GPIO1_IO16, + 0xD8B0u); /* Slew Rate Field: Slow Slew Rate + Drive Strength Field: R0/6 + Speed Field: medium(100MHz) + Open Drain Enable Field: Open Drain Enabled + Pull / Keep Enable Field: Pull/Keeper Enabled + Pull / Keep Select Field: Keeper + Pull Up / Down Config. Field: 22K Ohm Pull Up + Hyst. Enable Field: Hysteresis Disabled */ + IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_01_GPIO1_IO17, 1U); + IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_01_GPIO1_IO17, + 0xD8B0u); /* Slew Rate Field: Slow Slew Rate + Drive Strength Field: R0/6 + Speed Field: medium(100MHz) + Open Drain Enable Field: Open Drain Enabled + Pull / Keep Enable Field: Pull/Keeper Enabled + Pull / Keep Select Field: Keeper + Pull Up / Down Config. Field: 22K Ohm Pull Up + Hyst. Enable Field: Hysteresis Disabled */ + /* Enable touch panel controller */ + GPIO_PinInit(_i2c_bdata.sda.base, _i2c_bdata.sda.pin, &pin_config); + GPIO_PinInit(_i2c_bdata.scl.base, _i2c_bdata.scl.pin, &pin_config); + + GPIO_PortSet(_i2c_bdata.sda.base, _i2c_bdata.sda.pin); + GPIO_PortSet(_i2c_bdata.scl.base, _i2c_bdata.scl.pin); + + //RT_ASSERT(gpio_get_scl(&_i2c_bdata) != 0); + //RT_ASSERT(gpio_get_sda(&_i2c_bdata) != 0); + + i2c_device.priv = (void *)&_i2c_bit_ops; + rt_i2c_bit_add_bus(&i2c_device, I2CBUS_NAME); + } /* register I2C */ + +#else /* RT_USING_I2C_BITOPS */ + // Todo : add hardware i2c + +#endif /* RT_USING_I2C_BITOPS */ + + return 0; +} +INIT_DEVICE_EXPORT(rt_hw_i2c_init); + +#if defined(RT_USING_FINSH) && defined(DRV_I2C_DEBUG) +#include + +static rt_device_t _i2c_find(const char *name) +{ + rt_device_t dev; + + dev = rt_device_find(name); + if (!dev) + { + rt_kprintf("search device failed: %s\n", name); + return RT_NULL; + } + + if (rt_device_open(dev, RT_DEVICE_OFLAG_RDWR) != RT_EOK) + { + rt_kprintf("open device failed: %s\n", name); + return RT_NULL; + } + + rt_kprintf("open i2c bus: %s\n", name); + + return dev; +} + +static void _search_i2c_device(rt_device_t dev, uint8_t cmd) +{ + int count = 0; + struct rt_i2c_msg msgs[2]; + uint8_t buf = 0; + + msgs[0].flags = RT_I2C_WR; + msgs[0].buf = &cmd; + msgs[0].len = sizeof(cmd); + + msgs[1].flags = RT_I2C_RD; + msgs[1].buf = &buf; + msgs[1].len = 1; + + for (int i = 0; i <= 0x7f; i++) + { + int len; + + msgs[0].addr = i; + msgs[1].addr = i; + len = rt_i2c_transfer(dev, msgs, 2); + if (len == 2) + { + count++; + rt_kprintf("add:%02X transfer success, id: %02X\n", i, buf); + } + } + + rt_kprintf("i2c device: %d\n", count); +} + +static int i2c_test(const char *name, uint8_t cmd) +{ + rt_device_t dev = _i2c_find(name); + if (dev == RT_NULL) + { + rt_kprintf("search i2c device faild\n"); + return -1; + } + + _search_i2c_device(dev, cmd); + + rt_device_close(dev); + + return 0; +} +FINSH_FUNCTION_EXPORT(i2c_test, e.g: i2c_test("i2c0", 0xA3)); +#endif + +#endif /* RT_USING_I2C */ diff --git a/bsp/imxrt1052-evk/drivers/drv_lcd.c b/bsp/imxrt1052-evk/drivers/drv_lcd.c new file mode 100644 index 0000000000000000000000000000000000000000..c6644844cae3655abc0e3b0a9a129bd602e9e012 --- /dev/null +++ b/bsp/imxrt1052-evk/drivers/drv_lcd.c @@ -0,0 +1,688 @@ +/* + * File : usart.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2009, RT-Thread Development Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rt-thread.org/license/LICENSE + * + * Change Logs: + * Date Author Notes + * 2017-10-30 Tanek the first version + */ + +#include +#include + +#include "fsl_common.h" +#include "fsl_elcdif.h" +#include "fsl_gpio.h" + +//#define LCD_DEBUG + +#ifdef RT_USING_GUIENGINE + +#define APP_HSW 41 +#define APP_HFP 4 +#define APP_HBP 8 +#define APP_VSW 10 +#define APP_VFP 4 +#define APP_VBP 2 +#define APP_POL_FLAGS \ + (kELCDIF_DataEnableActiveHigh | kELCDIF_VsyncActiveLow | kELCDIF_HsyncActiveLow | kELCDIF_DriveDataOnRisingClkEdge) + +#define FRAME_BUFFER_ALIGN 64 + +#define LCD_PIXEL_T uint16_t +#define LCD_BITS_PER_PIXEL (sizeof(LCD_PIXEL_T) * 8) + +#define LCD_INIT_DATA (0x00) + + +/* Display. */ +#define LCD_DISP_GPIO GPIO1 +#define LCD_DISP_GPIO_PIN 2 +/* Back light. */ +#define LCD_BL_GPIO GPIO2 +#define LCD_BL_GPIO_PIN 31 + +#define APP_ELCDIF LCDIF +#define APP_LCDIF_DATA_BUS kELCDIF_DataBus16Bit +#define FRAME_BUFFER_COUNT 2 + +#define RT_HW_LCD_WIDTH ((uint16_t)800) /* LCD PIXEL WIDTH */ +#define RT_HW_LCD_HEIGHT ((uint16_t)480) /* LCD PIXEL HEIGHT */ + +ALIGN(FRAME_BUFFER_ALIGN) +static LCD_PIXEL_T lcdif_frame_buffer[FRAME_BUFFER_COUNT][RT_HW_LCD_HEIGHT][RT_HW_LCD_WIDTH] SECTION("NonCacheable"); + + +#ifdef LCD_DEBUG +static volatile bool s_frameDone = false; +#endif + +struct imxrt_lcd_t +{ + struct rt_device_graphic_info lcd_info; + struct rt_device lcd; + struct rt_semaphore lcd_sem; + rt_uint32_t index; //lcd buffer + LCD_PIXEL_T * framebuffer; + bool update; +}; + +static struct imxrt_lcd_t imxrt_lcd; + +static void _lcd_gpio_config(void) +{ + CLOCK_EnableClock(kCLOCK_Iomuxc); /* iomuxc clock (iomuxc_clk_enable): 0x03u */ + + 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_B0_00_LCD_CLK, /* GPIO_B0_00 is configured as LCD_CLK */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_01_LCD_ENABLE, /* GPIO_B0_01 is configured as LCD_ENABLE */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_02_LCD_HSYNC, /* GPIO_B0_02 is configured as LCD_HSYNC */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_03_LCD_VSYNC, /* GPIO_B0_03 is configured as LCD_VSYNC */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_04_LCD_DATA00, /* GPIO_B0_04 is configured as LCD_DATA00 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_05_LCD_DATA01, /* GPIO_B0_05 is configured as LCD_DATA01 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_06_LCD_DATA02, /* GPIO_B0_06 is configured as LCD_DATA02 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_07_LCD_DATA03, /* GPIO_B0_07 is configured as LCD_DATA03 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_08_LCD_DATA04, /* GPIO_B0_08 is configured as LCD_DATA04 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_09_LCD_DATA05, /* GPIO_B0_09 is configured as LCD_DATA05 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_10_LCD_DATA06, /* GPIO_B0_10 is configured as LCD_DATA06 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_11_LCD_DATA07, /* GPIO_B0_11 is configured as LCD_DATA07 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_12_LCD_DATA08, /* GPIO_B0_12 is configured as LCD_DATA08 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_13_LCD_DATA09, /* GPIO_B0_13 is configured as LCD_DATA09 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_14_LCD_DATA10, /* GPIO_B0_14 is configured as LCD_DATA10 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B0_15_LCD_DATA11, /* GPIO_B0_15 is configured as LCD_DATA11 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B1_00_LCD_DATA12, /* GPIO_B1_00 is configured as LCD_DATA12 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B1_01_LCD_DATA13, /* GPIO_B1_01 is configured as LCD_DATA13 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B1_02_LCD_DATA14, /* GPIO_B1_02 is configured as LCD_DATA14 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B1_03_LCD_DATA15, /* GPIO_B1_03 is configured as LCD_DATA15 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinMux( + IOMUXC_GPIO_B1_15_GPIO2_IO31, /* GPIO_B1_15 is configured as GPIO2_IO31 */ + 0U); /* Software Input On Field: Input Path is determined by functionality */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_AD_B0_02_GPIO1_IO02, /* GPIO_AD_B0_02 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_B0_00_LCD_CLK, /* GPIO_B0_00 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_01_LCD_ENABLE, /* GPIO_B0_01 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_02_LCD_HSYNC, /* GPIO_B0_02 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_03_LCD_VSYNC, /* GPIO_B0_03 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_04_LCD_DATA00, /* GPIO_B0_04 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_05_LCD_DATA01, /* GPIO_B0_05 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_06_LCD_DATA02, /* GPIO_B0_06 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_07_LCD_DATA03, /* GPIO_B0_07 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_08_LCD_DATA04, /* GPIO_B0_08 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_09_LCD_DATA05, /* GPIO_B0_09 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_10_LCD_DATA06, /* GPIO_B0_10 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_11_LCD_DATA07, /* GPIO_B0_11 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_12_LCD_DATA08, /* GPIO_B0_12 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_13_LCD_DATA09, /* GPIO_B0_13 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_14_LCD_DATA10, /* GPIO_B0_14 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B0_15_LCD_DATA11, /* GPIO_B0_15 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B1_00_LCD_DATA12, /* GPIO_B1_00 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B1_01_LCD_DATA13, /* GPIO_B1_01 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B1_02_LCD_DATA14, /* GPIO_B1_02 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B1_03_LCD_DATA15, /* GPIO_B1_03 PAD functional properties : */ + 0x01B0B0u); /* 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: Pull + Pull Up / Down Config. Field: 100K Ohm Pull Up + Hyst. Enable Field: Hysteresis Enabled */ + IOMUXC_SetPinConfig( + IOMUXC_GPIO_B1_15_GPIO2_IO31, /* GPIO_B1_15 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 */ +} + +static void _lcd_clock_config(void) +{ + /* + * The desired output frame rate is 60Hz. So the pixel clock frequency is: + * (480 + 41 + 4 + 18) * (272 + 10 + 4 + 2) * 60 = 9.2M. + * Here set the LCDIF pixel clock to 9.3M. + */ + + /* + * Initialize the Video PLL. + * Video PLL output clock is OSC24M * (loopDivider + (denominator / numerator)) / postDivider = 93MHz. + */ + clock_video_pll_config_t config = { + .loopDivider = 31, .postDivider = 8, .numerator = 0, .denominator = 0, + }; + + CLOCK_InitVideoPll(&config); + + /* + * 000 derive clock from PLL2 + * 001 derive clock from PLL3 PFD3 + * 010 derive clock from PLL5 + * 011 derive clock from PLL2 PFD0 + * 100 derive clock from PLL2 PFD1 + * 101 derive clock from PLL3 PFD1 + */ + CLOCK_SetMux(kCLOCK_Lcdif1PreMux, 2); + + CLOCK_SetDiv(kCLOCK_Lcdif1PreDiv, 4); + + CLOCK_SetDiv(kCLOCK_Lcdif1Div, 1); + + /* + * 000 derive clock from divided pre-muxed lcdif1 clock + * 001 derive clock from ipp_di0_clk + * 010 derive clock from ipp_di1_clk + * 011 derive clock from ldb_di0_clk + * 100 derive clock from ldb_di1_clk + */ + CLOCK_SetMux(kCLOCK_Lcdif1Mux, 0); +} + +/* Initialize the LCD_DISP. */ +static void _lcd_hardware_reset(void) +{ + volatile uint32_t i = 0x100U; + + gpio_pin_config_t config = { + kGPIO_DigitalOutput, 0, + }; + + /* Reset the LCD. */ + GPIO_PinInit(LCD_DISP_GPIO, LCD_DISP_GPIO_PIN, &config); + + GPIO_PinWrite(LCD_DISP_GPIO, LCD_DISP_GPIO_PIN, 0); + + while (i--) + { + } + + GPIO_PinWrite(LCD_DISP_GPIO, LCD_DISP_GPIO_PIN, 1); + + /* Backlight. */ + config.outputLogic = 1; + GPIO_PinInit(LCD_BL_GPIO, LCD_BL_GPIO_PIN, &config); +} + +static void _lcdif_init(void) +{ + const elcdif_rgb_mode_config_t config = { + .panelWidth = RT_HW_LCD_WIDTH, + .panelHeight = RT_HW_LCD_HEIGHT, + .hsw = APP_HSW, + .hfp = APP_HFP, + .hbp = APP_HBP, + .vsw = APP_VSW, + .vfp = APP_VFP, + .vbp = APP_VBP, + .polarityFlags = APP_POL_FLAGS, + .bufferAddr = (uint32_t)lcdif_frame_buffer[0], + .pixelFormat = kELCDIF_PixelFormatRGB565, + .dataBus = APP_LCDIF_DATA_BUS, + }; + + ELCDIF_RgbModeInit(LCDIF, &config); +} + +static void _lcd_interrupt_init(void) +{ + EnableIRQ(LCDIF_IRQn); + ELCDIF_EnableInterrupts(LCDIF, kELCDIF_CurFrameDoneInterruptEnable); +} + +static void _lcd_start(void) +{ + ELCDIF_RgbModeStart(LCDIF); +} + +void LCDIF_IRQHandler(void) +{ + uint32_t intStatus; + + intStatus = ELCDIF_GetInterruptStatus(LCDIF); + + ELCDIF_ClearInterruptStatus(LCDIF, intStatus); + + if (intStatus & kELCDIF_CurFrameDone) + { +#ifdef LCD_DEBUG + s_frameDone = true; +#endif + + if (imxrt_lcd.update) + { + ELCDIF_SetNextBufferAddr(LCDIF, (uint32_t)lcdif_frame_buffer[imxrt_lcd.index]); + imxrt_lcd.update = false; + rt_sem_release(&imxrt_lcd.lcd_sem); + } + + } +} + +static rt_err_t rt_lcd_control(rt_device_t dev, int cmd, void *args) +{ + switch (cmd) + { + case RTGRAPHIC_CTRL_RECT_UPDATE: + { + if(rt_sem_take(&imxrt_lcd.lcd_sem, RT_TICK_PER_SECOND/20) != RT_EOK) + { + rt_kprintf("lcdtimeout!\n"); + } + + imxrt_lcd.index = (imxrt_lcd.index + 1) % FRAME_BUFFER_COUNT; + memcpy(lcdif_frame_buffer[imxrt_lcd.index], imxrt_lcd.framebuffer, + sizeof(LCD_PIXEL_T) * RT_HW_LCD_WIDTH * RT_HW_LCD_HEIGHT); + imxrt_lcd.update = true; + } + break; + + case RTGRAPHIC_CTRL_POWERON: + break; + + case RTGRAPHIC_CTRL_POWEROFF: + break; + + case RTGRAPHIC_CTRL_GET_INFO: + memcpy(args, &imxrt_lcd.lcd_info, sizeof(imxrt_lcd.lcd_info)); + break; + + case RTGRAPHIC_CTRL_SET_MODE: + break; + } + + return RT_EOK; +} + +int imxrt_hw_lcd_init(void) +{ + LCD_PIXEL_T * framebuffer; + + framebuffer = rt_malloc_align(sizeof(LCD_PIXEL_T) * RT_HW_LCD_WIDTH * RT_HW_LCD_HEIGHT, FRAME_BUFFER_ALIGN); + if(!framebuffer) + { + rt_kprintf("malloc framebuffer fail\n"); + return -1; + } + imxrt_lcd.framebuffer = framebuffer; + + memset(framebuffer, LCD_INIT_DATA, sizeof(LCD_PIXEL_T) * RT_HW_LCD_WIDTH * RT_HW_LCD_HEIGHT); + memset(lcdif_frame_buffer, LCD_INIT_DATA, sizeof(lcdif_frame_buffer)); + + rt_kprintf("framebuffer: %p, lcdif_frame_buffer: %p, lcdif_frame_buffer[0]: %p, lcdif_frame_buffer[1]: %p\n", \ + framebuffer, lcdif_frame_buffer, lcdif_frame_buffer[0], lcdif_frame_buffer[1]); + + _lcd_gpio_config(); + _lcd_clock_config(); + _lcd_hardware_reset(); + _lcdif_init(); + _lcd_interrupt_init(); + _lcd_start(); + + imxrt_lcd.index = 0; + imxrt_lcd.update = false; + + imxrt_lcd.lcd_info.bits_per_pixel = LCD_BITS_PER_PIXEL; + imxrt_lcd.lcd_info.pixel_format = RTGRAPHIC_PIXEL_FORMAT_RGB565; + imxrt_lcd.lcd_info.framebuffer = (void *)framebuffer; + imxrt_lcd.lcd_info.width = RT_HW_LCD_WIDTH; + imxrt_lcd.lcd_info.height = RT_HW_LCD_HEIGHT; + + imxrt_lcd.lcd.type = RT_Device_Class_Graphic; + imxrt_lcd.lcd.init = NULL; + imxrt_lcd.lcd.open = NULL; + imxrt_lcd.lcd.close = NULL; + imxrt_lcd.lcd.read = NULL; + imxrt_lcd.lcd.write = NULL; + imxrt_lcd.lcd.control = rt_lcd_control; + imxrt_lcd.lcd.user_data = (void *)&imxrt_lcd.lcd_info; + + rt_sem_init(&imxrt_lcd.lcd_sem, "lcd_sem", 1, RT_IPC_FLAG_FIFO); + + /* register lcd device to RT-Thread */ + rt_device_register(&imxrt_lcd.lcd, "lcd", RT_DEVICE_FLAG_RDWR); + + + return 0; +} +//INIT_DEVICE_EXPORT(imxrt_hw_lcd_init); + +#ifdef LCD_DEBUG +#include + +void APP_FillFrameBuffer(uint32_t frameBuffer[RT_HW_LCD_HEIGHT][RT_HW_LCD_WIDTH]) +{ + /* Background color. */ + static const uint32_t bgColor = 0U; + /* Foreground color. */ + static uint8_t fgColorIndex = 0U; + static const uint32_t fgColorTable[] = {0x000000FFU, 0x0000FF00U, 0x0000FFFFU, 0x00FF0000U, + 0x00FF00FFU, 0x00FFFF00U, 0x00FFFFFFU}; + uint32_t fgColor = fgColorTable[fgColorIndex]; + + /* Position of the foreground rectangle. */ + static uint16_t upperLeftX = 0U; + static uint16_t upperLeftY = 0U; + static uint16_t lowerRightX = (RT_HW_LCD_WIDTH - 1U) / 2U; + static uint16_t lowerRightY = (RT_HW_LCD_HEIGHT - 1U) / 2U; + + static int8_t incX = 1; + static int8_t incY = 1; + + /* Change color in next forame or not. */ + static bool changeColor = false; + + uint32_t i, j; + + /* Background color. */ + for (i = 0; i < RT_HW_LCD_HEIGHT; i++) + { + for (j = 0; j < RT_HW_LCD_WIDTH; j++) + { + frameBuffer[i][j] = bgColor; + } + } + + /* Foreground color. */ + for (i = upperLeftY; i < lowerRightY; i++) + { + for (j = upperLeftX; j < lowerRightX; j++) + { + frameBuffer[i][j] = fgColor; + } + } + + /* Update the format: color and rectangle position. */ + upperLeftX += incX; + upperLeftY += incY; + lowerRightX += incX; + lowerRightY += incY; + + changeColor = false; + + if (0U == upperLeftX) + { + incX = 1; + changeColor = true; + } + else if (RT_HW_LCD_WIDTH - 1 == lowerRightX) + { + incX = -1; + changeColor = true; + } + + if (0U == upperLeftY) + { + incY = 1; + changeColor = true; + } + else if (RT_HW_LCD_HEIGHT - 1 == lowerRightY) + { + incY = -1; + changeColor = true; + } + + if (changeColor) + { + fgColorIndex++; + + if (ARRAY_SIZE(fgColorTable) == fgColorIndex) + { + fgColorIndex = 0U; + } + } +} + +void lcd_test(void) +{ + uint32_t frameBufferIndex = 0; + + APP_FillFrameBuffer(lcdif_frame_buffer[frameBufferIndex]); + + while (1) + { + frameBufferIndex ^= 1U; + + APP_FillFrameBuffer(lcdif_frame_buffer[frameBufferIndex]); + + ELCDIF_SetNextBufferAddr(LCDIF, (uint32_t)lcdif_frame_buffer[frameBufferIndex]); + + s_frameDone = false; + /* Wait for previous frame complete. */ + while (!s_frameDone) + { + } + } +} +FINSH_FUNCTION_EXPORT(lcd_test, lcd test); +#endif +#endif diff --git a/bsp/imxrt1052-evk/drivers/drv_lcd.h b/bsp/imxrt1052-evk/drivers/drv_lcd.h new file mode 100644 index 0000000000000000000000000000000000000000..a0b7169a4e22b93b67ab3fe9f63283159b911c07 --- /dev/null +++ b/bsp/imxrt1052-evk/drivers/drv_lcd.h @@ -0,0 +1,29 @@ +/* + * File : drv_i2c.c + * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Change Logs: + * Date Author Notes + * 2017-12-15 Tanek the first version + */ + +#ifndef __DRV_LCD_H__ +#define __DRV_LCD_H__ + +extern int imxrt_hw_lcd_init(void); + +#endif diff --git a/bsp/imxrt1052-evk/project.uvoptx b/bsp/imxrt1052-evk/project.uvoptx index 6375c4b93883957c3d3d41c9fc0a5c576654f72e..d9168401b3786ba7709d8032e70ed8ce80a20f9b 100644 --- a/bsp/imxrt1052-evk/project.uvoptx +++ b/bsp/imxrt1052-evk/project.uvoptx @@ -73,7 +73,7 @@ 0 - 0 + 1 0 1 @@ -103,7 +103,7 @@ 1 0 0 - 4 + 3 @@ -114,7 +114,7 @@ .\Libraries\arm\evkmimxrt1050_flexspi_nor.ini - Segger\JL2CM3.dll + BIN\CMSIS_AGDI.dll @@ -181,7 +181,7 @@ Applications - 0 + 1 0 0 0 @@ -245,17 +245,29 @@ 0 0 + + 1 + 6 + 1 + 0 + 0 + 0 + .\applications\rtgui_demo.c + rtgui_demo.c + 0 + 0 + Drivers - 0 + 1 0 0 0 2 - 6 + 7 1 0 0 @@ -267,7 +279,7 @@ 2 - 7 + 8 1 0 0 @@ -279,7 +291,7 @@ 2 - 8 + 9 1 0 0 @@ -291,7 +303,7 @@ 2 - 9 + 10 1 0 0 @@ -303,7 +315,7 @@ 2 - 10 + 11 1 0 0 @@ -315,7 +327,7 @@ 2 - 11 + 12 1 0 0 @@ -327,7 +339,7 @@ 2 - 12 + 13 1 0 0 @@ -337,6 +349,42 @@ 0 0 + + 2 + 14 + 1 + 0 + 0 + 0 + drivers\drv_lcd.c + drv_lcd.c + 0 + 0 + + + 2 + 15 + 1 + 0 + 0 + 0 + drivers\drv_ft5406.c + drv_ft5406.c + 0 + 0 + + + 2 + 16 + 1 + 0 + 0 + 0 + drivers\drv_i2c.c + drv_i2c.c + 0 + 0 + @@ -347,7 +395,7 @@ 0 3 - 13 + 17 1 0 0 @@ -359,7 +407,7 @@ 3 - 14 + 18 1 0 0 @@ -371,7 +419,7 @@ 3 - 15 + 19 1 0 0 @@ -383,7 +431,7 @@ 3 - 16 + 20 1 0 0 @@ -395,7 +443,7 @@ 3 - 17 + 21 1 0 0 @@ -407,7 +455,7 @@ 3 - 18 + 22 1 0 0 @@ -419,7 +467,7 @@ 3 - 19 + 23 1 0 0 @@ -431,7 +479,7 @@ 3 - 20 + 24 1 0 0 @@ -443,7 +491,7 @@ 3 - 21 + 25 1 0 0 @@ -455,7 +503,7 @@ 3 - 22 + 26 1 0 0 @@ -467,7 +515,7 @@ 3 - 23 + 27 1 0 0 @@ -479,7 +527,7 @@ 3 - 24 + 28 1 0 0 @@ -491,7 +539,7 @@ 3 - 25 + 29 1 0 0 @@ -503,7 +551,7 @@ 3 - 26 + 30 1 0 0 @@ -515,7 +563,7 @@ 3 - 27 + 31 1 0 0 @@ -527,7 +575,7 @@ 3 - 28 + 32 1 0 0 @@ -539,7 +587,7 @@ 3 - 29 + 33 1 0 0 @@ -551,7 +599,7 @@ 3 - 30 + 34 1 0 0 @@ -563,7 +611,7 @@ 3 - 31 + 35 1 0 0 @@ -575,7 +623,7 @@ 3 - 32 + 36 1 0 0 @@ -587,7 +635,7 @@ 3 - 33 + 37 1 0 0 @@ -599,7 +647,7 @@ 3 - 34 + 38 1 0 0 @@ -611,7 +659,7 @@ 3 - 35 + 39 1 0 0 @@ -623,7 +671,7 @@ 3 - 36 + 40 1 0 0 @@ -635,7 +683,7 @@ 3 - 37 + 41 1 0 0 @@ -647,7 +695,7 @@ 3 - 38 + 42 1 0 0 @@ -659,7 +707,7 @@ 3 - 39 + 43 1 0 0 @@ -671,7 +719,7 @@ 3 - 40 + 44 1 0 0 @@ -683,7 +731,7 @@ 3 - 41 + 45 1 0 0 @@ -695,7 +743,7 @@ 3 - 42 + 46 1 0 0 @@ -707,7 +755,7 @@ 3 - 43 + 47 1 0 0 @@ -719,7 +767,7 @@ 3 - 44 + 48 1 0 0 @@ -731,7 +779,7 @@ 3 - 45 + 49 1 0 0 @@ -743,7 +791,7 @@ 3 - 46 + 50 1 0 0 @@ -755,7 +803,7 @@ 3 - 47 + 51 1 0 0 @@ -767,7 +815,7 @@ 3 - 48 + 52 1 0 0 @@ -779,7 +827,7 @@ 3 - 49 + 53 1 0 0 @@ -791,7 +839,7 @@ 3 - 50 + 54 1 0 0 @@ -803,7 +851,7 @@ 3 - 51 + 55 1 0 0 @@ -815,7 +863,7 @@ 3 - 52 + 56 1 0 0 @@ -827,7 +875,7 @@ 3 - 53 + 57 1 0 0 @@ -839,7 +887,7 @@ 3 - 54 + 58 1 0 0 @@ -851,7 +899,7 @@ 3 - 55 + 59 1 0 0 @@ -863,7 +911,7 @@ 3 - 56 + 60 1 0 0 @@ -875,7 +923,7 @@ 3 - 57 + 61 1 0 0 @@ -887,7 +935,7 @@ 3 - 58 + 62 1 0 0 @@ -899,7 +947,7 @@ 3 - 59 + 63 1 0 0 @@ -911,7 +959,7 @@ 3 - 60 + 64 1 0 0 @@ -923,7 +971,7 @@ 3 - 61 + 65 1 0 0 @@ -935,7 +983,7 @@ 3 - 62 + 66 1 0 0 @@ -947,7 +995,7 @@ 3 - 63 + 67 1 0 0 @@ -959,7 +1007,7 @@ 3 - 64 + 68 1 0 0 @@ -971,7 +1019,7 @@ 3 - 65 + 69 1 0 0 @@ -983,7 +1031,7 @@ 3 - 66 + 70 1 0 0 @@ -995,7 +1043,7 @@ 3 - 67 + 71 1 0 0 @@ -1007,7 +1055,7 @@ 3 - 68 + 72 1 0 0 @@ -1019,7 +1067,7 @@ 3 - 69 + 73 1 0 0 @@ -1031,7 +1079,7 @@ 3 - 70 + 74 1 0 0 @@ -1043,7 +1091,7 @@ 3 - 71 + 75 1 0 0 @@ -1055,7 +1103,7 @@ 3 - 72 + 76 1 0 0 @@ -1067,7 +1115,7 @@ 3 - 73 + 77 2 0 0 @@ -1087,7 +1135,7 @@ 0 4 - 74 + 78 1 0 0 @@ -1099,7 +1147,7 @@ 4 - 75 + 79 1 0 0 @@ -1111,7 +1159,7 @@ 4 - 76 + 80 1 0 0 @@ -1123,7 +1171,7 @@ 4 - 77 + 81 1 0 0 @@ -1135,7 +1183,7 @@ 4 - 78 + 82 1 0 0 @@ -1147,7 +1195,7 @@ 4 - 79 + 83 1 0 0 @@ -1159,7 +1207,7 @@ 4 - 80 + 84 1 0 0 @@ -1171,7 +1219,7 @@ 4 - 81 + 85 1 0 0 @@ -1183,7 +1231,7 @@ 4 - 82 + 86 1 0 0 @@ -1195,7 +1243,7 @@ 4 - 83 + 87 1 0 0 @@ -1207,7 +1255,7 @@ 4 - 84 + 88 1 0 0 @@ -1219,7 +1267,7 @@ 4 - 85 + 89 1 0 0 @@ -1231,7 +1279,7 @@ 4 - 86 + 90 1 0 0 @@ -1251,7 +1299,7 @@ 0 5 - 87 + 91 1 0 0 @@ -1263,7 +1311,7 @@ 5 - 88 + 92 2 0 0 @@ -1275,7 +1323,7 @@ 5 - 89 + 93 1 0 0 @@ -1287,7 +1335,7 @@ 5 - 90 + 94 1 0 0 @@ -1299,7 +1347,7 @@ 5 - 91 + 95 1 0 0 @@ -1319,7 +1367,7 @@ 0 6 - 92 + 96 1 0 0 @@ -1331,7 +1379,7 @@ 6 - 93 + 97 1 0 0 @@ -1343,7 +1391,7 @@ 6 - 94 + 98 1 0 0 @@ -1355,7 +1403,7 @@ 6 - 95 + 99 1 0 0 @@ -1367,7 +1415,7 @@ 6 - 96 + 100 1 0 0 @@ -1379,7 +1427,7 @@ 6 - 97 + 101 1 0 0 @@ -1391,7 +1439,7 @@ 6 - 98 + 102 1 0 0 @@ -1401,6 +1449,18 @@ 0 0 + + 6 + 103 + 1 + 0 + 0 + 0 + ..\..\components\dfs\filesystems\elmfat\option\ccsbcs.c + ccsbcs.c + 0 + 0 + @@ -1411,345 +1471,1201 @@ 0 7 - 99 + 104 1 0 0 0 - ..\..\components\drivers\sdio\block_dev.c - block_dev.c + ..\..\components\drivers\i2c\i2c_core.c + i2c_core.c 0 0 7 - 100 + 105 1 0 0 0 - ..\..\components\drivers\sdio\mmcsd_core.c - mmcsd_core.c + ..\..\components\drivers\i2c\i2c_dev.c + i2c_dev.c 0 0 7 - 101 + 106 1 0 0 0 - ..\..\components\drivers\sdio\sd.c - sd.c + ..\..\components\drivers\i2c\i2c-bit-ops.c + i2c-bit-ops.c 0 0 7 - 102 + 107 1 0 0 0 - ..\..\components\drivers\sdio\sdio.c - sdio.c + ..\..\components\drivers\sdio\block_dev.c + block_dev.c 0 0 7 - 103 + 108 + 1 + 0 + 0 + 0 + ..\..\components\drivers\sdio\mmcsd_core.c + mmcsd_core.c + 0 + 0 + + + 7 + 109 + 1 + 0 + 0 + 0 + ..\..\components\drivers\sdio\sd.c + sd.c + 0 + 0 + + + 7 + 110 + 1 + 0 + 0 + 0 + ..\..\components\drivers\sdio\sdio.c + sdio.c + 0 + 0 + + + 7 + 111 + 1 + 0 + 0 + 0 + ..\..\components\drivers\sdio\mmc.c + mmc.c + 0 + 0 + + + 7 + 112 + 1 + 0 + 0 + 0 + ..\..\components\drivers\serial\serial.c + serial.c + 0 + 0 + + + 7 + 113 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\completion.c + completion.c + 0 + 0 + + + 7 + 114 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\dataqueue.c + dataqueue.c + 0 + 0 + + + 7 + 115 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\pipe.c + pipe.c + 0 + 0 + + + 7 + 116 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\ringbuffer.c + ringbuffer.c + 0 + 0 + + + 7 + 117 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\waitqueue.c + waitqueue.c + 0 + 0 + + + 7 + 118 + 1 + 0 + 0 + 0 + ..\..\components\drivers\src\workqueue.c + workqueue.c + 0 + 0 + + + + + finsh + 0 + 0 + 0 + 0 + + 8 + 119 + 1 + 0 + 0 + 0 + ..\..\components\finsh\shell.c + shell.c + 0 + 0 + + + 8 + 120 + 1 + 0 + 0 + 0 + ..\..\components\finsh\symbol.c + symbol.c + 0 + 0 + + + 8 + 121 + 1 + 0 + 0 + 0 + ..\..\components\finsh\cmd.c + cmd.c + 0 + 0 + + + 8 + 122 + 1 + 0 + 0 + 0 + ..\..\components\finsh\msh.c + msh.c + 0 + 0 + + + 8 + 123 + 1 + 0 + 0 + 0 + ..\..\components\finsh\msh_cmd.c + msh_cmd.c + 0 + 0 + + + 8 + 124 + 1 + 0 + 0 + 0 + ..\..\components\finsh\msh_file.c + msh_file.c + 0 + 0 + + + 8 + 125 + 1 + 0 + 0 + 0 + ..\..\components\finsh\finsh_compiler.c + finsh_compiler.c + 0 + 0 + + + 8 + 126 + 1 + 0 + 0 + 0 + ..\..\components\finsh\finsh_error.c + finsh_error.c + 0 + 0 + + + 8 + 127 + 1 + 0 + 0 + 0 + ..\..\components\finsh\finsh_heap.c + finsh_heap.c + 0 + 0 + + + 8 + 128 + 1 + 0 + 0 + 0 + ..\..\components\finsh\finsh_init.c + finsh_init.c + 0 + 0 + + + 8 + 129 + 1 + 0 + 0 + 0 + ..\..\components\finsh\finsh_node.c + finsh_node.c + 0 + 0 + + + 8 + 130 + 1 + 0 + 0 + 0 + ..\..\components\finsh\finsh_ops.c + finsh_ops.c + 0 + 0 + + + 8 + 131 + 1 + 0 + 0 + 0 + ..\..\components\finsh\finsh_parser.c + finsh_parser.c + 0 + 0 + + + 8 + 132 + 1 + 0 + 0 + 0 + ..\..\components\finsh\finsh_var.c + finsh_var.c + 0 + 0 + + + 8 + 133 + 1 + 0 + 0 + 0 + ..\..\components\finsh\finsh_vm.c + finsh_vm.c + 0 + 0 + + + 8 + 134 + 1 + 0 + 0 + 0 + ..\..\components\finsh\finsh_token.c + finsh_token.c + 0 + 0 + + + + + GuiEngine + 0 + 0 + 0 + 0 + + 9 + 135 + 1 + 0 + 0 + 0 + ..\..\components\gui\libraries\lodepng\lodepng.c + lodepng.c + 0 + 0 + + + 9 + 136 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\asc12font.c + asc12font.c + 0 + 0 + + + 9 + 137 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\asc16font.c + asc16font.c + 0 + 0 + + + 9 + 138 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\blit.c + blit.c + 0 + 0 + + + 9 + 139 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\box.c + box.c + 0 + 0 + + + 9 + 140 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\color.c + color.c + 0 + 0 + + + 9 + 141 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\container.c + container.c + 0 + 0 + + + 9 + 142 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\dc.c + dc.c + 0 + 0 + + + 9 + 143 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\dc_blend.c + dc_blend.c + 0 + 0 + + + 9 + 144 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\dc_buffer.c + dc_buffer.c + 0 + 0 + + + 9 + 145 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\dc_client.c + dc_client.c + 0 + 0 + + + 9 + 146 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\dc_hw.c + dc_hw.c + 0 + 0 + + + 9 + 147 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\dc_rotozoom.c + dc_rotozoom.c + 0 + 0 + + + 9 + 148 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\dc_trans.c + dc_trans.c + 0 + 0 + + + 9 + 149 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\filerw.c + filerw.c + 0 + 0 + + + 9 + 150 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\font.c + font.c + 0 + 0 + + + 9 + 151 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\font_bmp.c + font_bmp.c + 0 + 0 + + + 9 + 152 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\font_fnt.c + font_fnt.c + 0 + 0 + + + 9 + 153 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\font_freetype.c + font_freetype.c + 0 + 0 + + + 9 + 154 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\font_hz_bmp.c + font_hz_bmp.c + 0 + 0 + + + 9 + 155 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\font_hz_file.c + font_hz_file.c + 0 + 0 + + + 9 + 156 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\hz12font.c + hz12font.c + 0 + 0 + + + 9 + 157 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\hz16font.c + hz16font.c + 0 + 0 + + + 9 + 158 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\image.c + image.c + 0 + 0 + + + 9 + 159 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\image_bmp.c + image_bmp.c + 0 + 0 + + + 9 + 160 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\image_container.c + image_container.c + 0 + 0 + + + 9 + 161 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\image_hdc.c + image_hdc.c + 0 + 0 + + + 9 + 162 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\image_jpg.c + image_jpg.c + 0 + 0 + + + 9 + 163 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\image_png.c + image_png.c + 0 + 0 + + + 9 + 164 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\image_xpm.c + image_xpm.c + 0 + 0 + + + 9 + 165 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\matrix.c + matrix.c + 0 + 0 + + + 9 + 166 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\mouse.c + mouse.c + 0 + 0 + + + 9 + 167 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\region.c + region.c + 0 + 0 + + + 9 + 168 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\rtgui_app.c + rtgui_app.c + 0 + 0 + + + 9 + 169 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\rtgui_driver.c + rtgui_driver.c + 0 + 0 + + + 9 + 170 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\rtgui_object.c + rtgui_object.c + 0 + 0 + + + 9 + 171 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\rtgui_system.c + rtgui_system.c + 0 + 0 + + + 9 + 172 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\server.c + server.c + 0 + 0 + + + 9 + 173 + 1 + 0 + 0 + 0 + ..\..\components\gui\src\title.c + title.c + 0 + 0 + + + 9 + 174 1 0 0 0 - ..\..\components\drivers\sdio\mmc.c - mmc.c + ..\..\components\gui\src\topwin.c + topwin.c 0 0 - 7 - 104 + 9 + 175 1 0 0 0 - ..\..\components\drivers\serial\serial.c - serial.c + ..\..\components\gui\src\widget.c + widget.c 0 0 - 7 - 105 + 9 + 176 1 0 0 0 - ..\..\components\drivers\src\completion.c - completion.c + ..\..\components\gui\src\window.c + window.c 0 0 + + + + FreeType + 0 + 0 + 0 + 0 - 7 - 106 + 10 + 177 1 0 0 0 - ..\..\components\drivers\src\dataqueue.c - dataqueue.c + ..\..\components\gui\libraries\freetype-2.6.2\builds\rt-thread\ftsystem.c + ftsystem.c 0 0 - 7 - 107 + 10 + 178 1 0 0 0 - ..\..\components\drivers\src\pipe.c - pipe.c + ..\..\components\gui\libraries\freetype-2.6.2\builds\rt-thread\gb2312tounicode.c + gb2312tounicode.c 0 0 - 7 - 108 + 10 + 179 1 0 0 0 - ..\..\components\drivers\src\ringbuffer.c - ringbuffer.c + ..\..\components\gui\libraries\freetype-2.6.2\src\autofit\autofit.c + autofit.c 0 0 - 7 - 109 + 10 + 180 1 0 0 0 - ..\..\components\drivers\src\waitqueue.c - waitqueue.c + ..\..\components\gui\libraries\freetype-2.6.2\src\base\fttype1.c + fttype1.c 0 0 - 7 - 110 + 10 + 181 1 0 0 0 - ..\..\components\drivers\src\workqueue.c - workqueue.c + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftbitmap.c + ftbitmap.c 0 0 - - - - finsh - 0 - 0 - 0 - 0 - 8 - 111 + 10 + 182 1 0 0 0 - ..\..\components\finsh\shell.c - shell.c + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftbase.c + ftbase.c 0 0 - 8 - 112 + 10 + 183 1 0 0 0 - ..\..\components\finsh\symbol.c - symbol.c + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftbbox.c + ftbbox.c 0 0 - 8 - 113 + 10 + 184 1 0 0 0 - ..\..\components\finsh\cmd.c - cmd.c + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftfstype.c + ftfstype.c 0 0 - 8 - 114 + 10 + 185 1 0 0 0 - ..\..\components\finsh\msh.c - msh.c + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftglyph.c + ftglyph.c 0 0 - 8 - 115 + 10 + 186 1 0 0 0 - ..\..\components\finsh\msh_cmd.c - msh_cmd.c + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftinit.c + ftinit.c 0 0 - 8 - 116 + 10 + 187 1 0 0 0 - ..\..\components\finsh\msh_file.c - msh_file.c + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftlcdfil.c + ftlcdfil.c 0 0 - 8 - 117 + 10 + 188 1 0 0 0 - ..\..\components\finsh\finsh_compiler.c - finsh_compiler.c + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftmm.c + ftmm.c 0 0 - 8 - 118 + 10 + 189 1 0 0 0 - ..\..\components\finsh\finsh_error.c - finsh_error.c + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftpatent.c + ftpatent.c 0 0 - 8 - 119 + 10 + 190 1 0 0 0 - ..\..\components\finsh\finsh_heap.c - finsh_heap.c + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcbasic.c + ftcbasic.c 0 0 - 8 - 120 + 10 + 191 1 0 0 0 - ..\..\components\finsh\finsh_init.c - finsh_init.c + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftccache.c + ftccache.c 0 0 - 8 - 121 + 10 + 192 1 0 0 0 - ..\..\components\finsh\finsh_node.c - finsh_node.c + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftccmap.c + ftccmap.c 0 0 - 8 - 122 + 10 + 193 1 0 0 0 - ..\..\components\finsh\finsh_ops.c - finsh_ops.c + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcglyph.c + ftcglyph.c 0 0 - 8 - 123 + 10 + 194 1 0 0 0 - ..\..\components\finsh\finsh_parser.c - finsh_parser.c + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcimage.c + ftcimage.c 0 0 - 8 - 124 + 10 + 195 1 0 0 0 - ..\..\components\finsh\finsh_var.c - finsh_var.c + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcmanag.c + ftcmanag.c 0 0 - 8 - 125 + 10 + 196 1 0 0 0 - ..\..\components\finsh\finsh_vm.c - finsh_vm.c + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcmru.c + ftcmru.c 0 0 - 8 - 126 + 10 + 197 1 0 0 0 - ..\..\components\finsh\finsh_token.c - finsh_token.c + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcsbits.c + ftcsbits.c + 0 + 0 + + + 10 + 198 + 1 + 0 + 0 + 0 + ..\..\components\gui\libraries\freetype-2.6.2\src\psnames\psnames.c + psnames.c + 0 + 0 + + + 10 + 199 + 1 + 0 + 0 + 0 + ..\..\components\gui\libraries\freetype-2.6.2\src\sfnt\sfnt.c + sfnt.c + 0 + 0 + + + 10 + 200 + 1 + 0 + 0 + 0 + ..\..\components\gui\libraries\freetype-2.6.2\src\smooth\smooth.c + smooth.c + 0 + 0 + + + 10 + 201 + 1 + 0 + 0 + 0 + ..\..\components\gui\libraries\freetype-2.6.2\src\truetype\truetype.c + truetype.c 0 0 @@ -1762,8 +2678,8 @@ 0 0 - 9 - 127 + 11 + 202 1 0 0 @@ -1774,8 +2690,8 @@ 0 - 9 - 128 + 11 + 203 1 0 0 @@ -1786,8 +2702,8 @@ 0 - 9 - 129 + 11 + 204 1 0 0 @@ -1798,8 +2714,8 @@ 0 - 9 - 130 + 11 + 205 1 0 0 @@ -1810,8 +2726,8 @@ 0 - 9 - 131 + 11 + 206 1 0 0 @@ -1822,8 +2738,8 @@ 0 - 9 - 132 + 11 + 207 1 0 0 @@ -1842,8 +2758,8 @@ 0 0 - 10 - 133 + 12 + 208 1 0 0 @@ -1854,8 +2770,8 @@ 0 - 10 - 134 + 12 + 209 1 0 0 @@ -1866,8 +2782,8 @@ 0 - 10 - 135 + 12 + 210 1 0 0 @@ -1878,8 +2794,8 @@ 0 - 10 - 136 + 12 + 211 1 0 0 @@ -1890,8 +2806,8 @@ 0 - 10 - 137 + 12 + 212 1 0 0 @@ -1902,8 +2818,8 @@ 0 - 10 - 138 + 12 + 213 1 0 0 @@ -1914,8 +2830,8 @@ 0 - 10 - 139 + 12 + 214 1 0 0 @@ -1926,8 +2842,8 @@ 0 - 10 - 140 + 12 + 215 1 0 0 @@ -1938,8 +2854,8 @@ 0 - 10 - 141 + 12 + 216 1 0 0 @@ -1950,8 +2866,8 @@ 0 - 10 - 142 + 12 + 217 1 0 0 @@ -1962,8 +2878,8 @@ 0 - 10 - 143 + 12 + 218 1 0 0 @@ -1974,8 +2890,8 @@ 0 - 10 - 144 + 12 + 219 1 0 0 @@ -1986,8 +2902,8 @@ 0 - 10 - 145 + 12 + 220 1 0 0 @@ -1998,8 +2914,8 @@ 0 - 10 - 146 + 12 + 221 1 0 0 @@ -2010,8 +2926,8 @@ 0 - 10 - 147 + 12 + 222 1 0 0 @@ -2022,8 +2938,8 @@ 0 - 10 - 148 + 12 + 223 1 0 0 @@ -2034,8 +2950,8 @@ 0 - 10 - 149 + 12 + 224 1 0 0 @@ -2046,8 +2962,8 @@ 0 - 10 - 150 + 12 + 225 1 0 0 @@ -2058,8 +2974,8 @@ 0 - 10 - 151 + 12 + 226 1 0 0 @@ -2070,8 +2986,8 @@ 0 - 10 - 152 + 12 + 227 1 0 0 @@ -2082,8 +2998,8 @@ 0 - 10 - 153 + 12 + 228 1 0 0 @@ -2094,8 +3010,8 @@ 0 - 10 - 154 + 12 + 229 1 0 0 @@ -2106,8 +3022,8 @@ 0 - 10 - 155 + 12 + 230 1 0 0 @@ -2118,8 +3034,8 @@ 0 - 10 - 156 + 12 + 231 1 0 0 @@ -2130,8 +3046,8 @@ 0 - 10 - 157 + 12 + 232 1 0 0 @@ -2142,8 +3058,8 @@ 0 - 10 - 158 + 12 + 233 1 0 0 @@ -2154,8 +3070,8 @@ 0 - 10 - 159 + 12 + 234 1 0 0 @@ -2166,8 +3082,8 @@ 0 - 10 - 160 + 12 + 235 1 0 0 @@ -2178,8 +3094,8 @@ 0 - 10 - 161 + 12 + 236 1 0 0 @@ -2190,8 +3106,8 @@ 0 - 10 - 162 + 12 + 237 1 0 0 @@ -2202,8 +3118,8 @@ 0 - 10 - 163 + 12 + 238 1 0 0 @@ -2214,8 +3130,8 @@ 0 - 10 - 164 + 12 + 239 1 0 0 @@ -2226,8 +3142,8 @@ 0 - 10 - 165 + 12 + 240 1 0 0 @@ -2238,8 +3154,8 @@ 0 - 10 - 166 + 12 + 241 1 0 0 @@ -2250,8 +3166,8 @@ 0 - 10 - 167 + 12 + 242 1 0 0 diff --git a/bsp/imxrt1052-evk/project.uvprojx b/bsp/imxrt1052-evk/project.uvprojx index 1bfed90eb0bd239ce157661f8d27dd547d3d18dc..cbfc7a6da659ab9c860f011006a087054e63350c 100644 --- a/bsp/imxrt1052-evk/project.uvprojx +++ b/bsp/imxrt1052-evk/project.uvprojx @@ -333,10 +333,10 @@ 0 0 - --library_interface=armcc --library_type=standardlib --diag_suppress=66 - SKIP_SYSCLK_INIT, CPU_MIMXRT1052DVL6A, FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL=1, EVK_MCIMXRM, FSL_FEATURE_PHYKSZ8081_USE_RMII50M_MODE, RT_USING_ARM_LIBC + --library_interface=armcc --library_type=standardlib --diag_suppress=66,1296,186 + SKIP_SYSCLK_INIT, FSL_FEATURE_PHYKSZ8081_USE_RMII50M_MODE, RT_USING_ARM_LIBC, FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL=1, EVK_MCIMXRM, FT2_BUILD_LIBRARY, CPU_MIMXRT1052DVL6A - applications;.;drivers;Libraries;Libraries\drivers;Libraries\utilities;Libraries\CMSIS\Include;..\..\include;..\..\libcpu\arm\cortex-m7;..\..\libcpu\arm\common;..\..\components\dfs\include;..\..\components\dfs\filesystems\devfs;..\..\components\dfs\filesystems\elmfat;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh;..\..\components\libc\compilers\armlibc;..\..\components\net\lwip-1.4.1\src;..\..\components\net\lwip-1.4.1\src\include;..\..\components\net\lwip-1.4.1\src\include\ipv4;..\..\components\net\lwip-1.4.1\src\arch\include;..\..\components\net\lwip-1.4.1\src\include\netif + applications;.;drivers;Libraries;Libraries\drivers;Libraries\utilities;Libraries\CMSIS\Include;..\..\include;..\..\libcpu\arm\cortex-m7;..\..\libcpu\arm\common;..\..\components\dfs\include;..\..\components\dfs\filesystems\devfs;..\..\components\dfs\filesystems\elmfat;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh;..\..\components\gui\include;..\..\components\gui\include\rtgui;..\..\components\gui\include\rtgui\widgets;..\..\components\gui\libraries\lodepng;..\..\components\gui\src;..\..\components\gui\libraries\freetype-2.6.2\builds\rt-thread;..\..\components\gui\libraries\freetype-2.6.2\include;..\..\components\gui\libraries\freetype-2.6.2\include\freetype;..\..\components\gui\libraries\freetype-2.6.2\include\freetype\config;..\..\components\gui\libraries\freetype-2.6.2\include\freetype\internal;..\..\components\gui\libraries\freetype-2.6.2\include\freetype\internal\services;..\..\components\gui\libraries\freetype-2.6.2\src\autofit;..\..\components\gui\libraries\freetype-2.6.2\src\base;..\..\components\gui\libraries\freetype-2.6.2\src\cache;..\..\components\gui\libraries\freetype-2.6.2\src\psnames;..\..\components\gui\libraries\freetype-2.6.2\src\sfnt;..\..\components\gui\libraries\freetype-2.6.2\src\smooth;..\..\components\gui\libraries\freetype-2.6.2\src\truetype;..\..\components\libc\compilers\armlibc;..\..\components\net\lwip-1.4.1\src;..\..\components\net\lwip-1.4.1\src\include;..\..\components\net\lwip-1.4.1\src\include\ipv4;..\..\components\net\lwip-1.4.1\src\arch\include;..\..\components\net\lwip-1.4.1\src\include\netif @@ -370,7 +370,7 @@ .\Libraries\arm\MIMXRT1052xxxxx_flexspi_nor.scf - --keep *.o(.rti_fn.*) --keep *.o(FSymTab) --keep *.o(VSymTab) + --keep *.o(.rti_fn.*) --keep *.o(FSymTab) --keep *.o(VSymTab) @@ -405,6 +405,11 @@ 1 applications\sdio_test.c + + rtgui_demo.c + 1 + .\applications\rtgui_demo.c + @@ -445,6 +450,21 @@ 1 drivers\drv_sdio.c + + drv_lcd.c + 1 + drivers\drv_lcd.c + + + drv_ft5406.c + 1 + drivers\drv_ft5406.c + + + drv_i2c.c + 1 + drivers\drv_i2c.c + @@ -895,11 +915,31 @@ 1 ..\..\components\dfs\filesystems\elmfat\ff.c + + ccsbcs.c + 1 + ..\..\components\dfs\filesystems\elmfat\option\ccsbcs.c + DeviceDrivers + + i2c_core.c + 1 + ..\..\components\drivers\i2c\i2c_core.c + + + i2c_dev.c + 1 + ..\..\components\drivers\i2c\i2c_dev.c + + + i2c-bit-ops.c + 1 + ..\..\components\drivers\i2c\i2c-bit-ops.c + block_dev.c 1 @@ -1047,6 +1087,351 @@ + + GuiEngine + + + lodepng.c + 1 + ..\..\components\gui\libraries\lodepng\lodepng.c + + + asc12font.c + 1 + ..\..\components\gui\src\asc12font.c + + + asc16font.c + 1 + ..\..\components\gui\src\asc16font.c + + + blit.c + 1 + ..\..\components\gui\src\blit.c + + + box.c + 1 + ..\..\components\gui\src\box.c + + + color.c + 1 + ..\..\components\gui\src\color.c + + + container.c + 1 + ..\..\components\gui\src\container.c + + + dc.c + 1 + ..\..\components\gui\src\dc.c + + + dc_blend.c + 1 + ..\..\components\gui\src\dc_blend.c + + + dc_buffer.c + 1 + ..\..\components\gui\src\dc_buffer.c + + + dc_client.c + 1 + ..\..\components\gui\src\dc_client.c + + + dc_hw.c + 1 + ..\..\components\gui\src\dc_hw.c + + + dc_rotozoom.c + 1 + ..\..\components\gui\src\dc_rotozoom.c + + + dc_trans.c + 1 + ..\..\components\gui\src\dc_trans.c + + + filerw.c + 1 + ..\..\components\gui\src\filerw.c + + + font.c + 1 + ..\..\components\gui\src\font.c + + + font_bmp.c + 1 + ..\..\components\gui\src\font_bmp.c + + + font_fnt.c + 1 + ..\..\components\gui\src\font_fnt.c + + + font_freetype.c + 1 + ..\..\components\gui\src\font_freetype.c + + + font_hz_bmp.c + 1 + ..\..\components\gui\src\font_hz_bmp.c + + + font_hz_file.c + 1 + ..\..\components\gui\src\font_hz_file.c + + + hz12font.c + 1 + ..\..\components\gui\src\hz12font.c + + + hz16font.c + 1 + ..\..\components\gui\src\hz16font.c + + + image.c + 1 + ..\..\components\gui\src\image.c + + + image_bmp.c + 1 + ..\..\components\gui\src\image_bmp.c + + + image_container.c + 1 + ..\..\components\gui\src\image_container.c + + + image_hdc.c + 1 + ..\..\components\gui\src\image_hdc.c + + + image_jpg.c + 1 + ..\..\components\gui\src\image_jpg.c + + + image_png.c + 1 + ..\..\components\gui\src\image_png.c + + + image_xpm.c + 1 + ..\..\components\gui\src\image_xpm.c + + + matrix.c + 1 + ..\..\components\gui\src\matrix.c + + + mouse.c + 1 + ..\..\components\gui\src\mouse.c + + + region.c + 1 + ..\..\components\gui\src\region.c + + + rtgui_app.c + 1 + ..\..\components\gui\src\rtgui_app.c + + + rtgui_driver.c + 1 + ..\..\components\gui\src\rtgui_driver.c + + + rtgui_object.c + 1 + ..\..\components\gui\src\rtgui_object.c + + + rtgui_system.c + 1 + ..\..\components\gui\src\rtgui_system.c + + + server.c + 1 + ..\..\components\gui\src\server.c + + + title.c + 1 + ..\..\components\gui\src\title.c + + + topwin.c + 1 + ..\..\components\gui\src\topwin.c + + + widget.c + 1 + ..\..\components\gui\src\widget.c + + + window.c + 1 + ..\..\components\gui\src\window.c + + + + + FreeType + + + ftsystem.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\builds\rt-thread\ftsystem.c + + + gb2312tounicode.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\builds\rt-thread\gb2312tounicode.c + + + autofit.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\autofit\autofit.c + + + fttype1.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\base\fttype1.c + + + ftbitmap.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftbitmap.c + + + ftbase.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftbase.c + + + ftbbox.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftbbox.c + + + ftfstype.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftfstype.c + + + ftglyph.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftglyph.c + + + ftinit.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftinit.c + + + ftlcdfil.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftlcdfil.c + + + ftmm.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftmm.c + + + ftpatent.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\base\ftpatent.c + + + ftcbasic.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcbasic.c + + + ftccache.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftccache.c + + + ftccmap.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftccmap.c + + + ftcglyph.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcglyph.c + + + ftcimage.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcimage.c + + + ftcmanag.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcmanag.c + + + ftcmru.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcmru.c + + + ftcsbits.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\cache\ftcsbits.c + + + psnames.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\psnames\psnames.c + + + sfnt.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\sfnt\sfnt.c + + + smooth.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\smooth\smooth.c + + + truetype.c + 1 + ..\..\components\gui\libraries\freetype-2.6.2\src\truetype\truetype.c + + + libc diff --git a/bsp/imxrt1052-evk/rtconfig.h b/bsp/imxrt1052-evk/rtconfig.h index b68ec992194af10424a58a407aad7572562f6ce2..61ca46d80f2e84628fc5100909b777d958c43d60 100644 --- a/bsp/imxrt1052-evk/rtconfig.h +++ b/bsp/imxrt1052-evk/rtconfig.h @@ -85,11 +85,11 @@ #define RT_DFS_ELM_CODE_PAGE 437 #define RT_DFS_ELM_WORD_ACCESS -#define RT_DFS_ELM_USE_LFN_0 +/* RT_DFS_ELM_USE_LFN_0 is not set */ /* RT_DFS_ELM_USE_LFN_1 is not set */ /* RT_DFS_ELM_USE_LFN_2 is not set */ -/* RT_DFS_ELM_USE_LFN_3 is not set */ -#define RT_DFS_ELM_USE_LFN 0 +#define RT_DFS_ELM_USE_LFN_3 +#define RT_DFS_ELM_USE_LFN 3 #define RT_DFS_ELM_MAX_LFN 255 #define RT_DFS_ELM_DRIVES 2 #define RT_DFS_ELM_MAX_SECTOR_SIZE 512 @@ -108,7 +108,8 @@ #define RT_USING_SERIAL /* RT_USING_CAN is not set */ /* RT_USING_HWTIMER is not set */ -/* RT_USING_I2C is not set */ +#define RT_USING_I2C +#define RT_USING_I2C_BITOPS /* RT_USING_PIN is not set */ /* RT_USING_MTD_NOR is not set */ /* RT_USING_MTD_NAND is not set */ @@ -143,7 +144,6 @@ #define RT_LWIP_DHCP #define IP_SOF_BROADCAST 1 #define IP_SOF_BROADCAST_RECV 1 -/* LWIP_USING_DHCPD is not set */ /* Static IPv4 Address */ @@ -154,8 +154,7 @@ #define RT_LWIP_TCP /* RT_LWIP_RAW is not set */ /* RT_LWIP_PPP is not set */ -/* RT_LWIP_PPPOE is not set */ -/* RT_LWIP_PPPOS is not set */ +#define RT_MEMP_NUM_NETCONN 8 #define RT_LWIP_PBUF_NUM 16 #define RT_LWIP_RAW_PCB_NUM 4 #define RT_LWIP_UDP_PCB_NUM 4 @@ -179,11 +178,28 @@ /* Modbus master and slave stack */ /* RT_USING_MODBUS is not set */ +/* LWIP_USING_DHCPD is not set */ /* RT_USING_NETUTILS is not set */ /* RT-Thread UI Engine */ -/* RT_USING_GUIENGINE is not set */ +#define RT_USING_GUIENGINE +#define RTGUI_NAME_MAX 16 +#define RTGUI_USING_TTF +#define UTF8_TO_UNICODE +#define RTGUI_USING_FONT16 +#define RTGUI_USING_FONT12 +/* RTGUI_USING_FONTHZ is not set */ +/* RTGUI_IMAGE_XPM is not set */ +#define RTGUI_IMAGE_JPEG_NONE +/* RTGUI_IMAGE_JPEG is not set */ +/* RTGUI_IMAGE_TJPGD is not set */ +/* RTGUI_IMAGE_PNG_NONE is not set */ +/* RTGUI_IMAGE_PNG is not set */ +#define RTGUI_IMAGE_LODEPNG +/* RTGUI_IMAGE_BMP is not set */ +#define RTGUI_IMAGE_CONTAINER +/* RTGUI_USING_DEMO is not set */ /* VBUS(Virtual Software BUS) */ @@ -216,6 +232,7 @@ /* PKG_USING_MBEDTLS is not set */ /* PKG_USING_libsodium is not set */ +/* PKG_USING_TINYCRYPT is not set */ /* language packages */ @@ -224,11 +241,14 @@ /* multimedia packages */ +/* PKG_USING_OPENMV is not set */ + /* tools packages */ /* PKG_USING_CMBACKTRACE is not set */ /* PKG_USING_EASYLOGGER is not set */ /* PKG_USING_SYSTEMVIEW is not set */ +/* PKG_USING_IPERF is not set */ /* miscellaneous packages */ diff --git a/bsp/imxrt1052-evk/template.uvoptx b/bsp/imxrt1052-evk/template.uvoptx index 49e59d65e835966914a93e98d243d2da6dfb4332..deca1cf444e3cf914b6dd6a3a618d5911934bfc4 100644 --- a/bsp/imxrt1052-evk/template.uvoptx +++ b/bsp/imxrt1052-evk/template.uvoptx @@ -103,7 +103,7 @@ 1 0 0 - 4 + 3 @@ -114,7 +114,7 @@ .\Libraries\arm\evkmimxrt1050_flexspi_nor.ini - Segger\JL2CM3.dll + BIN\CMSIS_AGDI.dll