hwsetup.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /************************************************************************
  2. Project: Welling Motor Control Paltform
  3. Filename: hwsetup.h
  4. Partner Filename: hwsetup.c
  5. Description: The header file of hwsetup.c
  6. Complier: IAR Embedded Workbench for ARM 8.40.2
  7. CPU TYPE : GD32F30x
  8. *************************************************************************
  9. Copyright (c) 2022 Welling Motor Technology(Shanghai) Co. Ltd.
  10. All rights reserved.
  11. *************************************************************************
  12. *************************************************************************
  13. Revising History (ECL of this file):
  14. ************************************************************************/
  15. /************************************************************************
  16. Beginning of File, do not put anything above here except notes
  17. Compiler Directives:
  18. ************************************************************************/
  19. #ifndef HWSETUP_H
  20. #define HWSETUP_H
  21. #include "gd32f30x_libopt.h"
  22. /************************************************************************
  23. Compiler Directives (N/A)
  24. ************************************************************************/
  25. #ifdef _HWSETUP_C_
  26. #define _HWSETUP_EXT
  27. #else
  28. #define _HWSETUP_EXT extern
  29. #endif
  30. /************************************************************************
  31. Definitions & Macros
  32. ************************************************************************/
  33. /* Interrupt ON/OFF define */
  34. #define ENABLE_IRQ __enable_irq()
  35. #define DISABLE_IRQ __disable_irq()
  36. /************************************************************************
  37. TypeDefs & Structure defines (N/A)
  38. ************************************************************************/
  39. /************************************************************************
  40. Constant Table
  41. *************************************************************************/
  42. /************************************************************************
  43. Exported Variables
  44. ************************************************************************/
  45. /************************************************************************
  46. RAM ALLOCATION (N/A)
  47. ************************************************************************/
  48. /************************************************************************
  49. Exported Function Call Prototypes
  50. ************************************************************************/
  51. #ifdef _HWSETUP_C_
  52. _HWSETUP_EXT void hw_voHardwareSetup1(void);
  53. _HWSETUP_EXT void hw_voHardwareSetup2(void);
  54. _HWSETUP_EXT void hw_voEnInt(void);
  55. _HWSETUP_EXT void hw_voInitPeri(void);
  56. _HWSETUP_EXT void hw_voInitSysCtrl(void);
  57. _HWSETUP_EXT void hw_voInitGPIO(void);
  58. _HWSETUP_EXT void hw_voInitInt(void);
  59. _HWSETUP_EXT void hw_voInitSysTick(void);
  60. _HWSETUP_EXT void hw_voInitCAN(void);
  61. #else
  62. _HWSETUP_EXT void hw_voHardwareSetup1(void);
  63. _HWSETUP_EXT void hw_voHardwareSetup2(void);
  64. _HWSETUP_EXT void hw_voEnInt(void);
  65. _HWSETUP_EXT void hw_voTimEn(void);
  66. _HWSETUP_EXT void hw_voPWMInit(void);
  67. _HWSETUP_EXT void hw_voPWMOn(void);
  68. _HWSETUP_EXT void hw_voPWMOff(void);
  69. _HWSETUP_EXT void hw_voCharge(void);
  70. _HWSETUP_EXT void hw_voThrPhsShrt(void);
  71. _HWSETUP_EXT void hw_voIWDGInit(uint16_t prer, uint16_t rlr);
  72. #endif
  73. #define ID_TO_MC_FILTER (uint16_t)0x751
  74. #define ID_TO_MC_MASK (uint16_t)0x7FF
  75. #define ID_BC_FILTER (uint16_t)0x751
  76. #define ID_BC_MASK (uint16_t)0x7FF
  77. /************************************************************************
  78. Flag Define (N/A)
  79. ************************************************************************/
  80. /***********************************************************************/
  81. #endif
  82. /************************************************************************
  83. Copyright (c) 2022 Welling Motor Technology(Shanghai) Co. Ltd.
  84. All rights reserved.
  85. *************************************************************************
  86. End of this File (EOF)!
  87. Do not put anything after this part!
  88. ************************************************************************/