main_page.h 4.6 KB

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