This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

example for i2c and s132

Hello everyone,

there is so much i2c code in the nrf52_bitfields.h (s132).

Is there any example for i2c and s132?

Thanks!

Parents
  • There are several TWI examples in the SDK, and the most relevant is often the TWI Sensor Example, which uses the TWI master driver. The example does not use a SoftDevice, but you can use the exact same method in an application that use a SoftDevice.

    (TWI is the same as I2C, but there are legal reasons for not using that name.)

  • You can add C++ files and libraries to your Keil project. However, I am not sure it will make your job easier. Remember that you must interface with the TWI master peripheral on the nRF, and this is most easily done using the TWI master driver. I think you will use more time trying to port an existing driver for the MCP9808 to the nRF rather than just making your own "library" based on the TWI master driver and the specific code needed to configure and read temperature from the sensor (you can always find inspiration from other existing libraries).

Reply
  • You can add C++ files and libraries to your Keil project. However, I am not sure it will make your job easier. Remember that you must interface with the TWI master peripheral on the nRF, and this is most easily done using the TWI master driver. I think you will use more time trying to port an existing driver for the MCP9808 to the nRF rather than just making your own "library" based on the TWI master driver and the specific code needed to configure and read temperature from the sensor (you can always find inspiration from other existing libraries).

Children
No Data
Related