main_page.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /**
  2. * @defgroup lwip lwIP
  3. *
  4. * @defgroup infrastructure Infrastructure
  5. *
  6. * @defgroup callbackstyle_api Callback-style APIs
  7. * Non thread-safe APIs, callback style for maximum performance and minimum
  8. * memory footprint.
  9. *
  10. * @defgroup sequential_api Sequential-style APIs
  11. * Sequential-style APIs, blocking functions. More overhead, but can be called
  12. * from any thread except TCPIP thread.
  13. *
  14. * @defgroup addons Addons
  15. *
  16. * @defgroup apps Applications
  17. */
  18. /**
  19. * @mainpage Overview
  20. * @verbinclude "README"
  21. */
  22. /**
  23. * @page upgrading Upgrading
  24. * @verbinclude "UPGRADING"
  25. */
  26. /**
  27. * @page changelog Changelog
  28. * @verbinclude "CHANGELOG"
  29. */
  30. /**
  31. * @page contrib How to contribute to lwIP
  32. * @verbinclude "contrib.txt"
  33. */
  34. /**
  35. * @page pitfalls Common pitfalls
  36. *
  37. * Multiple Execution Contexts in lwIP code
  38. * ========================================
  39. *
  40. * The most common source of lwIP problems is to have multiple execution contexts
  41. * inside the lwIP code.
  42. *
  43. * lwIP can be used in two basic modes: @ref lwip_nosys (no OS/RTOS
  44. * running on target system) or @ref lwip_os (there is an OS running
  45. * on the target system).
  46. *
  47. * Mainloop Mode
  48. * -------------
  49. * In mainloop mode, only @ref callbackstyle_api can be used.
  50. * The user has two possibilities to ensure there is only one
  51. * exection context at a time in lwIP:
  52. *
  53. * 1) Deliver RX ethernet packets directly in interrupt context to lwIP
  54. * by calling netif->input directly in interrupt. This implies all lwIP
  55. * callback functions are called in IRQ context, which may cause further
  56. * problems in application code: IRQ is blocked for a long time, multiple
  57. * execution contexts in application code etc. When the application wants
  58. * to call lwIP, it only needs to disable interrupts during the call.
  59. * If timers are involved, even more locking code is needed to lock out
  60. * timer IRQ and ethernet IRQ from each other, assuming these may be nested.
  61. *
  62. * 2) Run lwIP in a mainloop. There is example code here: @ref lwip_nosys.
  63. * lwIP is _ONLY_ called from mainloop callstacks here. The ethernet IRQ
  64. * has to put received telegrams into a queue which is polled in the
  65. * mainloop. Ensure lwIP is _NEVER_ called from an interrupt, e.g.
  66. * some SPI IRQ wants to forward data to udp_send() or tcp_write()!
  67. *
  68. * OS Mode
  69. * -------
  70. * In OS mode, @ref callbackstyle_api AND @ref sequential_api can be used.
  71. * @ref sequential_api are designed to be called from threads other than
  72. * the TCPIP thread, so there is nothing to consider here.
  73. * But @ref callbackstyle_api functions must _ONLY_ be called from
  74. * TCPIP thread. It is a common error to call these from other threads
  75. * or from IRQ contexts. ​Ethernet RX needs to deliver incoming packets
  76. * in the correct way by sending a message to TCPIP thread, this is
  77. * implemented in tcpip_input().​​
  78. * Again, ensure lwIP is _NEVER_ called from an interrupt, e.g.
  79. * some SPI IRQ wants to forward data to udp_send() or tcp_write()!
  80. *
  81. * 1) tcpip_callback() can be used get called back from TCPIP thread,
  82. * it is safe to call any @ref callbackstyle_api from there.
  83. *
  84. * 2) Use @ref LWIP_TCPIP_CORE_LOCKING. All @ref callbackstyle_api
  85. * functions can be called when lwIP core lock is aquired, see
  86. * @ref LOCK_TCPIP_CORE() and @ref UNLOCK_TCPIP_CORE().
  87. * These macros cannot be used in an interrupt context!
  88. * Note the OS must correctly handle priority inversion for this.
  89. */
  90. /**
  91. * @page bugs Reporting bugs
  92. * Please report bugs in the lwIP bug tracker at savannah.\n
  93. * BEFORE submitting, please check if the bug has already been reported!\n
  94. * https://savannah.nongnu.org/bugs/?group=lwip
  95. */
  96. /**
  97. * @defgroup lwip_nosys Mainloop mode ("NO_SYS")
  98. * @ingroup lwip
  99. * Use this mode if you do not run an OS on your system. \#define NO_SYS to 1.
  100. * Feed incoming packets to netif->input(pbuf, netif) function from mainloop,
  101. * *not* *from* *interrupt* *context*. You can allocate a @ref pbuf in interrupt
  102. * context and put them into a queue which is processed from mainloop.\n
  103. * Call sys_check_timeouts() periodically in the mainloop.\n
  104. * Porting: implement all functions in @ref sys_time, @ref sys_prot and
  105. * @ref compiler_abstraction.\n
  106. * You can only use @ref callbackstyle_api in this mode.\n
  107. * Sample code:\n
  108. * @include NO_SYS_SampleCode.c
  109. */
  110. /**
  111. * @defgroup lwip_os OS mode (TCPIP thread)
  112. * @ingroup lwip
  113. * Use this mode if you run an OS on your system. It is recommended to
  114. * use an RTOS that correctly handles priority inversion and
  115. * to use @ref LWIP_TCPIP_CORE_LOCKING.\n
  116. * Porting: implement all functions in @ref sys_layer.\n
  117. * You can use @ref callbackstyle_api together with @ref tcpip_callback,
  118. * and all @ref sequential_api.
  119. */
  120. /**
  121. * @page raw_api lwIP API
  122. * @verbinclude "rawapi.txt"
  123. */