Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BHI260 BHY2 Sensor API documentation?

    BHI260 BHY2 Sensor API documentation?

    robca
    New Poster

    Hello,

    I plan to use a BHI260AB connected to a nRF52840 via SPI, and I'm looking at the BHY2 Sensor API repository https://github.com/BoschSensortec/BHY2-Sensor-API

    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

    thanks

     

    7 REPLIES 7

    BSTRobin
    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.

    BSTRobin
    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 🙂

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist