|
Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
|
Files | |
| file | max2221x.h |
| Public API for MAX2221X MISC driver. | |
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. | |
| #define MAX2221X_RAMP_DOWN_MASK BIT(2) |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Ramp-down enable mask.
| #define MAX2221X_RAMP_MID_MASK BIT(1) |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Ramp-middle enable mask.
| #define MAX2221X_RAMP_UP_MASK BIT(0) |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Ramp-up enable mask.
| enum max2221x_ch_freq_div |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Channel frequency divisor options.
| enum max2221x_ctrl_mode |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Control mode options.
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Fault pin mask definitions.
| enum max2221x_gain |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Gain scale options.
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Individual channel chopping frequency divisor options.
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Master chopping frequency options.
| enum max2221x_slew_rate |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Slew rate options.
| enum 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. |
| enum 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. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
VM threshold voltage levels.
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the chopping frequency divider of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to get the chopping frequency divider for. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the channel frequency of the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to read. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the control mode of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to get the control mode for. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the demagnetization voltage of the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| dc_hdl | Pointer to the variable to store the demagnetization voltage. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the digital gain for the CDR of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to get the gain for. |
| 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.
| dev | Pointer to the device structure for the driver instance. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the off time of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to get the off time for. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the on time of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to get the on time for. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the ramp slew rate of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to get the ramp slew rate for. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the repetitions of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to get the repetitions for. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the slew rate of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to get the slew rate for. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the sense scaling factor of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to get the sense scaling factor for. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the stop state of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to get the stop state for. |
| int max2221x_get_vdr_mode | ( | const struct device * | dev | ) |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Get the VDR mode of the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| 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.
| dev | Pointer to the device structure for the driver instance. |
| 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.
| dev | Pointer to the device structure for the driver instance. |
| 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:
| dev | Pointer to the device structure for the driver instance. |
| mask | The fault condition to mask. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Read the DC_H value of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| dc_h | Pointer to the variable to store the DC_H value. |
| channel | The channel to read the DC_H value from. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Read the DC_L value of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| dc_l | Pointer to the variable to store the DC_L value. |
| channel | The channel to read the DC_L value from. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Read the DC_L2H value of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| dc_l2h | Pointer to the variable to store the DC_L2H value. |
| channel | The channel to read the DC_L2H value from. |
| 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.
| dev | Pointer to the device structure for the driver instance. |
| 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.
| dev | Pointer to the device structure for the driver instance. |
| 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.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to read the PWM duty cycle from. |
| duty_cycle | Pointer to the variable to store the PWM duty cycle. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Read the status of the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| status | Pointer to the variable to store the status. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Read the time L2H value of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| time_l2h | Pointer to the variable to store the time L2H value. |
| channel | The channel to read the time L2H value from. |
#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
| dev | Pointer to the device structure for the driver instance. |
| vm_monitor | Pointer to the variable to store the voltage monitor. |
| 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:
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the chopping frequency divider for. |
| freq_div | The desired chopping frequency divider to set. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Set the channel state (enable/disable) of a channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the state for. |
| enable | True to enable the channel, false to disable. |
| 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:
| dev | Pointer to the device structure for the driver instance. |
| mode | The desired control mode to set. |
| channel | The channel to set the control mode for. |
#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.
| dev | Pointer to the device structure for the driver instance. |
| dc_hdl | The desired demagnetization voltage to set. |
| 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:
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the gain for. |
| gain | The desired gain to set. |
| 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:
| dev | Pointer to the device structure for the driver instance. |
| freq | The desired master chopping frequency to set. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Set the off time of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the off time for. |
| off_time_us | The desired off time to set in microseconds. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Set the on time of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the on time for. |
| on_time_us | The desired on time to set in microseconds. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Set the part state (enable/disable) of the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| enable | True to enable the part, false to disable. |
| 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.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the ramp slew rate for. |
| ramp_slew_rate | The desired ramp slew rate to set. |
| 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.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the ramps for. |
| ramp_mask | The ramp mask indicating which ramps to modify. |
| enable | True to enable the specified ramps, false to disable. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Set the repetitions of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the repetitions for. |
| repetitions | The desired repetitions to set. |
| 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:
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the slew rate for. |
| slew_rate | The desired slew rate to set. |
| 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:
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the sense scaling factor for. |
| snsf | The desired sense scaling factor to set. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Set the stop state of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the stop state for. |
| stop_state | The desired stop state to set. |
| 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:
| dev | Pointer to the device structure for the driver instance. |
| mode | The VDR mode to set. |
| 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:
| dev | Pointer to the device structure for the driver instance. |
| threshold | The desired lower threshold to set. |
| 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:
| dev | Pointer to the device structure for the driver instance. |
| threshold | The desired upper threshold to set. |
#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.
Example usage:
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to start the rapid fire mode for. |
| 0 | on success. |
| -errno | Negative error code on failure. |
#include <zephyr/drivers/misc/max2221x/max2221x.h>
Stop the rapid fire mode of channel on the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to stop the rapid fire mode for. |
| 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:
| dev | Pointer to the device structure for the driver instance. |
| mask | The fault condition to unmask. |
#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).
| dev | Pointer to the device structure for the driver instance. |
| dc_h | The desired DC_H value to write. |
| channel | The channel to write the DC_H value to. |
#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).
| dev | Pointer to the device structure for the driver instance. |
| dc_l | The desired DC_L value to write. |
| channel | The channel to write the DC_L value to. |
#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).
| dev | Pointer to the device structure for the driver instance. |
| dc_l2h | The desired DC_L2H value to write. |
| channel | The channel to write the DC_L2H value to. |
#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
| dev | Pointer to the device structure for the driver instance. |
| time_l2h | The desired time L2H value to write. |
| channel | The channel to write the time L2H value to. |