#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "ad5293.h"
#include "no_os_alloc.h"
#include "no_os_delay.h"
Functions | |
int32_t | ad5293_init (struct ad5293_dev **device, struct ad5293_init_param *init_param) |
Initialize the ad5293 device structure. More... | |
int32_t | ad5293_remove (struct ad5293_dev *dev) |
Free any resource used by the driver. More... | |
int32_t | ad5293_hard_reset (struct ad5293_dev *dev) |
Reset ad5293 through Hardware Reset Pin. More... | |
int32_t | ad5293_soft_reset (struct ad5293_dev *dev) |
Reset ad5293 through software reset command. More... | |
int32_t | ad5293_sdo_setfloat (struct ad5293_dev *dev) |
Place SDO pin in high impedence mode. More... | |
int32_t | ad5293_shutdown (struct ad5293_dev *dev, enum shutdown_t sd) |
Place ad5293 in shutdown mode or recovery. More... | |
int32_t | ad5293_update_cali (struct ad5293_dev *dev, enum calibration_mode_t cali, uint8_t num) |
Update ad5293 chip info struct calibration information. More... | |
int32_t | ad5293_update_wiper (struct ad5293_dev *dev, uint16_t val, uint8_t num) |
Update ad5293 chip info struct wiper value information. More... | |
int32_t | ad5293_write_cali (struct ad5293_dev *dev) |
Write ad5293 chip info struct calibration value through SPI interface. More... | |
int32_t | ad5293_write_wiper (struct ad5293_dev *dev) |
Write ad5293 chip info struct wiper value through SPI interface. More... | |
int32_t | ad5293_read_reg_cali (struct ad5293_dev *dev) |
Read ad5293 device register calibration mode through SPI interface. More... | |
int32_t | ad5293_read_reg_wiper (struct ad5293_dev *dev) |
Read ad5293 device register wiper value through SPI interface. More... | |
int8_t | ad5293_get_cali (struct ad5293_dev *dev, uint8_t num) |
Get calibration of a certain chip. More... | |
int16_t | ad5293_get_wiper (struct ad5293_dev *dev, uint8_t num) |
Get wiper of a certain chip. More... | |
int8_t ad5293_get_cali | ( | struct ad5293_dev * | dev, |
uint8_t | num | ||
) |
Get calibration of a certain chip.
return chip info struct calibration value to caller.
dev | - The device structure. |
num | - The device number.( 0 to chip_num-1) |
int16_t ad5293_get_wiper | ( | struct ad5293_dev * | dev, |
uint8_t | num | ||
) |
Get wiper of a certain chip.
return chip info struct wiper value to caller.
dev | - The device structure. |
num | - The device number.( 0 to chip_num-1) |
int32_t ad5293_hard_reset | ( | struct ad5293_dev * | dev | ) |
Reset ad5293 through Hardware Reset Pin.
dev | - The device structure. |
int32_t ad5293_init | ( | struct ad5293_dev ** | device, |
struct ad5293_init_param * | init_param | ||
) |
Initialize the ad5293 device structure.
Performs memory allocation of the device structure.
device | - Pointer to location of device structure to write. |
init_param | - Pointer to configuration of the driver. |
int32_t ad5293_read_reg_cali | ( | struct ad5293_dev * | dev | ) |
Read ad5293 device register calibration mode through SPI interface.
read ad5293 calibration value and update it to chip info struct. Note: multiple chips operation should in daisy-chain mode.
dev | - The device structure. |
int32_t ad5293_read_reg_wiper | ( | struct ad5293_dev * | dev | ) |
Read ad5293 device register wiper value through SPI interface.
read ad5293 wiper value and update it to chip info struct. Note: multiple chips operation should in daisy-chain mode.
dev | - The device structure. |
int32_t ad5293_remove | ( | struct ad5293_dev * | dev | ) |
Free any resource used by the driver.
dev | - The device structure. |
int32_t ad5293_sdo_setfloat | ( | struct ad5293_dev * | dev | ) |
Place SDO pin in high impedence mode.
Minimize power dissipation when pin is used.
dev | - The device structure. |
int32_t ad5293_shutdown | ( | struct ad5293_dev * | dev, |
enum shutdown_t | sd | ||
) |
Place ad5293 in shutdown mode or recovery.
In shut down mode, terminal A open, Wiper and terminal B connected.
dev | - The device structure. |
sd | - shutdown mode selection. |
int32_t ad5293_soft_reset | ( | struct ad5293_dev * | dev | ) |
Reset ad5293 through software reset command.
dev | - The device structure. |
int32_t ad5293_update_cali | ( | struct ad5293_dev * | dev, |
enum calibration_mode_t | cali, | ||
uint8_t | num | ||
) |
Update ad5293 chip info struct calibration information.
For calibration register write operation.
dev | - The device structure. |
cali | - calibration mode selection. |
num | - chip indication. |
int32_t ad5293_update_wiper | ( | struct ad5293_dev * | dev, |
uint16_t | val, | ||
uint8_t | num | ||
) |
Update ad5293 chip info struct wiper value information.
For wiper register write operation.
dev | - The device structure. |
val | - wiper value. |
num | - chip indication. |
int32_t ad5293_write_cali | ( | struct ad5293_dev * | dev | ) |
Write ad5293 chip info struct calibration value through SPI interface.
Note: multiple chips operation should in daisy-chain mode.
dev | - The device structure. |
int32_t ad5293_write_wiper | ( | struct ad5293_dev * | dev | ) |
Write ad5293 chip info struct wiper value through SPI interface.
Note: multiple chips operation should in daisy-chain mode.
dev | - The device structure. |