esp8266_driver.c File Reference

ESP8266 Wi-Fi controller. More...

#include "espressif/esp_wifi.h"
#include "espressif/esp_system.h"
#include "lwip/pbuf.h"
#include "core/net.h"
#include "drivers/wifi/esp8266_driver.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NIC_TRACE_LEVEL
 

Functions

error_t esp8266WifiInit (NetInterface *interface)
 ESP8266_WIFI initialization. More...
 
void esp8266WifiTick (NetInterface *interface)
 ESP8266 Wi-Fi timer handler. More...
 
void esp8266WifiEnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void esp8266WifiDisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void esp8266WifiEventHandler (NetInterface *interface)
 ESP8266 Wi-Fi event handler. More...
 
error_t esp8266WifiSendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset)
 Send a packet. More...
 
error_t esp8266WifiUpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void netif_set_up (struct netif *netif)
 Process link-up event. More...
 
void netif_set_down (struct netif *netif)
 Process link-down event. More...
 
void ethernetif_input (struct netif *netif, struct pbuf *p)
 Process incoming packets. More...
 

Variables

const NicDriver esp8266WifiStaDriver
 ESP8266 Wi-Fi driver (STA mode) More...
 
const NicDriver esp8266WifiApDriver
 ESP8266 Wi-Fi driver (AP mode) More...
 

Detailed Description

ESP8266 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 esp8266_driver.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 30 of file esp8266_driver.c.

Function Documentation

◆ esp8266WifiDisableIrq()

void esp8266WifiDisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 201 of file esp8266_driver.c.

◆ esp8266WifiEnableIrq()

void esp8266WifiEnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 191 of file esp8266_driver.c.

◆ esp8266WifiEventHandler()

void esp8266WifiEventHandler ( NetInterface interface)

ESP8266 Wi-Fi event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 211 of file esp8266_driver.c.

◆ esp8266WifiInit()

error_t esp8266WifiInit ( NetInterface interface)

ESP8266_WIFI initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 101 of file esp8266_driver.c.

◆ esp8266WifiSendPacket()

error_t esp8266WifiSendPacket ( 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 224 of file esp8266_driver.c.

◆ esp8266WifiTick()

void esp8266WifiTick ( NetInterface interface)

ESP8266 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 181 of file esp8266_driver.c.

◆ esp8266WifiUpdateMacAddrFilter()

error_t esp8266WifiUpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 278 of file esp8266_driver.c.

◆ ethernetif_input()

void ethernetif_input ( struct netif *  netif,
struct pbuf *  p 
)

Process incoming packets.

Parameters
[in]netifUnderlying network interface
[in]pPointer to the buffer allocated by the Wi-Fi driver

Definition at line 357 of file esp8266_driver.c.

◆ netif_set_down()

void netif_set_down ( struct netif *  netif)

Process link-down event.

Parameters
[in]netifUnderlying network interface

Definition at line 323 of file esp8266_driver.c.

◆ netif_set_up()

void netif_set_up ( struct netif *  netif)

Process link-up event.

Parameters
[in]netifUnderlying network interface

Definition at line 290 of file esp8266_driver.c.

Variable Documentation

◆ esp8266WifiApDriver

const NicDriver esp8266WifiApDriver
Initial value:
=
{
NULL,
NULL,
NULL,
}
void esp8266WifiEnableIrq(NetInterface *interface)
Enable interrupts.
#define TRUE
Definition: os_port.h:48
error_t esp8266WifiInit(NetInterface *interface)
ESP8266_WIFI initialization.
void esp8266WifiEventHandler(NetInterface *interface)
ESP8266 Wi-Fi event handler.
void esp8266WifiTick(NetInterface *interface)
ESP8266 Wi-Fi timer handler.
void esp8266WifiDisableIrq(NetInterface *interface)
Disable interrupts.
error_t esp8266WifiSendPacket(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 esp8266WifiUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.

ESP8266 Wi-Fi driver (AP mode)

Definition at line 74 of file esp8266_driver.c.

◆ esp8266WifiStaDriver

const NicDriver esp8266WifiStaDriver
Initial value:
=
{
NULL,
NULL,
NULL,
}
void esp8266WifiEnableIrq(NetInterface *interface)
Enable interrupts.
#define TRUE
Definition: os_port.h:48
error_t esp8266WifiInit(NetInterface *interface)
ESP8266_WIFI initialization.
void esp8266WifiEventHandler(NetInterface *interface)
ESP8266 Wi-Fi event handler.
void esp8266WifiTick(NetInterface *interface)
ESP8266 Wi-Fi timer handler.
void esp8266WifiDisableIrq(NetInterface *interface)
Disable interrupts.
error_t esp8266WifiSendPacket(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 esp8266WifiUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.

ESP8266 Wi-Fi driver (STA mode)

Definition at line 49 of file esp8266_driver.c.