Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    BHI160 sensor library usage

    o_o
    Contributor

    Re: BHI160 sensor library usage

    BHI160 uses bit7 to identify the direction of the operation, 0xE1 is the read address for parameter 97 (wakeup accelerometer config). The write address of parameter 97 is 0x61.

     

    At this point I would like to advise that unless you want to carefully read the entire datasheet, please disregard all APIs from the bhy.h file and only use the functions from bhy_uc_driver.h file.

     

    The fact that BHI160 is a complex device is the reason why we provide an entire driver and not just a simple API, like we do with our other sensors.

     

    The bhy_uc_driver.h file along wth the example codes should provide functionnality for the vast majority of use-cases.

    lucasrangit
    Member

    Re: BHI160 sensor library usage

    The bhy_get_wakeup_sensor_configuration() parameter ID in the documentation appears wrong. You write with BHY_PARAMETER_REQUEST_WRITE_PARAMETER_97 (0xE1)
    and read with BHY_PARAMETER_REQUEST_READ_PARAMETER_97 (0x61).

    See my PR where I fix the documentation in the code: https://github.com/BoschSensortec/BHy1_driver_and_MCU_solution/pull/13

    owain-incus
    Established Member

    Re: BHI160 sensor library usage

    This does appear to be true; or well at least I get readings back using those sesnor ID's.
    Here dump of physical sensor configuration (bhy_get_physical_sensor_status()) and virtual sensor configuration after configuration has been done (bhy_get_wakeup_sensor_configuration(). You See sensor ID's 0xE? return giberish; IID's 0x6? seem to make some sense.

    <info> app: Accel Phys:SR:100,DR:16,Flag:225
    <info> app: Gyro Phys:SR:100,DR:2000,Flag:225
    <info> app: Mag Phys:SR:25,DR:2000,Flag:225
    <info> app:
    <info> app: Sensor 61 SR 100 DR 16
    <info> app: Sensor 62 SR 0 DR 2000
    <info> app: Sensor 63 SR 0 DR 1
    <info> app: Sensor 64 SR 100 DR 2000
    <info> app: Sensor 6A SR 100 DR 16


    <info> app: Accel Phys:SR:100,DR:16,Flag:225
    <info> app: Gyro Phys:SR:100,DR:2000,Flag:225
    <info> app: Mag Phys:SR:25,DR:2000,Flag:225
    <info> app:
    <info> app: Sensor E1 SR 100 DR 53248
    <info> app: Sensor E2 SR 100 DR 53248
    <info> app: Sensor E3 SR 100 DR 53248
    <info> app: Sensor E4 SR 100 DR 53248
    <info> app: Sensor EA SR 100 DR 53248

    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