Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Examples of BME68X Sensor API use coines.h but this file is not included

    Examples of BME68X Sensor API use coines.h but this file is not included

    Strooom
    Member

    I am going to implement the BME688 on a custom board with STM32L431 (Cortex M4F), using SPI.

    I have downloaded the HW driver for the device itself (boschsensortec/BME68x_SensorAPI: Common Sensor API for the BME680 and BME688 sensors (github.com)) and am looking at the examples to try to detect the device on my board.

    However, these examples all #include <coines.h> which is not included with the driver...

    Looking at the code of the driver, it looks like I have to provide functions for reading/writing the SPI and set pointers to these functions in an instance of this driver. That makes sense but I would like to see a simple example doing this, to improve my understanding of how to use the driver.

    Is there a simple 'detect the BME688' example for (eg) STM32 available ?

    1 REPLY 1

    kmca
    Established Member

    There is an example of how to do this for I2C in the PI3G python wrapper, available in github https://github.com/mcalisterkm/bme68x-python-library-bsec2.6.1.0/blob/main/README.md 

    BSEC 2.x includes I2C/SPI comms, but if you are just using the API then there are the references to coines which may not be available for your platform. That is the case for the Raspberry PI, and bme68xmodule.c uses ioctl calls on the I2C device.  The bme68x_i2c_read/coines_read_i2c (and write) are mapped in the API common.c and in the PI3G python wrapper replaced by pi3g_read (and write) see internal_functions.c.

    Sorry it's not SPI but it does show how to replace COINES comms initialisation, read, and write. 

    I recall that there are other integrations on GitHub for the BME688 that do a similar replacement of COINES in order to use the API. 

    Regards

    Keith

    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