cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any proper or suggested way to write a sensor library?

furkan_elibol
Associate

Hi,

I want to learn how to write a proper sensor library. I am aware that every sensor has specific way to work but i need to understand coding details. For example should use only one struct for writing and reading registers or maybe seperate structs for each register field like result, configuration, low limit, high limit etc.. Should i use static variable for my configuration struct or should user can create its own variable and push it to my configuration function. I'm trying to figure out best solutions for these kind of problems. Is there any kind of standart or guide? I would be appreciate if you'll enlighten me.

Regards

Furkan

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @furkan_elibol and welcome to the ST Community :smiling_face_with_smiling_eyes:.

I suggest you to take a look at the UM2298. It should be helpful.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
STTwo-32
ST Employee

Hello @furkan_elibol and welcome to the ST Community :smiling_face_with_smiling_eyes:.

I suggest you to take a look at the UM2298. It should be helpful.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.