Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Files

file  max2221x.h
 Public API for MAX2221X MISC driver.

Enumerations

enum  max2221x_master_chop_freq {
  MAX2221X_FREQ_100KHZ = 0 , MAX2221X_FREQ_80KHZ , MAX2221X_FREQ_60KHZ , MAX2221X_FREQ_50KHZ ,
  MAX2221X_FREQ_40KHZ , MAX2221X_FREQ_30KHZ , MAX2221X_FREQ_25KHZ , MAX2221X_FREQ_20KHZ ,
  MAX2221X_FREQ_15KHZ , MAX2221X_FREQ_10KHZ , MAX2221X_FREQ_7500HZ , MAX2221X_FREQ_5000HZ ,
  MAX2221X_FREQ_2500HZ , MAX2221X_FREQ_INVALID
}
 Master chopping frequency options. More...
enum  max2221x_individual_chop_freq {
  MAX2221X_FREQ_M = 0 , MAX2221X_FREQ_M_2 , MAX2221X_FREQ_M_4 , MAX2221X_FREQ_M_8 ,
  MAX2221X_FREQ_M_INVALID
}
 Individual channel chopping frequency divisor options. More...
enum  max2221x_fault_pin_masks {
  MAX2221X_FAULT_PIN_UVM = 0 , MAX2221X_FAULT_PIN_COMF , MAX2221X_FAULT_PIN_DPM , MAX2221X_FAULT_PIN_HHF ,
  MAX2221X_FAULT_PIN_OLF , MAX2221X_FAULT_PIN_OCP , MAX2221X_FAULT_PIN_OVT , MAX2221X_FAULT_PIN_INVALID
}
 Fault pin mask definitions. More...
enum  max2221x_vdr_mode { MAX2221X_VDR_MODE_NORMAL = 0 , MAX2221X_VDR_MODE_DUTY , MAX2221X_VDR_MODE_INVALID }
 VDR mode options. More...
enum  max2221x_vm_threshold {
  MAX2221X_VM_THRESHOLD_DISABLED = 0 , MAX2221X_VM_THRESHOLD_4500MV , MAX2221X_VM_THRESHOLD_6500MV , MAX2221X_VM_THRESHOLD_8500MV ,
  MAX2221X_VM_THRESHOLD_10500MV , MAX2221X_VM_THRESHOLD_12500MV , MAX2221X_VM_THRESHOLD_14500MV , MAX2221X_VM_THRESHOLD_16500MV ,
  MAX2221X_VM_THRESHOLD_18500MV , MAX2221X_VM_THRESHOLD_20500MV , MAX2221X_VM_THRESHOLD_22500MV , MAX2221X_VM_THRESHOLD_24500MV ,
  MAX2221X_VM_THRESHOLD_26500MV , MAX2221X_VM_THRESHOLD_28500MV , MAX2221X_VM_THRESHOLD_30500MV , MAX2221X_VM_THRESHOLD_32500MV ,
  MAX2221X_VM_THRESHOLD_INVALID
}
 VM threshold voltage levels. More...
enum  max2221x_ctrl_mode {
  MAX2221X_CTRL_MODE_VOLT = 0 , MAX2221X_CTRL_MODE_CDR , MAX2221X_CTRL_MODE_LIMITER_VOLT , MAX2221X_CTRL_MODE_VOLT_CDR ,
  MAX2221X_CTRL_MODE_INVALID
}
 Control mode options. More...
enum  max2221x_ch_freq_div {
  MAX2221X_CH_FREQ_DIV_1 = 0 , MAX2221X_CH_FREQ_DIV_2 , MAX2221X_CH_FREQ_DIV_4 , MAX2221X_CH_FREQ_DIV_8 ,
  MAX2221X_CH_FREQ_DIV_INVALID
}
 Channel frequency divisor options. More...
enum  max2221x_slew_rate {
  MAX2221X_SLEW_RATE_FAST = 0 , MAX2221X_SLEW_RATE_400V_PER_US , MAX2221X_SLEW_RATE_200V_PER_US , MAX2221X_SLEW_RATE_100V_PER_US ,
  MAX2221X_SLEW_RATE_INVALID
}
 Slew rate options. More...
enum  max2221x_gain {
  MAX2221X_SCALE_1 = 0 , MAX2221X_SCALE_2 , MAX2221X_SCALE_3 , MAX2221X_SCALE_4 ,
  MAX2221X_GAIN_INVALID
}
 Gain scale options. More...
enum  max2221x_snsf { MAX2221X_SNSF_FULL_SCALE = 0 , MAX2221X_SNSF_2_3 , MAX2221X_SNSF_1_3 , MAX2221X_SNSF_INVALID }
 Sense filter options. More...

Functions

int max2221x_set_master_chop_freq (const struct device *dev, enum max2221x_master_chop_freq freq)
 Set the master chopping frequency for the MAX2221X device.
int max2221x_get_master_chop_freq (const struct device *dev)
 Get the master chop frequency of the MAX2221X device.
int max2221x_get_channel_freq (const struct device *dev, uint8_t channel)
 Get the channel frequency of the MAX2221X device.
int max2221x_set_part_state (const struct device *dev, bool enable)
 Set the part state (enable/disable) of the MAX2221X device.
