/**
  * @brief  Display Init (LCD)
  * @param  None
  * @retval None
  */
void Display_Init(void)
{
  /* Initialize the LCD */
#ifdef USE_STM320518_EVAL
    STM320518_LCD_Init();
#else
    STM32072B_LCD_Init();
#endif /* USE_STM320518_EVAL */

  /* Clear the LCD */ 
  LCD_Clear(White);

  /* Set the LCD Text size */
  LCD_SetFont(&Font8x12);

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);

  /* Display */
  LCD_DisplayStringLine(LINE(0x13), "  ADC conversion example (Basic example)");

  /* Set the LCD Text size */
  LCD_SetFont(&Font16x24);

  LCD_DisplayStringLine(LINE(0), MESSAGE1);
  LCD_DisplayStringLine(LINE(1), MESSAGE2);
  
  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(White);
  LCD_SetTextColor(Blue);
     
}
Пример #2
0
/*******************************************************************************
* Function Name  : Draw_Logo
* Description    : 
* Input          : None
* Return         : None
*******************************************************************************/
void Draw_Logo(void)
{
	char txt[20] = "ver  ";

	LCD_FillScreen(Black);	// очищаем экран выбранным цветом 
	LCD_SetTextColor(DarkOrange2);	// установить цвет текста
	LCD_SetFont(&arialUnicodeMS_16ptFontInfo); // установить шрифт	16
	LCD_PutStrig(45, 122, 1, "NeilScope 3");
	
	LCD_SetTextColor(LightGray4);	// установить цвет текста
	LCD_SetFont(&lucidaConsole10ptFontInfo); // установить шрифт	10

	sprintf(&txt[4], "%d", __FIRMWARE_VERSION__);
	strcat(txt, " rev ");
	strcat(txt, __FIRMWARE_REVISION__);
	
	LCD_PutStrig(100, 110, 1, txt);
	LCD_PutStrig(100, 95, 1, "design by: Left Radio, Muha and others.");
	LCD_PutStrig(100, 80, 1, "full open HW/FW project");

	LCD_SetTextColor(DarkAuqa);
	LCD_PutStrig(180, 5, 0, "http://hobby-research.at.ua");

	delay_ms(1000);
	delay_ms(1000);
	delay_ms(1000);
}
Пример #3
0
/**
  * @brief  Display Init (LCD)
  * @param  None
  * @retval None
  */
void Display_Init(void)
{
  /* Initialize the LCD */
  STM32303C_LCD_Init();

  /* Clear the LCD */ 
  LCD_Clear(White);

  /* Set the LCD Text size */
  LCD_SetFont(&Font8x12);

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);

  /* Display */
  LCD_DisplayStringLine(LINE(0x13), (uint8_t*)"  ADC conversion example (Diff example)");

  /* Set the LCD Text size */
  LCD_SetFont(&Font16x24);

  LCD_DisplayStringLine(LINE(0), (uint8_t*)"STM32F303x CortexM4 ");
  LCD_DisplayStringLine(LINE(1), (uint8_t*)"   STM32303C-EVAL   ");
  
  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(White);
  LCD_SetTextColor(Blue);

  /* Display */
  LCD_DisplayStringLine(LINE(3),(uint8_t*)"  Turn RV2(PC.01)    ");
  LCD_DisplayStringLine(LINE(4),(uint8_t*)"   Potentiometer     ");
     
}
Пример #4
0
/**
  * @brief  Display Init (LCD)
  * @param  None
  * @retval None
  */
