no-OS
Loading...
Searching...
No Matches
ad5242.h
Go to the documentation of this file.
1/***************************************************************************/
32#ifndef AD5242_H_
33#define AD5242_H_
34
35#define AD5242_READ_ENABLE 0x01
36#define AD5242_SHUT_DOWN_ENABLE 0x20
37#define AD5242_SHUT_DOWN_DISABLE 0x00
38/* Control word for placing the AD5161 in reset state(mid range ) */
39#define AD5242_CTL_FOR_MID_SCALE_POSITION 0x40
40
41#include "../common/dpot.h"
42#include "no_os_spi.h"
43#include "no_os_i2c.h"
44#include "no_os_gpio.h"
45#include "no_os_util.h"
46
47
53 /* Interface type */
55 /* I2C init parameters */
57 /* Digital interface select GPIO init parameters */
59};
60
67 /* I2C descriptor */
69
71};
72
73/* ad5242 digital potentiometer ops */
74int ad5242_dpot_init(struct dpot_init_param *init_params,
75 struct dpot_dev **desc);
76int ad5242_dpot_remove(struct dpot_dev *desc);
77
78int ad5242_dpot_chn_read(struct dpot_dev *desc,
79 enum dpot_chn_type chn, uint8_t *data);
80int ad5242_dpot_chn_write(struct dpot_dev *desc,
81 enum dpot_chn_type chn, uint8_t data);
83 struct dpot_command *cmd);
84int ad5242_dpot_shutdown(struct dpot_dev *desc, enum dpot_chn_type chn,
85 bool shutdown_enable);
86
87#endif // AD5242_H_
int ad5242_dpot_send_cmd(struct dpot_dev *desc, struct dpot_command *cmd)
int ad5242_dpot_remove(struct dpot_dev *desc)
Free the memory allocated by ad5242_dpot_init().
Definition ad5242.c:158
int ad5242_dpot_shutdown(struct dpot_dev *desc, enum dpot_chn_type chn, bool shutdown_enable)
Shutdown the AD5144 digital potentiometer channel.
Definition ad5242.c:252
int ad5242_dpot_chn_read(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t *data)
Read the ad5242 digital potentiometer channel.
Definition ad5242.c:221
int ad5242_dpot_init(struct dpot_init_param *init_params, struct dpot_dev **desc)
Initialize the ad5242 digital potentiometer.
Definition ad5242.c:91
int ad5242_dpot_chn_write(struct dpot_dev *desc, enum dpot_chn_type chn, uint8_t data)
Write to the digital potentiometer channel.
Definition ad5242.c:190
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.
Definition ad5242.h:65
struct no_os_gpio_desc * shdn_gpio_desc
Definition ad5242.h:70
enum dpot_intf_type intf_type
Definition ad5242.h:66
struct no_os_i2c_desc * i2c_desc
Definition ad5242.h:68
Definition ad5242.h:52
enum dpot_intf_type eIntfType
Definition ad5242.h:54
struct no_os_gpio_init_param * shdn_gpio_init
Definition ad5242.h:58
struct no_os_i2c_init_param * i2c_init
Definition ad5242.h:56
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 the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Structure holding I2C address descriptor.
Definition no_os_i2c.h:89
Structure holding the parameters for I2C initialization.
Definition no_os_i2c.h:52