Skip to main content
Explorer
March 16, 2024
Solved

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

  • March 16, 2024
  • 1 reply
  • 1663 views

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

    This topic has been closed for replies.
    Best answer by STTwo-32

    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 

    1 reply

    STTwo-32Answer
    Technical Moderator
    March 16, 2024

    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