int max2221x_set_channel_state (const struct device *dev, uint8_t channel, bool enable)
 Set the channel state (enable/disable) of a channel on the MAX2221X device.
int max2221x_mask_fault_pin (const struct device *dev, enum max2221x_fault_pin_masks mask)
 Mask detection of a fault condition on the MAX2221X device.
int max2221x_unmask_fault_pin (const struct device *dev, enum max2221x_fault_pin_masks mask)
 Unmask detection of a fault condition on the MAX2221X device.
int max2221x_set_vdr_mode (const struct device *dev, enum max2221x_vdr_mode mode)
 Set the VDR mode of the MAX2221X device.
int max2221x_get_vdr_mode (const struct device *dev)
 Get the VDR mode of the MAX2221X device.
int max2221x_read_status (const struct device *dev, uint16_t *status)
 Read the status of the MAX2221X device.
int max2221x_read_vm_monitor (const struct device *dev, uint16_t *vm_monitor)
 Read the voltage monitor of the MAX2221X device.
int max2221x_set_dc_h2l (const struct device *dev, uint16_t dc_hdl)
 Set the demagnetization voltage of the MAX2221X device.
int max2221x_get_dc_h2l (const struct device *dev, uint16_t *dc_hdl)
 Get the demagnetization voltage of the MAX2221X device.
int max2221x_set_vm_upper_threshold (const struct device *dev, enum max2221x_vm_threshold threshold)
 Set the upper threshold of the supply voltage monitor of the MAX2221X device.
int max2221x_get_vm_upper_threshold (const struct device *dev)
 Get the upper threshold of the supply voltage monitor of the MAX2221X device.
int max2221x_set_vm_lower_threshold (const struct device *dev, enum max2221x_vm_threshold threshold)
 Set the lower threshold of the supply voltage monitor of the MAX2221X device.
int max2221x_get_vm_lower_threshold (const struct device *dev)
 Get the lower threshold of the supply voltage monitor of the MAX2221X device.
int max2221x_read_dc_l2h (const struct device *dev, uint16_t *dc_l2h, uint8_t channel)
 Read the DC_L2H value of channel on the MAX2221X device.
int max2221x_write_dc_l2h (const struct device *dev, uint16_t dc_l2h, uint8_t channel)
 Write the DC_L2H value of channel on the MAX2221X device.
int max2221x_read_dc_h (const struct device *dev, uint16_t *dc_h, uint8_t channel)
 Read the DC_H value of channel on the MAX2221X device.
int max2221x_write_dc_h (const struct device *dev, uint16_t dc_h, uint8_t channel)
 Write the DC_H value of channel on the MAX2221X device.
int max2221x_read_dc_l (const struct device *dev, uint16_t *dc_l, uint8_t channel)
 Read the DC_L value of channel on the MAX2221X device.
int max2221x_write_dc_l (const struct device *dev, uint16_t dc_l, uint8_t channel)
 Write the DC_L value of channel on the MAX2221X device.
int max2221x_read_time_l2h (const struct device *dev, uint16_t *time_l2h, uint8_t channel)
 Read the time L2H value of channel on the MAX2221X device.
int max2221x_write_time_l2h (const struct device *dev, uint16_t time_l2h, uint8_t channel)
 Write the time L2H value of channel on the MAX2221X device.
int max2221x_set_ctrl_mode (const struct device *dev, enum max2221x_ctrl_mode mode, uint8_t channel)
 Set the control mode of channel on the MAX2221X device.
int max2221x_get_ctrl_mode (const struct device *dev, uint8_t channel)
 Get the control mode of channel on the MAX2221X device.
int max2221x_set_ramps (const struct device *dev, uint8_t channel, uint8_t ramp_mask, bool enable)
 Set ramps on channel of the MAX2221X device.
int max2221x_set_ramp_slew_rate (const struct device *dev, uint8_t channel, uint8_t ramp_slew_rate)
 Set the ramp slew rate of channel on the MAX2221X device.
int max2221x_get_ramp_slew_rate (const struct device *dev, uint8_t channel)
 Get the ramp slew rate of channel on the MAX2221X device.
int max2221x_set_channel_chop_freq_div (const struct device *dev, uint8_t channel, enum max2221x_ch_freq_div freq_div)
 Set the chopping frequency divider of channel on the MAX2221X device.
int max2221x_get_channel_chop_freq_div (const struct device *dev, uint8_t channel)
 Get the chopping frequency divider of channel on the MAX2221X device.
int max2221x_set_slew_rate (const struct device *dev, uint8_t channel, enum max2221x_slew_rate slew_rate)
 Set the slew rate of channel on the MAX2221X device.
int max2221x_get_slew_rate (const struct device *dev, uint8_t channel)
 Get the slew rate of channel on the MAX2221X device.
int max2221x_set_gain (const struct device *dev, uint8_t channel, enum max2221x_gain gain)
 Set the digital gain for the CDR of channel on the MAX2221X device.
int max2221x_get_gain (const struct device *dev, uint8_t channel)
 Get the digital gain for the CDR of channel on the MAX2221X device.
int max2221x_set_snsf (const struct device *dev, uint8_t channel, enum max2221x_snsf snsf)
 Set the sense scaling factor of channel on the MAX2221X device.
