diff --git a/include/nuttx/power/battery_charger.h b/include/nuttx/power/battery_charger.h index af99027aec..5f66666a38 100644 --- a/include/nuttx/power/battery_charger.h +++ b/include/nuttx/power/battery_charger.h @@ -52,7 +52,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ + /* CONFIG_BATTERY_CHARGER - Upper half battery charger driver support * * Specific, lower-half drivers will have other configuration requirements @@ -64,8 +66,10 @@ */ /* IOCTL Commands ***********************************************************/ -/* The upper-half battery charger driver provides a character driver "wrapper" - * around the lower-half battery charger driver that does all of the real work. + +/* The upper-half battery charger driver provides a character driver + * "wrapper" around the lower-half battery charger driver that does all of + * the real work. * Since there is no real data transfer to/or from a battery, all of the * driver interaction is through IOCTL commands. The IOCTL commands * supported by the upper-half driver simply provide calls into the @@ -86,7 +90,8 @@ * BATIOC_INPUT_CURRENT - Define the input current limit of power supply. * Input value: An int defining the input current limit value. * BATIOC_OPERATE - Perform miscellaneous, device-specific charger operation. - * Input value: An uintptr_t that can hold a pointer to struct batio_operate_msg_s. + * Input value: An uintptr_t that can hold a pointer to struct + * batio_operate_msg_s. */ /* Special input values for BATIOC_INPUT_CURRENT that may optionally @@ -98,6 +103,7 @@ /**************************************************************************** * Public Types ****************************************************************************/ + /* Battery status */ enum battery_charger_status_e @@ -126,7 +132,7 @@ enum battery_charger_health_e BATTERY_HEALTH_DISCONNECTED /* Battery is not connected */ }; - /* This structure defines the lower half battery interface */ + /* This structure defines the lower half battery interface */ struct battery_charger_dev_s; struct battery_charger_operations_s @@ -167,6 +173,7 @@ struct battery_charger_dev_s /* Fields required by the upper-half driver */ FAR const struct battery_charger_operations_s *ops; /* Battery operations */ + sem_t batsem; /* Enforce mutually exclusive access */ /* Data fields specific to the lower-half driver may follow */ @@ -189,6 +196,7 @@ extern "C" /**************************************************************************** * Public Function Prototypes ****************************************************************************/ + /**************************************************************************** * Name: battery_charger_register * @@ -238,10 +246,11 @@ int battery_charger_register(FAR const char *devpath, #if defined(CONFIG_I2C) && defined(CONFIG_I2C_BQ2425X) struct i2c_master_s; -FAR struct battery_charger_dev_s *bq2425x_initialize(FAR struct i2c_master_s *i2c, - uint8_t addr, - uint32_t frequency, - int current); +FAR struct battery_charger_dev_s *bq2425x_initialize( + FAR struct i2c_master_s *i2c, + uint8_t addr, + uint32_t frequency, + int current); #endif /**************************************************************************** @@ -287,10 +296,11 @@ FAR struct battery_charger_dev_s *bq2425x_initialize(FAR struct i2c_master_s *i2 #if defined(CONFIG_I2C) && defined(CONFIG_I2C_BQ2429X) struct i2c_master_s; -FAR struct battery_charger_dev_s *bq2429x_initialize(FAR struct i2c_master_s *i2c, - uint8_t addr, - uint32_t frequency, - int current); +FAR struct battery_charger_dev_s *bq2429x_initialize( + FAR struct i2c_master_s *i2c, + uint8_t addr, + uint32_t frequency, + int current); #endif #undef EXTERN diff --git a/include/nuttx/power/relay.h b/include/nuttx/power/relay.h index 4b8fa4921a..ff3d8e4621 100644 --- a/include/nuttx/power/relay.h +++ b/include/nuttx/power/relay.h @@ -50,6 +50,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ + /* IOCTL Commands ***********************************************************/ #define RELAYIOC_CTRL _RELAYIOC(0x0001) /* Relay control