You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using an Arduino Nicla Sense ME on a project, which has a BQ25120A charger chip.
This chip has an LDO output that I need to configure via I2C. I defined a custom property the following way:
Then in my implementation of the int charger_set_prop(const struct device *dev, const charger_prop_t prop, const union charger_propval *val); function I write the proper register. To test that it was working properly I used an unused member of charger_propval as the val argument. This hack worked fine for testing, but I am now wondering about the best way to add custom members to this union ?
I defined a custom union that I pass as argument instead of charger_propval:
union bq25120a_propval {
union charger_propval;
uint32_t ldo_value;
};
It works, but I get warnings of this type : expected 'const union charger_propval *' but argument is of type 'const union bq25120a_propval *'
Does anyone have an idea on how I can proceed to remove this warning ?
Thanks
Nicolas G.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Zephyr community,
I am using an Arduino Nicla Sense ME on a project, which has a BQ25120A charger chip.
This chip has an LDO output that I need to configure via I2C. I defined a custom property the following way:
Then in my implementation of the
int charger_set_prop(const struct device *dev, const charger_prop_t prop, const union charger_propval *val);
function I write the proper register. To test that it was working properly I used an unused member ofcharger_propval
as theval
argument. This hack worked fine for testing, but I am now wondering about the best way to add custom members to this union ?I defined a custom union that I pass as argument instead of charger_propval:
It works, but I get warnings of this type :
expected 'const union charger_propval *' but argument is of type 'const union bq25120a_propval *'
Does anyone have an idea on how I can proceed to remove this warning ?
Thanks
Nicolas G.
Beta Was this translation helpful? Give feedback.
All reactions