Platform/ECM3532/M3/hw/hal/common/timer/src/timer_hal.c
/**
 * Create new Timer instance, timer can be oneshort or periodic, base on
 * iTmrType value, period of timer will be ui32TmrPrd.
 * Create API return Handle of newly created timer, that need to be pass
 * to start API
 *
 *
 * @param iTmrCh timer channel
 * @param iTmrType timer type one short or periodic
 * @param ui32TmrPrd Period of new created timer
 * @param fCbFunc timer callback function, will be called after tiemr expiry
 * @param vArg agrument of callback function to be called with
 *
 * @return on sucess tHalTmrHandle handle of newly create timer, NULL on error
 */
Create new Timer instance, timer can be oneshort or periodic, base on
iTmrType value, period of timer will be ui32TmrPrd.
Create API return Handle of newly created timer, that need to be pass
to start API



@return on sucess tHalTmrHandle handle of newly create timer, NULL on error
Create new Timer instance timer can be oneshort or periodic base on iTmrType value period of timer will be ui32TmrPrd . Create API return Handle of newly created timer that need to be pass to start API @return on sucess tHalTmrHandle handle of newly create timer NULL on error
tHalTmr * HalTmrCreate(tHalTmrCh iTmrCh, tHalTmrType iTmrType,
                            uint32_t ui32TmrPrd,
                            tHalTmrCb fCbFun, void *vArg)
{
    struct sDevTmr *sDev;
    tHalTmr *sHalNewTmr;
    sDev= TmrGetDev(iTmrCh);
    if(sDev == NULL)
        return NULL;
    sHalNewTmr =
        (tHalTmr *)pvPortMalloc(sizeof(tHalTmr));
    if(sHalNewTmr == NULL)
        return NULL;
    memset(sHalNewTmr,0,sizeof(tHalTmr));
    sHalNewTmr->iTmrTyp = iTmrType;
    sHalNewTmr->ui32TmrPrd = ui32TmrPrd;
    sHalNewTmr->fTmrCb = fCbFun;
    sHalNewTmr->vCbArg = vArg;
    sHalNewTmr->sDev = sDev;
    sHalNewTmr->sLink.tqe_prev = NULL;
    return sHalNewTmr;
}
tHalTmr * HalTmrCreate ( tHalTmrCh iTmrCh , tHalTmrType iTmrType , uint32_t ui32TmrPrd , tHalTmrCb fCbFun , void * vArg ) { struct sDevTmr * sDev ; tHalTmr * sHalNewTmr ; sDev = TmrGetDev ( iTmrCh ) ; if ( sDev == NULL ) return NULL ; sHalNewTmr = ( tHalTmr * ) pvPortMalloc ( sizeof ( tHalTmr ) ) ; if ( sHalNewTmr == NULL ) return NULL ; memset ( sHalNewTmr , 0 , sizeof ( tHalTmr ) ) ; sHalNewTmr -> iTmrTyp = iTmrType ; sHalNewTmr -> ui32TmrPrd = ui32TmrPrd ; sHalNewTmr -> fTmrCb = fCbFun ; sHalNewTmr -> vCbArg = vArg ; sHalNewTmr -> sDev = sDev ; sHalNewTmr -> sLink . tqe_prev = NULL ; return sHalNewTmr ; }
Create new Timer instance, timer can be oneshort or periodic, base on
 iTmrType value, period of timer will be ui32TmrPrd.
Create new Timer instance timer can be oneshort or periodic base on iTmrType value period of timer will be ui32TmrPrd .