Simple demo for the Raio RA8875 Based Display with a 4-wire SPI interface.

Dependencies:   mbed RA8875

You are viewing an older revision! See the latest version

Homepage

Table of Contents

    RA8875 Based Display Controller

    A basic library for this low cost display from buydisplay.com. The module supports I2C, 3-Wire SPI, 4-Wire SPI, 8-bit Parallel and 16-bit Parallel.

    The companion library supports the 4-Wire SPI.

    /media/uploads/WiredHome/img_20140116_211305_173.jpg

    Library

    RA8875 Library

    Sample Program

    #include "mbed.h"
    
    #include "RA8875.h"
    
    RA8875 lcd(p5, p6, p7, p12, NC, "tft");    // MOSI, MISO, SCK, /ChipSelect, /reset, name
    
    Serial pc(USBTX, USBRX);
    
    int main()
    {
        pc.baud(460800);    // I like a snappy terminal, so crank it up!
        pc.printf("\r\nRA8875 Test - Build " __DATE__ " " __TIME__ "\r\n");
        
        pc.printf("Turning on display\r\n");
        lcd.Reset();
        lcd.Power(true);  // display power is on, but the backlight is independent
        lcd.background(Black);
        lcd.foreground(Blue);
        lcd.cls();
        lcd.Backlight(1.0);
        
        lcd.puts(0,0, "Raio RA8875 Display Controller Library\r\n");
        lcd.puts("This library uses a 4-wire SPI interface.\r\n\r\n"
        "lcd.circle(       400,15,  15,    BrightRed);\r\n"
        "lcd.fillcircle(   440,15,  15,    RGB(128,255,128));\r\n"
        "lcd.ellipse(      400,50,  25,10,            BrightBlue);\r\n"
        "lcd.fillellipse(  440,50,  25,10,            Blue);\r\n"
        "lcd.triangle(     400,75,  430,90,  410,100, Magenta);\r\n"
        "lcd.filltriangle( 440,100, 480,120, 450,130, Cyan);\r\n"
        "lcd.rect(         400,150, 479,200,          Brown);\r\n"
        "lcd.fillrect(     410,160, 470,190,          Pink);\r\n"
        "lcd.roundrect(    405,200, 450,255, 10,16,   Yellow);\r\n"
        "lcd.fillroundrect(420,220, 435,250,  5,8,    RGB(10,30,50));");
    
        lcd.circle(       400,15,  15,               BrightRed);
        lcd.fillcircle(   440,15,  15,               RGB(128,255,128));
        lcd.ellipse(      400,50,  25,10,            BrightBlue);
        lcd.fillellipse(  440,50,  25,10,            Blue);
        lcd.triangle(     400,75,  430,90,  410,100, Magenta);
        lcd.filltriangle( 440,100, 480,120, 450,130, Cyan);
        lcd.rect(         400,150, 479,200,          Brown);
        lcd.fillrect(     410,160, 470,190,          Pink);
        lcd.roundrect(    405,200, 450,255, 10,16,   Yellow);
        lcd.fillroundrect(420,220, 435,250,  5,8,    RGB(10,30,50));
        while (1)
            ;
    }
    

    All wikipages