Sensirion SPS30 dust sensor: I2C comms

With the function acquireWireBuffer() all you do is create a config structure that can enable buffer of the size I2C_BUFFER_SIZE, but it is has NOT changed the Wire-buffer.
Normally config is passed along when creating the Wire instance, e.g. TwoWire Wire(HAL_I2C_INTERFACE1, &default_config);
As Wire is already defined, with the call hal_i2c_init(HAL_I2C_INTERFACE1, &config); we now change the Wire-buffer from the default (32) to 128. You MUST call this before Wire.begin() as here it will initialize pointers.

If you set debug = 2 in the sketch, and comment out the hal_i2c_init-line, you will see that despite acquireWireBuffer() we still have the default config. We only receive 0x22 (34) bytes of the 0x40 (64) bytes. That means Concentration [#/cm3] that are displayed will be wrong (they have NOT been received from the SPS30 due to Wire buffer-size). Not sure why that is 34 as the default buffer is only 32, hence my concern about memory violation. (I used 2.1.0 dev-OS)

Now the same, but with the Wire-buffer at 128 (due to hal_i2c_init), you will see 0x40 (64) bytes are received and the displayed Concentration [#/cm3] is now showing the data from the SPS30.

regards,
Paul