void Display_Init(void)
{
  /* Initialize the LCD */
  STM320518_LCD_Init();

  /* Clear the LCD */ 
  LCD_Clear(White);

  /* Set the LCD Text size */
  LCD_SetFont(&Font8x12);

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);

  /* Display */
  LCD_DisplayStringLine(LINE(0x13), "         ADC DMA conversion example         ");

  /* Set the LCD Text size */
  LCD_SetFont(&Font16x24);

  LCD_DisplayStringLine(LINE(0), " STM32F05x CortexM0 ");
  LCD_DisplayStringLine(LINE(1), "   STM320518-EVAL   ");
  
  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(White);
  LCD_SetTextColor(Blue);

  /* Display */
  LCD_DisplayStringLine(LINE(3),"  Turn RV3(PC.01)    ");
}
Пример #5
0
/**
* @brief  Set Grid
* @param  void
* @retval Null
*/
void setGrid(){
    LCD_SetFont(&Font8x8);
	  LCD_SetTextColor(LCD_COLOR_BLACK);
		int i, j;
	  //Draws horizontal lines
    for(i =20; i <= 300; i +=10)
    {		
	   LCD_DrawLine(20, i, 200, LCD_DIR_HORIZONTAL);
		}
		//Draws vertical lines
		for(j = 20; j <= 220; j +=10)
    {		
	   LCD_DrawLine(j, 20, 280, LCD_DIR_VERTICAL);
		}
		LCD_DisplayStringLine(310, (uint8_t*)"         Y DISPLACEMENT     ");
		LCD_DisplayChar(90, 10, (uint8_t)'X');
    LCD_DisplayChar(110, 10, (uint8_t)'D');
		LCD_DisplayChar(120, 10, (uint8_t)'I');
		LCD_DisplayChar(130, 10, (uint8_t)'S');
		LCD_DisplayChar(140, 10, (uint8_t)'P');
		LCD_DisplayChar(150, 10, (uint8_t)'L');
		LCD_DisplayChar(160, 10, (uint8_t)'A');
		LCD_DisplayChar(170, 10, (uint8_t)'C');
		LCD_DisplayChar(180, 10, (uint8_t)'E');
		LCD_DisplayChar(190, 10, (uint8_t)'M');
		LCD_DisplayChar(200, 10, (uint8_t)'E');
		LCD_DisplayChar(210, 10, (uint8_t)'N');
		LCD_DisplayChar(220, 10, (uint8_t)'T');
		LCD_SetFont(&Font12x12);
		LCD_SetTextColor(LCD_COLOR_RED);
}
Пример #6
0
/**
  * @brief  Display Init (LCD)
  * @param  None
  * @retval None
  */
void Display_Init(void)
{
  /* Initialize the LCD */
  STM320518_LCD_Init();

  /* Clear the LCD */ 
  LCD_Clear(White);

  /* Set the LCD Text size */
  LCD_SetFont(&Font8x12);

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);

  /* Display */
  LCD_DisplayStringLine(LINE(0x13), "       ADC Low Power Mode example       ");
  /* Set the LCD Text size */
  LCD_SetFont(&Font16x24);

  LCD_DisplayStringLine(LINE(0), "STM32F05x CortexM0  ");
  LCD_DisplayStringLine(LINE(1), "   STM320518-EVAL   ");
  
  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(White);
  LCD_SetTextColor(Blue);

  /* Display */
  LCD_DisplayStringLine(LINE(3)," Turn RV3 PC.1 then ");
  LCD_DisplayStringLine(LINE(4),"  Press KEY button  ");  
}
Пример #7
0
/**
  * @brief  Display Init (LCD)
  * @param  None
  * @retval None
  */
void Display_Init(void)
{

  /* Initialize the LCD */
  STM322xG_LCD_Init();

  /* Clear the LCD */
  LCD_Clear(White);

  /* Set the LCD Text size */
  LCD_SetFont(&Font8x12);

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);

  LCD_DisplayStringLine(LINE(0x13), " STM32F2xx ADC1 VBAT Measurement example");

  /* Set the LCD Text size */
  LCD_SetFont(&Font16x24);

  LCD_DisplayStringLine(LINE(0), "**VBAT Measurement**");

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(White);
  LCD_SetTextColor(Blue);

  LCD_DisplayStringLine(LINE(2)," Eval Board Instant ");
  LCD_DisplayStringLine(LINE(4),"  Battery Voltage   ");
}
/**
  * @brief  Display Init (LCD)
  * @param  None
  * @retval None
  */
void Display_Init(void)
{
  /* Initialize the LCD */
  STM324xG_LCD_Init();

  /* Clear the LCD */ 
  LCD_Clear(White);

  /* Set the LCD Text size */
  LCD_SetFont(&Font8x12);

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);

  /* Display */
  LCD_DisplayStringLine(LINE(0x13), " ADC conversion w/ DMA transfer example ");

  /* Set the LCD Text size */
  LCD_SetFont(&Font16x24);

  /* Display */
  LCD_DisplayStringLine(LINE(0), "ADC Ch3 Conv @2.4Msps");


  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(White);
  LCD_SetTextColor(Blue);

  /* Display */
  LCD_DisplayStringLine(LINE(2),"  Turn RT1(PA.03)    ");
  LCD_DisplayStringLine(LINE(4),"   Potentiometer     ");
}
Пример #9
0
void DemoCpuTemperature(void)
{
	uint16	i,y;
	
	LCD_ClearScreen();
	LCD_SetPenColor(1);
	LCD_SetFont(1);
	LCD_PrintXY(40,0,"CPU:");
	LCD_PrintXY(80,0,TempString);
		
	LCD_SetFont(0);
	LCD_PrintXY(0,0, "60-");
	LCD_PrintXY(0,18,"50-");
	LCD_PrintXY(0,37,"40-");
	LCD_PrintXY(0,56,"30-");
	LCD_DrawLine(15,0,15,63);

	for(i=16;i<128;i++)
	{
		y = DemoMem[127-i];
		
		if(y > 290) 
		{
			y = ((y - 290) / 5);
			y = 64 - y;
			LCD_PutPixel(i,y,1);
			LCD_PutPixel(i,y+1,1);
		}
	}
}
Пример #10
0
void CpuTemperatureView(void)
{
	uint16_t	i,y;
	MEASUREMENT_VIEW_struct * viewMem = cpu_temp_getViewMem();
	LCD_ClearScreen();
	LCD_SetPenColor(1);
	LCD_SetFont(1);
	LCD_PrintXY(40,0,"CPU:");
	LCD_PrintXY(80,0,viewMem->cur_value);
		
	LCD_SetFont(0);
	LCD_PrintXY(0,0, "60-");
	LCD_PrintXY(0,18,"50-");
	LCD_PrintXY(0,37,"40-");
	LCD_PrintXY(0,56,"30-");
	LCD_DrawLine(15,0,15,63);

	for(i=16;i<128;i++)
	{
		y = viewMem->Mem[127-i];
		
		if(y > 290) 
		{
			y = ((y - 290) / 5);
			y = 64 - y;
			LCD_PutPixel(i,y,1);
			LCD_PutPixel(i,y+1,1);
		}
	}
}
Пример #11
0
/**
  * @brief  Display Init (LCD)
  * @param  None
  * @retval None
  */
