/*********************************************************************
 *
 *        Filename:  mtimer_drv.h
 *
 *         Created:  2022-04-28 02:19:34 PM
 *   Last Modified:  2022-04-28 02:19:34 PM
 *          Author:  xinxin.li
 *    Organization:  Beijing Smart Logic Technology Co., Ltd.
 *
 *     Description:
 *
 *
 ********************************************************************/

#ifndef __MTIMER_DRV_H__
#define __MTIMER_DRV_H__

#include "ucp_drv_common.h"

typedef enum _tagMtimerMaskId
{
	MTIMER_MASK_32BIT	= 0,
	MTIMER_MASK_48BIT	= 1,
	MTIMER_MASK_62BIT	= 2
}MtimerMaskId;


uint32_t mtimer_get_baseaddr(uint8_t nTmrId);
int32_t mtimer_para_init(uint8_t nTmrId, int32_t nScsId, int32_t nTddSlotNum);
int32_t mtimer_clear_all_event(uint8_t nTmrId);
int32_t set_mtimer_period(uint8_t nTmrId, uint32_t nTmrL, uint32_t nTmrM, uint32_t nTmrH);
int32_t set_mtimer_1pps_scratch(uint8_t nTmrId);
// nTmrPoint: us as unit
int32_t set_mtimer_tmrpoint(uint8_t nTmrId, uint8_t nPointId, int32_t nTmrPoint, uint8_t mask);
int32_t enable_mtimer_tmrpoint_int(uint8_t nTmrId, uint8_t nPointId, uint8_t nIntcId);
int32_t disable_mtimer_tmrpoint_int(uint8_t nTmrId, uint8_t nPointId, uint8_t nIntcId);
int32_t enable_mtimer_cevent_int(uint8_t nTmrId, uint8_t nCEvtId, uint8_t nIntcId);

int32_t set_cpri_tmr_ctrl();

int32_t start_mtimer(uint8_t nTmrId);

int32_t stop_mtimer(uint8_t nTmrId);

uint64_t get_mtimer_rt_scr_value(uint8_t nTmrId);

#endif

