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

LSM9DS1 libraries for nRF51

Hi, I have some code written for Arduino that read values in SPI from a LSM9DS1 (9-axis IMU) and I need to make it work on a nRF51.

What I have troubles with is the library to use with the LSM9DS1. The only library I have found is the library for Arduino, but it uses the Arduino SPI library to communicate with the LSM9DS1.

I think that I need to look trought the library provided for Arduino and replace the calls to Arduino SPI library by calls to the nRF51 SPI library.

Two questions :

  1. Am I right, and will it be very complex ?
  2. Is there a library for LSM9DS1 already written for nRF51/52 that I could use ?

I have found this other question ( devzone.nordicsemi.com/.../ ), but it was only about how to import the .cpp library.

Thank you very much

Parents
  • Hi Louis

    There are some Arduino boards based on the nRF52, such as the Arduino Primo, and they have implemented their own SPI drivers that follows the normal Arduino API.

    While their drivers and examples are designed to run on the Arduino Primo board itself, you should be able to reuse the driver on a standard nRF52DK.

    You can download the software from here:
    http://www.arduino.org/downloads

    With those drivers it will hopefully be easier to adapt your library.

    As mentioned mixing C++ and C in the same project is not a problem, as long as you configure your compiler/IDE properly.

    Best regards
    Torbjørn

Reply
  • Hi Louis

    There are some Arduino boards based on the nRF52, such as the Arduino Primo, and they have implemented their own SPI drivers that follows the normal Arduino API.

    While their drivers and examples are designed to run on the Arduino Primo board itself, you should be able to reuse the driver on a standard nRF52DK.

    You can download the software from here:
    http://www.arduino.org/downloads

    With those drivers it will hopefully be easier to adapt your library.

    As mentioned mixing C++ and C in the same project is not a problem, as long as you configure your compiler/IDE properly.

    Best regards
    Torbjørn

Children
No Data
Related