iLLD_TC27xC
1.0
|
![]() |
The PORT I/O driver provides several functions to easily configure and read pins. The configuration includes input/output, mode, pad driver strength and state. For referencing the pins and their ports a IfxPort_PinMap is available as well.
In the following sections it will be described, how to integrate the driver into the application framework.
Include following header file into your C code:
Specify the used pins, their modes and (for outputs) the pad driver strength:
Note: For inputs the pad driver strength is only a dummy.
Note: the IfxPort_* pins are defined in IfxPort_PinMap
Assemble the final configuration structure:
Call the initialisation function:
Now the pins are configured as specified.
Generally, you can use one function for both inputs and outputs to set the desired mode.
For inputs use the IfxPort_setPinModeInput function:
For outputs use the IfxPort_setModeOutput function:
If the pin is an output, the pad driver should be configured as well:
Read the state of a single pin:
Generally, you can use one function to set an output pin high or low or to toggle it.
An output pin can be set high as following:
An output pin can be set low as following:
Enable emergency stop for P33.0:
The driver also provides a function to disable this feature.