void Display_Init(void)
{

  /* Initialize the LCD */
  LCD_Init();

  /* Clear the LCD */
  LCD_Clear(White);

  /* Set the LCD Text size */
  LCD_SetFont(&Font8x12);

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);

  LCD_DisplayStringLine(LCD_LINE_19, (uint8_t*)" STM32F4xx ADC1 VBAT Measurement example");

  /* Set the LCD Text size */
  LCD_SetFont(&Font16x24);

  LCD_DisplayStringLine(LCD_LINE_0, (uint8_t*)"**VBAT Measurement**");

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(White);
  LCD_SetTextColor(Blue);

  LCD_DisplayStringLine(LCD_LINE_2, (uint8_t*)" Eval Board Instant ");
  LCD_DisplayStringLine(LCD_LINE_4, (uint8_t*)"  Battery Voltage   ");
}
Пример #12
0
void DemoFont(void)
{
	LCD_ClearScreen();
	LCD_SetFont(0);		LCD_PrintXY(0,0, "Font 0");
	LCD_SetFont(1);		LCD_PrintXY(0,8, "Font 1");
	LCD_SetFont(2);		LCD_PrintXY(0,23,"Font 2");
	LCD_SetFont(3);		LCD_PrintXY(0,39,"Font 3");
}
Пример #13
0
/*******************************************************************************
* Function Name  : Draw_Cursor_Trig
* Description    : указатели триггера
* Input          :
* Return         : None
*******************************************************************************/
void Draw_Cursor_Trig(DrawState NewState, uint16_t ClearColor, uint16_t TextColor)
{
	TrigCursorINFO *tTrigCursor = (pntTrigCursor == &Height_Y_cursor)? &Low_Y_cursor : &Height_Y_cursor;
	uint8_t tmpNewState = NewState;
	uint16_t textColor1, textColor2;

	if((gSyncState.Mode == Sync_NONE) && (NewState == DRAW)) return;

	LCD_SetFont(&lucidaConsole_9pt_Bold_FontInfo);
	LCD_SetTextColor(globalBackColor);

	if(gSyncState.Type > 1)
	{
		if(NewState == DRAW)
		{
			pntTrigCursor->Color = White;
			tTrigCursor->Color = LightGray4;
		}
		else
		{
			pntTrigCursor->Color = ClearColor;
			tTrigCursor->Color = ClearColor;
		}

		textColor1 = TextColor;
		textColor2 = TextColor;
	}
	else
	{
		if(NewState == DRAW) pntTrigCursor->Color = White;
		else pntTrigCursor->Color = ClearColor;

		tTrigCursor->Color = globalBackColor;
		tmpNewState = CLEAR;
		textColor1 = TextColor;
		textColor2 = globalBackColor;
	}


	/* Не активный курсор */
	LCD_DrawFillTriangle(0, tTrigCursor->Position - 3, 0, tTrigCursor->Position + 5,
			leftLimit, tTrigCursor->Position + 1, tTrigCursor->Color);

	Draw_Cursor_Trig_Line(tmpNewState, tTrigCursor);
	LCD_SetTextColor(textColor2);
	LCD_PutStrig(0, tTrigCursor->Position - 2, 1, tTrigCursor->Name);			/* очищаем старые показания */

	/* Активный курсор */
	LCD_DrawFillTriangle(0, pntTrigCursor->Position - 3, 0, pntTrigCursor->Position + 5,
			leftLimit, pntTrigCursor->Position + 1, pntTrigCursor->Color);

	Draw_Cursor_Trig_Line(NewState, pntTrigCursor);

	LCD_SetTextColor(textColor1);
	LCD_PutStrig(0, pntTrigCursor->Position - 2, 1, pntTrigCursor->Name);		/* очищаем старые показания */

	LCD_SetFont(&lucidaConsole10ptFontInfo);
}
Пример #14
0
/**
  * @brief  Display Init (LCD or/and USART)
  * @param  None
  * @retval None
  */
