no-OS
Classes | Macros | Enumerations | Functions | Variables
max538x.h File Reference

Header file of max538x Family Driver. More...

#include <stdint.h>
#include <stdbool.h>
#include "no_os_i2c.h"
#include "no_os_util.h"
Include dependency graph for max538x.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  max538x_chip_info
 
struct  max538x_dev
 
struct  max538x_init_param
 

Macros

#define MAX538X_RESOLUTION   0xFF
 

Enumerations

enum  max538x_type {
  MAX5380L,
  MAX5380M,
  MAX5380N,
  MAX5380K,
  MAX5381L,
  MAX5381M,
  MAX5381N,
  MAX5381K,
  MAX5382L,
  MAX5382M,
  MAX5382N,
  MAX5382K
}
 

Functions

int max538x_init (struct max538x_dev **device, struct max538x_init_param init_param)
 Initializes the communication peripheral and checks if the device is present. More...
 
int max538x_remove (struct max538x_dev *dev)
 Free the resources allocated by max538x_init(). More...
 
int max538x_set_voutput (struct max538x_dev *dev, float vout)
 Sets the DAC output voltage using vout. More...
 

Variables

const struct max538x_chip_info chip_info []
 

Detailed Description

Header file of max538x Family Driver.

Author
JSanbuen (jose..nosp@m.sanb.nosp@m.uenav.nosp@m.entu.nosp@m.ra@an.nosp@m.alog.nosp@m..com)

Copyright 2023(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ MAX538X_RESOLUTION

#define MAX538X_RESOLUTION   0xFF

Enumeration Type Documentation

◆ max538x_type

Enumerator
MAX5380L 
MAX5380M 
MAX5380N 
MAX5380K 
MAX5381L 
MAX5381M 
MAX5381N 
MAX5381K 
MAX5382L 
MAX5382M 
MAX5382N 
MAX5382K 

Function Documentation

◆ max538x_init()

int max538x_init ( struct max538x_dev **  device,
struct max538x_init_param  init_param 
)

Initializes the communication peripheral and checks if the device is present.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
ret - The result of the initialization procedure. Example: -1 - I2C peripheral wasn't initialized or the device is not present. 0 - I2C peripheral was initialized and the device is present.
Here is the caller graph for this function:

◆ max538x_remove()

int max538x_remove ( struct max538x_dev dev)

Free the resources allocated by max538x_init().

Parameters
dev- The device structure.
Returns
ret - The result of the remove procedure.
Here is the caller graph for this function:

◆ max538x_set_voutput()

int max538x_set_voutput ( struct max538x_dev dev,
float  vout 
)

Sets the DAC output voltage using vout.

Parameters
dev- The device structure.
vout- voltage output to set.
Returns
ret - 0 if no error, else return error code of I2C transaction
Here is the caller graph for this function:

Variable Documentation

◆ chip_info

const struct max538x_chip_info chip_info[]