Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
npm1300.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Nordic Semiconductor ASA
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#ifndef ZEPHYR_INCLUDE_DRIVERS_MFD_NPM1300_H_
7#define ZEPHYR_INCLUDE_DRIVERS_MFD_NPM1300_H_
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
19#include <stddef.h>
20#include <stdint.h>
21
22#include <zephyr/device.h>
23#include <zephyr/drivers/gpio.h>
24
42
54int mfd_npm1300_reg_read_burst(const struct device *dev, uint8_t base, uint8_t offset, void *data,
55 size_t len);
56
67int mfd_npm1300_reg_read(const struct device *dev, uint8_t base, uint8_t offset, uint8_t *data);
68
79int mfd_npm1300_reg_write(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data);
80
92int mfd_npm1300_reg_write2(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data1,
93 uint8_t data2);
94
106int mfd_npm1300_reg_update(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data,
107 uint8_t mask);
108
118int mfd_npm1300_set_timer(const struct device *dev, uint32_t time_ms);
119
127int mfd_npm1300_reset(const struct device *dev);
128
140int mfd_npm1300_hibernate(const struct device *dev, uint32_t time_ms);
141
149int mfd_npm1300_add_callback(const struct device *dev, struct gpio_callback *callback);
150
158int mfd_npm1300_remove_callback(const struct device *dev, struct gpio_callback *callback);
159
162#ifdef __cplusplus
163}
164#endif
165
166#endif /* ZEPHYR_INCLUDE_DRIVERS_MFD_NPM1300_H_ */
Public APIs for GPIO drivers.
int mfd_npm1300_reg_read_burst(const struct device *dev, uint8_t base, uint8_t offset, void *data, size_t len)
Read multiple registers from npm1300.
int mfd_npm1300_add_callback(const struct device *dev, struct gpio_callback *callback)
Add npm1300 event callback.
int mfd_npm1300_reg_write(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data)
Write single register to npm1300.
int mfd_npm1300_reset(const struct device *dev)
npm1300 full power reset
int mfd_npm1300_hibernate(const struct device *dev, uint32_t time_ms)
npm1300 hibernate
int mfd_npm1300_remove_callback(const struct device *dev, struct gpio_callback *callback)
Remove npm1300 event callback.
int mfd_npm1300_reg_write2(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data1, uint8_t data2)
Write two registers to npm1300.
mfd_npm1300_event_t
Definition npm1300.h:25
int mfd_npm1300_reg_update(const struct device *dev, uint8_t base, uint8_t offset, uint8_t data, uint8_t mask)
Update selected bits in npm1300 register.
int mfd_npm1300_set_timer(const struct device *dev, uint32_t time_ms)
Write npm1300 timer register.
int mfd_npm1300_reg_read(const struct device *dev, uint8_t base, uint8_t offset, uint8_t *data)
Read single register from npm1300.
@ NPM1300_EVENT_CHG_COMPLETED
Definition npm1300.h:26
@ NPM1300_EVENT_GPIO4_EDGE
Definition npm1300.h:39
@ NPM1300_EVENT_CHG_ERROR
Definition npm1300.h:27
@ NPM1300_EVENT_GPIO0_EDGE
Definition npm1300.h:35
@ NPM1300_EVENT_WATCHDOG_WARN
Definition npm1300.h:32
@ NPM1300_EVENT_MAX
Definition npm1300.h:40
@ NPM1300_EVENT_SHIPHOLD_PRESS
Definition npm1300.h:30
@ NPM1300_EVENT_GPIO1_EDGE
Definition npm1300.h:36
@ NPM1300_EVENT_BATTERY_DETECTED
Definition npm1300.h:28
@ NPM1300_EVENT_GPIO2_EDGE
Definition npm1300.h:37
@ NPM1300_EVENT_GPIO3_EDGE
Definition npm1300.h:38
@ NPM1300_EVENT_VBUS_REMOVED
Definition npm1300.h:34
@ NPM1300_EVENT_BATTERY_REMOVED
Definition npm1300.h:29
@ NPM1300_EVENT_SHIPHOLD_RELEASE
Definition npm1300.h:31
@ NPM1300_EVENT_VBUS_DETECTED
Definition npm1300.h:33
__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:412
GPIO callback structure.
Definition gpio.h:740