Clk_Init

Clk_Init

Initializes Clock module.

Files

clk.h/clk.c

Prototype

void Clk_Init (const CLK_TASK_CFG *p_task_cfg, MEM_SEG *p_mem_seg, CLK_ERR *p_err);

 

Arguments

p_task_cfg

Pointer to structure for the configuration of the clock task.

See Task Configuration for more details.

p_mem_seg

Memory segment from which internal data will be allocated. If DEF_NULL, will be allocated from the global heap.

See Memory Segments for more details.

p_err

Pointer to variable that will receive the return error code from this function:

CLK_ERR_NONE
CLK_ERR_NOT_NULL_PTR
CLK_ERR_ALLOC
CLK_OS_ERR_INIT_SIGNAL
CLK_OS_ERR_INIT_TASK

Returned Values

None.

Required Configuration

None.

Notes / Warnings

'p_task_cfg' needs to be NULL if CLK_CFG_EXT_EN is set to DEF_ENABLED.

Example Usage

Listing - Clk_Init() Example Usage
static const CLK_TASK_CFG clk_task_cfg = {CLK_TASK_PRIO, CLK_TASK_STK_SIZE, DEF_NULL}; CLK_ERR err; Clk_Init(&clk_task_cfg, DEF_NULL, &err); if (err == CLK_ERR_NONE) { printf("Clock module successfully initialized\n\r"); } else { printf("Clock module initialization failed\n\r"); }