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"
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
◆ max538x_init()
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()
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
◆ chip_info