Skip to content

doc: doxygen: add driver_api alias to describe driver API #82117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kartben
Copy link
Collaborator

@kartben kartben commented Nov 27, 2024

A new attempt at trying to provide public documentation for the driver API that device driver developers need to implement.

https://builds.zephyrproject.io/zephyr/pr/82117/docs/doxygen/html/group__adc__interface.html
https://builds.zephyrproject.io/zephyr/pr/82117/docs/doxygen/html/structadc__driver__api.html

@kartben
Copy link
Collaborator Author

kartben commented Nov 27, 2024

@nashif @gmarull @pdgendt thoughts on this approach?

@pdgendt
Copy link
Collaborator

pdgendt commented Nov 28, 2024

+1 for automating documentation, perhaps add a reference to the device driver model?

Comment on lines +297 to +299
"supervisor=\qualifier supervisor" \
"driver_api{1}=\brief \htmlonly <span class=\"mlabel\">Driver API</span> \endhtmlonly \1 driver API \
\details This is the mandatory API any \1 driver needs to expose."
Copy link
Member

@gmarull gmarull Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think calling this "Driver API" is a bit confusing. These are "driver ops", consumed by the actual driver/interface API. For now, we've kept this internal (INTERNAL_HIDDEN), but I think they should be part of first its own header and then its own Doxygen page. Many consumers of the driver/interface API do not care about how it is implemented behind the scenes, so it just clutters the main page. Also, we need to be careful about using @copydoc because there are many situations where there's no 1:1 mapping between the driver/interface API and the op it calls. A simple example is with optional ops: driver/interface API will document @retval -ENOSYS if not implemented, whereas the op won't have it.

Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jan 28, 2025
@github-actions github-actions bot closed this Feb 11, 2025
@kartben kartben reopened this Mar 19, 2025
@henrikbrixandersen henrikbrixandersen self-requested a review March 19, 2025 11:03
@pdgendt pdgendt removed the Stale label Mar 19, 2025
@pdgendt pdgendt self-requested a review March 19, 2025 11:12
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label May 19, 2025
kartben added 2 commits May 27, 2025 23:59
This new alias helps describe the driver API as part
of the public documentation, while still making it
visually distinguishable so that device driver
developers can quickly identify/access them.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This illustrates how one can document driver API by migrating a few
subsystems to the new driver_api Doxygen alias.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
@kartben kartben force-pushed the driver_api_doxy branch from cc4b232 to 42f0e3b Compare May 27, 2025 22:03
Copy link

@github-actions github-actions bot removed the Stale label May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants