macro.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _DOXYGEN_EXAMPLE_MACRO_H_
  2. #define _DOXYGEN_EXAMPLE_MACRO_H_
  3. /**
  4. * @page page_howto_macro How to write doxygen documentation for macro.
  5. *
  6. * There are two typical types of macro definitions.
  7. *
  8. * - One is to define constant macros. For this type of macro, we
  9. * recommend putting documentation after members. See `DOXYGEN_EXAMPLE_CONST_A`
  10. * and `DOXYGEN_EXAMPLE_CONST_B` in
  11. * <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/macro.h">documentation/0.doxygen/example/include/macro.h</a>
  12. * for exmaple.
  13. *
  14. * - The other is to define macros with parameters. For this type of
  15. * macro, we recommend using a method similar to documenting for
  16. * functions, that is, writing comment block before the macro definition.
  17. * More details please see @ref page_howto_function
  18. * See `DOXYGEN_EXAMPLE_ABS` in
  19. * <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/macro.h">documentation/0.doxygen/example/include/macro.h</a>
  20. * for example.
  21. */
  22. /**
  23. * @addtogroup group_doxygen_example
  24. */
  25. /** @{ */
  26. #define DOXYGEN_EXAMPLE_CONST_A 100 /**< Description of macro const A */
  27. #define DOXYGEN_EXAMPLE_CONST_B 200 /**< Description of macro const B */
  28. /**
  29. * @brief Computes the absolute value of its argument @a x.
  30. *
  31. * @param[in] x input value.
  32. *
  33. * @return absolute value of @a x.
  34. */
  35. #define DOXYGEN_EXAMPLE_ABS(x) (((x)>0)?(x):-(x))
  36. /** @} */
  37. #endif