summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-23 18:37:45 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-23 18:37:45 +0000
commitef82d9a26df8c1abfb0ab0cf36d194c597a5dda7 (patch)
treeea48b73e1893927467230bd559eeeae840e5c6b9 /nuttx/include
parent14bc61cb16e67bd247cef620e42500cc2c19bcd5 (diff)
downloadpx4-nuttx-ef82d9a26df8c1abfb0ab0cf36d194c597a5dda7.tar.gz
px4-nuttx-ef82d9a26df8c1abfb0ab0cf36d194c597a5dda7.tar.bz2
px4-nuttx-ef82d9a26df8c1abfb0ab0cf36d194c597a5dda7.zip
Fixes for clean compile of battery drivers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4325 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/power/battery.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/nuttx/include/nuttx/power/battery.h b/nuttx/include/nuttx/power/battery.h
index b1a06fd62..b98d6379e 100644
--- a/nuttx/include/nuttx/power/battery.h
+++ b/nuttx/include/nuttx/power/battery.h
@@ -44,6 +44,7 @@
#include <nuttx/config.h>
#include <nuttx/ioctl.h>
+#include <stdbool.h>
#include <semaphore.h>
#include <fixedmath.h>
@@ -85,9 +86,9 @@
*/
#define BATIOC_STATE _BATIOC(0x0001)
-#define BATIOC_ONLINE _BATIOC(0x0001)
-#define BATIOC_VOLTAGE _BATIOC(0x0001)
-#define BATIOC_CAPACITY _BATIOC(0x0001)
+#define BATIOC_ONLINE _BATIOC(0x0002)
+#define BATIOC_VOLTAGE _BATIOC(0x0003)
+#define BATIOC_CAPACITY _BATIOC(0x0004)
/****************************************************************************
* Public Types
@@ -110,19 +111,19 @@ struct battery_operations_s
{
/* Return the current battery state (see enum battery_status_e) */
- int state(struct battery_dev_s *dev, int *status);
+ int (*state)(struct battery_dev_s *dev, int *status);
/* Return true if the batter is online */
- int online(struct battery_dev_s *dev, bool *status);
+ int (*online)(struct battery_dev_s *dev, bool *status);
/* Current battery voltage */
- int voltage(struct battery_dev_s *dev, b16_t *value);
+ int (*voltage)(struct battery_dev_s *dev, b16_t *value);
/* Battery capacity */
- int capacity(struct battery_dev_s *dev, b16_t *value);
+ int (*capacity)(struct battery_dev_s *dev, b16_t *value);
};
/* This structure defines the battery driver state structure */
@@ -185,6 +186,8 @@ EXTERN int battery_register(FAR const char *devpath,
* CONFIG_BATTERY - Upper half battery driver support
* CONFIG_I2C - I2C support
* CONFIG_I2C_MAX1704X - And the driver must be explictly selected.
+ * CONFIG_I2C_MAX17040 or CONFIG_I2C_MAX17041 - The driver must know which
+ * chip is on the board in order to scale the voltage correctly.
*
* Input Parameters:
* i2c - An instance of the I2C interface to use to communicate with the MAX1704x