27 #define MBED_PLATFORM 1
30 #define CYCLIC_STREAM 0
31 #define ARBITRARY_STREAM 1
35 #define STR(s) XSTR(s)
40 #if !defined(ACTIVE_PLATFORM)
41 #define ACTIVE_PLATFORM MBED_PLATFORM
45 #if !defined(DATA_STREAM_MODE)
46 #define DATA_STREAM_MODE CYCLIC_STREAM
52 #if !defined(USE_PHY_COM_PORT)
53 #define USE_VIRTUAL_COM_PORT
65 #if defined(DEV_AD5780)
66 #define ACTIVE_DEVICE_NAME "ad5780"
67 #define DEVICE_NAME "DEV_AD5780"
68 #define ACTIVE_DEVICE ID_AD5780
69 #define HW_MEZZANINE_NAME "EVAL-AD5780ARDZ"
70 #define DAC_RESOLUTION 18
71 #elif defined(DEV_AD5781)
72 #define ACTIVE_DEVICE_NAME "ad5781"
73 #define DEVICE_NAME "DEV_AD5781"
74 #define ACTIVE_DEVICE ID_AD5781
75 #define HW_MEZZANINE_NAME "EVAL-AD5781ARDZ"
76 #define DAC_RESOLUTION 18
77 #elif defined(DEV_AD5790)
78 #define ACTIVE_DEVICE_NAME "ad5790"
79 #define DEVICE_NAME "DEV_AD5790"
80 #define ACTIVE_DEVICE ID_AD5790
81 #define HW_MEZZANINE_NAME "EVAL-AD5790ARDZ"
82 #define DAC_RESOLUTION 20
83 #elif defined(DEV_AD5791)
84 #define ACTIVE_DEVICE_NAME "ad5791"
85 #define DEVICE_NAME "DEV_AD5791"
86 #define ACTIVE_DEVICE ID_AD5791
87 #define HW_MEZZANINE_NAME "EVAL-AD5791ARDZ"
88 #define DAC_RESOLUTION 20
89 #elif defined(DEV_AD5760)
90 #define ACTIVE_DEVICE_NAME "ad5760"
91 #define DEVICE_NAME "DEV_AD5760"
92 #define ACTIVE_DEVICE ID_AD5760
93 #define HW_MEZZANINE_NAME "EVAL-AD5760ARDZ"
94 #define DAC_RESOLUTION 16
96 #warning No/Unsupported ADxxxx symbol defined. AD5780 defined
98 #define ACTIVE_DEVICE_NAME "ad5780"
99 #define DEVICE_NAME "DEV_AD5780"
100 #define ACTIVE_DEVICE ID_AD5780
101 #define HW_MEZZANINE_NAME "EVAL-AD5780ARDZ"
102 #define DAC_RESOLUTION 18
113 #if defined(INT_REF_M10V_TO_10V)
114 #define DAC_CH_SPAN 20
115 #define DAC_VREFN -10.0
116 #define DAC_VREFN_GAIN_OF_TWO -30.0
117 #elif defined(INT_REF_0V_TO_10V)
118 #define DAC_CH_SPAN 10
119 #define DAC_VREFN 0.0
120 #define DAC_VREFN_GAIN_OF_TWO -10.0
121 #elif defined(EXT_REF)
122 #define DAC_VREFN -10.0
123 #define DAC_VREFP 10.0
124 #define DAC_CH_SPAN (DAC_VREFP-DAC_VREFN)
126 #warning No/Unsupported Reference selection defined. Internal reference -10V to 10V defined
127 #define INT_REF_M10V_TO_10V
128 #define DAC_CH_SPAN 20
129 #define DAC_VREFN -10.0
130 #define DAC_VREFN_GAIN_OF_TWO -30.0
134 #define AD579X_NUM_CHANNELS 1
137 #define DAC_MAX_COUNT (uint32_t)((1 << DAC_RESOLUTION) - 1)
140 #define DAC_MAX_COUNT_BIN_OFFSET (uint32_t)((1 << DAC_RESOLUTION) - 1)
143 #define DAC_MAX_COUNT_2S_COMPL (uint32_t)(1 << (DAC_RESOLUTION-1))
146 #define NUM_OF_V_SPANS 5
148 #if (ACTIVE_PLATFORM == MBED_PLATFORM)
151 #define HW_CARRIER_NAME TARGET_NAME
154 #define pwm_extra_init_params mbed_pwm_extra_init_params
155 #define uart_extra_init_params mbed_uart_extra_init_params
156 #define vcom_extra_init_params mbed_vcom_extra_init_params
157 #define spi_extra_init_params mbed_spi_extra_init_params
158 #define i2c_extra_init_params mbed_i2c_extra_init_params
159 #define trigger_gpio_irq_extra_params mbed_trigger_gpio_irq_init_params
160 #define gpio_ops mbed_gpio_ops
161 #define spi_ops mbed_spi_ops
162 #define i2c_ops mbed_i2c_ops
163 #define uart_ops mbed_uart_ops
164 #define vcom_ops mbed_virtual_com_ops
165 #define pwm_ops mbed_pwm_ops
166 #define trigger_gpio_irq_ops mbed_gpio_irq_ops
168 #error "No/Invalid active platform selected"
174 #define IIO_UART_BAUD_RATE (230400)
177 #define FIRMWARE_NAME "ad579x_iio"
179 #if !defined(PLATFORM_NAME)
180 #define PLATFORM_NAME HW_CARRIER_NAME
186 #define VIRTUAL_COM_PORT_VID 0x0456
187 #define VIRTUAL_COM_PORT_PID 0xb66c
189 #define VIRTUAL_COM_SERIAL_NUM (FIRMWARE_NAME "_" DEVICE_NAME "_" STR(PLATFORM_NAME))
192 #if defined(USE_PHY_COM_PORT)
194 #if (ACTIVE_PLATFORM == MBED_PLATFORM)
195 #define CONSOLE_STDIO_PORT_AVAILABLE
199 #define CONSOLE_STDIO_PORT_AVAILABLE
206 #define CONV_PERIOD_NSEC(x) (((float)(1.0 / x) * 1000000) * 1000)
207 #define CONV_DUTY_CYCLE_NSEC(x) (CONV_PERIOD_NSEC(x) / 2)
213 extern struct no_os_pwm_desc *
pwm_desc;
int32_t init_pwm_trigger(void)
Initialize the PWM trigger contoller.
Definition: app_config.c:161
struct no_os_irq_ctrl_desc * trigger_irq_desc
Definition: app_config.c:103
int32_t init_system(void)
Initialize the system peripherals.
Definition: app_config.c:185
struct no_os_uart_desc * uart_iio_com_desc
Definition: app_config.c:127
struct no_os_eeprom_desc * eeprom_desc
Definition: app_config.c:194
struct no_os_pwm_desc * pwm_desc
Definition: app_config.c:106
struct no_os_uart_desc * uart_console_stdio_desc
Definition: app_config.c:100
Header file for Mbed platform configurations.