/* Retrieve the highest magnitude (x, y, z) sample recorded since the last read of the MAXPEAK registers  */
int32_t adxl372_get_highest_peak_data(adxl372_dev *dev, adxl372_xyz_accel_data *max_peak)
/* Retrieve the highest magnitude (x, y, z) sample recorded since the last read of the MAXPEAK registers  */
int32_t adxl372_get_highest_peak_data(adxl372_dev *dev, adxl372_xyz_accel_data *max_peak)
{
	uint8_t buf[6];
	int32_t ret;
	ret = adxl372_spi_reg_read_multiple(dev,
					    ADXL372_X_MAXPEAK_H,
					    buf, 6);
	if (ret)
		return -1;
	max_peak->x = (buf[0] << 4) | (buf[1] >> 4);
	max_peak->y = (buf[2] << 4) | (buf[3] >> 4);
	max_peak->z = (buf[4] << 4) | (buf[5] >> 4);
	return ret;
}