This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How do I use the Graphics Library?

Other Parts Discussed in Thread: TM4C123GH6PM

Hi,

I am using a tm4c123gh6pm µcontroller and the LS027B7DH01LCD LCD Display. I am trying to use the TvaWare graphics library, but I am having some understanding problems how to correctly use the library. Right now I am trying to draw an image onto my display, the problem is that i don't really know how I'm supposed to do this. You can see the programm below.

#define SCRBUF_ZEILEN 400
#define SCRBUF_ZEILEN_LEN 50
#define SCRBUF_SIZE SCRBUF_ZEILEN_LEN*SCRBUF_ZEILEN

GrContextInit(&Context, &Display);
Context.i32Size = SCRBUF_SIZE;
Display.ui16Height = 240;
Display.ui16Width = 400;
/*
sRect.i16XMin = 0;
sRect.i16YMin = 0;
sRect.i16XMax = 100;
sRect.i16YMax = 100;
GrContextForegroundSet(&Context, ClrBlack);
GrRectFill(&Context, &sRect);
*/

GrImageDraw(&Context, ImageBuffer, 15, 15);
//GrFlush(&Context);

I'm not really sure if this is correct, but i declared both Context and Display globally. I'm also not so sure about the ImageBuffer array, do I have to write IMAGE_FMT_1BPP_COMP, in the array. I also don't understand the purpose of the void * pvDisplayData, I read that it points to a driver specific display driver, but what are those and do I need them?

If somebody can help me use the graphics library, I would be really thankful.

I would really appreciate help.

Best regards

  • Hello Marinkovic,

    Please have a look at the DK-TM4C123 Graphics example to initialize the Grlib driver using SSI interface. That is where you can use the existing code example and update the init procedure to reduce the overhead of doing the graphics lib and the drivers.

    Regards
    Amit