no-OS
Loading...
Searching...
No Matches
ad5171.h
Go to the documentation of this file.
1/***************************************************************************/
32#ifndef AD5171_H_
33#define AD5171_H_
34
35#include "../common/dpot.h"
36#include "no_os_spi.h"
37#include "no_os_i2c.h"
38#include "no_os_gpio.h"
39#include "no_os_util.h"
40
41#define ENABLE_OTP_PROGRAMMING 0x80
47 /* Interface type */
49 /* I2C init parameters */
51};
52
58 /* I2C descriptor */
60};
61
62/* AD5171 digital potentiometer ops */
63int ad5171_dpot_init(struct dpot_init_param *init_params,
64 struct dpot_dev **desc);
65int ad5171_dpot_remove(struct dpot_dev *desc);
66
67int ad5171_dpot_chn_read(struct dpot_dev *desc,
68 enum dpot_chn_type chn, uint8_t *data);
69int ad5171_dpot_chn_write(struct dpot_dev *desc,
70 enum dpot_chn_type chn, uint8_t data);
71int ad5171_dpot_send_cmd(struct dpot_dev *desc,
72 struct dpot_command *cmd);
73int ad5171_dpot_shutdown(struct dpot_dev *desc, enum dpot_chn_type chn,
74 bool shutdown_enable);
75
76#endif // AD5171_H_
int ad5171_dpot_chn_read(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Read the ad5171 digital potentiometer channel.
Definition ad5171.c:127
int ad5171_dpot_remove(struct dpot_dev *desc)
Free the memory allocated by ad5171_dpot_init().
Definition ad5171.c:100
int ad5171_dpot_init(struct dpot_init_param *init_params, struct dpot_dev **desc)
Initialize the ad5171 digital potentiometer.
Definition ad5171.c:41
int ad5171_dpot_chn_write(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
Write to the digital potentiometer channel.
Definition ad5171.c:154
int ad5171_dpot_send_cmd(struct dpot_dev *desc, struct dpot_command *cmd)
Send command word to the ad5171 digital potentiometer.
Definition ad5171.c:208
int ad5171_dpot_shutdown(struct dpot_dev *desc, enum dpot_chn_type chn, bool shutdown_enable)
dpot_chn_type
Digital potentiometer channel type.
Definition dpot.h:81
dpot_intf_type
digital potentiometer interface type.
Definition dpot.h:72
Header file of GPIO Interface.
Header file of I2C Interface.
Header file of SPI Interface.
Header file of utility functions.
ad1271/ad5273 digital potentiometer device descriptor parameters.
Definition ad5171.h:56
struct no_os_i2c_desc * i2c_desc
Definition ad5171.h:59
enum dpot_intf_type intf_type
Definition ad5171.h:57
ad5171 digital potentiometer init parameters.
Definition ad5171.h:46
enum dpot_intf_type eIntfType
Definition ad5171.h:48
struct no_os_i2c_init_param * i2c_init
Definition ad5171.h:50
Digital potentiometer command structure.
Definition dpot.h:141
Digital potentiometer device descriptor parameters.
Definition dpot.h:175
Digital potentiometer init parameters.
Definition dpot.h:157
Structure holding I2C address descriptor.
Definition no_os_i2c.h:89
Structure holding the parameters for I2C initialization.
Definition no_os_i2c.h:52