High level interface to the Cypress digital routing.
Features
Facilities for runtime manipulation of the on chip routing. The following types of connections are supported:
- Connection from a peripheral to a pin. (A dedicated connection must exist between the pin and the peripheral; see the device datasheet for more details)
- Experimental support for connecting between two on-chip "trigger" terminals.
Quick Start
- cyhal_connect_pin can be used to connect a pin to a peripheral.(A dedicated connection must exist between the pin and the peripheral; see the device datasheet for more details)
- cyhal_disconnect_pin can be used to disconnect a pin from a peripheral. The drive mode will be reset to High-Z after disconnecting
Code Snippets
Snippet 1: Connecting a pin to TCPWM block
The following code snippet demonstrates connecting a GPIO pin to an active TCPWM block on a PSoC 6 device. using the cyhal_connect_pin. It is assumed that the TCPWM is already configured and active.
◆ cyhal_connect_pin()
Connect a pin to a peripheral terminal.
This will route a direct connection from the pin to the peripheral. Any previous direct connection from the pin will be overriden.
See Snippet 1: Connecting a pin to TCPWM block
- Parameters
-
[in] | pin_connection | The pin and target peripheral terminal to be connected |
- Returns
- The status of the connect request
◆ cyhal_disconnect_pin()
Disconnect a peripheral from a pin.
This will also reset the pin's drive mode to High-Z.
- Parameters
-
[in] | pin | The pin to be disconnected |
- Returns
- The status of the disconnect request
◆ cyhal_connect_trigger()
- Warning
- WORK IN PROGRESS. This function is not yet fully implemented.
Connects two digital terminals on the device using any internal interconnect. A single source can drive multiple destinations, but a destination can be driven by only one source. If the destination is already connected, or the connection can not be established an error will be returned.
- Parameters
-
[in] | source | The source of the signal to connect |
[in] | dest | The destination of the signal to connect |
- Returns
- The status of the connect request