Modified version of ModbusTCP
Dependencies: EthernetNetIf mbed
ModBus/port.h@3:d7d7c67f21fa, 2012-03-15 (annotated)
- Committer:
- paleskyjp
- Date:
- Thu Mar 15 15:28:14 2012 +0000
- Revision:
- 3:d7d7c67f21fa
- Parent:
- 0:62be54b8975d
eMBRegCoilsCB was corrected.
(Implementation of writing single coil was wrong.)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
paleskyjp | 0:62be54b8975d | 1 | /* |
paleskyjp | 0:62be54b8975d | 2 | * FreeModbus Libary: BARE Port |
paleskyjp | 0:62be54b8975d | 3 | * Copyright (C) 2006 Christian Walter <wolti@sil.at> |
paleskyjp | 0:62be54b8975d | 4 | * |
paleskyjp | 0:62be54b8975d | 5 | * This library is free software; you can redistribute it and/or |
paleskyjp | 0:62be54b8975d | 6 | * modify it under the terms of the GNU Lesser General Public |
paleskyjp | 0:62be54b8975d | 7 | * License as published by the Free Software Foundation; either |
paleskyjp | 0:62be54b8975d | 8 | * version 2.1 of the License, or (at your option) any later version. |
paleskyjp | 0:62be54b8975d | 9 | * |
paleskyjp | 0:62be54b8975d | 10 | * This library is distributed in the hope that it will be useful, |
paleskyjp | 0:62be54b8975d | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paleskyjp | 0:62be54b8975d | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
paleskyjp | 0:62be54b8975d | 13 | * Lesser General Public License for more details. |
paleskyjp | 0:62be54b8975d | 14 | * |
paleskyjp | 0:62be54b8975d | 15 | * You should have received a copy of the GNU Lesser General Public |
paleskyjp | 0:62be54b8975d | 16 | * License along with this library; if not, write to the Free Software |
paleskyjp | 0:62be54b8975d | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
paleskyjp | 0:62be54b8975d | 18 | * |
paleskyjp | 0:62be54b8975d | 19 | * File: $Id: port.h,v 1.1 2006/08/22 21:35:13 wolti Exp $ |
paleskyjp | 0:62be54b8975d | 20 | */ |
paleskyjp | 0:62be54b8975d | 21 | |
paleskyjp | 0:62be54b8975d | 22 | #ifndef _PORT_H |
paleskyjp | 0:62be54b8975d | 23 | #define _PORT_H |
paleskyjp | 0:62be54b8975d | 24 | |
paleskyjp | 0:62be54b8975d | 25 | #include <assert.h> |
paleskyjp | 0:62be54b8975d | 26 | #include <inttypes.h> |
paleskyjp | 0:62be54b8975d | 27 | |
paleskyjp | 0:62be54b8975d | 28 | #define INLINE //inline |
paleskyjp | 0:62be54b8975d | 29 | #define PR_BEGIN_EXTERN_C //extern "C" { |
paleskyjp | 0:62be54b8975d | 30 | #define PR_END_EXTERN_C //} |
paleskyjp | 0:62be54b8975d | 31 | |
paleskyjp | 0:62be54b8975d | 32 | #define ENTER_CRITICAL_SECTION( ) |
paleskyjp | 0:62be54b8975d | 33 | #define EXIT_CRITICAL_SECTION( ) |
paleskyjp | 0:62be54b8975d | 34 | |
paleskyjp | 0:62be54b8975d | 35 | typedef uint8_t BOOL; |
paleskyjp | 0:62be54b8975d | 36 | |
paleskyjp | 0:62be54b8975d | 37 | typedef unsigned char UCHAR; |
paleskyjp | 0:62be54b8975d | 38 | typedef char CHAR; |
paleskyjp | 0:62be54b8975d | 39 | |
paleskyjp | 0:62be54b8975d | 40 | typedef uint16_t USHORT; |
paleskyjp | 0:62be54b8975d | 41 | typedef int16_t SHORT; |
paleskyjp | 0:62be54b8975d | 42 | |
paleskyjp | 0:62be54b8975d | 43 | typedef uint32_t ULONG; |
paleskyjp | 0:62be54b8975d | 44 | typedef int32_t LONG; |
paleskyjp | 0:62be54b8975d | 45 | |
paleskyjp | 0:62be54b8975d | 46 | #ifndef TRUE |
paleskyjp | 0:62be54b8975d | 47 | #define TRUE 1 |
paleskyjp | 0:62be54b8975d | 48 | #endif |
paleskyjp | 0:62be54b8975d | 49 | |
paleskyjp | 0:62be54b8975d | 50 | #ifndef FALSE |
paleskyjp | 0:62be54b8975d | 51 | #define FALSE 0 |
paleskyjp | 0:62be54b8975d | 52 | #endif |
paleskyjp | 0:62be54b8975d | 53 | |
paleskyjp | 0:62be54b8975d | 54 | #define MB_TCP_DEBUG 1 /* Debug output in TCP module. */ |
paleskyjp | 0:62be54b8975d | 55 | |
paleskyjp | 0:62be54b8975d | 56 | |
paleskyjp | 0:62be54b8975d | 57 | typedef enum |
paleskyjp | 0:62be54b8975d | 58 | { |
paleskyjp | 0:62be54b8975d | 59 | MB_LOG_ERROR = 0, |
paleskyjp | 0:62be54b8975d | 60 | MB_LOG_WARN = 1, |
paleskyjp | 0:62be54b8975d | 61 | MB_LOG_INFO = 2, |
paleskyjp | 0:62be54b8975d | 62 | MB_LOG_DEBUG = 3 |
paleskyjp | 0:62be54b8975d | 63 | } eMBPortLogLevel; |
paleskyjp | 0:62be54b8975d | 64 | |
paleskyjp | 0:62be54b8975d | 65 | #ifdef MB_TCP_DEBUG |
paleskyjp | 0:62be54b8975d | 66 | void vMBPortLog( eMBPortLogLevel eLevel, const CHAR * szModule, |
paleskyjp | 0:62be54b8975d | 67 | const CHAR * szFmt, ... ); |
paleskyjp | 0:62be54b8975d | 68 | |
paleskyjp | 0:62be54b8975d | 69 | void prvvMBTCPLogFrame( const CHAR * pucMsg, UCHAR * pucFrame, USHORT usFrameLen ); |
paleskyjp | 0:62be54b8975d | 70 | #endif |
paleskyjp | 0:62be54b8975d | 71 | |
paleskyjp | 0:62be54b8975d | 72 | #endif |