Does modustoolbox device configurator create the peripheral init structure?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Rodo
Level 4
Level 4
10 likes given 100 sign-ins 5 solutions authored

Hi,

I'm new to psoc 6. Somewhere in the PSoC 6 Peripheral Driver Library Documentation I read that peripherals need to be initialized. I'm wondering what do the settings in the device configurator (DC) actually do. If I setup a TCPWM (single shot) in DC, I still need to use Cy_TCPWM_Counter_Init() to initialize it, don't I? Does DC creates the configuration structure that I need to use in the function? Where can I find the name of the structure (if created by DC)? if not, what does DC actually do?

Thanks 

0 Likes
1 Solution
Arpit_S
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 250 sign-ins

Hi @Rodo ,

 

In Device configurator you actually configure the block that you are using. Say you are using PWM, then when you open PWM’s configurator you will configure parameters like PWM Mode, PWM Resolution, Run Mode, PWM Alignment, Compare, Period etc. and select PWM output line, PWM_n output line etc.

After specifying all these parameters while writing the code, you call functions like Cy_TCPWM_PWM_Init(). This function call will initialize the PWM with the parameters that you have specified in the device configurator and the register values will be changed accordingly.

After you call Init() function, All the data will be stored in cy_stc_tcpwm_pwm_config_t Struct. It has various data fields like pwmMode, pwmAlignment, runMode, clockPrescalar etc. Please find more information about cy_stc_tcpwm_pwm_config_t Struct at https://infineon.github.io/psoc6pdl/pdl_api_reference_manual/html/structcy__stc__tcpwm__pwm__config_...

For more information, you can refer to https://infineon.github.io/psoc6pdl/pdl_api_reference_manual/html/group__group__tcpwm.html

 

Kind regards

Arpit Srivastav

View solution in original post

1 Reply
Arpit_S
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 250 sign-ins

Hi @Rodo ,

 

In Device configurator you actually configure the block that you are using. Say you are using PWM, then when you open PWM’s configurator you will configure parameters like PWM Mode, PWM Resolution, Run Mode, PWM Alignment, Compare, Period etc. and select PWM output line, PWM_n output line etc.

After specifying all these parameters while writing the code, you call functions like Cy_TCPWM_PWM_Init(). This function call will initialize the PWM with the parameters that you have specified in the device configurator and the register values will be changed accordingly.

After you call Init() function, All the data will be stored in cy_stc_tcpwm_pwm_config_t Struct. It has various data fields like pwmMode, pwmAlignment, runMode, clockPrescalar etc. Please find more information about cy_stc_tcpwm_pwm_config_t Struct at https://infineon.github.io/psoc6pdl/pdl_api_reference_manual/html/structcy__stc__tcpwm__pwm__config_...

For more information, you can refer to https://infineon.github.io/psoc6pdl/pdl_api_reference_manual/html/group__group__tcpwm.html

 

Kind regards

Arpit Srivastav