9#ifndef _CYW43_CONFIGPORT_H
10#define _CYW43_CONFIGPORT_H
20#ifndef CYW43_HOST_NAME
21#define CYW43_HOST_NAME "PicoW"
28#ifndef CYW43_LOGIC_DEBUG
29#define CYW43_LOGIC_DEBUG 0
32#ifndef CYW43_USE_OTP_MAC
33#define CYW43_USE_OTP_MAC 1
36#ifndef CYW43_NO_NETUTILS
37#define CYW43_NO_NETUTILS 1
40#ifndef CYW43_IOCTL_TIMEOUT_US
41#define CYW43_IOCTL_TIMEOUT_US 1000000
44#ifndef CYW43_USE_STATS
45#define CYW43_USE_STATS 0
49#ifndef CYW43_HAL_MAC_WLAN0
50#define CYW43_HAL_MAC_WLAN0 0
58#define CYW43_USE_SPI 1
62#define CYW43_SPI_PIO 1
65#ifndef CYW43_CHIPSET_FIRMWARE_INCLUDE_FILE
66#if CYW43_ENABLE_BLUETOOTH
67#define CYW43_CHIPSET_FIRMWARE_INCLUDE_FILE "wb43439A0_7_95_49_00_combined.h"
69#define CYW43_CHIPSET_FIRMWARE_INCLUDE_FILE "w43439A0_7_95_49_00_combined.h"
73#ifndef CYW43_WIFI_NVRAM_INCLUDE_FILE
74#define CYW43_WIFI_NVRAM_INCLUDE_FILE "wifi_nvram_43439.h"
78#define CYW43_EPERM (-PICO_ERROR_NOT_PERMITTED)
79#define CYW43_EIO (-PICO_ERROR_IO)
80#define CYW43_EINVAL (-PICO_ERROR_INVALID_ARG)
81#define CYW43_ETIMEDOUT (-PICO_ERROR_TIMEOUT)
83#define CYW43_NUM_GPIOS CYW43_WL_GPIO_COUNT
85#define cyw43_hal_pin_obj_t uint
88#define CYW43_ARRAY_SIZE(a) count_of(a)
90static inline uint32_t cyw43_hal_ticks_us(
void) {
94static inline uint32_t cyw43_hal_ticks_ms(
void) {
98static inline int cyw43_hal_pin_read(cyw43_hal_pin_obj_t pin) {
102static inline void cyw43_hal_pin_low(cyw43_hal_pin_obj_t pin) {
106static inline void cyw43_hal_pin_high(cyw43_hal_pin_obj_t pin) {
110#define CYW43_HAL_PIN_MODE_INPUT (GPIO_IN)
111#define CYW43_HAL_PIN_MODE_OUTPUT (GPIO_OUT)
113#define CYW43_HAL_PIN_PULL_NONE (0)
114#define CYW43_HAL_PIN_PULL_UP (1)
115#define CYW43_HAL_PIN_PULL_DOWN (2)
117static inline void cyw43_hal_pin_config(cyw43_hal_pin_obj_t pin, uint32_t mode, uint32_t pull, __unused uint32_t alt) {
118 assert((mode == CYW43_HAL_PIN_MODE_INPUT || mode == CYW43_HAL_PIN_MODE_OUTPUT) && alt == 0);
120 gpio_set_pulls(pin, pull == CYW43_HAL_PIN_PULL_UP, pull == CYW43_HAL_PIN_PULL_DOWN);
123void cyw43_hal_get_mac(
int idx, uint8_t buf[6]);
125void cyw43_hal_generate_laa_mac(
int idx, uint8_t buf[6]);
128void cyw43_thread_enter(
void);
130void cyw43_thread_exit(
void);
132#define CYW43_THREAD_ENTER cyw43_thread_enter();
133#define CYW43_THREAD_EXIT cyw43_thread_exit();
136void cyw43_thread_lock_check(
void);
138#define cyw43_arch_lwip_check() cyw43_thread_lock_check()
139#define CYW43_THREAD_LOCK_CHECK cyw43_arch_lwip_check();
141#define cyw43_arch_lwip_check() ((void)0)
142#define CYW43_THREAD_LOCK_CHECK
145void cyw43_await_background_or_timeout_us(uint32_t timeout_us);
147#define CYW43_SDPCM_SEND_COMMON_WAIT cyw43_await_background_or_timeout_us(1000);
148#define CYW43_DO_IOCTL_WAIT cyw43_await_background_or_timeout_us(1000);
150void cyw43_delay_ms(uint32_t ms);
152void cyw43_delay_us(uint32_t us);
154void cyw43_schedule_internal_poll_dispatch(
void (*func)(
void));
156void cyw43_post_poll_hook(
void);
158#define CYW43_POST_POLL_HOOK cyw43_post_poll_hook();
162#define cyw43_malloc malloc
165#define cyw43_free free
static void gpio_set_dir(uint gpio, bool out)
Set a single GPIO direction.
Definition gpio.h:1340
static void gpio_clr_mask(uint32_t mask)
Drive low every GPIO appearing in mask.
Definition gpio.h:955
void gpio_set_pulls(uint gpio, bool up, bool down)
Select up and down pulls on specific GPIO.
Definition gpio.c:63
static bool gpio_get(uint gpio)
Get state of a single specified GPIO.
Definition gpio.h:859
static void gpio_set_mask(uint32_t mask)
Drive high every GPIO appearing in mask.
Definition gpio.h:908
static uint32_t time_us_32(void)
Return a 32 bit timestamp value in microseconds for the default timer instance.
Definition timer.h:215
static absolute_time_t get_absolute_time(void)
Return a representation of the current time.
Definition time.h:66
static uint32_t to_ms_since_boot(absolute_time_t t)
Convert a timestamp into a number of milliseconds since boot.
Definition time.h:87