port.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * FreeModbus Libary: BARE Port
  3. * Copyright (C) 2013 Armink <armink.ztl@gmail.com>
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2.1 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  18. *
  19. * File: $Id: port.h ,v 1.60 2013/08/13 15:07:05 Armink add Master Functions $
  20. */
  21. #ifndef _PORT_H
  22. #define _PORT_H
  23. #include <stm32f10x_conf.h>
  24. #include "mbconfig.h"
  25. #include <rthw.h>
  26. #include <rtthread.h>
  27. #include <assert.h>
  28. #include <inttypes.h>
  29. #define INLINE
  30. #define PR_BEGIN_EXTERN_C extern "C" {
  31. #define PR_END_EXTERN_C }
  32. #define ENTER_CRITICAL_SECTION() EnterCriticalSection()
  33. #define EXIT_CRITICAL_SECTION() ExitCriticalSection()
  34. typedef uint8_t BOOL;
  35. typedef unsigned char UCHAR;
  36. typedef char CHAR;
  37. typedef uint16_t USHORT;
  38. typedef int16_t SHORT;
  39. typedef uint32_t ULONG;
  40. typedef int32_t LONG;
  41. #ifndef TRUE
  42. #define TRUE 1
  43. #endif
  44. #ifndef FALSE
  45. #define FALSE 0
  46. #endif
  47. void EnterCriticalSection(void);
  48. void ExitCriticalSection(void);
  49. #endif