int max2221x_get_snsf (const struct device *dev, uint8_t channel)
 Get the sense scaling factor of channel on the MAX2221X device.
int max2221x_read_pwm_dutycycle (const struct device *dev, uint8_t channel, uint16_t *duty_cycle)
 Read the PWM duty cycle of channel on the MAX2221X device.
int max2221x_read_fault0 (const struct device *dev)
 Read the fault status from FAULT0 register of the MAX2221X device.
int max2221x_read_fault1 (const struct device *dev)
 Read the fault status from FAULT1 register of the MAX2221X device.
int max2221x_set_on_time (const struct device *dev, uint8_t channel, uint16_t on_time_us)
 Set the on time of channel on the MAX2221X device.
int max2221x_get_on_time (const struct device *dev, uint8_t channel)
 Get the on time of channel on the MAX2221X device.
int max2221x_set_off_time (const struct device *dev, uint8_t channel, uint16_t off_time_us)
 Set the off time of channel on the MAX2221X device.
int max2221x_get_off_time (const struct device *dev, uint8_t channel)
 Get the off time of channel on the MAX2221X device.
int max2221x_set_stop_state (const struct device *dev, uint8_t channel, bool stop_state)
 Set the stop state of channel on the MAX2221X device.
int max2221x_get_stop_state (const struct device *dev, uint8_t channel)
 Get the stop state of channel on the MAX2221X device.
int max2221x_set_repetitions (const struct device *dev, uint8_t channel, uint16_t repetitions)
 Set the repetitions of channel on the MAX2221X device.
int max2221x_get_repetitions (const struct device *dev, uint8_t channel)
 Get the repetitions of channel on the MAX2221X device.
int max2221x_start_rapid_fire (const struct device *dev, uint8_t channel)
 Start the rapid fire mode of channel on the MAX2221X device.
int max2221x_stop_rapid_fire (const struct device *dev, uint8_t channel)
 Stop the rapid fire mode of channel on the MAX2221X device.

MAX2221X Ramp Enable/Disable Masks

#define MAX2221X_RAMP_DOWN_MASK   BIT(2)
 Ramp-down enable mask.
#define MAX2221X_RAMP_MID_MASK   BIT(1)
 Ramp-middle enable mask.
#define MAX2221X_RAMP_UP_MASK   BIT(0)
 Ramp-up enable mask.

Detailed Description

Macro Definition Documentation

◆ MAX2221X_RAMP_DOWN_MASK

#define MAX2221X_RAMP_DOWN_MASK   BIT(2)

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Ramp-down enable mask.

◆ MAX2221X_RAMP_MID_MASK

#define MAX2221X_RAMP_MID_MASK   BIT(1)

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Ramp-middle enable mask.

◆ MAX2221X_RAMP_UP_MASK

#define MAX2221X_RAMP_UP_MASK   BIT(0)

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Ramp-up enable mask.

Enumeration Type Documentation

◆ max2221x_ch_freq_div

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Channel frequency divisor options.

Enumerator
MAX2221X_CH_FREQ_DIV_1 

No frequency division.

MAX2221X_CH_FREQ_DIV_2 

Frequency divided by 2.

MAX2221X_CH_FREQ_DIV_4 

Frequency divided by 4.

MAX2221X_CH_FREQ_DIV_8 

Frequency divided by 8.

MAX2221X_CH_FREQ_DIV_INVALID 

Invalid frequency divisor sentinel.

◆ max2221x_ctrl_mode

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Control mode options.

Enumerator
MAX2221X_CTRL_MODE_VOLT 

Voltage drive mode.

MAX2221X_CTRL_MODE_CDR 

Current drive mode.

MAX2221X_CTRL_MODE_LIMITER_VOLT 

Voltage drive with current limiter mode.

MAX2221X_CTRL_MODE_VOLT_CDR 

Voltage and current drive mode.

MAX2221X_CTRL_MODE_INVALID 

Invalid control mode sentinel.

◆ max2221x_fault_pin_masks

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Fault pin mask definitions.

Enumerator
MAX2221X_FAULT_PIN_UVM 

Under Voltage Monitor fault.

MAX2221X_FAULT_PIN_COMF 

Communication Error fault.

MAX2221X_FAULT_PIN_DPM 

DPM Error fault.

MAX2221X_FAULT_PIN_HHF 

Hit current not reached error fault.

MAX2221X_FAULT_PIN_OLF 

Open-Load Fault.

MAX2221X_FAULT_PIN_OCP 

Over-Current Protection fault.

MAX2221X_FAULT_PIN_OVT 

Over-Temperature Protection fault.

MAX2221X_FAULT_PIN_INVALID 

Invalid fault pin sentinel.

◆ max2221x_gain

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Gain scale options.

Enumerator
MAX2221X_SCALE_1 

Gain scale factor 1.

MAX2221X_SCALE_2 

Gain scale factor 2.

MAX2221X_SCALE_3 

Gain scale factor 3.

MAX2221X_SCALE_4 

Gain scale factor 4.

MAX2221X_GAIN_INVALID 

Invalid gain sentinel.

◆ max2221x_individual_chop_freq

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Individual channel chopping frequency divisor options.

