/* Set the threshold for activity detection for all 3-axis  */
int32_t adxl372_set_activity_threshold(adxl372_dev *dev, adxl372_th_activity act, uint16_t thresh, bool referenced, bool enable)
/* Set the threshold for activity detection for all 3-axis  */
int32_t adxl372_set_activity_threshold(adxl372_dev *dev, adxl372_th_activity act, uint16_t thresh, bool referenced, bool enable)
{
	uint8_t th_val_h, th_val_l, i;
	int32_t ret = 0;
	th_val_h = (thresh >> 3);
	th_val_l = (thresh << 5) | (referenced << 1) | enable;
	for (i = 0; i < 3; i++) {
		ret |= adxl372_spi_reg_write(dev,
					     adxl372_th_reg_addr_h[act][i],
					     th_val_h);
		ret |= adxl372_spi_reg_write(dev,
					     adxl372_th_reg_addr_l[act][i],
					     th_val_l);
	}
	return ret;
}