A real world migration from TI-RTOS to the POSIX API of TI SimpleLink.

Texas Instruments migrated from the proprietary TI-RTOS to the open POSIX API.

I'm migrating a project that extensively used the TI paradigms to that POSIX API. You're my witness.

The blog assumes that you are a TI-RTOS user and want to adapt to the new ways of working.

I know that LCD Display is two times the word display. Get over it.

This time the topic is SimpleLink and MSP432 DriverLib Display Driver related. Not POSIX specific, but an impact of switching to SimpleLink.

This is similar to the EEPROM API topic covered two posts ago.

 

It's going to be a short article because the impact of switching is easy.

The TI-RTOS distribution i was using for the black pre-production MSP432 LaunchPad didn't have an LCD driver. Someone backported it for that release:

 

this port was the work of: John Pocreva

https://e2e.ti.com/support/embedded/tirtos/f/355/t/552357

 

That backport was a great piece of work. I'm saying goodbye to it now though, because SimpleLink has the driver.

 

There's very little that changed. I have to initialise it differently and that's about it.

 

#include <ti/display/DisplayExt.h>

 

    Display_init();
    /* Initialize display and try to open LCD type of display. */
    Display_Params params;
    Display_Params_init(&params);
    params.lineClearMode = DISPLAY_CLEAR_BOTH;
//    Display_Handle hLcd = Display_open(Display_Type_LCD | Display_Type_GRLIB, ¶ms);
    Display_Handle hLcd = Display_open(Display_Type_LCD, &params);
    if (!hLcd) {
        return NULL; // we didn't get a display handle. Check if the following is defined: BOARD_DISPLAY_USE_LCD
    }
    Graphics_Context *context = DisplayExt_getGraphicsContext(hLcd);
    GrContextForegroundSet(context, ClrBlack);
    GrContextBackgroundSet(context, ClrWhite);


    GrClearDisplay(context);
    GrContextFontSet(context, &g_sFontCmss12);

    GrStringDraw(context, "The Breadboard", -1, 10, 15, 0);
    GrStringDraw(context, "Electronic Load", -1, 15, 30, 0);
    GrStringDraw(context, "Copyright Free", -1, 13, 45, 0);
    GrStringDraw(context, "Version 0", -1, 22, 60, 0);


    GrFlush(context);

 

(if you see strange text in this code, it means &params. The syntax highlighter on the forum is playing up lately)

 

That's actually it. By default the display works compatible with UART output. But you can use the graphic libs to draw, position, etc ...

Ah yes, define this symbol (in your project settings) if you want to compile the LCD code in the firmware:

 

BOARD_DISPLAY_USE_LCD

 

Related Blog
Switch from TI-RTOS to SimpleLink POSIX: Threads and Semaphores
Switch from TI-RTOS to SimpleLink POSIX: EEPROM API

Switch from TI-RTOS to SimpleLink POSIX: From MailBox to Message Queue

Switch from TI-RTOS to SimpleLink POSIX: LCD Display Driver
Switch from TI-RTOS to SimpleLink POSIX: Sleep when Idle