Пример #1
0
/**
 * @function main
 * @brief entry point
 * @param none
 * @return dummy
 */
int32_t main(void) {

  timer_t tmInit;

  UcInit();       /*uc init; shall be the first one*/
  TicksInit();    /*software clock init*/
  LCD_Init();     /*start the ILI932X*/

  /* start a timer; backlight will be turned on once this timer will elapse
   * -> this avoids a white flash*/
  tmInit = GetTimeout(120);

  P2D_Init();
  GUI_Init();
  TouchScreenCalib(NULL);
  TouchScreenEnable();

  /*mount the file system*/
  disk_initialize(0);
  f_mount(0, &Fatfs);

  /* wait the 120ms timeout */
  while(IsTimerElapsed(tmInit) == false) DelayMs(1);
  BacklightInit();

  /*set the main task*/
  pCurrentTask = &SetupTask;

  /*main loop*/
  while(1) {

    /*execute the main task, if any*/
    if(pCurrentTask != NULL) pCurrentTask();

    /*GUI task*/
    GUI_DrawObjects();
    GUI_DBG_Task();

    /*software RTC task*/
    RtcTask();

    /*CPU limiter; reduces the power consumption*/
    DelayMs(1);
  }

  /*never arrive here*/
  return -1;
}
Пример #2
0
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  GUI_Init();
  //
  // Use memory devices for all windows
  //
  #if GUI_SUPPORT_MEMDEV
    WM_SetCreateFlags(WM_CF_MEMDEV);
    WM_EnableMemdev(WM_HBKWIN);
  #endif
  WM_SetDesktopColor(GUI_GREEN);
  while(1) {
    _Font = _Color = 0;
    GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbDialog, 0, 0, 0);
    GUI_Delay(1000);
  }
}
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  GUI_Init();
  //
  // Check if recommended memory for the sample is available
  //
  if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
    GUI_ErrorOut("Not enough memory available."); 
    return;
  }
  WM_SetCallback(WM_HBKWIN, _cbBkWindow);
  WM_SetCreateFlags(WM_CF_MEMDEV);  // Use memory devices on all windows to avoid flicker
  while (1) {
    GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbCallback, 0, 0, 0);
    GUI_Delay(1000);
  }
}
Пример #4
0
/* API initializes the Segger library */
GUI_SEGGERLIBRARY_STATUS_t GUI_SEGGERLIBRARY_Init(GUI_SEGGERLIBRARY_t *handle)
{
  GUI_SEGGERLIBRARY_STATUS_t status;

  status = GUI_SEGGERLIBRARY_STATUS_SUCCESS;

#if (GUI_SEGGERLIBRARY_RTOS_PRESENT == 0)
  status = (GUI_SEGGERLIBRARY_STATUS_t)SYSTIMER_Init(handle->systimer_handler);
#endif

#if (CMSIS_RTOS_RTX_PRESENT == 1)
  status = (GUI_SEGGERLIBRARY_STATUS_t)CMSIS_RTOS_RTX_Init(&CMSIS_RTOS_RTX_0);
#endif

  if (status == GUI_SEGGERLIBRARY_STATUS_SUCCESS)
  {
    /* Initialize SPI as well as the port and pin for GPIO */
    #if (SPI_INTERFACE == 1)
      status = (GUI_SEGGERLIBRARY_STATUS_t)SPI_MASTER_Init(handle->spi_master_handler);

      #if !USER_DEFINED_LCD
		if (status == GUI_SEGGERLIBRARY_STATUS_SUCCESS)
		{
		  XMC_GPIO_Init(handle->config->portNo, handle->config->pinNo, handle->config->gpio);

		  status = GUI_SEGGERLIBRARY_STATUS_SUCCESS;
		}
		else
		{
		  status = GUI_SEGGERLIBRARY_STATUS_FAILURE;
		}
      #endif
    #endif

    if (handle->enable_at_init == true)
    {
      GUI_Init();
    }
  }
  else
  {
    status = GUI_SEGGERLIBRARY_STATUS_FAILURE;
  }

  return (status);
}
Пример #5
0
int main(void)
{

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_DMA_Init();
  MX_CRC_Init();
  MX_USART1_UART_Init();
//  MX_RTC_Init();  /**< 重新用cube生成工程时 注释掉此函数 再下载 */

  /* USER CODE BEGIN 2 */
    rtc_init();     /**< 使用改造后的初始化函数实现备份掉电时的数据 */
    
    GUI_Init();
    GUI_UC_SetEncodeUTF8();
    GUI_SetFont(&GUI_Font24B_1);
    GUI_SetBkColor(GUI_BLACK);
    GUI_SetColor(GUI_GREEN);

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */
    RTC_display_current_time(20, 170);
    RTC_display_current_date(120, 170);  
  }
  /* USER CODE END 3 */

}
Пример #6
0
static  void  App_Task1(void *p_arg)
{
	(void)p_arg;
	 LED_GPIO_Conf();
	GUI_Init();
	GUI_SetBkColor(GUI_RED);
	GUI_SetColor(GUI_BLUE);
	GUI_Clear();
	while(1)
	{
     	LED0(On);
		OSTimeDly(500);
		LED0(Off);
		OSTimeDly(500);
		MainTask();
	}	
}
Пример #7
0
void MainTask(void) {
  SPINBOX_Handle  hSpin;
  FRAMEWIN_Handle hFrame;
  WM_HWIN hClient;

  GUI_Init();
  WM_SetCallback(WM_HBKWIN, _cbBk);
  hFrame = FRAMEWIN_CreateEx(110, 60, 100, 80, WM_HBKWIN, WM_CF_SHOW, 0, ID_FRAMEWIN_0, "Spinbox", 0);
  hClient = WM_GetClientWindow(hFrame);
  FRAMEWIN_SetSkin(hFrame, FRAMEWIN_SKIN_FLEX);
  FRAMEWIN_SetFont(hFrame, GUI_FONT_16B_ASCII);
  hSpin  = SPINBOX_CreateEx(10, 10, 60, 20, hClient, WM_CF_SHOW, GUI_ID_SPINBOX0, 5, 2222);
  SPINBOX_SetSkin(hSpin, SPINBOX_SKIN_FLEX);
  while (1) {
    GUI_Delay(100);
  }
}
Пример #8
0
/*******************************************************************************
*  Function Name  :   testgui 
*  Description    : GUI测试函数,初化后,显示数据
*  Input          : None
*  Output         : None
*  Return         : None
*******************************************************************************/
void test_gui(void)
{
  int i;  
	RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
    GUI_Init();
    GUI_Initialized = 1;
    GUI_DispChars('/', 53);     
    for( i= 0; i < 240; i += 8)   
    {        
        GUI_DispCharAt('/', 312, i);
        GUI_DispCharAt('/', 1,   i);
    } 
    GUI_DispChars('/', 52); 
    GUI_SetFont(&GUI_Font24B_ASCII);
    GUI_SetColor(GUI_RED); 
    GUI_DispStringAt("This is a test program!",10,110);
}
Пример #9
0
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  //
  // Init GUI
  //
  GUI_Init();
  //
  // Create tasks
  //
  CREATE_TASK(&aTCB[0], "Task_0",   Task_0,    100, Stack_0);
  CREATE_TASK(&aTCB[1], "Task_1",   Task_1,     50, Stack_1);
  CREATE_TASK(&aTCB[2], "Task_2",   Task_2,     50, Stack_2);
  CREATE_TASK(&aTCB[3], "GUI_TASK", _GUI_Task,   1, Stack_3);
  //
  // Start multitasking
  //
  START_MT();
}
Пример #10
0
int main(void)
{
	GUI_MEMDEV_Handle hMem0,hMem1;
	SysTick_Config(180000);
	SDRAM_Init();
	
	LCD_Config();
	
	GUI_Init();
	GUI_SetFont(&GUI_Font32B_ASCII);
	GUI_SetBkColor(GUI_BLUE);
	GUI_SetColor(GUI_YELLOW);
	GUI_Clear();

//	GUI_DispStringAt("blacklight",0,100);
	
//	GUIDEMO_Main();
	
	hMem0 = GUI_MEMDEV_CreateFixed(0,0,100,50,GUI_MEMDEV_NOTRANS,GUI_MEMDEV_APILIST_32,GUI_COLOR_CONV_888);
	hMem1 = GUI_MEMDEV_CreateFixed(0,0,100,50,GUI_MEMDEV_NOTRANS,GUI_MEMDEV_APILIST_32,GUI_COLOR_CONV_888);
	GUI_MEMDEV_Select(hMem0);
	GUI_Clear();
	GUI_DispString("Text");
	GUI_MEMDEV_CopyToLCDAt(hMem0,0,0);
	
	while(1)
	{	
		GUI_MEMDEV_Select(hMem1);
		GUI_MEMDEV_DrawPerspectiveX(hMem0,0,0,50,50-50*i/100,100-100*i/100,25*i/100);
		GUI_MEMDEV_CopyToLCDAt(hMem1,i,50+i);
		
		GUI_Delay(10);
		
		GUI_MEMDEV_Select(hMem1);
		GUI_Clear();
		GUI_MEMDEV_CopyToLCDAt(hMem1,i,50+i);
		
		i+=1;
		if(i>100)
		{
			i=0;
		}
	}
	
	while(1);
}
Пример #11
0
void MainTask(void) {
  static GUI_PID_STATE OldState;
  GUI_PID_STATE        CurrentState;
  int                  tEnd;

  GUI_Init();
  do {
    WM_HWIN hButton0, hButton1;
    WM_SetCallback(WM_HBKWIN, _cbBkWin);
    hButton0 = _CreateButton(100, 220, 170, 150, 5, 25, "Dashboard"    , &bmDashboard   , GUI_ID_BUTTON0);
    hButton1 = _CreateButton(370, 220, 170, 150, 5, 25, "Cash Terminal", &bmCashTerminal, GUI_ID_BUTTON1);
    WM_SetFocus(hButton0);
    tEnd = GUI_GetTime() + 4000;
    do {
      GUI_PID_GetState(&CurrentState);
      if ((OldState.x != CurrentState.x) || (OldState.y != CurrentState.y)) {
        tEnd = GUI_GetTime() + 10000;
      }
      OldState = CurrentState;
      GUI_Delay(100);
      if (GUI_GetTime() >= tEnd) {
        if (_AppSelectionOld) {
          _AppSelection = ((_AppSelectionOld - 1) ^ 1) + 1;
        } else {
          _AppSelection = APP_DASHBOARD;
        }
      }
    } while (!_AppSelection && !_Break);
    WM_DeleteWindow(hButton0);
    WM_DeleteWindow(hButton1);
    if (!_Break) {
      switch (_AppSelection) {
      case APP_DASHBOARD:
        AppDashBoard();
        break;
      case APP_CASHTERMINAL:
        AppCashTerminal();
        break;
      }
      GUI_CURSOR_Hide();
      _AppSelectionOld = _AppSelection;
      _AppSelection    = 0;
    }
  } while (!_Break);
}
Пример #12
0
void rt_gui_thread_entry(void* parameter) 
{
  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
  /*设置默认创建标记WM 然后会将 WM_PAINT 消息输出重定向到存储设备中,再复制到显
  示器中。如果整个窗口的内存不够,会自动使用分段*/
  WM_SetCreateFlags(WM_CF_MEMDEV);
  touch_config();
  Timer5Config();
  GUI_Init();
  GUI_Initialized = 1;
  ADC_Config();
  LED_Init();
  RS485GPIOConfig();
  RS485Write();
  
  GUIDEMO_Main();

}
Пример #13
0
int main(void)
{
	InitHard();

	// Init the STemWin GUI Library.
	GUI_Init();
	GUI_Initialized = 1;

	// Activate the use of memory device feature.
	WM_SetCreateFlags(WM_CF_MEMDEV);

	WM_HWIN hDlg = CreateTestDlg();

	while (1)
	{
		GUI_Delay(10);
	}
}
Пример #14
0
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  GUI_Init();
  #if GUI_SUPPORT_MEMDEV
    WM_SetCreateFlags(WM_CF_MEMDEV);
  #endif
  WM_SetCallback(WM_HBKWIN, &_cbBkWindow);
  //
  // Create message box and wait until it is closed
  //
  while (1) {
    GUI_MessageBox("This text is shown\nin a message box",
                   "Caption/Title", GUI_MESSAGEBOX_CF_MOVEABLE);
    GUI_Delay(750);                    // Wait for a short moment ...
    GUI_MessageBox("New message !",
                   "Caption/Title", GUI_MESSAGEBOX_CF_MOVEABLE);
    GUI_Delay(750);
  }
}
Пример #15
0
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  GUI_PID_STATE TouchState;
  int           xPhys;
  int           yPhys;

  GUI_Init();
  GUI_CURSOR_Show();
  GUI_CURSOR_Select(&GUI_CursorCrossL);
  GUI_SetBkColor(GUI_WHITE);
  GUI_SetColor(GUI_BLACK);
  GUI_Clear();
  GUI_DispString("Measurement of\nA/D converter values");
  while (1) {
    GUI_TOUCH_GetState(&TouchState);  // Get the touch position in pixel
    xPhys = GUI_TOUCH_GetxPhys();     // Get the A/D mesurement result in x
    yPhys = GUI_TOUCH_GetyPhys();     // Get the A/D mesurement result in y
    //
    // Display the measurement result
    //
    GUI_SetColor(GUI_BLUE);
    GUI_DispStringAt("Analog input:\n", 0, 20);
    GUI_GotoY(GUI_GetDispPosY() + 2);
    GUI_DispString("x:");
    GUI_DispDec(xPhys, 4);
    GUI_DispString(", y:");
    GUI_DispDec(yPhys, 4);
    //
    // Display the according position
    //
    GUI_SetColor(GUI_RED);
    GUI_GotoY(GUI_GetDispPosY() + 4);
    GUI_DispString("\nPosition:\n");
    GUI_GotoY(GUI_GetDispPosY() + 2);
    GUI_DispString("x:");
    GUI_DispDec(TouchState.x,4);
    GUI_DispString(", y:");
    GUI_DispDec(TouchState.y,4);
    //
    // Wait a while
    //
    GUI_Delay(100);
  };
}
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
    MYWIDGET_Handle hMyWidget;
    char            acExtraBytes[] = "Extrabytes";

    GUI_Init();
    //
    // Check if recommended memory for the sample is available
    //
    if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
        GUI_ErrorOut("Not enough memory available.");
        return;
    }
    hMyWidget = MYWIDGET_Create(10, 10, 100, 50, WM_HBKWIN, WM_CF_SHOW, NULL, _cbMyWidget, strlen(acExtraBytes));
    MYWIDGET_SetUserData(hMyWidget, acExtraBytes, strlen(acExtraBytes));
    BUTTON_Create(10, 100, 100, 50, 0, WM_CF_SHOW);
    while (1) {
        GUI_Delay(100);
    }
}
Пример #17
0
/*
  *******************************************************************
  *
  *              main()
  *
  *******************************************************************
*/
void MainTask_test(void) {
  int Cnt =0;
  int i,YPos;
  int LCDXSize = LCD_GET_XSIZE();
  int LCDYSize = LCD_GET_YSIZE();
  const GUI_BITMAP *pBitmap;
  GUI_Init();
  GUI_SetBkColor(GUI_RED); GUI_Clear();
  GUI_Delay(1000);
  GUI_SetBkColor(GUI_BLUE); GUI_Clear();
  GUI_Delay(1000);
  GUI_SetColor(GUI_WHITE);
  for (i=0; i<1000; i+=10) {
    GUI_DrawHLine(i,0,100);
    GUI_DispStringAt("Line ",0,i);
    GUI_DispDecMin(i);
  }
  GUI_Delay(1000);
  GUI_SetColor(0x0);
  GUI_SetBkColor(0xffffff);
  for (i=0; i<160; i++) {
    int len = (i<80) ? i : 160-i;
    GUI_DrawHLine(i,20,len+20);
  }
  GUI_Delay(1000);
  GUI_Clear();
  if (LCD_GET_YSIZE()>(100+bmMicriumLogo_1bpp.YSize)) {
    pBitmap=&bmMicriumLogo;
  } else {
    GUI_SetColor(GUI_BLUE);
    pBitmap=&bmMicriumLogo_1bpp;
  }
  GUI_DrawBitmap(pBitmap,(LCDXSize-pBitmap->XSize)/2,10);
  YPos=20+pBitmap->YSize;
  GUI_SetFont(&GUI_FontComic24B_1);
  GUI_DispStringHCenterAt("www.micrium.com",LCDXSize/2,YPos);
  GUI_Delay(1000);
  GUI_SetColor(GUI_RED);
  GUI_DispStringHCenterAt("© 2004\n", LCDXSize/2,YPos+30);
  GUI_SetFont(&GUI_Font10S_1);
  GUI_DispStringHCenterAt("Micriµm Inc.",LCDXSize/2,YPos+60);;
  GUI_Delay(1000);
}
Пример #18
0
//............................................................................
QState Table::initial(Table *me, QEvt const *) {

    QS_OBJ_DICTIONARY(&l_table);
    QS_FUN_DICTIONARY(&QHsm::top);
    QS_FUN_DICTIONARY(&Table::initial);
    QS_FUN_DICTIONARY(&Table::serving);

    QS_SIG_DICTIONARY(DONE_SIG,      0);                     // global signals
    QS_SIG_DICTIONARY(EAT_SIG,       0);
    QS_SIG_DICTIONARY(PAUSE_SIG, 0);

    QS_SIG_DICTIONARY(HUNGRY_SIG,    me);             // signal just for Table

    GUI_Init();                                 // initialize the embedded GUI

    me->subscribe(DONE_SIG);
    me->subscribe(PAUSE_SIG);

    return Q_TRAN(&Table::ready);
}
Пример #19
0
/*******************************************************************
*
*       MainTask
*/
void MainTask(void) {
  int xPos, yPos, xSize;
  int i = 0;

  GUI_Init();
  xPos = LCD_GetXSize() / 2;
  yPos = LCD_GetYSize() / 3;
  GUI_SetTextMode(GUI_TM_REV);
  GUI_SetFont(GUI_FONT_20F_ASCII);
  GUI_DispStringHCenterAt("Hello world!", xPos, yPos);
  GUI_SetFont(GUI_FONT_D24X32);
  xSize = GUI_GetStringDistX("0000");
  xPos -= xSize / 2;
  yPos += 24 + 10;
  while (1) {
    GUI_DispDecAt( i++, xPos, yPos, 4);
    if (i > 9999) {
      i = 0;
    }
  }
}
Пример #20
0
int main(void)
{
    uint32_t i;
    DelayInit();
    GPIO_QuickInit(HW_GPIOE, 6, kGPIO_Mode_OPP);
    UART_QuickInit(UART0_RX_PD06_TX_PD07, 115200);
    
    printf("flexbus lcd test\r\n");
    GUI_Init();
    GUI_DispString("ucGUI");
    GUI_DispString(GUI_GetVersionString());
    GUI_DispString("\r\nHello world!");
    while(1) 
    {
        GUI_DispDecAt( i++, 20,20,4);
        if (i>9999)
        {
            i=0;
        }
    }
}
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  GUI_Init();
  //
  // Check if recommended memory for the sample is available
  //
  if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
    GUI_ErrorOut("Not enough memory available."); 
    return;
  }
  #if GUI_SUPPORT_MEMDEV
    WM_SetCreateFlags(WM_CF_MEMDEV);
  #endif
  GUI_CURSOR_Show();
  WM_SetCallback(WM_HBKWIN, _cbBkWin);
  while(1) {
    _DemoMultiedit();
    *_acInfoText = 0;
    WM_InvalidateWindow(WM_HBKWIN);
    GUI_Delay(SPEED);
  }
}
void MainTask(void) {
  WM_HWIN hItem, hDlg;

  GUI_Init();
  #if GUI_SUPPORT_CURSOR
    GUI_CURSOR_Show();
  #endif
  #if GUI_SUPPORT_MEMDEV
    WM_SetCreateFlags(WM_CF_MEMDEV);
  #endif
  hDlg = GUI_CreateDialogBox(_aMain, GUI_COUNTOF(_aMain), &_cbMain, 0, 0, 0);
  hItem = WM_GetDialogItem(hDlg, GUI_ID_TREEVIEW0);
  if (hItem == 0) {
    WM_DeleteWindow(hDlg);
  } else {
    WM_SetFocus(hItem);
    while (1) {
      GUI_Delay(100);
    }
  }
}
Пример #23
0
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  int Value = 0;
  WM_HWIN hDlgFrame;
  GUI_Init();
  WM_SetCallback(WM_HBKWIN, _cbBkWindow);  
  WM_SetCreateFlags(WM_CF_MEMDEV);  /* Use memory devices on all windows to avoid flicker */
  while(1) {
    WM_HWIN hDlg, hText;
    char acText[3] = {0};
    GUI_Delay(150);
    if (!WM_IsWindow(hDlgFrame)) {
      hDlgFrame = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbCallback, 0, 0, 0);
    }
    Value = (Value + 1) % 100;
    acText[0] = '0' + Value / 10;
    acText[1] = '0' + Value % 10;
    hDlg = WM_GetClientWindow(hDlgFrame);
    hText = WM_GetDialogItem(hDlg, GUI_ID_TEXT0);
    TEXT_SetText(hText, acText);
  }
}
void MainTask(void) {
  WM_HWIN hWin;

  GUI_Init();
  //
  // Check if recommended memory for the sample is available
  //
  if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
    GUI_ErrorOut("Not enough memory available."); 
    return;
  }
  GUI_CURSOR_Show();
  WM_SetCreateFlags(WM_CF_MEMDEV);
  WM_EnableMemdev(WM_HBKWIN);
  WM_SetCallback(WM_HBKWIN, &_cbBkWindow);
  while (1) {
    hWin = GUI_CreateDialogBox(_aDialogOrder, GUI_COUNTOF(_aDialogOrder), &_cbDialogOrder, WM_HBKWIN, 0, 0); 
    WM_MakeModal(hWin);
    GUI_ExecCreatedDialog(hWin);
    GUI_Delay(1500);
  }
}
Пример #25
0
/*********************************************************************
*
*       MainTask
*/
void MainTask_TOUCHCAL(void) {
  int aPhysX[2], aPhysY[2], aLogX[2], aLogY[2], i;
  GUI_Init();
  GUI_SetBkColor(GUI_WHITE);
  GUI_Clear();
  GUI_SetColor(GUI_BLACK);
  GUI_SetFont(&GUI_Font13B_ASCII);
  _Explain();
  /* Set the logical values */
  aLogX[0] = 15;
  aLogY[0] = 15;
  aLogX[1] = LCD_GetXSize() - 15;
  aLogY[1] = LCD_GetYSize() - 15;
  /* Get the physical values of the AD converter for 2 positions */
  for (i = 0; i < 2; i++) {
    _GetPhysValues(aLogX[i], aLogY[i], &aPhysX[i], &aPhysY[i], _acPos[i]);
  }
  /* Use the physical values to calibrate the touch screen */
  GUI_TOUCH_Calibrate(0, aLogX[0], aLogX[1], aPhysX[0], aPhysX[1]); /* Calibrate X-axis */ //如果我们要存到外部存储器中 那么就存储这里的8个参数
  GUI_TOUCH_Calibrate(1, aLogY[0], aLogY[1], aPhysY[0], aPhysY[1]); /* Calibrate Y-axis */
  /* Display the result */
  GUI_CURSOR_Show();
  GUI_Clear();
  _DispStringCentered("Congratulation, your\n"
                      "touch screen has been\n"
                      "calibrated. Please use\n"
                      "the cursor to test\n"
                      "the calibration...");
  /* Let the user play */
  while(1) {
    GUI_PID_STATE State;

    GUI_TOUCH_GetState(&State);
    if (State.Pressed == 1) {
      GUI_FillCircle(State.x, State.y, 3);
    }
    GUI_Delay(10);
  }
}
Пример #26
0
int main(void)
{
    DelayInit();
    GPIO_QuickInit(HW_GPIOE, 6, kGPIO_Mode_OPP);
    SRAM_Init();
    UART_QuickInit(UART0_RX_PD06_TX_PD07, 115200);
    GUI_Init();
    GUI_DispString("BMP file test\r\n");
    GUI_DispString("please insert SD card...\r\n");
    SD_QuickInit(10*1000*1000);
    printf("SD size:%dMB\r\n", SD_GetSizeInMB());
    FATFS fs_sd;
    FATFS *fs = &fs_sd;
    /* 挂载文件系统 */
    f_mount(fs, "0:", 0);
    
    while(1)
    {
        scan_files("0:");
        GPIO_ToggleBit(HW_GPIOE, 6);
    }
}
Пример #27
0
/*************************************************************************************
  * 函数名称:main()
  * 参数    :void
  * 返回值  :void
  * 描述    :程序主入口main函数
  *************************************************************************************/
