• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ LCD_Init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LCD_Init函数的典型用法代码示例。如果您正苦于以下问题:C++ LCD_Init函数的具体用法?C++ LCD_Init怎么用?C++ LCD_Init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LCD_Init函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main(void) {
    
    char buffer[8];

    cli();
    LCD_Init();
    DDRB = DDRB | ( 1 << PB5);
    PORTB = PORTB & ( ~ ( 1 << PB5 ) );
    sei();

    uint8_t loop8;
    uint16_t byteIndex;
    uint16_t numBytes = 3431;//HARDCODED
    sprintf(buffer, "difference encoding");
    LCD_puts(buffer,1);
    for(byteIndex = 0 ; byteIndex < numBytes ; byteIndex ++){
	uint8_t currByte = pgm_read_byte(&(mywavdata[byteIndex]));
	for(loop8 = 1 ; loop8 > 0 ; loop8*=2){
                if (loop8 & currByte) 
			PORTB = PORTB | (1 << PB5);
		else
			PORTB = PORTB & ~(1 << PB5);
        	_delay_us(120);
	}
    }
    
    return 0;   /* never reached */
}
开发者ID:Studentblanchard,项目名称:RT,代码行数:28,代码来源:main_diff.c


示例2: borad_HarwareInit

//硬件初始化
void borad_HarwareInit(void)
{
		//OS_ERR err;
		//CPU_SR_ALLOC();
		
		delay_init(168);  //时钟初始化
		NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//中断分组配置
		uart_init(115200);   //串口初始化
		
		INTX_DISABLE();		//关中断,防止滴答定时器对外设初始化的打扰
		
		LED_Init();         //LED初始化	
		LCD_Init();			//LCD初始化	
		
		POINT_COLOR = RED;
		LCD_ShowString(30,10,200,16,16,"HardWare: STM32F4");	
		LCD_ShowString(30,30,200,16,16,"SotfWareSystem:UCOSIII,FATFS");
		LCD_ShowString(30,50,200,16,16,"STM32_NC");
		LCD_ShowString(30,70,200,16,16,"HuBei University of Technology");
		LCD_ShowString(30,90,200,16,16,"2016/1/16");
		
		//SD卡初始化
		SDCard_Init();
		
		INTX_ENABLE();		//开中断
}
开发者ID:dragonflyor,项目名称:STM32F4-TestProjs,代码行数:27,代码来源:board.c


示例3: main

void main(){

	OUTPUT_LOW(LCD_RW); //Che do ghi 
	LCD_Init();        //Khoi tao LCD

	LCD_PutCmd(0x01);  //Xoa man hinh

	ENABLE_INTERRUPTS(INT_TIMER0); //Kich hoat ngat ngoai
	SETUP_TIMER_0(RTCC_INTERNAL|RTCC_DIV_32); //Xung kich noi va chia truoc 32
	ENABLE_INTERRUPTS(GLOBAL); //Cho phep ngat toan cuc
	SET_TIMER0(100); //Bat dau dem tu 100, khi tran Timer0 duoc 1ms

	while (True){ //Duy tri hoat dong cua vi dieu khien

		if (dem > N_max){
			dem = 0;
			LCD_PutCmd(0x01);
		}

		LCD_SetPosition(0x00); //Cot 1 dong 1
		LCD_PutChar("Dem so:");
		LCD_SetPosition(0x07); //Cot 8 dong 1
		printf(LCD_PutChar,"%lu",dem);

	}
}
开发者ID:thinhut,项目名称:vdk-pic16f887,代码行数:26,代码来源:BAI-5-2.C


示例4: main

void main(void)
{
	uint8_t error_flag;

	LED3=0;
	UART_Init();
	LCD_Init();
	SPI_master_init(400000); // Set clock rate to that speed in Hz
	error_flag = SDcard_init();
	

	while(1)
	{
		LED1 = 0;
		LED4 = 0;
		if(error_flag != NO_ERRORS)
		{
			LED4 = 0;
		}
		else
		{
			LED4 = 1;
		}
		delay_ms(1000);
		LED1 = 1;
		LED4 = 1;
		LCD_Write(COMMAND, LINE1);
		LCD_Print(16, "Coltons and Matt");
		LCD_Write(COMMAND, LINE2);
		LCD_Print(15, "hews LCD Works!");
		delay_ms(3000);
		LCD_Clear();
	}

}
开发者ID:MatthewWedewer,项目名称:5160,代码行数:35,代码来源:main.c


