Bosch Sensortec Community

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

    Pre project BMA400

    New Poster

    Pre project BMA400

    Hi everybody,

    I'm adding a BMA400 on my bluetooth product to optimize consumption.

    Before to start developement, i would like to benefit from your experience concerning the faisability of my idea.

    I would like to use BMA400 to wake up my uC when product rotate. So once bluetooth is disconnected, system goes into sleep mode. When a rotation ( let's say 45degres but better to be parametric) is detected, interupt pin goes high. It should not wake up if it is only vibration up and down. I have seen this example : Auto wakeup and auto low power by activity Case here :

     https://community.bosch-sensortec.com/t5/Knowledge-base/Introduction-about-BMA400-Auto-Wakeup-and-Au...

     

    Is it this kind of example i should follow may be to start ?

    Thanks a lot for your ideas, there is so much possibility with this device that i 'm not sure know how to start 😅

    Tags (1)
    3 REPLIES 3
    Community Moderator

    Re: Pre project BMA400

    Yes, it is a good start for you to use BMA400 into your project and reduce the power consumption.

    You can use auto wake up interrupt to turn BMA400 from sleep mode to normal mode,  then you can use the orientation interrupt.  With the orientation interrupt issuing,  you wake up your host controller. 

    New Poster

    Re: Pre project BMA400

    Thanks Vincent !

     

    I started to integrate the drivers to my C code. 

    There is an example folder, where all the i2c and spi function are missing. I guess it is the place where customer like me should place their owm spi function depending on uC we use ? Is it the own change to do before using the driver ?

     

    There is also something confusing, for the read spi fucntion, driver always call dev->read with 5 argument. But prototype declared ( the ne we have to fill ) as only 4 argument :

    int8_t bma400_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint8_t len, const struct bma400_dev *dev)

    /* Read the data from the reg_addr */
    rslt = dev->read(dev->dev_id, reg_addr, temp_buff, temp_len);

     

    int8_t spi_reg_write(void *intf_ptr, uint8_t cs, uint8_t reg_addr, uint8_t *reg_data, uint16_t length);
    int8_t spi_reg_read(void *intf_ptr, uint8_t cs, uint8_t reg_addr, uint8_t *reg_data, uint16_t length);

     

     

    Is here a documentation on how to implement the driver please ?

    Thanks a lot

    Community Moderator

    Re: Pre project BMA400

    Unfortunately, we don't have specific document on how to porting the driver.

    We provide the example and help document in Github along with the API codes which you are able to refering to.

    Your understanding about the bus read and write are correct.  In the API, we only give an interface for bus read and write,  you need to rewrite them with your platform bus communication function.

    In the API layer, we only consider device address, register address, read_write_length,  content buffer and device structure with function point. 

    In the lower layer,  you can re-write the interface code to access the physical bus and stored the return value properly.

    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