Graphics Library Migration from MSP432Ware
Introduction
The following migration guide is intended for MSP32 Graphics Library users who are upgrading from version 3_21_00_00
to a later version.
MSP432 Graphics Library versions 3_30_00_xx
and later require updated LCD Driver files.
WHY is the LCD driver update needed?
The graphics library core files were updated for the initial SDK release. The purpose of these updates is to minimize the software porting effort between Texas Instruments microcontroller products with SDK support. The changes in the graphics library require updates to old LCD driver files.
Refer to Updating LCD driver file to SDK compliant driver files for further instructions.
Updating a CCS graphics library project
To migrate to the SDK-provided Graphics Library,
Delete any Graphics Library source or linked .a files in an existing project.
RemoveGrlib\grlib
RemoveGrlib\fonts
In Project-> Properties -> Build -> MSP432 Compiler -> Include options:
Under “Add dir to #include search path (–include_path, -I)”:
Remove"${PROJECT_ROOT}/GrLib/grlib"
Remove"${PROJECT_ROOT}/GrLib/fonts"
If your project uses Graphics Library fonts
Determine fonts used in your project by searching for the following APIs:
-Graphics_setFont
-GrContextFontSet
For each occurrence of the font that is found, add the following include statement on the top of its source file:
-#include "ti/grlib/fonts/<font>.c"
For example, if you find:Graphics_setFont(&g_sContext,&g_sFontFixed6x8)
Add:#include "ti/grlib/fonts/fontfixed6x8.c"
Next, go to Project -> Properties -> Build -> MSP432 Linker -> File Search Path:
Under “Include library file or command file as input (–library, -l)”, add the line below:
"${COM_TI_SIMPLELINK_MSP432_SDK_INSTALL_DIR}/source/ti/grlib/ccs/grlib.lib"
See the image below for how to link Graphics Library.
After Graphics Library is linked in your project, you will also need to change the Graphics Library include path to point to the SDK-provided files.
- In all project source files, find all occurrences of
#include grlib.h
Replace with#include <ti/grlib/grlib.h>
Migrating Graphics Library from MSP432Ware to MSP432 SDK also requires changes in LCD Drivers,
- Refer to Updating LCD driver file to SDK compliant driver files for further instructions.
Updating a IAR graphics library project
To migrate to the SDK-provided Graphics Library,
Delete any Graphics Library source or linked .a files in an existing project.
RemoveGrlib\grlib
RemoveGrlib\fonts
Remove existing Driver Library include paths
In Project-> Options… -> C/C++ Compiler -> Preprocessor -> Additional include directories:
Remove$PROJ_DIR$\...\GrLib\grlib
Remove$PROJ_DIR$\...\GrLib\fonts
If your project uses Graphics Library fonts
Determine fonts used in your project by searching for the following APIs:
-Graphics_setFont
-GrContextFontSet
For each occurrence of the font that is found, add the following include statement on the top of its source file:
-#include "ti/grlib/fonts/<font>.c"
For example, if you find:Graphics_setFont(&g_sContext,&g_sFontFixed6x8)
Add:#include "ti/grlib/fonts/fontfixed6x8.c"
Next, go to Project -> Options… -> Linker
Under “Additional Libraries”, add the line below:
$SIMPLELINK_MSP432_SDK_INSTALL_DIR$/source/ti/grlib/iar/grlib.a
See the image below for how to link Graphics Library.
After Graphics Library is linked in your project, you will also need to change the Graphics Library include path to point to the SDK-provided files.
- In all project source files, find all occurrences of
#include grlib.h
Replace with#include <ti/grlib/grlib.h>
Migrating Graphics Library from MSP432Ware to MSP432 SDK also requires changes in LCD Drivers,
- Refer to Updating LCD driver file to SDK compliant driver files for further instructions.
Updating a Keil graphics library project
To migrate to the SDK-provided Driver Library,
Delete any Graphics Library source or linked .a files in an existing project.
Remove\grlib\
Remove\fonts\
Remove existing Driver Library include paths
In Project-> Options… -> C/C++ -> Include Paths:
Remove..\GrLib\grlib
Remove..\GrLib\fonts
If your project uses Graphics Library fonts
Determine fonts used in your project by searching for the following APIs:
-Graphics_setFont
-GrContextFontSet
For each occurrence of the font that is found, add the following include statement on the top of its source file:
-#include "ti/grlib/fonts/<font>.c"
For example, if you find:Graphics_setFont(&g_sContext,&g_sFontFixed6x8)
Add:#include "ti/grlib/fonts/fontfixed6x8.c"
- Create a group called
Library
- Right-click on the newly created
Library
group and selectAdd Existing Files to Group 'Library'...
- Browse to
<SDK_install_path>/source/ti/grlib/keil/
- Make sure to change
File of Type
toLibrary file (*.lib)
Add
grlib.lib
See the image below for how to link Graphics Library.
After Graphics Library is linked in your project, you will also need to change the Graphics Library include path to point to the SDK-provided files.
- In all project source files, find all occurrences of
#include grlib.h
Replace with#include <ti/grlib/grlib.h>
Migrating Graphics Library from MSP432Ware to MSP432 SDK also requires changes in LCD Drivers,
- Refer to Updating LCD driver file to SDK compliant driver files for further instructions.
Updating LCD driver file to SDK compliant driver files
If your application is using TI provided LCD drivers (Crystalfontz128x128, Kitronix320x240x16_ssd2119_spi, Sharp96x96)
1. Replace driver files .c and .h with the update drivers provided in <SDK_INSTALL_DIR>/examples/
2. Go to Step3 below.
Otherwise, if you have created custom LCD driver files, please start from Step1 below to manually update your LCD drivers.
Instructions to update existing Graphics Library applications
Step1. Split the Graphics_Display global constant into two global variable/constant, Graphics_Display and Graphics_Display_Functions in your driver *.c file.
For example inside LcdDriver/Crystalfontz128x128.c, split the Graphics_Display global constant into two global variable/constant, Graphics_Display and Graphics_Display_Functions.
Inside LcdDriver/Crystalfontz128x128.h:
Step2.- Replace all instances of void pvDisplayData with const Graphics_Display pDisplay in the LCD function parameters.
For example, inside /LcdDriver/Crystalfontz128x128.c