示例5: LCD_Config

/**
  * @brief  LCD configuration.
  * @param  None
  * @retval None
  */
static void LCD_Config(void)
{
  /* LCD DSI initialization in mode Video Burst  */
  LCD_Init();
  
  /* Activate foreground and background layers */
  BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER_BACKGROUND, LCD_BG_LAYER_ADDRESS); 
  BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER_FOREGROUND, LCD_FG_LAYER_ADDRESS);  
  
  /* Set LCD Background Layer  */
  BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER_BACKGROUND); 
  /* Clear the Background Layer */
  BSP_LCD_Clear(LCD_COLOR_WHITE);
  
  /* Set LCD Foreground Layer  */
  BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER_FOREGROUND);
  /* Clear the Foreground Layer */ 
  BSP_LCD_Clear(LCD_COLOR_BLACK); 

  /* Configure and enable the Color Keying feature */
  BSP_LCD_SetColorKeying(1, 0); 

  /* Configure the transparency for foreground: Increase the transparency */
  BSP_LCD_SetTransparency(LTDC_ACTIVE_LAYER_FOREGROUND, 100);
  
}
开发者ID:Lembed,项目名称:STM32CubeF4-mirrors,代码行数:31,代码来源:main.c


示例6: main

int main(void) {

    MCU_Clk_Init();
    Input_Init();
    Output_Init();
    LCD_Init();
    // Cau hinh timer xay ra ngat sau 1s
    Timer0A_Config(40000000);

    Write_Str("Hello World!", 0, 0);

    while (1) {
        if (CuaDong) {
            // Bat den
            door_is_close = true;
            GPIOPinWrite(GPIO_PORTB_BASE, LIGHT_PIN, LIGHT_PIN);
        } else {
            door_is_close = false;
            if (is_active) {
                // Neu dang nuong ma mo cua thi tat ngay lap tuc thiet bi nuong, tat timer va bat loa canh bao
                GPIOPinWrite(GPIO_PORTB_BASE, GRILL_PIN, GRILL_PIN);
                GPIOPinWrite(GPIO_PORTB_BASE, MICRO_PIN, MICRO_PIN);
                TimerDisable(TIMER0_BASE, TIMER_A);
                GPIOPinWrite(GPIO_PORTB_BASE, SPEAKER_PIN, 0);
            } else {
                // Neu da nuong xong va cua mo thi tat loa
                GPIOPinWrite(GPIO_PORTB_BASE, SPEAKER_PIN, 0);
            }

        }
    }
}
开发者ID:datho1801,项目名称:TivaC_TUT,代码行数:32,代码来源:main_alt.c


示例7: setup

/**
 * Hardware setup peripherals
 */
static void 
setup(void)
{
	wdt_enable(WDTO_1S);

	use_buzzer = 1;

	DDRC |= (1 << RED_PIN) | (1 << YELLOW_PIN) | (1 << GREEN_PIN) | (1 << SPEAKER_PIN);
	PORTC |= 0x0E;

	TCCR1B |= (1 << WGM12);
    TIMSK |= (1 << OCIE1A);
    OCR1A = 65400; // 256 prescaler --> 1 Hz

	TCCR0 |= (1 << WGM01);
	OCR0 = 255; // 1024 prescaler --> 250 Hz
	TIMSK |= (1 << OCIE0);

	LCD_Init(16);
	LCD_Clear();
	LCD_GotoXY(0, 0);

	USB_InitAndConnect();

	// TIMER1: 256 prescaler
	TCCR1B |= (1 << CS12); 

	// TIMER0: 1024 prescaler
	TCCR0 |=  (1 << CS02) | (1 << CS00); 

	RFID_Init();
}
开发者ID:jafp,项目名称:travelcard_firmware,代码行数:35,代码来源:main.c


示例8: main

