CooCox 1.1.4 on mbed with simple blinky example

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

timer.c File Reference

timer.c File Reference

timer management implementation code of CooCox CoOS kernel. More...

Go to the source code of this file.

Functions

static void InsertTmrList (OS_TCID tmrID)
 Insert a timer into the timer list.
static void RemoveTmrList (OS_TCID tmrID)
 Remove a timer from the timer list.
OS_TCID CoCreateTmr (U8 tmrType, U32 tmrCnt, U32 tmrReload, vFUNCPtr func)
 Create a timer.
StatusType CoStartTmr (OS_TCID tmrID)
 Start counter.
StatusType CoStopTmr (OS_TCID tmrID)
 Stop countering for a spcify timer.
StatusType CoDelTmr (OS_TCID tmrID)
 Delete a timer.
U32 CoGetCurTmrCnt (OS_TCID tmrID, StatusType *perr)
 Get current counter of specify timer.
StatusType CoSetTmrCnt (OS_TCID tmrID, U32 tmrCnt, U32 tmrReload)
 Setting for a specify timer.
void TmrDispose (void)
 Timer counter dispose.
void isr_TmrDispose (void)
 Timer counter dispose in ISR.

Variables

TmrCtrl TmrTbl [CFG_MAX_TMR] = {{0}}
P_TmrCtrl TmrList = Co_NULL
U32 TmrIDVessel = 0

Detailed Description

timer management implementation code of CooCox CoOS kernel.

Version:
V1.1.4
Date:
2011.04.20

INTERNAL FILE,DON'T PUBLIC.

© COPYRIGHT 2009 CooCox

Definition in file timer.c.


Function Documentation

OS_TCID CoCreateTmr ( U8  tmrType,
U32  tmrCnt,
U32  tmrReload,
vFUNCPtr  func 
)

Create a timer.

Parameters:
[in]tmrTypeSpecify timer's type.
[in]tmrCntSpecify timer initial counter value.
[in]tmrReloadSpecify timer reload value.
[in]funcSpecify timer callback function entry.
[out]None
Return values:
E_CREATE_FAILCreate timer fail.
othersCreate timer successful.
Description

This function is called to create a timer.

Definition at line 168 of file timer.c.

StatusType CoDelTmr ( OS_TCID  tmrID )

Delete a timer.

Parameters:
[in]tmrIDSpecify a timer which deleted.
[out]None
Return values:
E_INVALID_IDThe timer id passed was invalid,deleted failure.
E_OKDelete a timer successful.
Description

This function is called to delete a timer which created before.

Definition at line 292 of file timer.c.

U32 CoGetCurTmrCnt ( OS_TCID  tmrID,
StatusType *  perr 
)

Get current counter of specify timer.

Parameters:
[in]tmrIDSpecify timer by ID.
[out]E_INVALID_IDInvalid ID was passed and get counter failure.
[out]E_OKGet current counter successful.
Return values:
Currentcounter of a timer which specify by id.
Description

This function is called to obtain current counter of specify timer.

Definition at line 326 of file timer.c.

StatusType CoSetTmrCnt ( OS_TCID  tmrID,
U32  tmrCnt,
U32  tmrReload 
)

Setting for a specify timer.

Parameters:
[in]tmrIDSpecify timer by ID.
[in]tmrCntSpecify timer counter which need to be set.
[in]tmrReloadSpecify timer reload value which need to be set.
[out]None
Return values:
E_INVALID_IDThe ID passed was invalid,set fail.
E_OKSet timer counter successful.
Description

This function is called to set timer counter and reload value.

Definition at line 359 of file timer.c.

StatusType CoStartTmr ( OS_TCID  tmrID )

Start counter.

Parameters:
[in]tmrIDSpecify a timer which startted.
[out]None
Return values:
E_INVALID_IDThe timer id passed was invalid,can't start timer
E_OKInsert a timer to timer list and start it successful.
Description

This function is called to make a timer start countering.

Definition at line 216 of file timer.c.

StatusType CoStopTmr ( OS_TCID  tmrID )

Stop countering for a spcify timer.

Parameters:
[in]tmrIDSpecify a timer which stopped.
[out]None
Return values:
E_INVALID_IDThe timer id passed was invalid, stop failure.
E_OKStop a timer countering successful.
Description

This function is called to stop a timer from counting.

Definition at line 254 of file timer.c.

static void InsertTmrList ( OS_TCID  tmrID ) [static]

Insert a timer into the timer list.

Parameters:
[in]tmrIDSpecify timer ID which insertted.
[out]None
Return values:
E_INVALID_IDTimer ID passed was invalid,insert fail.
E_OKInsert successful.
Description

This function is called to insert a timer into the timer list.

Definition at line 41 of file timer.c.

void isr_TmrDispose ( void   )

Timer counter dispose in ISR.

Parameters:
[in]None
[out]None
Return values:
None
Description

This function is called to dispose timer counter.

Definition at line 434 of file timer.c.

static void RemoveTmrList ( OS_TCID  tmrID ) [static]

Remove a timer from the timer list.

Parameters:
[in]tmrIDSpecify ID for a timer which removed form timer list.
[out]None
Return values:
None
Description

This function is called to remove a timer from the timer list.

Definition at line 115 of file timer.c.

void TmrDispose ( void   )

Timer counter dispose.

Parameters:
[in]None
[out]None
Return values:
None
Description

This function is called to dispose timer counter.

Definition at line 394 of file timer.c.


Variable Documentation

U32 TmrIDVessel = 0

Timer ID container.

Definition at line 26 of file timer.c.

P_TmrCtrl TmrList = Co_NULL

The header of the TmrCtrl list.

Definition at line 25 of file timer.c.

TmrCtrl TmrTbl[CFG_MAX_TMR] = {{0}}

Table which save timer control block.

Definition at line 24 of file timer.c.