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.

Compiler/TMS320F28379D: Add a Sensor API to the project

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Tool/software: TI C/C++ Compiler

Hey there,

I'm new to microcontrollers, so go easy on me :)

My goal is to use a sensor via I2C protocol on my TI Controller. I use a example project from the resourcce explorer as base. Should I use bitfield or driverlib examples? The sensor is the VL6180X time of flight laser sensor. On the linked page there is an API that should help the enduser with different .h and .c files, so you just call a function like VL6180X_GetRange() and with everything initialized and working it should handle the I2C protocol and etc.

My first big problem was, that CCS is apparently not capable to include these files in a project via the project include function. I tried everything, Compiler, linker, I added every patch and even the files by themselves but while compiling CCS could just not find them. The solution was to add the files manually on the highest level in the project and now voila. Whats the matter with this?!?!

My second problem is that I am not able to compile the project including the API without errors. According to this integration guide, it needs some porting but I don't know what to do anymore. One of my biggest errors are from this type:

#258 invalid redeclaration of type name "uint32_t" (declared at line 70 of "C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-c2000_20.2.1.LTS/include/sys/_stdint.h")    vl6180x_types.h    /alaub_mark02    line 74    C/C++ Problem

One can download the VL6180X_types.h file from the first link, I might try to upload it directly in here.

So the problem relies on these double declarations of the type lengths. I changed them accordingly but it just wont work. Has anyone an idea?

vl6180x_types.h

  • Hi Alexander,

    The example code you have is intended for one of STM's Nucleo boards. It won't work directly with a C2000 device and will take some porting effort.

    I'd recommend installing C2000WARE and taking a look at the I2C driverLib examples and functions for I2C. Then you can try to replicate what is done in the VL6180X software example and protocol on the C2000 device's I2C using the driverLib functions.

    You can find I2C driverLib examples to import into CCS at the below C2000WARE directory:

    C:\ti\c2000\C2000Ware_3_02_00_00\driverlib\f2837xd\examples\cpu1\i2c

    Best,

    Kevin