int main()
{

	unsigned int i, j = 0;

   volatile unsigned int *pLcdDestReg = (volatile unsigned int*)(LCD_DEST_REG_ADDR);
   volatile unsigned int *pLcdWidthReg = (volatile unsigned int*)(LCD_WIDTH_REG_ADDR);
   volatile unsigned int *pLcdHeightReg = (volatile unsigned int*)(LCD_HEIGHT_REG_ADDR);
   volatile unsigned int *pLcdCmdReg = (volatile unsigned int*)(LCD_CMD_REG_ADDR);

   volatile unsigned int *pCam = (volatile unsigned int*)(OV7670_0_BASE | 0x80000000);
   volatile unsigned char pid[2] = {0,0};

  *pLcdCmdReg = 0; // make sure that the DMA is stopped before calling the LCD init functions
  *pCam = 0;
  LCD_Init();
  LCD_Clear(0X00ff);
  //init_lcd_frame();



   printf("%x\n", lcd_frame);

   *pCam = 1; // turns the camera ON. Camera turns on with the next new frame
   Delay_Ms(2000); // add delay to be sure that frames are already in the memory

   *pLcdDestReg = LT24_CONTROLLER_0_BASE + 4;
   *pLcdWidthReg = 240; // LCD width
   *pLcdHeightReg = 320; // LCD height
   *pLcdCmdReg = 0x1f00000; // by default camera throws images starting from here
   *pLcdCmdReg |= 0x80000000; // this commands turns the LCD ON



}
开发者ID:schmitma,项目名称:AutonomesFahren,代码行数:35,代码来源:main.c


示例9: LCD_Config

static void LCD_Config(void)
{
  /* LCD Initialization */ 
  LCD_Init();

  /* LCD Layers Initialization */ 
  LCD_LayerInit();
  
  /* Enable the LCD */ 
  LCD_DisplayOn();

  /* Set LCD Background Layer  */
  LCD_SetLayer(LCD_BACKGROUND_LAYER);
  /* Clear the Background Layer */
  LCD_Clear(LCD_COLOR_WHITE);

  /* Set LCD Foreground Layer  */
  LCD_SetLayer(LCD_FOREGROUND_LAYER);
  /* Clear the Foreground Layer */ 
  LCD_Clear(LCD_COLOR_WHITE); 

  /* Configure and enable the Color Keying feature */
  LCD_SetColorKeying(0); 

  /* Configure the transparency for foreground : Increase the transprency */
  LCD_SetTransparency(100);

}
开发者ID:XDeca,项目名称:LED_POV,代码行数:28,代码来源:main.c


示例10: main

void main()
{	
int i,j;
int a[5] = {34,43,12,56,78}	;
int temp = 0;
LCD_PORT = 0x00;
LCD_Init();
lcd_cmd(0x80);  
delay(2);

for(i=0;i<5;i++)
	{
		for(j=i;j<5;j++) 
			{
			 if(a[i]>a[j])
			 	{
					temp = a[i];
					a[i] = a[j];
					a[j] = temp;
				}	 
  			}
		}
for(i=0;i<5;i++)
{
	converttochar(a[i]);

} 
 while(1); 
}
开发者ID:Jeet1994,项目名称:Embedded-C-8051-Lab-Codes,代码行数:29,代码来源:ascending_14.c


示例11: prvLCDTask

void prvLCDTask( void * pvParameters )
{
QueueHandle_t *pxLCDQueue;
xLCDMessage xReceivedMessage;
char *pcString;

	/* To test the parameter passing mechanism, the queue on which messages are
	received is passed in as a parameter even though it is available as a file
	scope variable anyway. */
	pxLCDQueue = ( QueueHandle_t * ) pvParameters;

	LCD_Init();

	for( ;; )
	{
		/* Wait for a message to arrive. */
		if( xQueueReceive( *pxLCDQueue, &xReceivedMessage, portMAX_DELAY ) )
		{
			/* Where is the string we are going to display? */
			pcString = *xReceivedMessage.ppcMessageToDisplay;
  			LCD_DisplayString(xReceivedMessage.xRow, pcString, BlackText);

			/* The delay here is just to ensure the LCD task does not starve
			out lower priority tasks as writing to the LCD can take a long
			time. */
			vTaskDelay( mainLCD_DELAY );
		}
	}
}
开发者ID:vmandrews,项目名称:CSDC-OBC-Software,代码行数:29,代码来源:main.c


示例12: main

int main(void)
{
	int i = 0, j = 0, m = 0;

	*LED = 0b00000001;

	LCD_Init();
	LCD_Clear(GUI_COLOR_RED);

	while(1){

		for(m = 0; (m <= 12); m++){

			LCD_Clear(colors[m]);

			for(i = 0; i < 7; i++){
				*LED<<=1;
				for(j = 0; j < SPEED; j++);
			}

			for(i = 7; i > 0; i--){
				*LED>>=1;
				for(j = 0; j < SPEED; j++);
			}
		}
	}

	return 0;
}
开发者ID:timoll,项目名称:carme-linux,代码行数:29,代码来源:main.c


