@@ -24,8 +24,8 @@ The sensor driver package includes bme280.c, bme280.h and bme280_defs.h files.
2424SPI 3-wire is currently not supported in the API.
2525## Usage guide
2626### Initializing the sensor
27- To initialize the sensor, user need to create a device structure. User can do this by
28- creating an instance of the structure bme280_dev. After creating the device strcuture, user
27+ To initialize the sensor, user need to create a device structure. User can do this by
28+ creating an instance of the structure bme280_dev. After creating the device strcuture, user
2929need to fill in the various parameters as shown below.
3030
3131#### Example for SPI 4-Wire
@@ -40,7 +40,7 @@ dev.intf_ptr = &dev_addr;
4040dev.intf = BME280_SPI_INTF;
4141dev.read = user_spi_read;
4242dev.write = user_spi_write;
43- dev.delay_ms = user_delay_ms ;
43+ dev.delay_us = user_delay_us ;
4444
4545rslt = bme280_init(&dev);
4646```
@@ -54,7 +54,7 @@ dev.intf_ptr = &dev_addr;
5454dev.intf = BME280_I2C_INTF;
5555dev.read = user_i2c_read;
5656dev.write = user_i2c_write;
57- dev.delay_ms = user_delay_ms ;
57+ dev.delay_us = user_delay_us ;
5858
5959rslt = bme280_init(&dev);
6060```
@@ -72,7 +72,7 @@ By default, 64 bit variant is used in the API. If the user wants 32 bit variant,
7272macro BME280_64BIT_ENABLE in bme280_defs.h file.
7373
7474### Sensor data units
75- > The sensor data units depends on the following macros being enabled or not,
75+ > The sensor data units depends on the following macros being enabled or not,
7676> (in bme280_defs.h file or as compiler macros)
7777> * BME280_FLOAT_ENABLE
7878> * BME280_64BIT_ENABLE
@@ -112,7 +112,7 @@ int8_t stream_sensor_data_forced_mode(struct bme280_dev *dev)
112112 settings_sel = BME280_OSR_PRESS_SEL | BME280_OSR_TEMP_SEL | BME280_OSR_HUM_SEL | BME280_FILTER_SEL;
113113
114114 rslt = bme280_set_sensor_settings(settings_sel, dev);
115-
115+
116116 /*Calculate the minimum delay required between consecutive measurement based upon the sensor enabled
117117 * and the oversampling configuration. */
118118 req_delay = bme280_cal_meas_delay(&dev->settings);
@@ -122,7 +122,7 @@ int8_t stream_sensor_data_forced_mode(struct bme280_dev *dev)
122122 while (1) {
123123 rslt = bme280_set_sensor_mode(BME280_FORCED_MODE, dev);
124124 /* Wait for the measurement to complete and print data @25Hz */
125- dev->delay_ms (req_delay, dev->intf_ptr);
125+ dev->delay_us (req_delay, dev->intf_ptr);
126126 rslt = bme280_get_sensor_data(BME280_ALL, &comp_data, dev);
127127 print_sensor_data(&comp_data);
128128 }
@@ -164,7 +164,7 @@ int8_t stream_sensor_data_normal_mode(struct bme280_dev *dev)
164164 printf("Temperature, Pressure, Humidity\r\n");
165165 while (1) {
166166 /* Delay while the sensor completes a measurement */
167- dev->delay_ms (70, dev->intf_ptr);
167+ dev->delay_us (70, dev->intf_ptr);
168168 rslt = bme280_get_sensor_data(BME280_ALL, &comp_data, dev);
169169 print_sensor_data(&comp_data);
170170 }
@@ -185,11 +185,11 @@ void print_sensor_data(struct bme280_data *comp_data)
185185### Templates for function pointers
186186``` c
187187
188- void user_delay_ms (uint32_t period, void * intf_ptr)
188+ void user_delay_us (uint32_t period, void * intf_ptr)
189189{
190190 /*
191191 * Return control or wait,
192- * for a period amount of milliseconds
192+ * for a period amount of microseconds
193193 * /
194194}
195195
@@ -219,7 +219,7 @@ int8_t user_spi_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *in
219219 return rslt;
220220}
221221
222- int8_t user_spi_write(uint8_t reg_addr, uint8_t * reg_data, uint32_t len, void * intf_ptr)
222+ int8_t user_spi_write(uint8_t reg_addr, const uint8_t * reg_data, uint32_t len, void * intf_ptr)
223223{
224224 int8_t rslt = 0; /* Return 0 for Success, non-zero for failure * /
225225
@@ -272,7 +272,7 @@ int8_t user_i2c_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *in
272272 return rslt;
273273}
274274
275- int8_t user_i2c_write(uint8_t reg_addr, uint8_t * reg_data, uint32_t len, void * intf_ptr)
275+ int8_t user_i2c_write(uint8_t reg_addr, const uint8_t * reg_data, uint32_t len, void * intf_ptr)
276276{
277277 int8_t rslt = 0; /* Return 0 for Success, non-zero for failure * /
278278
0 commit comments