Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Public API for the MAX20362 regulator driver. More...

Files

file  max20362.h
 Public API for the MAX20362 PMIC regulator driver.

Functions

int regulator_max20362_set_int_mask (const struct device *dev, uint8_t mask)
 Sets the main interrupt mask (INT_MASK register) of the MAX20362 device.
int regulator_max20362_set_ingen_int_mask (const struct device *dev, uint8_t mask)
 Sets the Ingenuity interrupt mask (INGEN_INT_MASK register) of the MAX20362 device.
int regulator_max20362_set_ldo_int_mask (const struct device *dev, uint8_t mask)
 Sets the LDO interrupt mask (LDO_INT_MASK register) of the MAX20362 device.
int regulator_max20362_set_bat_bbin_vdrop (const struct device *dev, uint8_t vdrop)
 Sets the BAT to BBIN voltage drop of the MAX20362 device.
int regulator_max20362_set_ldo_input_source (const struct device *dev, uint8_t source)
 Sets the LDO input source of the MAX20362 device.
int regulator_max20362_set_dvs_rr_table (const struct device *dev, const uint32_t *voltages_uv, uint8_t count)
 Programs the Round-Robin VSET table of the MAX20362 device.
int regulator_max20362_set_rr_wrap (const struct device *dev, bool enable)
 Sets the Round-Robin wrap mode of the MAX20362 device.
int regulator_max20362_set_rr_clk_polarity (const struct device *dev, bool rising_edge)
 Sets the Round-Robin clock polarity of the MAX20362 device.
int regulator_max20362_set_rr_timeout_reset (const struct device *dev, bool enable)
 Sets the Round-Robin timeout-reset behavior of the MAX20362 device.
int regulator_max20362_set_rr_timeout (const struct device *dev, uint8_t timeout)
 Sets the Round-Robin timeout duration of the MAX20362 device.

MAX20362 INT / INT_MASK register bits (0x14 / 0x18)

#define MAX20362_INT_CAPOVLO_MASK   BIT(7)
 Cap over-voltage lockout.
#define MAX20362_INT_CAPUVLO_MASK   BIT(6)
 Cap under-voltage lockout.
#define MAX20362_INT_BBSTON_MASK   BIT(5)
 Buck-boost on.
#define MAX20362_INT_BBSTOFF_MASK   BIT(4)
 Buck-boost off.
#define MAX20362_INT_BBINUVLO_MASK   BIT(3)
 Buck-boost input UVLO.
#define MAX20362_INT_UVLO_MASK   BIT(2)
 Undervoltage lockout.
#define MAX20362_INT_BSTFLT_MASK   BIT(1)
 Boost fault.
#define MAX20362_INT_THMFLT_MASK   BIT(0)
 Thermal fault.

MAX20362 LDO_INT / LDO_INT_MASK register bits (0x17 / 0x1B)

#define MAX20362_LDOINT_DIV_MASK   BIT(3)
 Divider fault.
#define MAX20362_LDOINT_SHR_MASK   BIT(2)
 Short circuit.
#define MAX20362_LDOINT_THM_MASK   BIT(1)
 Thermal fault.
#define MAX20362_LDOINT_CLP_MASK   BIT(0)
 Current limit / clipping fault.

MAX20362 INGEN_INT / INGEN_INT_MASK register bits (0x16 / 0x1A)

#define MAX20362_INGENINT_OUTTMO_MASK   BIT(4)
 Output timeout.
#define MAX20362_INGENINT_DRPMIN_MASK   BIT(3)
 Droop min.
#define MAX20362_INGENINT_TNKTMO_MASK   BIT(2)
 Tank timeout.
#define MAX20362_INGENINT_SIMOPIN_MASK   BIT(1)
 SIMO pin.
#define MAX20362_INGENINT_DRPMAX_MASK   BIT(0)
 Droop max.

MAX20362 interrupt mask convenience values

#define MAX20362_INT_MASK_ALL   0xFF
 Mask all INT bits.
#define MAX20362_LDO_INT_MASK_ALL   0x0F
 Mask all LDO_INT bits (DIV | SHR | THM | CLP).
#define MAX20362_INGEN_INT_MASK_ALL   0x1F
 Mask all INGEN_INT bits (OUTTMO | DRPMIN | TNKTMO | SIMOPIN | DRPMAX).

Detailed Description

Public API for the MAX20362 regulator driver.

Macro Definition Documentation

◆ MAX20362_INGEN_INT_MASK_ALL

#define MAX20362_INGEN_INT_MASK_ALL   0x1F

#include <zephyr/drivers/regulator/max20362.h>

Mask all INGEN_INT bits (OUTTMO | DRPMIN | TNKTMO | SIMOPIN | DRPMAX).

◆ MAX20362_INGENINT_DRPMAX_MASK

#define MAX20362_INGENINT_DRPMAX_MASK   BIT(0)

