/*------------------------------------------------------------------------------ * main.h * Copyright 2019 WDKL Electronics Co.,Ltd. * Description: * - This file implements the follow functions: * - * modification history * -------------------- * 10:10am, 9.Sep.2019, written by dwd * -------------------- ------------------------------------------------------------------------------*/ #ifndef _MAIN_H_ #define _MAIN_H_ /*------------------------------------------------------------------------------ * I N C L U D E *------------------------------------------------------------------------------*/ #include "general.h" /*------------------------------------------------------------------------------ * D E F I N E *------------------------------------------------------------------------------*/ #define OS_TICKS_PER_SEC (1000) /* # of clock ticks to obtain 1 second */ #define OS_TIMER_3MS ((OS_TICKS_PER_SEC*3L) / 1000) #define OS_TIMER_5MS ((OS_TICKS_PER_SEC*5L) / 1000) #define OS_TIMER_10MS ((OS_TICKS_PER_SEC*10L) / 1000) #define OS_TIMER_15MS ((OS_TICKS_PER_SEC*15L) / 1000) #define OS_TIMER_30MS ((OS_TICKS_PER_SEC*30L) / 1000) #define OS_TIMER_35MS ((OS_TICKS_PER_SEC*35L) / 1000) #define OS_TIMER_100MS ((OS_TICKS_PER_SEC*100L) / 1000) #define OS_TIMER_150MS ((OS_TICKS_PER_SEC*150L) / 1000) #define OS_TIMER_180MS ((OS_TICKS_PER_SEC*180L) / 1000) #define OS_TIMER_200MS ((OS_TICKS_PER_SEC*200L) / 1000) #define OS_TIMER_300MS ((OS_TICKS_PER_SEC*300L) / 1000) #define OS_TIMER_400MS ((OS_TICKS_PER_SEC*400L) / 1000) #define OS_TIMER_500MS ((OS_TICKS_PER_SEC*500L) / 1000) #define OS_TIMER_800MS ((OS_TICKS_PER_SEC*800L) / 1000) #define OS_TIMER_1S (OS_TICKS_PER_SEC*1) #define OS_TIMER_1_2S ((OS_TICKS_PER_SEC*1200L) / 1000) #define OS_TIMER_1S5 ((OS_TICKS_PER_SEC*1500L) / 1000) #define OS_TIMER_2S (OS_TICKS_PER_SEC*2) #define OS_TIMER_2S5 ((OS_TICKS_PER_SEC*2500L) / 1000) #define OS_TIMER_3S (OS_TICKS_PER_SEC*3) #define OS_TIMER_4S (OS_TICKS_PER_SEC*4) #define OS_TIMER_5S (OS_TICKS_PER_SEC*5) #define OS_TIMER_8S (OS_TICKS_PER_SEC*8) #define OS_TIMER_10S (OS_TICKS_PER_SEC*10) #define OS_TIMER_20S (OS_TICKS_PER_SEC*20) #define OS_TIMER_40S (OS_TICKS_PER_SEC*40) #define OS_TIMER_60S (OS_TICKS_PER_SEC*60) #define OS_TIMER_70S (OS_TICKS_PER_SEC*70) #define CAN_033K 0 #define CAN_050K 1 #define CAN_100K 2 #define CAN_125K 3 #define CAN_250K 4 #define CAN_500K 5 #define CAN1_BRT CAN_125K #define MAIN_433 #define WDFJKEY_MAC_ADD //#define TCP_DHCP /* Signal detect configuration */ #define SIG_BY_NONE 0u #define SIG_BY_LINE 1u #define SIG_BY_BCAN 2u #define SIG_BY_UART 3u #define APP_CFG_ACC_DET SIG_BY_LINE #define APP_CFG_ILL_DET SIG_BY_NONE #define APP_CFG_REV_DET SIG_BY_BCAN #define APP_CFG_PRK_DET SIG_BY_NONE #define APP_CFG_SWC1_DET SIG_BY_LINE #define APP_CFG_SWC2_DET SIG_BY_LINE #define APP_CFG_SWC3_DET SIG_BY_NONE #define APP_CFG_AVM_DET SIG_BY_LINE /* ----------------------------- Can Transciever configuration --------------------------- */ #define TRCV_TJA1040 0u #define TRCV_TJA1041 1u #define TRCV_TJA1055 2u #define TRCV_THK8056 3u /*------------------------------------------------------------------------------ * E X T E R N *------------------------------------------------------------------------------*/ //extern const U08 DeviceID[]; extern const U08 FJKEYADDER[]; extern const U08 DeviceVisionInfo[]; extern const U08 DeviceMacInfo[]; /*------------------------------------------------------------------------------ * P R O T O T Y P E *------------------------------------------------------------------------------*/ void SysDelayUs(U16 dlyus); void SysDelayMs(U16 dlyms); void SysTickISR(void); void MEMSET(void *buff,U08 data,U16 length); U08 MEMCPY(void * to,void * from,U08 size); void strncpy_rom(U08* to,const U08 from[],U08 size); void strncpy_u8(U08* to,U08* from,U08 size); U08 StrnCmp(U08 *str1,U08 *str2,U08 size); /*=============================== END OF FILE ===============================*/ #endif /* _MAIN_H_ */