⚠️ **Donot use this module yet, this is still going on
An ESP-Hosted-NG driver implementation for Zephyr
Details - https://github.com/espressif/esp-hosted
Things for people who implement IEEE 802.11 network drivers on Zephyr must read - https://docs.zephyrproject.org/latest/connectivity/networking/api/wifi.html
SPI | SDHC | |
IEEE 802.11 (WiFi) | O | X |
IEEE 802.15.1 (Bluetooth) | X | X |
- reset GPIO - GPIO output/Active Low
- SPI Mode 2 (CPOL only), default speed is 10MHz
- data-ready GPIO - GPIO input/Active High/IRQ edge rising
- handshake(Host TX okay) GPIO - GPIO input/Active High/IRQ edge rising
- fdsa
-
struct esph_proto_hdr Main header of the ESP-Hosted protocol field type desc possible values if_type u4 Interface type ESPH_IF_TYPE_STA
ESPH_IF_TYPE_AP
ESPH_IF_TYPE_HCI
ESPH_IF_TYPE_INTERNAL
ESPH_IF_TYPE_TEST
if_no u4 Interface number 0x0 or 0xF(Dummy indicator) flags u8 Flags 0x0 or 0xFF(Wakeup) pkt_type u8 Packet type ESPH_PKT_TYPE_DATA
ESPH_PKT_TYPE_CMD_REQ
ESPH_PKT_TYPE_CMD_RES
ESPH_PKT_TYPE_EVT
ESPH_PKT_TYPE_EAPOLreserved1u8 ReservedNone len le16 Payload length 0 ~ le16 max offset le16 Payload offset(?) I don't know yet Mostly size of this type cksm le16 Checksum Sum of the whole payload buffer reserved2u8 ReservedNone reserved3
hci_pkt_type
priv_pkt_typeunion (u8) Multi-purpose data Not used yet -
struct esph_proto_cmd_hdr payload header for ESPH_PKT_TYPE_CMD_REQ and ESPH_PKT_TYPE_CMD_RES field type desc possible values cmd u8 Command code ESPH_PROTO_CMD_INIT_IF
ESPH_PROTO_CMD_SET_MAC
ESPH_PROTO_CMD_GET_MAC
ESPH_PROTO_CMD_SCAN_REQ
ESPH_PROTO_CMD_STA_CONNECT
ESPH_PROTO_CMD_STA_DISCONNECT
ESPH_PROTO_CMD_DEINIT_IF
ESPH_PROTO_CMD_ADD_KEY
ESPH_PROTO_CMD_DEL_KEY
ESPH_PROTO_CMD_SET_DEFAULT_KEY
ESPH_PROTO_CMD_STA_AUTH
ESPH_PROTO_CMD_STA_ASSOC
ESPH_PROTO_CMD_SET_IP_ADDR
ESPH_PROTO_CMD_SET_MCAST_MAC_ADDR
ESPH_PROTO_CMD_GET_TXPOWER
ESPH_PROTO_CMD_SET_TXPOWER
ESPH_PROTO_CMD_GET_REG_DOMAIN
ESPH_PROTO_CMD_SET_REG_DOMAIN
ESPH_PROTO_CMD_RAW_TP_ESP_TO_HOST
ESPH_PROTO_CMD_RAW_TP_HOST_TO_ESP
ESPH_PROTO_CMD_SET_WOW_CONFIGstatus u8 Status code ESPH_PROTO_CMD_STATUS_PENDING
ESPH_PROTO_CMD_STATUS_FAIL
ESPH_PROTO_CMD_STATUS_SUCCESS
ESPH_PROTO_CMD_STATUS_BUSY
ESPH_PROTO_CMD_STATUS_UNSUPPORTED
ESPH_PROTO_CMD_STATUS_INVALID
len le16 Command payload length 0 ~ le16 max seq_no le16 Sequence number 0 ~ le16 max reserved1u8 ReservedNone reserved2u8 ReservedNone -
struct esph_proto_evt_hdr payload header for ESPH_PKT_TYPE_EVT field type desc possible values evt u8 Event code ESPH_PROTO_EVT_BOOTUP
ESPH_PROTO_EVT_SCAN_RESULT
ESPH_PROTO_EVT_STA_CONNECT
ESPH_PROTO_EVT_STA_DISCONNECT
ESPH_PROTO_EVT_AUTH_RX
ESPH_PROTO_EVT_ASSOC_RXstatus u8 Error status 0: No error, else: Error len Event data length le16 0 ~ le16 max -
struct esph_proto_evt_bootup payload for ESPH_PROTO_EVT_BOOTUP field type desc possible values
-
-
-
device init
sequenceDiagram host->>host: reset pin setup host->>esp: reset pin 1 0 host-->>host: sleep 300ms esp->>esp: reboot esp-->>host: proto_hdr(ESPH_IF_TYPE_INTERNAL + ) + evt_hdr + bootup_evt
-
netif init
sequenceDiagram host->>esp: proto_hdr(ESPH_IF_TYPE_STA + ESPH_PKT_TYPE_CMD_REQ) + cmd_hdr(ESPH_PROTO_CMD_INIT_IF) esp->>esp: STA init esp-->>host: proto_hdr(ESPH_IF_TYPE_STA + ESPH_PKT_TYPE_CMD_RES) + cmd_hdr(ESPH_PROTO_CMD_INIT_IF)