This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How do I add twi driver to Blinky app?

Hi

Env: keil and no SD

I am doing the first steps on keil + nordic nrf51822. I started by opening the Blinky app (C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Examples\11.0.0-2.alpha\peripheral\blinky\pca10028\blank\arm5) and it compiles well and runs well on the nrf51822 breakoutboard.

Now I would like to try I2C. I tryid to open Twi Sensr example app and comppiled it but 25 errors, where first one is: ..\..\main.c(22): error:  #20: identifier "NRF_DRV_TWI_TX_DONE" is undefined

So I decided to read manual and start to implement it step by step by "hand" havinf blinky app as the base.

So, I added #include "nrf_drv_twi.h" after existings:

#include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "nrf_gpio.h"
#include "boards.h"

#include "nrf_drv_twi.h"

but nrf_drv_twi.h is not known...

I checked C/C++ info and found Include Path:  ..\..

The file exists in folder:  C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\4.0.0-2.alpha\twi_master which is another branch...

I tried:

#include "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\4.0.0-2.alpha\twi_master\nrf_drv_twi.h" (which is not a good idea!)

but then nordic_common.h is not found (included bynrf_drv_twi.h)

 

My question is:

How to add include for nrf_drv_twi.h in blicky app?

Keil uVision 5.25

Thanks a lot

Alex

So the question s

Related