Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
max20362.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Analog Devices Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_DRIVERS_REGULATOR_MAX20362_H_
14#define ZEPHYR_INCLUDE_DRIVERS_REGULATOR_MAX20362_H_
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#include <errno.h>
21#include <zephyr/device.h>
22#include <zephyr/kernel.h>
23#include <zephyr/sys/util.h>
24
31
37#define MAX20362_INT_CAPOVLO_MASK BIT(7)
39#define MAX20362_INT_CAPUVLO_MASK BIT(6)
41#define MAX20362_INT_BBSTON_MASK BIT(5)
43#define MAX20362_INT_BBSTOFF_MASK BIT(4)
45#define MAX20362_INT_BBINUVLO_MASK BIT(3)
47#define MAX20362_INT_UVLO_MASK BIT(2)
49#define MAX20362_INT_BSTFLT_MASK BIT(1)
51#define MAX20362_INT_THMFLT_MASK BIT(0)
53
59#define MAX20362_LDOINT_DIV_MASK BIT(3)
61#define MAX20362_LDOINT_SHR_MASK BIT(2)
63#define MAX20362_LDOINT_THM_MASK BIT(1)
65#define MAX20362_LDOINT_CLP_MASK BIT(0)
67
73#define MAX20362_INGENINT_OUTTMO_MASK BIT(4)
75#define MAX20362_INGENINT_DRPMIN_MASK BIT(3)
77#define MAX20362_INGENINT_TNKTMO_MASK BIT(2)
79#define MAX20362_INGENINT_SIMOPIN_MASK BIT(1)
81#define MAX20362_INGENINT_DRPMAX_MASK BIT(0)
83
89#define MAX20362_INT_MASK_ALL 0xFF
91#define MAX20362_LDO_INT_MASK_ALL 0x0F
93#define MAX20362_INGEN_INT_MASK_ALL 0x1F
95
104int regulator_max20362_set_int_mask(const struct device *dev, uint8_t mask);
105
115
125
137
149
162int regulator_max20362_set_dvs_rr_table(const struct device *dev, const uint32_t *voltages_uv,
163 uint8_t count);
164
174int regulator_max20362_set_rr_wrap(const struct device *dev, bool enable);
175
185int regulator_max20362_set_rr_clk_polarity(const struct device *dev, bool rising_edge);
186
196int regulator_max20362_set_rr_timeout_reset(const struct device *dev, bool enable);
197
209int regulator_max20362_set_rr_timeout(const struct device *dev, uint8_t timeout);
210
212
213#ifdef __cplusplus
214}
215#endif
216
217#endif /* ZEPHYR_INCLUDE_DRIVERS_REGULATOR_MAX20362_H_ */
APIs and macros for the Zephyr device model.
System error numbers.
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_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_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_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_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_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_rr_wrap(const struct device *dev, bool enable)
Sets the Round-Robin wrap mode 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.
Public kernel APIs.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:543
Misc utilities.