#include <zephyr/drivers/regulator/max20362.h>

Droop max.

◆ MAX20362_INGENINT_DRPMIN_MASK

#define MAX20362_INGENINT_DRPMIN_MASK   BIT(3)

#include <zephyr/drivers/regulator/max20362.h>

Droop min.

◆ MAX20362_INGENINT_OUTTMO_MASK

#define MAX20362_INGENINT_OUTTMO_MASK   BIT(4)

#include <zephyr/drivers/regulator/max20362.h>

Output timeout.

◆ MAX20362_INGENINT_SIMOPIN_MASK

#define MAX20362_INGENINT_SIMOPIN_MASK   BIT(1)

◆ MAX20362_INGENINT_TNKTMO_MASK

#define MAX20362_INGENINT_TNKTMO_MASK   BIT(2)

#include <zephyr/drivers/regulator/max20362.h>

Tank timeout.

◆ MAX20362_INT_BBINUVLO_MASK

#define MAX20362_INT_BBINUVLO_MASK   BIT(3)

#include <zephyr/drivers/regulator/max20362.h>

Buck-boost input UVLO.

◆ MAX20362_INT_BBSTOFF_MASK

#define MAX20362_INT_BBSTOFF_MASK   BIT(4)

#include <zephyr/drivers/regulator/max20362.h>

Buck-boost off.

◆ MAX20362_INT_BBSTON_MASK

#define MAX20362_INT_BBSTON_MASK   BIT(5)

#include <zephyr/drivers/regulator/max20362.h>

Buck-boost on.

◆ MAX20362_INT_BSTFLT_MASK

#define MAX20362_INT_BSTFLT_MASK   BIT(1)

#include <zephyr/drivers/regulator/max20362.h>

Boost fault.

◆ MAX20362_INT_CAPOVLO_MASK

#define MAX20362_INT_CAPOVLO_MASK   BIT(7)

#include <zephyr/drivers/regulator/max20362.h>

Cap over-voltage lockout.

◆ MAX20362_INT_CAPUVLO_MASK

#define MAX20362_INT_CAPUVLO_MASK   BIT(6)

#include <zephyr/drivers/regulator/max20362.h>

Cap under-voltage lockout.

◆ MAX20362_INT_MASK_ALL

#define MAX20362_INT_MASK_ALL   0xFF

#include <zephyr/drivers/regulator/max20362.h>

Mask all INT bits.

◆ MAX20362_INT_THMFLT_MASK

#define MAX20362_INT_THMFLT_MASK   BIT(0)

#include <zephyr/drivers/regulator/max20362.h>

Thermal fault.

◆ MAX20362_INT_UVLO_MASK

#define MAX20362_INT_UVLO_MASK   BIT(2)

#include <zephyr/drivers/regulator/max20362.h>

Undervoltage lockout.

◆ MAX20362_LDO_INT_MASK_ALL

#define MAX20362_LDO_INT_MASK_ALL   0x0F

#include <zephyr/drivers/regulator/max20362.h>

Mask all LDO_INT bits (DIV | SHR | THM | CLP).

◆ MAX20362_LDOINT_CLP_MASK

#define MAX20362_LDOINT_CLP_MASK   BIT(0)

#include <zephyr/drivers/regulator/max20362.h>

Current limit / clipping fault.

◆ MAX20362_LDOINT_DIV_MASK

#define MAX20362_LDOINT_DIV_MASK   BIT(3)

#include <zephyr/drivers/regulator/max20362.h>

Divider fault.

◆ MAX20362_LDOINT_SHR_MASK

#define MAX20362_LDOINT_SHR_MASK   BIT(2)

#include <zephyr/drivers/regulator/max20362.h>

Short circuit.

◆ MAX20362_LDOINT_THM_MASK

#define MAX20362_LDOINT_THM_MASK   BIT(1)

#include <zephyr/drivers/regulator/max20362.h>

Thermal fault.

Function Documentation

◆ regulator_max20362_set_bat_bbin_vdrop()

int regulator_max20362_set_bat_bbin_vdrop ( const struct device * dev,
uint8_t vdrop )

#include <zephyr/drivers/regulator/max20362.h>

Sets the BAT to BBIN voltage drop of the MAX20362 device.

Parameters
devPointer to the device structure for the driver instance.
vdropVoltage drop, one of the MAX20362_BAT_BBIN_VDROP_* values from <zephyr/dt-bindings/regulator/max20362.h>.
Return values
0On success.
-EINVALIf vdrop is not a valid MAX20362_BAT_BBIN_VDROP_* value.
-errnoNegative errno from the I2C transfer on communication failure.

◆ regulator_max20362_set_dvs_rr_table()

int regulator_max20362_set_dvs_rr_table ( const struct device * dev,
const uint32_t * voltages_uv,
uint8_t count )

#include <zephyr/drivers/regulator/max20362.h>

