/* Multibyte read from device. A register read begins with the address and autoincrements for each aditional byte in the transfer.  */
int32_t adxl372_spi_reg_read_multiple(adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data, uint16_t count)
/* Multibyte read from device. A register read begins with the address and autoincrements for each aditional byte in the transfer.  */
int32_t adxl372_spi_reg_read_multiple(adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data, uint16_t count)
{
	uint8_t buf[1024];
	uint16_t i;
	int32_t ret;
	buf[0] = ADXL372_REG_READ(reg_addr);
	memset(&buf[1], 0x00, count);
	ret = spi_write_and_read(dev->spi_desc, buf, count + 1);
	for (i = 0; i <= count; i++)
		reg_data[i] = buf[i+1];
	return ret;
}