/* * The ESP32-P4-Nano's built-in radio: the P4 controller (main/bridge_hosted.c) and the ESP32-C6 next to it * (radio-c6/) talk over esp-hosted's peer-data channel (SDIO), one message = msg_id + bytes. * * RADIO_MSG_TX P4 -> C6 a batch of frames to send on ESP-NOW * RADIO_MSG_RX C6 -> P4 a batch of frames heard on ESP-NOW * RADIO_MSG_CTL P4 -> C6 one bridge_proto message without SLIP or CRC: [type][body] * (BRIDGE_MSG_HELLO, BRIDGE_MSG_SET_CHANNEL); both are answered with INFO * RADIO_MSG_INFO C6 -> P4 the bridge_proto INFO body (BRIDGE_INFO_LEN bytes) * RADIO_MSG_VERSION C6 -> P4 radio-c6's version (RADIO_CTL_VERSION asks for it) * * A batch is entries of mac(6) + len(1) + data(len), back to back: dst_mac going down, src_mac coming up. * Each RPC costs a round trip over SDIO, so both sides pack every frame that is waiting into one message. */ #pragma once #include #define RADIO_MSG_TX 0x52430001u #define RADIO_MSG_RX 0x52430002u #define RADIO_MSG_CTL 0x52430003u #define RADIO_MSG_INFO 0x52430004u #define RADIO_MSG_VERSION 0x52430005u // C6 -> P4: radio-c6's app version string, the answer to RADIO_CTL_VERSION // RADIO_MSG_CTL types of its own, next to the bridge_proto ones #define RADIO_CTL_VERSION 0x50 // ask for RADIO_MSG_VERSION. esp-hosted's own app description does not carry the // C6 app's version (it reports esp-hosted's), so the P4 asks this way. #define RADIO_BATCH_MAX 1536 // bytes per batch message #define RADIO_ENTRY_HDR 7 // mac + len