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

what is the difference between 'twi_sw_master.c' and 'twi_hw_master.c' ?

Hi.

I'm using nRF51 DK for developing a device.

and, I'm trying to use 24LC01B(external eeprom) by i2c.

Looking for code used for i2c, there are two *.c files, sw and hw.

There are same functions in two *.c files. (like 'bool twi_master_init(void)' and so on...)

what's the difference between them? and what should I use?

Parents
  • twi_sw_master.c is a software controlled twi driver, which means that SCL and SDA are set manually in software and timing is done with busy wait. twi_hw_master.c is a hardware controlled twi driver which use the twi peripheral on the chip.

    Use the hardware controlled twi driver, twi_hw_master.c. I think the software controlled driver is to be used if the twi peripheral is already occupied.

    If you are using newer SDK, I would recommend to use nrf_drv_twi.

  • Thanks for your answer!!!!! Thank you very much and merry x-mas :D

Reply Children
No Data
Related