13 #ifndef _APP_CONFIG_H_
14 #define _APP_CONFIG_H_
27 #define MBED_PLATFORM 1
30 #define BURST_DATA_CAPTURE 0
31 #define CONTINUOUS_DATA_CAPTURE 1
35 #define STR(s) XSTR(s)
38 #if !defined(ACTIVE_PLATFORM)
39 #define ACTIVE_PLATFORM MBED_PLATFORM
43 #if !defined(DATA_CAPTURE_MODE)
44 #define DATA_CAPTURE_MODE CONTINUOUS_DATA_CAPTURE
50 #if !defined(USE_PHY_COM_PORT)
51 #define USE_VIRTUAL_COM_PORT
63 #if defined(DEV_AD7605_4)
64 #define ACTIVE_DEVICE ID_AD7605_4
65 #define ACTIVE_DEVICE_NAME "ad7605-4"
66 #define DEVICE_NAME "DEV_AD7605_4"
67 #elif defined(DEV_AD7606_4)
68 #define ACTIVE_DEVICE ID_AD7606_4
69 #define ACTIVE_DEVICE_NAME "ad7606-4"
70 #define DEVICE_NAME "DEV_AD7606_4"
71 #elif defined(DEV_AD7606_6)
72 #define ACTIVE_DEVICE ID_AD7606_6
73 #define ACTIVE_DEVICE_NAME "ad7606-6"
74 #define DEVICE_NAME "DEV_AD7606_6"
75 #elif defined(DEV_AD7606_8)
76 #define ACTIVE_DEVICE ID_AD7606_8
77 #define ACTIVE_DEVICE_NAME "ad7606-8"
78 #define DEVICE_NAME "DEV_AD7606_8"
79 #elif defined(DEV_AD7606B)
80 #define ACTIVE_DEVICE ID_AD7606B
81 #define ACTIVE_DEVICE_NAME "ad7606b"
82 #define DEVICE_NAME "DEV_AD7606B"
83 #elif defined(DEV_AD7606C_16)
84 #define ACTIVE_DEVICE ID_AD7606C_16
85 #define ACTIVE_DEVICE_NAME "ad7606c-16"
86 #define DEVICE_NAME "DEV_AD7606C_16"
87 #elif defined(DEV_AD7606C_18)
88 #define ACTIVE_DEVICE ID_AD7606C_18
89 #define ACTIVE_DEVICE_NAME "ad7606c-18"
90 #define DEVICE_NAME "DEV_AD7606C_18"
91 #elif defined(DEV_AD7608)
92 #define ACTIVE_DEVICE ID_AD7608
93 #define ACTIVE_DEVICE_NAME "ad7608"
94 #define DEVICE_NAME "DEV_AD7608"
95 #elif defined(DEV_AD7609)
96 #define ACTIVE_DEVICE ID_AD7609
97 #define ACTIVE_DEVICE_NAME "ad7609"
98 #define DEVICE_NAME "DEV_AD7609"
100 #warning No/Unsupported ADxxxxy symbol defined. AD7606B defined
102 #define ACTIVE_DEVICE ID_AD7606B
103 #define ACTIVE_DEVICE_NAME "ad7606b"
104 #define DEVICE_NAME "DEV_AD7606B"
107 #if defined(DEV_AD7605_4)
108 #define AD7606X_ADC_CHANNELS 4
109 #define AD7606X_ADC_RESOLUTION 16
110 #elif defined(DEV_AD7606_4)
111 #define AD7606X_ADC_CHANNELS 4
112 #define AD7606X_ADC_RESOLUTION 16
113 #elif defined(DEV_AD7606_6)
114 #define AD7606X_ADC_CHANNELS 6
115 #define AD7606X_ADC_RESOLUTION 16
116 #elif defined(DEV_AD7606_8)
117 #define AD7606X_ADC_CHANNELS 8
118 #define AD7606X_ADC_RESOLUTION 16
119 #elif defined(DEV_AD7606B)
120 #define AD7606X_ADC_CHANNELS 8
121 #define AD7606X_ADC_RESOLUTION 16
122 #elif defined(DEV_AD7606C_16)
123 #define AD7606X_ADC_CHANNELS 8
124 #define AD7606X_ADC_RESOLUTION 16
125 #elif defined(DEV_AD7606C_18)
126 #define AD7606X_ADC_CHANNELS 8
127 #define AD7606X_ADC_RESOLUTION 18
128 #elif defined(DEV_AD7608)
129 #define AD7606X_ADC_CHANNELS 8
130 #define AD7606X_ADC_RESOLUTION 18
131 #elif defined(DEV_AD7609)
132 #define AD7606X_ADC_CHANNELS 8
133 #define AD7606X_ADC_RESOLUTION 18
136 #define AD7606X_ADC_CHANNELS 8
137 #define AD7606X_ADC_RESOLUTION 16
140 #if (ACTIVE_PLATFORM == MBED_PLATFORM)
143 #define HW_CARRIER_NAME TARGET_NAME
146 #define pwm_extra_init_params mbed_pwm_extra_init_params
147 #if defined(USE_VIRTUAL_COM_PORT)
148 #define uart_extra_init_params mbed_vcom_extra_init_params
149 #define uart_ops mbed_virtual_com_ops
151 #define uart_extra_init_params mbed_uart_extra_init_params
152 #define uart_ops mbed_uart_ops
154 #define spi_extra_init_params mbed_spi_extra_init_params
155 #define i2c_extra_init_params mbed_i2c_extra_init_params
156 #define trigger_gpio_irq_extra_params mbed_trigger_gpio_irq_init_params
157 #define trigger_gpio_extra_init_params mbed_trigger_gpio_extra_init_params
158 #define reset_gpio_extra_init_params mbed_reset_gpio_extra_init_params
159 #define convst_gpio_extra_init_params mbed_convst_gpio_extra_init_params
160 #define busy_gpio_extra_init_params mbed_busy_gpio_extra_init_params
161 #define osr0_gpio_extra_init_params mbed_osr0_gpio_extra_init_params
162 #define osr1_gpio_extra_init_params mbed_osr1_gpio_extra_init_params
163 #define osr2_gpio_extra_init_params mbed_osr2_gpio_extra_init_params
164 #define range_gpio_extra_init_params mbed_range_gpio_extra_init_params
165 #define stdby_gpio_extra_init_params mbed_stdby_gpio_extra_init_params
166 #define trigger_gpio_ops mbed_gpio_ops
167 #define irq_ops mbed_gpio_irq_ops
168 #define gpio_ops mbed_gpio_ops
169 #define spi_ops mbed_spi_ops
170 #define i2c_ops mbed_i2c_ops
171 #define trigger_gpio_irq_ops mbed_gpio_irq_ops
172 #define trigger_gpio_handle 0
173 #define IRQ_INT_ID GPIO_IRQ_ID1
174 #define TRIGGER_GPIO_PORT 0
175 #define TRIGGER_GPIO_PIN PWM_TRIGGER
176 #define TRIGGER_INT_ID GPIO_IRQ_ID1
178 #error "No/Invalid active platform selected"
182 #define ADC_MAX_COUNT_UNIPOLAR (uint32_t)((1 << AD7606X_ADC_RESOLUTION) - 1)
185 #define ADC_MAX_COUNT_BIPOLAR (uint32_t)(1 << (AD7606X_ADC_RESOLUTION-1))
194 #if (AD7606X_ADC_RESOLUTION == 18)
195 #define BYTES_PER_SAMPLE sizeof(uint32_t)
197 #define BYTES_PER_SAMPLE sizeof(uint16_t)
201 #define FIRMWARE_NAME "ad7606_iio"
203 #if !defined(PLATFORM_NAME)
204 #define PLATFORM_NAME HW_CARRIER_NAME
210 #define VIRTUAL_COM_PORT_VID 0x0456
211 #define VIRTUAL_COM_PORT_PID 0xb66c
213 #define VIRTUAL_COM_SERIAL_NUM (FIRMWARE_NAME "_" DEVICE_NAME "_" STR(PLATFORM_NAME))
216 #define IIO_UART_BAUD_RATE (230400)
225 extern struct no_os_uart_desc *
uart_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_desc
Definition: app_config.c:97
struct no_os_gpio_desc * led_gpio_desc
Definition: app_config.c:208
Header file for Mbed platform configurations.