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

PSoC™ 6 Forum Discussions

Rodo
Level 3
10 questions asked 5 likes given 10 replies posted
Level 3

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
Srivastav
Moderator
Moderator 100 sign-ins 10 likes received 5 likes given
Moderator

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
Srivastav
Moderator
Moderator 100 sign-ins 10 likes received 5 likes given
Moderator

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