commlib.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /**
  2. ******************************************************************************
  3. * @file CommLib.h
  4. * @author
  5. * @version V2.1.0
  6. * @date 15-Oct-2013
  7. * @brief This file contains all header files
  8. * @history
  9. *
  10. * Copyright (c) 2009-2013, MacroSilicon Technology Co.,Ltd.
  11. ******************************************************************************/
  12. #ifndef _MACROSILICON_TECH_COMMON_H_
  13. #define _MACROSILICON_TECH_COMMON_H_
  14. // KEIL C51
  15. //#define __KEIL_C__
  16. // KEIL ARM (STM32)
  17. //#define __KEIL_ARM_STM32__
  18. // Standard GCC
  19. //#define __STD_GCC__
  20. //Code Composer Studio
  21. //#define __CCS__
  22. #define __STD_GCC__
  23. #ifdef __KEIL_ARM_STM32__
  24. #ifndef _PLATFORM_ARM_
  25. #define _PLATFORM_ARM_
  26. #endif
  27. #endif
  28. // Compiler issue.
  29. #if defined (__CSMC__)
  30. #elif defined (__KEIL_C__)
  31. #elif defined (_PLATFORM_ARM_)
  32. #elif defined (__STD_GCC__)
  33. #elif defined (__CCS__)
  34. #else
  35. #error "Please define the Compiler type!!!"
  36. #endif
  37. // SW Version.
  38. #define SW_MAJOR_VERSION (0x02) // Major version
  39. #define SW_MINOR_VERSION (0x04) // Minor version
  40. #if defined(__KEIL_C__)
  41. #ifndef SM39R16A3
  42. #define STC_11LxxXE
  43. #endif
  44. // For keil c compiler
  45. #include <intrins.h>
  46. #include <stdio.h>
  47. #include <math.h>
  48. #include <string.h>
  49. // Add 8051 register header
  50. #if defined STC_11LxxXE
  51. #include "STC_11LxxXE.h"
  52. #elif defined SM39R16A3
  53. #include "SM39R16A3.h"
  54. #endif
  55. #include "mst_typedef.h"
  56. // Add peripheral configuration
  57. #include "Periph_Config.h"
  58. #elif defined(_PLATFORM_ARM_) || defined(__CCS__)
  59. #include <stdio.h>
  60. #include <math.h>
  61. #include <string.h>
  62. #include "mst_typedef.h"
  63. #elif defined(__STD_GCC__)
  64. #if defined(__KERNEL__)
  65. #include <linux/string.h>
  66. #else
  67. #include <string.h>
  68. #endif
  69. #include "mst_typedef.h"
  70. #elif defined(__CSMC__)
  71. #include <string.h>
  72. #include "stm8s.h"
  73. #include "mst_typedef.h"
  74. #include "Periph_Config.h"
  75. #include "stm8s\stm8s_lib.h"
  76. #include "stm8s\stm8s_it.h"
  77. #ifdef SUPPORT_SYSTEM_EDID
  78. #include "mst_i2c_slave.h"
  79. #endif
  80. #endif
  81. #if defined(__CSMC__) || defined(__KEIL_C__)
  82. // Add mcu peripherals' header files.
  83. #include "mst_periph.h"
  84. #include "mst_debug.h"
  85. #include "mst_timer.h"
  86. #include "mst_i2c.h"
  87. #include "mst_keys.h"
  88. #endif
  89. // Platform Porting Related APIs
  90. #include "MS928x_mpi.h"
  91. #endif //_MACROSILICON_TECH_COMMON_H_