void Display_Init(void)
{
#ifdef PRINT_ON_USART 

 USART_InitTypeDef USART_InitStructure;
  /* USARTx configured as follow:
        - BaudRate = 115200 baud  
        - Word Length = 8 Bits
        - One Stop Bit
        - No parity
        - Hardware flow control disabled (RTS and CTS signals)
        - Receive and transmit enabled
  */
  USART_InitStructure.USART_BaudRate = 115200;
  USART_InitStructure.USART_WordLength = USART_WordLength_8b;
  USART_InitStructure.USART_StopBits = USART_StopBits_1;
  USART_InitStructure.USART_Parity = USART_Parity_No;
  USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
  USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;

  STM_EVAL_COMInit(COM1, &USART_InitStructure);

  printf("\n\r ========================================\n");
  printf("\n\r ==== Multiple RNG Generator Example ====\n");
  printf("\n\r ======================================== \n\n\r");
  printf("\n\r  Press key button to generate 8 x 32bit random number\n");
#endif

#ifdef PRINT_ON_LCD  
/* Initialize the LCD */
  STM322xG_LCD_Init();

  /* Clear the LCD */ 
  LCD_Clear(White);

  /* Set the LCD Text size */
  LCD_SetFont(&Font8x12);

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);

  LCD_DisplayStringLine(LINE(0x13), "  To generate 8x32bit RNG, Press Key  >>");

  /* Set the LCD Text size */
  LCD_SetFont(&Font16x24);

  LCD_DisplayStringLine(LINE(0), "*** RNG  Example ***");

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(White);
  LCD_SetTextColor(Blue); 

  LCD_DisplayStringLine(LINE(3),"  Press KEY button ");
  LCD_DisplayStringLine(LINE(5),"     to START     ");
#endif
}
/**
  * @brief  Display Init (LCD)
  * @param  None
  * @retval None
  */
