Proper hwtimer bsp definition

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Proper hwtimer bsp definition

ソリューションへジャンプ
982件の閲覧回数
jamesmonczynski
Contributor II

I need to change hwtimer2 definition.

After creating my custom k70, the default is:

/* HWTIMER definitions for user applications */

#define BSP_HWTIMER1_DEV        pit_devif

#define BSP_HWTIMER1_SOURCE_CLK (CM_CLOCK_SOURCE_BUS)

#define BSP_HWTIMER1_ID         (0)

#define BSP_HWTIMER2_DEV      lpt_devif

#define BSP_HWTIMER2_SOURCE_CLK (CM_CLOCK_SOURCE_LPO)

#define BSP_HWTIMER2_ID         (0)

because I needed a pit timer, not an lpo, I changed it to:

/* HWTIMER definitions for user applications */

#define BSP_HWTIMER1_DEV        pit_devif

#define BSP_HWTIMER1_SOURCE_CLK (CM_CLOCK_SOURCE_BUS)

#define BSP_HWTIMER1_ID         (0)

#define BSP_HWTIMER2_DEV        pit_devif             //was lpt_devif

#define BSP_HWTIMER2_SOURCE_CLK (CM_CLOCK_SOURCE_BUS) //was (CM_CLOCK_SOURCE_LPO)

#define BSP_HWTIMER2_ID         (1)

I would like to know if this is the proper/standard way of updating the hwtimer definition?

Or, is there another way using the user_config.h to do the same (I couldn't find any setting for hwtimers).

Thanks for any info.

タグ(2)
0 件の賞賛
返信
1 解決策
825件の閲覧回数
RadekS
NXP Employee
NXP Employee

Yes, you can use definitions in twrk70f120m.h file for initialization your own application timer.

On other hand, this definitions are not necessary - they are there just for standardization of hwtimer example code across MCUs portfolio. You can define these values directly in your code or use directly numbers in hwtimer_init() function.

For example:

HWTIMER hwtimer5;

/* Initialize  hwtimer5 */

result = hwtimer_init(&hwtimer5, &pit_devif, 5, 3);

if (MQX_OK != result)

{

    return result;

}


Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
826件の閲覧回数
RadekS
NXP Employee
NXP Employee

Yes, you can use definitions in twrk70f120m.h file for initialization your own application timer.

On other hand, this definitions are not necessary - they are there just for standardization of hwtimer example code across MCUs portfolio. You can define these values directly in your code or use directly numbers in hwtimer_init() function.

For example:

HWTIMER hwtimer5;

/* Initialize  hwtimer5 */

result = hwtimer_init(&hwtimer5, &pit_devif, 5, 3);

if (MQX_OK != result)

{

    return result;

}


Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信
825件の閲覧回数
jamesmonczynski
Contributor II

Thanks, I did not know that.

0 件の賞賛
返信