esp32_wifi_driver.c File Reference

ESP32 Wi-Fi controller. More...

#include "esp_wifi.h"
#include "esp_wifi_internal.h"
#include "core/net.h"
#include "drivers/wifi/esp32_wifi_driver.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NIC_TRACE_LEVEL
 

Functions

esp_err_t esp32WifiStaStartEvent (system_event_t *event)
 Station start (event handler) More...
 
esp_err_t esp32WifiStaStopEvent (system_event_t *event)
 Station stop (event handler) More...
 
esp_err_t esp32WifiStaConnectedEvent (system_event_t *event)
 Station connected to AP (event handler) More...
 
esp_err_t esp32WifiStaDisconnectedEvent (system_event_t *event)
 Station disconnected from AP (event handler) More...
 
esp_err_t esp32WifiStaGotIpEvent (system_event_t *event)
 Station got IP from connected AP (event handler) More...
 
esp_err_t esp32WifiStaLostIpEvent (system_event_t *event)
 Station lost IP (event handler) More...
 
esp_err_t esp32WifiApStartEvent (system_event_t *event)
 Soft-AP start (event handler) More...
 
esp_err_t esp32WifiApStopEvent (system_event_t *event)
 Soft-AP stop (event handler) More...
 
esp_err_t esp32WifiStaRxCallback (void *buffer, uint16_t length, void *eb)
 Process incoming packets (STA interface) More...
 
esp_err_t esp32WifiApRxCallback (void *buffer, uint16_t length, void *eb)
 Process incoming packets (AP interface) More...
 
error_t esp32WifiInit (NetInterface *interface)
 ESP32_WIFI initialization. More...
 
void esp32WifiTick (NetInterface *interface)
 ESP32 Wi-Fi timer handler. More...
 
void esp32WifiEnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void esp32WifiDisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void esp32WifiEventHandler (NetInterface *interface)
 ESP32 Wi-Fi event handler. More...
 
error_t esp32WifiSendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset)
 Send a packet. More...
 
error_t esp32WifiUpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 

Variables

system_event_handler_t default_event_handlers [SYSTEM_EVENT_MAX]
 
const NicDriver esp32WifiStaDriver
 ESP32 Wi-Fi driver (STA mode) More...
 
const NicDriver esp32WifiApDriver
 ESP32 Wi-Fi driver (AP mode) More...
 

Detailed Description

ESP32 Wi-Fi controller.

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file esp32_wifi_driver.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 30 of file esp32_wifi_driver.c.

Function Documentation

◆ esp32WifiApRxCallback()

esp_err_t esp32WifiApRxCallback ( void *  buffer,
uint16_t  length,
void *  eb 
)

Process incoming packets (AP interface)

Parameters
[in]bufferIncoming packet
[in]lengthLength of the packet, in bytes
[in]ebPointer to the buffer allocated by the Wi-Fi driver
Returns
Error code

Definition at line 587 of file esp32_wifi_driver.c.

◆ esp32WifiApStartEvent()

esp_err_t esp32WifiApStartEvent ( system_event_t *  event)

Soft-AP start (event handler)

Parameters
[in]eventEvent information
Returns
Error code

Definition at line 475 of file esp32_wifi_driver.c.

◆ esp32WifiApStopEvent()

esp_err_t esp32WifiApStopEvent ( system_event_t *  event)

Soft-AP stop (event handler)

Parameters
[in]eventEvent information
Returns
Error code

Definition at line 514 of file esp32_wifi_driver.c.

◆ esp32WifiDisableIrq()

void esp32WifiDisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 255 of file esp32_wifi_driver.c.

◆ esp32WifiEnableIrq()

void esp32WifiEnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 245 of file esp32_wifi_driver.c.

◆ esp32WifiEventHandler()

void esp32WifiEventHandler ( NetInterface interface)

ESP32 Wi-Fi event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 265 of file esp32_wifi_driver.c.

◆ esp32WifiInit()

error_t esp32WifiInit ( NetInterface interface)

ESP32_WIFI initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 115 of file esp32_wifi_driver.c.

◆ esp32WifiSendPacket()

error_t esp32WifiSendPacket ( NetInterface interface,
const NetBuffer buffer,
size_t  offset 
)

Send a packet.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the data to send
[in]offsetOffset to the first data byte
Returns
Error code

Definition at line 278 of file esp32_wifi_driver.c.

◆ esp32WifiStaConnectedEvent()

esp_err_t esp32WifiStaConnectedEvent ( system_event_t *  event)

