Driver API for PORT (plib_port.h) More...
Macros | |
| #define | PORT_PLIB_OK (0) |
| Operation completed successfully. | |
| #define | PORT_PLIB_ERROR (-1) |
| Unspecified error occurred. | |
| #define | PORT_PLIB_ERROR_BUSY (-2) |
| Resource is busy. | |
| #define | PORT_PLIB_ERROR_TIMEOUT (-3) |
| Operation timed out. | |
| #define | PORT_PLIB_ERROR_UNSUPPORTED (-4) |
| Operation is not supported. | |
| #define | PORT_PLIB_ERROR_PARAMETER (-5) |
| Invalid parameter provided. | |
| #define | PORT_PLIB_ERROR_SPECIFIC (-6) |
| Specific error code for driver implementation. | |
Typedefs | |
| typedef uint32_t | PORT_PIN |
| GPIO pin identifier. | |
Enumerations | |
| enum | GPIO_DIRECTION { GPIO_INPUT , GPIO_OUTPUT } |
| GPIO port pin direction. More... | |
| enum | GPIO_OUTPUT_MODE { GPIO_PUSH_PULL , GPIO_OPEN_DRAIN } |
| GPIO output mode. More... | |
| enum | GPIO_PULL_RESISTOR { GPIO_PULL_NONE , GPIO_PULL_UP , GPIO_PULL_DOWN } |
| GPIO pull resistor configuration. More... | |
| enum | PORT_EVENT_INPUT_CHANNEL { PORT_EVENT_INPUT_CHANNEL_0 = PORT_EVCTRL_PORTEI0_Pos , PORT_EVENT_INPUT_CHANNEL_1 = PORT_EVCTRL_PORTEI1_Pos , PORT_EVENT_INPUT_CHANNEL_2 = PORT_EVCTRL_PORTEI2_Pos , PORT_EVENT_INPUT_CHANNEL_3 = PORT_EVCTRL_PORTEI3_Pos } |
| GPIO port event input channel. More... | |
| enum | PORT_EVENT_ACTION { PORT_EVENT_ACTION_OUT , PORT_EVENT_ACTION_SET , PORT_EVENT_ACTION_CLR , PORT_EVENT_ACTION_TGL } |
| GPIO port event action. More... | |
| enum | PORT_PERIPHERAL_FUNCTION |
| GPIO port peripheral function selection. More... | |
Driver API for PORT (plib_port.h)
| #define PORT_PLIB_ERROR (-1) |
Unspecified error occurred.
| #define PORT_PLIB_ERROR_BUSY (-2) |
Resource is busy.
| #define PORT_PLIB_ERROR_PARAMETER (-5) |
Invalid parameter provided.
| #define PORT_PLIB_ERROR_SPECIFIC (-6) |
Specific error code for driver implementation.
| #define PORT_PLIB_ERROR_TIMEOUT (-3) |
Operation timed out.
| #define PORT_PLIB_ERROR_UNSUPPORTED (-4) |
Operation is not supported.
| #define PORT_PLIB_OK (0) |
Operation completed successfully.
GPIO pin identifier.
GPIO pins are identified by a single numeric value that encodes both the GPIO port and the pin number.
The value of a pin identifier is defined by the device DFP and must be one of the DFP-provided pin macros, for example:
The numeric encoding follows this rule:
Where:
port_index is the zero-based GPIO port number (e.g. PA = 0, PB = 1, PC = 2, ...)pin_number is the pin index within the port (0–31)This encoding allows the driver to determine the GPIO port and pin number using simple arithmetic operations.
| enum GPIO_DIRECTION |
| enum GPIO_OUTPUT_MODE |
| enum GPIO_PULL_RESISTOR |
| enum PORT_EVENT_ACTION |
GPIO port peripheral function selection.
This enumeration specifies the peripheral function assigned to a GPIO pin.