示例13: main

/**
  * @brief  主函数
  * @param  无  
  * @retval 无
  */
int main(void)
{	
	/* 系统定时器 1us 定时初始化 */
  SysTick_Init();
  
  LCD_Init();	
  /* GRAM扫描方向为左下脚->右上角 */
  Lcd_GramScan(2);
  LCD_Clear(0, 0, 320, 240, BACKGROUND);
  
/*------------------------------------------------------------------------------------------------------*/
  
  /* 触摸屏IO和中断初始化 */
  Touch_Init();
  
  /* 等待触摸屏校正完毕 */
  while(Touch_Calibrate() !=0);
  
  /* 触摸取色板初始化 */
  Palette_Init();
  
	while( 1 )
  {
    if(touch_flag == 1)			/*如果触笔按下了*/
    {
      /*获取点的坐标*/
      if(Get_touch_point(&display, Read_2046_2(), &touch_para ) !=DISABLE)      
      {					
        Palette_draw_point(display.x,display.y);	 										
      }
    }		
  }
}
开发者ID:WildfireTeamPRJ,项目名称:wildfire_stm32_iso,代码行数:38,代码来源:main.c


示例14: Init

void Init() {
    PWR_Init();
    LED_Init();
    CLOCK_Init();
    UART_Initialize();
    printf("Start\n");
    Initialize_ButtonMatrix();
    STORAGE_Init();  // This must come before LCD_Init() for 7e

#ifdef MEDIA_DRIVE
    MEDIA_Init();
#endif

    LCD_Init();
    CHAN_Init();

    SPITouch_Init();
    SOUND_Init();
    BACKLIGHT_Init();
    BACKLIGHT_Brightness(1);
    AUTODIMMER_Init();
    STORAGE_WriteEnable(1);  // Enable writing to all banks of storage

    PPMin_TIM_Init();
#ifdef ENABLE_MODULAR
    //Force protocol to none to initialize RAM
    Model.protocol = PROTOCOL_NONE;
    PROTOCOL_Init(1);
#endif
#if HAS_RTC
    RTC_Init();        // Watchdog must be running in case something goes wrong (e.g no crystal)
#endif
}
开发者ID:DeviationTX,项目名称:deviation,代码行数:33,代码来源:main.c


示例15: LCD_Config

/**
  * @brief LCD configuration.
  * @note  This function Configure tha LTDC peripheral :
  *        1) Configure the Pixel Clock for the LCD
  *        2) Configure the LTDC Timing and Polarity
  *        3) Configure the LTDC Layer 1 :
  *           - ARGB4444 as pixel format  
  *           - The frame buffer is located at internal RAM : The output of DMA2D transfer
  *           - The Layer size configuration : 150x150  
  * @retval
  *  None
  */
static void LCD_Config(void)
{
  /* Initialize the LCD */
  LCD_Init();
  
  /* Initialize the LCD Layers */
  LCD_LayerInit();
  
  /* Set the Foreground as active Layer */
  LCD_SetLayer(LCD_FOREGROUND_LAYER);

  LCD_SetTransparency(0);
  
  /* Set the Background as active Layer */
  LCD_SetLayer(LCD_BACKGROUND_LAYER); 
  
  /* Configure the window size and position */
  LCD_SetDisplayWindow(165, 61, 150, 150);

  /* Configure the LCD Pixel Format */
  LCD_SetPixelFormat(LTDC_Pixelformat_ARGB4444);
  
  /* Configure the LCD frame Buffer Address */
  LCD_SetAddress((uint32_t)&aBufferResult);  
}  
开发者ID:EmbolismSoil,项目名称:STM32F407_LINUX,代码行数:37,代码来源:main.c


示例16: main

