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