Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
esp_wifi_drv.c File Reference
#include <logging/log.h>
#include <net/ethernet.h>
#include <net/net_pkt.h>
#include <net/net_if.h>
#include <device.h>
#include <soc.h>
#include <ethernet/eth_stats.h>
#include "esp_networking_priv.h"
#include "esp_private/wifi.h"
#include "esp_event.h"
#include "esp_timer.h"
#include "esp_system.h"
#include "esp_wpa.h"

Data Structures

struct  esp32_wifi_runtime
 

Macros

#define DT_DRV_COMPAT   espressif_esp32_wifi
 
#define DEV_DATA(dev)    ((struct esp32_wifi_runtime *)(dev)->data)
 

Functions

 LOG_MODULE_REGISTER (esp32_wifi, CONFIG_WIFI_LOG_LEVEL)
 
static void esp_wifi_event_task (void)
 
 K_MSGQ_DEFINE (esp_wifi_msgq, sizeof(system_event_t), 10, 4)
 
 K_THREAD_STACK_DEFINE (esp_wifi_event_stack, CONFIG_ESP32_WIFI_EVENT_TASK_STACK_SIZE)
 
esp_err_t esp_event_send_internal (esp_event_base_t event_base, int32_t event_id, void *event_data, size_t event_data_size, uint32_t ticks_to_wait)
 
static int eth_esp32_send (const struct device *dev, struct net_pkt *pkt)
 
static esp_err_t eth_esp32_rx (void *buffer, uint16_t len, void *eb)
 
static void eth_esp32_init (struct net_if *iface)
 
static int eth_esp32_dev_init (const struct device *dev)
 
 NET_DEVICE_DT_INST_DEFINE (0, eth_esp32_dev_init, NULL, &eth_data, NULL, CONFIG_ETH_INIT_PRIORITY, &eth_esp32_apis, ETHERNET_L2, NET_L2_GET_CTX_TYPE(ETHERNET_L2), NET_ETH_MTU)
 

Variables

static struct net_ifesp32_wifi_iface
 
static struct k_thread esp_wifi_event_thread
 
static struct esp32_wifi_runtime eth_data
 
static const struct ethernet_api eth_esp32_apis
 

Macro Definition Documentation

◆ DEV_DATA

#define DEV_DATA (   dev)     ((struct esp32_wifi_runtime *)(dev)->data)

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   espressif_esp32_wifi

Function Documentation

◆ esp_event_send_internal()

esp_err_t esp_event_send_internal ( esp_event_base_t  event_base,
int32_t  event_id,
void event_data,
size_t  event_data_size,
uint32_t  ticks_to_wait 
)

◆ esp_wifi_event_task()

static void esp_wifi_event_task ( void  )
static

◆ eth_esp32_dev_init()

static int eth_esp32_dev_init ( const struct device dev)
static

◆ eth_esp32_init()

static void eth_esp32_init ( struct net_if iface)
static

◆ eth_esp32_rx()

static esp_err_t eth_esp32_rx ( void buffer,
uint16_t  len,
void eb 
)
static

◆ eth_esp32_send()

static int eth_esp32_send ( const struct device dev,
struct net_pkt pkt 
)
static

◆ K_MSGQ_DEFINE()

K_MSGQ_DEFINE ( esp_wifi_msgq  ,
sizeof(system_event_t)  ,
10  ,
 
)

◆ K_THREAD_STACK_DEFINE()

K_THREAD_STACK_DEFINE ( esp_wifi_event_stack  ,
CONFIG_ESP32_WIFI_EVENT_TASK_STACK_SIZE   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( esp32_wifi  ,
CONFIG_WIFI_LOG_LEVEL   
)

◆ NET_DEVICE_DT_INST_DEFINE()

NET_DEVICE_DT_INST_DEFINE ( ,
eth_esp32_dev_init  ,
NULL  ,
eth_data,
NULL  ,
CONFIG_ETH_INIT_PRIORITY  ,
eth_esp32_apis,
ETHERNET_L2  ,
NET_L2_GET_CTX_TYPE(ETHERNET_L2)  ,
NET_ETH_MTU   
)

Variable Documentation

◆ esp32_wifi_iface

struct net_if* esp32_wifi_iface
static

◆ esp_wifi_event_thread

struct k_thread esp_wifi_event_thread
static

◆ eth_data

struct esp32_wifi_runtime eth_data
static

◆ eth_esp32_apis

const struct ethernet_api eth_esp32_apis
static
Initial value:
= {
.iface_api.init = eth_esp32_init,
.send = eth_esp32_send,
}
static int eth_esp32_send(const struct device *dev, struct net_pkt *pkt)
Definition: esp_wifi_drv.c:61
static void eth_esp32_init(struct net_if *iface)
Definition: esp_wifi_drv.c:146