no-OS
|
Header file of MAX14916 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"
Go to the source code of this file.
Macros | |
#define | MAX14916_CHANNELS 8 |
#define | MAX14916_SETOUT_REG 0x0 |
#define | MAX14916_SET_FLED_REG 0x1 |
#define | MAX14916_SET_SLED_REG 0x2 |
#define | MAX14916_INT_REG 0x3 |
#define | MAX14916_OVR_LD_REG 0x4 |
#define | MAX14916_CURR_LIM_REG 0x5 |
#define | MAX14916_OW_OFF_FAULT_REG 0x6 |
#define | MAX14916_OW_ON_FAULT_REG 0x7 |
#define | MAX14916_SHD_VDD_FAULT_REG 0x8 |
#define | MAX14916_GLOB_ERR_REG 0x9 |
#define | MAX14916_OW_OFF_EN_REG 0xA |
#define | MAX14916_OW_ON_EN_REG 0xB |
#define | MAX14916_SHD_VDD_EN_REG 0xC |
#define | MAX14916_CONFIG1_REG 0xD |
#define | MAX14916_CONFIG2_REG 0xE |
#define | MAX14916_MASK_REG 0xF |
#define | MAX14916_SETOUT_MASK(x) NO_OS_BIT(x) |
#define | MAX14916_SLED_CH_MASK(x) NO_OS_BIT(x) |
#define | MAX14916_SLED_MASK NO_OS_BIT(1) |
#define | MAX14916_FLED_MASK NO_OS_BIT(0) |
#define | MAX14916_FLED_STRETCH_MASK NO_OS_GENMASK(2, 1) |
#define | MAX14916_WD_MASK NO_OS_GENMASK(7, 6) |
#define | MAX14916_OW_OFF_CS_MASK NO_OS_GENMASK(5, 4) |
#define | MAX14916_SHT_VDD_THR_MASK NO_OS_GENMASK(3, 2) |
Functions | |
int | max14916_ch_get (struct max149x6_desc *, uint32_t, uint32_t *) |
Read the high-side state of a channel's switch. More... | |
int | max14916_ch_set (struct max149x6_desc *, uint32_t, uint32_t) |
Write the (logic) state of a channel (on/off). More... | |
int | max14916_sled_set (struct max149x6_desc *, uint32_t, enum max14916_sled_state) |
Read an output channel's current limit. More... | |
int | max14916_fled_time_set (struct max149x6_desc *, enum max14916_fled_time) |
Set FLEDs minimum on-time to requested value. More... | |
int | max14916_set_wd (struct max149x6_desc *, enum max14916_wd) |
Set watchdog timeout in the config2 register. More... | |
int | max14916_set_ow_off (struct max149x6_desc *, enum max14916_ow_off_cs) |
Set current magnitude for the ow off in the config2 register. More... | |
int | max14916_set_sht_vdd_thr (struct max149x6_desc *, enum max14916_sht_vdd_thr) |
Set short to vdd threshold in the config2 register. More... | |
int | max14916_init (struct max149x6_desc **, struct max149x6_init_param *) |
Initialize and configure the MAX14916 device. More... | |
int | max14916_remove (struct max149x6_desc *) |
Free the resources allocated during init. More... | |
Header file of MAX14916 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.
#define MAX14916_CHANNELS 8 |
#define MAX14916_CONFIG1_REG 0xD |
#define MAX14916_CONFIG2_REG 0xE |
#define MAX14916_CURR_LIM_REG 0x5 |
#define MAX14916_FLED_MASK NO_OS_BIT(0) |
#define MAX14916_FLED_STRETCH_MASK NO_OS_GENMASK(2, 1) |
#define MAX14916_GLOB_ERR_REG 0x9 |
#define MAX14916_INT_REG 0x3 |
#define MAX14916_MASK_REG 0xF |
#define MAX14916_OVR_LD_REG 0x4 |
#define MAX14916_OW_OFF_CS_MASK NO_OS_GENMASK(5, 4) |
#define MAX14916_OW_OFF_EN_REG 0xA |
#define MAX14916_OW_OFF_FAULT_REG 0x6 |
#define MAX14916_OW_ON_EN_REG 0xB |
#define MAX14916_OW_ON_FAULT_REG 0x7 |
#define MAX14916_SET_FLED_REG 0x1 |
#define MAX14916_SET_SLED_REG 0x2 |
#define MAX14916_SETOUT_MASK | ( | x | ) | NO_OS_BIT(x) |
#define MAX14916_SETOUT_REG 0x0 |
#define MAX14916_SHD_VDD_EN_REG 0xC |
#define MAX14916_SHD_VDD_FAULT_REG 0x8 |
#define MAX14916_SHT_VDD_THR_MASK NO_OS_GENMASK(3, 2) |
#define MAX14916_SLED_CH_MASK | ( | x | ) | NO_OS_BIT(x) |
#define MAX14916_SLED_MASK NO_OS_BIT(1) |
#define MAX14916_WD_MASK NO_OS_GENMASK(7, 6) |
enum max14916_fled_time |
enum max14916_ow_off_cs |
enum max14916_sht_vdd_thr |
enum max14916_sled_state |
enum max14916_wd |
int max14916_ch_get | ( | struct max149x6_desc * | desc, |
uint32_t | ch, | ||
uint32_t * | val | ||
) |
Read the high-side state of a channel's switch.
Read the state of a channel
desc | - device descriptor for the MAX14916. |
ch | - channel index (0 based). |
val | - binary value representing a channel's high-side switc state. |
int max14916_ch_set | ( | struct max149x6_desc * | desc, |
uint32_t | ch, | ||
uint32_t | val | ||
) |
Write the (logic) state of a channel (on/off).
Set the state of a channel
desc | - device descriptor for the MAX14916. |
ch | - channel index (0 based). |
val | - binary value representing a channel's voltage level (0 or 1). |
int max14916_fled_time_set | ( | struct max149x6_desc * | desc, |
enum max14916_fled_time | fled_time | ||
) |
Set FLEDs minimum on-time to requested value.
Set minimum on-time for the fault LEDs.
desc | - device descriptor for the MAX14916. |
fled_time | - minimum on-time for the FLEDs to be set. |
int max14916_init | ( | struct max149x6_desc ** | desc, |
struct max149x6_init_param * | param | ||
) |
Initialize and configure the MAX14916 device.
Initialize and configure the MAX14916 device
desc | - device descriptor for the MAX14916 that will be initialized. |
param | - initialization parameter for the device. |
int max14916_remove | ( | struct max149x6_desc * | desc | ) |
Free the resources allocated during init.
Free the resources allocated during init.
desc | - device descriptor for the MAX14916 that will be initialized. |
int max14916_set_ow_off | ( | struct max149x6_desc * | desc, |
enum max14916_ow_off_cs | ow_off_cs | ||
) |
Set current magnitude for the ow off in the config2 register.
Set current magnitude for the MAX14916 device current source.
desc | - device descriptor for the MAX14916. |
ow_off_cs | - current magnitude to be set. |
int max14916_set_sht_vdd_thr | ( | struct max149x6_desc * | desc, |
enum max14916_sht_vdd_thr | sht_vdd_thr | ||
) |
Set short to vdd threshold in the config2 register.
Set threshold for short to vdd for the MAX14916 device.
desc | - device descriptor for the MAX14916. |
sht_vdd_thr | - threshold to be set. |
int max14916_set_wd | ( | struct max149x6_desc * | desc, |
enum max14916_wd | wd | ||
) |
Set watchdog timeout in the config2 register.
Set watchdog timeout for the MAX14916 device.
desc | - device descriptor for the MAX14916. |
wd | - watchdog timer to be selected. |
int max14916_sled_set | ( | struct max149x6_desc * | desc, |
uint32_t | ch, | ||
enum max14916_sled_state | state | ||
) |
Read an output channel's current limit.
Set SLED to on/off
desc | - device descriptor for the MAX14916. |
ch | - channel index (0 based). |
state | - status led state. |
SLEDSet bit needs to be set to 1 in config1 register in order to change the SLED state.