int main(void)
{   
    u16 i,j;   
	u16 t=0;
	
 /*****************************初始化****************************************/   		                                   //初始化系统时钟,设置时钟为168Mhz
//  	LED_Init();
  	SysTick_Init(168); 
    TIM4_Init();
//    TIM3_init();//pwm	
	TIM5_PWM_Init();
	TIM5_PWM_OUTPUT(40,20,10,50);
    COM6_Init(115200);//串口6初始化
	
	bsp_InitDAC();//这样初始化adc和dac不会出问题
	bsp_InitADC();
	bsp_InitDAC();
  	TFTLCD_Init();
    Touch_Init();

	//EXTI_Configuration();
	GUI_Init(); //GUI 初始化 
	GUI_Clear();
	Timer2_Init(20);	//初始化LED的GPIO配置
	WaveTaskCreat();
	while(1)
	{  
		if(Wave_updat == 1)
		{
			Get_Signal();
			//Clculate_Signal();
			
		}
		Updata_signal();

	
		GUI_Exec();
	}
}
Пример #28
0
int main(void)
{	
	
		OS_CPU_SysTickInit(CLKPWR_GetCLK(CLKPWR_CLKTYPE_CPU) / 1000 - 1);

		Board_Init();
	
	
		
		//KeyInit();
	
		GUI_Init();
	
		Display_Logo();
		
	
	/* init phy */
    PHY_Init(optionSaveStruct.ipConfig.mac);
		
		M25P128_SSP_Init();
	
		GT21L16S2W_SSP_Init();
		
		
#if	FRMB_DEBUG		
		LPC_Uart_Init(1200*(0x01<<optionSaveStruct.uartConfig[2]),1200*(0x01<<optionSaveStruct.uartConfig[3]),1200*(0x01<<optionSaveStruct.uartConfig[4]),1200*(0x01<<optionSaveStruct.uartConfig[5]));
#endif
	
		System_Time_Init();		 									   /*   Init RTC    */

		OSInit();

    OSTaskCreate ( TaskStart,(void *)0,&GstkStart[TASK_START_STK_SIZE-1],TASK_START_PRIO );     /*  Initialize the start task   */
                                                                   /*  Start OS Schedule         */  
    OSStart();                                                     /*  Start uC/OS-II ??uC/OS-II */
    return(0);	
	
}
Пример #29
0
//@@@@@@@@@@@@@@@@@@@@@@  MAIN  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
void Main(void)
{
int i=0,j=0;


GUI_Init();
GUI_SetBkColor(GUI_GREEN);
GUI_Clear();
GUI_SetColor(GUI_BLACK);
point.x_point=20;point.y_point=20;
draw_net();
draw_point();
draw_curcolor(270,50,1);

while(1)
{
store_x=point.x_point;
store_y=point.y_point;


//Button();
key_s3c();
change_point();
draw_point();

if( (store_x!=point.x_point)||(store_y!=point.y_point) )
delete_point();

draw_map();
change_color();
draw_curcolor(270,50,point.color);
change_color();


GUI_Delay(3000);
}

}
Пример #30
0
void MainTask(void) {
  GUI_Init();
  GUI_SetBkColor(GUI_BLACK);
  WM_SetCreateFlags(WM_CF_MEMDEV);
  WM_EnableMemdev(WM_HBKWIN);
  while (1) {
    _DemoSetDesktopColor();
    _DemoCreateWindow();
    _DemoCreateWindowAsChild();
    _DemoInvalidateWindow();
    _DemoBringToTop();
    _DemoMoveTo();
    _DemoBringToBottom();
    _DemoMoveWindow();
    _DemoHideShowParent();
    _DemoHideShowChild();
    _DemoClipping();
    _DemoRedrawing();
    _DemoResizeWindow();
    _DemoSetCallback();
    _DemoDeleteWindow();
  }
}