![]() |
no-OS
|
Implementation of AD5754R Driver. More...
Functions | |
| int | ad5754r_write (struct ad5754r_dev *dev, uint8_t instr_addr, uint16_t reg_val) |
| Write device register. | |
| int | ad5754r_read (struct ad5754r_dev *dev, uint8_t instr_addr, uint16_t *reg_val) |
| Read device register. | |
| int | ad5754r_update_bits (struct ad5754r_dev *dev, uint8_t instr_addr, uint16_t mask, uint16_t reg_val) |
| Update specific register bits. | |
| int | ad5754r_update_dac_ch_register (struct ad5754r_dev *dev, uint8_t chn, uint16_t value) |
| Update DAC register value for specific channel. | |
| int | ad5754r_update_dac_all_ch_registers (struct ad5754r_dev *dev, uint16_t value) |
| Update DAC register value for all channels. | |
| int | ad5754r_ldac_trigger (struct ad5754r_dev *dev) |
| Trigger LDAC. | |
| int | ad5754r_clear_async (struct ad5754r_dev *dev) |
| Clear DAC output for all channels. | |
| int | ad5754r_read_dac_ch_register (struct ad5754r_dev *dev, uint8_t chn, uint16_t *value) |
| Read DAC register value for specific channel. | |
| int | ad5754r_dac_code_to_mvolts (struct ad5754r_dev *dev, uint8_t chn, uint16_t code, uint16_t *value) |
| Convert DAC code to millivolts for specific channel. | |
| int | ad5754r_dac_mvolts_to_code (struct ad5754r_dev *dev, uint8_t chn, uint16_t mvolts, uint16_t *code) |
| Convert DAC millivolts to code for specific channel. | |
| int | ad5754r_set_ch_range (struct ad5754r_dev *dev, uint8_t chn, enum ad5754r_dac_ch_range ch_range) |
| Set output range for specific channel. | |
| int | ad5754r_set_ch_pwrup (struct ad5754r_dev *dev, uint8_t chn, enum ad5754r_pwr_dac_ch_pwrup ch_pwrup) |
| Set power-up state for specific channel. | |
| int | ad5754r_set_current_clamp_en (struct ad5754r_dev *dev, enum ad5754r_ctrl_current_clamp_en clamp_en) |
| Apply current clamp setting for device. | |
| int | ad5754r_set_tsd_en (struct ad5754r_dev *dev, enum ad5754r_ctrl_tsd_en tsd_en) |
| Apply TSD setting for device. | |
| int | ad5754r_set_clear_mode (struct ad5754r_dev *dev, enum ad5754r_ctrl_clear_sel clear_sel) |
| Set clear mode setting for device. | |
| int | ad5754r_set_sdo_disable (struct ad5754r_dev *dev, enum ad5754r_ctrl_sdo_dis sdo_dis) |
| Set SDO Enable/Disable state for device. | |
| int | ad5754r_set_int_ref_pwrup (struct ad5754r_dev *dev, enum ad5754r_pwr_int_ref_pwrup int_ref_pwrup) |
| Set Internal Reference Enable/Disable state for device. | |
| int | ad5754r_get_oc_ch_alert (struct ad5754r_dev *dev, uint8_t chn, enum ad5754r_pwr_oc_ch_alert *oc_ch_alert) |
| Get Over-current status bit for specific channel. | |
| int | ad5754r_get_tsd_alert (struct ad5754r_dev *dev, enum ad5754r_pwr_tsd_alert *tsd_alert) |
| Get Thermal Shutdown status bit. | |
| int | ad5754r_spi_verify (struct ad5754r_dev *dev) |
| Write to and read back a register to verify SPI. | |
| int | ad5754r_gpio_init (struct ad5754r_dev *dev, struct ad5754r_init_param *init_param) |
| Do GPIO initialization and config for AD5754R. | |
| int | ad5754r_reg_init (struct ad5754r_dev *dev, struct ad5754r_init_param *init_param) |
| Initialize registers based on init parameters. | |
| int | ad5754r_init (struct ad5754r_dev **device, struct ad5754r_init_param *init_param) |
| Initialize the device. | |
| int | ad5754r_remove_gpios (struct ad5754r_dev *dev) |
| Remove GPIOs and free resources. | |
| int | ad5754r_remove (struct ad5754r_dev *dev) |
| Remove the device and release resources. | |
Variables | |
| const unsigned int | ad5754r_gain_values_scaled [AD5754R_SPAN_M10V8_TO_10V8+1] |
Implementation of AD5754R Driver.
Copyright 2023(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| int ad5754r_clear_async | ( | struct ad5754r_dev * | dev | ) |
Clear DAC output for all channels.
| dev | - The device structure. |
| int ad5754r_dac_code_to_mvolts | ( | struct ad5754r_dev * | dev, |
| uint8_t | chn, | ||
| uint16_t | code, | ||
| uint16_t * | value ) |
Convert DAC code to millivolts for specific channel.
| dev | - The device structure. |
| chn | - The index of channel being addressed. |
| code | - DAC code |
| value | - Millivolts output calculated using DAC code. |
| int ad5754r_dac_mvolts_to_code | ( | struct ad5754r_dev * | dev, |
| uint8_t | chn, | ||
| uint16_t | mvolts, | ||
| uint16_t * | code ) |
Convert DAC millivolts to code for specific channel.
| dev | - The device structure. |
| chn | - The index of channel being addressed. |
| mvolts | - Desired millivolts ouput for specific channel |
| code | - DAC code for desired output voltage |
| int ad5754r_get_oc_ch_alert | ( | struct ad5754r_dev * | dev, |
| uint8_t | chn, | ||
| enum ad5754r_pwr_oc_ch_alert * | oc_ch_alert ) |
Get Over-current status bit for specific channel.
| dev | - The device structure. |
| chn | - The index of channel being addressed. |
| oc_ch_alert | - Store channel overcurrent alert status. |
| int ad5754r_get_tsd_alert | ( | struct ad5754r_dev * | dev, |
| enum ad5754r_pwr_tsd_alert * | tsd_alert ) |
Get Thermal Shutdown status bit.
| dev | - The device structure. |
| tsd_alert | - Store TSD alert status. |
| int ad5754r_gpio_init | ( | struct ad5754r_dev * | dev, |
| struct ad5754r_init_param * | init_param ) |
Do GPIO initialization and config for AD5754R.
| dev | - The device structure. |
| init_param | - Pointer to structure containing the device initial parameters. |
| int ad5754r_init | ( | struct ad5754r_dev ** | device, |
| struct ad5754r_init_param * | init_param ) |
Initialize the device.
| device | - The device structure. |
| init_param | - Pointer to structure containing the device initial parameters. |
| int ad5754r_ldac_trigger | ( | struct ad5754r_dev * | dev | ) |
Trigger LDAC.
| dev | - The device structure. |
| int ad5754r_read | ( | struct ad5754r_dev * | dev, |
| uint8_t | instr_addr, | ||
| uint16_t * | reg_val ) |
Read device register.
| dev | - The device structure. |
| instr_addr | - The instruction address comprising register and dac channel address. |
| reg_val | - The data read from the register. |
| int ad5754r_read_dac_ch_register | ( | struct ad5754r_dev * | dev, |
| uint8_t | chn, | ||
| uint16_t * | value ) |
Read DAC register value for specific channel.
| dev | - The device structure. |
| chn | - The index of channel being addressed. |
| value | - The data read from dac channel register. |
| int ad5754r_reg_init | ( | struct ad5754r_dev * | dev, |
| struct ad5754r_init_param * | init_param ) |
Initialize registers based on init parameters.
| dev | - The device structure. |
| init_param | - Pointer to structure containing the device initial parameters. |
| int ad5754r_remove | ( | struct ad5754r_dev * | dev | ) |
Remove the device and release resources.
| dev | - The device structure. |
| int ad5754r_remove_gpios | ( | struct ad5754r_dev * | dev | ) |
Remove GPIOs and free resources.
| dev | - The device structure. |
| int ad5754r_set_ch_pwrup | ( | struct ad5754r_dev * | dev, |
| uint8_t | chn, | ||
| enum ad5754r_pwr_dac_ch_pwrup | ch_pwrup ) |
Set power-up state for specific channel.
| dev | - The device structure. |
| chn | - The index of channel being addressed. |
| ch_pwrup | - Powerup setting for specified channel. |
| int ad5754r_set_ch_range | ( | struct ad5754r_dev * | dev, |
| uint8_t | chn, | ||
| enum ad5754r_dac_ch_range | ch_range ) |
Set output range for specific channel.
| dev | - The device structure. |
| chn | - The index of channel being addressed. |
| ch_range | - Range option to be set for specified channel. |
| int ad5754r_set_clear_mode | ( | struct ad5754r_dev * | dev, |
| enum ad5754r_ctrl_clear_sel | clear_sel ) |
Set clear mode setting for device.
| dev | - The device structure. |
| clear_sel | - Clear mode setting for device. |
| int ad5754r_set_current_clamp_en | ( | struct ad5754r_dev * | dev, |
| enum ad5754r_ctrl_current_clamp_en | clamp_en ) |
Apply current clamp setting for device.
| dev | - The device structure. |
| clamp_en | - Clamp setting for device. |
| int ad5754r_set_int_ref_pwrup | ( | struct ad5754r_dev * | dev, |
| enum ad5754r_pwr_int_ref_pwrup | int_ref_pwrup ) |
Set Internal Reference Enable/Disable state for device.
| dev | - The device structure. |
| int_ref_pwrup | - Internal Reference Enable/Disable state for device. |
| int ad5754r_set_sdo_disable | ( | struct ad5754r_dev * | dev, |
| enum ad5754r_ctrl_sdo_dis | sdo_dis ) |
Set SDO Enable/Disable state for device.
| dev | - The device structure. |
| sdo_dis | - SDO Enable/Disable state for device. |
| int ad5754r_set_tsd_en | ( | struct ad5754r_dev * | dev, |
| enum ad5754r_ctrl_tsd_en | tsd_en ) |
Apply TSD setting for device.
| dev | - The device structure. |
| tsd_en | - TSD setting for device. |
| int ad5754r_spi_verify | ( | struct ad5754r_dev * | dev | ) |
Write to and read back a register to verify SPI.
| dev | - The device structure. |
| int ad5754r_update_bits | ( | struct ad5754r_dev * | dev, |
| uint8_t | instr_addr, | ||
| uint16_t | mask, | ||
| uint16_t | reg_val ) |
Update specific register bits.
| dev | - The device structure. |
| instr_addr | - The instruction address comprising register and dac channel address. |
| mask | - Specific bits mask. |
| reg_val | - The data to be written. |
| int ad5754r_update_dac_all_ch_registers | ( | struct ad5754r_dev * | dev, |
| uint16_t | value ) |
Update DAC register value for all channels.
| dev | - The device structure. |
| value | - The data to be written to the dac channel registers. |
| int ad5754r_update_dac_ch_register | ( | struct ad5754r_dev * | dev, |
| uint8_t | chn, | ||
| uint16_t | value ) |
Update DAC register value for specific channel.
| dev | - The device structure. |
| chn | - The index of channel being addressed. |
| value | - The data to be written to the dac channel. |
| int ad5754r_write | ( | struct ad5754r_dev * | dev, |
| uint8_t | instr_addr, | ||
| uint16_t | reg_val ) |
Write device register.
| dev- | The device structure. |
| instr_addr | - The instruction address comprising register and dac channel address. |
| reg_val | - The data to be written. |
| const unsigned int ad5754r_gain_values_scaled[AD5754R_SPAN_M10V8_TO_10V8+1] |