|
完整的STM32代碼下載:
LCD 12864.7z
(186.66 KB, 下載次數(shù): 69)
2022-10-17 20:55 上傳
點(diǎn)擊文件名下載附件
lcd12864驅(qū)動(dòng)程序的主程序:
- /******************** (C) COPYRIGHT 2012 WildFire Team **************************
- * 文件名 :main.c
- * 描述 :用3.5.0版本建的工程模板。
- * 實(shí)驗(yàn)平臺(tái):野火STM32開發(fā)板
- * 庫版本 :ST3.5.0
- *
- * 作者 :wildfire team
- **********************************************************************************/
- #include "stm32f10x.h"
- /*
- * 函數(shù)名:main
- * 描述 : 主函數(shù)
- * 輸入 :無
- * 輸出 : 無
- */
- int main(void)
- {
- SysInit_Configuration(); //系統(tǒng)初始化函數(shù)
- printf("\r\n this is a LCD 12864 demo \r\n");
- // delay_ms(1000);
- // SendCMD(0x88);//1000,0001 設(shè)定DDRAM 7位地址000,0001到地址計(jì)數(shù)器AC
- // SendDat(0x33);
- // SendDat(0x42);
- // SendDat(0x43);
- // SendDat(0x44);
- //// SendCMD(0x00);
- // delay_ms(1000);
- // while(1) ;
-
- while(1)
- {
- display(0x80,"STM32");display(0x83,"12864");display(0x86,"3.3V");
-
- display(0x90,"陜西");display(0x93,"西安");
-
- display(0x88,"2014");display(0x8A,"0424");
-
- display(0x98,"測試");display(0x9A,"程序");
- delay_ms(1000);
- while(1) ;
- // SendCMD(0x00);
- }
- }
- void SysInit_Configuration(void)
- {
- RCC_Configuration(); //利用外部高速時(shí)鐘HSE對(duì)系統(tǒng)相關(guān)時(shí)鐘進(jìn)行配置,
- GPIO_Configuration(); //IO口進(jìn)行基本配置
- // TIM1_Configuration(); //定時(shí)器1配置
- // TIM2_Configuration(); //定時(shí)器2配置
- // ADC_Configuration(); //模數(shù)轉(zhuǎn)換器配置
- USART1_Configuration(); //串口1配置
- // USART2_Configuration(); //串口2配置
- SysTick_Configuration(); //系統(tǒng)節(jié)拍定時(shí)器配置
- initlcm(); //12864初始化
- // TIM_Cmd(TIM2, ENABLE); //定時(shí)器2啟動(dòng)
- }
- int fputc(int ch, FILE *f)
- {
- /* 將Printf內(nèi)容發(fā)往串口 */
- USART_ClearFlag(USART1,USART_FLAG_TC);
- USART_SendData(USART1, (unsigned char) ch);
- while(USART_GetFlagStatus(USART1,USART_FLAG_TC)!= SET);
- return ch;
- }
- /******************* (C) COPYRIGHT 2012 WildFire Team *****END OF FILE************/
復(fù)制代碼
|
|