Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BHI260 BHY2 Sensor API documentation?

    BHI260 BHY2 Sensor API documentation?

    New Poster


    I plan to use a BHI260AB connected to a nRF52840 via SPI, and I'm looking at the BHY2 Sensor API repository

    I already implemented the low level SPI read and write calls, and I can successfully get Euler angles using the euler.c example, so things are looking up.

    I cannot find any documentation for the APIs, though. I know I can look thru the code and use the examples (like euler.c) for a sense of how to use the APIs, but I was hoping for some documentation. Does it exist? The rest of Bosch documentation is really good, and it's strange to see nothing for all those pretty fundamental APIs



    7 REPLIES 7

    Community Moderator
    Community Moderator

    Hello robca,

    This API is written according to the data sheet. In addition to the API code, you could also refer to the data sheet. There was no special API documentation.
    There are some example code on GitHub. If you have problems when you use it, you could give feedback.

    Thanks for the prompt reply. Yes, as mentioned, it's not impossible to make sense of the APIs by looking at the code and datasheet, but the datasheet/code is not a perfect match, and it's taken me a bit of time to figure out basic things like how the code is organized, what virtual sensors use which data structure, how to port it to an embedded platform, etc. Other parts of the Bosch code are better documented.

    Is there a way to use the BHY2 Sensor APIs to put the BHI260 in low power mode (deep sleep) until a wake up IMU event happens? In the board I'm using, the BHI260AB is connected to the main processor and the PMIC using the HIRQ pin. We need to conserve battery when the device is not worn, so we plan to use the PMIC to put the rest of the board in the lowest possible power mode, set the BHI260 to deep sleep and lowest clock, and have the entire system wake up when a movement happens.

    I have not found any example about sleep/wake, and the APIs do not seem to have specific code. And so far I have not found a description in the datasheet. There are multiple references to the various sleep states, but I must have missed something.

    Community Moderator
    Community Moderator

    Hello robca,

    What wake-up events do you want to generate for your application? Like any motion.
    How do you want to sleep for your application? For example, no motion.

    In addition, could you introduce the functions of your product? This makes it easy for us to understand your original requirement.

    Unfortunately I can't provide too many details on the device. It's a low power sports wearable device, transmitting data with ANT+. When the user stops the activity, the device is removed from the body and usually set away. When the user is ready again, the device is worn. Given we use a small rechargeable battery, having an ultra-low power mode when unused is critical

    So we need to detect lack of activity for a few seconds (that part is done), then start the process to go into low power mode by properly configuring the BHI260, readying the main processor for sleep, and finally programming a PMIC to cut power to all the rails minus the BHI260 one. In a way the main processor kills its power as the last action

    We would like for the BHI to detect, as you say, any type of motion and pull HIRQ low. That will power up again all the PMIC rails, and in turn boot the main processor which will "remember" it went to sleep, and restart from there. The board already connects HIRQ to the PMIC and the PMIC is programmed to wake up on an event

    We need help in configuring the BHI for the lowest possible power consumption, then programming a wake up even on motion to issue the HIRQ signal. From reading the datasheet it's all possible. But I'm still unclear on the exact sequence needed 🙂