Enumerator
MAX2221X_FREQ_M 

Master frequency (no division).

MAX2221X_FREQ_M_2 

Master frequency divided by 2.

MAX2221X_FREQ_M_4 

Master frequency divided by 4.

MAX2221X_FREQ_M_8 

Master frequency divided by 8.

MAX2221X_FREQ_M_INVALID 

Invalid frequency divisor sentinel.

◆ max2221x_master_chop_freq

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Master chopping frequency options.

Enumerator
MAX2221X_FREQ_100KHZ 

100 kHz

MAX2221X_FREQ_80KHZ 

80 kHz

MAX2221X_FREQ_60KHZ 

60 kHz

MAX2221X_FREQ_50KHZ 

50 kHz

MAX2221X_FREQ_40KHZ 

40 kHz

MAX2221X_FREQ_30KHZ 

30 kHz

MAX2221X_FREQ_25KHZ 

25 kHz

MAX2221X_FREQ_20KHZ 

20 kHz

MAX2221X_FREQ_15KHZ 

15 kHz

MAX2221X_FREQ_10KHZ 

10 kHz

MAX2221X_FREQ_7500HZ 

7.5 kHz

MAX2221X_FREQ_5000HZ 

5 kHz

MAX2221X_FREQ_2500HZ 

2.5 kHz

MAX2221X_FREQ_INVALID 

Invalid frequency sentinel.

◆ max2221x_slew_rate

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Slew rate options.

Enumerator
MAX2221X_SLEW_RATE_FAST 

Fast slew rate.

MAX2221X_SLEW_RATE_400V_PER_US 

400 V/us slew rate

MAX2221X_SLEW_RATE_200V_PER_US 

200 V/us slew rate

MAX2221X_SLEW_RATE_100V_PER_US 

100 V/us slew rate

MAX2221X_SLEW_RATE_INVALID 

Invalid slew rate sentinel.

◆ max2221x_snsf

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Sense filter options.

Enumerator
MAX2221X_SNSF_FULL_SCALE 

Full scale sense filter.

MAX2221X_SNSF_2_3 

2/3 sense filter

MAX2221X_SNSF_1_3 

1/3 sense filter

MAX2221X_SNSF_INVALID 

Invalid sense filter sentinel.

◆ max2221x_vdr_mode

#include <zephyr/drivers/misc/max2221x/max2221x.h>

VDR mode options.

Enumerator
MAX2221X_VDR_MODE_NORMAL 

Normal Voltage mode.

MAX2221X_VDR_MODE_DUTY 

Duty Cycle mode.

MAX2221X_VDR_MODE_INVALID 

Invalid VDR mode sentinel.

◆ max2221x_vm_threshold

#include <zephyr/drivers/misc/max2221x/max2221x.h>

VM threshold voltage levels.

Enumerator
MAX2221X_VM_THRESHOLD_DISABLED 

Threshold disabled.

MAX2221X_VM_THRESHOLD_4500MV 

4500 mV threshold

MAX2221X_VM_THRESHOLD_6500MV 

6500 mV threshold

MAX2221X_VM_THRESHOLD_8500MV 

8500 mV threshold

MAX2221X_VM_THRESHOLD_10500MV 

10500 mV threshold

MAX2221X_VM_THRESHOLD_12500MV 

12500 mV threshold

MAX2221X_VM_THRESHOLD_14500MV 

14500 mV threshold

MAX2221X_VM_THRESHOLD_16500MV 

16500 mV threshold

MAX2221X_VM_THRESHOLD_18500MV 

18500 mV threshold

MAX2221X_VM_THRESHOLD_20500MV 

20500 mV threshold

MAX2221X_VM_THRESHOLD_22500MV 

22500 mV threshold

MAX2221X_VM_THRESHOLD_24500MV 

24500 mV threshold

MAX2221X_VM_THRESHOLD_26500MV 

26500 mV threshold

MAX2221X_VM_THRESHOLD_28500MV 

28500 mV threshold

MAX2221X_VM_THRESHOLD_30500MV 

30500 mV threshold

MAX2221X_VM_THRESHOLD_32500MV 

32500 mV threshold

MAX2221X_VM_THRESHOLD_INVALID 

Invalid threshold sentinel.

Function Documentation

◆ max2221x_get_channel_chop_freq_div()

int max2221x_get_channel_chop_freq_div ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the chopping frequency divider of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to get the chopping frequency divider for.
Returns
The chopping frequency divider on success, or a negative error code on failure.

◆ max2221x_get_channel_freq()

int max2221x_get_channel_freq ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the channel frequency of the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to read.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_get_ctrl_mode()

int max2221x_get_ctrl_mode ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the control mode of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to get the control mode for.
Returns
The control mode on success, or a negative error code on failure.

◆ max2221x_get_dc_h2l()

int max2221x_get_dc_h2l ( const struct device * dev,
uint16_t * dc_hdl )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the demagnetization voltage of the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
dc_hdlPointer to the variable to store the demagnetization voltage.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_get_gain()

int max2221x_get_gain ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the digital gain for the CDR of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to get the gain for.
Returns
The gain on success, or a negative error code on failure.

◆ max2221x_get_master_chop_freq()

