boschsensortec / BME68x_SensorAPI

Common Sensor API for the BME680 and BME688 sensors
BSD 3-Clause "New" or "Revised" License
213 stars 70 forks source link

coines.h file missing #11

Open sumandevkota opened 3 years ago

sumandevkota commented 3 years ago

I would really appreciate if you could upload "coines.h" file

rburkholder commented 3 years ago

Actually, if the dependency on coines could be totally removed, I think that would be better. I don't think the old deprecated bme680 repository had this dependency.

From what I can tell, coines is a user-interface, which requires a whole environment to be installed.

What I would rather prefer is a nice self contained library so I can link it into my own code for use. Like the old deprectated repository.

mathmatt01 commented 2 years ago

I agree with rburkholder - I have tried running the examples after installing the COINES environment, but even though I know the I2C interface works (I'm using a breakout board on a RaspberryPi), the COINES always says there is a communication error. Having a self-contained library would be much better in my opinion.

jbreitung commented 2 years ago

Still no updates on this? I have the same issue with the coines.h file. I'd prefer if I could set my own I2C write and read functions like in the old BME680 API.

wassfila commented 1 year ago

coines.his not needed, here an integration into Zephyr that drops coines.h as example https://github.com/HomeSmartMesh/sdk-hsm-thingy53/blob/main/drivers/sensor/bme688/bme688.c

wassfila commented 1 year ago

@rburkholder the driver https://github.com/boschsensortec/BME68x-Sensor-API/tree/master is free from coines.h as it only appears in the examples. see above link for my integration of the driver with unmodified sources, just dropping the examples folder.

adityaseelam commented 1 year ago

@rburkholder the driver https://github.com/boschsensortec/BME68x-Sensor-API/tree/master is free from coines.h as it only appears in the examples. see above link for my integration of the driver with unmodified sources, just dropping the examples folder.

Hello @wassfila Ive a doubt regarding interfacing this sensor with my zybo z7-20 board(fpga). In vivado ive designed a block. In that ive used AXI IIC to connect to the sensor. Ive generated bit stream. In vitis IDE im stuck.. I dont know how to write the code.`/**

include

include "bme68x.h"

include "common.h"

include "coines.h"

// / Macros / //

/ Macro for count of samples to be displayed /

define SAMPLE_COUNT UINT16_C(300)

// / Test code / //

int main(void) { struct bme68x_dev bme; int8_t rslt; struct bme68x_conf conf; struct bme68x_heatr_conf heatr_conf; struct bme68x_data data; uint32_t del_period; uint32_t time_ms = 0; uint8_t n_fields; uint16_t sample_count = 1;

/* Interface preference is updated as a parameter
 * For I2C : BME68X_I2C_INTF
 * For SPI : BME68X_SPI_INTF
 */
rslt = bme68x_interface_init(&bme, BME68X_SPI_INTF);
bme68x_check_rslt("bme68x_interface_init", rslt);

rslt = bme68x_init(&bme);
bme68x_check_rslt("bme68x_init", rslt);

/* Check if rslt == BME68X_OK, report or handle if otherwise */
conf.filter = BME68X_FILTER_OFF;
conf.odr = BME68X_ODR_NONE;
conf.os_hum = BME68X_OS_16X;
conf.os_pres = BME68X_OS_1X;
conf.os_temp = BME68X_OS_2X;
rslt = bme68x_set_conf(&conf, &bme);
bme68x_check_rslt("bme68x_set_conf", rslt);

/* Check if rslt == BME68X_OK, report or handle if otherwise */
heatr_conf.enable = BME68X_ENABLE;
heatr_conf.heatr_temp = 300;
heatr_conf.heatr_dur = 100;
rslt = bme68x_set_heatr_conf(BME68X_FORCED_MODE, &heatr_conf, &bme);
bme68x_check_rslt("bme68x_set_heatr_conf", rslt);

printf("Sample, TimeStamp(ms), Temperature(deg C), Pressure(Pa), Humidity(%%), Gas resistance(ohm), Status\n");

while (sample_count <= SAMPLE_COUNT)
{
    rslt = bme68x_set_op_mode(BME68X_FORCED_MODE, &bme);
    bme68x_check_rslt("bme68x_set_op_mode", rslt);

    /* Calculate delay period in microseconds */
    del_period = bme68x_get_meas_dur(BME68X_FORCED_MODE, &conf, &bme) + (heatr_conf.heatr_dur * 1000);
    bme.delay_us(del_period, bme.intf_ptr);

    time_ms = coines_get_millis();

    /* Check if rslt == BME68X_OK, report or handle if otherwise */
    rslt = bme68x_get_data(BME68X_FORCED_MODE, &data, &n_fields, &bme);
    bme68x_check_rslt("bme68x_get_data", rslt);

    if (n_fields)
    {

ifdef BME68X_USE_FPU

        printf("%u, %lu, %.2f, %.2f, %.2f, %.2f, 0x%x\n",
               sample_count,
               (long unsigned int)time_ms,
               data.temperature,
               data.pressure,
               data.humidity,
               data.gas_resistance,
               data.status);

else

        printf("%u, %lu, %d, %lu, %lu, %lu, 0x%x\n",
               sample_count,
               (long unsigned int)time_ms,
               (data.temperature / 100),
               (long unsigned int)data.pressure,
               (long unsigned int)(data.humidity / 1000),
               (long unsigned int)data.gas_resistance,
               data.status);

endif

        sample_count++;
    }
}

bme68x_coines_deinit();

return rslt;

}` Ive dumped that code but im getting lot of errors and I dont even have coines.h header file with me. Im not even sure if thats the correct way to approach. Can you please guide me with that.

wassfila commented 1 year ago

@adityaseelam this is not the right place to start a new discussion for a support topic as it deviates from the topic summary. Also if your problem is not related to a bug you found in the code, and need support, I would rather recommend the Bosch Sensortec Community Forum https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/bd-p/bst_community-mems-forum