/* Write generic device register (platform dependent) 
WARNING: Functions declare in this section are defined at the end of this file and are strictly related to the hardware platform used. */
static int32_t platform_write(void *handle, uint8_t reg, uint8_t *bufp, uint16_t len)
/* Write generic device register (platform dependent) 
WARNING: Functions declare in this section are defined at the end of this file and are strictly related to the hardware platform used. */
static int32_t platform_write(void *handle, uint8_t reg, uint8_t *bufp, uint16_t len)
{
  if (handle == &hi2c1)
  {
    reg |= 0x80;
    HAL_I2C_Mem_Write(handle, HTS221_I2C_ADDRESS, reg,
                      I2C_MEMADD_SIZE_8BIT, bufp, len, 1000);
  }
  return 0;
}