14 #ifndef _APP_CONFIG_H_
15 #define _APP_CONFIG_H_
28 #define MBED_PLATFORM 1
31 #define CONTINUOUS_DATA_CAPTURE 0
32 #define BURST_DATA_CAPTURE 1
36 #define STR(s) XSTR(s)
47 #if !defined(DEV_AD2S1210)
49 #define ACTIVE_DEVICE ID_AD2S1210
50 #define ACTIVE_DEVICE_NAME "ad2s1210"
51 #define DEVICE_NAME "DEV_AD2S1210"
55 #if !defined(ACTIVE_PLATFORM)
56 #define ACTIVE_PLATFORM MBED_PLATFORM
60 #if !defined(DATA_CAPTURE_MODE)
61 #define DATA_CAPTURE_MODE CONTINUOUS_DATA_CAPTURE
67 #if !defined(USE_PHY_COM_PORT)
68 #define USE_VIRTUAL_COM_PORT
71 #if (ACTIVE_PLATFORM == MBED_PLATFORM)
74 #define HW_CARRIER_NAME TARGET_NAME
77 #define pwm_extra_init_params mbed_pwm_extra_init_params
78 #define uart_extra_init_params mbed_uart_extra_init_params
79 #define vcom_extra_init_params mbed_vcom_extra_init_params
80 #define spi_extra_init_params mbed_spi_extra_init_params
81 #define trigger_gpio_irq_extra_params mbed_trigger_gpio_irq_init_params
82 #define trigger_gpio_extra_init_params mbed_trigger_gpio_extra_init_params
83 #define trigger_gpio_ops mbed_gpio_ops
84 #define irq_ops mbed_gpio_irq_ops
85 #define gpio_ops mbed_gpio_ops
86 #define spi_ops mbed_spi_ops
87 #define uart_ops mbed_uart_ops
88 #define vcom_ops mbed_virtual_com_ops
89 #define pwm_ops mbed_pwm_ops
90 #define trigger_gpio_irq_ops mbed_gpio_irq_ops
91 #define trigger_gpio_handle 0
92 #define IRQ_INT_ID GPIO_IRQ_ID1
93 #define TRIGGER_GPIO_PORT 0
94 #define TRIGGER_GPIO_PIN PWM_TRIGGER
95 #define TRIGGER_INT_ID GPIO_IRQ_ID1
97 #error "No/Invalid active platform selected"
101 #define HW_MEZZANINE_NAME "EVAL-AD2S1210SDZ"
102 #define HW_NAME "ad2s1210"
103 #define HW_VENDOR "Analog Devices"
104 #define NUM_CTX_ATTR 4
106 #define RESOLVER_CHANNELS 3
107 #define RESOLVER_MAX_ATTR 10
110 #define RESOLVER_MAX_COUNT_UNIPOLAR (uint32_t)(USHRT_MAX)
111 #define RESOLVER_MAX_COUNT_BIPOLAR (uint32_t)(SHRT_MAX)
114 #define AD2S1210_RESOLUTION AD2S1210_RES_16BIT
116 #define AD2S1210_FCLKIN 8192000
118 #define MATH_PI 3.1415926f
120 #define AD2S1210_POS_IIO_SCALE (2 * MATH_PI / RESOLVER_MAX_COUNT_UNIPOLAR)
122 #if (AD2S1210_FCLKIN == 8192000)
123 #define AD2S1210_TRACKING_RATE_10BIT 2500
124 #define AD2S1210_TRACKING_RATE_12BIT 1000
125 #define AD2S1210_TRACKING_RATE_14BIT 500
126 #define AD2S1210_TRACKING_RATE_16BIT 125
127 #elif (AD2S1210_FCLKIN == 10240000)
128 #define AD2S1210_TRACKING_RATE_10BIT 3125
129 #define AD2S1210_TRACKING_RATE_12BIT 1250
130 #define AD2S1210_TRACKING_RATE_14BIT 625
131 #define AD2S1210_TRACKING_RATE_16BIT 156
132 #if (AD2S1210_FCLKIN != 10240000)
133 #warn "unknown tracking rate"
139 #define FIRMWARE_NAME "ad2s1210_iio"
141 #if !defined(PLATFORM_NAME)
142 #define PLATFORM_NAME HW_CARRIER_NAME
149 #define VIRTUAL_COM_PORT_VID 0x0456
150 #define VIRTUAL_COM_PORT_PID 0xb66c
151 #define VIRTUAL_COM_SERIAL_NUM (FIRMWARE_NAME "_" DEVICE_NAME "_" STR(PLATFORM_NAME))
153 #if defined(USE_PHY_COM_PORT)
155 #if (ACTIVE_PLATFORM == MBED_PLATFORM)
156 #define CONSOLE_STDIO_PORT_AVAILABLE
160 #define CONSOLE_STDIO_PORT_AVAILABLE
164 #define IIO_UART_BAUD_RATE (230400)
173 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
Header file for Mbed platform configurations.