Go to the documentation of this file.
33 #ifndef __ADAQ8092_H__
34 #define __ADAQ8092_H__
49 #define ADAQ8092_SPI_READ NO_OS_BIT(7)
50 #define ADAQ8092_ADDR(x) ((x) & 0xFF)
53 #define ADAQ8092_REG_RESET 0x00
54 #define ADAQ8092_REG_POWERDOWN 0x01
55 #define ADAQ8092_REG_TIMING 0x02
56 #define ADAQ8092_REG_OUTPUT_MODE 0x03
57 #define ADAQ8092_REG_DATA_FORMAT 0x04
60 #define ADAQ8092_RESET NO_OS_BIT(7)
63 #define ADAQ8092_POWERDOWN_MODE NO_OS_GENMASK(1, 0)
66 #define ADAQ8092_CLK_INVERT NO_OS_BIT(3)
67 #define ADAQ8092_CLK_PHASE NO_OS_GENMASK(2, 1)
68 #define ADAQ8092_CLK_DUTYCYCLE NO_OS_BIT(0)
71 #define ADAQ8092_ILVDS NO_OS_GENMASK(6, 4)
72 #define ADAQ8092_TERMON NO_OS_BIT(3)
73 #define ADAQ8092_OUTOFF NO_OS_BIT(2)
74 #define ADAQ8092_OUTMODE NO_OS_GENMASK(1, 0)
77 #define ADAQ8092_OUTTEST NO_OS_GENMASK(5, 3)
78 #define ADAQ8092_ABP NO_OS_BIT(2)
79 #define ADAQ8092_RAND NO_OS_BIT(1)
80 #define ADAQ8092_TWOSCOMP NO_OS_BIT(0)
234 uint8_t mask, uint8_t reg_data);
@ ADAQ8092_ALT_BIT_POL_OFF
Definition: adaq8092.h:154
int adaq8092_set_test_mode(struct adaq8092_dev *dev, enum adaq8092_out_test_modes mode)
Set digital output test pattern mode.
Definition: adaq8092.c:562
enum adaq8092_out_test_modes adaq8092_get_test_mode(struct adaq8092_dev *dev)
Get digital output test pattern mode.
Definition: adaq8092.c:583
#define ADAQ8092_CLK_PHASE
Definition: adaq8092.h:67
int adaq8092_update_bits(struct adaq8092_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t reg_data)
Update specific register bits.
Definition: adaq8092.c:96
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
int adaq8092_read(struct adaq8092_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Read device register.
Definition: adaq8092.c:55
@ ADAQ8092_DOUT_OFF
Definition: adaq8092.h:133
int adaq8092_write(struct adaq8092_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Write device register.
Definition: adaq8092.c:78
#define ADAQ8092_CLK_INVERT
Definition: adaq8092.h:66
int adaq8092_set_lvds_cur_mode(struct adaq8092_dev *dev, enum adaq8092_lvds_out_current mode)
Set the LVDS output current mode.
Definition: adaq8092.c:432
enum adaq8092_dout_enable adaq8092_get_dout_en(struct adaq8092_dev *dev)
Get digital outputs.
Definition: adaq8092.c:519
enum adaq8092_data_rand data_rand_en
Definition: adaq8092.h:216
enum adaq8092_alt_bit_pol alt_bit_pol_en
Definition: adaq8092.h:215
@ ADAQ8092_CLKOUT_DELAY_180DEG
Definition: adaq8092.h:104
int adaq8092_set_clk_pol_mode(struct adaq8092_dev *dev, enum adaq8092_clk_invert mode)
Set the clock polarity mode.
Definition: adaq8092.c:335
adaq8092_clk_phase_delay
Definition: adaq8092.h:100
int adaq8092_set_pd_mode(struct adaq8092_dev *dev, enum adaq8092_powerdown_modes mode)
Set the device powerodown mode.
Definition: adaq8092.c:303
int adaq8092_set_dout_mode(struct adaq8092_dev *dev, enum adaq8092_dout_modes mode)
Set the digital output mode.
Definition: adaq8092.c:530
int adaq8092_write(struct adaq8092_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Write device register.
Definition: adaq8092.c:78
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
@ ADAQ8092_DOUBLE_RATE_CMOS
Definition: adaq8092.h:140
struct no_os_gpio_desc * gpio_par_ser
Definition: adaq8092.h:205
enum adaq8092_clk_invert clk_pol_mode
Definition: adaq8092.h:207
int adaq8092_set_data_rand_en(struct adaq8092_dev *dev, enum adaq8092_data_rand mode)
Set the data output randomizer mode.
Definition: adaq8092.c:626
Header file of SPI Interface.
#define ADAQ8092_OUTMODE
Definition: adaq8092.h:74
enum adaq8092_twoscomp adaq8092_get_twos_comp(struct adaq8092_dev *dev)
Get the Tows Complement mode.
Definition: adaq8092.c:679
@ ADAQ8092_DATA_RAND_OFF
Definition: adaq8092.h:160
adaq8092_dout_modes
Definition: adaq8092.h:137
#define ADAQ8092_REG_TIMING
Definition: adaq8092.h:55
adaq8092_dout_enable
Definition: adaq8092.h:131
@ ADAQ8092_CLK_POL_INVERTED
Definition: adaq8092.h:96
struct no_os_gpio_desc * gpio_en_1p8
Definition: adaq8092.h:204
int adaq8092_set_dout_en(struct adaq8092_dev *dev, enum adaq8092_dout_enable mode)
Set digital outputs.
Definition: adaq8092.c:498
enum adaq8092_out_test_modes adaq8092_get_test_mode(struct adaq8092_dev *dev)
Get digital output test pattern mode.
Definition: adaq8092.c:583
struct no_os_gpio_init_param * gpio_adc_pd1_param
Definition: adaq8092.h:177
@ ADAQ8092_2M5A
Definition: adaq8092.h:119
adaq8092_clk_dutycycle
Definition: adaq8092.h:108
@ ADAQ8092_CLK_DC_STABILIZER_ON
Definition: adaq8092.h:110
int adaq8092_remove(struct adaq8092_dev *dev)
Remove the device and release resources.
Definition: adaq8092.c:268
Header file of Delay functions.
int adaq8092_remove(struct adaq8092_dev *dev)
Remove the device and release resources.
Definition: adaq8092.c:268
int adaq8092_set_clk_phase_mode(struct adaq8092_dev *dev, enum adaq8092_clk_phase_delay mode)
Set the clock phase delay mode.
Definition: adaq8092.c:367
@ ADAQ8092_TERM_ON
Definition: adaq8092.h:127
Definition: ad9361_util.h:69
@ ADAQ8092_CH1_CH2_NAP
Definition: adaq8092.h:89
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
int adaq8092_set_test_mode(struct adaq8092_dev *dev, enum adaq8092_out_test_modes mode)
Set digital output test pattern mode.
Definition: adaq8092.c:562
enum adaq8092_clk_phase_delay adaq8092_get_clk_phase_mode(struct adaq8092_dev *dev)
Get the clock phase delay mode.
Definition: adaq8092.c:388
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
int adaq8092_set_lvds_cur_mode(struct adaq8092_dev *dev, enum adaq8092_lvds_out_current mode)
Set the LVDS output current mode.
Definition: adaq8092.c:432
#define ADAQ8092_REG_POWERDOWN
Definition: adaq8092.h:54
@ ADAQ8092_SLEEP
Definition: adaq8092.h:90
enum adaq8092_clk_phase_delay adaq8092_get_clk_phase_mode(struct adaq8092_dev *dev)
Get the clock phase delay mode.
Definition: adaq8092.c:388
@ ADAQ8092_CH1_NORMAL_CH2_NAP
Definition: adaq8092.h:88
enum adaq8092_out_test_modes test_mode
Definition: adaq8092.h:189
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
@ ADAQ8092_CLKOUT_DELAY_45DEG
Definition: adaq8092.h:102
@ ADAQ8092_FULL_RATE_CMOS
Definition: adaq8092.h:138
int adaq8092_set_data_rand_en(struct adaq8092_dev *dev, enum adaq8092_data_rand mode)
Set the data output randomizer mode.
Definition: adaq8092.c:626
enum adaq8092_alt_bit_pol alt_bit_pol_en
Definition: adaq8092.h:190
struct no_os_spi_desc * spi_desc
Definition: adaq8092.h:201
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
@ ADAQ8092_OFFSET_BINARY
Definition: adaq8092.h:166
@ ADAQ8092_1M75
Definition: adaq8092.h:121
enum adaq8092_dout_enable dout_en
Definition: adaq8092.h:187
@ ADAQ8092_2M1A
Definition: adaq8092.h:120
struct no_os_gpio_init_param * gpio_en_1p8_param
Definition: adaq8092.h:179
#define ADAQ8092_POWERDOWN_MODE
Definition: adaq8092.h:63
struct no_os_gpio_init_param * gpio_par_ser_param
Definition: adaq8092.h:180
@ ADAQ8092_CLKOUT_DELAY_90DEG
Definition: adaq8092.h:103
enum adaq8092_powerdown_modes adaq8092_get_pd_mode(struct adaq8092_dev *dev)
Get the device powerdown mode.
Definition: adaq8092.c:324
adaq8092_twoscomp
Definition: adaq8092.h:165
@ ADAQ8092_DOUT_ON
Definition: adaq8092.h:132
#define ADAQ8092_TWOSCOMP
Definition: adaq8092.h:80
@ ADAQ8092_TEST_ONES
Definition: adaq8092.h:146
@ ADAQ8092_TERM_OFF
Definition: adaq8092.h:126
int adaq8092_set_twos_comp(struct adaq8092_dev *dev, enum adaq8092_twoscomp mode)
Set the Tows Complement mode.
Definition: adaq8092.c:658
@ ADAQ8092_DOUBLE_RATE_LVDS
Definition: adaq8092.h:139
@ ADAQ8092_ALT_BIT_POL_ON
Definition: adaq8092.h:155
#define ADAQ8092_CLK_DUTYCYCLE
Definition: adaq8092.h:68
enum adaq8092_twoscomp twos_comp
Definition: adaq8092.h:217
enum adaq8092_internal_term lvds_term_mode
Definition: adaq8092.h:211
int adaq8092_set_pd_mode(struct adaq8092_dev *dev, enum adaq8092_powerdown_modes mode)
Set the device powerodown mode.
Definition: adaq8092.c:303
@ ADAQ8092_CLK_DC_STABILIZER_OFF
Definition: adaq8092.h:109
enum adaq8092_clk_invert adaq8092_get_clk_pol_mode(struct adaq8092_dev *dev)
Get the clock polarity mode.
Definition: adaq8092.c:356
@ ADAQ8092_NORMAL_OP
Definition: adaq8092.h:87
enum adaq8092_dout_modes dout_mode
Definition: adaq8092.h:213
enum adaq8092_lvds_out_current lvds_cur_mode
Definition: adaq8092.h:185
enum adaq8092_lvds_out_current lvds_cur_mode
Definition: adaq8092.h:210
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
enum adaq8092_clk_dutycycle adaq8092_get_clk_dc_mode(struct adaq8092_dev *dev)
Get the clock duty cycle stabilizer mode.
Definition: adaq8092.c:421
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define ADAQ8092_TERMON
Definition: adaq8092.h:72
int adaq8092_set_clk_dc_mode(struct adaq8092_dev *dev, enum adaq8092_clk_dutycycle mode)
Set the clock duty cycle stabilizer mode.
Definition: adaq8092.c:400
ADAQ8092 Device structure.
Definition: adaq8092.h:199
@ ADAQ8092_TWOS_COMPLEMENT
Definition: adaq8092.h:167
@ ADAQ8092_TEST_ALTERNATING
Definition: adaq8092.h:149
int adaq8092_init(struct adaq8092_dev **device, struct adaq8092_init_param init_param)
Initialize the device.
Definition: adaq8092.c:119
@ ADAQ8092_DATA_RAND_ON
Definition: adaq8092.h:161
ADAQ8092 Device initialization parameters.
Definition: adaq8092.h:174
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
adaq8092_out_test_modes
Definition: adaq8092.h:144
enum adaq8092_dout_modes adaq8092_get_dout_mode(struct adaq8092_dev *dev)
Get the digital output mode.
Definition: adaq8092.c:551
Header file of ADAQ8092 Driver.
#define ADAQ8092_REG_OUTPUT_MODE
Definition: adaq8092.h:56
int adaq8092_set_twos_comp(struct adaq8092_dev *dev, enum adaq8092_twoscomp mode)
Set the Tows Complement mode.
Definition: adaq8092.c:658
enum adaq8092_internal_term lvds_term_mode
Definition: adaq8092.h:186
#define ADAQ8092_ILVDS
Definition: adaq8092.h:71
#define ADAQ8092_REG_RESET
Definition: adaq8092.h:53
#define ADAQ8092_OUTOFF
Definition: adaq8092.h:73
enum adaq8092_clk_dutycycle clk_dc_mode
Definition: adaq8092.h:209
adaq8092_lvds_out_current
Definition: adaq8092.h:114
#define ADAQ8092_ABP
Definition: adaq8092.h:78
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
int adaq8092_set_clk_phase_mode(struct adaq8092_dev *dev, enum adaq8092_clk_phase_delay mode)
Set the clock phase delay mode.
Definition: adaq8092.c:367
enum adaq8092_powerdown_modes adaq8092_get_pd_mode(struct adaq8092_dev *dev)
Get the device powerdown mode.
Definition: adaq8092.c:324
@ ADAQ8092_3M5A
Definition: adaq8092.h:115
int adaq8092_set_clk_pol_mode(struct adaq8092_dev *dev, enum adaq8092_clk_invert mode)
Set the clock polarity mode.
Definition: adaq8092.c:335
enum adaq8092_clk_phase_delay clk_phase_mode
Definition: adaq8092.h:208
enum adaq8092_clk_dutycycle adaq8092_get_clk_dc_mode(struct adaq8092_dev *dev)
Get the clock duty cycle stabilizer mode.
Definition: adaq8092.c:421
#define ADAQ8092_REG_DATA_FORMAT
Definition: adaq8092.h:57
int adaq8092_set_clk_dc_mode(struct adaq8092_dev *dev, enum adaq8092_clk_dutycycle mode)
Set the clock duty cycle stabilizer mode.
Definition: adaq8092.c:400
enum adaq8092_powerdown_modes pd_mode
Definition: adaq8092.h:206
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
@ ADAQ8092_CLK_POL_NORMAL
Definition: adaq8092.h:95
enum adaq8092_clk_phase_delay clk_phase_mode
Definition: adaq8092.h:183
enum adaq8092_clk_invert clk_pol_mode
Definition: adaq8092.h:182
enum adaq8092_twoscomp adaq8092_get_twos_comp(struct adaq8092_dev *dev)
Get the Tows Complement mode.
Definition: adaq8092.c:679
int adaq8092_set_lvds_term_mode(struct adaq8092_dev *dev, enum adaq8092_internal_term mode)
Set the LVDS internal temination mode.
Definition: adaq8092.c:465
adaq8092_powerdown_modes
Definition: adaq8092.h:86
#define ADAQ8092_OUTTEST
Definition: adaq8092.h:77
adaq8092_internal_term
Definition: adaq8092.h:125
struct no_os_spi_init_param * spi_init
Definition: adaq8092.h:176
@ ADAQ8092_TEST_CHECKERBOARD
Definition: adaq8092.h:148
struct no_os_gpio_desc * gpio_adc_pd1
Definition: adaq8092.h:202
enum adaq8092_clk_invert adaq8092_get_clk_pol_mode(struct adaq8092_dev *dev)
Get the clock polarity mode.
Definition: adaq8092.c:356
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
@ ADAQ8092_NO_DELAY
Definition: adaq8092.h:101
enum adaq8092_data_rand adaq8092_get_data_rand_en(struct adaq8092_dev *dev)
Get the data output randomizer mode.
Definition: adaq8092.c:647
enum adaq8092_dout_modes adaq8092_get_dout_mode(struct adaq8092_dev *dev)
Get the digital output mode.
Definition: adaq8092.c:551
enum adaq8092_dout_enable dout_en
Definition: adaq8092.h:212
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
adaq8092_alt_bit_pol
Definition: adaq8092.h:153
enum adaq8092_lvds_out_current adaq8092_get_lvds_cur_mode(struct adaq8092_dev *dev)
Get the LVDS output current mode.
Definition: adaq8092.c:453
enum adaq8092_internal_term adaq8092_get_lvds_term_mode(struct adaq8092_dev *dev)
Get the LVDS internal temination device mode.
Definition: adaq8092.c:486
enum adaq8092_dout_enable adaq8092_get_dout_en(struct adaq8092_dev *dev)
Get digital outputs.
Definition: adaq8092.c:519
Header file of GPIO Interface.
adaq8092_clk_invert
Definition: adaq8092.h:94
enum adaq8092_clk_dutycycle clk_dc_mode
Definition: adaq8092.h:184
int adaq8092_set_lvds_term_mode(struct adaq8092_dev *dev, enum adaq8092_internal_term mode)
Set the LVDS internal temination mode.
Definition: adaq8092.c:465
struct no_os_gpio_desc * gpio_adc_pd2
Definition: adaq8092.h:203
enum adaq8092_data_rand data_rand_en
Definition: adaq8092.h:191
enum adaq8092_data_rand adaq8092_get_data_rand_en(struct adaq8092_dev *dev)
Get the data output randomizer mode.
Definition: adaq8092.c:647
int adaq8092_set_alt_pol_en(struct adaq8092_dev *dev, enum adaq8092_alt_bit_pol mode)
Set the alternate bit polarity mode.
Definition: adaq8092.c:594
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
enum adaq8092_twoscomp twos_comp
Definition: adaq8092.h:192
enum adaq8092_lvds_out_current adaq8092_get_lvds_cur_mode(struct adaq8092_dev *dev)
Get the LVDS output current mode.
Definition: adaq8092.c:453
enum adaq8092_alt_bit_pol adaq8092_get_alt_pol_en(struct adaq8092_dev *dev)
Get the alternate bit polarity mode.
Definition: adaq8092.c:615
struct no_os_gpio_init_param * gpio_adc_pd2_param
Definition: adaq8092.h:178
Header file of utility functions.
enum adaq8092_powerdown_modes pd_mode
Definition: adaq8092.h:181
int adaq8092_update_bits(struct adaq8092_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t reg_data)
Update specific register bits.
Definition: adaq8092.c:96
int adaq8092_read(struct adaq8092_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Read device register.
Definition: adaq8092.c:55
#define ADAQ8092_SPI_READ
Definition: adaq8092.h:49
int adaq8092_set_alt_pol_en(struct adaq8092_dev *dev, enum adaq8092_alt_bit_pol mode)
Set the alternate bit polarity mode.
Definition: adaq8092.c:594
enum adaq8092_out_test_modes test_mode
Definition: adaq8092.h:214
adaq8092_data_rand
Definition: adaq8092.h:159
@ ADAQ8092_TEST_OFF
Definition: adaq8092.h:145
@ ADAQ8092_3MA
Definition: adaq8092.h:118
@ ADAQ8092_4M5A
Definition: adaq8092.h:117
enum adaq8092_alt_bit_pol adaq8092_get_alt_pol_en(struct adaq8092_dev *dev)
Get the alternate bit polarity mode.
Definition: adaq8092.c:615
@ ADAQ8092_4MA
Definition: adaq8092.h:116
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
int adaq8092_set_dout_en(struct adaq8092_dev *dev, enum adaq8092_dout_enable mode)
Set digital outputs.
Definition: adaq8092.c:498
@ ADAQ8092_TEST_ZEROS
Definition: adaq8092.h:147
#define ADAQ8092_RESET
Definition: adaq8092.h:60
int adaq8092_set_dout_mode(struct adaq8092_dev *dev, enum adaq8092_dout_modes mode)
Set the digital output mode.
Definition: adaq8092.c:530
enum adaq8092_dout_modes dout_mode
Definition: adaq8092.h:188
Error macro definition for ARM Compiler.
enum adaq8092_internal_term adaq8092_get_lvds_term_mode(struct adaq8092_dev *dev)
Get the LVDS internal temination device mode.
Definition: adaq8092.c:486
#define ADAQ8092_RAND
Definition: adaq8092.h:79
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
int adaq8092_init(struct adaq8092_dev **device, struct adaq8092_init_param init_param)
Initialize the device.
Definition: adaq8092.c:119