39#include "no_os_error.h"
68#define DPOT_NUM_SUPPORTED_DEVICES DEV_AD5273+1
198 bool shutdown_enable);
243 bool shutdown_enable);
282 bool shutdown_enable);
struct ad5933_init_param init_params
Definition main.c:76
int dpot_nvm_write(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
Write data to NVM (non-volatile) memory.
Definition dpot.c:251
int dpot_chn_read(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Read the digital potentiometer channel.
Definition dpot.c:193
int dpot_reset(struct dpot_dev *desc)
Reset the digital potentiometer.
Definition dpot.c:81
int dpot_send_cmd(struct dpot_dev *desc, struct dpot_command *cmd)
Send command word to the digital potentiometer.
Definition dpot.c:379
int dpot_sw_lrdac_update(struct dpot_dev *desc, enum dpot_chn_type chn)
Copy input register to RDAC (software LRDAC).
Definition dpot.c:175
int dpot_enable_top_scale(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t nEnter)
Perform Enter/exit top scale.
Definition dpot.c:326
int dpot_rdac_6db_update(struct dpot_dev *desc, enum dpot_chn_type chn, enum dpot_rdac_6db_status status)
Perform RDAC 6dB increment/decrement.
Definition dpot.c:360
dpot_operating_mode
Digital potentiometer operating mode.
Definition dpot.h:107
@ DPOT_POTENTIOMETER_MODE
Definition dpot.h:109
@ DPOT_LINEAR_GAIN_SETTING_MODE
Definition dpot.h:111
int dpot_rdac_linear_update(struct dpot_dev *desc, enum dpot_chn_type chn, enum dpot_rdac_linear_status status)
Perform RDAC linear increment/decrement.
Definition dpot.c:307
dpot_dev_id
Digital potentiometer device IDs.
Definition dpot.h:44
@ DEV_AD5171
Definition dpot.h:58
@ DEV_AD5242
Definition dpot.h:60
@ DEV_AD5259
Definition dpot.h:64
@ DEV_AD5142
Definition dpot.h:51
@ DEV_AD5122A
Definition dpot.h:47
@ DEV_AD5124
Definition dpot.h:49
@ DEV_AD5123
Definition dpot.h:48
@ DEV_AD5121
Definition dpot.h:45
@ DEV_AD5143
Definition dpot.h:53
@ DEV_AD5144
Definition dpot.h:54
@ DEV_AD5122
Definition dpot.h:46
@ DEV_AD5258
Definition dpot.h:63
@ DEV_AD5161
Definition dpot.h:56
@ DEV_AD5245
Definition dpot.h:61
@ DEV_AD5141
Definition dpot.h:50
@ DEV_AD5165
Definition dpot.h:57
@ DEV_AD5160
Definition dpot.h:55
@ DEV_AD5142A
Definition dpot.h:52
@ DEV_AD5246
Definition dpot.h:62
@ DEV_AD5273
Definition dpot.h:65
@ DEV_AD5241
Definition dpot.h:59
int dpot_remove(struct dpot_dev *desc)
Free the memory allocated by dpot_init().
Definition dpot.c:65
int dpot_input_reg_read(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Read the digital potentiometer input register.
Definition dpot.c:136
int dpot_set_mid_scale(struct dpot_dev *desc, enum dpot_chn_type chn, bool shutdown_enable)
Shutdown the digital potentiometer channel.
Definition dpot.c:417
int dpot_shutdown(struct dpot_dev *desc, enum dpot_chn_type chn, bool shutdown_enable)
Shutdown the digital potentiometer channel.
Definition dpot.c:99
int dpot_copy_rdac_to_nvm(struct dpot_dev *desc, enum dpot_chn_type chn)
Copy RDAC register to NVM/EEPROM.
Definition dpot.c:270
int dpot_copy_nvm_to_rdac(struct dpot_dev *desc, enum dpot_chn_type chn)
Copy NVM/EEPROM data to RDAC.
Definition dpot.c:289
int dpot_input_reg_write(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
Write to the digital potentiometer input register.
Definition dpot.c:156
int dpot_chn_write(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
Write to the digital potentiometer channel.
Definition dpot.c:211
int dpot_set_operating_mode(struct dpot_dev *desc, enum dpot_operating_mode operating_mode)
Set the digital potentiometer operating mode.
Definition dpot.c:117
dpot_rdac_linear_status
Digital potentiometer RDAC linear update status.
Definition dpot.h:119
@ DPOT_RDAC_LINEAR_INCREMENT
Definition dpot.h:121
@ DPOT_RDAC_LINEAR_DECREMENT
Definition dpot.h:123
int dpot_nvm_read(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Read the NVM (non-volatile) memory data.
Definition dpot.c:231
int dpot_enable_bottom_scale(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t nEnter)
Perform Enter/exit top scale.
Definition dpot.c:343
dpot_rdac_6db_status
Digital potentiometer RDAC 6dB update status.
Definition dpot.h:131
@ DPOT_RDAC_6DB_DECREMENT
Definition dpot.h:135
@ DPOT_RDAC_6DB_INCREMENT
Definition dpot.h:133
dpot_chn_type
Digital potentiometer channel type.
Definition dpot.h:82
@ DPOT_CHN_RDAC1
Definition dpot.h:84
@ DPOT_CHN_R_WB2
Definition dpot.h:93
@ DPOT_CHN_RDAC4
Definition dpot.h:87
@ DPOT_CHN_R_WB3
Definition dpot.h:95
@ DPOT_CHN_R_AW1
Definition dpot.h:90
@ DPOT_CHN_R_AW4
Definition dpot.h:96
@ DPOT_CHN_RDAC3
Definition dpot.h:86
@ DPOT_CHN_RDAC2
Definition dpot.h:85
@ DPOT_CHN_R_WB4
Definition dpot.h:97
@ DPOT_CHN_R_WB1
Definition dpot.h:91
@ DPOT_CHN_R_AW3
Definition dpot.h:94
@ NUM_OF_DPOT_CHN
Definition dpot.h:98
@ DPOT_CHN_R_AW2
Definition dpot.h:92
int dpot_init(struct dpot_dev **desc, struct dpot_init_param *pDpotInitParam)
Initialize the digital potentiometer.
Definition dpot.c:40
int dpot_tolerance_read(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Send command word to the digital potentiometer.
Definition dpot.c:398
dpot_intf_type
digital potentiometer interface type.
Definition dpot.h:73
@ AD_SPI_INTERFACE
Definition dpot.h:75
@ AD_I2C_INTERFACE
Definition dpot.h:77
Digital potentiometer command structure.
Definition dpot.h:142
uint8_t control
Definition dpot.h:144
bool is_readback
Definition dpot.h:150
uint8_t data
Definition dpot.h:148
uint8_t address
Definition dpot.h:146
uint8_t response
Definition dpot.h:152
Digital potentiometer device descriptor parameters.
Definition dpot.h:176
struct dpot_ops * dpot_ops
Definition dpot.h:180
void * extra
Definition dpot.h:182
enum dpot_dev_id device_id
Definition dpot.h:178
Digital potentiometer init parameters.
Definition dpot.h:158
const struct dpot_ops * dpot_ops
Definition dpot.h:164
enum dpot_dev_id device_id
Definition dpot.h:162
void * extra
Definition dpot.h:166
enum dpot_intf_type intf_type
Definition dpot.h:160
enum dpot_operating_mode operating_mode
Definition dpot.h:168
Digital potentiometer common APIs.
Definition dpot.h:189
int(* dpot_chn_read)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Definition dpot.h:211
int(* dpot_copy_rdac_to_nvm)(struct dpot_dev *desc, enum dpot_chn_type chn)
Definition dpot.h:223
int(* dpot_remove)(struct dpot_dev *desc)
Definition dpot.h:193
int(* dpot_rdac_linear_update)(struct dpot_dev *desc, enum dpot_chn_type chn, enum dpot_rdac_linear_status status)
Definition dpot.h:227
int(* dpot_sw_lrdac_update)(struct dpot_dev *desc, enum dpot_chn_type chn)
Definition dpot.h:209
int(* dpot_send_cmd)(struct dpot_dev *desc, struct dpot_command *cmd)
Definition dpot.h:233
int(* dpot_input_reg_write)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
Definition dpot.h:206
int(* dpot_input_reg_read)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Definition dpot.h:203
int(* dpot_copy_nvm_to_rdac)(struct dpot_dev *desc, enum dpot_chn_type chn)
Definition dpot.h:225
int(* dpot_nvm_read)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Definition dpot.h:217
int(* dpot_reset)(struct dpot_dev *desc)
Definition dpot.h:195
int(* dpot_tolerance_read)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Definition dpot.h:234
int(* dpot_shutdown)(struct dpot_dev *desc, enum dpot_chn_type chn, bool shutdown_enable)
Definition dpot.h:197
int(* dpot_set_operating_mode)(struct dpot_dev *desc, enum dpot_operating_mode operating_mode)
Definition dpot.h:200
int(* dpot_enable_top_bottom_scale)(struct dpot_dev *desc, enum dpot_chn_type chn, bool isTopScale, uint8_t nEnter)
Definition dpot.h:237
int(* dpot_set_mid_scale)(struct dpot_dev *desc, enum dpot_chn_type chn, bool shutdown_enable)
Definition dpot.h:241
int(* dpot_rdac_6db_update)(struct dpot_dev *desc, enum dpot_chn_type chn, enum dpot_rdac_6db_status status)
Definition dpot.h:230
int(* dpot_nvm_write)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
Definition dpot.h:220
int(* dpot_init)(struct dpot_init_param *init_params, struct dpot_dev **desc)
Definition dpot.h:191
int(* dpot_chn_write)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
Definition dpot.h:214