4
0
mirror of https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32.git synced 2025-02-03 03:22:23 +08:00
armink d4ee095afa 1、【修改】FreeModbus中的Port框架,并支持主机模式
2、【增加】FreeModbus中的Port关于主机的移植文件
3、【增加】FreeModbus分析图中关于FreeModbus初始化的流程图

Signed-off-by: armink <armink.ztl@gmail.com>
2013-08-13 16:45:39 +08:00

71 lines
2.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* FreeModbus Libary: BARE Port
* Copyright (C) 2006 Christian Walter <wolti@sil.at>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* File: $Id: port.h add Master Functions,v 1.1 2013/08/13 15:07:05 Armink Exp $
*/
#ifndef _PORT_H
#define _PORT_H
#include <stm32f10x_conf.h>
#include <rthw.h>
#include <rtthread.h>
#include <assert.h>
#include <inttypes.h>
#define INLINE
#define PR_BEGIN_EXTERN_C extern "C" {
#define PR_END_EXTERN_C }
//TODO 暂时先写B13引脚等组网测试时再确认
#define SLAVER_RS485_SEND_MODE GPIO_SetBits(GPIOB,GPIO_Pin_13)
#define SLAVER_RS485_RECEIVE_MODE GPIO_ResetBits(GPIOB,GPIO_Pin_13)
#define MASTER_RS485_SEND_MODE GPIO_SetBits(GPIOB,GPIO_Pin_13)
#define MASTER_RS485_RECEIVE_MODE GPIO_ResetBits(GPIOB,GPIO_Pin_13)
//void USART1_IRQHandler(void);
//void TIM3_IRQHandler(void);
#define ENTER_CRITICAL_SECTION() EnterCriticalSection()
#define EXIT_CRITICAL_SECTION() ExitCriticalSection()
void EnterCriticalSection(void);
void ExitCriticalSection(void);
typedef uint8_t BOOL;
typedef unsigned char UCHAR;
typedef char CHAR;
typedef uint16_t USHORT;
typedef int16_t SHORT;
typedef uint32_t ULONG;
typedef int32_t LONG;
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#endif