How to initialise peripherals

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to initialise peripherals

Jump to solution
480 Views
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 Kudos
Reply
1 Solution
463 Views
ArkAndyFraser
Contributor III

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

A

View solution in original post

0 Kudos
Reply
2 Replies
474 Views
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 Kudos
Reply
464 Views
ArkAndyFraser
Contributor III

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

A

0 Kudos
Reply