Both Stellaris, Tiva, Tiva Connected and CC3200 uses the same framework and same libraries, only differ on GPIO and interrupts configuration. For this reason, I made a new example projects with shared dependencies like LCDBPV2 drivers: backlight, touch and LCD.
First, please check that you are able to import some example project (maybe "blink"). And train yourself with the workbook of your processor. Code Composer Studio configuration is relatively hard, but later this Eclipse based IDE is the most powerfull and friendly.
If you like to test code example from main article you need to install tivaware.
I use 5.1.6 version of ARM compiler, because it is the default in 6.0.X Code Composer Studio, but 6.1 use ARM 5.2. You can use any of them, but take a note that compiler version is downside compatible but not upside. If you have 5.1.X version of this compiler you cant import 5.2 code examples and you need to upgrade your CCS installation.
|project", "import CSS projects", "Select archive file", "browse"||"resource", "linked resources"||"Include options"||ARM compiler version error.|
LCDBPV2 code for all processors is in the same file and to select the right settings preprocessor directives are used. For this reason, you need to select the adjusts to fit your microprocessor.
There are four things you need to check into LCDBPV2_setup.h header file:
Comunication mode: #define SERIAL ***
This statement sets the comunication mode, uncomment it to select serial and leave it commented for parallel mode.
Depending on the microprocessor you use you can select different modes:
-Tiva Launchpad: parallel (plugged into boosterpack header) or serial
-Tiva Connected Launchpad: serial.
-CC3200 Launchpad: serial.
Microprocessor select: #define TIVA/TIVACONNECTED/CC3200 ***
This statement sets the used microcontroller.
I2C configuration: #define CONFIGURE_I2C
This statement is only for CC3200 microcontroller, for TIVA and TIVACONNECTED I2C is allways activated.
CC3200 projects usually activates I2C master driver to provide comunication with onboard sensors, for this reason I2C would be activated before LCDBPV2_setup() call and generates a conflict. If in your project I2C is not configurated before, uncomment this line, otherwise leave it commented.
Touch modes: LCDBPV2_setup(TOUCH_PERSISTENT_MOVE);
Touch can be used in three different ways and this mode can be set in LCDBPV2_setup() call:
-TOUCH_SIMPLE: Touch driver only take an action instantly after touch screen and when leaves screen, but not while pulsation is maintained.
-TOUCH_PERSISTENT_MOVE: Touch driver take an action instanctly after touch (WIDGET_MSG_PTR_UP), when touch leaves (WIDGET_MSG_PTR_DOWN) and when pulsation is maintained sending a "WIDGET_MSG_PTR_MOVE" message.
-TOUCH_PERSISTENT_DOWN: Touch driver take an action instanctly after touch (WIDGET_MSG_PTR_UP), when touch leaves (WIDGET_MSG_PTR_DOWN) and when pulsation is maintained sending a "WIDGET_MSG_PTR_DOWN" message.
To learn more about how Texas Instruments Graphics Library works please go to Tivaware Graphics Library user's guide.
|*** NOTE: Microprocessor select and Comunication mode are usually overrided by "predefined symbols" into project properties. Predefine a symbol means that every header and source file includes this sentences.|
By default touch callback function (the function that says to the microprocessor what they need to do when touch is handled) is "WidgetPointerMessage", the callback needed by Texas Instruments Graphics Library, and the function to set the callback is "TouchScreenCallbackSet()". Because "WidgetPointerMessage" is already called by default there is no need to call to "TouchScreenCallbackSet()" with WidgetPointerMessage again.
Override callback function
By calling "TouchScreenCallbackSet()" after "LCDBPV2_setup()" with new callback function as parameter you can override the callback function and modify the default behaviour.
At the right there is a capture of scribble example.
Scribble example uses a buffer to store touch messages and maybe is not absolutly clear example to learn, but the definitive function to handle touch callback is int32_t TSMainHandler(uint32_t ui32Message, int32_t i32X, int32_t i32Y)
|Microcontroller||Parallel mode||Serial mode|
|I2C SDA||I2C SCL||INT||EHA CLK||EHA CS||EHA D0||EHA D1|
|Tiva / Stellaris||Plug boosterpack||E5||E4||E0||C6||C7||C5||C4|
In serial mode don't forget to connect "Supply" header: 5V to 5V (Vbus on launchpad) and Gnd to Gnd.
ONLY IF YOU RECEIVED THE LCDBPV2 BEFORE 25 december 2013: Connect INT pin to 38 pin of HDR_F P11
Tiva / Stellaris launchpad page
Tiva connected launchpad page
CC3200 launchpad page
Please refer to "Microcontroller" section into main article to download Code Composer Studio zipped workspace package.
LCDBPV2 driver files are built into each project of the example code workspace package, but you can also link driver directory independly of workspace to allow the use of the same driver between projects and microcontrollers and have to modify driver files only one time.
To link LCDBPV2 driver files, first download zip from de link below and decompress it. Now copy it into some folder of your hard disk, i choose "C:\ti\LCDBPV2", and add a "path variable" with the name "LCDBPV2_ROOT" and Value "C:\ti\LCDBPV2".
Download LCDBPV2 driver