|
基于STM32單片機的ESP8266使用教程與資料
CH340驅動(USB串口驅動)_XP_WIN7共用
TCP&UDP測試工具(UDP Client時用)
串口調試助手
手機端網絡調試助手
網絡調試助手
單片機源程序如下:
- #include "sys.h"
- #include "delay.h"
- #include "usart.h"
- #include "led.h"
- #include "lcd.h"
- #include "key.h"
- #include "usmart.h"
- #include "malloc.h"
- #include "mmc_sd.h"
- #include "flash.h"
- #include "ff.h"
- #include "exfuns.h"
- #include "text.h"
- #include "usart2.h"
- #include "touch.h"
- #include "common.h"
- //ATK-ESP8266 WIFI模塊測試實驗
- int main(void)
- {
- u8 key,fontok=0;
- Stm32_Clock_Init(9); //系統時鐘設置
- delay_init(72); //延時初始化
- uart_init(72,115200); //串口1初始化
- USART2_Init(36,115200); //串口3初始化
- LCD_Init(); //初始化液晶
- LED_Init(); //LED初始化
- KEY_Init(); //按鍵初始化
- usmart_dev.init(72); //usmart初始化
- TP_Init(); //初始化觸摸屏
- mem_init(); //初始化內存管理
- exfuns_init(); //為fatfs相關變量申請內存
- f_mount(fs[0],"0:",1); //掛載SD卡
- f_mount(fs[1],"1:",1); //掛載FLASH.
- key=KEY_Scan(0);
- if(key==KEY0_PRES) //強制校準
- {
- LCD_Clear(WHITE); //清屏
- TP_Adjust(); //屏幕校準
- TP_Save_Adjdata();
- LCD_Clear(WHITE); //清屏
- }
- fontok=font_init(); //檢查字庫是否OK
- if(fontok||key==KEY1_PRES)//需要更新字庫
- {
- LCD_Clear(WHITE); //清屏
- POINT_COLOR=RED; //設置字體為紅色
- LCD_ShowString(60,50,200,16,16,"ALIENTEK STM32");
- while(SD_Initialize()) //檢測SD卡
- {
- LCD_ShowString(60,70,200,16,16,"SD Card Failed!");
- delay_ms(200);
- LCD_Fill(60,70,200+60,70+16,WHITE);
- delay_ms(200);
- }
- LCD_ShowString(60,70,200,16,16,"SD Card OK");
- LCD_ShowString(60,90,200,16,16,"Font Updating...");
- key=update_font(20,110,16);//更新字庫
- while(key)//更新失敗
- {
- LCD_ShowString(60,110,200,16,16,"Font Update Failed!");
- delay_ms(200);
- LCD_Fill(20,110,200+20,110+16,WHITE);
- delay_ms(200);
- }
- LCD_ShowString(60,110,200,16,16,"Font Update Success!");
- delay_ms(1500);
- LCD_Clear(WHITE); //清屏
- }
- atk_8266_test(); //進入ATK_ESP8266測試
- }
復制代碼
所有資料51hei提供下載:
|
|