EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #209 background imageLoading...
Page #209 background image
Chapter 2. API Reference
A) User code, boiler plate Overall application interaction with a specific IO driver for communication media and
configured TCP/IP network stack is abstracted using ESP-NETIF APIs and outlined as below:
A) Initialization code
1) Initializes IO driver
2) Creates a new instance of ESP-NETIF and configure with
ESP-NETIF specific options (flags, behaviour, name)
Network stack options (netif init and input functions, not publicly available)
IO driver specific options (transmit, free rx buffer functions, IO driver handle)
3) Attaches the IO driver handle to the ESP-NETIF instance created in the above steps
4) Configures event handlers
use default handlers for common interfaces defined in IO drivers; or define a specific handlers for
customised behaviour/new interfaces
register handlers for app related events (such as IP lost/acquired)
B) Interaction with network interfaces using ESP-NETIF API
Getting and setting TCP/IP related parameters (DHCP, IP, etc)
Receiving IP events (connect/disconnect)
Controlling application lifecycle (set interface up/down)
B) Communication driver, IO driver, media driver Communication driver plays these two important roles in
relation with ESP-NETIF:
1) Event handlers: Define behaviour patterns of interaction with ESP-NETIF (for example: ethernet link-up ->
turn netif on)
2) Glue IO layer: Adapts the input/output functions to use ESP-NETIF transmit, receive and free receive buffer
Installs driver_transmit to appropriate ESP-NETIF object, so that outgoing packets from network stack are
passed to the IO driver
Calls esp_netif_receive() to pass incoming data to network stack
C) ESP-NETIF, former tcpip_adapter ESP-NETIF is an intermediary between an IO driver and a network stack,
connecting packet data path between these two. As that it provides a set of interfaces for attaching a driver to ESP-
NETIF object (runtime) and configuring a network stack (compile time). In addition to that a set of API is provided
to control network interface lifecycle and its TCP/IP properties. As an overview, the ESP-NETIF public interface
could be divided into these 6 groups:
1) Initialization APIs (to create and configure ESP-NETIF instance)
2) Input/Output API (for passing data between IO driver and network stack)
3) Event or Action API
Used for network interface lifecycle management
ESP-NETIF provides building blocks for designing event handlers
4) Setters and Getters for basic network interface properties
5) Network stack abstraction: enabling user interaction with TCP/IP stack
Set interface up or down
DHCP server and client API
DNS API
6) Driver conversion utilities
D) Network stack Network stack has no public interaction with application code with regard to public interfaces
and shall be fully abstracted by ESP-NETIF API.
Espressif Systems 198
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish