Go to the documentation of this file.
48 #define AD9833_CTRLB28 (1 << 13)
49 #define AD9833_CTRLHLB (1 << 12)
50 #define AD9833_CTRLFSEL (1 << 11)
51 #define AD9833_CTRLPSEL (1 << 10)
52 #define AD9834_CTRLPINSW (1 << 9)
53 #define AD9833_CTRLRESET (1 << 8)
54 #define AD9833_CTRLSLEEP1 (1 << 7)
55 #define AD9833_CTRLSLEEP12 (1 << 6)
56 #define AD9833_CTRLOPBITEN (1 << 5)
57 #define AD9834_CTRLSIGNPIB (1 << 4)
58 #define AD9833_CTRLDIV2 (1 << 3)
59 #define AD9833_CTRLMODE (1 << 1)
62 #define AD9834_PSEL_OUT no_os_gpio_direction_output(dev->gpio_psel, \
64 #define AD9834_PSEL_LOW no_os_gpio_set_value(dev->gpio_psel, \
66 #define AD9834_PSEL_HIGH no_os_gpio_set_value(dev->gpio_psel, \
69 #define AD9834_FSEL_OUT no_os_gpio_direction_output(dev->gpio_fsel, \
71 #define AD9834_FSEL_LOW no_os_gpio_set_value(dev->gpio_fsel, \
73 #define AD9834_FSEL_HIGH no_os_gpio_set_value(dev->gpio_fsel, \
76 #define AD9834_RESET_OUT no_os_gpio_direction_output(dev->gpio_reset, \
78 #define AD9834_RESET_LOW no_os_gpio_set_value(dev->gpio_reset, \
80 #define AD9834_RESET_HIGH pio_set_value(dev->gpio_reset, \
83 #define AD9834_SLEEP_OUT no_os_gpio_direction_output(dev->gpio_sleep, \
85 #define AD9834_SLEEP_LOW no_os_gpio_set_value(dev->gpio_sleep, \
87 #define AD9834_SLEEP_HIGH no_os_gpio_set_value(dev->gpio_sleep, \
91 #define BIT_F0ADDRESS 0x4000 // Frequency Register 0 address.
92 #define BIT_F1ADDRESS 0x8000 // Frequency Register 1 address.
93 #define BIT_P0ADDRESS 0xC000 // Phase Register 0 address.
94 #define BIT_P1ADDRESS 0xE000 // Phase Register 1 address.
156 uint8_t register_number,
157 uint32_t frequency_value);
160 uint8_t register_number,
#define AD9834_SLEEP_OUT
Definition: ad9833.h:83
struct no_os_gpio_desc * gpio_psel
Definition: ad9833.h:112
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
#define AD9834_FSEL_OUT
Definition: ad9833.h:69
struct no_os_spi_desc * spi_desc
Definition: ad9833.h:110
@ ID_AD9833
Definition: ad9833.h:102
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
void ad9833_sleep_mode(struct ad9833_dev *dev, uint8_t sleep_mode)
Enable / Disable the sleep function.
Definition: ad9833.c:274
Header file of SPI Interface.
int32_t ad9833_remove(struct ad9833_dev *dev)
Free the resources allocated by ad9833_init().
Definition: ad9833.c:145
struct no_os_gpio_desc * gpio_fsel
Definition: ad9833.h:113
void ad9833_select_phase_reg(struct ad9833_dev *dev, uint8_t phase_reg)
Select the phase register to be used.
Definition: ad9833.c:419
#define AD9834_FSEL_LOW
Definition: ad9833.h:71
Header file of Delay functions.
struct no_os_gpio_init_param gpio_reset
Definition: ad9833.h:129
#define AD9833_CTRLPSEL
Definition: ad9833.h:51
Header file of AD9833 Driver for Microblaze processor.
void ad9833_set_phase(struct ad9833_dev *dev, uint8_t register_number, float phase_value)
Loads a phase value in a register.
Definition: ad9833.c:359
#define AD9833_CTRLSLEEP1
Definition: ad9833.h:54
Definition: ad9361_util.h:69
#define BIT_F1ADDRESS
Definition: ad9833.h:92
void ad9833_set_freq(struct ad9833_dev *dev, uint8_t register_number, uint32_t frequency_value)
Loads a frequency value in a register.
Definition: ad9833.c:323
void ad9833_set_phase(struct ad9833_dev *dev, uint8_t register_number, float phase_value)
Loads a phase value in a register.
Definition: ad9833.c:359
void ad9833_select_freq_reg(struct ad9833_dev *dev, uint8_t freq_reg)
Select the frequency register to be used.
Definition: ad9833.c:383
#define BIT_P0ADDRESS
Definition: ad9833.h:93
uint16_t ctrl_reg_value
Definition: ad9833.h:119
void ad9834_logic_output(struct ad9833_dev *dev, uint8_t opbiten, uint8_t signpib, uint8_t div2)
Configures the control register for logic output. (only for AD9834 & AD9838)
Definition: ad9833.c:481
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
#define AD9833_CTRLOPBITEN
Definition: ad9833.h:56
int32_t ad9833_remove(struct ad9833_dev *dev)
Free the resources allocated by ad9833_init().
Definition: ad9833.c:145
struct no_os_spi_init_param spi_init
Definition: ad9833.h:125
#define AD9833_CTRLSLEEP12
Definition: ad9833.h:55
#define AD9833_CTRLFSEL
Definition: ad9833.h:50
void ad9834_select_prog_method(struct ad9833_dev *dev, uint8_t value)
Sets the programming method. (only for AD9834 & AD9838)
Definition: ad9833.c:455
#define AD9834_PSEL_HIGH
Definition: ad9833.h:66
void ad9833_select_phase_reg(struct ad9833_dev *dev, uint8_t phase_reg)
Select the phase register to be used.
Definition: ad9833.c:419
uint8_t prog_method
Definition: ad9833.h:118
void ad9833_select_freq_reg(struct ad9833_dev *dev, uint8_t freq_reg)
Select the frequency register to be used.
Definition: ad9833.c:383
#define AD9834_FSEL_HIGH
Definition: ad9833.h:73
float freq_const
Definition: ad9833.h:137
int8_t ad9833_out_mode(struct ad9833_dev *dev, uint8_t out_mode)
Selects the type of output.
Definition: ad9833.c:205
@ ID_AD9837
Definition: ad9833.h:104
enum ad9833_type act_device
Definition: ad9833.h:132
#define AD9834_PSEL_OUT
Definition: ad9833.h:62
#define AD9834_RESET_OUT
Definition: ad9833.h:76
struct no_os_gpio_desc * gpio_sleep
Definition: ad9833.h:115
#define BIT_F0ADDRESS
Definition: ad9833.h:91
void ad9834_logic_output(struct ad9833_dev *dev, uint8_t opbiten, uint8_t signpib, uint8_t div2)
Configures the control register for logic output. (only for AD9834 & AD9838)
Definition: ad9833.c:481
enum ad9833_type act_device
Definition: ad9833.h:117
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
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define AD9834_SLEEP_HIGH
Definition: ad9833.h:87
#define AD9834_SLEEP_LOW
Definition: ad9833.h:85
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
#define AD9834_CTRLPINSW
Definition: ad9833.h:52
struct no_os_gpio_init_param gpio_fsel
Definition: ad9833.h:128
int8_t ad9833_init(struct ad9833_dev **device, struct ad9833_init_param init_param)
Initialize the SPI communication with the device.
Definition: ad9833.c:81
void ad9834_select_prog_method(struct ad9833_dev *dev, uint8_t value)
Sets the programming method. (only for AD9834 & AD9838)
Definition: ad9833.c:455
#define AD9834_RESET_LOW
Definition: ad9833.h:78
int8_t ad9833_out_mode(struct ad9833_dev *dev, uint8_t v_out_mode)
Selects the type of output.
Definition: ad9833.c:205
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
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
int8_t ad9833_init(struct ad9833_dev **device, struct ad9833_init_param init_param)
Initialize the SPI communication with the device.
Definition: ad9833.c:81
void ad9833_sleep_mode(struct ad9833_dev *dev, uint8_t sleep_mode)
Enable / Disable the sleep function.
Definition: ad9833.c:274
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
void ad9833_tx_spi(struct ad9833_dev *dev, int16_t value)
Transmits 16 bits on SPI.
Definition: ad9833.c:169
struct no_os_gpio_init_param gpio_sleep
Definition: ad9833.h:130
uint16_t test_opbiten
Definition: ad9833.h:120
#define AD9834_CTRLSIGNPIB
Definition: ad9833.h:57
uint32_t mclk
Definition: ad9833.h:136
void ad9833_tx_spi(struct ad9833_dev *dev, int16_t value)
Transmits 16 bits on SPI.
Definition: ad9833.c:169
@ ID_AD9834
Definition: ad9833.h:103
ad9833_type
Definition: ad9833.h:101
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
struct no_os_gpio_init_param gpio_psel
Definition: ad9833.h:127
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
Header file of GPIO Interface.
void ad9833_set_freq(struct ad9833_dev *dev, uint8_t register_number, uint32_t frequency_value)
Loads a frequency value in a register.
Definition: ad9833.c:323
#define AD9833_CTRLB28
Definition: ad9833.h:48
const struct max538x_chip_info chip_info[]
Definition: max538x.c:46
#define BIT_P1ADDRESS
Definition: ad9833.h:94
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
float phase_const
Definition: ad9833.c:45
#define AD9833_CTRLDIV2
Definition: ad9833.h:58
#define AD9833_CTRLMODE
Definition: ad9833.h:59
#define AD9834_PSEL_LOW
Definition: ad9833.h:64
#define AD9833_CTRLRESET
Definition: ad9833.h:53
@ ID_AD9838
Definition: ad9833.h:105
struct no_os_gpio_desc * gpio_reset
Definition: ad9833.h:114
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140