Source file of MAX14906 Driver. More...
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "max14906.h"
#include "no_os_util.h"
#include "no_os_alloc.h"
Functions | |
int | max14906_ch_get (struct max149x6_desc *desc, uint32_t ch, uint32_t *val) |
Read the (voltage) state of a channel (works for both input or output). | |
int | max14906_ch_set (struct max149x6_desc *desc, uint32_t ch, uint32_t val) |
Write the (logic) state of a channel (only for output channels). | |
int | max14906_ch_func (struct max149x6_desc *desc, uint32_t ch, enum max14906_function function) |
Configure a channel's function. | |
int | max14906_climit_set (struct max149x6_desc *desc, uint32_t ch, enum max14906_climit climit) |
Configure the current limit for output channels. | |
int | max14906_climit_get (struct max149x6_desc *desc, uint32_t ch, enum max14906_climit *climit) |
Read an output channel's current limit. | |
int | max14906_init (struct max149x6_desc **desc, struct max149x6_init_param *param) |
Initialize and configure the MAX14906 device. | |
int | max14906_remove (struct max149x6_desc *desc) |
Free the resources allocated during init and place all the channels in high-z. | |
Source file of MAX14906 Driver.
Copyright 2023(c) Analog Devices, Inc.
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, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 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.
int max14906_ch_func | ( | struct max149x6_desc * | desc, |
uint32_t | ch, | ||
enum max14906_function | function ) |
Configure a channel's function.
desc | - device descriptor for the MAX14906 |
ch | - channel index (0 based). |
function | - channel configuration (input, output or high-z). |
int max14906_ch_get | ( | struct max149x6_desc * | desc, |
uint32_t | ch, | ||
uint32_t * | val ) |
Read the (voltage) state of a channel (works for both input or output).
desc | - device descriptor for the MAX14906 |
ch | - channel index (0 based). |
val | - binary value representing a channel's voltage level (0 or 1). |
int max14906_ch_set | ( | struct max149x6_desc * | desc, |
uint32_t | ch, | ||
uint32_t | val ) |
Write the (logic) state of a channel (only for output channels).
desc | - device descriptor for the MAX14906 |
ch | - channel index (0 based). |
val | - binary value representing a channel's voltage level (0 or 1). |
int max14906_climit_get | ( | struct max149x6_desc * | desc, |
uint32_t | ch, | ||
enum max14906_climit * | climit ) |
Read an output channel's current limit.
desc | - device descriptor for the MAX14906 |
ch | - channel index (0 based). |
climit | - current limit value. |
int max14906_climit_set | ( | struct max149x6_desc * | desc, |
uint32_t | ch, | ||
enum max14906_climit | climit ) |
Configure the current limit for output channels.
desc | - device descriptor for the MAX14906 |
ch | - channel index (0 based). |
climit | - current limit value. |
int max14906_init | ( | struct max149x6_desc ** | desc, |
struct max149x6_init_param * | param ) |
Initialize and configure the MAX14906 device.
desc | - device descriptor for the MAX14906 that will be initialized. |
param | - initialization parameter for the device. |
int max14906_remove | ( | struct max149x6_desc * | desc | ) |
Free the resources allocated during init and place all the channels in high-z.
desc | - device descriptor for the MAX14906 that will be initialized. |