How to initialise peripherals

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to initialise peripherals

跳至解决方案
612 次查看
ArkAndyFraser
Contributor III

Having got frustrated with RTD, I have dropped back to S32DS 3.4 and SDK for my project.

One thing that I have not figured out with the SDK is how to configure the hardware drivers given the code automatically generated. Where is it documented how you initialise the drivers in your code?

As an example, I have assigned an FTM channel as input capture and generated the code. I now have peripherals_flexTimer_ic_1.c and peripherals_flexTimer_ic_1.h. 

In the peripherals_flexTimer_ic_1.c file I can see:

ftm_user_config_t flexTimer_ic_1_InitConfig = ...
ftm_input_param_t flexTimer_ic_1_InputCaptureConfig = ...
ftm_input_ch_param_t flexTimer_ic_1_InputCaptureChannelConfig[1] = ...

Where is it documented how I use these configuration structures?

I can see in SDK/platform/drivers/src/ftm/ftm_common.c the FTM_DRV_Init function which takes ftm_user_config_t which is defined in the generated code but also takes ftm_state_t which does not appear to exist in the generated code!

I also see FTM_DRV_InitInputCapture in ftm_ic_driver.c which takes ftm_input_param_t which is in the generated code.

So, where is it documented which of these initialisation functions need to be called?

Andy

0 项奖励
回复
1 解答
595 次查看
ArkAndyFraser
Contributor III

I guess the example code is the primary documentation for using the SDK.

A

在原帖中查看解决方案

0 项奖励
回复
2 回复数
606 次查看
ArkAndyFraser
Contributor III

Okay, I think I have figured out that ftm_state_t is returned *from* FTM_DRV_Init.

But again, where is this documented?

Andy

0 项奖励
回复
596 次查看
ArkAndyFraser
Contributor III

I guess the example code is the primary documentation for using the SDK.

A

0 项奖励
回复