Are there any I2C examples for the nRF51822 ( write/ read functions) ? If not, can anyone suggest a good starting point for I2C? I am using Eclipse kepler for development. Thank you for all suggests.
Are there any I2C examples for the nRF51822 ( write/ read functions) ? If not, can anyone suggest a good starting point for I2C? I am using Eclipse kepler for development. Thank you for all suggests.
This won't work with Softdevices enabled - will it?
@clovett ,
i was seeing your wrapper you used twi_master_transfer both for reading and writing i2c data.
dont we need to use nrf_drv_twi_tx and nrf_drv_twi_rx as well ?
And what will be the twi initialization in this case ? tnx
My code is assuming the SoftDevice is available, so you must have called twi_master_init already, then my helper functions can work from there using twi_master_transfer. A read is also a "transfer" because you have to write the register address that you want to read from.
Ok, you are right, it looks like my code is using an older version of the Nordic sdk. The new examples that are bundled with Keil C use nrf_drv_twi_init and nrf_drv_twi_tx.
copy these files (.c,.h) to near Project main.c file and after that import to your project in Keil.