欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: STM32F407 HAL庫驅動FSMC的TFT屏(HAL庫版) [打印本頁]

作者: 天藍色的Toto    時間: 2021-3-7 15:20
標題: STM32F407 HAL庫驅動FSMC的TFT屏(HAL庫版)
研究了一下fsmc,終于成功解決了TFT屏的顯示(記得把KEIL的O3優化調成O0,否則會有BUG)

單片機源程序如下:
  1. /* Includes ------------------------------------------------------------------*/
  2. #include "main.h"
  3. #include "gpio.h"
  4. #include "fsmc.h"

  5. /* Private includes ----------------------------------------------------------*/
  6. /* USER CODE BEGIN Includes */
  7. #include "lcd.h"
  8. /* USER CODE END Includes */

  9. /* Private typedef -----------------------------------------------------------*/
  10. /* USER CODE BEGIN PTD */

  11. /* USER CODE END PTD */

  12. /* Private define ------------------------------------------------------------*/
  13. /* USER CODE BEGIN PD */
  14. /* USER CODE END PD */

  15. /* Private macro -------------------------------------------------------------*/
  16. /* USER CODE BEGIN PM */

  17. /* USER CODE END PM */

  18. /* Private variables ---------------------------------------------------------*/

  19. /* USER CODE BEGIN PV */

  20. /* USER CODE END PV */

  21. /* Private function prototypes -----------------------------------------------*/
  22. void SystemClock_Config(void);
  23. /* USER CODE BEGIN PFP */

  24. /* USER CODE END PFP */

  25. /* Private user code ---------------------------------------------------------*/
  26. /* USER CODE BEGIN 0 */

  27. /* USER CODE END 0 */

  28. /**
  29.   * @brief  The application entry point.
  30.   * @retval int
  31.   */
  32. int main(void)
  33. {
  34.   /* USER CODE BEGIN 1 */

  35.   /* USER CODE END 1 */

  36.   /* MCU Configuration--------------------------------------------------------*/

  37.   /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  38.   HAL_Init();

  39.   /* USER CODE BEGIN Init */

  40.   /* USER CODE END Init */

  41.   /* Configure the system clock */
  42.   SystemClock_Config();

  43.   /* USER CODE BEGIN SysInit */

  44.   /* USER CODE END SysInit */

  45.   /* Initialize all configured peripherals */
  46.   MX_GPIO_Init();
  47.   MX_FSMC_Init();
  48.   /* USER CODE BEGIN 2 */
  49.         HAL_Delay(500);
  50.         LCD_Init();           //初始化LCD FSMC接口
  51.         LCD_DisplayOn();               
  52.         POINT_COLOR=DARKBLUE;      //畫筆顏色:紅色
  53.   /* USER CODE END 2 */

  54.   /* Infinite loop */
  55.   /* USER CODE BEGIN WHILE */
  56.   while (1)
  57.   {
  58.     /* USER CODE END WHILE */

  59.     /* USER CODE BEGIN 3 */
  60.                 LCD_Clear(RED);
  61.                 HAL_Delay(200);
  62.                                 LCD_Clear(BLUE);
  63.                                 HAL_Delay(200);
  64.                                 LCD_Clear(WHITE);
  65.                                 HAL_Delay(200);
  66.                                 LCD_Clear(GREEN);
  67.                                 HAL_Delay(200);
  68.                                 LCD_Clear(BLACK);
  69.                                 HAL_Delay(200);
  70.                 LCD_Clear(YELLOW);
  71.                                 HAL_Delay(200);

  72.   }
  73.   /* USER CODE END 3 */
  74. }

  75. /**
  76.   * @brief System Clock Configuration
  77.   * @retval None
  78.   */
  79. void SystemClock_Config(void)
  80. {
  81.   RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  82.   RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

  83.   /** Configure the main internal regulator output voltage
  84.   */
  85.   __HAL_RCC_PWR_CLK_ENABLE();
  86.   __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
  87.   /** Initializes the RCC Oscillators according to the specified parameters
  88.   * in the RCC_OscInitTypeDef structure.
  89.   */
  90.   RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  91.   RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  92.   RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  93.   RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  94.   RCC_OscInitStruct.PLL.PLLM = 4;
  95.   RCC_OscInitStruct.PLL.PLLN = 168;
  96.   RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  97.   RCC_OscInitStruct.PLL.PLLQ = 4;
  98.   if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  99.   {
  100.     Error_Handler();
  101.   }
  102.   /** Initializes the CPU, AHB and APB buses clocks
  103.   */
  104.   RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
  105.                               |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  106.   RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  107.   RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  108.   RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
  109.   RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;

  110.   if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK)
  111.   {
  112.     Error_Handler();
  113.   }
  114.   /** Enables the Clock Security System
  115.   */
  116.   HAL_RCC_EnableCSS();
  117. }

  118. /* USER CODE BEGIN 4 */

  119. /* USER CODE END 4 */

  120. /**
  121.   * @brief  This function is executed in case of error occurrence.
  122.   * @retval None
  123.   */
  124. void Error_Handler(void)
  125. {
  126.   /* USER CODE BEGIN Error_Handler_Debug */
  127.   /* User can add his own implementation to report the HAL error return state */
  128.   __disable_irq();
  129.   while (1)
  130.   {
  131.   }
  132.   /* USER CODE END Error_Handler_Debug */
  133. }

  134. #ifdef  USE_FULL_ASSERT
  135. /**
  136.   * @brief  Reports the name of the source file and the source line number
  137.   *         where the assert_param error has occurred.
  138.   * @param  file: pointer to the source file name
  139.   * @param  line: assert_param error line source number
  140.   * @retval None
  141.   */
  142. void assert_failed(uint8_t *file, uint32_t line)
  143. {
  144.   /* USER CODE BEGIN 6 */
  145.   /* User can add his own implementation to report the file name and line number,
  146.      ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  147.   /* USER CODE END 6 */
  148. }
  149. #endif /* USE_FULL_ASSERT */
復制代碼

所有資料51hei提供下載:
FSMC_F4(SHENJIAJIA).7z (6.76 MB, 下載次數: 87)


作者: 天藍色的Toto    時間: 2021-3-7 15:21
MCU:STM32F407VET6
作者: 天藍色的Toto    時間: 2021-3-7 15:21
MCU:STM32F407VET6
板子和TFT: MCUDEV配套的
作者: 隨風落    時間: 2021-10-1 16:59
目前正在學習FSMC驅動TFTLCD屏
作者: libaihui    時間: 2022-2-25 09:53
屏幕是什么型號的
作者: fumoumou    時間: 2022-3-18 00:42
你好,請問驅動8位的LCD和16位的有什么區別嗎
作者: fumoumou    時間: 2022-3-18 00:42
樓主有8位lcd的驅動歷程嗎
作者: daiqinbin    時間: 2022-8-10 18:51
下下來移植到GD32上面,看看行不行
作者: Ivan_007    時間: 2023-1-8 19:25
剛好在了解這方面的。謝謝!
作者: CanlanPc    時間: 2023-11-21 08:23
剛好在了解這方面的,我的也是VET6,很了解這個用法
作者: CanlanPc    時間: 2023-11-24 08:59
好想要這個數據來試試內容




歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1