no-OS
common_data.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef __COMMON_DATA_H__
34 #define __COMMON_DATA_H__
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include "platform_includes.h"
40 #include "app_config.h"
41 #include "no_os_util.h"
42 #include "adc_demo.h"
43 #include "dac_demo.h"
44 #if defined(IIO_SW_TRIGGER_EXAMPLE) || defined(IIO_TIMER_TRIGGER_EXAMPLE)
45 #include "iio_trigger.h"
46 #endif
47 
48 /******************************************************************************/
49 /********************** Macros and Constants Definitions **********************/
50 /******************************************************************************/
52 
53 #define DEMO_CHANNELS no_os_max(TOTAL_ADC_CHANNELS, TOTAL_DAC_CHANNELS)
54 
55 #ifdef ENABLE_LOOPBACK
56 #define SAMPLES_PER_CHANNEL SAMPLES_PER_CHANNEL_PLATFORM
57 #else //ENABLE_LOOPBACK
58 #define SAMPLES_PER_CHANNEL 0
59 #define loopback_buffs NULL
60 #endif //ENABLE_LOOPBACK
61 
62 extern uint8_t in_buff[];
63 extern uint8_t out_buff[];
64 
65 #define MAX_SIZE_BASE_ADDR (SAMPLES_PER_CHANNEL * DEMO_CHANNELS * \
66  sizeof(uint16_t))
67 
68 #define DAC_DDR_BASEADDR out_buff
69 #define ADC_DDR_BASEADDR in_buff
70 
71 extern struct adc_demo_init_param adc_init_par;
72 extern struct dac_demo_init_param dac_init_par;
73 
74 #ifdef IIO_SW_TRIGGER_EXAMPLE
75 #define ADC_DEMO_TRIG_NAME "adc-demo-sw-trig"
76 extern struct iio_sw_trig_init_param adc_trig_ip;
77 
78 #define DAC_DEMO_TRIG_NAME "dac-demo-sw-trig"
79 extern struct iio_sw_trig_init_param dac_trig_ip;
80 #endif
81 
82 #ifdef IIO_TIMER_TRIGGER_EXAMPLE
83 #define ADC_DEMO_TIMER_TRIG_NAME "adc_demo_timer_trig"
84 extern struct no_os_timer_init_param adc_demo_tip;
85 extern struct no_os_irq_init_param adc_demo_timer_irq_ip;
86 extern struct iio_hw_trig_init_param adc_demo_timer_trig_ip;
87 
88 #define DAC_DEMO_TIMER_TRIG_NAME "dac_demo_timer_trig"
89 extern struct no_os_timer_init_param dac_demo_tip;
90 extern struct no_os_irq_init_param dac_demo_timer_irq_ip;
91 extern struct iio_hw_trig_init_param dac_demo_timer_trig_ip;
92 #endif
93 
94 #endif /* __COMMON_DATA_H__ */
in_buff
uint8_t in_buff[]
Definition: common_data.c:46
iio_trigger.h
Header file for iio_trigger.
dac_init_par
struct dac_demo_init_param dac_init_par
Definition: common_data.c:68
iio_demo_uart_ip
struct no_os_uart_init_param iio_demo_uart_ip
Definition: common_data.c:44
app_config.h
Config file of IIO Demo project.
adc_demo.h
Header file of ADC Demo Driver.
no_os_timer_init_param
Structure holding the parameters for timer initialization.
Definition: no_os_timer.h:83
iio_hw_trig_init_param
IIO hardware trigger initialization structure.
Definition: iio_trigger.h:86
iio_sw_trig_init_param
IIO software trigger initialization structure.
Definition: iio_trigger.h:116
no_os_uart_init_param
Structure holding the parameters for UART initialization.
Definition: no_os_uart.h:110
no_os_irq_init_param
Structure holding the initial parameters for Interrupt Request.
Definition: no_os_irq.h:107
out_buff
uint8_t out_buff[]
Definition: common_data.c:79
no_os_util.h
Header file of utility functions.
adc_demo_init_param
Definition: adc_demo.h:78
adc_init_par
struct adc_demo_init_param adc_init_par
Definition: common_data.c:58
dac_demo_init_param
Definition: dac_demo.h:77
dac_demo.h
Header file of DAC Demo Driver.