Forum Discussion
Altera_Forum
Honored Contributor
12 years agohi. i am trying to save a bitmap image to sram from sd card through sopc builder and nios2. my problem is i'm not sure if i can directly use alt_up_sd_card_read to read the file because it is a bitmap image. are they the same with reading text file?
and about this: --- Quote Start --- for(i=0;i<280;i++){for(j=40;j<320;j++) { byte_b=(unsigned char)(alt_up_sd_card_read(sd_fileh)); byte_g=(unsigned char)(alt_up_sd_card_read(sd_fileh)); byte_r=(unsigned char)(alt_up_sd_card_read(sd_fileh)); pixel=((byte_r>>3)<<11)|((byte_g>>2)<<5)|((byte_b>>3)<<0); IOWR_16DIRECT(SDRAM_BASE,(((i+80)*640+(j))-40),pixel); } --- Quote End --- can you explain this to me please? this is wrting to pixel memory, right? but how did you come up with this?