vedranMv / tm4c_mpu9250

MPU9250 library for TI's Tiva TM4C1294 with I2C/SPI and DMP
12 stars 1 forks source link

Implement for CC2640R2 #3

Open mel0nparty opened 4 years ago

mel0nparty commented 4 years ago

Hi I was wondering if this project can be implemented on a cc2640R2 launchpad. I tried to make the changes as advised to the HAL folder but I am unsure on how to port my specific board pin layout to the project.

I'm very new to CCS and am trying to use an IMU for a final year project but can only find this resource that relates to its use.

Thanks in advance!

vedranMv commented 4 years ago

Hi, it is possible, sure, but I don't have that board to try it on my own.

The idea of HAL layer is to provide your own implementation of the functions seen in hal/tm4c1294 folder. So you'd start by duplicating the tm4c1294 folder then renaming one of the copies to e.g. cc2640r2. Then, inside this new folder, you'd open every .c file, and change content of the functions so that is works on your board. Make sure you don't change any function parameters, logic, nor return values.

For example, in hal/cc2640r2/hal_mpu_spi_tm4c.c you find the function HAL_MPU_WriteBytes. That function must take exactly 3 arguments, in exactly the same order. You then change body of the function so that its functionality remains the same: write data in the arguments into a provided register, when done return 0. You would then repeat the same process for all remaining functions in the .c files.

I hope that helps :)