40#define AD5933_REG_CONTROL_HB 0x80
41#define AD5933_REG_CONTROL_LB 0x81
42#define AD5933_REG_FREQ_START 0x82
43#define AD5933_REG_FREQ_INC 0x85
44#define AD5933_REG_INC_NUM 0x88
45#define AD5933_REG_SETTLING_CYCLES 0x8A
46#define AD5933_REG_STATUS 0x8F
47#define AD5933_REG_TEMP_DATA 0x92
48#define AD5933_REG_REAL_DATA 0x94
49#define AD5933_REG_IMAG_DATA 0x96
52#define AD5933_CONTROL_FUNCTION(x) ((x) << 4)
53#define AD5933_CONTROL_RANGE(x) ((x) << 1)
54#define AD5933_CONTROL_PGA_GAIN(x) ((x) << 0)
57#define AD5933_CONTROL_RESET (0x1 << 4)
58#define AD5933_CONTROL_INT_SYSCLK (0x0 << 3)
59#define AD5933_CONTROL_EXT_SYSCLK (0x1 << 3)
62#define AD5933_FUNCTION_NOP 0x0
63#define AD5933_FUNCTION_INIT_START_FREQ 0x1
64#define AD5933_FUNCTION_START_SWEEP 0x2
65#define AD5933_FUNCTION_INC_FREQ 0x3
66#define AD5933_FUNCTION_REPEAT_FREQ 0x4
67#define AD5933_FUNCTION_MEASURE_TEMP 0x9
68#define AD5933_FUNCTION_POWER_DOWN 0xA
69#define AD5933_FUNCTION_STANDBY 0xB
72#define AD5933_RANGE_2000mVpp 0x0
73#define AD5933_RANGE_200mVpp 0x1
74#define AD5933_RANGE_400mVpp 0x2
75#define AD5933_RANGE_1000mVpp 0x3
78#define AD5933_GAIN_X5 0
79#define AD5933_GAIN_X1 1
82#define AD5933_15_CYCLES 15
85#define AD5933_SETTLING_X1 0
86#define AD5933_SETTLING_X2 1
87#define AD5933_SETTLING_X4 3
90#define AD5933_STAT_TEMP_VALID (0x1 << 0)
91#define AD5933_STAT_DATA_VALID (0x1 << 1)
92#define AD5933_STAT_SWEEP_DONE (0x1 << 2)
95#define AD5933_ADDRESS 0x0D
98#define AD5933_BLOCK_WRITE 0xA0
99#define AD5933_BLOCK_READ 0xA1
100#define AD5933_ADDR_POINTER 0xB0
103#define AD5933_INTERNAL_SYS_CLK 16000000ul
104#define AD5933_MAX_INC_NUM 511
135 uint8_t register_address,
136 uint32_t register_value,
137 uint8_t bytes_number);
141 uint8_t register_address,
142 uint8_t bytes_number);
150 uint32_t ext_clk_freq);
171 uint8_t freq_function,
177 uint32_t calibration_impedance,
178 uint8_t freq_function);
183 uint8_t freq_function);
188 uint16_t number_cycles);
void ad5933_set_system_clk(struct ad5933_dev *dev, int8_t clk_source, uint32_t ext_clk_freq)
Selects the source of the system clock.
Definition ad5933.c:173
float ad5933_get_temperature(struct ad5933_dev *dev)
Reads the temperature from the part and returns the data in degrees Celsius.
Definition ad5933.c:227
void ad5933_start_sweep(struct ad5933_dev *dev)
Starts the sweep operation.
Definition ad5933.c:310
uint32_t ad5933_get_register_value(struct ad5933_dev *dev, uint8_t register_address, uint8_t bytes_number)
Reads the value of a register.
Definition ad5933.c:127
void ad5933_reset(struct ad5933_dev *dev)
Resets the device.
Definition ad5933.c:156
int32_t ad5933_remove(struct ad5933_dev *dev)
Free the resources allocated by ad5933_init().
Definition ad5933.c:84
void ad5933_set_range_and_gain(struct ad5933_dev *dev, int8_t range, int8_t gain)
Selects the range and gain of the device.
Definition ad5933.c:204
double ad5933_calculate_gain_factor(struct ad5933_dev *dev, uint32_t calibration_impedance, uint8_t freq_function)
Reads the real and the imaginary data and calculates the Gain Factor.
Definition ad5933.c:392
void ad5933_set_register_value(struct ad5933_dev *dev, uint8_t register_address, uint32_t register_value, uint8_t bytes_number)
Writes data into a register.
Definition ad5933.c:103
void ad5933_set_settling_time(struct ad5933_dev *dev, uint8_t mulitplier, uint16_t number_cycles)
Selects the number of settling cycles of the device.
Definition ad5933.c:449
int32_t ad5933_init(struct ad5933_dev **device, struct ad5933_init_param init_param)
Initializes the communication peripheral and the initial Values for AD5933 Board.
Definition ad5933.c:55
void ad5933_config_sweep(struct ad5933_dev *dev, uint32_t start_freq, uint32_t inc_freq, uint16_t inc_num)
Configures the sweep parameters: Start frequency, Frequency increment and Number of increments.
Definition ad5933.c:266
double ad5933_calculate_impedance(struct ad5933_dev *dev, double gain_factor, uint8_t freq_function)
Reads the real and the imaginary data and calculates the Impedance.
Definition ad5933.c:420
void ad5933_get_data(struct ad5933_dev *dev, uint8_t freq_function, short *imag_data, short *real_data)
Reads the real and imaginary value from register.
Definition ad5933.c:349
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
Header file of I2C Interface.
uint32_t current_sys_clk
Definition ad5933.h:110
struct no_os_i2c_desc * i2c_desc
Definition ad5933.h:108
uint8_t current_range
Definition ad5933.h:113
uint8_t current_clock_source
Definition ad5933.h:111
uint8_t current_gain
Definition ad5933.h:112
struct no_os_i2c_init_param i2c_init
Definition ad5933.h:118
uint8_t current_clock_source
Definition ad5933.h:121
uint8_t current_range
Definition ad5933.h:123
uint32_t current_sys_clk
Definition ad5933.h:120
uint8_t current_gain
Definition ad5933.h:122
Definition ad9361_util.h:63
Structure holding I2C address descriptor.
Definition no_os_i2c.h:89
Structure holding the parameters for I2C initialization.
Definition no_os_i2c.h:52