Reconfiguring GPIO of PSoC4000S

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

cross mob
YoIs_1298666
Level 5
Level 5
250 sign-ins 100 replies posted 100 sign-ins

Hello,

I have a question about reconfiguration of GPIO of PSoC4000S.

If the GPIO is configured as CapSense:Sns, can we reconfigure it as Digital output or Digital input mode immediately with API?

Best regards,

Yocchi

0 Likes
1 Solution
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi YoIs_1298666​,

Yes you can configure.

Can you please refer to this thread

Dynamically change CapSense pins to Digital Inputs/Outputs

Regards

Alakananda

Alakananda

View solution in original post

0 Likes
5 Replies
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi YoIs_1298666​,

Yes you can configure.

Can you please refer to this thread

Dynamically change CapSense pins to Digital Inputs/Outputs

Regards

Alakananda

Alakananda
0 Likes

Hello Alakananda-san,

Thank you very much.

I ask you some macro.

I know that this is for P2_7.

I have two questions.

    regVal = ((regVal &(~(1u << PIN_NUM * PC2_SHIFT))) | (0u << PIN_NUM * PC2_SHIFT));

I look at the registers TRM and it is written like below.

pastedImage_1.png

Q1:The 0u in "0u << PIN_NUM*PC2_SHIT" is default value. Does the 0u mean "Enables the input buffer"?

CY8C4147AZI-S475 of your sample project have from P4[0] to P4[7].

But,  there are only 4 DMs in the registers TRM. There are not from DM[4] to DM[7].

Q2: Why?

pastedImage_4.png

pastedImage_7.png

Best regards,

Yocchi

0 Likes

Hello Alakananda-san,

I am sorry.

The second question was my mistake.

I refered to PSoC4000S register Technical Reference Manual.

But I must refer to PSoC41000S's register TRM.

Best regards,

Yocchi

0 Likes
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi YoIs_1298666​,

The answer to your first question is YES.

If it is set to 0 it is enabled and if the bit is set to 1 it will be disabled.

Regards

Alakananda

Alakananda
0 Likes

Hello Alakananda-san,

Thank you very much.

I can port this reconfiguration code.

And it can run well.

Best regards,

Yocchi

0 Likes