From e58bc98ff0f244a1cc04613bb842619c29c29f05 Mon Sep 17 00:00:00 2001 From: xuzhuoyi Date: Thu, 13 Sep 2018 18:44:51 +0800 Subject: [PATCH 1/6] [bsp][stm32f429-disco] Add LCD support --- bsp/stm32f429-disco/drivers/drv_lcd.c | 945 ++++++++++++++++++ bsp/stm32f429-disco/drivers/drv_lcd.h | 154 +++ .../drivers/stm32f4xx_hal_conf.h | 4 +- 3 files changed, 1101 insertions(+), 2 deletions(-) create mode 100644 bsp/stm32f429-disco/drivers/drv_lcd.c create mode 100644 bsp/stm32f429-disco/drivers/drv_lcd.h diff --git a/bsp/stm32f429-disco/drivers/drv_lcd.c b/bsp/stm32f429-disco/drivers/drv_lcd.c new file mode 100644 index 0000000000..99522871f9 --- /dev/null +++ b/bsp/stm32f429-disco/drivers/drv_lcd.c @@ -0,0 +1,945 @@ +/* + * File : drv_lcd.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2009 RT-Thread Develop 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 + * 2018-09-13 xuzhuoyi first implementation + */ + +#include "drv_lcd.h" +#include + +//#define DEBUG + +#ifdef DEBUG +#define DEBUG_PRINTF(...) rt_kprintf(__VA_ARGS__) +#else +#define DEBUG_PRINTF(...) +#endif + +typedef struct +{ + rt_uint16_t width; //LCD 宽度 + rt_uint16_t height; //LCD 高度 + rt_uint16_t id; //LCD ID + rt_uint8_t dir; //横屏还是竖屏控制:0,竖屏;1,横屏。 + rt_uint16_t wramcmd; //开始写gram指令 + rt_uint16_t setxcmd; //设置x坐标指令 + rt_uint16_t setycmd; //设置y坐标指令 +} lcd_info_t; + +typedef struct +{ + volatile rt_uint16_t reg; + volatile rt_uint16_t ram; +} lcd_ili9341_t; + +//使用NOR/SRAM的 Bank1.sector1,地址位HADDR[27,26]=00 A18作为数据命令区分线 +//注意设置时STM32内部会右移一位对其! +#define LCD_ILI9341_BASE ((rt_uint32_t)(0x60000000 | 0x0007FFFE)) +#define ili9341 ((lcd_ili9341_t *) LCD_ILI9341_BASE) +////////////////////////////////////////////////////////////////////////////////// + +//扫描方向定义 +#define L2R_U2D 0 //从左到右,从上到下 +#define L2R_D2U 1 //从左到右,从下到上 +#define R2L_U2D 2 //从右到左,从上到下 +#define R2L_D2U 3 //从右到左,从下到上 +#define U2D_L2R 4 //从上到下,从左到右 +#define U2D_R2L 5 //从上到下,从右到左 +#define D2U_L2R 6 //从下到上,从左到右 +#define D2U_R2L 7 //从下到上,从右到左 +#define DFT_SCAN_DIR L2R_U2D //默认的扫描方向 + +static lcd_info_t lcddev; +LTDC_HandleTypeDef LtdcHandler; +static RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; +/* Default LCD configuration with LCD Layer 1 */ +static uint32_t ActiveLayer = 0; +//LCD_DrvTypeDef *LcdDrv; +SPI_HandleTypeDef hspi5; + +void delay_us(rt_uint32_t nus) +{ + //rt_thread_delay(1); + while (nus--) { + __NOP(); + } +} + +void delay_ms(rt_uint32_t nms) +{ + //rt_thread_delay((RT_TICK_PER_SECOND * nms + 999) / 1000); + while (nms--) + { + int i; + for (i = 0; i < 10000; i++) + { + __NOP(); + } + } +} + + +/** + * @brief Selects the LCD Layer. + * @param LayerIndex: the Layer foreground or background. + */ +void BSP_LCD_SelectLayer(uint32_t LayerIndex) +{ + ActiveLayer = LayerIndex; +} + +/** + * @brief Initializes the LTDC MSP. + */ +__weak void BSP_LCD_MspInit(void) +{ + GPIO_InitTypeDef GPIO_InitStructure; + + /* Enable the LTDC and DMA2D Clock */ + __HAL_RCC_LTDC_CLK_ENABLE(); + __HAL_RCC_DMA2D_CLK_ENABLE(); + + /* Enable GPIOs clock */ + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOG_CLK_ENABLE(); + + /* GPIOs Configuration */ + /* + +------------------------+-----------------------+----------------------------+ + + LCD pins assignment + + +------------------------+-----------------------+----------------------------+ + | LCD_TFT R2 <-> PC.10 | LCD_TFT G2 <-> PA.06 | LCD_TFT B2 <-> PD.06 | + | LCD_TFT R3 <-> PB.00 | LCD_TFT G3 <-> PG.10 | LCD_TFT B3 <-> PG.11 | + | LCD_TFT R4 <-> PA.11 | LCD_TFT G4 <-> PB.10 | LCD_TFT B4 <-> PG.12 | + | LCD_TFT R5 <-> PA.12 | LCD_TFT G5 <-> PB.11 | LCD_TFT B5 <-> PA.03 | + | LCD_TFT R6 <-> PB.01 | LCD_TFT G6 <-> PC.07 | LCD_TFT B6 <-> PB.08 | + | LCD_TFT R7 <-> PG.06 | LCD_TFT G7 <-> PD.03 | LCD_TFT B7 <-> PB.09 | + ------------------------------------------------------------------------------- + | LCD_TFT HSYNC <-> PC.06 | LCDTFT VSYNC <-> PA.04 | + | LCD_TFT CLK <-> PG.07 | LCD_TFT DE <-> PF.10 | + ----------------------------------------------------- + */ + + /* GPIOA configuration */ + GPIO_InitStructure.Pin = GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_6 | + GPIO_PIN_11 | GPIO_PIN_12; + GPIO_InitStructure.Mode = GPIO_MODE_AF_PP; + GPIO_InitStructure.Pull = GPIO_NOPULL; + GPIO_InitStructure.Speed = GPIO_SPEED_FAST; + GPIO_InitStructure.Alternate= GPIO_AF14_LTDC; + HAL_GPIO_Init(GPIOA, &GPIO_InitStructure); + + /* GPIOB configuration */ + GPIO_InitStructure.Pin = GPIO_PIN_8 | \ + GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11; + HAL_GPIO_Init(GPIOB, &GPIO_InitStructure); + + /* GPIOC configuration */ + GPIO_InitStructure.Pin = GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_10; + HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); + + /* GPIOD configuration */ + GPIO_InitStructure.Pin = GPIO_PIN_3 | GPIO_PIN_6; + HAL_GPIO_Init(GPIOD, &GPIO_InitStructure); + + /* GPIOF configuration */ + GPIO_InitStructure.Pin = GPIO_PIN_10; + HAL_GPIO_Init(GPIOF, &GPIO_InitStructure); + + /* GPIOG configuration */ + GPIO_InitStructure.Pin = GPIO_PIN_6 | GPIO_PIN_7 | \ + GPIO_PIN_11; + HAL_GPIO_Init(GPIOG, &GPIO_InitStructure); + + /* GPIOB configuration */ + GPIO_InitStructure.Pin = GPIO_PIN_0 | GPIO_PIN_1; + GPIO_InitStructure.Alternate= GPIO_AF9_LTDC; + HAL_GPIO_Init(GPIOB, &GPIO_InitStructure); + + /* GPIOG configuration */ + GPIO_InitStructure.Pin = GPIO_PIN_10 | GPIO_PIN_12; + HAL_GPIO_Init(GPIOG, &GPIO_InitStructure); +} + +/** + * @brief Writes a byte to device. + * @param Value: value to be written + */ +static void SPIx_Write(uint16_t Value) +{ + HAL_StatusTypeDef status = HAL_OK; + + status = HAL_SPI_Transmit(&hspi5, (uint8_t*) &Value, 1, 0x1000); + + /* Check the communication status */ + if(status != HAL_OK) + { + /* Re-Initialize the BUS */ + //SPIx_Error(); + } +} + +/** + * @brief Reads 4 bytes from device. + * @param ReadSize: Number of bytes to read (max 4 bytes) + * @retval Value read on the SPI + */ +static uint32_t SPIx_Read(uint8_t ReadSize) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t readvalue; + + status = HAL_SPI_Receive(&hspi5, (uint8_t*) &readvalue, ReadSize, 0x1000); + + /* Check the communication status */ + if(status != HAL_OK) + { + /* Re-Initialize the BUS */ + //SPIx_Error(); + } + + return readvalue; +} + +/** + * @brief Configures the LCD_SPI interface. + */ +__weak void LCD_IO_Init(void) +{ + /* Set or Reset the control line */ + LCD_CS_LOW(); + LCD_CS_HIGH(); + + /* SPI5 parameter configuration*/ + hspi5.Instance = SPI5; + hspi5.Init.Mode = SPI_MODE_MASTER; + hspi5.Init.Direction = SPI_DIRECTION_2LINES; + hspi5.Init.DataSize = SPI_DATASIZE_8BIT; + hspi5.Init.CLKPolarity = SPI_POLARITY_LOW; + hspi5.Init.CLKPhase = SPI_PHASE_1EDGE; + hspi5.Init.NSS = SPI_NSS_SOFT; + hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; + hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB; + hspi5.Init.TIMode = SPI_TIMODE_DISABLE; + hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; + hspi5.Init.CRCPolynomial = 10; + if (HAL_SPI_Init(&hspi5) != HAL_OK) + { + //_Error_Handler(__FILE__, __LINE__); + } + +} + +/** + * @brief Writes to the selected LCD register. + * @param LCD_Reg: address of the selected register. + * @retval None + */ +void ili9341_WriteReg(uint8_t LCD_Reg) +{ + /* Reset WRX to send command */ + LCD_WRX_LOW(); + + /* Reset LCD control line(/CS) and Send command */ + LCD_CS_LOW(); + SPIx_Write(LCD_Reg); + + /* Deselect: Chip Select high */ + LCD_CS_HIGH(); +} + +/** + * @brief Writes data to the selected LCD register. + * @param LCD_Reg: address of the selected register. + * @retval None + */ +void ili9341_WriteData(uint16_t RegValue) +{ + /* Set WRX to send data */ + LCD_WRX_HIGH(); + + /* Reset LCD control line(/CS) and Send data */ + LCD_CS_LOW(); + SPIx_Write(RegValue); + + /* Deselect: Chip Select high */ + LCD_CS_HIGH(); +} + +/** + * @brief Reads the selected LCD Register. + * @param RegValue: Address of the register to read + * @param ReadSize: Number of bytes to read + * @retval LCD Register Value. + */ +uint32_t ili9341_ReadData(uint16_t RegValue, uint8_t ReadSize) +{ + uint32_t readvalue = 0; + + /* Select: Chip Select low */ + LCD_CS_LOW(); + + /* Reset WRX to send command */ + LCD_WRX_LOW(); + + SPIx_Write(RegValue); + + readvalue = SPIx_Read(ReadSize); + + /* Set WRX to send data */ + LCD_WRX_HIGH(); + + /* Deselect: Chip Select high */ + LCD_CS_HIGH(); + + return readvalue; +} + +/** + * @brief Enables the Display. + */ +void BSP_LCD_DisplayOn(void) +{ + /* Display On */ + ili9341_WriteReg(LCD_DISPLAY_ON); +} + +/** + * @brief Disables the Display. + */ +void BSP_LCD_DisplayOff(void) +{ + /* Display Off */ + ili9341_WriteReg(LCD_DISPLAY_OFF); +} + +void ili9341_Init(void) +{ + /* Initialize ILI9341 low level bus layer ----------------------------------*/ + LCD_IO_Init(); + + /* Configure LCD */ + ili9341_WriteReg(0xCA); + ili9341_WriteData(0xC3); + ili9341_WriteData(0x08); + ili9341_WriteData(0x50); + ili9341_WriteReg(LCD_POWERB); + ili9341_WriteData(0x00); + ili9341_WriteData(0xC1); + ili9341_WriteData(0x30); + ili9341_WriteReg(LCD_POWER_SEQ); + ili9341_WriteData(0x64); + ili9341_WriteData(0x03); + ili9341_WriteData(0x12); + ili9341_WriteData(0x81); + ili9341_WriteReg(LCD_DTCA); + ili9341_WriteData(0x85); + ili9341_WriteData(0x00); + ili9341_WriteData(0x78); + ili9341_WriteReg(LCD_POWERA); + ili9341_WriteData(0x39); + ili9341_WriteData(0x2C); + ili9341_WriteData(0x00); + ili9341_WriteData(0x34); + ili9341_WriteData(0x02); + ili9341_WriteReg(LCD_PRC); + ili9341_WriteData(0x20); + ili9341_WriteReg(LCD_DTCB); + ili9341_WriteData(0x00); + ili9341_WriteData(0x00); + ili9341_WriteReg(LCD_FRMCTR1); + ili9341_WriteData(0x00); + ili9341_WriteData(0x1B); + ili9341_WriteReg(LCD_DFC); + ili9341_WriteData(0x0A); + ili9341_WriteData(0xA2); + ili9341_WriteReg(LCD_POWER1); + ili9341_WriteData(0x10); + ili9341_WriteReg(LCD_POWER2); + ili9341_WriteData(0x10); + ili9341_WriteReg(LCD_VCOM1); + ili9341_WriteData(0x45); + ili9341_WriteData(0x15); + ili9341_WriteReg(LCD_VCOM2); + ili9341_WriteData(0x90); + ili9341_WriteReg(LCD_MAC); + ili9341_WriteData(0xC8); + ili9341_WriteReg(LCD_3GAMMA_EN); + ili9341_WriteData(0x00); + ili9341_WriteReg(LCD_RGB_INTERFACE); + ili9341_WriteData(0xC2); + ili9341_WriteReg(LCD_DFC); + ili9341_WriteData(0x0A); + ili9341_WriteData(0xA7); + ili9341_WriteData(0x27); + ili9341_WriteData(0x04); + + /* Colomn address set */ + ili9341_WriteReg(LCD_COLUMN_ADDR); + ili9341_WriteData(0x00); + ili9341_WriteData(0x00); + ili9341_WriteData(0x00); + ili9341_WriteData(0xEF); + /* Page address set */ + ili9341_WriteReg(LCD_PAGE_ADDR); + ili9341_WriteData(0x00); + ili9341_WriteData(0x00); + ili9341_WriteData(0x01); + ili9341_WriteData(0x3F); + ili9341_WriteReg(LCD_INTERFACE); + ili9341_WriteData(0x01); + ili9341_WriteData(0x00); + ili9341_WriteData(0x06); + + ili9341_WriteReg(LCD_GRAM); + delay_ms(200); + + ili9341_WriteReg(LCD_GAMMA); + ili9341_WriteData(0x01); + + ili9341_WriteReg(LCD_PGAMMA); + ili9341_WriteData(0x0F); + ili9341_WriteData(0x29); + ili9341_WriteData(0x24); + ili9341_WriteData(0x0C); + ili9341_WriteData(0x0E); + ili9341_WriteData(0x09); + ili9341_WriteData(0x4E); + ili9341_WriteData(0x78); + ili9341_WriteData(0x3C); + ili9341_WriteData(0x09); + ili9341_WriteData(0x13); + ili9341_WriteData(0x05); + ili9341_WriteData(0x17); + ili9341_WriteData(0x11); + ili9341_WriteData(0x00); + ili9341_WriteReg(LCD_NGAMMA); + ili9341_WriteData(0x00); + ili9341_WriteData(0x16); + ili9341_WriteData(0x1B); + ili9341_WriteData(0x04); + ili9341_WriteData(0x11); + ili9341_WriteData(0x07); + ili9341_WriteData(0x31); + ili9341_WriteData(0x33); + ili9341_WriteData(0x42); + ili9341_WriteData(0x05); + ili9341_WriteData(0x0C); + ili9341_WriteData(0x0A); + ili9341_WriteData(0x28); + ili9341_WriteData(0x2F); + ili9341_WriteData(0x0F); + + ili9341_WriteReg(LCD_SLEEP_OUT); + delay_ms(200); + ili9341_WriteReg(LCD_DISPLAY_ON); + /* GRAM start writing */ + ili9341_WriteReg(LCD_GRAM); +} + +/** + * @brief Initializes the LCD layers. + * @param LayerIndex: the layer foreground or background. + * @param FB_Address: the layer frame buffer. + */ +void BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address) +{ + LTDC_LayerCfgTypeDef Layercfg; + + /* Layer Init */ + Layercfg.WindowX0 = 0; + Layercfg.WindowX1 = 240; + Layercfg.WindowY0 = 0; + Layercfg.WindowY1 = 320; + Layercfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565; + Layercfg.FBStartAdress = FB_Address; + Layercfg.Alpha = 255; + Layercfg.Alpha0 = 0; + Layercfg.Backcolor.Blue = 0; + Layercfg.Backcolor.Green = 0; + Layercfg.Backcolor.Red = 0; + Layercfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA; + Layercfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA; + Layercfg.ImageWidth = 240; + Layercfg.ImageHeight = 320; + + HAL_LTDC_ConfigLayer(&LtdcHandler, &Layercfg, LayerIndex); + + //DrawProp[LayerIndex].BackColor = LCD_COLOR_WHITE; + //DrawProp[LayerIndex].pFont = &Font24; + //DrawProp[LayerIndex].TextColor = LCD_COLOR_BLACK; + + /* Dithering activation */ + HAL_LTDC_EnableDither(&LtdcHandler); +} + +uint8_t BSP_LCD_Init(void) +{ + /* On STM32F429I-DISCO, it is not possible to read ILI9341 ID because */ + /* PIN EXTC is not connected to VDD and then LCD_READ_ID4 is not accessible. */ + /* In this case, ReadID function is bypassed.*/ + /*if(ili9341_drv.ReadID() == ILI9341_ID)*/ + + /* LTDC Configuration ----------------------------------------------------*/ + LtdcHandler.Instance = LTDC; + + /* Timing configuration (Typical configuration from ILI9341 datasheet) + HSYNC=10 (9+1) + HBP=20 (29-10+1) + ActiveW=240 (269-20-10+1) + HFP=10 (279-240-20-10+1) + + VSYNC=2 (1+1) + VBP=2 (3-2+1) + ActiveH=320 (323-2-2+1) + VFP=4 (327-320-2-2+1) + */ + + /* Configure horizontal synchronization width */ + LtdcHandler.Init.HorizontalSync = ILI9341_HSYNC; + /* Configure vertical synchronization height */ + LtdcHandler.Init.VerticalSync = ILI9341_VSYNC; + /* Configure accumulated horizontal back porch */ + LtdcHandler.Init.AccumulatedHBP = ILI9341_HBP; + /* Configure accumulated vertical back porch */ + LtdcHandler.Init.AccumulatedVBP = ILI9341_VBP; + /* Configure accumulated active width */ + LtdcHandler.Init.AccumulatedActiveW = 269; + /* Configure accumulated active height */ + LtdcHandler.Init.AccumulatedActiveH = 323; + /* Configure total width */ + LtdcHandler.Init.TotalWidth = 279; + /* Configure total height */ + LtdcHandler.Init.TotalHeigh = 327; + + /* Configure R,G,B component values for LCD background color */ + LtdcHandler.Init.Backcolor.Red= 0; + LtdcHandler.Init.Backcolor.Blue= 0; + LtdcHandler.Init.Backcolor.Green= 0; + + /* LCD clock configuration */ + /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */ + /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 192 Mhz */ + /* PLLLCDCLK = PLLSAI_VCO Output/PLLSAIR = 192/4 = 48 Mhz */ + /* LTDC clock frequency = PLLLCDCLK / LTDC_PLLSAI_DIVR_8 = 48/4 = 6Mhz */ + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC; + PeriphClkInitStruct.PLLSAI.PLLSAIN = 192; + PeriphClkInitStruct.PLLSAI.PLLSAIR = 4; + PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_8; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + + /* Polarity */ + LtdcHandler.Init.HSPolarity = LTDC_HSPOLARITY_AL; + LtdcHandler.Init.VSPolarity = LTDC_VSPOLARITY_AL; + LtdcHandler.Init.DEPolarity = LTDC_DEPOLARITY_AL; + LtdcHandler.Init.PCPolarity = LTDC_PCPOLARITY_IPC; + + BSP_LCD_MspInit(); + HAL_LTDC_Init(&LtdcHandler); + + /* Select the device */ + //LcdDrv = &ili9341_drv; + + /* LCD Init */ + ili9341_Init(); + + /* Initialize the SDRAM */ + //BSP_SDRAM_Init(); + + /* Initialize the font */ + //BSP_LCD_SetFont(&LCD_DEFAULT_FONT); + + return 0; +} + +void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code) +{ + /* Write data value to all SDRAM memory */ + *(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*240 + Xpos))) = RGB_Code; +} + +void BSP_LCD_DrawLine(uint32_t pixel, uint16_t X1, uint16_t Y1, uint16_t X2, uint16_t Y2) +{ + int16_t deltax = 0, deltay = 0, x = 0, y = 0, xinc1 = 0, xinc2 = 0, + yinc1 = 0, yinc2 = 0, den = 0, num = 0, numadd = 0, numpixels = 0, + curpixel = 0; + + deltax = ABS(X2 - X1); /* The difference between the x's */ + deltay = ABS(Y2 - Y1); /* The difference between the y's */ + x = X1; /* Start x off at the first pixel */ + y = Y1; /* Start y off at the first pixel */ + + if (X2 >= X1) /* The x-values are increasing */ + { + xinc1 = 1; + xinc2 = 1; + } + else /* The x-values are decreasing */ + { + xinc1 = -1; + xinc2 = -1; + } + + if (Y2 >= Y1) /* The y-values are increasing */ + { + yinc1 = 1; + yinc2 = 1; + } + else /* The y-values are decreasing */ + { + yinc1 = -1; + yinc2 = -1; + } + + if (deltax >= deltay) /* There is at least one x-value for every y-value */ + { + xinc1 = 0; /* Don't change the x when numerator >= denominator */ + yinc2 = 0; /* Don't change the y for every iteration */ + den = deltax; + num = deltax / 2; + numadd = deltay; + numpixels = deltax; /* There are more x-values than y-values */ + } + else /* There is at least one y-value for every x-value */ + { + xinc2 = 0; /* Don't change the x for every iteration */ + yinc1 = 0; /* Don't change the y when numerator >= denominator */ + den = deltay; + num = deltay / 2; + numadd = deltax; + numpixels = deltay; /* There are more y-values than x-values */ + } + + for (curpixel = 0; curpixel <= numpixels; curpixel++) + { + BSP_LCD_DrawPixel(x, y, pixel); /* Draw the current pixel */ + num += numadd; /* Increase the numerator by the top of the fraction */ + if (num >= den) /* Check if numerator >= denominator */ + { + num -= den; /* Calculate the new numerator value */ + x += xinc1; /* Change the x as appropriate */ + y += yinc1; /* Change the y as appropriate */ + } + x += xinc2; /* Change the x as appropriate */ + y += yinc2; /* Change the y as appropriate */ + } +} + +rt_uint16_t ili9341_bgr2rgb(rt_uint16_t value) +{ + rt_uint16_t red, green, blue; + + blue = (value >> 0) & 0x1f; + green = (value >> 5) & 0x3f; + red = (value >> 11) & 0x1f; + + return (blue << 11) + (green << 5) + (red << 0); +} + +//static void ili9341_set_scan_direction(rt_uint8_t dir) +//{ +// rt_uint16_t regval = 0; +// rt_uint16_t dirreg = 0; +// rt_uint16_t temp; + +// switch (dir) +// { +// case L2R_U2D://从左到右,从上到下 +// regval |= (0 << 7) | (0 << 6) | (0 << 5); +// break; +// case L2R_D2U://从左到右,从下到上 +// regval |= (1 << 7) | (0 << 6) | (0 << 5); +// break; +// case R2L_U2D://从右到左,从上到下 +// regval |= (0 << 7) | (1 << 6) | (0 << 5); +// break; +// case R2L_D2U://从右到左,从下到上 +// regval |= (1 << 7) | (1 << 6) | (0 << 5); +// break; +// case U2D_L2R://从上到下,从左到右 +// regval |= (0 << 7) | (0 << 6) | (1 << 5); +// break; +// case U2D_R2L://从上到下,从右到左 +// regval |= (0 << 7) | (1 << 6) | (1 << 5); +// break; +// case D2U_L2R://从下到上,从左到右 +// regval |= (1 << 7) | (0 << 6) | (1 << 5); +// break; +// case D2U_R2L://从下到上,从右到左 +// regval |= (1 << 7) | (1 << 6) | (1 << 5); +// break; +// } + +// dirreg = 0X36; +// ili9341_write_reg_with_value(dirreg, regval); + +// if (regval & 0X20) +// { +// if (lcddev.width < lcddev.height)//交换X,Y +// { +// temp = lcddev.width; +// lcddev.width = lcddev.height; +// lcddev.height = temp; +// } +// } +// else +// { +// if (lcddev.width > lcddev.height)//交换X,Y +// { +// temp = lcddev.width; +// lcddev.width = lcddev.height; +// lcddev.height = temp; +// } +// } +// +// ili9341_write_reg(lcddev.setxcmd); +// ili9341_write_data(0); +// ili9341_write_data(0); +// ili9341_write_data((lcddev.width - 1) >> 8); +// ili9341_write_data((lcddev.width - 1) & 0XFF); + +// ili9341_write_reg(lcddev.setycmd); +// ili9341_write_data(0); +// ili9341_write_data(0); +// ili9341_write_data((lcddev.height - 1) >> 8); +// ili9341_write_data((lcddev.height - 1) & 0XFF); +//} + +//void ili9341_set_backlight(rt_uint8_t pwm) +//{ +// ili9341_write_reg(0xBE); +// ili9341_write_data(0x05); +// ili9341_write_data(pwm*2.55); +// ili9341_write_data(0x01); +// ili9341_write_data(0xFF); +// ili9341_write_data(0x00); +// ili9341_write_data(0x00); +//} + +//void ili9341_set_display_direction(rt_uint8_t dir) +//{ +// lcddev.dir = dir; +// if (dir == 0) +// { +// lcddev.width = 240; +// lcddev.height = 320; +// } +// else +// { +// lcddev.width = 320; +// lcddev.height = 240; +// } + +// lcddev.wramcmd = 0X2C; +// lcddev.setxcmd = 0X2A; +// lcddev.setycmd = 0X2B; + +// ili9341_set_scan_direction(DFT_SCAN_DIR); +//} + + +void _lcd_low_level_init(void) +{ + BSP_LCD_Init(); + BSP_LCD_LayerDefaultInit(0,0xD0000000); + BSP_LCD_SelectLayer(0); + BSP_LCD_DisplayOn(); + lcddev.width = 240; + lcddev.height = 320; + //ili9341_set_display_direction(0); + //HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, GPIO_PIN_SET); +} + + +static rt_err_t lcd_init(rt_device_t dev) +{ + return RT_EOK; +} + +static rt_err_t lcd_open(rt_device_t dev, rt_uint16_t oflag) +{ + return RT_EOK; +} + +static rt_err_t lcd_close(rt_device_t dev) +{ + return RT_EOK; +} + +static rt_err_t lcd_control(rt_device_t dev, int cmd, void *args) +{ + switch (cmd) + { + case RTGRAPHIC_CTRL_GET_INFO: + { + struct rt_device_graphic_info *info; + + info = (struct rt_device_graphic_info*) args; + RT_ASSERT(info != RT_NULL); + + info->bits_per_pixel = 16; + info->pixel_format = RTGRAPHIC_PIXEL_FORMAT_RGB565; + info->framebuffer = RT_NULL; + info->width = 240; + info->height = 320; + } + break; + + case RTGRAPHIC_CTRL_RECT_UPDATE: + /* nothong to be done */ + break; + + default: + break; + } + + return RT_EOK; +} + +static void ili9341_lcd_set_pixel(const char* pixel, int x, int y) +{ + *(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(y * 240 + x))) = *(uint16_t *)pixel; +} +#ifdef RT_USING_FINSH +static void lcd_set_pixel(uint16_t color, int x, int y) +{ + rt_kprintf("lcd set pixel, color: %X, x: %d, y: %d", color, x, y); + ili9341_lcd_set_pixel((const char *)&color, x, y); +} +FINSH_FUNCTION_EXPORT(lcd_set_pixel, set pixel in lcd display); +#endif + +static void ili9341_lcd_get_pixel(char* pixel, int x, int y) +{ + uint32_t ret = 0; + + if(LtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888) + { + /* Read data value from SDRAM memory */ + ret = *(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(y * 240 + x))); + } + else if(LtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB888) + { + /* Read data value from SDRAM memory */ + ret = (*(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(y*240 + x))) & 0x00FFFFFF); + } + else if((LtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565) || \ + (LtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB4444) || \ + (LtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_AL88)) + { + /* Read data value from SDRAM memory */ + ret = *(__IO uint16_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(y*240 + x))); + } + else + { + /* Read data value from SDRAM memory */ + ret = *(__IO uint8_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(y*240 + x))); + } + + *pixel = ret; +} +#ifdef RT_USING_FINSH +static void lcd_get_pixel(int x, int y) +{ + uint16_t pixel; + ili9341_lcd_get_pixel((char *)&pixel, x, y); + rt_kprintf("lcd get pixel, pixel: 0x%X, x: %d, y: %d", pixel, x, y); +} +FINSH_FUNCTION_EXPORT(lcd_get_pixel, get pixel in lcd display); +#endif + +static void ili9341_lcd_draw_hline(const char* pixel, int x1, int x2, int y) +{ + BSP_LCD_DrawLine(*pixel, x1, y, x2, y); +} +#ifdef RT_USING_FINSH +static void lcd_draw_hline(uint16_t pixel, int x1, int x2, int y) +{ + ili9341_lcd_draw_hline((const char *)&pixel, x1, x2, y); + rt_kprintf("lcd draw hline, pixel: 0x%X, x1: %d, x2: %d, y: %d", pixel, x1, x2, y); +} +FINSH_FUNCTION_EXPORT(lcd_draw_hline, draw hline in lcd display); +#endif + +static void ili9341_lcd_draw_vline(const char* pixel, int x, int y1, int y2) +{ + BSP_LCD_DrawLine(*pixel, x, y1, x, y2); +} +#ifdef RT_USING_FINSH +static void lcd_draw_vline(uint16_t pixel, int x, int y1, int y2) +{ + ili9341_lcd_draw_vline((const char *)&pixel, x, y1, y2); + rt_kprintf("lcd draw hline, pixel: 0x%X, x: %d, y: %d", pixel, y1, y2); +} +FINSH_FUNCTION_EXPORT(lcd_draw_vline, draw vline in lcd display); +#endif + +static void ili9341_lcd_blit_line(const char* pixels, int x, int y, rt_size_t size) +{ + int i = 0; + while(size--) + *(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(y*240 + x + i++))) = *(uint16_t *)pixels++; +} +#ifdef RT_USING_FINSH +#define LINE_LEN 30 +static void lcd_blit_line(int x, int y) +{ + uint16_t pixels[LINE_LEN]; + int i; + + for (i = 0; i < LINE_LEN; i++) + { + pixels[i] = i * 40 + 50; + } + + ili9341_lcd_blit_line((const char *)pixels, x, y, LINE_LEN); + rt_kprintf("lcd blit line, x: %d, y: %d", x, y); +} +FINSH_FUNCTION_EXPORT(lcd_blit_line, draw blit line in lcd display); +#endif + +static int rt_hw_lcd_init(void) +{ + _lcd_low_level_init(); + + static struct rt_device lcd_device; + + static struct rt_device_graphic_ops ili9341_ops = + { + ili9341_lcd_set_pixel, + ili9341_lcd_get_pixel, + ili9341_lcd_draw_hline, + ili9341_lcd_draw_vline, + ili9341_lcd_blit_line + }; + + /* register lcd device */ + lcd_device.type = RT_Device_Class_Graphic; + lcd_device.init = lcd_init; + lcd_device.open = lcd_open; + lcd_device.close = lcd_close; + lcd_device.control = lcd_control; + lcd_device.read = RT_NULL; + lcd_device.write = RT_NULL; + + lcd_device.user_data = &ili9341_ops; + + /* register graphic device driver */ + rt_device_register(&lcd_device, "lcd", + RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_STANDALONE); + + return 0; +} +INIT_BOARD_EXPORT(rt_hw_lcd_init); diff --git a/bsp/stm32f429-disco/drivers/drv_lcd.h b/bsp/stm32f429-disco/drivers/drv_lcd.h new file mode 100644 index 0000000000..abb83e7e4f --- /dev/null +++ b/bsp/stm32f429-disco/drivers/drv_lcd.h @@ -0,0 +1,154 @@ +#ifndef __DRV_LCD_H__ +#define __DRV_LCD_H__ + +#include +#include "stm32f4xx_hal.h" + +#define ILI9341_HSYNC ((uint32_t)9) /* Horizontal synchronization */ +#define ILI9341_HBP ((uint32_t)29) /* Horizontal back porch */ +#define ILI9341_HFP ((uint32_t)2) /* Horizontal front porch */ +#define ILI9341_VSYNC ((uint32_t)1) /* Vertical synchronization */ +#define ILI9341_VBP ((uint32_t)3) /* Vertical back porch */ +#define ILI9341_VFP ((uint32_t)2) /* Vertical front porch */ + + +/** + * @brief ILI9341 Registers + */ + +/* Level 1 Commands */ +#define LCD_SWRESET 0x01 /* Software Reset */ +#define LCD_READ_DISPLAY_ID 0x04 /* Read display identification information */ +#define LCD_RDDST 0x09 /* Read Display Status */ +#define LCD_RDDPM 0x0A /* Read Display Power Mode */ +#define LCD_RDDMADCTL 0x0B /* Read Display MADCTL */ +#define LCD_RDDCOLMOD 0x0C /* Read Display Pixel Format */ +#define LCD_RDDIM 0x0D /* Read Display Image Format */ +#define LCD_RDDSM 0x0E /* Read Display Signal Mode */ +#define LCD_RDDSDR 0x0F /* Read Display Self-Diagnostic Result */ +#define LCD_SPLIN 0x10 /* Enter Sleep Mode */ +#define LCD_SLEEP_OUT 0x11 /* Sleep out register */ +#define LCD_PTLON 0x12 /* Partial Mode ON */ +#define LCD_NORMAL_MODE_ON 0x13 /* Normal Display Mode ON */ +#define LCD_DINVOFF 0x20 /* Display Inversion OFF */ +#define LCD_DINVON 0x21 /* Display Inversion ON */ +#define LCD_GAMMA 0x26 /* Gamma register */ +#define LCD_DISPLAY_OFF 0x28 /* Display off register */ +#define LCD_DISPLAY_ON 0x29 /* Display on register */ +#define LCD_COLUMN_ADDR 0x2A /* Colomn address register */ +#define LCD_PAGE_ADDR 0x2B /* Page address register */ +#define LCD_GRAM 0x2C /* GRAM register */ +#define LCD_RGBSET 0x2D /* Color SET */ +#define LCD_RAMRD 0x2E /* Memory Read */ +#define LCD_PLTAR 0x30 /* Partial Area */ +#define LCD_VSCRDEF 0x33 /* Vertical Scrolling Definition */ +#define LCD_TEOFF 0x34 /* Tearing Effect Line OFF */ +#define LCD_TEON 0x35 /* Tearing Effect Line ON */ +#define LCD_MAC 0x36 /* Memory Access Control register*/ +#define LCD_VSCRSADD 0x37 /* Vertical Scrolling Start Address */ +#define LCD_IDMOFF 0x38 /* Idle Mode OFF */ +#define LCD_IDMON 0x39 /* Idle Mode ON */ +#define LCD_PIXEL_FORMAT 0x3A /* Pixel Format register */ +#define LCD_WRITE_MEM_CONTINUE 0x3C /* Write Memory Continue */ +#define LCD_READ_MEM_CONTINUE 0x3E /* Read Memory Continue */ +#define LCD_SET_TEAR_SCANLINE 0x44 /* Set Tear Scanline */ +#define LCD_GET_SCANLINE 0x45 /* Get Scanline */ +#define LCD_WDB 0x51 /* Write Brightness Display register */ +#define LCD_RDDISBV 0x52 /* Read Display Brightness */ +#define LCD_WCD 0x53 /* Write Control Display register*/ +#define LCD_RDCTRLD 0x54 /* Read CTRL Display */ +#define LCD_WRCABC 0x55 /* Write Content Adaptive Brightness Control */ +#define LCD_RDCABC 0x56 /* Read Content Adaptive Brightness Control */ +#define LCD_WRITE_CABC 0x5E /* Write CABC Minimum Brightness */ +#define LCD_READ_CABC 0x5F /* Read CABC Minimum Brightness */ +#define LCD_READ_ID1 0xDA /* Read ID1 */ +#define LCD_READ_ID2 0xDB /* Read ID2 */ +#define LCD_READ_ID3 0xDC /* Read ID3 */ + +/* Level 2 Commands */ +#define LCD_RGB_INTERFACE 0xB0 /* RGB Interface Signal Control */ +#define LCD_FRMCTR1 0xB1 /* Frame Rate Control (In Normal Mode) */ +#define LCD_FRMCTR2 0xB2 /* Frame Rate Control (In Idle Mode) */ +#define LCD_FRMCTR3 0xB3 /* Frame Rate Control (In Partial Mode) */ +#define LCD_INVTR 0xB4 /* Display Inversion Control */ +#define LCD_BPC 0xB5 /* Blanking Porch Control register */ +#define LCD_DFC 0xB6 /* Display Function Control register */ +#define LCD_ETMOD 0xB7 /* Entry Mode Set */ +#define LCD_BACKLIGHT1 0xB8 /* Backlight Control 1 */ +#define LCD_BACKLIGHT2 0xB9 /* Backlight Control 2 */ +#define LCD_BACKLIGHT3 0xBA /* Backlight Control 3 */ +#define LCD_BACKLIGHT4 0xBB /* Backlight Control 4 */ +#define LCD_BACKLIGHT5 0xBC /* Backlight Control 5 */ +#define LCD_BACKLIGHT7 0xBE /* Backlight Control 7 */ +#define LCD_BACKLIGHT8 0xBF /* Backlight Control 8 */ +#define LCD_POWER1 0xC0 /* Power Control 1 register */ +#define LCD_POWER2 0xC1 /* Power Control 2 register */ +#define LCD_VCOM1 0xC5 /* VCOM Control 1 register */ +#define LCD_VCOM2 0xC7 /* VCOM Control 2 register */ +#define LCD_NVMWR 0xD0 /* NV Memory Write */ +#define LCD_NVMPKEY 0xD1 /* NV Memory Protection Key */ +#define LCD_RDNVM 0xD2 /* NV Memory Status Read */ +#define LCD_READ_ID4 0xD3 /* Read ID4 */ +#define LCD_PGAMMA 0xE0 /* Positive Gamma Correction register */ +#define LCD_NGAMMA 0xE1 /* Negative Gamma Correction register */ +#define LCD_DGAMCTRL1 0xE2 /* Digital Gamma Control 1 */ +#define LCD_DGAMCTRL2 0xE3 /* Digital Gamma Control 2 */ +#define LCD_INTERFACE 0xF6 /* Interface control register */ + +/* Extend register commands */ +#define LCD_POWERA 0xCB /* Power control A register */ +#define LCD_POWERB 0xCF /* Power control B register */ +#define LCD_DTCA 0xE8 /* Driver timing control A */ +#define LCD_DTCB 0xEA /* Driver timing control B */ +#define LCD_POWER_SEQ 0xED /* Power on sequence register */ +#define LCD_3GAMMA_EN 0xF2 /* 3 Gamma enable register */ +#define LCD_PRC 0xF7 /* Pump ratio control register */ + +/* Size of read registers */ +#define LCD_READ_ID4_SIZE 3 /* Size of Read ID4 */ + +#define ABS(X) ((X) > 0 ? (X) : -(X)) + +/* Chip Select macro definition */ +#define LCD_CS_LOW() HAL_GPIO_WritePin(LCD_NCS_GPIO_PORT, LCD_NCS_PIN, GPIO_PIN_RESET) +#define LCD_CS_HIGH() HAL_GPIO_WritePin(LCD_NCS_GPIO_PORT, LCD_NCS_PIN, GPIO_PIN_SET) + +/* Set WRX High to send data */ +#define LCD_WRX_LOW() HAL_GPIO_WritePin(LCD_WRX_GPIO_PORT, LCD_WRX_PIN, GPIO_PIN_RESET) +#define LCD_WRX_HIGH() HAL_GPIO_WritePin(LCD_WRX_GPIO_PORT, LCD_WRX_PIN, GPIO_PIN_SET) + +/* Set WRX High to send data */ +#define LCD_RDX_LOW() HAL_GPIO_WritePin(LCD_RDX_GPIO_PORT, LCD_RDX_PIN, GPIO_PIN_RESET) +#define LCD_RDX_HIGH() HAL_GPIO_WritePin(LCD_RDX_GPIO_PORT, LCD_RDX_PIN, GPIO_PIN_SET) + +/** + * @brief LCD Control pin + */ +#define LCD_NCS_PIN GPIO_PIN_2 +#define LCD_NCS_GPIO_PORT GPIOC +#define LCD_NCS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() +#define LCD_NCS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE() +/** + * @} + */ +/** + * @brief LCD Command/data pin + */ +#define LCD_WRX_PIN GPIO_PIN_13 +#define LCD_WRX_GPIO_PORT GPIOD +#define LCD_WRX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE() +#define LCD_WRX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE() + +#define LCD_RDX_PIN GPIO_PIN_12 +#define LCD_RDX_GPIO_PORT GPIOD +#define LCD_RDX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE() +#define LCD_RDX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE() + +int rt_lcd_init(void); + +#endif + + + + + diff --git a/bsp/stm32f429-disco/drivers/stm32f4xx_hal_conf.h b/bsp/stm32f429-disco/drivers/stm32f4xx_hal_conf.h index a010dda5e1..0bff765afe 100644 --- a/bsp/stm32f429-disco/drivers/stm32f4xx_hal_conf.h +++ b/bsp/stm32f429-disco/drivers/stm32f4xx_hal_conf.h @@ -68,12 +68,12 @@ /* #define HAL_I2C_MODULE_ENABLED */ /* #define HAL_I2S_MODULE_ENABLED */ /* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ +#define HAL_LTDC_MODULE_ENABLED /* #define HAL_RNG_MODULE_ENABLED */ /* #define HAL_RTC_MODULE_ENABLED */ /* #define HAL_SAI_MODULE_ENABLED */ /* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_SPI_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED /* #define HAL_TIM_MODULE_ENABLED */ #define HAL_UART_MODULE_ENABLED /* #define HAL_USART_MODULE_ENABLED */ From fd7af6a1509a0e282011fd7c3d9b18455f46da87 Mon Sep 17 00:00:00 2001 From: xuzhuoyi Date: Thu, 13 Sep 2018 19:13:00 +0800 Subject: [PATCH 2/6] [bsp][stm32f429-disco] Add SPI Error Handler --- bsp/stm32f429-disco/drivers/drv_lcd.c | 60 ++++++++++++++++++++++++++- bsp/stm32f429-disco/drivers/drv_lcd.h | 7 ++++ 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/bsp/stm32f429-disco/drivers/drv_lcd.c b/bsp/stm32f429-disco/drivers/drv_lcd.c index 99522871f9..b94e16539d 100644 --- a/bsp/stm32f429-disco/drivers/drv_lcd.c +++ b/bsp/stm32f429-disco/drivers/drv_lcd.c @@ -173,6 +173,34 @@ __weak void BSP_LCD_MspInit(void) HAL_GPIO_Init(GPIOG, &GPIO_InitStructure); } +/** + * @brief SPIx error treatment function. + */ +static void SPIx_Error(void) +{ + /* De-initialize the SPI communication BUS */ + HAL_SPI_DeInit(&hspi5); + + /* Re- Initialize the SPI communication BUS */ + /* SPI5 parameter configuration*/ + hspi5.Instance = SPI5; + hspi5.Init.Mode = SPI_MODE_MASTER; + hspi5.Init.Direction = SPI_DIRECTION_2LINES; + hspi5.Init.DataSize = SPI_DATASIZE_8BIT; + hspi5.Init.CLKPolarity = SPI_POLARITY_LOW; + hspi5.Init.CLKPhase = SPI_PHASE_1EDGE; + hspi5.Init.NSS = SPI_NSS_SOFT; + hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; + hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB; + hspi5.Init.TIMode = SPI_TIMODE_DISABLE; + hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; + hspi5.Init.CRCPolynomial = 10; + if (HAL_SPI_Init(&hspi5) != HAL_OK) + { + //_Error_Handler(__FILE__, __LINE__); + } +} + /** * @brief Writes a byte to device. * @param Value: value to be written @@ -187,7 +215,7 @@ static void SPIx_Write(uint16_t Value) if(status != HAL_OK) { /* Re-Initialize the BUS */ - //SPIx_Error(); + SPIx_Error(); } } @@ -207,7 +235,7 @@ static uint32_t SPIx_Read(uint8_t ReadSize) if(status != HAL_OK) { /* Re-Initialize the BUS */ - //SPIx_Error(); + SPIx_Error(); } return readvalue; @@ -752,6 +780,34 @@ rt_uint16_t ili9341_bgr2rgb(rt_uint16_t value) void _lcd_low_level_init(void) { + GPIO_InitTypeDef GPIO_InitStruct; + + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOC, CSX_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOD, RDX_Pin|WRX_DCX_Pin, GPIO_PIN_RESET); + + + /*Configure GPIO pins : NCS_MEMS_SPI_Pin CSX_Pin OTG_FS_PSO_Pin */ + GPIO_InitStruct.Pin = CSX_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + /*Configure GPIO pins : RDX_Pin WRX_DCX_Pin */ + GPIO_InitStruct.Pin = RDX_Pin|WRX_DCX_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); + + BSP_LCD_Init(); BSP_LCD_LayerDefaultInit(0,0xD0000000); BSP_LCD_SelectLayer(0); diff --git a/bsp/stm32f429-disco/drivers/drv_lcd.h b/bsp/stm32f429-disco/drivers/drv_lcd.h index abb83e7e4f..b62242bbe1 100644 --- a/bsp/stm32f429-disco/drivers/drv_lcd.h +++ b/bsp/stm32f429-disco/drivers/drv_lcd.h @@ -109,6 +109,13 @@ #define ABS(X) ((X) > 0 ? (X) : -(X)) +#define CSX_Pin GPIO_PIN_2 +#define CSX_GPIO_Port GPIOC +#define RDX_Pin GPIO_PIN_12 +#define RDX_GPIO_Port GPIOD +#define WRX_DCX_Pin GPIO_PIN_13 +#define WRX_DCX_GPIO_Port GPIOD + /* Chip Select macro definition */ #define LCD_CS_LOW() HAL_GPIO_WritePin(LCD_NCS_GPIO_PORT, LCD_NCS_PIN, GPIO_PIN_RESET) #define LCD_CS_HIGH() HAL_GPIO_WritePin(LCD_NCS_GPIO_PORT, LCD_NCS_PIN, GPIO_PIN_SET) From 68c5cc39c33e18024b7fe42b45f4ed6ae05ba1c2 Mon Sep 17 00:00:00 2001 From: xuzhuoyi Date: Thu, 13 Sep 2018 21:35:52 +0800 Subject: [PATCH 3/6] [bsp][stm32f429-disco] Add guiengine support --- .../applications/application.c | 5 + bsp/stm32f429-disco/drivers/drv_lcd.c | 98 +++++++++++++++---- bsp/stm32f429-disco/drivers/drv_lcd.h | 19 +++- 3 files changed, 102 insertions(+), 20 deletions(-) diff --git a/bsp/stm32f429-disco/applications/application.c b/bsp/stm32f429-disco/applications/application.c index e6ad9e652f..621f1f988d 100644 --- a/bsp/stm32f429-disco/applications/application.c +++ b/bsp/stm32f429-disco/applications/application.c @@ -34,6 +34,8 @@ void rt_init_thread_entry(void* parameter) { + rt_device_t lcd; + /* GDB STUB */ #ifdef RT_USING_GDB gdb_set_device("uart6"); @@ -59,6 +61,9 @@ void rt_init_thread_entry(void* parameter) #ifdef RT_USING_FINSH finsh_system_init(); #endif + lcd = rt_device_find("lcd"); + rtgui_graphic_set_device(lcd); + rt_gui_demo_init(); } int rt_application_init() diff --git a/bsp/stm32f429-disco/drivers/drv_lcd.c b/bsp/stm32f429-disco/drivers/drv_lcd.c index b94e16539d..30481c0790 100644 --- a/bsp/stm32f429-disco/drivers/drv_lcd.c +++ b/bsp/stm32f429-disco/drivers/drv_lcd.c @@ -64,6 +64,7 @@ static RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; static uint32_t ActiveLayer = 0; //LCD_DrvTypeDef *LcdDrv; SPI_HandleTypeDef hspi5; +static SPI_HandleTypeDef SpiHandle; void delay_us(rt_uint32_t nus) { @@ -86,6 +87,28 @@ void delay_ms(rt_uint32_t nms) } } +/** + * @brief SPI MSP Init. + * @param hspi: SPI handle + */ +static void SPIx_MspInit(SPI_HandleTypeDef *hspi) +{ + GPIO_InitTypeDef GPIO_InitStructure; + + /* Enable SPIx clock */ + DISCOVERY_SPIx_CLK_ENABLE(); + + /* Enable DISCOVERY_SPI GPIO clock */ + DISCOVERY_SPIx_GPIO_CLK_ENABLE(); + + /* configure SPI SCK, MOSI and MISO */ + GPIO_InitStructure.Pin = (DISCOVERY_SPIx_SCK_PIN | DISCOVERY_SPIx_MOSI_PIN | DISCOVERY_SPIx_MISO_PIN); + GPIO_InitStructure.Mode = GPIO_MODE_AF_PP; + GPIO_InitStructure.Pull = GPIO_PULLDOWN; + GPIO_InitStructure.Speed = GPIO_SPEED_MEDIUM; + GPIO_InitStructure.Alternate = DISCOVERY_SPIx_AF; + HAL_GPIO_Init(DISCOVERY_SPIx_GPIO_PORT, &GPIO_InitStructure); +} /** * @brief Selects the LCD Layer. @@ -244,29 +267,66 @@ static uint32_t SPIx_Read(uint8_t ReadSize) /** * @brief Configures the LCD_SPI interface. */ -__weak void LCD_IO_Init(void) +void LCD_IO_Init(void) { - /* Set or Reset the control line */ + GPIO_InitTypeDef GPIO_InitStructure; + + + /* Configure NCS in Output Push-Pull mode */ + LCD_WRX_GPIO_CLK_ENABLE(); + GPIO_InitStructure.Pin = LCD_WRX_PIN; + GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStructure.Pull = GPIO_NOPULL; + GPIO_InitStructure.Speed = GPIO_SPEED_FAST; + HAL_GPIO_Init(LCD_WRX_GPIO_PORT, &GPIO_InitStructure); + + LCD_RDX_GPIO_CLK_ENABLE(); + GPIO_InitStructure.Pin = LCD_RDX_PIN; + GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStructure.Pull = GPIO_NOPULL; + GPIO_InitStructure.Speed = GPIO_SPEED_FAST; + HAL_GPIO_Init(LCD_RDX_GPIO_PORT, &GPIO_InitStructure); + + /* Configure the LCD Control pins ----------------------------------------*/ + LCD_NCS_GPIO_CLK_ENABLE(); + + /* Configure NCS in Output Push-Pull mode */ + GPIO_InitStructure.Pin = LCD_NCS_PIN; + GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStructure.Pull = GPIO_NOPULL; + GPIO_InitStructure.Speed = GPIO_SPEED_FAST; + HAL_GPIO_Init(LCD_NCS_GPIO_PORT, &GPIO_InitStructure); + + /* Set or Reset the control line */ LCD_CS_LOW(); LCD_CS_HIGH(); - /* SPI5 parameter configuration*/ - hspi5.Instance = SPI5; - hspi5.Init.Mode = SPI_MODE_MASTER; - hspi5.Init.Direction = SPI_DIRECTION_2LINES; - hspi5.Init.DataSize = SPI_DATASIZE_8BIT; - hspi5.Init.CLKPolarity = SPI_POLARITY_LOW; - hspi5.Init.CLKPhase = SPI_PHASE_1EDGE; - hspi5.Init.NSS = SPI_NSS_SOFT; - hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; - hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB; - hspi5.Init.TIMode = SPI_TIMODE_DISABLE; - hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; - hspi5.Init.CRCPolynomial = 10; - if (HAL_SPI_Init(&hspi5) != HAL_OK) - { - //_Error_Handler(__FILE__, __LINE__); - } + /* SPI configuration -----------------------------------------------------*/ + SpiHandle.Instance = DISCOVERY_SPIx; + /* SPI baudrate is set to 5.6 MHz (PCLK2/SPI_BaudRatePrescaler = 90/16 = 5.625 MHz) + to verify these constraints: + - ILI9341 LCD SPI interface max baudrate is 10MHz for write and 6.66MHz for read + - l3gd20 SPI interface max baudrate is 10MHz for write/read + - PCLK2 frequency is set to 90 MHz + */ + SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; + + /* On STM32F429I-Discovery, LCD ID cannot be read then keep a common configuration */ + /* for LCD and GYRO (SPI_DIRECTION_2LINES) */ + /* Note: To read a register a LCD, SPI_DIRECTION_1LINE should be set */ + SpiHandle.Init.Direction = SPI_DIRECTION_2LINES; + SpiHandle.Init.CLKPhase = SPI_PHASE_1EDGE; + SpiHandle.Init.CLKPolarity = SPI_POLARITY_LOW; + SpiHandle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED; + SpiHandle.Init.CRCPolynomial = 7; + SpiHandle.Init.DataSize = SPI_DATASIZE_8BIT; + SpiHandle.Init.FirstBit = SPI_FIRSTBIT_MSB; + SpiHandle.Init.NSS = SPI_NSS_SOFT; + SpiHandle.Init.TIMode = SPI_TIMODE_DISABLED; + SpiHandle.Init.Mode = SPI_MODE_MASTER; + + SPIx_MspInit(&SpiHandle); + HAL_SPI_Init(&SpiHandle); } diff --git a/bsp/stm32f429-disco/drivers/drv_lcd.h b/bsp/stm32f429-disco/drivers/drv_lcd.h index b62242bbe1..b537b13a67 100644 --- a/bsp/stm32f429-disco/drivers/drv_lcd.h +++ b/bsp/stm32f429-disco/drivers/drv_lcd.h @@ -150,7 +150,24 @@ #define LCD_RDX_GPIO_PORT GPIOD #define LCD_RDX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE() #define LCD_RDX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE() - + +/*############################### SPIx #######################################*/ +#define DISCOVERY_SPIx SPI5 +#define DISCOVERY_SPIx_CLK_ENABLE() __HAL_RCC_SPI5_CLK_ENABLE() +#define DISCOVERY_SPIx_GPIO_PORT GPIOF /* GPIOF */ +#define DISCOVERY_SPIx_AF GPIO_AF5_SPI5 +#define DISCOVERY_SPIx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE() +#define DISCOVERY_SPIx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE() +#define DISCOVERY_SPIx_SCK_PIN GPIO_PIN_7 /* PF.07 */ +#define DISCOVERY_SPIx_MISO_PIN GPIO_PIN_8 /* PF.08 */ +#define DISCOVERY_SPIx_MOSI_PIN GPIO_PIN_9 /* PF.09 */ +/* Maximum Timeout values for flags waiting loops. These timeouts are not based + on accurate values, they just guarantee that the application will not remain + stuck if the SPI communication is corrupted. + You may modify these timeout values depending on CPU frequency and application + conditions (interrupts routines ...). */ +#define SPIx_TIMEOUT_MAX ((uint32_t)0x1000) + int rt_lcd_init(void); #endif From efe00652c157f45fde4a9ab7fec9270c49a9b811 Mon Sep 17 00:00:00 2001 From: xuzhuoyi Date: Fri, 14 Sep 2018 20:30:09 +0800 Subject: [PATCH 4/6] [bsp][stm32f429-disco] Change to use rt_components_init() --- bsp/stm32f429-disco/applications/application.c | 10 ++-------- bsp/stm32f429-disco/drivers/board.c | 15 ++++++++++++++- bsp/stm32f429-disco/drivers/drv_lcd.c | 6 +++--- bsp/stm32f429-disco/drivers/drv_sdram.h | 2 +- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/bsp/stm32f429-disco/applications/application.c b/bsp/stm32f429-disco/applications/application.c index 621f1f988d..e0ed7642b2 100644 --- a/bsp/stm32f429-disco/applications/application.c +++ b/bsp/stm32f429-disco/applications/application.c @@ -34,8 +34,6 @@ void rt_init_thread_entry(void* parameter) { - rt_device_t lcd; - /* GDB STUB */ #ifdef RT_USING_GDB gdb_set_device("uart6"); @@ -57,13 +55,9 @@ void rt_init_thread_entry(void* parameter) rt_kprintf("TCP/IP initialized!\n"); } #endif + + rt_components_init(); -#ifdef RT_USING_FINSH - finsh_system_init(); -#endif - lcd = rt_device_find("lcd"); - rtgui_graphic_set_device(lcd); - rt_gui_demo_init(); } int rt_application_init() diff --git a/bsp/stm32f429-disco/drivers/board.c b/bsp/stm32f429-disco/drivers/board.c index 708d30345a..2fe4fb7c73 100644 --- a/bsp/stm32f429-disco/drivers/board.c +++ b/bsp/stm32f429-disco/drivers/board.c @@ -15,11 +15,16 @@ #include #include +#ifdef PKG_USING_GUIENGINE +#include +#endif + #include "stm32f4xx.h" #include "board.h" #include "usart.h" #include "stm32f4xx_hal.h" + void _init(void) { @@ -133,6 +138,8 @@ void HAL_Delay(__IO uint32_t Delay) */ void rt_hw_board_init() { + rt_device_t lcd; + HAL_Init(); SystemClock_Config(); @@ -142,10 +149,16 @@ void rt_hw_board_init() #else stm32_hw_usart_init(); #endif - + #ifdef RT_USING_CONSOLE rt_console_set_device(CONSOLE_DEVICE); #endif + +#ifdef RT_USING_CONSOLE + lcd = rt_device_find("lcd"); + rtgui_graphic_set_device(lcd); +#endif + } /*@}*/ diff --git a/bsp/stm32f429-disco/drivers/drv_lcd.c b/bsp/stm32f429-disco/drivers/drv_lcd.c index 30481c0790..c4db46a831 100644 --- a/bsp/stm32f429-disco/drivers/drv_lcd.c +++ b/bsp/stm32f429-disco/drivers/drv_lcd.c @@ -655,7 +655,7 @@ uint8_t BSP_LCD_Init(void) void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t RGB_Code) { /* Write data value to all SDRAM memory */ - *(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(Ypos*240 + Xpos))) = RGB_Code; + *(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*240 + Xpos))) = RGB_Code; } void BSP_LCD_DrawLine(uint32_t pixel, uint16_t X1, uint16_t Y1, uint16_t X2, uint16_t Y2) @@ -926,7 +926,7 @@ static rt_err_t lcd_control(rt_device_t dev, int cmd, void *args) static void ili9341_lcd_set_pixel(const char* pixel, int x, int y) { - *(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(y * 240 + x))) = *(uint16_t *)pixel; + *(__IO uint16_t*)(LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(y * 240 + x))) = *(uint16_t *)pixel; } #ifdef RT_USING_FINSH static void lcd_set_pixel(uint16_t color, int x, int y) @@ -1006,7 +1006,7 @@ static void ili9341_lcd_blit_line(const char* pixels, int x, int y, rt_size_t si { int i = 0; while(size--) - *(__IO uint32_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (4*(y*240 + x + i++))) = *(uint16_t *)pixels++; + *(__IO uint16_t*) (LtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(y*240 + x + i++))) = *(uint16_t *)pixels++; } #ifdef RT_USING_FINSH #define LINE_LEN 30 diff --git a/bsp/stm32f429-disco/drivers/drv_sdram.h b/bsp/stm32f429-disco/drivers/drv_sdram.h index 67825f602d..dce6764261 100644 --- a/bsp/stm32f429-disco/drivers/drv_sdram.h +++ b/bsp/stm32f429-disco/drivers/drv_sdram.h @@ -25,7 +25,7 @@ #include -#define SDRAM_BANK_ADDR ((uint32_t)0xD0000000) +#define SDRAM_BANK_ADDR ((uint32_t)0xD0030000) /*0xD0000000-0xD002FFFF used for LCD framebuffer*/ /* #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_8 */ #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_16 From d5c7a638008fbecbf3c982d94771d0144d6c862b Mon Sep 17 00:00:00 2001 From: xuzhuoyi Date: Sat, 15 Sep 2018 14:28:09 +0800 Subject: [PATCH 5/6] [bsp][stm32f429-disco] Modify readme.md --- bsp/stm32f429-disco/.config | 144 ++++-- bsp/stm32f429-disco/drivers/SConscript | 1 + bsp/stm32f429-disco/drivers/drv_lcd.c | 1 - bsp/stm32f429-disco/project.uvproj | 665 +++++++++++++++++++------ bsp/stm32f429-disco/project.uvprojx | 665 +++++++++++++++++++------ bsp/stm32f429-disco/readme.md | 85 +++- bsp/stm32f429-disco/rtconfig.h | 124 ++--- 7 files changed, 1268 insertions(+), 417 deletions(-) diff --git a/bsp/stm32f429-disco/.config b/bsp/stm32f429-disco/.config index 20b6514e3d..4123e8acf8 100644 --- a/bsp/stm32f429-disco/.config +++ b/bsp/stm32f429-disco/.config @@ -13,13 +13,22 @@ CONFIG_RT_THREAD_PRIORITY_32=y # CONFIG_RT_THREAD_PRIORITY_256 is not set CONFIG_RT_THREAD_PRIORITY_MAX=32 CONFIG_RT_TICK_PER_SECOND=100 -CONFIG_RT_DEBUG=y CONFIG_RT_USING_OVERFLOW_CHECK=y -CONFIG_RT_DEBUG_INIT=1 -CONFIG_RT_DEBUG_THREAD=0 CONFIG_RT_USING_HOOK=y +CONFIG_RT_IDEL_HOOK_LIST_SIZE=4 CONFIG_IDLE_THREAD_STACK_SIZE=1024 # CONFIG_RT_USING_TIMER_SOFT is not set +CONFIG_RT_DEBUG=y +# CONFIG_RT_DEBUG_INIT_CONFIG is not set +# CONFIG_RT_DEBUG_THREAD_CONFIG is not set +# CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set +# CONFIG_RT_DEBUG_IPC_CONFIG is not set +# CONFIG_RT_DEBUG_TIMER_CONFIG is not set +# CONFIG_RT_DEBUG_IRQ_CONFIG is not set +# CONFIG_RT_DEBUG_MEM_CONFIG is not set +# CONFIG_RT_DEBUG_SLAB_CONFIG is not set +# CONFIG_RT_DEBUG_MEMHEAP_CONFIG is not set +# CONFIG_RT_DEBUG_MODULE_CONFIG is not set # # Inter-Thread communication @@ -47,11 +56,11 @@ CONFIG_RT_USING_HEAP=y # Kernel Device Object # CONFIG_RT_USING_DEVICE=y +# CONFIG_RT_USING_DEVICE_OPS is not set # CONFIG_RT_USING_INTERRUPT_INFO is not set CONFIG_RT_USING_CONSOLE=y CONFIG_RT_CONSOLEBUF_SIZE=128 CONFIG_RT_CONSOLE_DEVICE_NAME="uart1" -# CONFIG_RT_USING_MODULE is not set # # RT-Thread Components @@ -73,6 +82,7 @@ CONFIG_FINSH_USING_HISTORY=y CONFIG_FINSH_HISTORY_LINES=5 CONFIG_FINSH_USING_SYMTAB=y CONFIG_FINSH_USING_DESCRIPTION=y +# CONFIG_FINSH_ECHO_DISABLE_DEFAULT is not set CONFIG_FINSH_THREAD_PRIORITY=20 CONFIG_FINSH_THREAD_STACK_SIZE=4096 CONFIG_FINSH_CMD_SIZE=80 @@ -80,26 +90,36 @@ CONFIG_FINSH_CMD_SIZE=80 CONFIG_FINSH_USING_MSH=y CONFIG_FINSH_USING_MSH_DEFAULT=y # CONFIG_FINSH_USING_MSH_ONLY is not set +CONFIG_FINSH_ARG_MAX=10 # # Device virtual file system # -# CONFIG_RT_USING_DFS is not set -# 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_USING_DFS=y +CONFIG_DFS_USING_WORKDIR=y +CONFIG_DFS_FILESYSTEMS_MAX=2 +CONFIG_DFS_FILESYSTEM_TYPES_MAX=2 +CONFIG_DFS_FD_MAX=16 +# CONFIG_RT_USING_DFS_MNTTABLE is not set +# CONFIG_RT_USING_DFS_ELMFAT is not set +CONFIG_RT_USING_DFS_DEVFS=y +# CONFIG_RT_USING_DFS_ROMFS is not set +# CONFIG_RT_USING_DFS_RAMFS is not set +# CONFIG_RT_USING_DFS_UFFS is not set +# CONFIG_RT_USING_DFS_JFFS2 is not set # # Device Drivers # CONFIG_RT_USING_DEVICE_IPC=y +CONFIG_RT_PIPE_BUFSZ=512 CONFIG_RT_USING_SERIAL=y # CONFIG_RT_USING_CAN is not set # CONFIG_RT_USING_HWTIMER is not set # CONFIG_RT_USING_CPUTIME is not set # CONFIG_RT_USING_I2C is not set CONFIG_RT_USING_PIN=y +# CONFIG_RT_USING_PWM is not set # CONFIG_RT_USING_MTD_NOR is not set # CONFIG_RT_USING_MTD_NAND is not set # CONFIG_RT_USING_RTC is not set @@ -107,6 +127,7 @@ CONFIG_RT_USING_PIN=y # CONFIG_RT_USING_SPI is not set # CONFIG_RT_USING_WDT is not set # CONFIG_RT_USING_WIFI is not set +# CONFIG_RT_USING_AUDIO is not set # # Using USB @@ -117,14 +138,18 @@ CONFIG_RT_USING_PIN=y # # POSIX layer and C standard library # -CONFIG_RT_USING_LIBC=y -CONFIG_RT_USING_PTHREADS=y -# CONFIG_HAVE_SYS_SIGNALS is not set +# CONFIG_RT_USING_LIBC is not set +# CONFIG_RT_USING_PTHREADS is not set # -# Network stack +# Network # +# +# Socket abstraction layer +# +# CONFIG_RT_USING_SAL is not set + # # light weight TCP/IP stack # @@ -135,6 +160,11 @@ CONFIG_RT_USING_PTHREADS=y # # CONFIG_RT_USING_MODBUS is not set +# +# AT commands +# +# CONFIG_RT_USING_AT is not set + # # VBUS(Virtual Software BUS) # @@ -150,19 +180,6 @@ CONFIG_RT_USING_PTHREADS=y # RT-Thread online packages # -# -# system packages -# - -# -# RT-Thread GUI Engine -# -# CONFIG_PKG_USING_GUIENGINE is not set -# CONFIG_PKG_USING_LWEXT4 is not set -# CONFIG_PKG_USING_PARTITION is not set -# CONFIG_PKG_USING_SQLITE is not set -# CONFIG_PKG_USING_RTI is not set - # # IoT - internet of things # @@ -171,10 +188,10 @@ CONFIG_RT_USING_PTHREADS=y # CONFIG_PKG_USING_MONGOOSE is not set # CONFIG_PKG_USING_WEBTERMINAL is not set # CONFIG_PKG_USING_CJSON is not set +# CONFIG_PKG_USING_JSMN is not set # CONFIG_PKG_USING_LJSON is not set # CONFIG_PKG_USING_EZXML is not set # CONFIG_PKG_USING_NANOPB is not set -# CONFIG_PKG_USING_GAGENT_CLOUD is not set # # Wi-Fi @@ -192,6 +209,15 @@ CONFIG_RT_USING_PTHREADS=y # CONFIG_PKG_USING_COAP is not set # CONFIG_PKG_USING_NOPOLL is not set # CONFIG_PKG_USING_NETUTILS is not set +# CONFIG_PKG_USING_AT_DEVICE is not set + +# +# IoT Cloud +# +# CONFIG_PKG_USING_ONENET is not set +# CONFIG_PKG_USING_GAGENT_CLOUD is not set +# CONFIG_PKG_USING_ALI_IOTKIT is not set +# CONFIG_PKG_USING_AZURE is not set # # security packages @@ -203,6 +229,7 @@ CONFIG_RT_USING_PTHREADS=y # # language packages # +# CONFIG_PKG_USING_LUA is not set # CONFIG_PKG_USING_JERRYSCRIPT is not set # CONFIG_PKG_USING_MICROPYTHON is not set @@ -210,27 +237,86 @@ CONFIG_RT_USING_PTHREADS=y # multimedia packages # # CONFIG_PKG_USING_OPENMV is not set +# CONFIG_PKG_USING_MUPDF is not set # # tools packages # # CONFIG_PKG_USING_CMBACKTRACE is not set +# CONFIG_PKG_USING_EASYFLASH is not set # CONFIG_PKG_USING_EASYLOGGER is not set # CONFIG_PKG_USING_SYSTEMVIEW is not set -# CONFIG_PKG_USING_IPERF is not set + +# +# system packages +# +CONFIG_PKG_USING_GUIENGINE=y +CONFIG_PKG_GUIENGINE_PATH="/packages/system/gui_engine" +# CONFIG_PKG_USING_GUIENGINE_V200 is not set +CONFIG_PKG_USING_GUIENGINE_LATEST_VERSION=y +CONFIG_PKG_GUIENGINE_VER="latest" +CONFIG_GUIENGINE_NAME_MAX=16 +# CONFIG_GUIENGINE_USING_TTF is not set +# CONFIG_GUIENG_USING_FNT_FILE is not set +CONFIG_GUIENGINE_USING_FONT16=y +CONFIG_GUIENGINE_USING_FONT12=y +# CONFIG_GUIENGINE_USING_FONTHZ is not set +# CONFIG_GUIENGINE_IMAGE_XPM is not set +# CONFIG_GUIENGINE_USING_JPG is not set +# CONFIG_GUIENGINE_USING_PNG is not set +# CONFIG_GUIENGINE_IMAGE_BMP is not set +CONFIG_GUIENGINE_IMAGE_CONTAINER=y +CONFIG_GUIENGINE_USING_DEMO=y +# CONFIG_PKG_USING_CAIRO is not set +# CONFIG_PKG_USING_PIXMAN is not set +# CONFIG_PKG_USING_LWEXT4 is not set +# CONFIG_PKG_USING_PARTITION is not set +# CONFIG_PKG_USING_FAL is not set +# CONFIG_PKG_USING_SQLITE is not set +# CONFIG_PKG_USING_RTI is not set +# CONFIG_PKG_USING_LITTLEVGL2RTT is not set + +# +# peripheral libraries and drivers +# +# CONFIG_PKG_USING_STM32F4_HAL is not set +# CONFIG_PKG_USING_STM32F4_DRIVERS is not set +# CONFIG_PKG_USING_REALTEK_AMEBA is not set +# CONFIG_PKG_USING_SHT2X is not set +# CONFIG_PKG_USING_AHT10 is not set +# CONFIG_PKG_USING_AP3216C is not set +# CONFIG_PKG_USING_STM32_SDIO is not set +# CONFIG_PKG_USING_ICM20608 is not set # # miscellaneous packages # +# CONFIG_PKG_USING_LIBCSV is not set +# CONFIG_PKG_USING_OPTPARSE is not set # CONFIG_PKG_USING_FASTLZ is not set # CONFIG_PKG_USING_MINILZO is not set # CONFIG_PKG_USING_QUICKLZ is not set +# CONFIG_PKG_USING_MULTIBUTTON is not set +# CONFIG_PKG_USING_CANFESTIVAL is not set +# CONFIG_PKG_USING_ZLIB is not set +# CONFIG_PKG_USING_DSTR is not set + +# +# sample package +# + +# +# samples: kernel and components samples +# +# CONFIG_PKG_USING_KERNEL_SAMPLES is not set +# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set +# CONFIG_PKG_USING_NETWORK_SAMPLES is not set +# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set # # example package: hello # # CONFIG_PKG_USING_HELLO is not set -# CONFIG_PKG_USING_MULTIBUTTON is not set CONFIG_RT_USING_EXT_SDRAM=y CONFIG_RT_USING_UART1=y # CONFIG_RT_USING_UART2 is not set diff --git a/bsp/stm32f429-disco/drivers/SConscript b/bsp/stm32f429-disco/drivers/SConscript index 16cd3a1869..5c44efca3e 100644 --- a/bsp/stm32f429-disco/drivers/SConscript +++ b/bsp/stm32f429-disco/drivers/SConscript @@ -10,6 +10,7 @@ board.c stm32f4xx_it.c usart.c drv_sdram.c +drv_lcd.c """) CPPPATH = [cwd] diff --git a/bsp/stm32f429-disco/drivers/drv_lcd.c b/bsp/stm32f429-disco/drivers/drv_lcd.c index c4db46a831..3476a8198e 100644 --- a/bsp/stm32f429-disco/drivers/drv_lcd.c +++ b/bsp/stm32f429-disco/drivers/drv_lcd.c @@ -62,7 +62,6 @@ LTDC_HandleTypeDef LtdcHandler; static RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; /* Default LCD configuration with LCD Layer 1 */ static uint32_t ActiveLayer = 0; -//LCD_DrvTypeDef *LcdDrv; SPI_HandleTypeDef hspi5; static SPI_HandleTypeDef SpiHandle; diff --git a/bsp/stm32f429-disco/project.uvproj b/bsp/stm32f429-disco/project.uvproj index 26737e7aab..e59d7d643e 100644 --- a/bsp/stm32f429-disco/project.uvproj +++ b/bsp/stm32f429-disco/project.uvproj @@ -359,7 +359,7 @@ USE_HAL_DRIVER, STM32F429xx - drivers;applications;.;Libraries/STM32F4xx_HAL_Driver/Inc;Libraries/CMSIS/Device/ST/STM32F4xx/Include;Libraries/CMSIS/Include;../../include;../../libcpu/arm/cortex-m4;../../libcpu/arm/common;../../components/drivers/include;../../components/drivers/include;../../components/finsh + applications;.;drivers;Libraries\STM32F4xx_HAL_Driver\Inc;Libraries\CMSIS\Device\ST\STM32F4xx\Include;Libraries\CMSIS\Include;packages\gui_engine-latest\include;packages\gui_engine-latest\src;packages\gui_engine-latest\example;..\..\include;..\..\libcpu\arm\cortex-m4;..\..\libcpu\arm\common;..\..\components\dfs\include;..\..\components\dfs\filesystems\devfs;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh @@ -399,51 +399,65 @@ - - Drivers - - - board.c - 1 - drivers/board.c - - - - - stm32f4xx_it.c - 1 - drivers/stm32f4xx_it.c - - - - - usart.c - 1 - drivers/usart.c - - - - - drv_sdram.c - 1 - drivers/drv_sdram.c - - - Applications application.c 1 - applications/application.c + applications\application.c + + + + + rtgui_demo.c + 1 + applications\rtgui_demo.c startup.c 1 - applications/startup.c + applications\startup.c + + + + + Drivers + + + board.c + 1 + drivers\board.c + + + + + stm32f4xx_it.c + 1 + drivers\stm32f4xx_it.c + + + + + usart.c + 1 + drivers\usart.c + + + + + drv_sdram.c + 1 + drivers\drv_sdram.c + + + + + drv_lcd.c + 1 + drivers\drv_lcd.c @@ -453,483 +467,797 @@ system_stm32f4xx.c 1 - Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c + Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c stm32f4xx_hal.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c stm32f4xx_hal_adc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c stm32f4xx_hal_adc_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c stm32f4xx_hal_can.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c stm32f4xx_hal_cec.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cec.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cec.c stm32f4xx_hal_cortex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c stm32f4xx_hal_crc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_crc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.c stm32f4xx_hal_cryp.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cryp.c stm32f4xx_hal_cryp_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cryp_ex.c stm32f4xx_hal_dac.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dac.c stm32f4xx_hal_dac_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dac_ex.c stm32f4xx_hal_dcmi.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dcmi.c stm32f4xx_hal_dcmi_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dcmi_ex.c stm32f4xx_hal_dfsdm.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dfsdm.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dfsdm.c stm32f4xx_hal_dma.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c stm32f4xx_hal_dma2d.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma2d.c stm32f4xx_hal_dma_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c stm32f4xx_hal_dsi.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dsi.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dsi.c stm32f4xx_hal_eth.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_eth.c stm32f4xx_hal_flash.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c stm32f4xx_hal_flash_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c stm32f4xx_hal_flash_ramfunc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c stm32f4xx_hal_fmpi2c.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_fmpi2c.c stm32f4xx_hal_fmpi2c_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_fmpi2c_ex.c stm32f4xx_hal_gpio.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c stm32f4xx_hal_hash.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hash.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_hash.c stm32f4xx_hal_hash_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hash_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_hash_ex.c stm32f4xx_hal_hcd.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_hcd.c stm32f4xx_hal_i2c.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c stm32f4xx_hal_i2c_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c stm32f4xx_hal_i2s.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2s.c stm32f4xx_hal_i2s_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2s_ex.c stm32f4xx_hal_irda.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_irda.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_irda.c stm32f4xx_hal_iwdg.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_iwdg.c stm32f4xx_hal_lptim.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_lptim.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_lptim.c stm32f4xx_hal_ltdc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_ltdc.c stm32f4xx_hal_ltdc_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_ltdc_ex.c stm32f4xx_hal_nand.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nand.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_nand.c stm32f4xx_hal_nor.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nor.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_nor.c stm32f4xx_hal_pccard.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pccard.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pccard.c stm32f4xx_hal_pcd.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd.c stm32f4xx_hal_pcd_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd_ex.c stm32f4xx_hal_pwr.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c stm32f4xx_hal_pwr_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c stm32f4xx_hal_qspi.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_qspi.c stm32f4xx_hal_rcc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c stm32f4xx_hal_rcc_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c stm32f4xx_hal_rng.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c stm32f4xx_hal_rtc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc.c stm32f4xx_hal_rtc_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc_ex.c stm32f4xx_hal_sai.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_sai.c stm32f4xx_hal_sai_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_sai_ex.c stm32f4xx_hal_sd.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_sd.c stm32f4xx_hal_sdram.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sdram.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_sdram.c stm32f4xx_hal_smartcard.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_smartcard.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_smartcard.c stm32f4xx_hal_spdifrx.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spdifrx.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spdifrx.c stm32f4xx_hal_spi.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c stm32f4xx_hal_sram.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_sram.c stm32f4xx_hal_tim.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c stm32f4xx_hal_tim_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c stm32f4xx_hal_uart.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c stm32f4xx_hal_usart.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_usart.c stm32f4xx_hal_wwdg.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_wwdg.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_wwdg.c stm32f4xx_ll_fmc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_fmc.c stm32f4xx_ll_fsmc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_fsmc.c stm32f4xx_ll_sdmmc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_sdmmc.c stm32f4xx_ll_usb.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_usb.c startup_stm32f429xx.s 2 - Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f429xx.s + Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f429xx.s + + + + + GuiEngine + + + asc12font.c + 1 + packages\gui_engine-latest\src\asc12font.c + + + + + asc16font.c + 1 + packages\gui_engine-latest\src\asc16font.c + + + + + blit.c + 1 + packages\gui_engine-latest\src\blit.c + + + + + box.c + 1 + packages\gui_engine-latest\src\box.c + + + + + color.c + 1 + packages\gui_engine-latest\src\color.c + + + + + container.c + 1 + packages\gui_engine-latest\src\container.c + + + + + dc.c + 1 + packages\gui_engine-latest\src\dc.c + + + + + dc_blend.c + 1 + packages\gui_engine-latest\src\dc_blend.c + + + + + dc_buffer.c + 1 + packages\gui_engine-latest\src\dc_buffer.c + + + + + dc_client.c + 1 + packages\gui_engine-latest\src\dc_client.c + + + + + dc_hw.c + 1 + packages\gui_engine-latest\src\dc_hw.c + + + + + dc_rotozoom.c + 1 + packages\gui_engine-latest\src\dc_rotozoom.c + + + + + dc_trans.c + 1 + packages\gui_engine-latest\src\dc_trans.c + + + + + filerw.c + 1 + packages\gui_engine-latest\src\filerw.c + + + + + font.c + 1 + packages\gui_engine-latest\src\font.c + + + + + font_bmp.c + 1 + packages\gui_engine-latest\src\font_bmp.c + + + + + font_fnt.c + 1 + packages\gui_engine-latest\src\font_fnt.c + + + + + font_freetype.c + 1 + packages\gui_engine-latest\src\font_freetype.c + + + + + font_hz_bmp.c + 1 + packages\gui_engine-latest\src\font_hz_bmp.c + + + + + font_hz_file.c + 1 + packages\gui_engine-latest\src\font_hz_file.c + + + + + gb2312.c + 1 + packages\gui_engine-latest\src\gb2312.c + + + + + hz12font.c + 1 + packages\gui_engine-latest\src\hz12font.c + + + + + hz16font.c + 1 + packages\gui_engine-latest\src\hz16font.c + + + + + image.c + 1 + packages\gui_engine-latest\src\image.c + + + + + image_bmp.c + 1 + packages\gui_engine-latest\src\image_bmp.c + + + + + image_container.c + 1 + packages\gui_engine-latest\src\image_container.c + + + + + image_hdc.c + 1 + packages\gui_engine-latest\src\image_hdc.c + + + + + image_jpg.c + 1 + packages\gui_engine-latest\src\image_jpg.c + + + + + image_png.c + 1 + packages\gui_engine-latest\src\image_png.c + + + + + image_xpm.c + 1 + packages\gui_engine-latest\src\image_xpm.c + + + + + matrix.c + 1 + packages\gui_engine-latest\src\matrix.c + + + + + mouse.c + 1 + packages\gui_engine-latest\src\mouse.c + + + + + region.c + 1 + packages\gui_engine-latest\src\region.c + + + + + rtgui_app.c + 1 + packages\gui_engine-latest\src\rtgui_app.c + + + + + rtgui_driver.c + 1 + packages\gui_engine-latest\src\rtgui_driver.c + + + + + rtgui_object.c + 1 + packages\gui_engine-latest\src\rtgui_object.c + + + + + rtgui_system.c + 1 + packages\gui_engine-latest\src\rtgui_system.c + + + + + server.c + 1 + packages\gui_engine-latest\src\server.c + + + + + title.c + 1 + packages\gui_engine-latest\src\title.c + + + + + topwin.c + 1 + packages\gui_engine-latest\src\topwin.c + + + + + widget.c + 1 + packages\gui_engine-latest\src\widget.c + + + + + window.c + 1 + packages\gui_engine-latest\src\window.c + + + + + gui_demo + + + gui_demo.c + 1 + packages\gui_engine-latest\example\gui_demo.c + + + + + resources.c + 1 + packages\gui_engine-latest\example\resources.c @@ -939,105 +1267,105 @@ clock.c 1 - ../../src/clock.c + ..\..\src\clock.c components.c 1 - ../../src/components.c + ..\..\src\components.c device.c 1 - ../../src/device.c + ..\..\src\device.c idle.c 1 - ../../src/idle.c + ..\..\src\idle.c ipc.c 1 - ../../src/ipc.c + ..\..\src\ipc.c irq.c 1 - ../../src/irq.c + ..\..\src\irq.c kservice.c 1 - ../../src/kservice.c + ..\..\src\kservice.c mem.c 1 - ../../src/mem.c + ..\..\src\mem.c memheap.c 1 - ../../src/memheap.c + ..\..\src\memheap.c mempool.c 1 - ../../src/mempool.c + ..\..\src\mempool.c object.c 1 - ../../src/object.c + ..\..\src\object.c scheduler.c 1 - ../../src/scheduler.c + ..\..\src\scheduler.c signal.c 1 - ../../src/signal.c + ..\..\src\signal.c thread.c 1 - ../../src/thread.c + ..\..\src\thread.c timer.c 1 - ../../src/timer.c + ..\..\src\timer.c @@ -1047,87 +1375,132 @@ cpuport.c 1 - ../../libcpu/arm/cortex-m4/cpuport.c + ..\..\libcpu\arm\cortex-m4\cpuport.c context_rvds.S 2 - ../../libcpu/arm/cortex-m4/context_rvds.S + ..\..\libcpu\arm\cortex-m4\context_rvds.S backtrace.c 1 - ../../libcpu/arm/common/backtrace.c + ..\..\libcpu\arm\common\backtrace.c div0.c 1 - ../../libcpu/arm/common/div0.c + ..\..\libcpu\arm\common\div0.c showmem.c 1 - ../../libcpu/arm/common/showmem.c + ..\..\libcpu\arm\common\showmem.c + + + + + Filesystem + + + dfs.c + 1 + ..\..\components\dfs\src\dfs.c + + + + + dfs_file.c + 1 + ..\..\components\dfs\src\dfs_file.c + + + + + dfs_fs.c + 1 + ..\..\components\dfs\src\dfs_fs.c + + + + + dfs_posix.c + 1 + ..\..\components\dfs\src\dfs_posix.c + + + + + devfs.c + 1 + ..\..\components\dfs\filesystems\devfs\devfs.c DeviceDrivers + + + pin.c + 1 + ..\..\components\drivers\misc\pin.c + + serial.c 1 - ../../components/drivers/serial/serial.c + ..\..\components\drivers\serial\serial.c completion.c 1 - ../../components/drivers/src/completion.c + ..\..\components\drivers\src\completion.c dataqueue.c 1 - ../../components/drivers/src/dataqueue.c + ..\..\components\drivers\src\dataqueue.c pipe.c 1 - ../../components/drivers/src/pipe.c + ..\..\components\drivers\src\pipe.c ringbuffer.c 1 - ../../components/drivers/src/ringbuffer.c + ..\..\components\drivers\src\ringbuffer.c waitqueue.c 1 - ../../components/drivers/src/waitqueue.c + ..\..\components\drivers\src\waitqueue.c workqueue.c 1 - ../../components/drivers/src/workqueue.c + ..\..\components\drivers\src\workqueue.c @@ -1137,112 +1510,112 @@ shell.c 1 - ../../components/finsh/shell.c + ..\..\components\finsh\shell.c symbol.c 1 - ../../components/finsh/symbol.c + ..\..\components\finsh\symbol.c cmd.c 1 - ../../components/finsh/cmd.c + ..\..\components\finsh\cmd.c msh.c 1 - ../../components/finsh/msh.c + ..\..\components\finsh\msh.c msh_cmd.c 1 - ../../components/finsh/msh_cmd.c + ..\..\components\finsh\msh_cmd.c msh_file.c 1 - ../../components/finsh/msh_file.c + ..\..\components\finsh\msh_file.c finsh_compiler.c 1 - ../../components/finsh/finsh_compiler.c + ..\..\components\finsh\finsh_compiler.c finsh_error.c 1 - ../../components/finsh/finsh_error.c + ..\..\components\finsh\finsh_error.c finsh_heap.c 1 - ../../components/finsh/finsh_heap.c + ..\..\components\finsh\finsh_heap.c finsh_init.c 1 - ../../components/finsh/finsh_init.c + ..\..\components\finsh\finsh_init.c finsh_node.c 1 - ../../components/finsh/finsh_node.c + ..\..\components\finsh\finsh_node.c finsh_ops.c 1 - ../../components/finsh/finsh_ops.c + ..\..\components\finsh\finsh_ops.c finsh_parser.c 1 - ../../components/finsh/finsh_parser.c + ..\..\components\finsh\finsh_parser.c finsh_var.c 1 - ../../components/finsh/finsh_var.c + ..\..\components\finsh\finsh_var.c finsh_vm.c 1 - ../../components/finsh/finsh_vm.c + ..\..\components\finsh\finsh_vm.c finsh_token.c 1 - ../../components/finsh/finsh_token.c + ..\..\components\finsh\finsh_token.c diff --git a/bsp/stm32f429-disco/project.uvprojx b/bsp/stm32f429-disco/project.uvprojx index d6141cd54a..60f42141c1 100644 --- a/bsp/stm32f429-disco/project.uvprojx +++ b/bsp/stm32f429-disco/project.uvprojx @@ -332,7 +332,7 @@ USE_HAL_DRIVER, STM32F429xx - drivers;applications;.;Libraries/STM32F4xx_HAL_Driver/Inc;Libraries/CMSIS/Device/ST/STM32F4xx/Include;Libraries/CMSIS/Include;../../include;../../libcpu/arm/cortex-m4;../../libcpu/arm/common;../../components/drivers/include;../../components/drivers/include;../../components/finsh + applications;.;drivers;Libraries\STM32F4xx_HAL_Driver\Inc;Libraries\CMSIS\Device\ST\STM32F4xx\Include;Libraries\CMSIS\Include;packages\gui_engine-latest\include;packages\gui_engine-latest\src;packages\gui_engine-latest\example;..\..\include;..\..\libcpu\arm\cortex-m4;..\..\libcpu\arm\common;..\..\components\dfs\include;..\..\components\dfs\filesystems\devfs;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh @@ -373,51 +373,65 @@ - - Drivers - - - board.c - 1 - drivers/board.c - - - - - stm32f4xx_it.c - 1 - drivers/stm32f4xx_it.c - - - - - usart.c - 1 - drivers/usart.c - - - - - drv_sdram.c - 1 - drivers/drv_sdram.c - - - Applications application.c 1 - applications/application.c + applications\application.c + + + + + rtgui_demo.c + 1 + applications\rtgui_demo.c startup.c 1 - applications/startup.c + applications\startup.c + + + + + Drivers + + + board.c + 1 + drivers\board.c + + + + + stm32f4xx_it.c + 1 + drivers\stm32f4xx_it.c + + + + + usart.c + 1 + drivers\usart.c + + + + + drv_sdram.c + 1 + drivers\drv_sdram.c + + + + + drv_lcd.c + 1 + drivers\drv_lcd.c @@ -427,483 +441,797 @@ system_stm32f4xx.c 1 - Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c + Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c stm32f4xx_hal.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c stm32f4xx_hal_adc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c stm32f4xx_hal_adc_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c stm32f4xx_hal_can.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c stm32f4xx_hal_cec.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cec.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cec.c stm32f4xx_hal_cortex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c stm32f4xx_hal_crc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_crc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_crc.c stm32f4xx_hal_cryp.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cryp.c stm32f4xx_hal_cryp_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cryp_ex.c stm32f4xx_hal_dac.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dac.c stm32f4xx_hal_dac_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dac_ex.c stm32f4xx_hal_dcmi.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dcmi.c stm32f4xx_hal_dcmi_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dcmi_ex.c stm32f4xx_hal_dfsdm.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dfsdm.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dfsdm.c stm32f4xx_hal_dma.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c stm32f4xx_hal_dma2d.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma2d.c stm32f4xx_hal_dma_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c stm32f4xx_hal_dsi.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dsi.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dsi.c stm32f4xx_hal_eth.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_eth.c stm32f4xx_hal_flash.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c stm32f4xx_hal_flash_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c stm32f4xx_hal_flash_ramfunc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c stm32f4xx_hal_fmpi2c.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_fmpi2c.c stm32f4xx_hal_fmpi2c_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_fmpi2c_ex.c stm32f4xx_hal_gpio.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c stm32f4xx_hal_hash.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hash.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_hash.c stm32f4xx_hal_hash_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hash_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_hash_ex.c stm32f4xx_hal_hcd.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_hcd.c stm32f4xx_hal_i2c.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c stm32f4xx_hal_i2c_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c stm32f4xx_hal_i2s.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2s.c stm32f4xx_hal_i2s_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2s_ex.c stm32f4xx_hal_irda.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_irda.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_irda.c stm32f4xx_hal_iwdg.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_iwdg.c stm32f4xx_hal_lptim.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_lptim.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_lptim.c stm32f4xx_hal_ltdc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_ltdc.c stm32f4xx_hal_ltdc_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_ltdc_ex.c stm32f4xx_hal_nand.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nand.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_nand.c stm32f4xx_hal_nor.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nor.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_nor.c stm32f4xx_hal_pccard.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pccard.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pccard.c stm32f4xx_hal_pcd.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd.c stm32f4xx_hal_pcd_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd_ex.c stm32f4xx_hal_pwr.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c stm32f4xx_hal_pwr_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c stm32f4xx_hal_qspi.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_qspi.c stm32f4xx_hal_rcc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c stm32f4xx_hal_rcc_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c stm32f4xx_hal_rng.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rng.c stm32f4xx_hal_rtc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc.c stm32f4xx_hal_rtc_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rtc_ex.c stm32f4xx_hal_sai.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_sai.c stm32f4xx_hal_sai_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_sai_ex.c stm32f4xx_hal_sd.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_sd.c stm32f4xx_hal_sdram.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sdram.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_sdram.c stm32f4xx_hal_smartcard.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_smartcard.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_smartcard.c stm32f4xx_hal_spdifrx.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spdifrx.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spdifrx.c stm32f4xx_hal_spi.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c stm32f4xx_hal_sram.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_sram.c stm32f4xx_hal_tim.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c stm32f4xx_hal_tim_ex.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c stm32f4xx_hal_uart.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c stm32f4xx_hal_usart.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_usart.c stm32f4xx_hal_wwdg.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_wwdg.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_wwdg.c stm32f4xx_ll_fmc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_fmc.c stm32f4xx_ll_fsmc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_fsmc.c stm32f4xx_ll_sdmmc.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_sdmmc.c stm32f4xx_ll_usb.c 1 - Libraries/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c + Libraries\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_usb.c startup_stm32f429xx.s 2 - Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f429xx.s + Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f429xx.s + + + + + GuiEngine + + + asc12font.c + 1 + packages\gui_engine-latest\src\asc12font.c + + + + + asc16font.c + 1 + packages\gui_engine-latest\src\asc16font.c + + + + + blit.c + 1 + packages\gui_engine-latest\src\blit.c + + + + + box.c + 1 + packages\gui_engine-latest\src\box.c + + + + + color.c + 1 + packages\gui_engine-latest\src\color.c + + + + + container.c + 1 + packages\gui_engine-latest\src\container.c + + + + + dc.c + 1 + packages\gui_engine-latest\src\dc.c + + + + + dc_blend.c + 1 + packages\gui_engine-latest\src\dc_blend.c + + + + + dc_buffer.c + 1 + packages\gui_engine-latest\src\dc_buffer.c + + + + + dc_client.c + 1 + packages\gui_engine-latest\src\dc_client.c + + + + + dc_hw.c + 1 + packages\gui_engine-latest\src\dc_hw.c + + + + + dc_rotozoom.c + 1 + packages\gui_engine-latest\src\dc_rotozoom.c + + + + + dc_trans.c + 1 + packages\gui_engine-latest\src\dc_trans.c + + + + + filerw.c + 1 + packages\gui_engine-latest\src\filerw.c + + + + + font.c + 1 + packages\gui_engine-latest\src\font.c + + + + + font_bmp.c + 1 + packages\gui_engine-latest\src\font_bmp.c + + + + + font_fnt.c + 1 + packages\gui_engine-latest\src\font_fnt.c + + + + + font_freetype.c + 1 + packages\gui_engine-latest\src\font_freetype.c + + + + + font_hz_bmp.c + 1 + packages\gui_engine-latest\src\font_hz_bmp.c + + + + + font_hz_file.c + 1 + packages\gui_engine-latest\src\font_hz_file.c + + + + + gb2312.c + 1 + packages\gui_engine-latest\src\gb2312.c + + + + + hz12font.c + 1 + packages\gui_engine-latest\src\hz12font.c + + + + + hz16font.c + 1 + packages\gui_engine-latest\src\hz16font.c + + + + + image.c + 1 + packages\gui_engine-latest\src\image.c + + + + + image_bmp.c + 1 + packages\gui_engine-latest\src\image_bmp.c + + + + + image_container.c + 1 + packages\gui_engine-latest\src\image_container.c + + + + + image_hdc.c + 1 + packages\gui_engine-latest\src\image_hdc.c + + + + + image_jpg.c + 1 + packages\gui_engine-latest\src\image_jpg.c + + + + + image_png.c + 1 + packages\gui_engine-latest\src\image_png.c + + + + + image_xpm.c + 1 + packages\gui_engine-latest\src\image_xpm.c + + + + + matrix.c + 1 + packages\gui_engine-latest\src\matrix.c + + + + + mouse.c + 1 + packages\gui_engine-latest\src\mouse.c + + + + + region.c + 1 + packages\gui_engine-latest\src\region.c + + + + + rtgui_app.c + 1 + packages\gui_engine-latest\src\rtgui_app.c + + + + + rtgui_driver.c + 1 + packages\gui_engine-latest\src\rtgui_driver.c + + + + + rtgui_object.c + 1 + packages\gui_engine-latest\src\rtgui_object.c + + + + + rtgui_system.c + 1 + packages\gui_engine-latest\src\rtgui_system.c + + + + + server.c + 1 + packages\gui_engine-latest\src\server.c + + + + + title.c + 1 + packages\gui_engine-latest\src\title.c + + + + + topwin.c + 1 + packages\gui_engine-latest\src\topwin.c + + + + + widget.c + 1 + packages\gui_engine-latest\src\widget.c + + + + + window.c + 1 + packages\gui_engine-latest\src\window.c + + + + + gui_demo + + + gui_demo.c + 1 + packages\gui_engine-latest\example\gui_demo.c + + + + + resources.c + 1 + packages\gui_engine-latest\example\resources.c @@ -913,105 +1241,105 @@ clock.c 1 - ../../src/clock.c + ..\..\src\clock.c components.c 1 - ../../src/components.c + ..\..\src\components.c device.c 1 - ../../src/device.c + ..\..\src\device.c idle.c 1 - ../../src/idle.c + ..\..\src\idle.c ipc.c 1 - ../../src/ipc.c + ..\..\src\ipc.c irq.c 1 - ../../src/irq.c + ..\..\src\irq.c kservice.c 1 - ../../src/kservice.c + ..\..\src\kservice.c mem.c 1 - ../../src/mem.c + ..\..\src\mem.c memheap.c 1 - ../../src/memheap.c + ..\..\src\memheap.c mempool.c 1 - ../../src/mempool.c + ..\..\src\mempool.c object.c 1 - ../../src/object.c + ..\..\src\object.c scheduler.c 1 - ../../src/scheduler.c + ..\..\src\scheduler.c signal.c 1 - ../../src/signal.c + ..\..\src\signal.c thread.c 1 - ../../src/thread.c + ..\..\src\thread.c timer.c 1 - ../../src/timer.c + ..\..\src\timer.c @@ -1021,87 +1349,132 @@ cpuport.c 1 - ../../libcpu/arm/cortex-m4/cpuport.c + ..\..\libcpu\arm\cortex-m4\cpuport.c context_rvds.S 2 - ../../libcpu/arm/cortex-m4/context_rvds.S + ..\..\libcpu\arm\cortex-m4\context_rvds.S backtrace.c 1 - ../../libcpu/arm/common/backtrace.c + ..\..\libcpu\arm\common\backtrace.c div0.c 1 - ../../libcpu/arm/common/div0.c + ..\..\libcpu\arm\common\div0.c showmem.c 1 - ../../libcpu/arm/common/showmem.c + ..\..\libcpu\arm\common\showmem.c + + + + + Filesystem + + + dfs.c + 1 + ..\..\components\dfs\src\dfs.c + + + + + dfs_file.c + 1 + ..\..\components\dfs\src\dfs_file.c + + + + + dfs_fs.c + 1 + ..\..\components\dfs\src\dfs_fs.c + + + + + dfs_posix.c + 1 + ..\..\components\dfs\src\dfs_posix.c + + + + + devfs.c + 1 + ..\..\components\dfs\filesystems\devfs\devfs.c DeviceDrivers + + + pin.c + 1 + ..\..\components\drivers\misc\pin.c + + serial.c 1 - ../../components/drivers/serial/serial.c + ..\..\components\drivers\serial\serial.c completion.c 1 - ../../components/drivers/src/completion.c + ..\..\components\drivers\src\completion.c dataqueue.c 1 - ../../components/drivers/src/dataqueue.c + ..\..\components\drivers\src\dataqueue.c pipe.c 1 - ../../components/drivers/src/pipe.c + ..\..\components\drivers\src\pipe.c ringbuffer.c 1 - ../../components/drivers/src/ringbuffer.c + ..\..\components\drivers\src\ringbuffer.c waitqueue.c 1 - ../../components/drivers/src/waitqueue.c + ..\..\components\drivers\src\waitqueue.c workqueue.c 1 - ../../components/drivers/src/workqueue.c + ..\..\components\drivers\src\workqueue.c @@ -1111,112 +1484,112 @@ shell.c 1 - ../../components/finsh/shell.c + ..\..\components\finsh\shell.c symbol.c 1 - ../../components/finsh/symbol.c + ..\..\components\finsh\symbol.c cmd.c 1 - ../../components/finsh/cmd.c + ..\..\components\finsh\cmd.c msh.c 1 - ../../components/finsh/msh.c + ..\..\components\finsh\msh.c msh_cmd.c 1 - ../../components/finsh/msh_cmd.c + ..\..\components\finsh\msh_cmd.c msh_file.c 1 - ../../components/finsh/msh_file.c + ..\..\components\finsh\msh_file.c finsh_compiler.c 1 - ../../components/finsh/finsh_compiler.c + ..\..\components\finsh\finsh_compiler.c finsh_error.c 1 - ../../components/finsh/finsh_error.c + ..\..\components\finsh\finsh_error.c finsh_heap.c 1 - ../../components/finsh/finsh_heap.c + ..\..\components\finsh\finsh_heap.c finsh_init.c 1 - ../../components/finsh/finsh_init.c + ..\..\components\finsh\finsh_init.c finsh_node.c 1 - ../../components/finsh/finsh_node.c + ..\..\components\finsh\finsh_node.c finsh_ops.c 1 - ../../components/finsh/finsh_ops.c + ..\..\components\finsh\finsh_ops.c finsh_parser.c 1 - ../../components/finsh/finsh_parser.c + ..\..\components\finsh\finsh_parser.c finsh_var.c 1 - ../../components/finsh/finsh_var.c + ..\..\components\finsh\finsh_var.c finsh_vm.c 1 - ../../components/finsh/finsh_vm.c + ..\..\components\finsh\finsh_vm.c finsh_token.c 1 - ../../components/finsh/finsh_token.c + ..\..\components\finsh\finsh_token.c diff --git a/bsp/stm32f429-disco/readme.md b/bsp/stm32f429-disco/readme.md index 3971dafdfa..62e5582866 100644 --- a/bsp/stm32f429-disco/readme.md +++ b/bsp/stm32f429-disco/readme.md @@ -1,12 +1,79 @@ -board info: -STM32F429I-DISC1 -http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/32f429idiscovery.html +# STM32F429-DISCO -note: -in drivers/stm32f4xx_conf.h - /* Redefine the HSE value; it's equal to 8 MHz on the STM32F429I-DISC1 Kit */ - #define HSE_VALUE ((uint32_t)8000000) +## 1. 绠浠 + +STM32F429I-DISCOVERY 寮鍙戞澘浣跨敤楂樻ц兘 MCU STM32F429锛屽彲浠ョ敤浜庡疄鐜伴珮绾у浘褰㈢敤鎴风晫闈€ +鏈 BSP 鍏煎 STM32F429I-DISCO 鍜 STM32F429I-DISC1 涓や釜鐗堟湰鐨 DISCOVERY 寮鍙戞澘銆 + +鏍稿績鏉挎澘杞戒富瑕佽祫婧愬涓嬶細 + +| 纭欢 | 鎻忚堪 | +| -- | -- | +|鑺墖鍨嬪彿| STM32F429ZIT6 | +|CPU| ARM Cortex-M4F | +|涓婚| 180MHz | +|鐗囧唴 SRAM| 256KB | +|鐗囧 SDRAM| 64-Mbit SDRAM | +|鐗囧唴 Flash| 2MB | +|鏄剧ず璁惧| 2.4" QVGA TFT LCD| +|鈥庤繍鍔ㄤ紶鎰熷櫒鈥巪 L3GD20 | +|LED| 6 涓 | +|鎸夐敭| 2 涓 | + +## 2. 缂栬瘧璇存槑 + +STM32F429-DISCO 鏉跨骇鍖呮敮鎸 MDK4锕慚DK5锕慖AR 寮鍙戠幆澧冨拰 GCC 缂栬瘧鍣紝浠ヤ笅鏄叿浣撶増鏈俊鎭細 + +| IDE/缂栬瘧鍣 | 宸叉祴璇曠増鏈 | +| ---------- | ---------------------------- | +| MDK4 | MDK4.74 | +| MDK5 | MDK V5.25.2.0 | +| IAR | 鏈祴璇 | +| GCC | GCC 5.4.1 20160919 (release) | + +## 3. 鐑у啓鍙婃墽琛 + +渚涚數鏂瑰紡锛氫娇鐢 Mini USB 绾胯繛鎺ョ數鑴戝拰鏉垮瓙鐨 USB ST-LINK 鍙c + +涓插彛杩炴帴锛歋TM32F429I-DISC1 鐗堟湰鐨勫紑鍙戞澘鐨勬澘杞借皟璇曞櫒涓 ST-LINK/V2-B锛屾敮鎸 VCP 铏氭嫙涓插彛锛屾墍浠ュ彲浠ョ洿鎺ヤ娇鐢ㄨ櫄鎷熶覆鍙h緭鍑洪粯璁ゆ帶鍒跺彴璁惧 USART1銆 + +鑰佺増鏈殑 STM32F429I-DISCO 寮鍙戞澘闇瑕佷粠鏉垮瓙涓婄殑寮曡剼澶栨帴涓插彛锛屽苟鏇存敼鎺у埗鍙拌澶囧埌鐩稿簲 USART銆 + +鍦≒C涓婁娇鐢ㄧ粓绔蒋浠朵互115200-N-8-1鐨勯厤缃柟寮忚繛鎺ュ埌瀵瑰簲鐨凜OM璁惧涓娿 + +STM32F429-DISCO/DISC1 浣跨敤鏉胯浇缂栫▼鍣ㄤ笅杞界▼搴忋 + +### 3.1 杩愯缁撴灉 + +濡傛灉缂栬瘧 & 鐑у啓鏃犺锛屽綋澶嶄綅璁惧鍚庯紝浼氬湪涓插彛涓婄湅鍒 RT-Thread 鐨勫惎鍔 logo 淇℃伅锛 + +```bash + \ | / +- RT - Thread Operating System + / | \ 3.1.0 build Aug 31 2018 + 2006 - 2018 Copyright by rt-thread team +finsh /> + +``` + +## 4. 椹卞姩鏀寔鎯呭喌鍙婅鍒 + +| 椹卞姩 | 鏀寔鎯呭喌 | 澶囨敞 | +| ------ | ---- | :------: | +| USART | 鏀寔 | USART1/2/3 | +| SPI | 鏀寔 | | +| LCD | 鏀寔 | 鏀寔 FrameBuffer 妯″紡 LCD 鏄剧ず | +| SDRAM | 鏀寔 | | +| GPIO | 鏈敮鎸 | | +| IIC | 鏈敮鎸 | | +| L3GD20 | 鏈敮鎸 | | +| USB OTG | 鏈敮鎸 | | - **TODO** - auto add *.icf by scons script +## 5. 鑱旂郴浜轰俊鎭 + +缁存姢浜猴細[xuzhuoyi](https://github.com/xuzhuoyi) + +## 6. 鍙傝 + +* [鏉垮瓙鐩稿叧璧勬枡](https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/32f429idiscovery.html) diff --git a/bsp/stm32f429-disco/rtconfig.h b/bsp/stm32f429-disco/rtconfig.h index f06e44d2c0..0b1c0850e3 100644 --- a/bsp/stm32f429-disco/rtconfig.h +++ b/bsp/stm32f429-disco/rtconfig.h @@ -8,18 +8,14 @@ #define RT_NAME_MAX 8 #define RT_ALIGN_SIZE 4 -/* RT_THREAD_PRIORITY_8 is not set */ #define RT_THREAD_PRIORITY_32 -/* RT_THREAD_PRIORITY_256 is not set */ #define RT_THREAD_PRIORITY_MAX 32 #define RT_TICK_PER_SECOND 100 -#define RT_DEBUG #define RT_USING_OVERFLOW_CHECK -#define RT_DEBUG_INIT 1 -#define RT_DEBUG_THREAD 0 #define RT_USING_HOOK +#define RT_IDEL_HOOK_LIST_SIZE 4 #define IDLE_THREAD_STACK_SIZE 1024 -/* RT_USING_TIMER_SOFT is not set */ +#define RT_DEBUG /* Inter-Thread communication */ @@ -28,36 +24,27 @@ #define RT_USING_EVENT #define RT_USING_MAILBOX #define RT_USING_MESSAGEQUEUE -/* RT_USING_SIGNALS is not set */ /* Memory Management */ #define RT_USING_MEMPOOL #define RT_USING_MEMHEAP -/* RT_USING_NOHEAP is not set */ #define RT_USING_SMALL_MEM -/* RT_USING_SLAB is not set */ -/* RT_USING_MEMHEAP_AS_HEAP is not set */ -/* RT_USING_MEMTRACE is not set */ #define RT_USING_HEAP /* Kernel Device Object */ #define RT_USING_DEVICE -/* RT_USING_INTERRUPT_INFO is not set */ #define RT_USING_CONSOLE #define RT_CONSOLEBUF_SIZE 128 #define RT_CONSOLE_DEVICE_NAME "uart1" -/* RT_USING_MODULE is not set */ /* RT-Thread Components */ #define RT_USING_COMPONENTS_INIT -/* RT_USING_USER_MAIN is not set */ /* C++ features */ -/* RT_USING_CPLUSPLUS is not set */ /* Command shell */ @@ -70,139 +57,104 @@ #define FINSH_THREAD_PRIORITY 20 #define FINSH_THREAD_STACK_SIZE 4096 #define FINSH_CMD_SIZE 80 -/* FINSH_USING_AUTH is not set */ #define FINSH_USING_MSH #define FINSH_USING_MSH_DEFAULT -/* FINSH_USING_MSH_ONLY is not set */ +#define FINSH_ARG_MAX 10 /* Device virtual file system */ -/* RT_USING_DFS is not set */ -/* 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_USING_DFS +#define DFS_USING_WORKDIR +#define DFS_FILESYSTEMS_MAX 2 +#define DFS_FILESYSTEM_TYPES_MAX 2 +#define DFS_FD_MAX 16 +#define RT_USING_DFS_DEVFS /* Device Drivers */ #define RT_USING_DEVICE_IPC +#define RT_PIPE_BUFSZ 512 #define RT_USING_SERIAL -/* RT_USING_CAN is not set */ -/* RT_USING_HWTIMER is not set */ -/* RT_USING_CPUTIME is not set */ -/* RT_USING_I2C is not set */ #define RT_USING_PIN -/* RT_USING_MTD_NOR is not set */ -/* RT_USING_MTD_NAND is not set */ -/* RT_USING_RTC is not set */ -/* RT_USING_SDIO is not set */ -/* RT_USING_SPI is not set */ -/* RT_USING_WDT is not set */ -/* RT_USING_WIFI is not set */ /* Using USB */ -/* RT_USING_USB_HOST is not set */ -/* RT_USING_USB_DEVICE is not set */ /* POSIX layer and C standard library */ -#define RT_USING_LIBC -#define RT_USING_PTHREADS -/* HAVE_SYS_SIGNALS is not set */ -/* Network stack */ +/* Network */ + +/* Socket abstraction layer */ + /* light weight TCP/IP stack */ -/* RT_USING_LWIP is not set */ /* Modbus master and slave stack */ -/* RT_USING_MODBUS is not set */ + +/* AT commands */ + /* VBUS(Virtual Software BUS) */ -/* RT_USING_VBUS is not set */ /* Utilities */ -/* RT_USING_LOGTRACE is not set */ -/* RT_USING_RYM is not set */ /* RT-Thread online packages */ -/* system packages */ - -/* RT-Thread GUI Engine */ - -/* PKG_USING_GUIENGINE is not set */ -/* PKG_USING_LWEXT4 is not set */ -/* PKG_USING_PARTITION is not set */ -/* PKG_USING_SQLITE is not set */ -/* PKG_USING_RTI is not set */ - /* IoT - internet of things */ -/* PKG_USING_PAHOMQTT is not set */ -/* PKG_USING_WEBCLIENT is not set */ -/* PKG_USING_MONGOOSE is not set */ -/* PKG_USING_WEBTERMINAL is not set */ -/* PKG_USING_CJSON is not set */ -/* PKG_USING_LJSON is not set */ -/* PKG_USING_EZXML is not set */ -/* PKG_USING_NANOPB is not set */ -/* PKG_USING_GAGENT_CLOUD is not set */ /* Wi-Fi */ /* Marvell WiFi */ -/* PKG_USING_WLANMARVELL is not set */ /* Wiced WiFi */ -/* PKG_USING_WLAN_WICED is not set */ -/* PKG_USING_COAP is not set */ -/* PKG_USING_NOPOLL is not set */ -/* PKG_USING_NETUTILS is not set */ + +/* IoT Cloud */ + /* security packages */ -/* PKG_USING_MBEDTLS is not set */ -/* PKG_USING_libsodium is not set */ -/* PKG_USING_TINYCRYPT is not set */ /* language packages */ -/* PKG_USING_JERRYSCRIPT is not set */ -/* PKG_USING_MICROPYTHON is not set */ /* 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 */ + +/* system packages */ + +#define PKG_USING_GUIENGINE +#define PKG_USING_GUIENGINE_LATEST_VERSION +#define GUIENGINE_NAME_MAX 16 +#define GUIENGINE_USING_FONT16 +#define GUIENGINE_USING_FONT12 +#define GUIENGINE_IMAGE_CONTAINER +#define GUIENGINE_USING_DEMO + +/* peripheral libraries and drivers */ + /* miscellaneous packages */ -/* PKG_USING_FASTLZ is not set */ -/* PKG_USING_MINILZO is not set */ -/* PKG_USING_QUICKLZ is not set */ + +/* sample package */ + +/* samples: kernel and components samples */ + /* example package: hello */ -/* PKG_USING_HELLO is not set */ -/* PKG_USING_MULTIBUTTON is not set */ #define RT_USING_EXT_SDRAM #define RT_USING_UART1 -/* RT_USING_UART2 is not set */ -/* RT_USING_UART3 is not set */ -/* RT_USING_SPI5 is not set */ #endif From 65fff5b4b2de58bf12c67fcacfd76c0edad08187 Mon Sep 17 00:00:00 2001 From: xuzhuoyi Date: Sat, 15 Sep 2018 16:22:54 +0800 Subject: [PATCH 6/6] [bsp][stm32f429-disco] Fix The Travis CI building failure --- bsp/stm32f429-disco/.config | 18 +- bsp/stm32f429-disco/drivers/board.c | 10 +- bsp/stm32f429-disco/project.uvproj | 316 +--------------------------- bsp/stm32f429-disco/project.uvprojx | 316 +--------------------------- bsp/stm32f429-disco/rtconfig.h | 7 - 5 files changed, 10 insertions(+), 657 deletions(-) diff --git a/bsp/stm32f429-disco/.config b/bsp/stm32f429-disco/.config index 4123e8acf8..cfb4a30f16 100644 --- a/bsp/stm32f429-disco/.config +++ b/bsp/stm32f429-disco/.config @@ -250,23 +250,9 @@ CONFIG_RT_USING_PIN=y # # system packages # -CONFIG_PKG_USING_GUIENGINE=y -CONFIG_PKG_GUIENGINE_PATH="/packages/system/gui_engine" +# CONFIG_PKG_USING_GUIENGINE is not set # CONFIG_PKG_USING_GUIENGINE_V200 is not set -CONFIG_PKG_USING_GUIENGINE_LATEST_VERSION=y -CONFIG_PKG_GUIENGINE_VER="latest" -CONFIG_GUIENGINE_NAME_MAX=16 -# CONFIG_GUIENGINE_USING_TTF is not set -# CONFIG_GUIENG_USING_FNT_FILE is not set -CONFIG_GUIENGINE_USING_FONT16=y -CONFIG_GUIENGINE_USING_FONT12=y -# CONFIG_GUIENGINE_USING_FONTHZ is not set -# CONFIG_GUIENGINE_IMAGE_XPM is not set -# CONFIG_GUIENGINE_USING_JPG is not set -# CONFIG_GUIENGINE_USING_PNG is not set -# CONFIG_GUIENGINE_IMAGE_BMP is not set -CONFIG_GUIENGINE_IMAGE_CONTAINER=y -CONFIG_GUIENGINE_USING_DEMO=y +# CONFIG_PKG_USING_GUIENGINE_LATEST_VERSION is not set # CONFIG_PKG_USING_CAIRO is not set # CONFIG_PKG_USING_PIXMAN is not set # CONFIG_PKG_USING_LWEXT4 is not set diff --git a/bsp/stm32f429-disco/drivers/board.c b/bsp/stm32f429-disco/drivers/board.c index 2fe4fb7c73..2592f7964b 100644 --- a/bsp/stm32f429-disco/drivers/board.c +++ b/bsp/stm32f429-disco/drivers/board.c @@ -138,8 +138,10 @@ void HAL_Delay(__IO uint32_t Delay) */ void rt_hw_board_init() { - rt_device_t lcd; - +#ifdef PKG_USING_GUIENGINE + rt_device_t lcd; +#endif + HAL_Init(); SystemClock_Config(); @@ -154,8 +156,8 @@ void rt_hw_board_init() rt_console_set_device(CONSOLE_DEVICE); #endif -#ifdef RT_USING_CONSOLE - lcd = rt_device_find("lcd"); +#ifdef PKG_USING_GUIENGINE + lcd = rt_device_find("lcd"); rtgui_graphic_set_device(lcd); #endif diff --git a/bsp/stm32f429-disco/project.uvproj b/bsp/stm32f429-disco/project.uvproj index e59d7d643e..00d5d63c7c 100644 --- a/bsp/stm32f429-disco/project.uvproj +++ b/bsp/stm32f429-disco/project.uvproj @@ -359,7 +359,7 @@ USE_HAL_DRIVER, STM32F429xx - applications;.;drivers;Libraries\STM32F4xx_HAL_Driver\Inc;Libraries\CMSIS\Device\ST\STM32F4xx\Include;Libraries\CMSIS\Include;packages\gui_engine-latest\include;packages\gui_engine-latest\src;packages\gui_engine-latest\example;..\..\include;..\..\libcpu\arm\cortex-m4;..\..\libcpu\arm\common;..\..\components\dfs\include;..\..\components\dfs\filesystems\devfs;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh + applications;.;drivers;Libraries\STM32F4xx_HAL_Driver\Inc;Libraries\CMSIS\Device\ST\STM32F4xx\Include;Libraries\CMSIS\Include;..\..\include;..\..\libcpu\arm\cortex-m4;..\..\libcpu\arm\common;..\..\components\dfs\include;..\..\components\dfs\filesystems\devfs;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh @@ -947,320 +947,6 @@ - - GuiEngine - - - asc12font.c - 1 - packages\gui_engine-latest\src\asc12font.c - - - - - asc16font.c - 1 - packages\gui_engine-latest\src\asc16font.c - - - - - blit.c - 1 - packages\gui_engine-latest\src\blit.c - - - - - box.c - 1 - packages\gui_engine-latest\src\box.c - - - - - color.c - 1 - packages\gui_engine-latest\src\color.c - - - - - container.c - 1 - packages\gui_engine-latest\src\container.c - - - - - dc.c - 1 - packages\gui_engine-latest\src\dc.c - - - - - dc_blend.c - 1 - packages\gui_engine-latest\src\dc_blend.c - - - - - dc_buffer.c - 1 - packages\gui_engine-latest\src\dc_buffer.c - - - - - dc_client.c - 1 - packages\gui_engine-latest\src\dc_client.c - - - - - dc_hw.c - 1 - packages\gui_engine-latest\src\dc_hw.c - - - - - dc_rotozoom.c - 1 - packages\gui_engine-latest\src\dc_rotozoom.c - - - - - dc_trans.c - 1 - packages\gui_engine-latest\src\dc_trans.c - - - - - filerw.c - 1 - packages\gui_engine-latest\src\filerw.c - - - - - font.c - 1 - packages\gui_engine-latest\src\font.c - - - - - font_bmp.c - 1 - packages\gui_engine-latest\src\font_bmp.c - - - - - font_fnt.c - 1 - packages\gui_engine-latest\src\font_fnt.c - - - - - font_freetype.c - 1 - packages\gui_engine-latest\src\font_freetype.c - - - - - font_hz_bmp.c - 1 - packages\gui_engine-latest\src\font_hz_bmp.c - - - - - font_hz_file.c - 1 - packages\gui_engine-latest\src\font_hz_file.c - - - - - gb2312.c - 1 - packages\gui_engine-latest\src\gb2312.c - - - - - hz12font.c - 1 - packages\gui_engine-latest\src\hz12font.c - - - - - hz16font.c - 1 - packages\gui_engine-latest\src\hz16font.c - - - - - image.c - 1 - packages\gui_engine-latest\src\image.c - - - - - image_bmp.c - 1 - packages\gui_engine-latest\src\image_bmp.c - - - - - image_container.c - 1 - packages\gui_engine-latest\src\image_container.c - - - - - image_hdc.c - 1 - packages\gui_engine-latest\src\image_hdc.c - - - - - image_jpg.c - 1 - packages\gui_engine-latest\src\image_jpg.c - - - - - image_png.c - 1 - packages\gui_engine-latest\src\image_png.c - - - - - image_xpm.c - 1 - packages\gui_engine-latest\src\image_xpm.c - - - - - matrix.c - 1 - packages\gui_engine-latest\src\matrix.c - - - - - mouse.c - 1 - packages\gui_engine-latest\src\mouse.c - - - - - region.c - 1 - packages\gui_engine-latest\src\region.c - - - - - rtgui_app.c - 1 - packages\gui_engine-latest\src\rtgui_app.c - - - - - rtgui_driver.c - 1 - packages\gui_engine-latest\src\rtgui_driver.c - - - - - rtgui_object.c - 1 - packages\gui_engine-latest\src\rtgui_object.c - - - - - rtgui_system.c - 1 - packages\gui_engine-latest\src\rtgui_system.c - - - - - server.c - 1 - packages\gui_engine-latest\src\server.c - - - - - title.c - 1 - packages\gui_engine-latest\src\title.c - - - - - topwin.c - 1 - packages\gui_engine-latest\src\topwin.c - - - - - widget.c - 1 - packages\gui_engine-latest\src\widget.c - - - - - window.c - 1 - packages\gui_engine-latest\src\window.c - - - - - gui_demo - - - gui_demo.c - 1 - packages\gui_engine-latest\example\gui_demo.c - - - - - resources.c - 1 - packages\gui_engine-latest\example\resources.c - - - Kernel diff --git a/bsp/stm32f429-disco/project.uvprojx b/bsp/stm32f429-disco/project.uvprojx index 60f42141c1..f9915cd532 100644 --- a/bsp/stm32f429-disco/project.uvprojx +++ b/bsp/stm32f429-disco/project.uvprojx @@ -332,7 +332,7 @@ USE_HAL_DRIVER, STM32F429xx - applications;.;drivers;Libraries\STM32F4xx_HAL_Driver\Inc;Libraries\CMSIS\Device\ST\STM32F4xx\Include;Libraries\CMSIS\Include;packages\gui_engine-latest\include;packages\gui_engine-latest\src;packages\gui_engine-latest\example;..\..\include;..\..\libcpu\arm\cortex-m4;..\..\libcpu\arm\common;..\..\components\dfs\include;..\..\components\dfs\filesystems\devfs;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh + applications;.;drivers;Libraries\STM32F4xx_HAL_Driver\Inc;Libraries\CMSIS\Device\ST\STM32F4xx\Include;Libraries\CMSIS\Include;..\..\include;..\..\libcpu\arm\cortex-m4;..\..\libcpu\arm\common;..\..\components\dfs\include;..\..\components\dfs\filesystems\devfs;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh @@ -921,320 +921,6 @@ - - GuiEngine - - - asc12font.c - 1 - packages\gui_engine-latest\src\asc12font.c - - - - - asc16font.c - 1 - packages\gui_engine-latest\src\asc16font.c - - - - - blit.c - 1 - packages\gui_engine-latest\src\blit.c - - - - - box.c - 1 - packages\gui_engine-latest\src\box.c - - - - - color.c - 1 - packages\gui_engine-latest\src\color.c - - - - - container.c - 1 - packages\gui_engine-latest\src\container.c - - - - - dc.c - 1 - packages\gui_engine-latest\src\dc.c - - - - - dc_blend.c - 1 - packages\gui_engine-latest\src\dc_blend.c - - - - - dc_buffer.c - 1 - packages\gui_engine-latest\src\dc_buffer.c - - - - - dc_client.c - 1 - packages\gui_engine-latest\src\dc_client.c - - - - - dc_hw.c - 1 - packages\gui_engine-latest\src\dc_hw.c - - - - - dc_rotozoom.c - 1 - packages\gui_engine-latest\src\dc_rotozoom.c - - - - - dc_trans.c - 1 - packages\gui_engine-latest\src\dc_trans.c - - - - - filerw.c - 1 - packages\gui_engine-latest\src\filerw.c - - - - - font.c - 1 - packages\gui_engine-latest\src\font.c - - - - - font_bmp.c - 1 - packages\gui_engine-latest\src\font_bmp.c - - - - - font_fnt.c - 1 - packages\gui_engine-latest\src\font_fnt.c - - - - - font_freetype.c - 1 - packages\gui_engine-latest\src\font_freetype.c - - - - - font_hz_bmp.c - 1 - packages\gui_engine-latest\src\font_hz_bmp.c - - - - - font_hz_file.c - 1 - packages\gui_engine-latest\src\font_hz_file.c - - - - - gb2312.c - 1 - packages\gui_engine-latest\src\gb2312.c - - - - - hz12font.c - 1 - packages\gui_engine-latest\src\hz12font.c - - - - - hz16font.c - 1 - packages\gui_engine-latest\src\hz16font.c - - - - - image.c - 1 - packages\gui_engine-latest\src\image.c - - - - - image_bmp.c - 1 - packages\gui_engine-latest\src\image_bmp.c - - - - - image_container.c - 1 - packages\gui_engine-latest\src\image_container.c - - - - - image_hdc.c - 1 - packages\gui_engine-latest\src\image_hdc.c - - - - - image_jpg.c - 1 - packages\gui_engine-latest\src\image_jpg.c - - - - - image_png.c - 1 - packages\gui_engine-latest\src\image_png.c - - - - - image_xpm.c - 1 - packages\gui_engine-latest\src\image_xpm.c - - - - - matrix.c - 1 - packages\gui_engine-latest\src\matrix.c - - - - - mouse.c - 1 - packages\gui_engine-latest\src\mouse.c - - - - - region.c - 1 - packages\gui_engine-latest\src\region.c - - - - - rtgui_app.c - 1 - packages\gui_engine-latest\src\rtgui_app.c - - - - - rtgui_driver.c - 1 - packages\gui_engine-latest\src\rtgui_driver.c - - - - - rtgui_object.c - 1 - packages\gui_engine-latest\src\rtgui_object.c - - - - - rtgui_system.c - 1 - packages\gui_engine-latest\src\rtgui_system.c - - - - - server.c - 1 - packages\gui_engine-latest\src\server.c - - - - - title.c - 1 - packages\gui_engine-latest\src\title.c - - - - - topwin.c - 1 - packages\gui_engine-latest\src\topwin.c - - - - - widget.c - 1 - packages\gui_engine-latest\src\widget.c - - - - - window.c - 1 - packages\gui_engine-latest\src\window.c - - - - - gui_demo - - - gui_demo.c - 1 - packages\gui_engine-latest\example\gui_demo.c - - - - - resources.c - 1 - packages\gui_engine-latest\example\resources.c - - - Kernel diff --git a/bsp/stm32f429-disco/rtconfig.h b/bsp/stm32f429-disco/rtconfig.h index 0b1c0850e3..933d1b1b33 100644 --- a/bsp/stm32f429-disco/rtconfig.h +++ b/bsp/stm32f429-disco/rtconfig.h @@ -133,13 +133,6 @@ /* system packages */ -#define PKG_USING_GUIENGINE -#define PKG_USING_GUIENGINE_LATEST_VERSION -#define GUIENGINE_NAME_MAX 16 -#define GUIENGINE_USING_FONT16 -#define GUIENGINE_USING_FONT12 -#define GUIENGINE_IMAGE_CONTAINER -#define GUIENGINE_USING_DEMO /* peripheral libraries and drivers */