Station connected to AP (event handler)

Parameters
[in]eventEvent information
Returns
Error code

Definition at line 365 of file esp32_wifi_driver.c.

◆ esp32WifiStaDisconnectedEvent()

esp_err_t esp32WifiStaDisconnectedEvent ( system_event_t *  event)

Station disconnected from AP (event handler)

Parameters
[in]eventEvent information
Returns
Error code

Definition at line 404 of file esp32_wifi_driver.c.

◆ esp32WifiStaGotIpEvent()

esp_err_t esp32WifiStaGotIpEvent ( system_event_t *  event)

Station got IP from connected AP (event handler)

Parameters
[in]eventEvent information
Returns
Error code

Definition at line 443 of file esp32_wifi_driver.c.

◆ esp32WifiStaLostIpEvent()

esp_err_t esp32WifiStaLostIpEvent ( system_event_t *  event)

Station lost IP (event handler)

Parameters
[in]eventEvent information
Returns
Error code

Definition at line 459 of file esp32_wifi_driver.c.

◆ esp32WifiStaRxCallback()

esp_err_t esp32WifiStaRxCallback ( void *  buffer,
uint16_t  length,
void *  eb 
)

Process incoming packets (STA interface)

Parameters
[in]bufferIncoming packet
[in]lengthLength of the packet, in bytes
[in]ebPointer to the buffer allocated by the Wi-Fi driver
Returns
Error code

Definition at line 555 of file esp32_wifi_driver.c.

◆ esp32WifiStaStartEvent()

esp_err_t esp32WifiStaStartEvent ( system_event_t *  event)

Station start (event handler)

Parameters
[in]eventEvent information
Returns
Error code

Definition at line 333 of file esp32_wifi_driver.c.

◆ esp32WifiStaStopEvent()

esp_err_t esp32WifiStaStopEvent ( system_event_t *  event)

Station stop (event handler)

Parameters
[in]eventEvent information
Returns
Error code

Definition at line 349 of file esp32_wifi_driver.c.

◆ esp32WifiTick()

void esp32WifiTick ( NetInterface interface)

ESP32 Wi-Fi timer handler.

This routine is periodically called by the TCP/IP stack to handle periodic operations such as polling the link state

Parameters
[in]interfaceUnderlying network interface

Definition at line 235 of file esp32_wifi_driver.c.

◆ esp32WifiUpdateMacAddrFilter()

error_t esp32WifiUpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 320 of file esp32_wifi_driver.c.

Variable Documentation

◆ default_event_handlers

system_event_handler_t default_event_handlers[SYSTEM_EVENT_MAX]

◆ esp32WifiApDriver

const NicDriver esp32WifiApDriver
Initial value:
=
{
NULL,
NULL,
NULL,
}
void esp32WifiTick(NetInterface *interface)
ESP32 Wi-Fi timer handler.
void esp32WifiEnableIrq(NetInterface *interface)
Enable interrupts.
error_t esp32WifiUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
#define TRUE
Definition: os_port.h:48
void esp32WifiDisableIrq(NetInterface *interface)
Disable interrupts.
error_t esp32WifiSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset)
Send a packet.
#define ETH_MTU
Definition: ethernet.h:82
Ethernet interface.
Definition: nic.h:69
error_t esp32WifiInit(NetInterface *interface)
ESP32_WIFI initialization.
void esp32WifiEventHandler(NetInterface *interface)
ESP32 Wi-Fi event handler.

ESP32 Wi-Fi driver (AP mode)

Definition at line 88 of file esp32_wifi_driver.c.

◆ esp32WifiStaDriver

const NicDriver esp32WifiStaDriver
Initial value:
=
{
NULL,
NULL,
NULL,
}
void esp32WifiTick(NetInterface *interface)
ESP32 Wi-Fi timer handler.
void esp32WifiEnableIrq(NetInterface *interface)
Enable interrupts.
error_t esp32WifiUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
#define TRUE
Definition: os_port.h:48
void esp32WifiDisableIrq(NetInterface *interface)
Disable interrupts.
error_t esp32WifiSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset)
Send a packet.
#define ETH_MTU
Definition: ethernet.h:82
Ethernet interface.
Definition: nic.h:69
error_t esp32WifiInit(NetInterface *interface)
ESP32_WIFI initialization.
void esp32WifiEventHandler(NetInterface *interface)
ESP32 Wi-Fi event handler.

ESP32 Wi-Fi driver (STA mode)

Definition at line 63 of file esp32_wifi_driver.c.