-
大小: 13.1MB文件类型: .zip金币: 2下载: 1 次发布日期: 2023-07-13
- 语言: 其他
- 标签: STM32F407 freeModbus
资源简介
STM32F407移植freemodbus和LWIP使用modbus tcp实验,代码已验证通过,可拿来直接使用
代码片段和文件信息
/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter
* All rights reserved.
*
* Redistribution and use in source and binary forms with or without
* modification are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ‘‘AS IS‘‘ AND ANY EXPRESS OR
* IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT INDIRECT
* INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING BUT
* NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE
* DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* File: $Id: mb.cv 1.28 2010/06/06 13:54:40 wolti Exp $
*/
/* ----------------------- System includes ----------------------------------*/
#include “stdlib.h“
#include “string.h“
/* ----------------------- Platform includes --------------------------------*/
#include “port.h“
/* ----------------------- Modbus includes ----------------------------------*/
#include “mb.h“
#include “mbconfig.h“
#include “mbframe.h“
#include “mbproto.h“
#include “mbfunc.h“
#include “mbport.h“
#if MB_RTU_ENABLED == 1
#include “mbrtu.h“
#endif
#if MB_ASCII_ENABLED == 1
#include “mbascii.h“
#endif
#if MB_TCP_ENABLED == 1
#include “mbtcp.h“
#endif
#ifndef MB_PORT_HAS_CLOSE
#define MB_PORT_HAS_CLOSE 0
#endif
/* ----------------------- Static variables ---------------------------------*/
static UCHAR ucMBAddress;
static UCHAR ucMBTCPAddress;
static eMBMode eMBCurrentMode;
static enum
{
STATE_ENABLED
STATE_DISABLED
STATE_NOT_INITIALIZED
}eMBRTUSlaveState = STATE_NOT_INITIALIZEDeMBTCPState = STATE_NOT_INITIALIZED;
/* Functions pointer which are initialized in eMBInit( ). Depending on the
* mode (RTU or ASCII) the are set to the correct implementations.
*/
static peMBframeSend peMBframeSendCur;
static pvMBframeStart pvMBframeStartCur;
static pvMBframeStop pvMBframeStopCur;
static peMBframeReceive peMBframeReceiveCur;
static p
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-07-17 16:46 modbus移植\
目录 0 2020-07-17 15:47 modbus移植\CORE\
文件 109142 2016-04-15 22:01 modbus移植\CORE\core_cm4.h
文件 22735 2016-04-15 22:01 modbus移植\CORE\core_cm4_simd.h
文件 17146 2016-04-15 22:01 modbus移植\CORE\core_cmFunc.h
文件 20513 2016-04-15 22:01 modbus移植\CORE\core_cmInstr.h
文件 29605 2016-04-15 22:01 modbus移植\CORE\startup_stm32f40_41xxx.s
目录 0 2020-07-17 16:46 modbus移植\FREEMODBUS\
目录 0 2020-07-17 16:46 modbus移植\FREEMODBUS\modbus\
目录 0 2020-07-17 16:46 modbus移植\FREEMODBUS\modbus\ascii\
文件 15715 2010-06-06 15:47 modbus移植\FREEMODBUS\modbus\ascii\mbascii.c
文件 2457 2006-12-08 00:10 modbus移植\FREEMODBUS\modbus\ascii\mbascii.h
目录 0 2020-07-17 16:46 modbus移植\FREEMODBUS\modbus\functions\
文件 9887 2007-02-19 01:47 modbus移植\FREEMODBUS\modbus\functions\mbfunccoils.c
文件 1662 2006-12-08 00:10 modbus移植\FREEMODBUS\modbus\functions\mbfuncdiag.c
文件 4614 2007-02-19 01:48 modbus移植\FREEMODBUS\modbus\functions\mbfuncdisc.c
文件 12201 2007-02-19 01:48 modbus移植\FREEMODBUS\modbus\functions\mbfuncholding.c
文件 4840 2016-12-03 19:41 modbus移植\FREEMODBUS\modbus\functions\mbfuncinput.c
文件 3534 2006-12-08 00:10 modbus移植\FREEMODBUS\modbus\functions\mbfuncother.c
文件 5099 2007-02-19 01:49 modbus移植\FREEMODBUS\modbus\functions\mbutils.c
目录 0 2020-07-17 16:49 modbus移植\FREEMODBUS\modbus\include\
文件 19738 2016-12-26 11:43 modbus移植\FREEMODBUS\modbus\include\mb.h
文件 5678 2020-07-17 16:49 modbus移植\FREEMODBUS\modbus\include\mbconfig.h
文件 3788 2006-12-08 00:10 modbus移植\FREEMODBUS\modbus\include\mbfr
文件 3114 2006-12-08 00:10 modbus移植\FREEMODBUS\modbus\include\mbfunc.h
文件 5138 2016-12-26 10:58 modbus移植\FREEMODBUS\modbus\include\mbport.h
文件 3677 2006-12-08 00:10 modbus移植\FREEMODBUS\modbus\include\mbproto.h
文件 4218 2006-12-08 00:10 modbus移植\FREEMODBUS\modbus\include\mbutils.h
文件 16003 2016-12-26 11:44 modbus移植\FREEMODBUS\modbus\mb.c
目录 0 2020-07-17 16:46 modbus移植\FREEMODBUS\modbus\rtu\
文件 5530 2016-12-01 21:59 modbus移植\FREEMODBUS\modbus\rtu\mbcrc.c
............此处省略575个文件信息
相关资源
- FreeModbus_Slave+STM32F407+USART2代码亲测可
- STM32F407 串口配置 串口1~6 六串口同时
- STM32F407_6个串口同时使用的代码
- STM32F407实时时钟_DS1302实时时钟模块和
- stm32f407读写flash的demo,基于正点原子
- 基于STM32F407的视频采集与传输系统设
- STM32F103移植FreeModbus实现modbus主机.zi
- STM32F407ZG_ESP8266例程
- Keil5下的STM32F407程序
- USART基于hal库stm32f407串口通讯.rar
- 完整的STM32F407_MODBUS通信工程代码。
- STM32指针式时钟工程项目
- stm32f407和摇杆制作的控制手柄代码
- STM32F407. 基于PID速度环的步进电机速度
- STM32F407 基于232或485的57&42;步进电机旋
- STM32F407与OV2640的二维码识别实验
- stm32f407+ov5640颜色识别与追踪
- NRF24L01收发程序STM32F407
- uCOS-III+STemWin+Fatfs+usb在STM32F407上成功移
- STM32F407串口1-6 CAN1&2测试例程
- 基于STM32F407的MLX90614驱动程序(寄存器
- FreeModbus_For_STM32_USART1_RS485移植分享
- stm32f405/stm32f407单片机nrf24l01无线通信
- 基于STM32F407的漏电检测系统
- STM32F407ZG接入ONENET平台代码
- STM32F407 SD卡IAP升级
- 基于stm32f407芯片双ADC多通道开启AD转换
- STM32F407ZET/ZGT STEMWIN ILI9341 SPI LCD液晶屏
- stm32f407对ds18b20温度传感器数据的采集
- STM32F407_OLED显示
评论
共有 条评论