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

nrf_drv_twi dynamically adjust receiving length

Hi,

I am porting a NCI (Nfc Controller Interface) driver to the nRF52. One of the things I am struggling with is that, when reading from the device, the amount of data to be read is part of the first 3 bytes. Is it possible to set up a transfer of 250 bytes and the, after reading the first 3 bytes, downsizing to the right amount of bytes (which is part of these first 3 bytes) without interrupting the transfer?

Thanks and regards, Josef

Parents
  • It appears that it is possible to run the TWI in the legacy ( deprecated ) mode on the NRF52 so it should be OK using the original NRF51 code. For some reason Nordic now appears to have 3 separate I2C interface options, 2 using EZDMA ( 1 master and 1 slave ), and 1 like the NRF51 using interrupts, in reality they are 1 peripheral with 3 modes but Nordic could not even bother to keep them together in the datasheet so it's easy to not notice this point. As usual, the Nordic HW is good but let down by the poor documentation.

Reply
  • It appears that it is possible to run the TWI in the legacy ( deprecated ) mode on the NRF52 so it should be OK using the original NRF51 code. For some reason Nordic now appears to have 3 separate I2C interface options, 2 using EZDMA ( 1 master and 1 slave ), and 1 like the NRF51 using interrupts, in reality they are 1 peripheral with 3 modes but Nordic could not even bother to keep them together in the datasheet so it's easy to not notice this point. As usual, the Nordic HW is good but let down by the poor documentation.

Children
Related