67#define DPOT_NUM_SUPPORTED_DEVICES DEV_AD5273+1
197 bool shutdown_enable);
242 bool shutdown_enable);
281 bool shutdown_enable);
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:106
@ DPOT_POTENTIOMETER_MODE
Definition dpot.h:108
@ DPOT_LINEAR_GAIN_SETTING_MODE
Definition dpot.h:110
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:118
@ DPOT_RDAC_LINEAR_INCREMENT
Definition dpot.h:120
@ DPOT_RDAC_LINEAR_DECREMENT
Definition dpot.h:122
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:130
@ DPOT_RDAC_6DB_DECREMENT
Definition dpot.h:134
@ DPOT_RDAC_6DB_INCREMENT
Definition dpot.h:132
dpot_chn_type
Digital potentiometer channel type.
Definition dpot.h:81
@ DPOT_CHN_RDAC1
Definition dpot.h:83
@ DPOT_CHN_R_WB2
Definition dpot.h:92
@ DPOT_CHN_RDAC4
Definition dpot.h:86
@ DPOT_CHN_R_WB3
Definition dpot.h:94
@ DPOT_CHN_R_AW1
Definition dpot.h:89
@ DPOT_CHN_R_AW4
Definition dpot.h:95
@ DPOT_CHN_RDAC3
Definition dpot.h:85
@ DPOT_CHN_RDAC2
Definition dpot.h:84
@ DPOT_CHN_R_WB4
Definition dpot.h:96
@ DPOT_CHN_R_WB1
Definition dpot.h:90
@ DPOT_CHN_R_AW3
Definition dpot.h:93
@ NUM_OF_DPOT_CHN
Definition dpot.h:97
@ DPOT_CHN_R_AW2
Definition dpot.h:91
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:72
@ AD_SPI_INTERFACE
Definition dpot.h:74
@ AD_I2C_INTERFACE
Definition dpot.h:76
Digital potentiometer command structure.
Definition dpot.h:141
uint8_t control
Definition dpot.h:143
bool is_readback
Definition dpot.h:149
uint8_t data
Definition dpot.h:147
uint8_t address
Definition dpot.h:145
uint8_t response
Definition dpot.h:151
Digital potentiometer device descriptor parameters.
Definition dpot.h:175
struct dpot_ops * dpot_ops
Definition dpot.h:179
void * extra
Definition dpot.h:181
enum dpot_dev_id device_id
Definition dpot.h:177
Digital potentiometer init parameters.
Definition dpot.h:157
const struct dpot_ops * dpot_ops
Definition dpot.h:163
enum dpot_dev_id device_id
Definition dpot.h:161
void * extra
Definition dpot.h:165
enum dpot_intf_type intf_type
Definition dpot.h:159
enum dpot_operating_mode operating_mode
Definition dpot.h:167
Digital potentiometer common APIs.
Definition dpot.h:188
int(* dpot_chn_read)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Definition dpot.h:210
int(* dpot_copy_rdac_to_nvm)(struct dpot_dev *desc, enum dpot_chn_type chn)
Definition dpot.h:222
int(* dpot_remove)(struct dpot_dev *desc)
Definition dpot.h:192
int(* dpot_rdac_linear_update)(struct dpot_dev *desc, enum dpot_chn_type chn, enum dpot_rdac_linear_status status)
Definition dpot.h:226
int(* dpot_sw_lrdac_update)(struct dpot_dev *desc, enum dpot_chn_type chn)
Definition dpot.h:208
int(* dpot_send_cmd)(struct dpot_dev *desc, struct dpot_command *cmd)
Definition dpot.h:232
int(* dpot_input_reg_write)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
Definition dpot.h:205
int(* dpot_input_reg_read)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Definition dpot.h:202
int(* dpot_copy_nvm_to_rdac)(struct dpot_dev *desc, enum dpot_chn_type chn)
Definition dpot.h:224
int(* dpot_nvm_read)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Definition dpot.h:216
int(* dpot_reset)(struct dpot_dev *desc)
Definition dpot.h:194
int(* dpot_tolerance_read)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Definition dpot.h:233
int(* dpot_shutdown)(struct dpot_dev *desc, enum dpot_chn_type chn, bool shutdown_enable)
Definition dpot.h:196
int(* dpot_set_operating_mode)(struct dpot_dev *desc, enum dpot_operating_mode operating_mode)
Definition dpot.h:199
int(* dpot_enable_top_bottom_scale)(struct dpot_dev *desc, enum dpot_chn_type chn, bool isTopScale, uint8_t nEnter)
Definition dpot.h:236
int(* dpot_set_mid_scale)(struct dpot_dev *desc, enum dpot_chn_type chn, bool shutdown_enable)
Definition dpot.h:240
int(* dpot_rdac_6db_update)(struct dpot_dev *desc, enum dpot_chn_type chn, enum dpot_rdac_6db_status status)
Definition dpot.h:229
int(* dpot_nvm_write)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
Definition dpot.h:219
int(* dpot_init)(struct dpot_init_param *init_params, struct dpot_dev **desc)
Definition dpot.h:190
int(* dpot_chn_write)(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
Definition dpot.h:213