|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
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). | |
Public API for the MAX20362 regulator driver.
| #define MAX20362_INGEN_INT_MASK_ALL 0x1F |
#include <zephyr/drivers/regulator/max20362.h>
Mask all INGEN_INT bits (OUTTMO | DRPMIN | TNKTMO | SIMOPIN | DRPMAX).
| #define MAX20362_INGENINT_DRPMAX_MASK BIT(0) |
#include <zephyr/drivers/regulator/max20362.h>
Droop max.
| #define MAX20362_INGENINT_DRPMIN_MASK BIT(3) |
#include <zephyr/drivers/regulator/max20362.h>
Droop min.
| #define MAX20362_INGENINT_OUTTMO_MASK BIT(4) |
#include <zephyr/drivers/regulator/max20362.h>
Output timeout.
| #define MAX20362_INGENINT_SIMOPIN_MASK BIT(1) |
#include <zephyr/drivers/regulator/max20362.h>
SIMO pin.
| #define MAX20362_INGENINT_TNKTMO_MASK BIT(2) |
#include <zephyr/drivers/regulator/max20362.h>
Tank timeout.
| #define MAX20362_INT_BBINUVLO_MASK BIT(3) |
#include <zephyr/drivers/regulator/max20362.h>
Buck-boost input UVLO.
| #define MAX20362_INT_BBSTOFF_MASK BIT(4) |
#include <zephyr/drivers/regulator/max20362.h>
Buck-boost off.
| #define MAX20362_INT_BBSTON_MASK BIT(5) |
#include <zephyr/drivers/regulator/max20362.h>
Buck-boost on.
| #define MAX20362_INT_BSTFLT_MASK BIT(1) |
#include <zephyr/drivers/regulator/max20362.h>
Boost fault.
| #define MAX20362_INT_CAPOVLO_MASK BIT(7) |
#include <zephyr/drivers/regulator/max20362.h>
Cap over-voltage lockout.
| #define MAX20362_INT_CAPUVLO_MASK BIT(6) |
#include <zephyr/drivers/regulator/max20362.h>
Cap under-voltage lockout.
| #define MAX20362_INT_MASK_ALL 0xFF |
#include <zephyr/drivers/regulator/max20362.h>
Mask all INT bits.
| #define MAX20362_INT_THMFLT_MASK BIT(0) |
#include <zephyr/drivers/regulator/max20362.h>
Thermal fault.
| #define MAX20362_INT_UVLO_MASK BIT(2) |
#include <zephyr/drivers/regulator/max20362.h>
Undervoltage lockout.
| #define MAX20362_LDO_INT_MASK_ALL 0x0F |
#include <zephyr/drivers/regulator/max20362.h>
Mask all LDO_INT bits (DIV | SHR | THM | CLP).
| #define MAX20362_LDOINT_CLP_MASK BIT(0) |
#include <zephyr/drivers/regulator/max20362.h>
Current limit / clipping fault.
| #define MAX20362_LDOINT_DIV_MASK BIT(3) |
#include <zephyr/drivers/regulator/max20362.h>
Divider fault.
| #define MAX20362_LDOINT_SHR_MASK BIT(2) |
#include <zephyr/drivers/regulator/max20362.h>
Short circuit.
| #define MAX20362_LDOINT_THM_MASK BIT(1) |
#include <zephyr/drivers/regulator/max20362.h>
Thermal fault.
#include <zephyr/drivers/regulator/max20362.h>
Sets the BAT to BBIN voltage drop of the MAX20362 device.
| dev | Pointer to the device structure for the driver instance. |
| vdrop | Voltage drop, one of the MAX20362_BAT_BBIN_VDROP_* values from <zephyr/dt-bindings/regulator/max20362.h>. |
| 0 | On success. |
| -EINVAL | If vdrop is not a valid MAX20362_BAT_BBIN_VDROP_* value. |
| -errno | Negative errno from the I2C transfer on communication failure. |
| 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.
| dev | Pointer to the device structure for the driver instance. |
| voltages_uv | Array of VSET voltages, in microvolts, in step order. |
| count | Number of entries, 1 to 20 (the RRVsetXX register count). |
| 0 | On success. |
| -EBUSY | If Round-Robin is the active DVS source (disable it first). |
| -EINVAL | If voltages_uv is NULL, count is 0 or above 20, or a voltage is outside the supported buck-boost range. |
| -errno | Negative errno from the I2C transfer on communication failure. |
#include <zephyr/drivers/regulator/max20362.h>
Sets the Ingenuity interrupt mask (INGEN_INT_MASK register) of the MAX20362 device.
| dev | Pointer to the device structure for the driver instance. |
| mask | Interrupt mask value to write (1 = masked/disabled, 0 = enabled). |
| 0 | On success. |
| -errno | Negative errno from the I2C transfer on communication failure. |
#include <zephyr/drivers/regulator/max20362.h>
Sets the main interrupt mask (INT_MASK register) of the MAX20362 device.
| dev | Pointer to the device structure for the driver instance. |
| mask | Interrupt mask value to write (1 = masked/disabled, 0 = enabled). |
| 0 | On success. |
| -errno | Negative errno from the I2C transfer on communication failure. |
#include <zephyr/drivers/regulator/max20362.h>
Sets the LDO input source of the MAX20362 device.
| dev | Pointer to the device structure for the driver instance. |
| source | LDO input source, one of the MAX20362_LDO_SRC_* values from <zephyr/dt-bindings/regulator/max20362.h>. |
| 0 | On success. |
| -EINVAL | If source is not a valid MAX20362_LDO_SRC_* value. |
| -errno | Negative errno from the I2C transfer on communication failure. |
#include <zephyr/drivers/regulator/max20362.h>
Sets the LDO interrupt mask (LDO_INT_MASK register) of the MAX20362 device.
| dev | Pointer to the device structure for the driver instance. |
| mask | Interrupt mask value to write (1 = masked/disabled, 0 = enabled). |
| 0 | On success. |
| -errno | Negative errno from the I2C transfer on communication failure. |
#include <zephyr/drivers/regulator/max20362.h>
Sets the Round-Robin clock polarity of the MAX20362 device.
| dev | Pointer to the device structure for the driver instance. |
| rising_edge | true to update on the rising edge, false on the falling edge. |
| 0 | On success. |
| -EBUSY | If Round-Robin is the active DVS source (disable it first). |
| -errno | Negative errno from the I2C transfer on communication failure. |
#include <zephyr/drivers/regulator/max20362.h>
Sets the Round-Robin timeout duration of the MAX20362 device.
| dev | Pointer to the device structure for the driver instance. |
| timeout | Timeout duration, one of the MAX20362_RR_TIMEOUT_* values from <zephyr/dt-bindings/regulator/max20362.h>. |
| 0 | On success. |
| -EBUSY | If Round-Robin is the active DVS source (disable it first). |
| -EINVAL | If timeout is not a valid MAX20362_RR_TIMEOUT_* value. |
| -errno | Negative errno from the I2C transfer on communication failure. |
#include <zephyr/drivers/regulator/max20362.h>
Sets the Round-Robin timeout-reset behavior of the MAX20362 device.
| dev | Pointer to the device structure for the driver instance. |
| enable | true to reset the step pointer on timeout, false to keep it. |
| 0 | On success. |
| -EBUSY | If Round-Robin is the active DVS source (disable it first). |
| -errno | Negative errno from the I2C transfer on communication failure. |
#include <zephyr/drivers/regulator/max20362.h>
Sets the Round-Robin wrap mode of the MAX20362 device.
| dev | Pointer to the device structure for the driver instance. |
| enable | true to wrap to the first step after the last, false to stop. |
| 0 | On success. |
| -EBUSY | If Round-Robin is the active DVS source (disable it first). |
| -errno | Negative errno from the I2C transfer on communication failure. |