no-OS
Loading...
Searching...
No Matches
max22216.h File Reference

Current control. More...

#include <stdbool.h>
#include "no_os_gpio.h"
#include "no_os_spi.h"
#include "no_os_alloc.h"
#include "no_os_util.h"
#include "no_os_error.h"
Include dependency graph for max22216.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  max22216_reg_setting_t
 
struct  max22216_init_param
 
struct  max22216_desc
 

Macros

#define MAX22216_NR_OF_CHANNELS   4
 
#define MAX22216_K_CDR   1.017
 
#define MAX22216_GAIN   0.25
 
#define MAX22216_SNSF   1
 
#define MAX22216_GLOBAL_CTRL   0x00
 
#define MAX22216_GLOBAL_CFG   0x01
 
#define MAX22216_F_AC   0x07
 
#define MAX22216_U_AC_SCAN   0x08
 
#define MAX22216_CFG_DC_L2H_0   0x09
 
#define MAX22216_CFG_DC_H_0   0x0A
 
#define MAX22216_CFG_L2H_TIME_0   0x0C
 
#define MAX22216_CFG_CTRL0_0   0x0D
 
#define MAX22216_CFG_CTRL1_0   0x0E
 
#define MAX22216_CFG_IND_0_0   0x13
 
#define MAX22216_CFG_IND_DITHERING_BIT   11
 
#define MAX22216_CFG_P_0   0x15
 
#define MAX22216_DIAG_CURR_MON_0   0x45
 
#define MAX22216_CFG_I_0   0x16
 
#define MAX22216_FAULT0   0x65
 
#define MAX22216_FAULT1   0x66
 
#define MAX22216_CHANNEL_CONFIG_REG_SHIFT   0x14
 
#define MAX22216_DIAGNOSTICS_REG_SHIFT   0x09
 

Functions

int max22216_init (struct max22216_desc **desc, struct max22216_init_param *param)
 
int max22216_remove (struct max22216_desc *desc)
 
int max22216_write_reg (struct max22216_desc *desc, uint8_t, uint16_t)
 
int max22216_read_reg (struct max22216_desc *desc, uint8_t, uint16_t *)
 
int max22216_write_reg_list (struct max22216_desc *desc, max22216_reg_setting_t *list, uint8_t elem_nr)
 
int max22216_set_enable_pin (struct max22216_desc *desc, bool value)
 
int max22216_check_fault_pin (struct max22216_desc *desc, bool *fault_status)
 
int max22216_current_reg_control (struct max22216_desc *desc, uint8_t channel_nr, uint16_t value)
 
int max22216_set_current_ma (struct max22216_desc *desc, uint8_t channel_nr, uint16_t current_ma)
 
int max22216_turn_on (struct max22216_desc *desc, uint8_t channel_nr)
 
int max22216_turn_off (struct max22216_desc *desc, uint8_t channel_nr)
 

Detailed Description

Current control.

Author
Robert Budai (rober.nosp@m.t.bu.nosp@m.dai@a.nosp@m.nalo.nosp@m.g.com)

Copyright 2025(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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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.

Macro Definition Documentation

◆ MAX22216_CFG_CTRL0_0

#define MAX22216_CFG_CTRL0_0   0x0D

◆ MAX22216_CFG_CTRL1_0

#define MAX22216_CFG_CTRL1_0   0x0E

◆ MAX22216_CFG_DC_H_0

#define MAX22216_CFG_DC_H_0   0x0A

◆ MAX22216_CFG_DC_L2H_0

#define MAX22216_CFG_DC_L2H_0   0x09

◆ MAX22216_CFG_I_0

#define MAX22216_CFG_I_0   0x16

◆ MAX22216_CFG_IND_0_0

#define MAX22216_CFG_IND_0_0   0x13

◆ MAX22216_CFG_IND_DITHERING_BIT

#define MAX22216_CFG_IND_DITHERING_BIT   11

◆ MAX22216_CFG_L2H_TIME_0

#define MAX22216_CFG_L2H_TIME_0   0x0C

◆ MAX22216_CFG_P_0

#define MAX22216_CFG_P_0   0x15

◆ MAX22216_CHANNEL_CONFIG_REG_SHIFT

#define MAX22216_CHANNEL_CONFIG_REG_SHIFT   0x14

◆ MAX22216_DIAG_CURR_MON_0

#define MAX22216_DIAG_CURR_MON_0   0x45

◆ MAX22216_DIAGNOSTICS_REG_SHIFT

#define MAX22216_DIAGNOSTICS_REG_SHIFT   0x09

◆ MAX22216_F_AC

#define MAX22216_F_AC   0x07

◆ MAX22216_FAULT0

#define MAX22216_FAULT0   0x65

◆ MAX22216_FAULT1

#define MAX22216_FAULT1   0x66

◆ MAX22216_GAIN

#define MAX22216_GAIN   0.25

◆ MAX22216_GLOBAL_CFG

#define MAX22216_GLOBAL_CFG   0x01

◆ MAX22216_GLOBAL_CTRL

#define MAX22216_GLOBAL_CTRL   0x00

◆ MAX22216_K_CDR

#define MAX22216_K_CDR   1.017

◆ MAX22216_NR_OF_CHANNELS

#define MAX22216_NR_OF_CHANNELS   4

◆ MAX22216_SNSF

#define MAX22216_SNSF   1

◆ MAX22216_U_AC_SCAN

#define MAX22216_U_AC_SCAN   0x08

Function Documentation

◆ max22216_check_fault_pin()

int max22216_check_fault_pin ( struct max22216_desc * desc,
bool * fault_status )

◆ max22216_current_reg_control()

int max22216_current_reg_control ( struct max22216_desc * desc,
uint8_t channel_nr,
uint16_t value )
Here is the caller graph for this function:

◆ max22216_init()

int max22216_init ( struct max22216_desc ** desc,
struct max22216_init_param * param )

◆ max22216_read_reg()

int max22216_read_reg ( struct max22216_desc * desc,
uint8_t reg_addr,
uint16_t * data )
Here is the caller graph for this function:

◆ max22216_remove()

int max22216_remove ( struct max22216_desc * desc)

◆ max22216_set_current_ma()

int max22216_set_current_ma ( struct max22216_desc * desc,
uint8_t channel_nr,
uint16_t current_ma )

◆ max22216_set_enable_pin()

int max22216_set_enable_pin ( struct max22216_desc * desc,
bool value )

◆ max22216_turn_off()

int max22216_turn_off ( struct max22216_desc * desc,
uint8_t channel_nr )

◆ max22216_turn_on()

int max22216_turn_on ( struct max22216_desc * desc,
uint8_t channel_nr )

◆ max22216_write_reg()

int max22216_write_reg ( struct max22216_desc * desc,
uint8_t reg_addr,
uint16_t data )
Here is the caller graph for this function:

◆ max22216_write_reg_list()

int max22216_write_reg_list ( struct max22216_desc * desc,
max22216_reg_setting_t * list,
uint8_t elem_nr )