static void Display_Init(void)
{
  /* Initialize the LCD */
#ifdef USE_STM320518_EVAL
    STM320518_LCD_Init();
#else
    STM32072B_LCD_Init();
#endif /* USE_STM320518_EVAL */

  /* Clear the LCD */
  LCD_Clear(LCD_COLOR_WHITE);
  
  /* Set the LCD Back Color */
  LCD_SetBackColor(Blue);
  
  /* Set the LCD Text Color */
  LCD_SetTextColor(White);
  
  /* Displays MESSAGE1 on line 1 */
  LCD_DisplayStringLine(LINE(0), (uint8_t *)MESSAGE1);
  
  /* Set the LCD Text Color */
  LCD_SetTextColor(Red);
  
  /* Set the LCD Back Color */
  LCD_SetBackColor(Red);
  LCD_DrawFullRect(31, 292,264,34);
  
  /* Set the LCD Back Color */
  LCD_SetBackColor(White);
  LCD_DrawFullRect(33, 290 ,260,30);
  
  
  /* Set the LCD Text, Back Colors and Text size */
  LCD_SetTextColor(Black); 
  LCD_SetBackColor(Cyan);
  LCD_SetFont(&Font12x12);
  
  LCD_DisplayStringLine(LINE(18), (uint8_t *)MESSAGE2);
  
  /* Set the LCD Back Color */
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);
  
  LCD_DisplayStringLine(LINE(19), (uint8_t *)MESSAGE3);
  
  /* Set text size */
  LCD_SetFont(&Font16x24);
  
  /* Set the LCD Text Color */
  LCD_SetTextColor(Blue);
  
}
Пример #16
0
/**
* @brief  Display the application header (title) on the LCD screen 
* @param  Title :  pointer to the string to be displayed
* @retval None
*/
void LCD_LOG_SetHeader (uint8_t *Title)
{
  sFONT *cFont;

  uint32_t size = 0 , idx,cnt=LCD_PIXEL_WIDTH/cFont->Width+1; 
  uint8_t  *ptr = Title;
  uint8_t  tmp[80];
// #ifdef inch_4
//   uint8_t  tmp[66];
// #endif
// #ifdef inch_7
//   uint8_t  tmp[66];
// #endif	
	
  LCD_SetFont (&Font12x12);
  cFont = LCD_GetFont();
	cnt=LCD_PIXEL_WIDTH/cFont->Width+1;
  /* center the header */
  while (*ptr++) size ++ ;

  /* truncate extra text */
  if(size > cnt)
  {
     size = cnt;
  }
  
  for (idx = 0 ; idx <cnt ; idx ++)
  { 
    tmp[idx] = ' '; 
  }

  for (idx = 0 ; idx < size ; idx ++)
  { 
    tmp[idx + (cnt - size)/2] = Title[idx];
  }
  
  /* Clear the LCD */
  LCD_Clear(Black);
    
  /* Set the LCD Font */
 

  cFont = LCD_GetFont();  
  /* Set the LCD Text Color */
  LCD_SetTextColor(White);
  LCD_SetBackColor(Blue);
  LCD_ClearLine(0);
  LCD_DisplayStringLine(cFont->Height, tmp);
  LCD_ClearLine(2 * cFont->Height);

  LCD_SetBackColor(Black);
  LCD_SetFont (&Font8x12);
}
Пример #17
0
void DemoText(void)
{	
	LCD_ClearScreen();
	LCD_SetFont(1);	
	LCD_PrintXY(30,0,"Raspi-LCD");
	LCD_PrintXY(0,12,"www.emsystech.de");
	LCD_SetFont(0);	
	LCD_PrintXY(8,29,"128 x 64 Pixel (BW)");
	LCD_PrintXY(6,38,"White LED Backlight");
	LCD_PrintXY(4,47,"8 Lines with 21 Char ");
	LCD_PrintXY(4,56,"in the smallest Font ");
}
Пример #18
0
void AbgasTemperatureView(void)
{
	uint16_t	i,y;
	MEASUREMENT_VIEW_struct * viewMem = pt100_getViewMem();
	LCD_ClearScreen();
	LCD_SetPenColor(1);
	LCD_SetFont(0);
	LCD_PrintXY(30,0,"ABGAS:");
	LCD_PrintXY(80,0,viewMem->cur_value);
		
	LCD_SetFont(0);
	
  int max = roundUp(viewMem->max);
  int min  = roundDown(viewMem->min);
  int diff = max-min;
  int span;
  if(!diff) {
    span = 10;
    if(min) min -= 10;
  }else {
    span = diff/3;
  }
  
  if(span < 10) span = 10;
  
  char dummy[10];
 
    sprintf(dummy,"%4u-",min+(span*3));
    LCD_PrintXY(0,0, dummy);
    
    sprintf(dummy,"%4u-",min+(span*2));
    LCD_PrintXY(0,18,dummy);
    
    sprintf(dummy,"%4u-",min+(span*1));
    LCD_PrintXY(0,37,dummy);
    
    sprintf(dummy,"%4u-",min);
    LCD_PrintXY(0,56,dummy);

  
	LCD_DrawLine(27,0,27,63);
  diff = (span*3);
  
	for(i=27;i<128;i++)
	{
		y = viewMem->Mem[127-i];
		y =  64 - ((double)(y-min)*(double)(64.0/diff));
		LCD_PutPixel(i,y,1);
		LCD_PutPixel(i,y+1,1);
		
	}
}
Пример #19
0
/**
  * @brief  Display Init (LCD)
  * @param  None
  * @retval None
  */
static void Display_Init(void)
{
  /* Initialize the LCD */
  LCD_Init();
  LCD_LayerInit();
  /* Enable the LTDC */
  LTDC_Cmd(ENABLE);
  
  /* Set LCD Background Layer  */
  LCD_SetLayer(LCD_BACKGROUND_LAYER);
  
  /* Clear the Background Layer */ 
  LCD_Clear(LCD_COLOR_WHITE);
  
  /* Configure the transparency for background */
  LCD_SetTransparency(0);
  
  /* Set LCD Foreground Layer  */
  LCD_SetLayer(LCD_FOREGROUND_LAYER);

  /* Configure the transparency for foreground */
  LCD_SetTransparency(200);
  
  /* Clear the Foreground Layer */ 
  LCD_Clear(LCD_COLOR_WHITE);
  
  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(LCD_COLOR_BLUE);
  LCD_SetTextColor(LCD_COLOR_WHITE);
  
    /* Set the LCD Text size */
  LCD_SetFont(&FONTSIZE);
  
  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(LCD_COLOR_BLUE);
  LCD_SetTextColor(LCD_COLOR_WHITE);
  
  LCD_DisplayStringLine(LINE(LINENUM), (uint8_t*)MESSAGE1);
  LCD_DisplayStringLine(LINE(LINENUM + 1), (uint8_t*)MESSAGE1_1);
  LCD_DisplayStringLine(LINE(0x17), (uint8_t*)"                               ");
  
  /* Set the LCD Text size */
  LCD_SetFont(&Font16x24);
  
  LCD_DisplayStringLine(LCD_LINE_0, (uint8_t*)MESSAGE2);
  LCD_DisplayStringLine(LCD_LINE_1, (uint8_t*)MESSAGE2_1);
  
  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(LCD_COLOR_WHITE);
  LCD_SetTextColor(LCD_COLOR_BLUE); 
}
Пример #20
0
/**
  * @brief  Display Init (LCD)
  * @param  None
  * @retval None
  */
