Packed 12bit Raw image file load to display to Nokia LCD. Add function "blit12" to Nokia LCD for native 12bit color buffer.

Dependencies:   mbed

main.cpp

Committer:
sakai
Date:
2011-02-10
Revision:
4:f746ea56e891
Parent:
3:8739f7e5148a

File content as of revision 4:f746ea56e891:

#include "mbed.h"
#include "NokiaLCD.h"
#include "SDFileSystem.h"

NokiaLCD lcd(p11, p13, p14, p15, NokiaLCD::LCD6610); // mosi, sclk, cs, rst, type
SDFileSystem sd(p5, p6, p7, p8, "sd");

int main() {
    lcd.background(0x000000);
    lcd.cls();
    FILE *fp = NULL;
    fp = fopen("/sd/128x128.r12", "r");
    if (fp != NULL) {
        printf("Start!\r\n");
        unsigned char bufLine[64 * 3 * 128];
        fread(bufLine, sizeof(unsigned char), (64 * 3 * 128), fp);
        lcd.blit12(0, 0, 128, 128, bufLine);
        fclose(fp);
        printf("Finish!\r\n");
    } else {
        printf("Can't open file.\r\n");
    }
}