void SAMAPP_API_Screen(char *str) { Ft_Gpu_CoCmd_Dlstart(phost); Ft_App_WrCoCmd_Buffer(phost,CLEAR_COLOR_RGB(255,255,255)); Ft_App_WrCoCmd_Buffer(phost,CLEAR(1,1,1)); Ft_App_WrCoCmd_Buffer(phost,COLOR_RGB(0x80,0x80,0x00)); Ft_Gpu_CoCmd_Text(phost,(FT_DispWidth/2), FT_DispHeight/2, 31, OPT_CENTERX, str); Ft_App_WrCoCmd_Buffer(phost,DISPLAY()); Ft_Gpu_CoCmd_Swap(phost); Ft_App_Flush_Co_Buffer(phost); // Download the commands into fifo Ft_Gpu_Hal_WaitCmdfifo_empty(phost); //Wait till coprocessor completes the operation Ft_Gpu_Hal_Sleep(5000); }
void smartMirror(){ uint32 ReadWord; int16 xvalue,yvalue; printf("Smart Mirror mode"); Ft_Gpu_CoCmd_Dlstart(phost); Ft_App_WrCoCmd_Buffer(phost,CLEAR_COLOR_RGB(64,64,64)); Ft_App_WrCoCmd_Buffer(phost,CLEAR(1,1,1)); Ft_App_WrCoCmd_Buffer(phost,COLOR_RGB(255,255,255)); Ft_Gpu_CoCmd_Button(phost, 10, 200, 130, 30, 28, 0, "Back"); if(!saved){ Ft_Gpu_CoCmd_Button(phost, 200, 200, 110, 30, 28, 0, "Save data"); } else{ Ft_Gpu_CoCmd_Button(phost, 200, 200, 110, 30, 28, 0, "Saved"); } Ft_Gpu_CoCmd_Text(phost, 10, 40, 26, 0, "SMART MIRROR SCREEN"); ReadWord = Ft_Gpu_Hal_Rd32(phost, REG_TOUCH_DIRECT_XY); yvalue = (int16)(ReadWord & 0xffff); xvalue = (int16)((ReadWord>>16) & 0xffff); if(xvalue > 70 && xvalue < 460 && yvalue > 70 && yvalue < 190){ printf("Back \n"); screenNR = 1; } else if(xvalue > 630 && xvalue < 950 && yvalue > 70 && yvalue < 190){ saved = !saved; printf("Save Data = %i\n", saved); } else printf("x = %i y = %i\n", xvalue, yvalue); Ft_App_WrCoCmd_Buffer(phost,DISPLAY()); Ft_Gpu_CoCmd_Swap(phost); /* Download the commands into fifo */ Ft_App_Flush_Co_Buffer(phost); /* Wait till coprocessor completes the operation */ Ft_Gpu_Hal_WaitCmdfifo_empty(phost); Ft_Gpu_Hal_Sleep(30); }
ft_void_t Ft_Gpu_Copro_SendCmd(Ft_Gpu_Hal_Context_t *phost,ft_uint32_t cmd) { #ifdef BUFFER_OPTIMIZATION Ft_App_WrCoCmd_Buffer(phost,cmd); #endif #ifdef ARDUINO_PLATFORM #ifdef ARDUINO_PLATFORM_COCMD_BURST Ft_Gpu_Hal_Transfer32(phost,cmd); #else Ft_Gpu_Hal_WrCmd32(phost,cmd); #endif #endif }
void mainScreen(void){ uint32 ReadWord; int16 xvalue,yvalue; ft_char8_t StringArray[100]; Ft_Gpu_CoCmd_Dlstart(phost); Ft_App_WrCoCmd_Buffer(phost,CLEAR_COLOR_RGB(64,64,64)); Ft_App_WrCoCmd_Buffer(phost,CLEAR(1,1,1)); Ft_App_WrCoCmd_Buffer(phost,COLOR_RGB(255,255,255)); Ft_Gpu_CoCmd_Button(phost, 10, 200, 130, 30, 28, 0, "Smart Mirror"); if(!saved){ Ft_Gpu_CoCmd_Button(phost, 200, 200, 110, 30, 28, 0, "Save data"); } else{ Ft_Gpu_CoCmd_Button(phost, 200, 200, 110, 30, 28, 0, "Saved"); } StringArray[0] = '\0'; strcat(StringArray,"Outside: "); Ft_Gpu_Hal_Dec2Ascii(StringArray,(ft_int32_t)tempOut); strcat(StringArray," C"); Ft_Gpu_CoCmd_Text(phost, 10, 20, 26, 0, StringArray); StringArray[0] = '\0'; strcat(StringArray,"Inside: "); Ft_Gpu_Hal_Dec2Ascii(StringArray,(ft_int32_t)tempIn); strcat(StringArray," C"); Ft_Gpu_CoCmd_Text(phost, 10, 40, 26, 0, StringArray); StringArray[0] = '\0'; strcat(StringArray,"Engine: "); Ft_Gpu_Hal_Dec2Ascii(StringArray,(ft_int32_t)tempEngine); strcat(StringArray," C"); Ft_Gpu_CoCmd_Text(phost, 10, 60, 26, 0, StringArray); StringArray[0] = '\0'; strcat(StringArray,"GPS: "); Ft_Gpu_CoCmd_Text(phost, 220, 20, 26, 0, StringArray); ReadWord = Ft_Gpu_Hal_Rd32(phost, REG_TOUCH_DIRECT_XY); yvalue = (int16)(ReadWord & 0xffff); xvalue = (int16)((ReadWord>>16) & 0xffff); if(xvalue > 70 && xvalue < 460 && yvalue > 70 && yvalue < 190){ printf("Smart mirror \n"); screenNR = 2; } else if(xvalue > 630 && xvalue < 950 && yvalue > 70 && yvalue < 190){ saved = !saved; printf("Save Data = %i\n", saved); } else printf("x = %i y = %i\n", xvalue, yvalue); Ft_App_WrCoCmd_Buffer(phost,DISPLAY()); Ft_Gpu_CoCmd_Swap(phost); /* Download the commands into fifo */ Ft_App_Flush_Co_Buffer(phost); /* Wait till coprocessor completes the operation */ Ft_Gpu_Hal_WaitCmdfifo_empty(phost); Ft_Gpu_Hal_Sleep(30); }