/* Get the STATUS, STATUS2, FIFO_ENTRIES and FIFO_ENTRIES2 registers data  */
int adxl372_get_status(const struct device *dev, uint8_t *status1, uint8_t *status2, uint16_t *fifo_entries)
/* Get the STATUS, STATUS2, FIFO_ENTRIES and FIFO_ENTRIES2 registers data  */
int adxl372_get_status(const struct device *dev, uint8_t *status1, uint8_t *status2, uint16_t *fifo_entries)
{
	struct adxl372_data *data = dev->data;
	uint8_t buf[4], length = 1U;
	int ret;
	if (status2) {
		length++;
	}
	if (fifo_entries) {
		length += 2U;
	}
	ret = data->hw_tf->read_reg_multiple(dev, ADXL372_STATUS_1, buf, length);
	*status1 = buf[0];
	if (status2) {
		*status2 = buf[1];
	}
	if (fifo_entries) {
		*fifo_entries = ((buf[2] & 0x3) << 8) | buf[3];
	}
	return ret;
}