no-OS
Loading...
Searching...
No Matches
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.
 
int max538x_remove (struct max538x_dev *dev)
 Free the resources allocated by max538x_init().
 
int max538x_set_voutput (struct max538x_dev *dev, float vout)
 Sets the DAC output voltage using vout.
 

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.

SPDX-License-Identifier: BSD-3-Clause

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.

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

◆ 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

Variable Documentation

◆ chip_info

const struct max538x_chip_info chip_info[]