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

Update ad7134 iio #35

Merged
merged 3 commits into from
Oct 30, 2023
Merged
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
4 changes: 1 addition & 3 deletions projects/ad7134_iio/STM32/.extSettings
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ app/libraries/no-OS/drivers/adc/ad713x/=../../../libraries/no-OS/drivers/adc/ad7

app/libraries/no-OS/drivers/tdm=../../../libraries/no-OS/drivers/tdm/no_os_tdm.c;

app/libraries/no-OS/util/=../../../libraries/no-OS/util/no_os_util.c;../../../libraries/no-OS/util/no_os_list.c;../../../libraries/no-OS/util/no_os_circular_buffer.c;../../../libraries/no-OS/util/no_os_lf256fifo.c;../../../libraries/no-OS/util/no_os_alloc.c;../../../libraries/no-OS/util/no_os_mutex.c;

app/libraries/no-OS/include/=../../../libraries/no-OS/include/no_os_list.h;../../../libraries/no-OS/include/no_os_gpio.h;../../../libraries/no-OS/include/no_os_delay.h;../../../libraries/no-OS/include/no_os_error.h;../../../libraries/no-OS/include/no_os_delay.h;../../../libraries/no-OS/include/no_os_spi.h;../../../libraries/no-OS/include/no_os_uart.h;../../../libraries/no-OS/include/no_os_util.h;../../../libraries/no-OS/include/no_os_circular_buffer.h;../../../libraries/no-OS/include/no_os_lf256fifo.h;../../../libraries/no-OS/include/no_os_irq.h;;../../../libraries/no-OS/include/no_os_tdm.h;../../../libraries/no-OS/include/no_os_alloc.h;../../../libraries/no-OS/include/no_os_mutex.h;
app/libraries/no-OS/=../../../libraries/no-OS/util/;../../../libraries/no-OS/include;

app/libraries/no-OS/drivers/platform/stm32/=../../../libraries/no-OS/drivers/platform/stm32/stm32_delay.c;../../../libraries/no-OS/drivers/platform/stm32/stm32_gpio.c;../../../libraries/no-OS/drivers/platform/stm32/stm32_gpio.h;../../../libraries/no-OS/drivers/platform/stm32/stm32_spi.c;../../../libraries/no-OS/drivers/platform/stm32/stm32_spi.h;../../../libraries/no-OS/drivers/platform/stm32/stm32_uart.c;../../../libraries/no-OS/drivers/platform/stm32/stm32_uart.h;../../../libraries/no-OS/drivers/platform/stm32/stm32_delay.h;../../../libraries/no-OS/drivers/platform/stm32/stm32_gpio_irq.h;../../../libraries/no-OS/drivers/platform/stm32/stm32_gpio_irq.c;../../../libraries/no-OS/drivers/platform/stm32/stm32_tdm.c;../../../libraries/no-OS/drivers/platform/stm32/stm32_tdm.h;../../../libraries/no-OS/drivers/platform/stm32/stm32_irq.h;../../../libraries/no-OS/drivers/platform/stm32/stm32_irq.c

Expand Down
11 changes: 0 additions & 11 deletions projects/ad7134_iio/app/ad7134_iio.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,6 @@ static struct iio_attribute global_attributes[] = {
END_ATTRIBUTES_ARRAY
};

/* IIOD debug attributes list */
static struct iio_attribute debug_attributes[] = {
{
.name = "direct_reg_access",
.show = NULL,
.store = NULL,
},
END_ATTRIBUTES_ARRAY
};

/* IIOD channels configurations */
struct scan_type chn_scan = {
.sign = 'u',
Expand Down Expand Up @@ -662,7 +652,6 @@ static int32_t iio_ad7134_init(struct iio_device **desc)
iio_ad7134_channels[0]);
iio_ad7134_inst->channels = iio_ad7134_channels;
iio_ad7134_inst->attributes = global_attributes;
iio_ad7134_inst->debug_attributes = debug_attributes;
iio_ad7134_inst->debug_reg_read = debug_reg_read;
iio_ad7134_inst->debug_reg_write = debug_reg_write;
iio_ad7134_inst->pre_enable = iio_ad7134_prepare_transfer;
Expand Down
2 changes: 1 addition & 1 deletion projects/ad7134_iio/app/ad7134_user_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct ad713x_init_param ad713x_init_params = {
.pnd = NO_OS_GPIO_HIGH,

/* Define the device specific additional parameters */
.dev_id = ID_AD7134,
.dev_id = ACTIVE_DEVICE_ID,

/* Only 16-bit Frame + No CRC is supported for data capturing */
.adc_data_len = ADC_16_BIT_DATA, /* DO NOT CHANGE */
Expand Down
29 changes: 25 additions & 4 deletions projects/ad7134_iio/app/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/******************************************************************************/

#include <stdint.h>
#include "ad713x.h"

/******************************************************************************/
/********************** Macros and Constants Definition ***********************/
Expand All @@ -42,10 +43,6 @@
/* Select the active platform from list of supported platforms */
#define ACTIVE_PLATFORM MBED_PLATFORM

/* Name of active device */
#define ACTIVE_DEVICE_NAME "ad7134"
#define HW_MEZZANINE_NAME "EVAL-AD7134ARDZ"

/* Select the ADC data capture mode (default is CC mode) */
#if !defined(DATA_CAPTURE_MODE)
#define DATA_CAPTURE_MODE CONTINUOUS_DATA_CAPTURE
Expand All @@ -60,6 +57,30 @@
#define XSTR(s) #s
#define STR(s) XSTR(s)

// **** Note for User: ACTIVE_DEVICE selection ****//
/* Define the device type from the list of below device type defines (one at a time)
* e.g. #define DEV_AD7134 -> This will make AD7134 as an active device.
* The active device is default set to AD7134 if device type is not defined.
* */
//#define DEV_AD7134

/* Name of active device */
#if defined (DEV_AD7134)
#define ACTIVE_DEVICE_NAME "ad7134"
#define HW_MEZZANINE_NAME "EVAL-AD7134ARDZ"
#define ACTIVE_DEVICE_ID ID_AD7134
#elif defined (DEV_AD4134)
#define ACTIVE_DEVICE_NAME "ad4134"
#define HW_MEZZANINE_NAME "EVAL-AD4134ARDZ"
#define ACTIVE_DEVICE_ID ID_AD4134
#else
#warning No / Unsupported ADxxxxy symbol defined.AD7134 defined
#define DEV_AD7134
#define ACTIVE_DEVICE_NAME "ad7134"
#define HW_MEZZANINE_NAME "EVAL-AD7134ARDZ"
#define ACTIVE_DEVICE_ID ID_AD7134
#endif

/* Enable the UART/VirtualCOM port connection (default VCOM) */
//#define USE_PHY_COM_PORT // Uncomment to select UART

Expand Down