/* Replace the functions "platform_write" and "platform_read" with your platform specific read and write function. This example use an STM32 evaluation board and CubeMX tool. In this case the "*handle" variable is useful in order to select the correct interface but the usage of "*handle" is not mandatory.  */
static int32_t platform_write(void *handle, uint8_t reg, uint8_t *bufp, uint16_t len)
/* Replace the functions "platform_write" and "platform_read" with your platform specific read and write function. This example use an STM32 evaluation board and CubeMX tool. In this case the "*handle" variable is useful in order to select the correct interface but the usage of "*handle" is not mandatory.  */
static int32_t platform_write(void *handle, uint8_t reg, uint8_t *bufp, uint16_t len)
{
  if (handle == &hi2c1)
  {
    HAL_I2C_Mem_Write(handle, LSM6DSL_I2C_ADD_L, Reg,
                      I2C_MEMADD_SIZE_8BIT, Bufp, len, 1000);
  }
  return 0;
}