/**
  *****************************************************************************
  * @file    ufcs_timer_defs.h
  * @author  Solution Team
  * @version V1.00
  * @date    28-February-2023
  * @brief   UFCS timer definitions
  *****************************************************************************
  * @attention 
  *  Copyright (c) 2017 - 2023 Unicmicro Co., Ltd. 
  *  All Rights Reserved. 
  *****************************************************************************
  */
 
#ifndef __UFCS_TIMER_DEFS_H_
#define __UFCS_TIMER_DEFS_H_

#include "arch.h"

#pragma pack(1)

/**
 * UFCS timer interval definitions
 *
 * Below timer interval defined for software
 */
#define tDet1                       2UL   // 2ms, 1.5 ~ 2.5 ms
#define tDet1Min                    1500UL // 1500us, 1.5 ~ 2.5 ms
#define tDet1Max                    2500UL // 1500us, 1.5 ~ 2.5 ms
#define tDet2                       8UL   // 8ms, 6 ~ 10 ms
#define tDet2Min                    6000UL // 6000us, 6 ~ 10 ms
#define tDet3                       2UL   // 2ms, 1.5 ~ 2.5 ms
#define tDet3Min                    1500UL // 1500us, 1.5 ~ 2.5 ms
#define tDet4                       8UL   // 8ms, 6 ~ 10 ms
#define tDet4Min                    6000UL // 6000us, 6 ~ 10 ms
#define tDpDet                      11UL  // 12ms, 11 ~ 15 ms
#define tdetRetry                   5UL   // 5ms, 0 ~ 10 ms
#define tDetTimeout                 15000UL // 15000us
#define tSendPing                   35UL  // 35ms, 0 ~ 100 ms
#define tWaitPing                   119UL // 119ms, 110 ~ 120 ms
#define tDataRoleSwitch             900UL // 900us, max 1 ms
#define tWaitGetOutput              100UL // 100ms
#define tWaitStartCblDet            20UL  // 20ms

#define tFrameReceive               600UL   // 600us, 500~700us
#define tResetCable                 1200UL  // 1000us, min 1000us, max 1500us
#define tResetCableMin              1000UL  // 1000us, min 1000us, max 1500us
#define tResetCableMax              1500UL  // 1000us, min 1000us, max 1500us
#define tResetSource                3000UL  // 3000us, min 2000us
#define tResetSourceMin             2000UL  // 2000us, min 2000us
#define tResetSink                  3000UL  // 3000us, min 2000us
#define tResetSinkMin               2000UL  // 2000us, min 2000us

#define tACKReceive                 8UL     // 8ms, max 10 ms
#define tACKtransmit                1UL     // 1ms, min 100us
#define tRetry                      300UL   // 300us, max 500us
#define tSenderResponse             49UL    // 49ms, max 50ms
#define tReceiverResponse           39UL    // 39ms, max 40ms
#define tPowerTransitSrc            20UL    // 20ms
#define tPowerSupplySrc             250//300UL   // 300ms, max 550ms
#define tPowerSupplySnk             500UL   // 500ms, max 550ms
#define tCableInfoResponse          1199UL  // 1199ms, max 1200ms
#define tRestartTrans               1099UL  // 1099ms, max 1100ms
#define tCableTrans                 999UL   // 999ms, max 1000ms
#define tMsgTransDelay              2UL     // 2ms, min 2ms

#define tSrcOutputDisabled          80UL  // 120ms, min 100ms
#define tSnkDetDisabledSrcOutput    90UL  // 150ms, min 100ms

#define tSnkPowerSupplyReq          500UL   // 500ms

#pragma pack()


#endif /* #ifndef __UFCS_TIMER_DEFS_H_ */

