4 * CVORG kernel/user-space interface
10 #if !defined(__KERNEL__)
13 #include <linux/types.h>
16 /* 2MB of SRAM per channel --> 1M samples/channel (i.e. 2 bytes/sample) */
17 #define CVORG_SRAM_SIZE 0x200000
18 #define CVORG_SRAM_SIZE_LONGS ((CVORG_SRAM_SIZE)/sizeof(uint32_t))
20 /* 100MHz maximum sampling frequency */
21 #define CVORG_MAX_FREQ 100000000
24 * @brief CVORG channels
26 enum cvorg_channelnr
{
32 * @brief Analog output offset
40 * @brief CVORG Input (triggers) polarity
47 /* channel status bitmask */
48 #define CVORG_CHANSTAT_READY 0x1
49 #define CVORG_CHANSTAT_BUSY 0x2
50 #define CVORG_CHANSTAT_ERR 0x4
51 #define CVORG_CHANSTAT_CLKOK 0x8
52 #define CVORG_CHANSTAT_ERR_CLK 0x10
53 #define CVORG_CHANSTAT_ERR_TRIG 0x20
54 #define CVORG_CHANSTAT_ERR_SYNC 0x40
55 #define CVORG_CHANSTAT_SRAM_BUSY 0x80
56 #define CVORG_CHANSTAT_STARTABLE 0x100
57 #define CVORG_CHANSTAT_OUT_ENABLED 0x200
61 * @brief CVORG triggers
70 * @brief Operation modes
82 * @brief Waveform struct
85 uint32_t recurr
; /**< play this wv 'recurr' times */
86 uint32_t size
; /**< size (in bytes) of the waveform */
87 uint32_t dynamic_gain
; /**< 1 to use gain_val, 0 otherwise */
88 int32_t gain_val
; /**< [-22,20] dB */
89 void *form
; /**< address of the waveform */
96 uint32_t nr
; /**< play this sequence nr times */
97 uint32_t n_waves
; /**< number of waveforms */
98 struct cvorg_wv
*waves
; /**< address of the waveforms */
103 * @param address - address of the SRAM entry
104 * @param data - value of the SRAM entry
106 struct cvorg_sram_entry
{
111 enum cvorg_adc_channel
{
112 CVORG_ADC_CHANNEL_MONITOR
,
113 CVORG_ADC_CHANNEL_REF
,
114 CVORG_ADC_CHANNEL_5V
,
115 CVORG_ADC_CHANNEL_GND
118 enum cvorg_adc_range
{
119 CVORG_ADC_RANGE_5V_BIPOLAR
,
120 CVORG_ADC_RANGE_5V_UNIPOLAR
,
121 CVORG_ADC_RANGE_10V_BIPOLAR
,
122 CVORG_ADC_RANGE_10V_UNIPOLAR
126 * @brief ADC configuration struct
127 * @param channel - ADC channel. See enum cvorg_adc_channel.
128 * @param range - Input range. See enum cvorg_adc_range.
129 * @param value - Read value of the selected ADC for the given number/range.
138 * @brief DAC configuration struct
139 * @param gain - Gain value used by the DAC.
140 * @param offset - Offset value used by the DAC.
147 #endif /* _CVORG_H_ */