Zephyr Project API 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Enumerations

enum  mfd_npm2100_event {
  NPM2100_EVENT_SYS_DIETEMP_WARN , NPM2100_EVENT_SYS_SHIPHOLD_FALL , NPM2100_EVENT_SYS_SHIPHOLD_RISE , NPM2100_EVENT_SYS_PGRESET_FALL ,
  NPM2100_EVENT_SYS_PGRESET_RISE , NPM2100_EVENT_SYS_TIMER_EXPIRY , NPM2100_EVENT_ADC_VBAT_READY , NPM2100_EVENT_ADC_DIETEMP_READY ,
  NPM2100_EVENT_ADC_DROOP_DETECT , NPM2100_EVENT_ADC_VOUT_READY , NPM2100_EVENT_GPIO0_FALL , NPM2100_EVENT_GPIO0_RISE ,
  NPM2100_EVENT_GPIO1_FALL , NPM2100_EVENT_GPIO1_RISE , NPM2100_EVENT_BOOST_VBAT_WARN , NPM2100_EVENT_BOOST_VOUT_MIN ,
  NPM2100_EVENT_BOOST_VOUT_WARN , NPM2100_EVENT_BOOST_VOUT_DPS , NPM2100_EVENT_BOOST_VOUT_OK , NPM2100_EVENT_LDOSW_OCP ,
  NPM2100_EVENT_LDOSW_VINTFAIL , NPM2100_EVENT_MAX
}
 
enum  mfd_npm2100_timer_mode { NPM2100_TIMER_MODE_GENERAL_PURPOSE , NPM2100_TIMER_MODE_WDT_RESET , NPM2100_TIMER_MODE_WDT_POWER_CYCLE , NPM2100_TIMER_MODE_WAKEUP }
 

Functions

int mfd_npm2100_set_timer (const struct device *dev, uint32_t time_ms, enum mfd_npm2100_timer_mode mode)
 Write npm2100 timer register.
 
int mfd_npm2100_start_timer (const struct device *dev)
 Start npm2100 timer.
 
int mfd_npm2100_reset (const struct device *dev)
 npm2100 full power reset
 
int mfd_npm2100_hibernate (const struct device *dev, uint32_t time_ms)
 npm2100 hibernate
 
int mfd_npm2100_add_callback (const struct device *dev, struct gpio_callback *callback)
 Add npm2100 event callback.
 
int mfd_npm2100_remove_callback (const struct device *dev, struct gpio_callback *callback)
 Remove npm2100 event callback.
 

Detailed Description

Enumeration Type Documentation

◆ mfd_npm2100_event

#include <include/zephyr/drivers/mfd/npm2100.h>

Enumerator
NPM2100_EVENT_SYS_DIETEMP_WARN 
NPM2100_EVENT_SYS_SHIPHOLD_FALL 
NPM2100_EVENT_SYS_SHIPHOLD_RISE 
NPM2100_EVENT_SYS_PGRESET_FALL 
NPM2100_EVENT_SYS_PGRESET_RISE 
NPM2100_EVENT_SYS_TIMER_EXPIRY 
NPM2100_EVENT_ADC_VBAT_READY 
NPM2100_EVENT_ADC_DIETEMP_READY 
NPM2100_EVENT_ADC_DROOP_DETECT 
NPM2100_EVENT_ADC_VOUT_READY 
NPM2100_EVENT_GPIO0_FALL 
NPM2100_EVENT_GPIO0_RISE 
NPM2100_EVENT_GPIO1_FALL 
NPM2100_EVENT_GPIO1_RISE 
NPM2100_EVENT_BOOST_VBAT_WARN 
NPM2100_EVENT_BOOST_VOUT_MIN 
NPM2100_EVENT_BOOST_VOUT_WARN 
NPM2100_EVENT_BOOST_VOUT_DPS 
NPM2100_EVENT_BOOST_VOUT_OK 
NPM2100_EVENT_LDOSW_OCP 
NPM2100_EVENT_LDOSW_VINTFAIL 
NPM2100_EVENT_MAX 

◆ mfd_npm2100_timer_mode

#include <include/zephyr/drivers/mfd/npm2100.h>

Enumerator
NPM2100_TIMER_MODE_GENERAL_PURPOSE 
NPM2100_TIMER_MODE_WDT_RESET 
NPM2100_TIMER_MODE_WDT_POWER_CYCLE 
NPM2100_TIMER_MODE_WAKEUP 

Function Documentation

◆ mfd_npm2100_add_callback()

int mfd_npm2100_add_callback ( const struct device dev,
struct gpio_callback callback 
)

#include <include/zephyr/drivers/mfd/npm2100.h>

Add npm2100 event callback.

Parameters
devnpm2100 mfd device
callbackcallback
Returns
0 on success, -errno on failure

◆ mfd_npm2100_hibernate()

int mfd_npm2100_hibernate ( const struct device dev,
uint32_t  time_ms 
)

#include <include/zephyr/drivers/mfd/npm2100.h>

npm2100 hibernate

Enters low power state, and wakes after specified time or "shphld" pin signal.

Parameters
devnpm2100 mfd device
time_mstimer value in ms. Set to 0 to disable timer.
Return values
0If successful
-EINVALif time value is too large
-EBUSYif the timer is already in use.
-errnoIn case of any bus error (see i2c_write_dt())

◆ mfd_npm2100_remove_callback()

int mfd_npm2100_remove_callback ( const struct device dev,
struct gpio_callback callback 
)

#include <include/zephyr/drivers/mfd/npm2100.h>

Remove npm2100 event callback.

Parameters
devnpm2100 mfd device
callbackcallback
Returns
0 on success, -errno on failure

◆ mfd_npm2100_reset()

int mfd_npm2100_reset ( const struct device dev)

#include <include/zephyr/drivers/mfd/npm2100.h>

npm2100 full power reset

Parameters
devnpm2100 mfd device
Return values
0If successful
-errnoIn case of any bus error (see i2c_write_dt())

◆ mfd_npm2100_set_timer()

int mfd_npm2100_set_timer ( const struct device dev,
uint32_t  time_ms,
enum mfd_npm2100_timer_mode  mode 
)

#include <include/zephyr/drivers/mfd/npm2100.h>

Write npm2100 timer register.

The timer tick resolution is 1/64 seconds. This function does not start the timer (see mfd_npm2100_start_timer()).

Parameters
devnpm2100 mfd device
time_mstimer value in ms
modetimer mode
Return values
0If successful
-EINVALif time value is too large
-errnoIn case of any bus error (see i2c_write_dt())

◆ mfd_npm2100_start_timer()

int mfd_npm2100_start_timer ( const struct device dev)

#include <include/zephyr/drivers/mfd/npm2100.h>

Start npm2100 timer.

Parameters
devnpm2100 mfd device
Return values
0If successful
-errnoIn case of any bus error (see i2c_write_dt())