/// the library you have is shit. 
/// not sure what isnt working at this point i think i may have to 
/// humm
int main(void)
{
	FILE lcd_str = FDEV_SETUP_STREAM(TerminalChar, NULL, _FDEV_SETUP_RW);
	stdout = &lcd_str;

	struct LCD_Geometry *pointCurrent= &Current;
	struct LCD_Properties *pointProperties= &Properties;
	pointProperties->Rotation= 0;
	//ILI9481_Initalize();
SSD1289_Initalize();
	testLibrary(); 


}
Пример #2
0
int main(void)
{
	struct LCD_Geometry *pointCurrent= &Current;
	struct LCD_Properties *pointProperties= &Properties;
	FILE lcd_str = FDEV_SETUP_STREAM(TerminalChar, NULL, _FDEV_SETUP_RW);
	//FILE lcd_str = FDEV_SETUP_STREAM(USART_send, NULL, _FDEV_SETUP_RW);
	char *hellow = "hello";
	stdout = &lcd_str;

	USART_init();
	SPI_MasterInit();
	SSD1289_Initalize();
	

	
	testLibrary(); 

		
	//ReadBMP_ARRAY(40,40,BMP_IMAGE);
}
// program entry point
int main()
{   
    int errCode; 
	struct LCD_Geometry *pointCurrent= &Current;
    struct LCD_Properties *pointProperties = &Properties;
    FILE lcd_str = FDEV_SETUP_STREAM(TerminalChar, NULL, _FDEV_SETUP_RW);
    stdout = &lcd_str;
	
	FRESULT rc;				/* Result code */
	DIR dir;				/* Directory object */
	FILINFO fno;			/* File information object */
	UINT bw, br, i;
	
   	USART_init();
   	SPI_MasterInit();
   	
   	SSD1289_Initalize();
	  
   	UTouch_InitTouch(0);
    LCD_Fill_Rectangle(0,0, 320,240,0x000000);
    terminalemulator();
    Terminal_Set_Properties(2, 1, 0xFFFFFF);
	//while(1) 	{ Paint_Program();}
	    
	printf("Serial Default Output");
	/* Init the MMC */
	printf("mmc_init\n");
	 //disk_initialize(0);
	mmc_init();
	
	
	
	/// Drive must be mounted before use  // Drive 0 - signifies SD System 
	/// Halt on anything other than mounting system okay
	errCode = f_mount(0, &filesystem);
	if (errCode != FR_OK)
	{
		printf("Error: f_mount failed, error code: %d\r", errCode);
		printf("Please refer to error list"); 
		while (1); // freeze
	}
	
	printf("\n Mounted File System: Type SD");
	// Draw BMP	
	
	printf("\nCreate a new file (hello.txt).\n");
	rc = f_open(&file, "HELLO.TXT", FA_WRITE | FA_CREATE_ALWAYS);
	
	printf("\nWrite a text data. (Hello world!)\n");
	rc = f_write(&file, "Hello world!\r\n", 14, &bw);
	printf("%u bytes written.\n", bw);

	printf("\nClose the file.\n");
	rc = f_close(&file);

	while(1){
		//printf("\nOpen root directory.\n");
		rc = f_opendir(&dir, "");
		
		//printf("\nDirectory listing...\n");
		for (;;) {
			rc = f_readdir(&dir, &fno);		/* Read a directory item */
			if (rc || !fno.fname[0]) break;	/* Error or end of dir */
		
			if (fno.fattrib & AM_DIR)
				printf("   <dir>  %s\n", fno.fname);
			else
				{
				//printf("%8lu  %s\n", fno.fsize, fno.fname);
				draw_bmp(0,0,fno.fname);
				}
		
		}
	}
}