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

How to use old TWI API on SDK15.0.0?

Hi,

I have code for NRF51822 which used TWI form sdk 8.

Now I want to port it into NRF52840, but I have issues with using old TWI api.

They are located at path .. nRF5_SDK_1500\components\drivers_nrf\twi_master\deprecated\twi_master.h and I'm always have errors about udefined functions.

Should I use some extra define in preprocessor to use them?

Regards!

Parents
  • Hello,

    In SDK15 the sdk_config.h files are often used to define these, although you could probably do it in the preprocessor defines as well.

     

    I suggest that you look at the example found in:

    SDK15\examples\peripheral\twi_scanner

     

    in this project folder, you will find the file sdk_config.h under twi_scanner\pca10056\blank\config

     

    Look at how the defines under nRF_Drivers are defined. You should have both NRFX_TWI_ENABLED = 1 and TWI_ENABLED = 1. Depending on what functions you use, you may also need NRFX_TWIM_ENABLED = 1. You should see in the files that have the implementations that you want to use, that they have a line close to the top saying something like:

    #if NRFX_CHECK(NRFX_TWI_ENABLED)

    which will return true if NRFX_TWI_ENABLED is defined to 1, and so on.

     

    So try to include these defines in your sdk_config.h file.

     

    Best regards,

    Edvin

Reply
  • Hello,

    In SDK15 the sdk_config.h files are often used to define these, although you could probably do it in the preprocessor defines as well.

     

    I suggest that you look at the example found in:

    SDK15\examples\peripheral\twi_scanner

     

    in this project folder, you will find the file sdk_config.h under twi_scanner\pca10056\blank\config

     

    Look at how the defines under nRF_Drivers are defined. You should have both NRFX_TWI_ENABLED = 1 and TWI_ENABLED = 1. Depending on what functions you use, you may also need NRFX_TWIM_ENABLED = 1. You should see in the files that have the implementations that you want to use, that they have a line close to the top saying something like:

    #if NRFX_CHECK(NRFX_TWI_ENABLED)

    which will return true if NRFX_TWI_ENABLED is defined to 1, and so on.

     

    So try to include these defines in your sdk_config.h file.

     

    Best regards,

    Edvin

Children
No Data
Related