void main(void)
{
    // M8C_EnableGInt ; // Uncomment this line to enable Global Interrupts
    // Insert your main routine code here.

    //Start LCD
    LCD_Start();
    LCD_Init();

    value = 0; //0b0000 0000 where last four bits are 0, PRT0DR[3],PRT0DR[2], PRT0DR[1]

    while(1)//Control loop
    {
        mask = PRT0DR;

        //Collect PRT0DR[3] value
        if( (mask & 0b00001000) == 0)
        {
            //PRT0DR[3] is low
            value &= ~0b00000100;
        }
        else
        {
            //PRT0DR[3] is high
            value |= 0b00000100;
        }

        //Collect PRT0DR[2] value
        if( (mask & 0b00000100) == 0)
        {
            //PRT0DR[2] is low
            value &= ~0b00000010;
        }
        else
        {
            //PRT0DR[2] is high
            value |= 0b00000010;
        }

        //Collect PRT0DR[1] value
        if( (mask & 0b00000010) == 0)
        {
            //PRT0DR[1] is low
            value &= ~0b00000001;
        }
        else
        {
            //PRT0DR[1] is high
            value |= 0b00000001;
        }

        //Print to LCD
        LCD_Position(0,0);
        LCD_PrHexByte(value);

    }//End control loop


}
开发者ID:JulianKemmerer,项目名称:Drexel-ECEC356,代码行数:59,代码来源:main.c


示例17: ISO_Init

/*
 * 初始化液晶,串口,触摸屏,flash及sd卡 * 
 */
void ISO_Init(void)
{
	uint8_t k;
	
  /* 液晶初始化先于串口,不然会有bug,至于是什么原因我也不知道:( */
  LCD_Init();
	
	LCD_Clear(0,0,240,320,WHITE);
	
	LCD_DispStr(20,150,"board init,please wait... ",RED);
  
  USART1_Config();	
	
	

	/* 初始化sd卡文件系统,因为汉字的字库放在了sd卡里面 */
	Sd_fs_init();	

	#ifdef WORD_MODE
  /* 显示界面图片 */
	Lcd_show_bmp(0, 0,"/boardtest/boardtest.bmp");
	#else
	 /* 显示界面图片 */
	Lcd_show_bmp(0, 0,"/boardtest/ISO/ui_boardtest.bmp");

	#endif
	Lcd_List(1);
	
	/* 初始化外部FLASH */
	SPI_FLASH_Init();
	//SPI_FLASH_SectorErase(0);
  
	/* 触摸屏IO和中断初始化 */
	Touch_Init();		
		
		
		/*-------------------------------------------------------------------------------------------------------*/  
		#if 1
		SPI_FLASH_BufferRead(&cal_flag, 0, 1);
		if( cal_flag == 0x55 )
		{
			SPI_FLASH_BufferRead((void*)cal_p, 1, sizeof(cal_p));
			SPI_FLASH_CS_HIGH();
			for( k=0; k<6; k++ )
						printf("\r\n rx = %LF \r\n",cal_p[k]);
		}
		else
		{
			/* 等待触摸屏校正完毕 */
			while(Touch_Calibrate() !=0);
		}
		#elif 0
		/* 等待触摸屏校正完毕 */
		while(Touch_Calibrate() !=0);
		#endif
	


}
开发者ID:WildfireTeamPRJ,项目名称:wildfire_stm32_iso,代码行数:62,代码来源:bsp_iso_test.c


示例18: main

int main()
{
    char uartBuffer[80];
    char lcdBuffer[16];
    
    UART_1_Start();    
    UART_1_UartPutString("Sequencer Board Test\r\n");
    
    // Sequence Boardをリセット
    Pin_I2C_Reset_Write(0u);
    CyDelay(1);
    Pin_I2C_Reset_Write(1u);
    
    /* Init I2C */
    I2CM_Start();
    CyDelay(1500);
    
    CyGlobalIntEnable;
    
    LCD_Init();
    LCD_Clear();
	LCD_Puts("Sequencer Board");
    
    CyDelay(1000);
        
    for(;;)
    {  
        if (readSequencerBoard() == I2C_TRANSFER_CMPLT) {
            sprintf(uartBuffer, "%d %d %d %d %d %d ",
                sequencerRdBuffer[0],
                sequencerRdBuffer[1],
                sequencerRdBuffer[2],
                sequencerRdBuffer[3],
                sequencerRdBuffer[4],
                sequencerRdBuffer[5]
            );
            UART_1_UartPutString(uartBuffer);
        }
        else {
            UART_1_UartPutString("I2C Master Sequencer Read Error.\r\n");
        }
        
        if (writeSequencerBoard() == I2C_TRANSFER_CMPLT) {
            sprintf(uartBuffer, "%d\r\n", sequencerWrBuffer[0]);
            UART_1_UartPutString(uartBuffer);
        }
        else {
            UART_1_UartPutString("I2C Master Sequencer Write Error.\r\n");
        }
        
        sprintf(lcdBuffer, "%d", sequencerWrBuffer[0]);
        LCD_Clear();
        LCD_Puts(lcdBuffer);
        
        sequencerWrBuffer[0] = inc_within_uint8(sequencerWrBuffer[0], 16, 0);
        
        CyDelay(125);
    }
}
开发者ID:ryood,项目名称:PSoC4_sequencer_master,代码行数:59,代码来源:main.c


