diff --git a/drivers/power/battery/battery_gauge.c b/drivers/power/battery/battery_gauge.c index 3363ca694f1..beb63bf6012 100644 --- a/drivers/power/battery/battery_gauge.c +++ b/drivers/power/battery/battery_gauge.c @@ -308,7 +308,7 @@ static int bat_gauge_ioctl(FAR struct file *filep, case BATIOC_VOLTAGE: { - FAR b16_t *ptr = (FAR b16_t *)((uintptr_t)arg); + FAR int *ptr = (FAR int *)((uintptr_t)arg); if (ptr) { ret = dev->ops->voltage(dev, ptr); @@ -318,7 +318,7 @@ static int bat_gauge_ioctl(FAR struct file *filep, case BATIOC_CAPACITY: { - FAR b16_t *ptr = (FAR b16_t *)((uintptr_t)arg); + FAR int *ptr = (FAR int *)((uintptr_t)arg); if (ptr) { ret = dev->ops->capacity(dev, ptr); @@ -328,7 +328,7 @@ static int bat_gauge_ioctl(FAR struct file *filep, case BATIOC_CURRENT: { - FAR b16_t *ptr = (FAR b16_t *)((uintptr_t)arg); + FAR int *ptr = (FAR int *)((uintptr_t)arg); if (ptr) { ret = dev->ops->current(dev, ptr); @@ -338,7 +338,7 @@ static int bat_gauge_ioctl(FAR struct file *filep, case BATIOC_TEMPERATURE: { - FAR b8_t *ptr = (FAR b8_t *)((uintptr_t)arg); + FAR int *ptr = (FAR int *)((uintptr_t)arg); if (ptr) { ret = dev->ops->temp(dev, ptr); diff --git a/include/nuttx/power/battery_gauge.h b/include/nuttx/power/battery_gauge.h index e4868e3e5b6..0501410f564 100644 --- a/include/nuttx/power/battery_gauge.h +++ b/include/nuttx/power/battery_gauge.h @@ -68,17 +68,17 @@ * BATIOC_ONLINE - Return 1 if the battery is online; 0 if offline. * Input value: A pointer to type bool. * BATIOC_VOLTAGE - Return the current battery voltage. The returned value - * is a fixed precision number in units of volts. - * Input value: A pointer to type b16_t. + * is a fixed precision number in units of mV. + * Input value: A pointer to type int. * BATIOC_CAPACITY - Return the current battery capacity or State of Charge * (SoC). The returned value is a fixed precision percentage of the * batteries full capacity. - * Input value: A pointer to type b16_t. + * Input value: A pointer to type int. * BATIOC_CURRENT - Return the current of the battery . The returned value * is a fixed precision number in units of ma. - * Input value: A pointer to type b16_t. + * Input value: A pointer to type int. * BATIOC_TEMPERATURE- Return the current temperature of the battery. - * Input value: A pointer to type b8_t. + * Input value: A pointer to type int. * BATIOC_CHIPID- Return the chip id of the gauge. * Input value: A pointer to type unsigned int. */ @@ -102,20 +102,20 @@ struct battery_gauge_operations_s /* Current battery voltage */ - CODE int (*voltage)(FAR struct battery_gauge_dev_s *dev, FAR b16_t *value); + CODE int (*voltage)(FAR struct battery_gauge_dev_s *dev, FAR int *value); /* Battery capacity */ CODE int (*capacity)(FAR struct battery_gauge_dev_s *dev, - FAR b16_t *value); + FAR int *value); /* Battery current */ - CODE int (*current)(FAR struct battery_gauge_dev_s *dev, FAR b16_t *value); + CODE int (*current)(FAR struct battery_gauge_dev_s *dev, FAR int *value); /* Battery temp */ - CODE int (*temp)(FAR struct battery_gauge_dev_s *dev, FAR b8_t *value); + CODE int (*temp)(FAR struct battery_gauge_dev_s *dev, FAR int *value); /* Battery chipid */