void Display_Init(void)
{

  /* Initialize the LCD */
  LCD_Init();

  /* Display message on LCD ***************************************************/
#if defined (USE_STM324x9I_EVAL) 
  /* Initialize the LCD Layers */
  LCD_LayerInit();
  
  /* Enable The Display */
  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);

  /* Configure the transparency for foreground */
  LCD_SetTransparency(100);
#endif /* USE_STM324x9I_EVAL */
  
  /* Clear the LCD */
  LCD_Clear(White);

  /* Set the LCD Text size */
  LCD_SetFont(&FONTSIZE);

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);

  LCD_DisplayStringLine(LINE(LINENUM), (uint8_t*)MESSAGE1);
  LCD_DisplayStringLine(LINE(0x16), (uint8_t*)"                                        ");
  
  /* Set the LCD Text size */
  LCD_SetFont(&Font16x24);

  LCD_DisplayStringLine(LCD_LINE_0, (uint8_t*)MESSAGE2);

  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(White);
  LCD_SetTextColor(Blue);

  LCD_DisplayStringLine(LCD_LINE_2, (uint8_t*)MESSAGE3);
  LCD_DisplayStringLine(LCD_LINE_4, (uint8_t*)MESSAGE4);
}
Пример #21
0
/**
* @brief  Configure the IO Expander and the Touch Panel.
* @param  None
* @retval None
*/
static void TP_Config(void)
{
  /* Clear the LCD */ 
  LCD_Clear(LCD_COLOR_WHITE);
  
  /* Configure the IO Expander */
  if (IOE_Config() == IOE_OK)
  {   
    LCD_SetFont(&Font8x8);
    LCD_DisplayStringLine(LINE(32), (uint8_t*)"              Touch Panel Paint     ");
    LCD_DisplayStringLine(LINE(34), (uint8_t*)"              Example               ");
    LCD_SetTextColor(LCD_COLOR_BLUE2); 
    LCD_DrawFullRect(5, 250, 30, 30);
    LCD_SetTextColor(LCD_COLOR_CYAN); 
    LCD_DrawFullRect(40, 250, 30, 30);
    LCD_SetTextColor(LCD_COLOR_YELLOW); 
    LCD_DrawFullRect(75, 250, 30, 30);
    LCD_SetTextColor(LCD_COLOR_RED); 
    LCD_DrawFullRect(5, 288, 30, 30);
    LCD_SetTextColor(LCD_COLOR_BLUE); 
    LCD_DrawFullRect(40, 288, 30, 30);
    LCD_SetTextColor(LCD_COLOR_GREEN); 
    LCD_DrawFullRect(75, 288, 30, 30);
    LCD_SetTextColor(LCD_COLOR_MAGENTA); 
    LCD_DrawFullRect(145, 288, 30, 30);
    LCD_SetTextColor(LCD_COLOR_BLACK); 
    LCD_DrawFullRect(110, 288, 30, 30);
    LCD_DrawRect(180, 270, 48, 50);
    LCD_SetFont(&Font16x24);
    LCD_DisplayChar(LCD_LINE_12, 195, 0x43);
    LCD_DrawLine(0, 248, 240, LCD_DIR_HORIZONTAL);
    LCD_DrawLine(0, 284, 180, LCD_DIR_HORIZONTAL);
    LCD_DrawLine(1, 248, 71, LCD_DIR_VERTICAL);
    LCD_DrawLine(37, 248, 71, LCD_DIR_VERTICAL);
    LCD_DrawLine(72, 248, 71, LCD_DIR_VERTICAL);
    LCD_DrawLine(107, 248, 71, LCD_DIR_VERTICAL);
    LCD_DrawLine(142, 284, 36, LCD_DIR_VERTICAL);
    LCD_DrawLine(0, 319, 240, LCD_DIR_HORIZONTAL);
  }  
  else
  {
    LCD_Clear(LCD_COLOR_RED);
    LCD_SetTextColor(LCD_COLOR_BLACK); 
    LCD_DisplayStringLine(LCD_LINE_6,(uint8_t*)"   IOE NOT OK      ");
    LCD_DisplayStringLine(LCD_LINE_7,(uint8_t*)"Reset the board   ");
    LCD_DisplayStringLine(LCD_LINE_8,(uint8_t*)"and try again     ");
  }
}
Пример #22
0
void LCD_Initialization(){
  lcd_init();
  lcd_drawBackground(20,60,250);
  lcd_drawBGPersimmon(20, 60, 250);
  LCD_SetColors(LCD_COLOR_WHITE-1,LCD_COLOR_BLACK);
  LCD_SetFont(&Font8x12); 
}
Пример #23
0
/**
  * @brief  This function handles External lines 15 to 10 interrupt request.
  * @param  None
  * @retval None
  */
