小学生
最后登录1970-1-1
在线时间 小时
注册时间2023-12-25
|
#include "stm32f10x.h"
#include "./lcd/bsp_ili9341_lcd.h"
#include "./usart/bsp_usart.h"
#include <stdio.h>
static void LCD_Test(void);
static void Delay ( __IO uint32_t nCount );
void Printf_Charater(void) ;
/**
* @brief Ö÷º¯Êý
* @param ÎÞ
* @retval ÎÞ
*/
int main ( void )
{
ILI9341_Init (); //LCD ³õʼ»¯
USART_Config();
printf("\r\n ********** Òº¾§ÆÁÓ¢ÎÄÏÔʾ³ÌÐò*********** \r\n");
printf("\r\n ±¾³ÌÐò²»Ö§³ÖÖÐÎÄ£¬ÏÔʾÖÐÎĵijÌÐòÇëѧϰÏÂÒ»Õ \r\n");
//ÆäÖÐ0¡¢3¡¢5¡¢6 ģʽÊʺϴÓ×óÖÁÓÒÏÔʾÎÄ×Ö£¬
//²»ÍƼöʹÓÃÆäËüģʽÏÔʾÎÄ×Ö ÆäËüģʽÏÔʾÎÄ×Ö»áÓоµÏñЧ¹û
//ÆäÖÐ 6 ģʽΪ´ó²¿·ÖÒº¾§Àý³ÌµÄĬÈÏÏÔʾ·½Ïò
ILI9341_GramScan ( 6 );
while ( 1 )
{
LCD_Test();
}
}
extern uint16_t lcdid;
/*ÓÃÓÚ²âÊÔ¸÷ÖÖÒº¾§µÄº¯Êý*/
void LCD_Test(void)
{
/*ÑÝʾÏÔʾ±äÁ¿*/
static uint8_t testCNT = 0;
char dispBuff[100];
testCNT++;
LCD_SetFont(&Font8x16);
LCD_SetColors(RED,BLACK);
ILI9341_Clear(0,0,LCD_X_LENGTH,LCD_Y_LENGTH); /* ÇåÆÁ£¬ÏÔʾȫºÚ */
/********ÏÔʾ×Ö·û´®Ê¾Àý*******/
if(lcdid == LCDID_ILI9341)
{
ILI9341_DispStringLine_EN(LINE(0),"BH 2.8 inch LCD para:");
ILI9341_DispStringLine_EN(LINE(1),"Image resolution:240x320 px");
ILI9341_DispStringLine_EN(LINE(2),"ILI9341 LCD driver");
ILI9341_DispStringLine_EN(LINE(3),"XPT2046 Touch Pad driver");
}
else if(lcdid == LCDID_ST7789V)
{
ILI9341_DispStringLine_EN(LINE(0),"BH 3.2 inch LCD para:");
ILI9341_DispStringLine_EN(LINE(1),"Image resolution:240x320 px");
ILI9341_DispStringLine_EN(LINE(2),"ST7789V LCD driver");
ILI9341_DispStringLine_EN(LINE(3),"XPT2046 Touch Pad driver");
}
/********ÏÔʾ±äÁ¿Ê¾Àý*******/
LCD_SetFont(&Font16x24);
LCD_SetTextColor(GREEN);
/*ʹÓÃc±ê×¼¿â°Ñ±äÁ¿×ª»¯³É×Ö·û´®*/
sprintf(dispBuff,"Count : %d ",testCNT);
LCD_ClearLine(LINE(4)); /* Çå³ýµ¥ÐÐÎÄ×Ö */
/*È»ºóÏÔʾ¸Ã×Ö·û´®¼´¿É£¬ÆäËü±äÁ¿Ò²ÊÇÕâÑù´¦Àí*/
ILI9341_DispStringLine_EN(LINE(4),dispBuff);
/*******ÏÔʾͼÐÎʾÀý***** |
|