port.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. * port.h ,v 1.60 2022/07/17 quanghona <lyhonquang@gmail.com> CMSIS-RTOS2 port $
  21. */
  22. #ifndef _PORT_H
  23. #define _PORT_H
  24. #include "mbconfig.h"
  25. #include <assert.h>
  26. #include <inttypes.h>
  27. #include "main.h"
  28. #define INLINE
  29. #define PR_BEGIN_EXTERN_C extern "C" {
  30. #define PR_END_EXTERN_C }
  31. #define ENTER_CRITICAL_SECTION() EnterCriticalSection()
  32. #define EXIT_CRITICAL_SECTION() ExitCriticalSection()
  33. typedef uint8_t BOOL;
  34. typedef unsigned char UCHAR;
  35. typedef char CHAR;
  36. typedef uint16_t USHORT;
  37. typedef int16_t SHORT;
  38. typedef uint32_t ULONG;
  39. typedef int32_t LONG;
  40. #ifndef TRUE
  41. #define TRUE 1
  42. #endif
  43. #ifndef FALSE
  44. #define FALSE 0
  45. #endif
  46. void EnterCriticalSection(void);
  47. void ExitCriticalSection(void);
  48. void prvvMBMasterUARTTxReadyISR(void);
  49. void prvvMBMasterUARTRxISR(void);
  50. void prvvMBMasterUARTRxReceiveCharISR(CHAR data);
  51. void prvvUARTTxReadyISR(void);
  52. void prvvUARTRxISR(void);
  53. void prvvUARTRxReceiveCharISR(CHAR data);
  54. #endif