Go to the documentation of this file.
46 #define CMD_SDO_Z 0x8001
49 #define CALI_MSK NO_OS_BIT(2)
50 #define PROTECT_MSK NO_OS_BIT(1)
83 #define AD5293_W_CTRL_FRAME(pm,cali) (uint16_t)((CMD_W_CTRL<<10)|(pm<<1)|(cali<<2))
84 #define AD5293_R_CTRL_FRAME (uint16_t)CMD_R_CTRL<<10
85 #define AD5293_W_WIPER_FRAME(data) (uint16_t)((CMD_W_WIPER<<10)|data)
86 #define AD5293_R_WIPER_FRAME (uint16_t)CMD_R_WIPER<<10
87 #define SHUTDOWN_FRAME(sd) (uint16_t)((CMD_PD<<10)|sd)
88 #define RESET_FRAME (uint16_t)CMD_RESET<<10
int32_t ad5293_sdo_setfloat(struct ad5293_dev *dev)
Place SDO pin in high impedence mode.
Definition: ad5293.c:252
int16_t ad5293_get_wiper(struct ad5293_dev *dev, uint8_t num)
Get wiper of a certain chip.
Definition: ad5293.c:547
#define AD5293_R_CTRL_FRAME
Definition: ad5293.h:84
@ NO_OS_SPI_MODE_1
Definition: no_os_spi.h:63
int32_t ad5293_read_reg_wiper(struct ad5293_dev *dev)
Read ad5293 device register wiper value through SPI interface.
Definition: ad5293.c:488
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
@ DAISY_CHAIN
Definition: ad5293.h:73
struct no_os_spi_init_param spi_init
Definition: ad5293.h:109
int8_t ad5293_get_cali(struct ad5293_dev *dev, uint8_t num)
Get calibration of a certain chip.
Definition: ad5293.c:527
int32_t ad5293_sdo_setfloat(struct ad5293_dev *dev)
Place SDO pin in high impedence mode.
Definition: ad5293.c:252
operation_mode_t
Definition: ad5293.h:71
int8_t ad5293_get_cali(struct ad5293_dev *dev, uint8_t num)
Get calibration of a certain chip.
Definition: ad5293.c:527
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
int32_t ad5293_read_reg_cali(struct ad5293_dev *dev)
Read ad5293 device register calibration mode through SPI interface.
Definition: ad5293.c:448
#define AD5293_W_WIPER_FRAME(data)
Definition: ad5293.h:85
protect_mode_t
Definition: ad5293.h:59
Header file of SPI Interface.
shutdown_t
Definition: ad5293.h:65
int32_t ad5293_update_cali(struct ad5293_dev *dev, enum calibration_mode_t cali, uint8_t num)
Update ad5293 chip info struct calibration information.
Definition: ad5293.c:314
int32_t ad5293_hard_reset(struct ad5293_dev *dev)
Reset ad5293 through Hardware Reset Pin.
Definition: ad5293.c:183
int32_t ad5293_soft_reset(struct ad5293_dev *dev)
Reset ad5293 through software reset command.
Definition: ad5293.c:217
struct no_os_gpio_init_param * gpio_reset
Definition: ad5293.h:111
Header file of Delay functions.
#define CALI_MSK
Definition: ad5293.h:49
struct no_os_spi_desc * spi_desc
Definition: ad5293.h:98
#define AD5293_W_CTRL_FRAME(pm, cali)
Definition: ad5293.h:83
struct no_os_gpio_desc * gpio_reset
Definition: ad5293.h:100
Definition: ad9361_util.h:69
@ BUS
Definition: ad5293.h:72
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
struct ad5293_chip_info * chip
Definition: ad5293.h:104
uint16_t Wiper_value
Definition: ad5293.h:93
int32_t ad5293_update_cali(struct ad5293_dev *dev, enum calibration_mode_t cali, uint8_t num)
Update ad5293 chip info struct calibration information.
Definition: ad5293.c:314
enum ad7616_mode mode
Definition: ad7616.h:226
int32_t ad5293_hard_reset(struct ad5293_dev *dev)
Reset ad5293 through Hardware Reset Pin.
Definition: ad5293.c:183
@ PROTECT_LOCK
Definition: ad5293.h:60
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
@ SDO_ENABLE
Definition: ad5293.h:79
#define AD5293_R_WIPER_FRAME
Definition: ad5293.h:86
int32_t ad5293_init(struct ad5293_dev **device, struct ad5293_init_param *init_param)
Initialize the ad5293 device structure.
Definition: ad5293.c:72
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
calibration_mode_t
Definition: ad5293.h:53
#define CMD_SDO_Z
Definition: ad5293.h:46
int32_t ad5293_read_reg_cali(struct ad5293_dev *dev)
Read ad5293 device register calibration mode through SPI interface.
Definition: ad5293.c:448
uint16_t chip_num
Definition: ad5293.h:102
int32_t ad5293_update_wiper(struct ad5293_dev *dev, uint16_t val, uint8_t num)
Update ad5293 chip info struct wiper value information.
Definition: ad5293.c:339
int32_t ad5293_write_cali(struct ad5293_dev *dev)
Write ad5293 chip info struct calibration value through SPI interface.
Definition: ad5293.c:380
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
@ SDO_DISENABLE
Definition: ad5293.h:78
int32_t ad5293_write_wiper(struct ad5293_dev *dev)
Write ad5293 chip info struct wiper value through SPI interface.
Definition: ad5293.c:409
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
int16_t ad5293_get_wiper(struct ad5293_dev *dev, uint8_t num)
Get wiper of a certain chip.
Definition: ad5293.c:547
@ CALI_NORMAL
Definition: ad5293.h:55
@ CALI_PERFORMANCE
Definition: ad5293.h:54
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
#define SHUTDOWN_FRAME(sd)
Definition: ad5293.h:87
sdo_mode_t
Definition: ad5293.h:77
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
int32_t ad5293_write_cali(struct ad5293_dev *dev)
Write ad5293 chip info struct calibration value through SPI interface.
Definition: ad5293.c:380
@ NORMAL
Definition: ad5293.h:66
int32_t ad5293_shutdown(struct ad5293_dev *dev, enum shutdown_t sd)
Place ad5293 in shutdown mode or recovery.
Definition: ad5293.c:286
#define RESET_FRAME
Definition: ad5293.h:88
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
int32_t ad5293_remove(struct ad5293_dev *dev)
Free any resource used by the driver.
Definition: ad5293.c:153
int32_t ad5293_shutdown(struct ad5293_dev *dev, enum shutdown_t sd)
Place ad5293 in shutdown mode or recovery.
Definition: ad5293.c:286
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
#define NULL
Definition: wrapper.h:64
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
int32_t ad5293_update_wiper(struct ad5293_dev *dev, uint16_t val, uint8_t num)
Update ad5293 chip info struct wiper value information.
Definition: ad5293.c:339
@ PROTECT_UNLOCK
Definition: ad5293.h:61
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.
enum calibration_mode_t cali
Definition: ad5293.h:92
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
@ SHUTDOWN
Definition: ad5293.h:67
Header file of utility functions.
int32_t ad5293_remove(struct ad5293_dev *dev)
Free any resource used by the driver.
Definition: ad5293.c:153
int32_t ad5293_init(struct ad5293_dev **device, struct ad5293_init_param *init_param)
Initialize the ad5293 device structure.
Definition: ad5293.c:72
int32_t ad5293_soft_reset(struct ad5293_dev *dev)
Reset ad5293 through software reset command.
Definition: ad5293.c:217
Error macro definition for ARM Compiler.
uint16_t chip_num
Definition: ad5293.h:113
int32_t ad5293_read_reg_wiper(struct ad5293_dev *dev)
Read ad5293 device register wiper value through SPI interface.
Definition: ad5293.c:488
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
int32_t ad5293_write_wiper(struct ad5293_dev *dev)
Write ad5293 chip info struct wiper value through SPI interface.
Definition: ad5293.c:409
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75