Dynamically Changing the Drive Mode of Port Pins in PSoC3/5

Question: How can I change the drive mode of port pins of PSoC3/5 in Firmware dynamically?

 

Answer:

When a Port pin is placed in the schematic (Top Design) and compiled, PSoC Creator generates API for controlling the behavior of the pins.  The drive modes of Port Pins can be changed by using API function "<Pin Name>_SetDriveMode(uint mode)". For example, if the name of the port pin is "Pin_1", the function will be named as "Pin_1_SetDriveMode()".

Please refer <Pin Name>.h file to get the names of various Macros to select the particular Drive Mode.

In the pin configuration window, remember to select the "Contiguous" option under Mapping.