コード例 #1
0
ファイル: main.c プロジェクト: CaptFrank/CC3200-Linux-SDK
//*****************************************************************************
//
//! \brief set Timer for transmitting udp packets for desired time.
//!
//! \param none
//!
//! \return handle for the Timer setup
//
//*****************************************************************************
cc_hndl SetTimer()
{
    cc_hndl tTimerHndl;
    struct cc_timer_cfg sLowResTimer;
    struct u64_time sInitTime, sIntervalTimer;

    sInitTime.secs = 0;
    sInitTime.nsec = 0;
    cc_rtc_set(&sInitTime);

    sLowResTimer.source = HW_REALTIME_CLK;
    sLowResTimer.timeout_cb = TimerCallback;
    sLowResTimer.cb_param = NULL;

    tTimerHndl = cc_timer_create(&sLowResTimer);

    sIntervalTimer.secs = TRAFFIC_DUR_SEC;
    sIntervalTimer.nsec = TRAFFIC_DUR_NSEC;
    cc_timer_start(tTimerHndl, &sIntervalTimer, OPT_TIME_ABS_VALUE);
    return(tTimerHndl);
}
コード例 #2
0
ファイル: main.c プロジェクト: bigcat26/cc3200-sdk
//*****************************************************************************
//
//! \brief set Timer as a wake up source from low power modes.
//!
//! \param none
//!
//! \return handle for the Timer setup as a wakeup source
//
//*****************************************************************************
cc_hndl SetTimerAsWkUp()
{
    cc_hndl tTimerHndl;
    struct cc_timer_cfg sRealTimeTimer;
    struct u64_time sInitTime, sIntervalTimer;
    //
    // setting up Timer as a wk up source and other timer configurations
    //
    sInitTime.secs = 0;
    sInitTime.nsec = 0;
    cc_rtc_set(&sInitTime);

    sRealTimeTimer.source = HW_REALTIME_CLK;
    sRealTimeTimer.timeout_cb = TimerCallback;
    sRealTimeTimer.cb_param = NULL;

    tTimerHndl = cc_timer_create(&sRealTimeTimer);

    sIntervalTimer.secs = LPDS_DUR_SEC;
    sIntervalTimer.nsec = LPDS_DUR_NSEC;
    cc_timer_start(tTimerHndl, &sIntervalTimer, OPT_TIMER_PERIODIC);
    return(tTimerHndl);
}