示例19: main

void main(void)
{
    u16 trigpos;
    u8 keycode;
    
    SystemState = AutoRunMode;
    // 现在还是使用软件触发
	  ADCState = Triggered;       // ADCState = WaitTrigger;

    CLK_Init();                 // 主时钟初始化
    TIM4_Init();                // TIM4 用于产生系统运行需要的定时信号
    KEY_Init();                 // 按键驱动初始化
    KeyParse_Init();            // 按键处理模块初始化
    LCD_Init();                 // LCD驱动初始化
    WDraw_Init();               // 波形显示模块初始化
    TriggerInterruptInit();     // 外部触发中断初始化
    ADC_Init();                 // ADC采样程控模块初始化
    DProc_Init();               // 数据处理模块初始化
  

    enableInterrupts();

    /* Infinite loop */
    while (1)
    {
    
				if(flag_10ms_ok)
        {
            flag_10ms_ok = 0;
            keycode = KEY_Scan();
						switch(GET_KTYPE(keycode))
            {
                case KTYPE_NORMAL:
                    KeyParse(GET_KCODE(keycode));
                default:
                    break;
            }
        }
        switch(SystemState)
        {
            // to do
            case AutoRunMode:
            case ManualMode:
                //  处理数据
                if( ADCState == ADC_Buffer_Full )
                {
                    trigpos = GetTriggerPostion(0, 64);
                    WDraw_DisplayUpdate(&ADC_Buffer[trigpos]);
                    ADCState = Triggered;
                    ADC_Index = 0;
                }
                break;
            default:
                break;
        }
		
		}
  
}
开发者ID:glocklueng,项目名称:stm8-oscilloscope,代码行数:59,代码来源:main.c


示例20: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  uint8_t  lcd_status = LCD_OK;
  
  /* STM32F4xx HAL library initialization:
    - Configure the Flash prefetch, instruction and Data caches
    - Systick timer is configured by default as source of time base, but user 
      can eventually implement his proper time base source (a general purpose 
      timer for example or other time source), keeping in mind that Time base 
      duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and 
      handled in milliseconds basis.
    - Set NVIC Group Priority to 4
    - Low Level Initialization: global MSP (MCU Support Package) initialization
  */
  HAL_Init();
  
  /* Configure the system clock to 180 MHz */
  SystemClock_Config();
  
  /* Initialize the SDRAM */
  BSP_SDRAM_Init();
  
  /* Initialize the LCD   */
  lcd_status = LCD_Init();
  OnError_Handler(lcd_status != LCD_OK); 

  /* Initialize LTDC layer 0 iused for Hint */
  BSP_LCD_LayerDefaultInit(0, LAYER0_ADDRESS);     
  BSP_LCD_SelectLayer(0); 
    
  /* Display example brief   */
  LCD_BriefDisplay();
  
  /*Draw first image */
  CopyBuffer((uint32_t *)Images[ImageIndex++], (uint32_t *)LAYER0_ADDRESS, 240, 160, 320, 240);
  pending_buffer = 0;
  
  /*Refresh the LCD display*/
  HAL_DSI_Refresh(&hdsi_eval);

  /* Infinite loop */
  while (1)
  {
    if(pending_buffer < 0)
    {
      CopyBuffer((uint32_t *)Images[ImageIndex++], (uint32_t *)LAYER0_ADDRESS, 240, 160, 320, 240);
      
      if(ImageIndex >= 2)
      {
        ImageIndex = 0;
      }
      pending_buffer = 0;
      
      HAL_DSI_Refresh(&hdsi_eval);
    }
    /* Wait some time before switching to next image */
    HAL_Delay(2000);
  }
}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:64,代码来源:main.c



注:本文中的LCD_Init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LCD_LOG_ClearTextZone函数代码示例发布时间:2022-05-30
下一篇:
C++ LCD_IO_WriteReg函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap