成功导入freemodbus模块

This commit is contained in:
jarvis 2025-03-04 14:39:51 +08:00
parent bfd67f8f00
commit 753b9760f0
4 changed files with 20 additions and 1 deletions

View File

@ -44,10 +44,17 @@ dependencies:
registry_url: https://components.espressif.com/
type: service
version: 8.4.0
mb_example_common:
dependencies: []
source:
path: C:\Espressif\frameworks\esp-idf-v5.3.1\examples\protocols\modbus\mb_example_common
type: local
version: '*'
direct_dependencies:
- espressif/esp-modbus
- espressif/esp_lcd_touch_ft5x06
- lvgl/lvgl
manifest_hash: 9636c39d052f12d7135da1a3705d24d168ae364c70341a0025805a1ae0dc5019
- mb_example_common
manifest_hash: 7bd740372f78c1d25e695e2a8ee35357efb49480f45dbadc74e6e9ffc63cb2ee
target: esp32s3
version: 2.0.0

7
main/FreeBus.h Normal file
View File

@ -0,0 +1,7 @@
#include "modbus_params.h" // for modbus parameters structures
#include "mbcontroller.h"
#define MB_PORT_NUM (CONFIG_MB_UART_PORT_NUM) // Number of UART port used for Modbus connection
#define MB_DEV_SPEED (CONFIG_MB_UART_BAUD_RATE) // The communication speed of the UART

View File

@ -18,6 +18,9 @@
#include "driver/gpio.h"
#include "lvgl.h"
/*导入Modbus控制头文件*/
#include "FreeBus.h"
//新增触摸屏驱动头文件
#include "driver/i2c.h"
#include "esp_lcd_touch_ft5x06.h"

View File

@ -2,3 +2,5 @@ dependencies:
lvgl/lvgl: ~8.4.0
esp_lcd_touch_ft5x06: ^1.0
espressif/esp-modbus: ^1.0.13
mb_example_common:
path: ${IDF_PATH}/examples/protocols/modbus/mb_example_common