Small doc/example changes

* Use PIO IRQ accessors in PIO I2C example

* Update pio/ir_nec/README.adoc file links (#183)

The "List of Files" now links (only) to files, not to directories (which prevented this example being included in the C SDK databook)
This commit is contained in:
Graham Sanderson
2021-11-24 19:02:20 -06:00
committed by GitHub
parent 188d849b1f
commit afd1d2008f
4 changed files with 22 additions and 22 deletions

View File

@@ -117,7 +117,8 @@ void bmp280_read_raw(int32_t* temp, int32_t* pressure) {
// note: normal mode does not require further ctrl_meas and config register writes
uint8_t buf[6];
i2c_write_blocking(i2c_default, ADDR, (uint8_t*)REG_PRESSURE_MSB, 1, true); // true to keep master control of bus
uint8_t reg = REG_PRESSURE_MSB;
i2c_write_blocking(i2c_default, ADDR, &reg, 1, true); // true to keep master control of bus
i2c_read_blocking(i2c_default, ADDR, buf, 6, false); // false - finished with bus
// store the 20 bit read in a 32 bit signed integer for conversion
@@ -184,7 +185,8 @@ void bmp280_get_calib_params(struct bmp280_calib_param* params) {
// and MSB register, so we read from 24 registers
uint8_t buf[NUM_CALIB_PARAMS] = { 0 };
i2c_write_blocking(i2c_default, ADDR, (uint8_t*)REG_DIG_T1_LSB, 1, true); // true to keep master control of bus
uint8_t reg = REG_DIG_T1_LSB;
i2c_write_blocking(i2c_default, ADDR, &reg, 1, true); // true to keep master control of bus
// read in one go as register addresses auto-increment
i2c_read_blocking(i2c_default, ADDR, buf, NUM_CALIB_PARAMS, false); // false, we're done reading