Programs the Round-Robin VSET table of the MAX20362 device.

Parameters
devPointer to the device structure for the driver instance.
voltages_uvArray of VSET voltages, in microvolts, in step order.
countNumber of entries, 1 to 20 (the RRVsetXX register count).
Return values
0On success.
-EBUSYIf Round-Robin is the active DVS source (disable it first).
-EINVALIf voltages_uv is NULL, count is 0 or above 20, or a voltage is outside the supported buck-boost range.
-errnoNegative errno from the I2C transfer on communication failure.

◆ regulator_max20362_set_ingen_int_mask()

int regulator_max20362_set_ingen_int_mask ( const struct device * dev,
uint8_t mask )

#include <zephyr/drivers/regulator/max20362.h>

Sets the Ingenuity interrupt mask (INGEN_INT_MASK register) of the MAX20362 device.

Parameters
devPointer to the device structure for the driver instance.
maskInterrupt mask value to write (1 = masked/disabled, 0 = enabled).
Return values
0On success.
-errnoNegative errno from the I2C transfer on communication failure.

◆ regulator_max20362_set_int_mask()

int regulator_max20362_set_int_mask ( const struct device * dev,
uint8_t mask )

#include <zephyr/drivers/regulator/max20362.h>

Sets the main interrupt mask (INT_MASK register) of the MAX20362 device.

Parameters
devPointer to the device structure for the driver instance.
maskInterrupt mask value to write (1 = masked/disabled, 0 = enabled).
Return values
0On success.
-errnoNegative errno from the I2C transfer on communication failure.

◆ regulator_max20362_set_ldo_input_source()

int regulator_max20362_set_ldo_input_source ( const struct device * dev,
uint8_t source )

#include <zephyr/drivers/regulator/max20362.h>

Sets the LDO input source of the MAX20362 device.

Parameters
devPointer to the device structure for the driver instance.
sourceLDO input source, one of the MAX20362_LDO_SRC_* values from <zephyr/dt-bindings/regulator/max20362.h>.
Return values
0On success.
-EINVALIf source is not a valid MAX20362_LDO_SRC_* value.
-errnoNegative errno from the I2C transfer on communication failure.

◆ regulator_max20362_set_ldo_int_mask()

int regulator_max20362_set_ldo_int_mask ( const struct device * dev,
uint8_t mask )

#include <zephyr/drivers/regulator/max20362.h>

Sets the LDO interrupt mask (LDO_INT_MASK register) of the MAX20362 device.

Parameters
devPointer to the device structure for the driver instance.
maskInterrupt mask value to write (1 = masked/disabled, 0 = enabled).
Return values
0On success.
-errnoNegative errno from the I2C transfer on communication failure.

◆ regulator_max20362_set_rr_clk_polarity()

int regulator_max20362_set_rr_clk_polarity ( const struct device * dev,
bool rising_edge )

#include <zephyr/drivers/regulator/max20362.h>

Sets the Round-Robin clock polarity of the MAX20362 device.

Parameters
devPointer to the device structure for the driver instance.
rising_edgetrue to update on the rising edge, false on the falling edge.
Return values
0On success.
-EBUSYIf Round-Robin is the active DVS source (disable it first).
-errnoNegative errno from the I2C transfer on communication failure.

◆ regulator_max20362_set_rr_timeout()

int regulator_max20362_set_rr_timeout ( const struct device * dev,
uint8_t timeout )

#include <zephyr/drivers/regulator/max20362.h>

Sets the Round-Robin timeout duration of the MAX20362 device.

Parameters
devPointer to the device structure for the driver instance.
timeoutTimeout duration, one of the MAX20362_RR_TIMEOUT_* values from <zephyr/dt-bindings/regulator/max20362.h>.
Return values
0On success.
-EBUSYIf Round-Robin is the active DVS source (disable it first).
-EINVALIf timeout is not a valid MAX20362_RR_TIMEOUT_* value.
-errnoNegative errno from the I2C transfer on communication failure.

◆ regulator_max20362_set_rr_timeout_reset()

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

#include <zephyr/drivers/regulator/max20362.h>

Sets the Round-Robin timeout-reset behavior of the MAX20362 device.

Parameters
devPointer to the device structure for the driver instance.
enabletrue to reset the step pointer on timeout, false to keep it.
Return values
0On success.
-EBUSYIf Round-Robin is the active DVS source (disable it first).
-errnoNegative errno from the I2C transfer on communication failure.

◆ regulator_max20362_set_rr_wrap()

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

#include <zephyr/drivers/regulator/max20362.h>

Sets the Round-Robin wrap mode of the MAX20362 device.

Parameters
devPointer to the device structure for the driver instance.
enabletrue to wrap to the first step after the last, false to stop.
Return values
0On success.
-EBUSYIf Round-Robin is the active DVS source (disable it first).
-errnoNegative errno from the I2C transfer on communication failure.