当前位置: 首页>>代码示例>>C++>>正文


C++ LCD_Init函数代码示例

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


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


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