1 /* 2 * Copyright (c) 2022 Raspberry Pi (Trading) Ltd. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef _PICO_LWIP_NOSYS_H 8 #define _PICO_LWIP_NOSYS_H 9 10 #include "pico.h" 11 #include "pico/async_context.h" 12 13 #ifdef __cplusplus 14 extern "C" { 15 #endif 16 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 21 * 22 * Simple \c init and \c deinit are all that is required to hook up lwIP via an \ref async_context instance. 23 */ 24 25 /*! \brief Initializes lwIP (NO_SYS=1 mode) support support using the provided async_context 26 * \ingroup pico_lwip_nosys 27 * 28 * If the initialization succeeds, \ref lwip_nosys_deinit() can be called to shutdown lwIP support 29 * 30 * \param context the async_context instance that provides the abstraction for handling asynchronous work. 31 * \return true if the initialization succeeded 32 */ 33 bool lwip_nosys_init(async_context_t *context); 34 35 /*! \brief De-initialize lwIP (NO_SYS=1 mode) support 36 * \ingroup pico_lwip_nosys 37 * 38 * Note that since lwIP may only be initialized once, and doesn't itself provide a shutdown mechanism, lwIP 39 * itself may still consume resources 40 * 41 * It is however safe to call \ref lwip_nosys_init again later. 42 * 43 * \param context the async_context the lwip_nosys support was added to via \ref lwip_nosys_init 44 */ 45 void lwip_nosys_deinit(async_context_t *context); 46 47 #ifdef __cplusplus 48 } 49 #endif 50 #endif