main.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*------------------------------------------------------------------------------
  2. * main.h
  3. * Copyright 2019 WDKL Electronics Co.,Ltd.
  4. * Description:
  5. * - This file implements the follow functions:
  6. * -
  7. * modification history
  8. * --------------------
  9. * 10:10am, 9.Sep.2019, written by dwd
  10. * --------------------
  11. ------------------------------------------------------------------------------*/
  12. #ifndef _MAIN_H_
  13. #define _MAIN_H_
  14. /*------------------------------------------------------------------------------
  15. * I N C L U D E
  16. *------------------------------------------------------------------------------*/
  17. #include "general.h"
  18. /*------------------------------------------------------------------------------
  19. * D E F I N E
  20. *------------------------------------------------------------------------------*/
  21. #define OS_TICKS_PER_SEC (1000) /* # of clock ticks to obtain 1 second */
  22. #define OS_TIMER_3MS ((OS_TICKS_PER_SEC*3L) / 1000)
  23. #define OS_TIMER_5MS ((OS_TICKS_PER_SEC*5L) / 1000)
  24. #define OS_TIMER_10MS ((OS_TICKS_PER_SEC*10L) / 1000)
  25. #define OS_TIMER_15MS ((OS_TICKS_PER_SEC*15L) / 1000)
  26. #define OS_TIMER_30MS ((OS_TICKS_PER_SEC*30L) / 1000)
  27. #define OS_TIMER_35MS ((OS_TICKS_PER_SEC*35L) / 1000)
  28. #define OS_TIMER_100MS ((OS_TICKS_PER_SEC*100L) / 1000)
  29. #define OS_TIMER_150MS ((OS_TICKS_PER_SEC*150L) / 1000)
  30. #define OS_TIMER_180MS ((OS_TICKS_PER_SEC*180L) / 1000)
  31. #define OS_TIMER_200MS ((OS_TICKS_PER_SEC*200L) / 1000)
  32. #define OS_TIMER_300MS ((OS_TICKS_PER_SEC*300L) / 1000)
  33. #define OS_TIMER_400MS ((OS_TICKS_PER_SEC*400L) / 1000)
  34. #define OS_TIMER_500MS ((OS_TICKS_PER_SEC*500L) / 1000)
  35. #define OS_TIMER_800MS ((OS_TICKS_PER_SEC*800L) / 1000)
  36. #define OS_TIMER_1S (OS_TICKS_PER_SEC*1)
  37. #define OS_TIMER_1_2S ((OS_TICKS_PER_SEC*1200L) / 1000)
  38. #define OS_TIMER_1S5 ((OS_TICKS_PER_SEC*1500L) / 1000)
  39. #define OS_TIMER_2S (OS_TICKS_PER_SEC*2)
  40. #define OS_TIMER_2S5 ((OS_TICKS_PER_SEC*2500L) / 1000)
  41. #define OS_TIMER_3S (OS_TICKS_PER_SEC*3)
  42. #define OS_TIMER_4S (OS_TICKS_PER_SEC*4)
  43. #define OS_TIMER_5S (OS_TICKS_PER_SEC*5)
  44. #define OS_TIMER_8S (OS_TICKS_PER_SEC*8)
  45. #define OS_TIMER_10S (OS_TICKS_PER_SEC*10)
  46. #define OS_TIMER_20S (OS_TICKS_PER_SEC*20)
  47. #define OS_TIMER_40S (OS_TICKS_PER_SEC*40)
  48. #define OS_TIMER_60S (OS_TICKS_PER_SEC*60)
  49. #define OS_TIMER_70S (OS_TICKS_PER_SEC*70)
  50. #define CAN_033K 0
  51. #define CAN_050K 1
  52. #define CAN_100K 2
  53. #define CAN_125K 3
  54. #define CAN_250K 4
  55. #define CAN_500K 5
  56. #define CAN1_BRT CAN_125K
  57. #define MAIN_433
  58. #define WDFJKEY_MAC_ADD
  59. //#define TCP_DHCP
  60. /* Signal detect configuration */
  61. #define SIG_BY_NONE 0u
  62. #define SIG_BY_LINE 1u
  63. #define SIG_BY_BCAN 2u
  64. #define SIG_BY_UART 3u
  65. #define APP_CFG_ACC_DET SIG_BY_LINE
  66. #define APP_CFG_ILL_DET SIG_BY_NONE
  67. #define APP_CFG_REV_DET SIG_BY_BCAN
  68. #define APP_CFG_PRK_DET SIG_BY_NONE
  69. #define APP_CFG_SWC1_DET SIG_BY_LINE
  70. #define APP_CFG_SWC2_DET SIG_BY_LINE
  71. #define APP_CFG_SWC3_DET SIG_BY_NONE
  72. #define APP_CFG_AVM_DET SIG_BY_LINE
  73. /* ----------------------------- Can Transciever configuration --------------------------- */
  74. #define TRCV_TJA1040 0u
  75. #define TRCV_TJA1041 1u
  76. #define TRCV_TJA1055 2u
  77. #define TRCV_THK8056 3u
  78. /*------------------------------------------------------------------------------
  79. * E X T E R N
  80. *------------------------------------------------------------------------------*/
  81. //extern const U08 DeviceID[];
  82. extern const U08 FJKEYADDER[];
  83. extern const U08 DeviceVisionInfo[];
  84. extern const U08 DeviceMacInfo[];
  85. /*------------------------------------------------------------------------------
  86. * P R O T O T Y P E
  87. *------------------------------------------------------------------------------*/
  88. void SysDelayUs(U16 dlyus);
  89. void SysDelayMs(U16 dlyms);
  90. void SysTickISR(void);
  91. void MEMSET(void *buff,U08 data,U16 length);
  92. U08 MEMCPY(void * to,void * from,U08 size);
  93. void strncpy_rom(U08* to,const U08 from[],U08 size);
  94. void strncpy_u8(U08* to,U08* from,U08 size);
  95. U08 StrnCmp(U08 *str1,U08 *str2,U08 size);
  96. /*=============================== END OF FILE ===============================*/
  97. #endif /* _MAIN_H_ */