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

Public API for MAX2221X MISC driver. More...

Go to the source code of this file.

Macros

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.

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.

Detailed Description

Public API for MAX2221X MISC driver.