Go to the documentation of this file.
47 #define AD5628_CMD(x) ((0x000F & (int32_t)(x)) << 24)
48 #define AD5628_ADDR(x) ((0x000F & (int32_t)(x)) << 20)
49 #define AD5628_DATA_BITS(x) ((0x0FFF & (int32_t)(x)) << 8)
52 #define AD5628_CMD_WRITE_INPUT_N 0 // Write to Input Register n.
53 #define AD5628_CMD_UPDATE_DAC_N 1 // Update DAC Register n.
54 #define AD5628_CMD_WRITE_INPUT_N_UPDATE_ALL 2 // Write to Input Register n, update all.
55 #define AD5628_CMD_WRITE_INPUT_N_UPDATE_N 3 // Write to and update DAC Channel n.
56 #define AD5628_CMD_POWERDOWN 4 // Power down/power up DAC.
57 #define AD5628_CMD_LOAD_CLEAR_CODE 5 // Load clear code register.
58 #define AD5628_CMD_LOAD_LDAC_REG 6 // Load LDAC register.
59 #define AD5628_CMD_RESET 7 // Reset (power-on reset)
60 #define AD5628_CMD_SET_INT_REF 8 // Set up internal REF register.
63 #define AD5628_ADDR_DAC_A 0x00 //DAC A
64 #define AD5628_ADDR_DAC_B 0x01 //DAC B
65 #define AD5628_ADDR_DAC_C 0x02 //DAC C
66 #define AD5628_ADDR_DAC_D 0x03 //DAC D
67 #define AD5628_ADDR_DAC_E 0x04 //DAC E
68 #define AD5628_ADDR_DAC_F 0x05 //DAC F
69 #define AD5628_ADDR_DAC_G 0x06 //DAC G
70 #define AD5628_ADDR_DAC_H 0x07 //DAC H
71 #define AD5628_ADDR_DAC_ALL 0x0F //All DACs
74 #define AD5628_INT_REF_OFF 0
75 #define AD5628_INT_REF_ON 1
78 #define AD5628_POWER_MODE(x) ((0x03 & (uint16_t) (x)) << 8)
80 #define AD5628_PWRDN_NONE 0 // Normal operation
81 #define AD5628_PWRDN_1K 1 // 1 KOhm to GND (Power-down mode)
82 #define AD5628_PWRDN_100K 2 // 100 KOhm to GND (Power-down mode)
83 #define AD5628_PWRDN_3STATE 3 // Three-state (Power-down mode)
86 #define AD5628_CODE_0X0000 0
87 #define AD5628_CODE_0X8000 1
88 #define AD5628_CODE_0XFFFF 2
89 #define AD5628_CODE_NOP 3
126 uint32_t register_value);
#define AD5628_INT_REF_ON
Definition: ad5628.h:75
int32_t ad5628_init(struct ad5628_dev **device, struct ad5628_init_param init_param)
Initializes the communication peripheral and the initial Values for AD5628 Board and resets the devic...
Definition: ad5628.c:55
#define AD5628_CMD(x)
Definition: ad5628.h:47
int32_t ad5628_init(struct ad5628_dev **device, struct ad5628_init_param init_param)
Initializes the communication peripheral and the initial Values for AD5628 Board and resets the devic...
Definition: ad5628.c:55
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
Header file of SPI Interface.
void ad5628_reset(struct ad5628_dev *dev)
Resets the device.
Definition: ad5628.c:146
Header file of AD5628 Driver.
Definition: ad9361_util.h:69
int32_t ad5628_remove(struct ad5628_dev *dev)
Free the resources allocated by ad5628_init().
Definition: ad5628.c:90
#define AD5628_CMD_POWERDOWN
Definition: ad5628.h:56
int32_t ad5628_remove(struct ad5628_dev *dev)
Free the resources allocated by ad5628_init().
Definition: ad5628.c:90
void ad5628_set_input_register(struct ad5628_dev *dev, uint32_t register_value)
Writes a 32-bit data-word to the Input Register of the device.
Definition: ad5628.c:160
#define AD5628_POWER_MODE(x)
Definition: ad5628.h:78
struct no_os_spi_init_param spi_init
Definition: ad5628.h:102
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define AD5628_CMD_SET_INT_REF
Definition: ad5628.h:60
struct no_os_spi_desc * spi_desc
Definition: ad5628.h:97
void ad5628_set_input_register(struct ad5628_dev *dev, uint32_t register_value)
Writes a 32-bit data-word to the Input Register of the device.
Definition: ad5628.c:160
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
#define AD5628_CMD_LOAD_CLEAR_CODE
Definition: ad5628.h:57
#define AD5628_ADDR_DAC_ALL
Definition: ad5628.h:71
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
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
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
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
void ad5628_reset(struct ad5628_dev *dev)
Resets the device.
Definition: ad5628.c:146
void ad5628_power_mode(struct ad5628_dev *dev, uint8_t pwr_mode, uint8_t channel)
Sets the device in a specific power mode.
Definition: ad5628.c:121
#define AD5628_CODE_0X0000
Definition: ad5628.h:86
#define AD5628_CMD_RESET
Definition: ad5628.h:59
void ad5628_power_mode(struct ad5628_dev *dev, uint8_t pwr_mode, uint8_t channel)
Sets the device in a specific power mode.
Definition: ad5628.c:121
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140