mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
battery_charger:add poll support
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/fs/ioctl.h>
|
||||
#include <nuttx/semaphore.h>
|
||||
#include <nuttx/list.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
@@ -127,6 +128,8 @@ struct battery_charger_dev_s
|
||||
|
||||
sem_t batsem; /* Enforce mutually exclusive access */
|
||||
|
||||
struct list_node flist;
|
||||
|
||||
/* Data fields specific to the lower-half driver may follow */
|
||||
};
|
||||
|
||||
@@ -148,6 +151,13 @@ extern "C"
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: battery_charger_changed
|
||||
****************************************************************************/
|
||||
|
||||
int battery_charger_changed(FAR struct battery_charger_dev_s *dev,
|
||||
uint32_t mask);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: battery_charger_register
|
||||
*
|
||||
|
||||
@@ -61,6 +61,15 @@
|
||||
|
||||
#define BATTERY_INPUT_CURRENT_EXT_LIM (-1) /* External input current limit */
|
||||
|
||||
/* The change mask definition used to set the mask. */
|
||||
|
||||
#define BATTERY_STATE_CHANGED (1U << 0)
|
||||
#define BATTERY_HEALTH_CHANGED (1U << 1)
|
||||
#define BATTERY_ONLINE_CHANGED (1U << 2)
|
||||
#define BATTERY_VOLTAGE_CHANGED (1U << 3)
|
||||
#define BATTERY_CURRENT_CHANGED (1U << 4)
|
||||
#define BATTERY_INPUT_CURRENT_CHANGED (1U << 5)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user