Skip to content

Commit ab18927

Browse files
authored
Various Documentation Updates + bump version to SDK1.5.0-develop (#1220)
* minor cleanup of lwip+tinyusb docs, and bump sdk verison number to 1.5.0-develop * Update cyw43_arch docs for async_context_use * remove accidental copy of some comments
1 parent a916761 commit ab18927

File tree

7 files changed

+97
-45
lines changed

7 files changed

+97
-45
lines changed

pico_sdk_version.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
set(PICO_SDK_VERSION_MAJOR 1)
44
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, group=pico_base
55
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, group=pico_base
6-
set(PICO_SDK_VERSION_MINOR 4)
6+
set(PICO_SDK_VERSION_MINOR 5)
77
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, group=pico_base
88
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, group=pico_base
9-
set(PICO_SDK_VERSION_REVISION 1)
9+
set(PICO_SDK_VERSION_REVISION 0)
1010
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, optional SDK pre-release version identifier, type=string, group=pico_base
1111
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, optional SDK pre-release version identifier, type=string, group=pico_base
1212
set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)

src/rp2_common/pico_async_context/include/pico/async_context.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ typedef struct async_when_pending_worker {
145145
#define ASYNC_CONTEXT_FLAG_POLLED 0x4
146146

147147
/*!
148-
* \brief Implementation of an async_context
148+
* \brief Implementation of an async_context type, providing methods common to that type
149149
* \ingroup pico_async_context
150150
*/
151151
typedef struct async_context_type {
@@ -166,6 +166,12 @@ typedef struct async_context_type {
166166
void (*deinit)(async_context_t *self);
167167
} async_context_type_t;
168168

169+
/*!
170+
* \brief Base structure type of all async_contexts. For details about its use, see \ref pico_async_context.
171+
* \ingroup pico_async_context
172+
*
173+
* Individual async_context_types with additional state, should contain this structure at the start.
174+
*/
169175
struct async_context {
170176
const async_context_type_t *type;
171177
async_when_pending_worker_t *when_pending_list;

src/rp2_common/pico_cyw43_arch/include/pico/cyw43_arch.h

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,28 @@ extern "C" {
5555
*
5656
* * \em 'poll' - This not multi-core/IRQ safe, and requires the user to call \ref cyw43_arch_poll periodically from their main loop
5757
* * \em 'thread_safe_background' - This is multi-core/thread/task safe, and maintenance of the driver and TCP/IP stack is handled automatically in the background
58+
* * \em 'freertos' - This is multi-core/thread/task safe, and uses a separate FreeRTOS task to handle lwIP and and driver work.
5859
*
5960
* As of right now, lwIP is the only supported TCP/IP stack, however the use of \c pico_cyw43_arch is intended to be independent of
6061
* the particular TCP/IP stack used (and possibly Bluetooth stack used) in the future. For this reason, the integration of lwIP
6162
* is handled in the base (\c pico_cyw43_arch) library based on the #define \ref CYW43_LWIP used by the \c cyw43_driver.
6263
*
63-
* Whilst you can use the \c pico_cyw43_arch library directly and specify \ref CYW$#_LWIP (and other defines) yourself, several
64+
* \note As of version 1.5.0 of the Raspberry Pi Pico SDK, the \c pico_cyw43_arch library no longer directly implements
65+
* the distinct behavioral abstractions. This is now handled by the more general \ref pico_async_context library. The
66+
* user facing behavior of pico_cyw43_arch has not changed as a result of this implementation detail, however pico_cyw43_arch
67+
* is now just a thin wrapper which creates an appropriate async_context and makes a simple call to add lwIP or cyw43_driver support
68+
* as appropriate. You are free to perform this context creation and adding of lwIP, cyw43_driver or indeed any other additional
69+
* future protocol/driver support to your async_context, however for now pico_cyw43_arch does still provide a few cyw43_ specific (i.e. Pico W)
70+
* APIs still for connection management, locking and GPIO interaction.
71+
*
72+
* \note The connection management APIs at least may be moved
73+
* to a more generic library in a future release. The locking methods are now backed by their \ref pico_async_context equivalents, and
74+
* those methods may be used interchangeably (see \ref cyw43_arch_lwip_begin, \ref cyw43_arch_lwip_end and \ref cyw43_arch_lwip_check for more details).
75+
*
76+
* \note For examples of creating of your own async_context and addition of \c cyw43_driver and \c lwIP support, please
77+
* refer to the specific source files \c cyw43_arch_poll.c, \c cyw43_arch_threadsafe_background.c and \c cyw43_arch_freertos.c.
78+
*
79+
* Whilst you can use the \c pico_cyw43_arch library directly and specify \ref CYW$#_LWIP (and other defines) yourself, several
6480
* other libraries are made available to the build which aggregate the defines and other dependencies for you:
6581
*
6682
* * \b pico_cyw43_arch_lwip_poll - For using the RAW lwIP API (in `NO_SYS=1` mode) without any background processing or multi-core/thread safety.
@@ -145,7 +161,7 @@ extern "C" {
145161
* which defaults to \c CYW43_COUNTRY_WORLDWIDE. Worldwide settings may not give the best performance; consider
146162
* setting PICO_CYW43_ARCH_DEFAULT_COUNTRY_CODE to a different value or calling \ref cyw43_arch_init_with_country
147163
*
148-
* By default this method initializes the cyw43_arch code's own \ref async_context by calling
164+
* By default this method initializes the cyw43_arch code's own async_context by calling
149165
* \ref cyw43_arch_init_default_async_context, however the user can specify use of their own async_context
150166
* by calling \ref cyw43_arch_set_async_context() before calling this method
151167
*
@@ -161,7 +177,7 @@ int cyw43_arch_init(void);
161177
* was enabled at build time). This method must be called prior to using any other \c pico_cyw43_arch,
162178
* \c cyw43_driver or lwIP functions.
163179
*
164-
* By default this method initializes the cyw43_arch code's own \ref async_context by calling
180+
* By default this method initializes the cyw43_arch code's own async_context by calling
165181
* \ref cyw43_arch_init_default_async_context, however the user can specify use of their own async_context
166182
* by calling \ref cyw43_arch_set_async_context() before calling this method
167183
*
@@ -202,7 +218,7 @@ async_context_t *cyw43_arch_async_context(void);
202218
void cyw43_arch_set_async_context(async_context_t *context);
203219

204220
/*!
205-
* \brief Initialize the default \ref async_context for the current cyw43_arch type
221+
* \brief Initialize the default async_context for the current cyw43_arch type
206222
* \ingroup pico_cyw43_arch
207223
*
208224
* This method initializes and returns a pointer to the static async_context associated
@@ -246,8 +262,13 @@ void cyw43_arch_wait_for_work_until(absolute_time_t until);
246262
* If you are using single-core polling only (pico_cyw43_arch_poll) then these calls are no-ops
247263
* anyway it is good practice to call them anyway where they are necessary.
248264
*
265+
* \note as of SDK release 1.5.0, this is now equivalent to calling \ref pico_async_context_acquire_lock_blocking
266+
* on the async_context associated with cyw43_arch and lwIP.
267+
*
249268
* \sa cyw43_arch_lwip_end
250269
* \sa cyw43_arch_lwip_protect
270+
* \sa async_context_acquire_lock_blocking
271+
* \sa cyw43_arch_async_context
251272
*/
252273
static inline void cyw43_arch_lwip_begin(void) {
253274
cyw43_thread_enter();
@@ -264,8 +285,13 @@ static inline void cyw43_arch_lwip_begin(void) {
264285
* If you are using single-core polling only (pico_cyw43_arch_poll) then these calls are no-ops
265286
* anyway it is good practice to call them anyway where they are necessary.
266287
*
288+
* \note as of SDK release 1.5.0, this is now equivalent to calling \ref async_context_release_lock
289+
* on the async_context associated with cyw43_arch and lwIP.
290+
*
267291
* \sa cyw43_arch_lwip_begin
268292
* \sa cyw43_arch_lwip_protect
293+
* \sa async_context_release_lock
294+
* \sa cyw43_arch_async_context
269295
*/
270296
static inline void cyw43_arch_lwip_end(void) {
271297
cyw43_thread_exit();
@@ -306,8 +332,13 @@ static inline int cyw43_arch_lwip_protect(int (*func)(void *param), void *param)
306332
* This method will assert in debug mode, if the above conditions are not met (i.e. it is not safe to
307333
* call into the lwIP API)
308334
*
335+
* \note as of SDK release 1.5.0, this is now equivalent to calling \ref async_context_lock_check
336+
* on the async_context associated with cyw43_arch and lwIP.
337+
*
309338
* \sa cyw43_arch_lwip_begin
310339
* \sa cyw43_arch_lwip_protect
340+
* \sa async_context_lock_check
341+
* \sa cyw43_arch_async_context
311342
*/
312343

313344
/*!

src/rp2_common/pico_lwip/doc.h

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
11
/**
22
* \defgroup pico_lwip pico_lwip
3-
* \brief Wrapper libraries for <a href="https://savannah.nongnu.org/projects/lwip/lwIP">lwIP</a>
3+
* \brief Integration/wrapper libraries for <a href="https://savannah.nongnu.org/projects/lwip/lwIP">lwIP</a>
4+
* the documentation for which is <a href="https://www.nongnu.org/lwip/2_1_x/index.html">here</a>.
45
*
5-
* The following libraries are provided that contain the equivalent lwIP functionality groups:
6+
* The main \c \b pico_lwip library itself aggregates the lwIP RAW API: \c \b pico_lwip_core, \c \b pico_lwip_core4, \c \b pico_lwip_core6, \c \b pico_lwip_api, \c \b pico_lwip_netif, \c \b pico_lwip_sixlowpan and \c \b pico_lwip_ppp.
67
*
7-
* * \c \b pico_lwip_core -
8-
* * \c \b pico_lwip_core4 -
9-
* * \c \b pico_lwip_core6 -
10-
* * \c \b pico_lwip_netif -
11-
* * \c \b pico_lwip_sixlowpan -
12-
* * \c \b pico_lwip_ppp -
13-
* * \c \b pico_lwip_api -
8+
* If you wish to run in NO_SYS=1 mode, then you can link \c \b pico_lwip along with \ref pico_lwip_nosys.
149
*
15-
* The following libraries are provided that contain the equivalent lwIP application support:
10+
* If you wish to run in NO_SYS=0 mode, then you can link \c \b pico_lwip with (for instance) \ref pico_lwip_freertos,
11+
* and also link in pico_lwip_api for the additional blocking/thread-safe APIs.
1612
*
17-
* * \c \b pico_lwip_snmp -
18-
* * \c \b pico_lwip_http -
19-
* * \c \b pico_lwip_makefsdata -
20-
* * \c \b pico_lwip_iperf -
21-
* * \c \b pico_lwip_smtp -
22-
* * \c \b pico_lwip_sntp -
23-
* * \c \b pico_lwip_mdns -
24-
* * \c \b pico_lwip_netbios -
25-
* * \c \b pico_lwip_tftp -
26-
* * \c \b pico_lwip_mbedtls -
27-
* * \c \b pico_lwip_mqtt -
13+
* Additionally you must link in \ref pico_lwip_arch unless you provide your own compiler bindings for lwIP.
2814
*
29-
* The SDK Provides a common set of functionality in \c \p pico_lwip which aggregates:
15+
* Additional individual pieces of lwIP functionality are available à la cart, by linking any of the libraries below.
16+
*
17+
* The following libraries are provided that contain exactly the equivalent lwIP functionality groups:
3018
*
3119
* * \c \b pico_lwip_core -
3220
* * \c \b pico_lwip_core4 -
3321
* * \c \b pico_lwip_core6 -
3422
* * \c \b pico_lwip_netif -
3523
* * \c \b pico_lwip_sixlowpan -
3624
* * \c \b pico_lwip_ppp -
25+
* * \c \b pico_lwip_api -
3726
*
38-
* The following additional libraries are provided:
27+
* The following libraries are provided that contain exactly the equivalent lwIP application support:
3928
*
40-
* * \c \b pico_lwip - Aggregates the lwIP RAW API: \c \b pico_lwip_core, \c \b pico_lwip_core4, \c \b pico_lwip_core6, \c \b pico_lwip_api, \c \b pico_lwip_netif, \c \b pico_lwip_sixlowpan and \c \b pico_lwip_ppp. It does
41-
* not include \c \b pico_lwip_api, which requires NO_SYS=0. You should include the latter separately if you want it.
29+
* * \c \b pico_lwip_snmp -
30+
* * \c \b pico_lwip_http -
31+
* * \c \b pico_lwip_makefsdata -
32+
* * \c \b pico_lwip_iperf -
33+
* * \c \b pico_lwip_smtp -
34+
* * \c \b pico_lwip_sntp -
35+
* * \c \b pico_lwip_mdns -
36+
* * \c \b pico_lwip_netbios -
37+
* * \c \b pico_lwip_tftp -
38+
* * \c \b pico_lwip_mbedtls -
39+
* * \c \b pico_lwip_mqtt -
4240
*
43-
* * \c \b pico_lwip_arch - lwIP required compiler adapters. This is not included in \c \b pico_lwip in case you wish to replace them.
44-
* * \c \b pico_lwip_nosys - basic stub functions for NO_SYS mode.
41+
*/
42+
43+
/** \defgroup pico_lwip_arch pico_lwip_arch
44+
* \ingroup pico_lwip
45+
* \brief lwIP compiler adapters. This is not included by default in \c \b pico_lwip in case you wish to implement your own.
4546
*/

src/rp2_common/pico_lwip/include/pico/lwip_freertos.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@
1414
extern "C" {
1515
#endif
1616

17+
/** \file pico/lwip_freertos.h
18+
* \defgroup pico_lwip_freertos pico_lwip_freertos
19+
* \ingroup pico_lwip
20+
* \brief Glue library for integration lwIP in \c NO_SYS=0 mode with the SDK. Simple \c init and \c deinit
21+
* are all that is required to hook up lwIP (with full blocking API support) via an \ref async_context instance.
22+
*/
23+
1724
/*! \brief Initializes lwIP (NO_SYS=0 mode) support support for FreeRTOS using the provided async_context
18-
* \ingroup pico_lwip
25+
* \ingroup pico_lwip_freertos
1926
*
2027
* If the initialization succeeds, \ref lwip_freertos_deinit() can be called to shutdown lwIP support
2128
*
@@ -27,7 +34,7 @@ extern "C" {
2734
bool lwip_freertos_init(async_context_t *context);
2835

2936
/*! \brief De-initialize lwIP (NO_SYS=0 mode) support for FreeRTOS
30-
* \ingroup pico_lwip
37+
* \ingroup pico_lwip_freertos
3138
*
3239
* Note that since lwIP may only be initialized once, and doesn't itself provide a shutdown mechanism, lwIP
3340
* itself may still consume resources.

src/rp2_common/pico_lwip/include/pico/lwip_nosys.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,25 @@
1414
extern "C" {
1515
#endif
1616

17+
/** \file pico/lwip_nosys.h
18+
* \defgroup pico_lwip_nosys pico_lwip_nosys
19+
* \ingroup pico_lwip
20+
* \brief Glue library for integration lwIP in \c NO_SYS=1 mode with the SDK. Simple \c init and \c deinit
21+
* are all that is required to hook up lwIP via an \ref async_context instance.
22+
*/
23+
1724
/*! \brief Initializes lwIP (NO_SYS=1 mode) support support using the provided async_context
18-
* \ingroup pico_lwip
19-
*
20-
* If the initialization succeeds, \ref lwip_nosys_deinit() can be called to shutdown lwIP support
21-
*
22-
* \param context the async_context instance that provides the abstraction for handling asynchronous work.
23-
* \return true if the initialization succeeded
25+
* \ingroup pico_lwip_nosys
26+
*
27+
* If the initialization succeeds, \ref lwip_nosys_deinit() can be called to shutdown lwIP support
28+
*
29+
* \param context the async_context instance that provides the abstraction for handling asynchronous work.
30+
* \return true if the initialization succeeded
2431
*/
2532
bool lwip_nosys_init(async_context_t *context);
2633

2734
/*! \brief De-initialize lwIP (NO_SYS=1 mode) support
28-
* \ingroup pico_lwip
35+
* \ingroup pico_lwip_nosys
2936
*
3037
* Note that since lwIP may only be initialized once, and doesn't itself provide a shutdown mechanism, lwIP
3138
* itself may still consume resources

src/rp2_common/tinyusb/doc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* \defgroup tinyusb_device tinyusb_device
3-
* \brief <a href="https://github.com/hathach/tinyusb">TinyUSB</a> Device-mode support for the RP2040
3+
* <a href="https://github.com/hathach/tinyusb">TinyUSB</a> Device-mode support for the RP2040. The TinyUSB documentation site can be found <a href="https://docs.tinyusb.org/en/latest/">here</a>.
44
*
55
* \defgroup tinyusb_host tinyusb_host
6-
* \brief <a href="https://github.com/hathach/tinyusb">TinyUSB</a> Host-mode support for the RP2040
6+
* <a href="https://github.com/hathach/tinyusb">TinyUSB</a> Host-mode support for the RP2040.
77
*/

0 commit comments

Comments
 (0)