void EXTI15_10_IRQHandler(void)
{
  uint32_t tmp = 0,tmp1 =0;
  if (EXTI_GetITStatus(EXTI_Line11) != RESET)
  {
    if(RTCAlarmCount == 0)
    {
      SecondNumb++;
      
      tmp = (uint32_t) (SecondNumb/60);
      tmp1 =   SecondNumb -(tmp*60);
      
      LCD_SetFont(&Font16x24);
      /* Set the LCD text color */
      LCD_SetTextColor(Blue);
      /* Set the LCD Back Color */
      LCD_SetBackColor(White);
      LCD_DisplayStringLine(95,     "         "); 
      /* Display Char on the LCD : XXX% */       
      LCD_DisplayChar(95,294, (tmp / 10) +0x30);
      LCD_DisplayChar(95,278, (tmp  % 10 ) +0x30);
      LCD_DisplayChar(95,262, ':');
      LCD_DisplayChar(95,246, (tmp1 / 10) +0x30);
      LCD_DisplayChar(95,230, (tmp1  % 10 ) +0x30);
      
    }
    /* Clear the EXTI Line 11 */
    EXTI_ClearITPendingBit(EXTI_Line11);
  } 
}
Пример #24
0
/*
 *	Main function: initializes all system values and components, then starts
 *	operation of the two threads.
 *
 *	@author HP Truong, Jacob Barnett
 *
 *	@param void
 *	@return void
 */
int main (void) {
	CC2500_LowLevel_Init();
	CC2500_Reset();

	osKernelInitialize ();                    // initialize CMSIS-RTOS
	
	// initialize peripherals here
	/* LCD initiatization */
	LCD_Init();
  
	/* LCD Layer initiatization */
	LCD_LayerInit();

	/* Enable the LTDC controler */
	LTDC_Cmd(ENABLE);

	/* Set LCD foreground layer as the current layer */
	LCD_SetLayer(LCD_FOREGROUND_LAYER);

	LCD_SetFont(&Font16x24);
	LCD_Clear(LCD_COLOR_WHITE);

	receive_and_plot_thread = osThreadCreate(osThread(receive_and_plot), NULL);
	print_lcd_debug_thread = osThreadCreate(osThread(print_lcd_debug), NULL);

	osKernelStart ();                         // start thread execution 
}
Пример #25
0
/**
  * @brief  Display transmitted msg on the LCD 
  * @param  None.
  * @retval None
  */
static void Display_TransmittedMsg(uint8_t PushNumber)
{
  uint8_t text[50] = {0}, dataindex =0;
  
  uint8_t TxMessages[6] = { 0, 1, 2, 3, 4, 5 };
  
  /* Set the LCD Back Color and Text Color*/
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);
  
   /* Set the LCD Text size */
  LCD_SetFont(&Font12x12);
  
  /* Display Messages on the the LCD */  
  LCD_DisplayStringLine(LINE(5), (uint8_t *)MESSAGE3);
  
  
  for(dataindex = 0 ; dataindex < 6 ;dataindex++)
  {
    
    TxMessage.Data[0] = (uint8_t)(TxMessages[dataindex] + (6 * PushNumber));
    
    CAN_Transmit(CANx, &TxMessage);
    
    sprintf((char*)text,"Send Message Num%d    = %d           ",dataindex+1,TxMessage.Data[0] );
    
    LCD_SetBackColor(Cyan);
    LCD_SetTextColor(Black);
    
    LCD_DisplayStringLine(LINE(6+dataindex),text);
  }
  
}
Пример #26
0
int main(void)
{
  uint8_t colorR =0 ,colorG =0 ,colorB =0 ;
  uint8_t colorR_dir =0 ,colorG_dir =0 ,colorB_dir =0 ;
  char lcd_text_buff[100];

  float GyX =0.0f, GyY =0.0f, GyZ =0.0f;
  float X_offset =0.0f,Y_offset =0.0f,Z_offset =0.0f;
  uint32_t i=0;
  float delay_count=1000.0f;

  GPIO_Configuration();
  USART1_Configuration();
  CANx_Config();
  CANx_NVIC_Config();
  lcd_init();
  lcd_drawBackground(20,60,250);
  lcd_drawBGPersimmon(20, 60, 250);


    LCD_SetColors(LCD_COLOR_WHITE-1,LCD_COLOR_WHITE);
    LCD_SetFont(&Font16x24);
    LCD_DisplayStringLine(LINE(1), (uint8_t*)" CAN Bus DEMO  ");
    DrawNeedle(120,120,60,300.0f,0.0f,200.0f);
  while (1)
  {
    CANx_Transmit();
    GPIO_ToggleBits(LED4);

    Delay_1us(1000);
  }
  
}
Пример #27
0
/**
  * @brief  Initializes the LCD.
  * @param  None
  * @retval None
  */