int max2221x_get_master_chop_freq ( const struct device * dev)

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the master chop frequency of the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
Returns
The master chop frequency in Hz on success, or a negative error code on failure.

◆ max2221x_get_off_time()

int max2221x_get_off_time ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the off time of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to get the off time for.
Returns
The off time in microseconds on success, or a negative error code on failure.

◆ max2221x_get_on_time()

int max2221x_get_on_time ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the on time of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to get the on time for.
Returns
The on time in microseconds on success, or a negative error code on failure.

◆ max2221x_get_ramp_slew_rate()

int max2221x_get_ramp_slew_rate ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the ramp slew rate of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to get the ramp slew rate for.
Returns
The ramp slew rate on success, or a negative error code on failure.

◆ max2221x_get_repetitions()

int max2221x_get_repetitions ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the repetitions of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to get the repetitions for.
Returns
The repetitions on success, or a negative error code on failure.

◆ max2221x_get_slew_rate()

int max2221x_get_slew_rate ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the slew rate of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to get the slew rate for.
Returns
The slew rate on success, or a negative error code on failure.

◆ max2221x_get_snsf()

int max2221x_get_snsf ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the sense scaling factor of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to get the sense scaling factor for.
Returns
The sense scaling factor on success, or a negative error code on failure.

◆ max2221x_get_stop_state()

int max2221x_get_stop_state ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the stop state of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to get the stop state for.
Returns
The stop state on success, or a negative error code on failure.

◆ max2221x_get_vdr_mode()

int max2221x_get_vdr_mode ( const struct device * dev)

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the VDR mode of the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
Returns
The VDR mode on success, or a negative error code on failure.

◆ max2221x_get_vm_lower_threshold()

int max2221x_get_vm_lower_threshold ( const struct device * dev)

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the lower threshold of the supply voltage monitor of the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
Returns
The lower threshold in millivolts on success, or a negative error code on failure.

◆ max2221x_get_vm_upper_threshold()

int max2221x_get_vm_upper_threshold ( const struct device * dev)

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Get the upper threshold of the supply voltage monitor of the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
Returns
The upper threshold in millivolts on success, or a negative error code on failure.

◆ max2221x_mask_fault_pin()

int max2221x_mask_fault_pin ( const struct device * dev,
enum max2221x_fault_pin_masks mask )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Mask detection of a fault condition on the MAX2221X device.

Mask fault pin for overcurrent condition

Example usage:

if (ret)
printk("Failed to mask fault pin: %d\n", ret);
else
printk("Fault pin masked successfully\n");
int max2221x_mask_fault_pin(const struct device *dev, enum max2221x_fault_pin_masks mask)
Mask detection of a fault condition on the MAX2221X device.
@ MAX2221X_FAULT_PIN_OCP
Over-Current Protection fault.
Definition max2221x.h:62
Public API for MAX2221X MISC driver.
static void printk(const char *fmt,...)
Print kernel debugging message.
Definition printk.h:51
Parameters
devPointer to the device structure for the driver instance.
maskThe fault condition to mask.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_read_dc_h()

