Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
-
Sorry, I saw this discusssion only now. I'll take a look next week. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your enhancement proposal related to a problem? Please describe.
I came across with this sensor driver, #62028 here is the discussion.
it seems this sensor driver is not comprehensive for the lps22df and doesn't allow a user to use it fully functional. The user needs to rewrite some parts of the code. Well, of course, it really good starter to see pressure and temp data coming out to the terminal screen but I think it would be better
I have a couple of questions for you if you don't mind to understand your approach to how a zephyros driver should be comprehensive.
question 1:
here is your bus mode setting, may I ask why you restrict bus_mode_settings with only the i3c bus interface? Because this bus mode setting is not only for i3c but also is valid for I²C with antispike filter as well, if you are running this code for i3c you should run it for the i2c bus too.
look at the lps22df.pdf page 28, paragraph: 7.4.2:
but look at your configuration it is only valid if the bus interface is i3c.
so would it not be better to remove if(ON_I3C_BUS(cfg)) statement?
question 2:
may I ask why you call this function set_odr or set only odr setting here? Because the function lps22df_mode_set you used in the lps22df_set_odr_raw requires also cfg->avg and cfg->lpf configurations which are really important together in terms of power consumption,(see page 33, paragraph 9.6 ) so would be better to give these parameters together into the function you defined (lps22df_set_odr_raw) and rename it. I see you call this function in the lps22df_attr_set to change sampling frequency but the avg(resolution ) config is also very important. I would've added the SENSOR_ATTR_OVERSAMPLING factor with the SENSOR_ATTR_SAMPLING_FREQUENCY in the lps22df_attr_set function to make this sensor fully functional.
it seems you took the lps22hh driver as a sample, that's why you have limited configuration here but lps22hh sensor supports only the odr setting as a sensor attribute but this lps22df sensor has some more attributes
question 3
should not it be better to have this tries value as a config definition? As far as I understand here this one is the timeout counter and waits until the reset is completed. if the reset is not completed, it is an error. so you defined the tries variable and its value as 10 in the init function in the source file
question 4:
we have 2 additional interrupt configs for the lps22df sensor.
would it not be better to show these configurations here to a user of this driver?
thanks for reading my questions patiently. and I'll appreciate it if you can reply to me
Beta Was this translation helpful? Give feedback.
All reactions