Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    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 :


    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.