@web-font-path: "roboto-debian.css";
v2.2.0 (RP2040)
Loading...
Searching...
No Matches
cyw43_arch.h
Go to the documentation of this file.
/*
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _PICO_CYW43_ARCH_H
#define _PICO_CYW43_ARCH_H
#include "pico.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "cyw43.h"
#include "cyw43_country.h"
#include "pico/async_context.h"
#ifdef PICO_CYW43_ARCH_HEADER
#include __XSTRING(PICO_CYW43_ARCH_HEADER)
#else
#if PICO_CYW43_ARCH_POLL
#include "pico/cyw43_arch/arch_poll.h"
#elif PICO_CYW43_ARCH_THREADSAFE_BACKGROUND
#include "pico/cyw43_arch/arch_threadsafe_background.h"
#elif PICO_CYW43_ARCH_FREERTOS
#include "pico/cyw43_arch/arch_freertos.h"
#else
#error must specify support pico_cyw43_arch architecture type or set PICO_CYW43_ARCH_HEADER
#endif
#endif
// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_PICO_CYW43_ARCH, Enable/disable assertions in the pico_cyw43_arch module, type=bool, default=0, group=pico_cyw43_arch
#ifndef PARAM_ASSERTIONS_ENABLED_PICO_CYW43_ARCH
#ifdef PARAM_ASSERTIONS_ENABLED_CYW43_ARCH // backwards compatibility with SDK < 2.0.0
#define PARAM_ASSERTIONS_ENABLED_PICO_CYW43_ARCH PARAM_ASSERTIONS_ENABLED_CYW43_ARCH
#else
#define PARAM_ASSERTIONS_ENABLED_PICO_CYW43_ARCH 0
#endif
#endif
// PICO_CONFIG: PICO_CYW43_ARCH_DEBUG_ENABLED, Enable/disable some debugging output in the pico_cyw43_arch module, type=bool, default=1 in debug builds, group=pico_cyw43_arch
#ifndef PICO_CYW43_ARCH_DEBUG_ENABLED
#ifndef NDEBUG
#define PICO_CYW43_ARCH_DEBUG_ENABLED 1
#else
#define PICO_CYW43_ARCH_DEBUG_ENABLED 0
#endif
#endif
// PICO_CONFIG: PICO_CYW43_ARCH_DEFAULT_COUNTRY_CODE, Default country code for the cyw43 wireless driver, default=CYW43_COUNTRY_WORLDWIDE, group=pico_cyw43_arch
#ifndef PICO_CYW43_ARCH_DEFAULT_COUNTRY_CODE
#define PICO_CYW43_ARCH_DEFAULT_COUNTRY_CODE CYW43_COUNTRY_WORLDWIDE
#endif
int cyw43_arch_init(void);
int cyw43_arch_init_with_country(uint32_t country);
void cyw43_arch_deinit(void);
async_context_t *cyw43_arch_async_context(void);
void cyw43_arch_set_async_context(async_context_t *context);
async_context_t *cyw43_arch_init_default_async_context(void);
void cyw43_arch_poll(void);
void cyw43_arch_wait_for_work_until(absolute_time_t until);
static inline void cyw43_arch_lwip_begin(void) {
cyw43_thread_enter();
}
static inline void cyw43_arch_lwip_end(void) {
cyw43_thread_exit();
}
static inline int cyw43_arch_lwip_protect(int (*func)(void *param), void *param) {
cyw43_arch_lwip_begin();
int rc = func(param);
cyw43_arch_lwip_end();
return rc;
}
uint32_t cyw43_arch_get_country_code(void);
void cyw43_arch_enable_sta_mode(void);
void cyw43_arch_disable_sta_mode(void);
void cyw43_arch_enable_ap_mode(const char *ssid, const char *password, uint32_t auth);
void cyw43_arch_disable_ap_mode(void);
int cyw43_arch_wifi_connect_blocking(const char *ssid, const char *pw, uint32_t auth);
int cyw43_arch_wifi_connect_bssid_blocking(const char *ssid, const uint8_t *bssid, const char *pw, uint32_t auth);
int cyw43_arch_wifi_connect_timeout_ms(const char *ssid, const char *pw, uint32_t auth, uint32_t timeout);
int cyw43_arch_wifi_connect_bssid_timeout_ms(const char *ssid, const uint8_t *bssid, const char *pw, uint32_t auth, uint32_t timeout);
int cyw43_arch_wifi_connect_async(const char *ssid, const char *pw, uint32_t auth);
int cyw43_arch_wifi_connect_bssid_async(const char *ssid, const uint8_t *bssid, const char *pw, uint32_t auth);
void cyw43_arch_gpio_put(uint wl_gpio, bool value);
bool cyw43_arch_gpio_get(uint wl_gpio);
#ifdef __cplusplus
}
#endif
#endif
async_context.h
cyw43_arch_lwip_begin
static void cyw43_arch_lwip_begin(void)
Acquire any locks required to call into lwIP.
Definition cyw43_arch.h:277
cyw43_arch_async_context
async_context_t * cyw43_arch_async_context(void)
Return the current async_context currently in use by the cyw43_arch code.
Definition cyw43_arch.c:177
cyw43_arch_enable_ap_mode
void cyw43_arch_enable_ap_mode(const char *ssid, const char *password, uint32_t auth)
Enables Wi-Fi AP (Access point) mode.
Definition cyw43_arch.c:47
cyw43_arch_gpio_put
void cyw43_arch_gpio_put(uint wl_gpio, bool value)
Set a GPIO pin on the wireless chip to a given value.
Definition cyw43_arch.c:165
cyw43_arch_wifi_connect_bssid_async
int cyw43_arch_wifi_connect_bssid_async(const char *ssid, const uint8_t *bssid, const char *pw, uint32_t auth)
Start attempting to connect to a wireless access point specified by SSID and BSSID.
Definition cyw43_arch.c:90
cyw43_arch_lwip_protect
static int cyw43_arch_lwip_protect(int(*func)(void *param), void *param)
sad Release any locks required for calling into lwIP
Definition cyw43_arch.h:320
cyw43_arch_set_async_context
void cyw43_arch_set_async_context(async_context_t *context)
Set the async_context to be used by the cyw43_arch_init.
Definition cyw43_arch.c:27
cyw43_arch_get_country_code
uint32_t cyw43_arch_get_country_code(void)
Return the country code used to initialize cyw43_arch.
Definition cyw43_arch.c:156
cyw43_arch_wifi_connect_async
int cyw43_arch_wifi_connect_async(const char *ssid, const char *pw, uint32_t auth)
Start attempting to connect to a wireless access point.
Definition cyw43_arch.c:96
cyw43_arch_enable_sta_mode
void cyw43_arch_enable_sta_mode(void)
Enables Wi-Fi STA (Station) mode.
Definition cyw43_arch.c:31
cyw43_arch_init
int cyw43_arch_init(void)
Initialize the CYW43 architecture.
cyw43_arch_disable_ap_mode
void cyw43_arch_disable_ap_mode(void)
Disables Wi-Fi AP (Access point) mode.
Definition cyw43_arch.c:59
cyw43_arch_init_default_async_context
async_context_t * cyw43_arch_init_default_async_context(void)
Initialize the default async_context for the current cyw43_arch type.
cyw43_arch_wifi_connect_blocking
int cyw43_arch_wifi_connect_blocking(const char *ssid, const char *pw, uint32_t auth)
Attempt to connect to a wireless access point, blocking until the network is joined or a failure is d...
Definition cyw43_arch.c:140
cyw43_arch_wifi_connect_bssid_blocking
int cyw43_arch_wifi_connect_bssid_blocking(const char *ssid, const uint8_t *bssid, const char *pw, uint32_t auth)
Attempt to connect to a wireless access point specified by SSID and BSSID, blocking until the network...
Definition cyw43_arch.c:144
cyw43_arch_disable_sta_mode
void cyw43_arch_disable_sta_mode(void)
Disables Wi-Fi STA (Station) mode.
Definition cyw43_arch.c:36
cyw43_arch_wifi_connect_bssid_timeout_ms
int cyw43_arch_wifi_connect_bssid_timeout_ms(const char *ssid, const uint8_t *bssid, const char *pw, uint32_t auth, uint32_t timeout)
Attempt to connect to a wireless access point specified by SSID and BSSID, blocking until the network...
Definition cyw43_arch.c:152
cyw43_arch_gpio_get
bool cyw43_arch_gpio_get(uint wl_gpio)
Read the value of a GPIO pin on the wireless chip.
Definition cyw43_arch.c:170
cyw43_arch_poll
void cyw43_arch_poll(void)
Perform any processing required by the cyw43_driver or the TCP/IP stack.
Definition cyw43_arch.c:181
cyw43_arch_wait_for_work_until
void cyw43_arch_wait_for_work_until(absolute_time_t until)
Sleep until there is cyw43_driver work to be done.
Definition cyw43_arch.c:186
cyw43_arch_wifi_connect_timeout_ms
int cyw43_arch_wifi_connect_timeout_ms(const char *ssid, const char *pw, uint32_t auth, uint32_t timeout)
Attempt to connect to a wireless access point, blocking until the network is joined,...
Definition cyw43_arch.c:148
cyw43_arch_deinit
void cyw43_arch_deinit(void)
De-initialize the CYW43 architecture.
cyw43_arch_lwip_end
static void cyw43_arch_lwip_end(void)
Release any locks required for calling into lwIP.
Definition cyw43_arch.h:300
cyw43_arch_init_with_country
int cyw43_arch_init_with_country(uint32_t country)
Initialize the CYW43 architecture for use in a specific country.
Definition cyw43_arch.c:160
absolute_time_t
uint64_t absolute_time_t
An opaque 64 bit timestamp in microseconds.
Definition types.h:43
pico.h