当前位置:网站首页>esp32 hosted
esp32 hosted
2022-06-12 06:47:00 【wwwlyj123321】
Handshake pin
ESP Of Output Pin . A high level indicates that... Is in progress ESP32 Passing spi Interface interacts with the host . therefore , When the pin is high , The host should not start spi The data transfer . The popular explanation is :host Want to give ESP32 send data , Have a look first esp32 Are you ready to receive data .
Data ready pin
ESP Of Output Pin . because ESP yes spi The slave device of , The transmission cannot be initiated . therefore , This pin is used to compensate SPI The inadequacy of the agreement , tell SPI host ,esp32 You want to send data to the host . This pin remains high , Until the host reads the packet .
Reset/EN pin
ESP Peripheral Input Pin . Used to reset ESP equipment .
esp32 The code internally maintains a spi Of rx_buffer and tx_buffer. Every buffer The biggest problem is 1600 byte , That is, the host can send and receive at most 1600 Bytes of data .
stay esp32 and host When exchanging data , Use protobuf Serialize and deserialize data .
If you want to add a new command interaction :
1、 stay .proto Add custom commands in the file , Then generate .c and .h file :
cd <path/to/esp_hosted>/common/proto
protoc-c esp_hosted_config.proto --c_out=.
mv esp_hosted_config.pb-c.c ../
mv esp_hosted_config.pb-c.h ../include/2、 stay host/host_common/commands.c Add C function
3、 stay ESP End , stay esp/esp_driver/network_adapter/main/slave_commands.c Add the corresponding C Function to handle the added message fields .
When host to esp32 When sending a command , First use protobuf Serialize the command , And then call transport_pserial_data_handler Interfaces assemble data into TLV Format (Type - Length - Value),

| Field | explain | bytes used |
Endpoint Type | 1: Indicates that the next transmission is endpoint name | 1 byte |
Endpoint Length | Indicates the next transmitted Endpoint Value Size | 2 byte |
Endpoint Value | There is only one value, Fixed is :"control" | 7 byte |
Data Type | 2: Indicates that the next transmission is the data content | 1 byte |
Data Length | Indicates the next transmitted Data Value Size | 2 byte |
Data Value | payload | N bytes |
边栏推荐
猜你喜欢

Solution: content type 'application/x-www-form-urlencoded; charset=UTF-8‘ not supported

【图像去噪】基于高斯滤波、均值滤波、中值滤波、双边滤波四种滤波实现椒盐噪声图像去噪附matlab代码

美团获得小样本学习榜单FewCLUE第一!Prompt Learning+自训练实战

报表工具的二次革命

Are you still using like+% for MySQL fuzzy query?

Database syntax related problems, solve a correct syntax

Qt-- realize TCP communication

SQL injection read / write file

Multithreading (V) -- concurrency tools (I) -- thread pool (II) -- related contents of ThreadPoolExecutor

Whether the modification of basic type and reference type is valid
随机推荐
6 functions
六月集训 第二天——字符串
Upload file (post form submission form data)
SQL injection read / write file
Database syntax related problems, solve a correct syntax
PHP 开发环境搭建及数据库增删改查
Leetcode: offer 60 Points of N dice [math + level DP + cumulative contribution]
(14) The software version number is displayed in the flash window of blender source code analysis
leetcode:剑指 Offer 67. 把字符串转换成整数【模拟 + 分割 +讨论】
美团获得小样本学习榜单FewCLUE第一!Prompt Learning+自训练实战
VSCode常用插件
LeetCode-1741. Find total time spent per employee
The first day of June training - array
Deep and detailed analysis of PHP one sentence Trojan horse
postman拼接替换参数循环调用接口
推荐17个提升开发效率的“轮子”
leetcode:890. 查找和替换模式【两个dict记录双射(set)】
The seventh day of June training - hash table
Use ms17-010 Eternal Blue vulnerability to infiltrate win7 and establish a permanent back door
2 variables and basic types