Hello all,
The sensor (VCNL4035) is connected and found by the nrf52dk. Indeed, the twi_sensor/scanner have been quickly recoded and it shows some progress...
The manufacturer provides the so-called code library where demos and access to the registers is quick via the functions ... can be found on the manufacturers webpage...
Indeed, the i2c_functions are given, but of course not for the nRF52 dk , so , I am trying to workout the i2c/twi by myself, but got stuck...
In the manual of the library this is the order that should be followed with regard to the other uC:
- Create a new project in your selected IDE (DONE)
- Configure the required pinouts, the I2C components as well as the USB CDC components (DONE) btw what is meant by the USB CDC components?
- Open the “C” folder / “C++” folder (DONE)
- Add the following files into the IDE: (DONE)
- I2C_Functions.c/cpp
- “Part Name”_Application _Library.c/cpp, “Part Name”_PS.c/cpp, “Part Name”_ALS.c/cpp, “Part Name”_RGB.c/cpp
- typedefinition.h
- I2C_Functions.h
- “Part Name”_Application_Library.h, “Part Name”.h, “Part Name”_Prototypes.h
- Step 5: Add the I2C API code of your MCU into I2C_Functions.c/cpp or I2C_Functions.h within the #ifdef #endif identifier statement of your MCU. Please ensure that the restart condition is implemented correctly for the I2C read command
- Step 6: Activate the MCU-specific code in the files I2C_Functions.c/cpp, I2C_Functions.h, and “Part Name”_Application_Library.c/cpp by defining #define (write your MCU name) in typedefinition.h
I got to the step 5, in addition, I have setup the twi_inti, twi_handlers... however, I am stuck at the step 5!
As you can see from the above it is required to add the TWI / I2C API ... here I am not sure what / how to use ... do you have any ideas ? Indeed, the step 6 will as well be of importance.
Any help , ideas how to handle this is very much appreciated!
Best.