void STM32303C_LCD_Init(void)
{
  __IO uint32_t lcdid = 0;
  
  /* Setups the LCD */
  LCD_Setup();

  /* Read the LCD ID */
  lcdid = LCD_ReadReg(0x00);  
  
  if (lcdid == LCD_SPFD5408)
  {
    LCDType = LCD_SPFD5408;
        /* Setups the LCD */
    LCD_Setup();
  }
  else if (lcdid == LCD_ILI9320)
  {
    LCDType = LCD_ILI9320;
    /* Setups the LCD */
    LCD_Setup();    
  }  
  else
  {
    LCDType = LCD_HX8347D;
        /* Setups the LCD */
    LCD_Setup();
  } 
    
  LCD_SetFont(&LCD_DEFAULT_FONT);
}
Пример #28
0
void lcdscreentimer::paintEvent()
{
  if( m_editMode )
  {
  }
  else
  {
    if( m_selectedTime>=0 )
    {
      int x = 0, y = 10*m_selectedTime, dx = 127, dy = 10;
      LCD_SetPenColor(1);
      LCD_DrawLine(x,y,x+dx,y);
      LCD_DrawLine(x+dx,y,x+dx,y+dy);
      LCD_DrawLine(x+dx,y+dy,x,y+dy);
      //LCD_DrawLine(x,y+dy,x,y); // does not really work ?
      LCD_DrawLine(x,y,x,y+dy);
    }
    LCD_SetFont(0);
    LCD_PrintXY(3, 2,timerText1);
    LCD_PrintXY(3,12,timerText2);
    LCD_PrintXY(3,22,timerText3);
    LCD_PrintXY(3,32,timerText4);
    LCD_PrintXY(3,42,timerText5);
  }
}
Пример #29
0
void header(int bar,bool_e plugged, bool_e armed){

	//définition des variables
	uint16_t i;
	uint16_t x = 241+40;

	//Contours+fond d'écran
	create_rectangle(0,0,320,25,0x2104);

	//affichage de l'icone usb si système branché
	if(plugged == TRUE){
		DISP_BMP((uint8_t*)usb,27,0,32,24);
	}

	//affichage de l'icone armed si système branché
	if(armed == TRUE){
		DISP_BMP((uint8_t*)key,0,1,32,24); //TODO : FIX Y AXIS PROBLEM
	}

	//logo batterie
	create_rectangle(239+40,6,28,13,0xFFFF);
	create_rectangle(240+40,7,26,11,0x2104);
	create_rectangle(266+40,9,3,7,0xFFFF);

	//boucle remplissage
	for (i=0;i<bar;i++){
		create_rectangle(x,8,4,9,0xFFFF);
		x = x+5;
	}

	//Choix de la taille de police pour l'écriture dans le header
	LCD_SetFont(&Bebas);
}
Пример #30
0
//Main Function
int main(void)
{
	//RCC_Configurastatic();
	GPIO_Configuration();
	USART1_Configuration();
	LCD_SetColors(0x1188, 0x0000);
	LCD_SetFont(&Font8x8);
	t_queue = xQueueCreate(1, sizeof(int));
	if (!t_queue) {
		ReportError("Failed to create t_queue");
		while(1);
	}

	t_mutex = xSemaphoreCreateMutex();
	if (!t_mutex) {
		ReportError("Failed to create t_mutex");
		while(1);
	}

	prvInit();
	
	//LCD_DisplayStringLine(LCD_LINE_1,text);
	//xTaskCreate(usart_text, (char *) "Draw Graph Task", 256,
	//	             NULL, tskIDLE_PRIORITY + 2, NULL);
xTaskCreate(r3d, (char *) "Draw Graph Task", 256,
		             NULL, tskIDLE_PRIORITY + 2, NULL);
	
	
	RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_RNG, ENABLE);
        RNG_Cmd(ENABLE);

	//Call Scheduler
	vTaskStartScheduler();
}