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

Code for multiple interfaces (I2C, UART, and USB)

I am currently using the ble_app_uart example but I want to add USB and I2C interface to this solution. Would I need to find what files differ/need to be added from USB and 12C examples in the peripheral folder and incorporate those? Or would I also have to change pin mapping, memory, etc.?

  • It's no different from any other situation where you have multiple sources of data, and a single comms link.

    You will need to have something that collects all the data from all the sources, marshals it, and then sends it over the link in an orderly fashion. 

  • Hello again Dan,

    Sorry for my terribly late reply - I have been out of office for some time.

    Are you still experiencing any issues, or is something still unclear?

    What Awneil said in regards to how you should setup your communication is correct. I assume that you by now have taken a look at the Nordic UART example that I referenced, and seen how it works. By implementing the approach Awneil outlines, you could schedule the data for BLE transfer by modifying the UART event handler of the Nordic UART example - i.e "when there is new data, transfer .. ".

    Best regards,
    Karl

Related