/* CLI command to read and display data from the ADC.  */
int32_t ad7124_8pmdz_data_read(struct ad7124_8pmdz_dev *dev, uint8_t *arg)
/* CLI command to read and display data from the ADC.  */
int32_t ad7124_8pmdz_data_read(struct ad7124_8pmdz_dev *dev, uint8_t *arg)
{
	uint32_t sample_no;
	float odr;
	if ((arg == NULL) || (*arg == 0))
		sample_no = 0;
	else
		sample_no = atoi((char *)arg);
	ad7124_8pmdz_odr_logic_get(dev, &odr);
	if (odr <= 3200)
		return ad7124_8pmdz_data_read_nomem(dev, sample_no);
	else
		return ad7124_8pmdz_data_read_mem(dev, sample_no);
}