int max2221x_read_dc_h ( const struct device * dev,
uint16_t * dc_h,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Read the DC_H value of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
dc_hPointer to the variable to store the DC_H value.
channelThe channel to read the DC_H value from.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_read_dc_l()

int max2221x_read_dc_l ( const struct device * dev,
uint16_t * dc_l,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Read the DC_L value of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
dc_lPointer to the variable to store the DC_L value.
channelThe channel to read the DC_L value from.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_read_dc_l2h()

int max2221x_read_dc_l2h ( const struct device * dev,
uint16_t * dc_l2h,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Read the DC_L2H value of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
dc_l2hPointer to the variable to store the DC_L2H value.
channelThe channel to read the DC_L2H value from.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_read_fault0()

int max2221x_read_fault0 ( const struct device * dev)

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Read the fault status from FAULT0 register of the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_read_fault1()

int max2221x_read_fault1 ( const struct device * dev)

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Read the fault status from FAULT1 register of the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_read_pwm_dutycycle()

int max2221x_read_pwm_dutycycle ( const struct device * dev,
uint8_t channel,
uint16_t * duty_cycle )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Read the PWM duty cycle of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to read the PWM duty cycle from.
duty_cyclePointer to the variable to store the PWM duty cycle.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_read_status()

int max2221x_read_status ( const struct device * dev,
uint16_t * status )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Read the status of the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
statusPointer to the variable to store the status.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_read_time_l2h()

int max2221x_read_time_l2h ( const struct device * dev,
uint16_t * time_l2h,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Read the time L2H value of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
time_l2hPointer to the variable to store the time L2H value.
channelThe channel to read the time L2H value from.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_read_vm_monitor()

int max2221x_read_vm_monitor ( const struct device * dev,
uint16_t * vm_monitor )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Read the voltage monitor of the MAX2221X device.

VM Measurement is calculated as:

VM = KVM x vm_monitor where KVM = 9.73 mV

Parameters
devPointer to the device structure for the driver instance.
vm_monitorPointer to the variable to store the voltage monitor.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_channel_chop_freq_div()

int max2221x_set_channel_chop_freq_div ( const struct device * dev,
uint8_t channel,
enum max2221x_ch_freq_div freq_div )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the chopping frequency divider of channel on the MAX2221X device.

Set channel chopping frequency divider to 1

Example usage:

if (ret)
printk("Failed to set channel chopping frequency divider: %d\n", ret);
else
printk("Channel chopping frequency divider set successfully\n");
int max2221x_set_channel_chop_freq_div(const struct device *dev, uint8_t channel, enum max2221x_ch_freq_div freq_div)
Set the chopping frequency divider of channel on the MAX2221X device.
@ MAX2221X_CH_FREQ_DIV_1
No frequency division.
Definition max2221x.h:110
Parameters
devPointer to the device structure for the driver instance.
channelThe channel to set the chopping frequency divider for.
freq_divThe desired chopping frequency divider to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_channel_state()

int max2221x_set_channel_state ( const struct device * dev,
uint8_t channel,
bool enable )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the channel state (enable/disable) of a channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to set the state for.
enableTrue to enable the channel, false to disable.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_ctrl_mode()

int max2221x_set_ctrl_mode ( const struct device * dev,
enum max2221x_ctrl_mode mode,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the control mode of channel on the MAX2221X device.

Set control mode for DC motor drive for channel 1

Example usage:

if (ret)
printk("Failed to set control mode: %d\n", ret);
else
printk("Control mode set successfully\n");
int max2221x_set_ctrl_mode(const struct device *dev, enum max2221x_ctrl_mode mode, uint8_t channel)
Set the control mode of channel on the MAX2221X device.
@ MAX2221X_CTRL_MODE_LIMITER_VOLT
Voltage drive with current limiter mode.
Definition max2221x.h:102
Parameters
devPointer to the device structure for the driver instance.
modeThe desired control mode to set.
channelThe channel to set the control mode for.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_dc_h2l()

int max2221x_set_dc_h2l ( const struct device * dev,
uint16_t dc_hdl )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the demagnetization voltage of the MAX2221X device.

If mode is MAX2221X_VDR_MODE_DUTY, dc_hdl represents a voltage. The voltage value is calculated as VOUT (V) = KVDR x 36 x dc_hdl. If mode is MAX2221X_VDR_MODE_NORMAL, dc_hdl represents a duty cycle. The voltage value is calculated as VOUT (V) = KVDR x VM x dc_hdl. Here, KVDR = 30.518 uV.

Parameters
devPointer to the device structure for the driver instance.
dc_hdlThe desired demagnetization voltage to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_gain()

int max2221x_set_gain ( const struct device * dev,
uint8_t channel,
enum max2221x_gain gain )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the digital gain for the CDR of channel on the MAX2221X device.

Set gain to 1 for channel 1

Example usage:

if (ret)
printk("Failed to set gain: %d\n", ret);
else
printk("Gain set successfully\n");
int max2221x_set_gain(const struct device *dev, uint8_t channel, enum max2221x_gain gain)
Set the digital gain for the CDR of channel on the MAX2221X device.
@ MAX2221X_SCALE_1
Gain scale factor 1.
Definition max2221x.h:130
Parameters
devPointer to the device structure for the driver instance.
channelThe channel to set the gain for.
gainThe desired gain to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_master_chop_freq()

int max2221x_set_master_chop_freq ( const struct device * dev,
enum max2221x_master_chop_freq freq )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the master chopping frequency for the MAX2221X device.

Set master chop frequency to 50kHz

Example usage:

if (ret)
printk("Failed to set master chop frequency: %d\n", ret);
else
printk("Master chop frequency set successfully\n");
int max2221x_set_master_chop_freq(const struct device *dev, enum max2221x_master_chop_freq freq)
Set the master chopping frequency for the MAX2221X device.
@ MAX2221X_FREQ_50KHZ
50 kHz
Definition max2221x.h:31
Parameters
devPointer to the device structure for the driver instance.
freqThe desired master chopping frequency to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_off_time()

int max2221x_set_off_time ( const struct device * dev,
uint8_t channel,
uint16_t off_time_us )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the off time of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to set the off time for.
off_time_usThe desired off time to set in microseconds.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_on_time()

int max2221x_set_on_time ( const struct device * dev,
uint8_t channel,
uint16_t on_time_us )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the on time of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to set the on time for.
on_time_usThe desired on time to set in microseconds.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_part_state()

int max2221x_set_part_state ( const struct device * dev,
bool enable )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the part state (enable/disable) of the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
enableTrue to enable the part, false to disable.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_ramp_slew_rate()

int max2221x_set_ramp_slew_rate ( const struct device * dev,
uint8_t channel,
uint8_t ramp_slew_rate )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the ramp slew rate of channel on the MAX2221X device.

Sets the Ramp Slew Rate. VDRDUTY: Ramp Slew Rate (V/ms) = KVDR x VM x (ramp_slew_rate + 1) x F_PWM (kHz) VDR: Ramp Slew Rate (V/ms) = KVDR x 36 x (ramp_slew_rate + 1) x F_PWM (kHz) CDR: Ramp Slew Rate (mA/ms) = KCDR x GAIN x SNSF x (ramp_slew_rate + 1) x F_PWM (kHz)

where KVDR = 30.518 uV, KCDR = 1.017 mA (MAX22216) or 0.339 mA (MAX22217), F_PWM is the channel chopping frequency.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to set the ramp slew rate for.
ramp_slew_rateThe desired ramp slew rate to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_ramps()

int max2221x_set_ramps ( const struct device * dev,
uint8_t channel,
uint8_t ramp_mask,
bool enable )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set ramps on channel of the MAX2221X device.

This is the base function that enables or disables ramps based on the enable parameter. Use max2221x_enable_ramps() or max2221x_disable_ramps() for specific enable/disable operations.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to set the ramps for.
ramp_maskThe ramp mask indicating which ramps to modify.
enableTrue to enable the specified ramps, false to disable.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_repetitions()

int max2221x_set_repetitions ( const struct device * dev,
uint8_t channel,
uint16_t repetitions )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the repetitions of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to set the repetitions for.
repetitionsThe desired repetitions to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_slew_rate()

int max2221x_set_slew_rate ( const struct device * dev,
uint8_t channel,
enum max2221x_slew_rate slew_rate )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the slew rate of channel on the MAX2221X device.

Set slew rate to 400V/us for channel 1

Example usage:

if (ret)
printk("Failed to set slew rate: %d\n", ret);
else
printk("Slew rate set successfully\n");
int max2221x_set_slew_rate(const struct device *dev, uint8_t channel, enum max2221x_slew_rate slew_rate)
Set the slew rate of channel on the MAX2221X device.
@ MAX2221X_SLEW_RATE_400V_PER_US
400 V/us slew rate
Definition max2221x.h:121
Parameters
devPointer to the device structure for the driver instance.
channelThe channel to set the slew rate for.
slew_rateThe desired slew rate to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_snsf()

int max2221x_set_snsf ( const struct device * dev,
uint8_t channel,
enum max2221x_snsf snsf )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the sense scaling factor of channel on the MAX2221X device.

Set sense scaling factor 2/3 for channel 1

Example usage:

if (ret)
printk("Failed to set sense scaling factor: %d\n", ret);
else
printk("Sense scaling factor set successfully\n");
int max2221x_set_snsf(const struct device *dev, uint8_t channel, enum max2221x_snsf snsf)
Set the sense scaling factor of channel on the MAX2221X device.
@ MAX2221X_SNSF_2_3
2/3 sense filter
Definition max2221x.h:141
Parameters
devPointer to the device structure for the driver instance.
channelThe channel to set the sense scaling factor for.
snsfThe desired sense scaling factor to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_stop_state()

int max2221x_set_stop_state ( const struct device * dev,
uint8_t channel,
bool stop_state )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the stop state of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to set the stop state for.
stop_stateThe desired stop state to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_vdr_mode()

int max2221x_set_vdr_mode ( const struct device * dev,
enum max2221x_vdr_mode mode )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the VDR mode of the MAX2221X device.

Set VDR mode to VDRDUTY

Example usage:

if (ret)
printk("Failed to set VDR mode: %d\n", ret);
else
printk("VDR mode set successfully\n");
int max2221x_set_vdr_mode(const struct device *dev, enum max2221x_vdr_mode mode)
Set the VDR mode of the MAX2221X device.
@ MAX2221X_VDR_MODE_DUTY
Duty Cycle mode.
Definition max2221x.h:71
Parameters
devPointer to the device structure for the driver instance.
modeThe VDR mode to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_vm_lower_threshold()

int max2221x_set_vm_lower_threshold ( const struct device * dev,
enum max2221x_vm_threshold threshold )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the lower threshold of the supply voltage monitor of the MAX2221X device.

Set lower threshold to 4500 mV

Example usage:

if (ret)
printk("Failed to set lower threshold: %d\n", ret);
else
printk("Lower threshold set successfully\n");
int max2221x_set_vm_lower_threshold(const struct device *dev, enum max2221x_vm_threshold threshold)
Set the lower threshold of the supply voltage monitor of the MAX2221X device.
@ MAX2221X_VM_THRESHOLD_4500MV
4500 mV threshold
Definition max2221x.h:79
Parameters
devPointer to the device structure for the driver instance.
thresholdThe desired lower threshold to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_set_vm_upper_threshold()

int max2221x_set_vm_upper_threshold ( const struct device * dev,
enum max2221x_vm_threshold threshold )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Set the upper threshold of the supply voltage monitor of the MAX2221X device.

Set upper threshold to 4500 mV

Example usage:

if (ret)
printk("Failed to set upper threshold: %d\n", ret);
else
printk("Upper threshold set successfully\n");
int max2221x_set_vm_upper_threshold(const struct device *dev, enum max2221x_vm_threshold threshold)
Set the upper threshold of the supply voltage monitor of the MAX2221X device.
Parameters
devPointer to the device structure for the driver instance.
thresholdThe desired upper threshold to set.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_start_rapid_fire()

int max2221x_start_rapid_fire ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Start the rapid fire mode of channel on the MAX2221X device.

Set rapid fire parameters and start rapid fire mode. The example below demonstrates how to configure the on time (1000 us), off time (1000 us), stop state (true), and repetitions (10) before starting the rapid fire mode.

Note
Usually, set on time, off time, repetitions, and stop state before starting rapid fire mode.

Example usage:

int ret;
ret = max2221x_set_on_time(dev, channel, 1000);
if (ret) {
printk("Failed to set on time: %d\n", ret);
return ret;
}
ret = max2221x_set_off_time(dev, channel, 1000);
if (ret) {
printk("Failed to set off time: %d\n", ret);
return ret;
}
ret = max2221x_set_stop_state(dev, channel, true);
if (ret) {
printk("Failed to set stop state: %d\n", ret);
return ret;
}
ret = max2221x_set_repetitions(dev, channel, 10);
if (ret) {
printk("Failed to set repetitions: %d\n", ret);
return ret;
}
ret = max2221x_start_rapid_fire(dev, channel);
if (ret) {
printk("Failed to start rapid fire mode: %d\n", ret);
} else {
printk("Rapid fire mode started successfully\n");
}
int max2221x_set_on_time(const struct device *dev, uint8_t channel, uint16_t on_time_us)
Set the on time of channel on the MAX2221X device.
int max2221x_set_off_time(const struct device *dev, uint8_t channel, uint16_t off_time_us)
Set the off time of channel on the MAX2221X device.
int max2221x_start_rapid_fire(const struct device *dev, uint8_t channel)
Start the rapid fire mode of channel on the MAX2221X device.
int max2221x_set_stop_state(const struct device *dev, uint8_t channel, bool stop_state)
Set the stop state of channel on the MAX2221X device.
int max2221x_set_repetitions(const struct device *dev, uint8_t channel, uint16_t repetitions)
Set the repetitions of channel on the MAX2221X device.
Parameters
devPointer to the device structure for the driver instance.
channelThe channel to start the rapid fire mode for.
Return values
0on success.
-errnoNegative error code on failure.

◆ max2221x_stop_rapid_fire()

int max2221x_stop_rapid_fire ( const struct device * dev,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Stop the rapid fire mode of channel on the MAX2221X device.

Parameters
devPointer to the device structure for the driver instance.
channelThe channel to stop the rapid fire mode for.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_unmask_fault_pin()

int max2221x_unmask_fault_pin ( const struct device * dev,
enum max2221x_fault_pin_masks mask )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Unmask detection of a fault condition on the MAX2221X device.

Unmask fault pin for overcurrent condition

Example usage:

if (ret)
printk("Failed to unmask fault pin: %d\n", ret);
else
printk("Fault pin unmasked successfully\n");
int max2221x_unmask_fault_pin(const struct device *dev, enum max2221x_fault_pin_masks mask)
Unmask detection of a fault condition on the MAX2221X device.
Parameters
devPointer to the device structure for the driver instance.
maskThe fault condition to unmask.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_write_dc_h()

int max2221x_write_dc_h ( const struct device * dev,
uint16_t dc_h,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Write the DC_H value of channel on the MAX2221X device.

Sets the DC_H level: VDR: VOUT (V) = KVDR x 36 x dc_h VDRDUTY: VOUT (V) = KVDR x VM x dc_h CDR: IOUT (mA) = KCDR x GAIN x SNSF x dc_h where KVDR = 30.518 uV, KCDR = 1.017 mA (MAX22216) or 0.339 mA (MAX22217).

Parameters
devPointer to the device structure for the driver instance.
dc_hThe desired DC_H value to write.
channelThe channel to write the DC_H value to.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_write_dc_l()

int max2221x_write_dc_l ( const struct device * dev,
uint16_t dc_l,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Write the DC_L value of channel on the MAX2221X device.

Sets the DC_L level: VDR: VOUT (V) = KVDR x 36 x dc_l VDRDUTY: VOUT (V) = KVDR x VM x dc_l CDR: IOUT (mA) = KCDR x GAIN x SNSF x dc_l where KVDR = 30.518 uV, KCDR = 1.017 mA (MAX22216) or 0.339 mA (MAX22217).

Parameters
devPointer to the device structure for the driver instance.
dc_lThe desired DC_L value to write.
channelThe channel to write the DC_L value to.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_write_dc_l2h()

int max2221x_write_dc_l2h ( const struct device * dev,
uint16_t dc_l2h,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Write the DC_L2H value of channel on the MAX2221X device.

Sets the DC_L2H level: VDR: VOUT (V) = KVDR x 36 x dc_l2h VDRDUTY: VOUT (V) = KVDR x VM x dc_l2h CDR: IOUT (mA) = KCDR x GAIN x SNSF x dc_l2h where KVDR = 30.518 uV, KCDR = 1.017 mA (MAX22216) or 0.339 mA (MAX22217).

Parameters
devPointer to the device structure for the driver instance.
dc_l2hThe desired DC_L2H value to write.
channelThe channel to write the DC_L2H value to.
Returns
0 on success, or a negative error code on failure.

◆ max2221x_write_time_l2h()

int max2221x_write_time_l2h ( const struct device * dev,
uint16_t time_l2h,
uint8_t channel )

#include <zephyr/drivers/misc/max2221x/max2221x.h>

Write the time L2H value of channel on the MAX2221X device.

Sets the time L2H level: TIME_L2H (s) = time_l2h / channel chopping frequency

Parameters
devPointer to the device structure for the driver instance.
time_l2hThe desired time L2H value to write.
channelThe channel to write the time L2H value to.
Returns
0 on success, or a negative error code on failure.