Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Modified the ad5754r_iio.c" #110

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects/ad559xr_console/app/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// The ACTIVE_DEVICE is default set to AD5592R, if device type is not defined.

#if !defined(ACTIVE_DEVICE)
#define ACTIVE_DEVICE DEV_AD5592R
#define ACTIVE_DEVICE DEV_AD5593R
#endif

/**
Expand Down
86 changes: 43 additions & 43 deletions projects/ad5754r_iio/app/ad5754r_iio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,63 +1297,63 @@ int32_t ad5754r_iio_init(void)
#if defined(DEV_CN0586)
if (hw_mezzanine_is_valid) {
#endif
/* Initialize AD5754R no-os device driver interface */
ret = ad5754r_init(&ad5754r_dev_inst, &ad5754r_init_params);
if (ret) {
return ret;
}
/* Initialize AD5754R no-os device driver interface */
ret = ad5754r_init(&ad5754r_dev_inst, &ad5754r_init_params);
if (ret) {
return ret;
}

/* Check if descriptors have been assigned for GPIOs */
if (ad5754r_init_params.gpio_clear_init) {
if (!ad5754r_dev_inst->gpio_clear) {
return -ENOSYS;
}
/* Check if descriptors have been assigned for GPIOs */
if (ad5754r_init_params.gpio_clear_init) {
if (!ad5754r_dev_inst->gpio_clear) {
return -ENOSYS;
}
}

if (ad5754r_init_params.gpio_ldac_init) {
if (!ad5754r_dev_inst->gpio_ldac) {
return -ENOSYS;
}
if (ad5754r_init_params.gpio_ldac_init) {
if (!ad5754r_dev_inst->gpio_ldac) {
return -ENOSYS;
}
}

/* Initialize the AD5754R IIO app specific parameters */
ret = ad5754r_iio_param_init(&ad5754r_iio_dev);
/* Initialize the AD5754R IIO app specific parameters */
ret = ad5754r_iio_param_init(&ad5754r_iio_dev);
if (ret) {
return ret;
}
iio_init_params.nb_devs++;

#ifdef DEV_CN0586
if (ad5754r_dev_inst) {
ret = cn0586_init(&cn0586_dev_inst, ad5754r_dev_inst);
if (ret) {
return ret;
}
iio_init_params.nb_devs++;

#ifdef DEV_CN0586
if (ad5754r_dev_inst) {
ret = cn0586_init(&cn0586_dev_inst, ad5754r_dev_inst);
if (ret) {
return ret;
}

ret = cn0586_iio_param_init(&cn0586_iio_dev);
if (ret) {
return ret;
}
iio_init_params.nb_devs++;
ret = cn0586_iio_param_init(&cn0586_iio_dev);
if (ret) {
return ret;
}
iio_init_params.nb_devs++;
}
#endif

/* AD5754R IIO device init parameters */
iio_device_init_params[0].name = ACTIVE_DEVICE_NAME;
iio_device_init_params[0].raw_buf = dac_data_buffer;
iio_device_init_params[0].raw_buf_len = DATA_BUFFER_SIZE;
iio_device_init_params[0].dev = ad5754r_dev_inst;
iio_device_init_params[0].dev_descriptor = ad5754r_iio_dev;
iio_device_init_params[0].trigger_id = "trigger0";
/* AD5754R IIO device init parameters */
iio_device_init_params[0].name = ACTIVE_DEVICE_NAME;
iio_device_init_params[0].raw_buf = dac_data_buffer;
iio_device_init_params[0].raw_buf_len = DATA_BUFFER_SIZE;
iio_device_init_params[0].dev = ad5754r_dev_inst;
iio_device_init_params[0].dev_descriptor = ad5754r_iio_dev;
iio_device_init_params[0].trigger_id = "trigger0";

#ifdef DEV_CN0586
/* CFTL IIO device init parameters */
iio_device_init_params[1].name = "cn0586";
iio_device_init_params[1].raw_buf = dac_data_buffer;
iio_device_init_params[1].raw_buf_len = DATA_BUFFER_SIZE;
iio_device_init_params[1].dev = cn0586_dev_inst;
iio_device_init_params[1].dev_descriptor = cn0586_iio_dev;
iio_device_init_params[1].trigger_id = NULL; // TODO
/* CFTL IIO device init parameters */
iio_device_init_params[1].name = "cn0586";
iio_device_init_params[1].raw_buf = dac_data_buffer;
iio_device_init_params[1].raw_buf_len = DATA_BUFFER_SIZE;
iio_device_init_params[1].dev = cn0586_dev_inst;
iio_device_init_params[1].dev_descriptor = cn0586_iio_dev;
iio_device_init_params[1].trigger_id = NULL; // TODO
#endif

#if defined(DEV_CN0586)
Expand Down
Loading