no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
max538x.h
Go to the documentation of this file.
1/***************************************************************************/
33#ifndef __MAX538x_H__
34#define __MAX538x_H__
35
36#include <stdint.h>
37#include <stdbool.h>
38#include "no_os_i2c.h"
39#include "no_os_util.h"
40
41/* MAX5380 default resolution */
42#define MAX538X_RESOLUTION 0xFF
43
58
60 uint8_t vfactor;
61 uint8_t addr;
62};
63
65 /* I2C */
67 /* Device Settings*/
69 /* Device VDD (for MAX5382 variant) */
70 uint8_t max538x_vdd ;
71 /* Device VREF */
72 uint8_t max538x_vref ;
73};
74
76 /* I2C */
78 /* Device Settings*/
80 /* Device VDD (for MAX5382 variant) */
81 uint8_t max538x_vdd ;
82 /* Device VREF */
83 uint8_t max538x_vref ;
84};
85
86extern const struct max538x_chip_info chip_info[];
87
88/* Initializes the communications peripheral and checks if the device is present. */
91
92/* Free the resources allocated by max538x_init(). */
93int max538x_remove(struct max538x_dev *dev);
94
95/* Sets the DAC output using VOUT */
96int max538x_set_voutput(struct max538x_dev *dev, float vout);
97
98#endif /* __MAX538x_H__ */
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
int max538x_set_voutput(struct max538x_dev *dev, float vout)
Sets the DAC output voltage using vout.
Definition max538x.c:166
int max538x_init(struct max538x_dev **device, struct max538x_init_param init_param)
Initializes the communication peripheral and checks if the device is present.
Definition max538x.c:108
int max538x_remove(struct max538x_dev *dev)
Free the resources allocated by max538x_init().
Definition max538x.c:149
max538x_type
Definition max538x.h:44
@ MAX5382N
Definition max538x.h:55
@ MAX5381L
Definition max538x.h:49
@ MAX5380K
Definition max538x.h:48
@ MAX5382L
Definition max538x.h:53
@ MAX5380N
Definition max538x.h:47
@ MAX5380M
Definition max538x.h:46
@ MAX5380L
Definition max538x.h:45
@ MAX5381N
Definition max538x.h:51
@ MAX5381M
Definition max538x.h:50
@ MAX5381K
Definition max538x.h:52
@ MAX5382K
Definition max538x.h:56
@ MAX5382M
Definition max538x.h:54
Header file of I2C Interface.
Header file of utility functions.
Definition ad9361_util.h:63
Definition max538x.h:59
uint8_t vfactor
Definition max538x.h:60
uint8_t addr
Definition max538x.h:61
Definition max538x.h:64
uint8_t max538x_vdd
Definition max538x.h:70
enum max538x_type active_device
Definition max538x.h:68
struct no_os_i2c_desc * i2c_desc
Definition max538x.h:66
uint8_t max538x_vref
Definition max538x.h:72
Definition max538x.h:75
uint8_t max538x_vdd
Definition max538x.h:81
uint8_t max538x_vref
Definition max538x.h:83
enum max538x_type active_device
Definition max538x.h:79
struct no_os_i2c_init_param i2c_init
Definition max538x.h:77
Structure holding I2C address descriptor.
Definition no_os_i2c.h:89
Structure holding the parameters for I2C initialization.
Definition no_os_i2c.h:52