Header file of MAX14906 Driver.
More...
#include <stdint.h>
#include <stdbool.h>
#include "max149x6-base.h"
#include "no_os_gpio.h"
#include "no_os_spi.h"
#include "no_os_util.h"
|
| int | max14906_ch_get (struct max149x6_desc *, uint32_t, uint32_t *) |
| | Read the (voltage) state of a channel (works for both input or output).
|
| |
| int | max14906_ch_set (struct max149x6_desc *, uint32_t, uint32_t) |
| | Write the (logic) state of a channel (only for output channels).
|
| |
| int | max14906_ch_func (struct max149x6_desc *, uint32_t, enum max14906_function) |
| | Configure a channel's function.
|
| |
| int | max14906_climit_set (struct max149x6_desc *, uint32_t, enum max14906_climit) |
| | Configure the current limit for output channels.
|
| |
| int | max14906_climit_get (struct max149x6_desc *, uint32_t, enum max14906_climit *) |
| | Read an output channel's current limit.
|
| |
| int | max14906_init (struct max149x6_desc **, struct max149x6_init_param *) |
| | Initialize and configure the MAX14906 device.
|
| |
| int | max14906_remove (struct max149x6_desc *) |
| | Free the resources allocated during init and place all the channels in high-z.
|
| |
Header file of MAX14906 Driver.
- Author
- Ciprian Regus (cipri.nosp@m.an.r.nosp@m.egus@.nosp@m.anal.nosp@m.og.co.nosp@m.m)
Copyright 2023(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ MAX14906_CH
◆ MAX14906_CH_DIR_MASK
| #define MAX14906_CH_DIR_MASK |
( |
| x | ) |
|
Value:
#define NO_OS_BIT(x)
Definition no_os_util.h:23
◆ MAX14906_CHANNELS
| #define MAX14906_CHANNELS 4 |
◆ MAX14906_CL_MASK
| #define MAX14906_CL_MASK |
( |
| x | ) |
|
Value:
#define NO_OS_GENMASK(h, l)
Definition no_os_util.h:60
◆ MAX14906_CONFIG1_REG
| #define MAX14906_CONFIG1_REG 0xA |
◆ MAX14906_CONFIG2_REG
| #define MAX14906_CONFIG2_REG 0xB |
◆ MAX14906_CONFIG_CURR_LIM
| #define MAX14906_CONFIG_CURR_LIM 0xE |
◆ MAX14906_CONFIG_DI_REG
| #define MAX14906_CONFIG_DI_REG 0xC |
◆ MAX14906_CONFIG_DO_REG
| #define MAX14906_CONFIG_DO_REG 0xD |
◆ MAX14906_CONFIG_MASK
| #define MAX14906_CONFIG_MASK 0xF |
◆ MAX14906_DO_MASK
| #define MAX14906_DO_MASK |
( |
| x | ) |
|
◆ MAX14906_DOI_LEVEL_MASK
| #define MAX14906_DOI_LEVEL_MASK |
( |
| x | ) |
|
◆ MAX14906_DOILEVEL_REG
| #define MAX14906_DOILEVEL_REG 0x2 |
◆ MAX14906_FLED_MASK
◆ MAX14906_GLOBAL_FLT_REG
| #define MAX14906_GLOBAL_FLT_REG 0x7 |
◆ MAX14906_HIGHO_MASK
| #define MAX14906_HIGHO_MASK |
( |
| x | ) |
|
◆ MAX14906_IEC_TYPE_MASK
◆ MAX14906_INT_REG
| #define MAX14906_INT_REG 0x3 |
◆ MAX14906_OPN_WIR_FLT_REG
| #define MAX14906_OPN_WIR_FLT_REG 0x5 |
◆ MAX14906_OVR_LD_REG
| #define MAX14906_OVR_LD_REG 0x4 |
◆ MAX14906_SETLED_REG
| #define MAX14906_SETLED_REG 0x1 |
◆ MAX14906_SETOUT_REG
| #define MAX14906_SETOUT_REG 0x0 |
◆ MAX14906_SHD_VDD_FLT_REG
| #define MAX14906_SHD_VDD_FLT_REG 0x6 |
◆ MAX14906_SLED_MASK
◆ max14906_climit
Current limit options for output channels.
| Enumerator |
|---|
| MAX14906_CL_600 | |
| MAX14906_CL_130 | |
| MAX14906_CL_300 | |
| MAX14906_CL_1200 | |
◆ max14906_do_mode
Configuration options for the output driver (on each channel).
| Enumerator |
|---|
| MAX14906_HIGH_SIDE | |
| MAX14906_HIGH_SIDE_INRUSH | |
| MAX14906_PUSH_PULL_CLAMP | |
| MAX14906_PUSH_PULL | |
◆ max14906_function
Channel configuration options.
| Enumerator |
|---|
| MAX14906_OUT | |
| MAX14906_IN | |
| MAX14906_HIGH_Z | |
◆ max14906_iec_type
| Enumerator |
|---|
| MAX14906_TYPE_1_3 | |
| MAX14906_TYPE_2 | |
◆ max14906_ch_func()
Configure a channel's function.
Configure a channel's function
- Parameters
-
| desc | - device descriptor for the MAX14906 |
| ch | - channel index (0 based). |
| function | - channel configuration (input, output or high-z). |
- Returns
- 0 in case of success, negative error code otherwise
◆ max14906_ch_get()
| 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).
Read the state of a channel
- Parameters
-
| desc | - device descriptor for the MAX14906 |
| ch | - channel index (0 based). |
| val | - binary value representing a channel's voltage level (0 or 1). |
- Returns
- 0 in case of success, negative error code otherwise
◆ max14906_ch_set()
| 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).
Set the state of a channel
- Parameters
-
| desc | - device descriptor for the MAX14906 |
| ch | - channel index (0 based). |
| val | - binary value representing a channel's voltage level (0 or 1). |
- Returns
- 0 in case of success, negative error code otherwise
◆ max14906_climit_get()
Read an output channel's current limit.
Read an output channel's current limit
- Parameters
-
| desc | - device descriptor for the MAX14906 |
| ch | - channel index (0 based). |
| climit | - current limit value. |
- Returns
- 0 in case of success, negative error code otherwise
◆ max14906_climit_set()
Configure the current limit for output channels.
Configure the current limit for output channels
- Parameters
-
| desc | - device descriptor for the MAX14906 |
| ch | - channel index (0 based). |
| climit | - current limit value. |
- Returns
- 0 in case of success, negative error code otherwise
◆ max14906_init()
Initialize and configure the MAX14906 device.
Initialize and configure the MAX14906 device
- Parameters
-
| desc | - device descriptor for the MAX14906 that will be initialized. |
| param | - initialization parameter for the device. |
- Returns
- 0 in case of success, negative error code otherwise
◆ max14906_remove()
Free the resources allocated during init and place all the channels in high-z.
Free the resources allocated during init and place all the channels in high-z.
- Parameters
-
| desc | - device descriptor for the MAX14906 that will be initialized. |
- Returns
- 0 in case of success, negative error code otherwise