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

標題: STM32F103RCT6實例工程模板(帶1.8寸SPI驅動TFT屏) [打印本頁]

作者: YunQy    時間: 2023-5-20 20:38
標題: STM32F103RCT6實例工程模板(帶1.8寸SPI驅動TFT屏)


使用STM32F103RCT6開發板實現定時器閃爍LED以及1.8寸SPI驅動的TFT屏幕,顯示菜單,按鍵KEY1切換畫面。
各位如有需要可根據原理圖進行設計,或改變引腳配置進行移植

單片機源程序如下:
  1. //C Header File
  2. #include <stdio.h>
  3. //Peripheral Header File
  4. #include "delay.h"
  5. #include "timer.h"
  6. #include "usart.h"
  7. //Hardware Header File
  8. #include "led.h"
  9. #include "beep.h"
  10. #include "key.h"
  11. #include "lcd.h"
  12. #include "picture.h"
  13. //Software Header File


  14. uint16_t LED1 = 0;

  15. int main(void)
  16. {
  17.         delay_Init();
  18.         LCD_Init();
  19.         LCD_Fill(0, 0, LCD_W, LCD_H, WHITE);
  20.         Usart1_Inital(9600);
  21.         LED_Inital();
  22.         BEEP_Inital();
  23.         KEY_Inital();
  24.         TIM2_Config(7199, 9999);
  25.         TIM3_Config(7199, 4999);
  26.         
  27.         while (1)
  28.         {
  29.                 switch (KEY_Scan(1)) {
  30.                         case (1): Usart_SendString(USART1, "KEY1\r\n");
  31.                                                                 LED1 = !LED1;
  32.                                                                 LCD_Fill(0, 0, LCD_W, LCD_H, WHITE);
  33.                                                                 break;
  34.                 }
  35.                 if (!LED1) {
  36.                         LED1_OFF;
  37.                         LCD_ShowPicture(12, 40, 40, 40, gImage_QQ);
  38.                         LCD_ShowString(28, 80, "QQ", BLACK, WHITE, 12, 0);
  39.                         LCD_ShowPicture(76, 40, 40, 40, gImage_We);
  40.                         LCD_ShowString(78, 80, "We", BLACK, WHITE, 12, 0);
  41.                         LCD_ShowPicture(12, 100, 40, 40, gImage_Game);
  42.                         LCD_ShowString(18, 140, "Games", BLACK, WHITE, 12, 0);
  43.                         LCD_ShowPicture(76, 100, 40, 40, gImage_Setting);
  44.                         LCD_ShowString(76, 140, "Setting", BLACK, WHITE, 12, 0);
  45.                 } else {
  46.                         LED1_ON;
  47.                         LCD_ShowPicture(24, 40, 80, 80, gImage_YunQy);
  48.                 }
  49.         }
  50. }
復制代碼
Keil代碼下載: STM32F103RCT6.7z (206.47 KB, 下載次數: 60)





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