no-OS
Functions | Variables
max538x.c File Reference

Implementation of max538x Family Driver. More...

#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include "max538x.h"
#include "no_os_i2c.h"
#include "no_os_error.h"
#include "no_os_util.h"
#include "no_os_alloc.h"
Include dependency graph for max538x.c:

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

Implementation 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.

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[]