mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
battery_monitor:add poll support
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
@@ -69,7 +69,9 @@
|
||||
#define BATTERY_VOLTAGE_CHANGED (1U << 3)
|
||||
#define BATTERY_CURRENT_CHANGED (1U << 4)
|
||||
#define BATTERY_CAPACITY_CHANGED (1U << 5)
|
||||
#define BATTERY_TEMPERATURE_CHANGED (1U << 6)
|
||||
#define BATTERY_CELLVOLTAGE_CHANGED (1U << 6)
|
||||
#define BATTERY_TEMPERATURE_CHANGED (1U << 7)
|
||||
#define BATTERY_COULOMBS_CHANGED (1U << 8)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/fs/ioctl.h>
|
||||
#include <nuttx/list.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -296,6 +297,8 @@ struct battery_monitor_dev_s
|
||||
FAR const struct battery_monitor_operations_s *ops; /* Battery operations */
|
||||
sem_t batsem; /* Enforce mutually exclusive access */
|
||||
|
||||
struct list_node flist;
|
||||
|
||||
/* Data fields specific to the lower-half driver may follow */
|
||||
};
|
||||
|
||||
@@ -317,6 +320,13 @@ extern "C"
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: battery_monitor_changed
|
||||
****************************************************************************/
|
||||
|
||||
int battery_monitor_changed(FAR struct battery_monitor_dev_s *dev,
|
||||
uint32_t mask);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: battery_monitor_register
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user