![]() |
no-OS
|
#include <stdint.h>#include <stdbool.h>#include "no_os_i2c.h"#include "no_os_gpio.h"#include "no_os_util.h"#include "no_os_error.h"Classes | |
| struct | max20362_dev |
| Device descriptor for MAX20362. More... | |
| struct | max20362_init_param |
| Initialization parameters for MAX20362. More... | |
Enumerations | |
| enum | max20362_dvs_source { MAX20362_DVS_SOURCE_I2C , MAX20362_DVS_SOURCE_PSPI , MAX20362_DVS_SOURCE_ROUND_ROBIN } |
| Dynamic voltage scaling source selection. More... | |
| enum | max20362_bbat_vdrop { MAX20362_BBAT_VDROP_55MV , MAX20362_BBAT_VDROP_100MV , MAX20362_BBAT_VDROP_150MV , MAX20362_BBAT_VDROP_200MV } |
| Battery voltage droop configuration. More... | |
| enum | max20362_ldo_source { MAX20362_LDO_SOURCE_BBOUT , MAX20362_LDO_SOURCE_CAP , MAX20362_LDO_SOURCE_BATT } |
| LDO input source selection. More... | |
Functions | |
| int | max20362_init (struct max20362_dev **device, const struct max20362_init_param *init_param) |
| Initialize MAX20362 device. | |
| int | max20362_remove (struct max20362_dev *dev) |
| Free resources and remove device. | |
| int | max20362_reg_write (struct max20362_dev *dev, uint8_t reg, uint8_t val) |
| Write register. | |
| int | max20362_reg_read (struct max20362_dev *dev, uint8_t reg, uint8_t *val) |
| Read register. | |
| int | max20362_reg_update_bits (struct max20362_dev *dev, uint8_t reg, uint8_t mask, uint8_t val) |
| Modify register bits. | |
| int | max20362_enable_buck_boost (struct max20362_dev *dev, bool enable) |
| Enable/disable buck-boost converter. | |
| int | max20362_set_buck_boost_voltage (struct max20362_dev *dev, uint32_t microvolts) |
| Set buck-boost output voltage. | |
| int | max20362_config_buck_boost_mode (struct max20362_dev *dev, bool half_bw, bool low_emi, bool fast_fpwm) |
| Configure buck-boost operating parameters. | |
| int | max20362_config_buck_boost_discharge (struct max20362_dev *dev, bool active_discharge, bool passive_discharge) |
| Configure buck-boost discharge modes. | |
| int | max20362_enable_ldo (struct max20362_dev *dev, bool enable) |
| Enable/disable LDO regulator. | |
| int | max20362_set_ldo_voltage (struct max20362_dev *dev, uint32_t microvolts) |
| Set LDO output voltage. | |
| int | max20362_config_ldo_mode (struct max20362_dev *dev, bool low_iq_mode, bool passive_discharge, bool active_discharge) |
| Configure LDO operating modes. | |
| int | max20362_set_ldo_input_source (struct max20362_dev *dev, enum max20362_ldo_source source) |
| Set LDO input source. | |
| int | max20362_set_dvs_mode (struct max20362_dev *dev, enum max20362_dvs_source source) |
| Set DVS operating mode. | |
| int | max20362_set_dvs_rr_table (struct max20362_dev *dev, const uint32_t *voltages_uv, uint8_t count) |
| Configure DVS round-robin voltage table. | |
| int | max20362_set_rr_wrap (struct max20362_dev *dev, bool enable) |
| Set round-robin wrap mode. | |
| int | max20362_set_rr_clk_polarity (struct max20362_dev *dev, bool rising_edge) |
| Set round-robin clock polarity. | |
| int | max20362_set_rr_timeout_reset (struct max20362_dev *dev, bool enable) |
| Set round-robin timeout reset behavior. | |
| int | max20362_set_cap_voltage (struct max20362_dev *dev, uint32_t microvolts, uint8_t step_size) |
| Set energy storage capacitor voltage. | |
| int | max20362_set_input_current_limit (struct max20362_dev *dev, uint8_t ma) |
| Set input current limit. | |
| int | max20362_set_bbat_vdrop (struct max20362_dev *dev, enum max20362_bbat_vdrop vdrop) |
| Set battery voltage droop. | |
| int | max20362_get_status (struct max20362_dev *dev, uint8_t *status) |
| Read fault status flags. | |
| int | max20362_get_int_status (struct max20362_dev *dev, uint8_t *status) |
| Read main interrupt status. | |
| int | max20362_get_ldo_int_status (struct max20362_dev *dev, uint8_t *status) |
| Read LDO interrupt status. | |
| int | max20362_get_ingen_int_status (struct max20362_dev *dev, uint8_t *status) |
| Read Ingenuity interrupt status. | |
| int | max20362_set_int_mask (struct max20362_dev *dev, uint8_t mask) |
| Set main interrupt mask. | |
| int | max20362_set_ldo_int_mask (struct max20362_dev *dev, uint8_t mask) |
| Set LDO interrupt mask. | |
| int | max20362_set_ingen_int_mask (struct max20362_dev *dev, uint8_t mask) |
| Set Ingenuity interrupt mask. | |
| int | max20362_clear_all_interrupts (struct max20362_dev *dev) |
| Clear all interrupt flags. | |
| int | max20362_unlock_registers (struct max20362_dev *dev) |
| Unlock write protection for protected registers. | |
| int | max20362_lock_registers (struct max20362_dev *dev) |
| Lock write protection for protected registers. | |
| #define MAX20362_BBOUT_MAX_UV 5500000 |
Buck-boost max: 5.5V
| #define MAX20362_BBOUT_MIN_UV 1500000 |
Voltage Range Constants (microvolts) Buck-boost min: 1.5V
| #define MAX20362_BBOUT_STEP_UV 50000 |
Buck-boost step: 50mV
| #define MAX20362_BBSTCFG_BBFHIGHSH_MSK NO_OS_BIT(2) |
High side FET control
| #define MAX20362_BBSTCFG_BBHALFBW_MSK NO_OS_BIT(7) |
BBstCfg0 Register Bits (0x01) Half bandwidth mode
| #define MAX20362_BBSTCFG_BBSTACTDSC_MSK NO_OS_BIT(1) |
Active discharge
| #define MAX20362_BBSTCFG_BBSTENA_MSK NO_OS_BIT(5) |
Buck-boost enable
| #define MAX20362_BBSTCFG_BBSTFAST_MSK NO_OS_BIT(4) |
Fast FPWM mode
| #define MAX20362_BBSTCFG_BBSTLOWEMI_MSK NO_OS_BIT(6) |
Low EMI mode
| #define MAX20362_BBSTCFG_BBSTPSVDSC_MSK NO_OS_BIT(0) |
Passive discharge
| #define MAX20362_BBSTVSET_MSK NO_OS_GENMASK(6, 0) |
BBST_VSET Register Bits
| #define MAX20362_CAPVSET_ACTDSC_MSK NO_OS_BIT(7) |
CAP_VSET Register Bits Active discharge
| #define MAX20362_CAPVSET_PSVDSC_MSK NO_OS_BIT(6) |
Passive discharge
| #define MAX20362_CAPVSET_STEP_MSK NO_OS_GENMASK(5, 4) |
Voltage step size
| #define MAX20362_CAPVSET_VSET_MSK NO_OS_GENMASK(3, 0) |
Voltage setting
| #define MAX20362_CHIP_ID_VAL 0x00 |
Expected Chip ID (Vendor: 0x0, Revision: 0x0)
| #define MAX20362_CHIPID_REV_MSK NO_OS_GENMASK(3, 0) |
| #define MAX20362_CHIPID_VENDOR_MSK NO_OS_GENMASK(7, 4) |
CHIP_ID Register Bits
| #define MAX20362_DVS_AUTO_MODE 0x02 |
DVS round-robin mode value
| #define MAX20362_DVS_I2C_MODE 0x00 |
DVS Mode Values DVS I2C control mode value
| #define MAX20362_DVS_PSPI_MODE 0x01 |
DVS pSPI control mode value
| #define MAX20362_DVS_SETTLE_DELAY_US 300 |
Timing Constants (microseconds) DVS mode change delay: 300µs
| #define MAX20362_DVS_VSET_MASK 0x0F |
DVS VSET field mask
| #define MAX20362_DVSCFG_DVSSOURCE_MSK NO_OS_BIT(0) |
DVS source
| #define MAX20362_DVSCFG_I2CLKPTDIS_MSK NO_OS_BIT(3) |
DVS_CFG Register Bits I2C lockup timer disable
| #define MAX20362_DVSCFG_RRENA_MSK NO_OS_BIT(1) |
Round-robin enable
| #define MAX20362_DVSCFG_RRWRAP_MSK NO_OS_BIT(2) |
RR wrap enable
| #define MAX20362_IGNCFG_BBVDROP_MSK NO_OS_GENMASK(7, 6) |
IGN_CFG Register Bits Battery droop
| #define MAX20362_IGNCFG_ILIM_MSK NO_OS_GENMASK(5, 0) |
Current limit
| #define MAX20362_ILIM_MAX_MA 50 |
Max current limit: 50mA
| #define MAX20362_ILIM_MIN_MA 5 |
Current Limit Constants (milliamps) Min current limit: 5mA
| #define MAX20362_ILIM_STEP_MA 1 |
Current limit step: 1mA
| #define MAX20362_INGEN_INT_EN 0x1D |
Enable Ingenuity interrupts
| #define MAX20362_INGENINT_DRPMAX_MSK NO_OS_BIT(0) |
Droop max
| #define MAX20362_INGENINT_DRPMIN_MSK NO_OS_BIT(3) |
Droop min
| #define MAX20362_INGENINT_OUTTMO_MSK NO_OS_BIT(4) |
INGEN_INT and INGEN_INT_MASK Register Bits Output timeout
| #define MAX20362_INGENINT_SIMOPIN_MSK NO_OS_BIT(1) |
SIMO pin
| #define MAX20362_INGENINT_TNKTMO_MSK NO_OS_BIT(2) |
Tank timeout
| #define MAX20362_INT_BBINUVLO_MSK NO_OS_BIT(3) |
BB input UVLO
| #define MAX20362_INT_BBSTOFF_MSK NO_OS_BIT(4) |
Buck-boost off
| #define MAX20362_INT_BBSTON_MSK NO_OS_BIT(5) |
Buck-boost on
| #define MAX20362_INT_BSTFLT_MSK NO_OS_BIT(1) |
Boost fault
| #define MAX20362_INT_CAPOVLO_MSK NO_OS_BIT(7) |
INT and INT_MASK Register Bits Cap overvoltage
| #define MAX20362_INT_CAPUVLO_MSK NO_OS_BIT(6) |
Cap undervoltage
| #define MAX20362_INT_EN 0xCF |
Interrupt Mask Values (0=unmask/enable, 1=mask/disable) Enable main interrupts
| #define MAX20362_INT_MASK_ALL 0xFF |
Mask all interrupts
| #define MAX20362_INT_THMFLT_MSK NO_OS_BIT(0) |
Thermal fault
| #define MAX20362_INT_UNMASK_ALL 0x00 |
Interrupt Mask Control Values Unmask all interrupts
| #define MAX20362_INT_UVLO_MSK NO_OS_BIT(2) |
UVLO
| #define MAX20362_INTERRUPT_CLEAR_ALL 0xFF |
Clear all interrupts value
| #define MAX20362_LDO_INT_EN 0x0F |
Enable LDO interrupts
| #define MAX20362_LDO_MAX_UV 4000000 |
LDO max: 4.0V
| #define MAX20362_LDO_MIN_UV 900000 |
LDO min: 0.9V
| #define MAX20362_LDO_STEP_UV 100000 |
LDO step: 100mV
| #define MAX20362_LDOCFG_ACT_MSK NO_OS_BIT(2) |
Active discharge
| #define MAX20362_LDOCFG_BBSTSUP_MSK NO_OS_BIT(5) |
LDO_CFG Register Bits LDO source select
| #define MAX20362_LDOCFG_ENA_MSK NO_OS_BIT(0) |
LDO enable
| #define MAX20362_LDOCFG_LOWIQ_MSK NO_OS_BIT(3) |
Low IQ mode
| #define MAX20362_LDOCFG_PROPMD_MSK NO_OS_BIT(4) |
Proportional mode
| #define MAX20362_LDOCFG_PSV_MSK NO_OS_BIT(1) |
Passive discharge
| #define MAX20362_LDOINT_CLP_MSK NO_OS_BIT(0) |
Current limit fault
| #define MAX20362_LDOINT_DIV_MSK NO_OS_BIT(3) |
LDO_INT and LDO_INT_MASK Register Bits Divider fault
| #define MAX20362_LDOINT_SHR_MSK NO_OS_BIT(2) |
Short circuit
| #define MAX20362_LDOINT_THM_MSK NO_OS_BIT(1) |
Thermal fault
| #define MAX20362_LDOVSET_MSK NO_OS_GENMASK(4, 0) |
LDO_VSET Register Bits
| #define MAX20362_LOCK_MASK_LOCKED 0x01 |
BBLck bit = 1 (locked)
| #define MAX20362_LOCK_MASK_UNLOCKED 0x00 |
Lock Mask Definitions BBLck bit = 0 (unlocked)
| #define MAX20362_LOCK_PASSWORD 0xAA |
Lock write protection
| #define MAX20362_PMIC_I2C_ADDR 0x68 |
I2C slave address
| #define MAX20362_REG_BBST_CFG0 0x01 |
Buck-boost configuration 0
| #define MAX20362_REG_BBST_VSET 0x02 |
Buck-boost voltage setting
| #define MAX20362_REG_CAP_VSET 0x0A |
Capacitor voltage setting
| #define MAX20362_REG_CHIP_ID 0x00 |
Register Map Chip ID register
| #define MAX20362_REG_DVS_CFG 0x54 |
DVS configuration
| #define MAX20362_REG_IGN_CFG 0x0C |
Input/Ingenuity config
| #define MAX20362_REG_INGEN_INT 0x16 |
Ingenuity interrupt register
| #define MAX20362_REG_INGEN_INT_MASK 0x1A |
Ingenuity interrupt mask
| #define MAX20362_REG_INT 0x14 |
Main interrupt register
| #define MAX20362_REG_INT_MASK 0x18 |
Main interrupt mask
| #define MAX20362_REG_LDO_CFG 0x40 |
LDO configuration
| #define MAX20362_REG_LDO_INT 0x17 |
LDO interrupt register
| #define MAX20362_REG_LDO_INT_MASK 0x1B |
LDO interrupt mask
| #define MAX20362_REG_LDO_VSET 0x41 |
LDO voltage setting
| #define MAX20362_REG_LOCK_MSK 0x50 |
Lock mask register
| #define MAX20362_REG_LOCK_UNLOCK 0x51 |
Lock/unlock password
| #define MAX20362_REG_RR_CFG1 0x55 |
Round-robin configuration 1 (Size)
| #define MAX20362_REG_RR_VSET_BASE 0x20 |
Round-robin voltage table base (0x20-0x33)
| #define MAX20362_REG_STATUS 0x10 |
Status register
| #define MAX20362_REGISTER_COUNT_OFFSET 1 |
Register Value Constants Offset for count-based register values
| #define MAX20362_RR_MAX_VOLTAGES 20 |
Round-Robin Constants Max RR table entries
| #define MAX20362_RR_MIN_COUNT 1 |
Minimum RR table count
| #define MAX20362_RR_REGISTER_START 0x20 |
First RR register address
| #define MAX20362_RR_VSET_ADDR | ( | x | ) |
Index RR table
| #define MAX20362_RRCFG1_RRCLKPOLARITY_MSK NO_OS_BIT(6) |
RRCfg1 Register Bits (0x55) RR clock polarity
| #define MAX20362_RRCFG1_RRSIZE_MSK NO_OS_GENMASK(4, 0) |
RR table size
| #define MAX20362_RRCFG1_RRTIMEOUTRES_MSK NO_OS_BIT(5) |
RR timeout reset
| #define MAX20362_STATUS_BBINUVLO_MSK NO_OS_BIT(3) |
BB input UVLO
| #define MAX20362_STATUS_BBSTOFF_MSK NO_OS_BIT(4) |
Buck-boost off
| #define MAX20362_STATUS_BBSTON_MSK NO_OS_BIT(5) |
Buck-boost on
| #define MAX20362_STATUS_BSTFLT_MSK NO_OS_BIT(1) |
Boost fault
| #define MAX20362_STATUS_CAPOVLO_MSK NO_OS_BIT(7) |
STATUS Register Bits Cap overvoltage
| #define MAX20362_STATUS_CAPUVLO_MSK NO_OS_BIT(6) |
Cap undervoltage
| #define MAX20362_STATUS_THMFLT_MSK NO_OS_BIT(0) |
Thermal fault
| #define MAX20362_STATUS_UVLO_MSK NO_OS_BIT(2) |
Undervoltage lockout
| #define MAX20362_UNLOCK_PASSWORD 0x55 |
Lock/Unlock Passwords Unlock write protection
| #define MAX20362_VCAP_125MV_BASE_OFFSET 4 |
Base offset for 125mV step calculations
| #define MAX20362_VCAP_125MV_MAX_UV 3025000 |
| #define MAX20362_VCAP_125MV_MIN_UV 1650000 |
| #define MAX20362_VCAP_125MV_STEP_UV 125000 |
| #define MAX20362_VCAP_125MV_UPPER_LIMIT_UV 2900000 |
Upper limit for 125mV step calculation
| #define MAX20362_VCAP_125MV_VSET_MAX 15 |
Max VSET value for 125mV steps
| #define MAX20362_VCAP_250MV_MAX_UV 5350000 |
| #define MAX20362_VCAP_250MV_MIN_UV 1600000 |
| #define MAX20362_VCAP_250MV_STEP_UV 250000 |
| #define MAX20362_VCAP_250MV_VSET_MAX 15 |
Max VSET value for 250mV steps
| #define MAX20362_VCAP_500MV_MAX_UV 9500000 |
| #define MAX20362_VCAP_500MV_MIN_UV 2500000 |
Capacitor Voltage Ranges (microvolts)
| #define MAX20362_VCAP_500MV_STEP_UV 500000 |
| #define MAX20362_VCAP_500MV_VSET_MAX 14 |
Capacitor Voltage Setting Maximum Values Max VSET value for 500mV steps
| #define MAX20362_VCAP_MAX_UV 9500000 |
Cap max: 9.5V
| #define MAX20362_VCAP_MIN_UV 1600000 |
Cap min: 1.6V
| #define MAX20362_VCAP_STEP_125MV 2 |
| #define MAX20362_VCAP_STEP_250MV 1 |
| #define MAX20362_VCAP_STEP_500MV 0 |
Capacitor Voltage Step Sizes
| #define MAX20362_VCAP_STEP_UV 250000 |
Cap step: 250mV
| #define MAX20362_VOLTAGE_MASK_7BIT 0x7F |
Bit Masks and Field Values 7-bit voltage register mask
| #define MAX20362_VOLTAGE_SETTLE_MS 10 |
General voltage settle delay: 10ms
| enum max20362_bbat_vdrop |
| enum max20362_dvs_source |
| enum max20362_ldo_source |
LDO input source selection.
This is an abstraction. The hardware selection is controlled by the LDOBBstSupp bit in the LDOCfg register (0x40), which toggles between the battery input and the buck-boost output. The driver must manage this selection logic.
| Enumerator | |
|---|---|
| MAX20362_LDO_SOURCE_BBOUT | Buck-boost output |
| MAX20362_LDO_SOURCE_CAP | Storage capacitor |
| MAX20362_LDO_SOURCE_BATT | Battery input |
| int max20362_clear_all_interrupts | ( | struct max20362_dev * | dev | ) |
Clear all interrupt flags.
| dev | - Device structure |
| int max20362_config_buck_boost_discharge | ( | struct max20362_dev * | dev, |
| bool | active_discharge, | ||
| bool | passive_discharge ) |
Configure buck-boost discharge modes.
| dev | - Device structure |
| active_discharge | - Active discharge enable |
| passive_discharge | - Passive discharge enable |
| int max20362_config_buck_boost_mode | ( | struct max20362_dev * | dev, |
| bool | half_bw, | ||
| bool | low_emi, | ||
| bool | fast_fpwm ) |
Configure buck-boost operating parameters.
| dev | - Device structure |
| half_bw | - Half bandwidth mode enable |
| low_emi | - Low EMI mode enable |
| fast_fpwm | - Fast FPWM mode enable |
| int max20362_config_ldo_mode | ( | struct max20362_dev * | dev, |
| bool | low_iq_mode, | ||
| bool | passive_discharge, | ||
| bool | active_discharge ) |
Configure LDO operating modes.
| dev | - Device structure |
| low_iq_mode | - Low quiescent current mode |
| passive_discharge | - Passive discharge enable |
| active_discharge | - Active discharge enable |
| int max20362_enable_buck_boost | ( | struct max20362_dev * | dev, |
| bool | enable ) |
Enable/disable buck-boost converter.
| dev | - Device structure |
| enable | - Enable flag |
| int max20362_enable_ldo | ( | struct max20362_dev * | dev, |
| bool | enable ) |
Enable/disable LDO regulator.
| dev | - Device structure |
| enable | - Enable flag |
| int max20362_get_ingen_int_status | ( | struct max20362_dev * | dev, |
| uint8_t * | status ) |
Read Ingenuity interrupt status.
| dev | - Device structure |
| status | - Status byte pointer |
| int max20362_get_int_status | ( | struct max20362_dev * | dev, |
| uint8_t * | status ) |
Read main interrupt status.
| dev | - Device structure |
| status | - Status byte pointer |
| int max20362_get_ldo_int_status | ( | struct max20362_dev * | dev, |
| uint8_t * | status ) |
Read LDO interrupt status.
| dev | - Device structure |
| status | - Status byte pointer |
| int max20362_get_status | ( | struct max20362_dev * | dev, |
| uint8_t * | status ) |
Read fault status flags.
| dev | - Device structure |
| status | - Pointer to store status register value |
| int max20362_init | ( | struct max20362_dev ** | device, |
| const struct max20362_init_param * | init_param ) |
Initialize MAX20362 device.
| device | - Pointer to device structure pointer |
| init_param | - Initialization parameters |
| int max20362_lock_registers | ( | struct max20362_dev * | dev | ) |
Lock write protection for protected registers.
| dev | - Device structure |
| int max20362_reg_read | ( | struct max20362_dev * | dev, |
| uint8_t | reg, | ||
| uint8_t * | val ) |
Read register.
| dev | - Device structure |
| reg | - Register address |
| val | - Pointer to store read value |
| int max20362_reg_update_bits | ( | struct max20362_dev * | dev, |
| uint8_t | reg, | ||
| uint8_t | mask, | ||
| uint8_t | val ) |
Modify register bits.
| dev | - Device structure |
| reg | - Register address |
| mask | - Bit mask |
| val | - New value for masked bits |
| int max20362_reg_write | ( | struct max20362_dev * | dev, |
| uint8_t | reg, | ||
| uint8_t | val ) |
Write register.
| dev | - Device structure |
| reg | - Register address |
| val | - Value to write |
| int max20362_remove | ( | struct max20362_dev * | dev | ) |
Free resources and remove device.
| dev | - Device structure pointer |
| int max20362_set_bbat_vdrop | ( | struct max20362_dev * | dev, |
| enum max20362_bbat_vdrop | vdrop ) |
Set battery voltage droop.
| dev | - Device structure |
| vdrop | - Voltage droop enum value |
| int max20362_set_buck_boost_voltage | ( | struct max20362_dev * | dev, |
| uint32_t | microvolts ) |
Set buck-boost output voltage.
| dev | - Device structure |
| microvolts | - Voltage in microvolts (1.5V-5.5V, 50mV steps) |
| int max20362_set_cap_voltage | ( | struct max20362_dev * | dev, |
| uint32_t | microvolts, | ||
| uint8_t | step_size ) |
Set energy storage capacitor voltage.
| dev | - Device structure |
| microvolts | - Voltage in microvolts (1.6V-9.5V) |
| step_size | - Step size (0=500mV, 1=250mV, 2=125mV) |
| int max20362_set_dvs_mode | ( | struct max20362_dev * | dev, |
| enum max20362_dvs_source | source ) |
Set DVS operating mode.
| dev | - Device structure |
| source | - DVS source enum |
| int max20362_set_dvs_rr_table | ( | struct max20362_dev * | dev, |
| const uint32_t * | voltages_uv, | ||
| uint8_t | count ) |
Configure DVS round-robin voltage table.
| dev | - Device structure |
| voltages_uv | - Array of voltages in microvolts |
| count | - Number of voltages (1-20) |
| int max20362_set_ingen_int_mask | ( | struct max20362_dev * | dev, |
| uint8_t | mask ) |
Set Ingenuity interrupt mask.
| dev | - Device structure |
| mask | - Interrupt mask (1=mask/disable, 0=unmask/enable) |
| int max20362_set_input_current_limit | ( | struct max20362_dev * | dev, |
| uint8_t | ma ) |
Set input current limit.
| dev | - Device structure |
| ma | - Current limit in milliamps (5-50mA) |
| int max20362_set_int_mask | ( | struct max20362_dev * | dev, |
| uint8_t | mask ) |
Set main interrupt mask.
| dev | - Device structure |
| mask | - Interrupt mask (1=mask/disable, 0=unmask/enable) |
| int max20362_set_ldo_input_source | ( | struct max20362_dev * | dev, |
| enum max20362_ldo_source | source ) |
Set LDO input source.
| dev | - Device structure |
| source | - LDO input source enum |
| int max20362_set_ldo_int_mask | ( | struct max20362_dev * | dev, |
| uint8_t | mask ) |
Set LDO interrupt mask.
| dev | - Device structure |
| mask | - Interrupt mask (1=mask/disable, 0=unmask/enable) |
| int max20362_set_ldo_voltage | ( | struct max20362_dev * | dev, |
| uint32_t | microvolts ) |
Set LDO output voltage.
| dev | - Device structure |
| microvolts | - Voltage in microvolts (0.9V-4.0V, 100mV steps) |
| int max20362_set_rr_clk_polarity | ( | struct max20362_dev * | dev, |
| bool | rising_edge ) |
Set round-robin clock polarity.
| dev | - Device structure |
| rising_edge | - true: rising edge active, false: falling edge active |
| int max20362_set_rr_timeout_reset | ( | struct max20362_dev * | dev, |
| bool | enable ) |
Set round-robin timeout reset behavior.
| dev | - Device structure |
| enable | - true: timeout resets RR pointer, false: timeout does not reset |
| int max20362_set_rr_wrap | ( | struct max20362_dev * | dev, |
| bool | enable ) |
Set round-robin wrap mode.
| dev | - Device structure |
| enable | - true: wrap back to first entry, false: stay on last entry |
| int max20362_unlock_registers | ( | struct max20362_dev * | dev | ) |
Unlock write protection for protected registers.
| dev | - Device structure |