S32 SDK
Pins

Detailed Description

The S32 SDK Pins Driver provides a set of API/services to configure the Port Control and Interrupt IP: PORT.

Hardware background

The Port Control and Interrupt (PORT) module provides support for port control, digital filtering, and external interrupt functions. Most functions can be configured independently for each pin in the 32-bit port and affect the pin regardless of its pin muxing state. There is one instance of the PORT module for each port. Not all pins within each port are implemented on a specific device. The PORT module has the following features:

Driver consideration

The Pins driver is developed on top of the PORT HAL. Pins Driver is designed for:

The graphical user interface for routing functionality consists of two main views: Collapsed View and Pins View.

The Collapsed view is designed for pin routing configuration. The Pin/Signal Selection column displays the list of pins that can be configured for selected Function or Signal. If not configured, "No pin routed" is displayed, which means no user requirement for configuration. You can see the popup menu for setting on/off automatic value. The Direction column contains the list of directions that can be configured for selected function or signal, if direction configuration is supported. For fixed direction signals, the direction text is displayed and grayed-out.

The Pins view allows the configuration of electrical properties of pins and displays all pins. It displays the pad configuration that is available in Processor view where each pin is associated with signal name and function. If you want to view specific pin, use Pin Filter. It filters the User Pin/Signal Name column as shown below. You can also sort the first two columns, Pin and User Pin/Signal Name.

Functional Properties view allows configuration of functional properties on pins. The user graphical interface is mapped over the port control features.

The Driver uses structures for configuration. The user application can use the default for most settings, changing only what is necessary. All port control features are part of data structure configuration.Please see pin_settings_config_t.

This is an example to write a pin configuration:

User number of configured pins
#define NUM_OF_CONFIGURED_PINS 1
Array of pin configuration structures
pin_settings_config_t g_pin_mux_InitConfigArr[NUM_OF_CONFIGURED_PINS] = {
{
.base = PORTE,
.pinPortIdx = 16u,
.passiveFilter = false,
.driveSelect = PORT_LOW_DRIVE_STRENGTH,
.pinLock = false,
.intConfig = PORT_DMA_INT_DISABLED,
.clearIntFlag = false,
}
};
write pins configuration
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

Modules

 Port Control and Interrupts (PORT)
 This module covers the functionality of the PORT peripheral.
 

Data Structures

struct  pin_settings_config_t
 Defines the converter configuration. More...
 

Enumerations

enum  port_data_direction_t { GPIO_INPUT_DIRECTION = 0x0U, GPIO_OUTPUT_DIRECTION = 0x1U, GPIO_UNSPECIFIED_DIRECTION = 0x2U }
 Configures the port data direction Implements : port_data_direction_t_Class. More...
 

Pins DRV.

status_t PINS_DRV_Init (const uint32_t pin_count, const pin_settings_config_t config[])
 Initializes the pins with the given configuration structure. More...
 

Enumeration Type Documentation

Configures the port data direction Implements : port_data_direction_t_Class.

Enumerator
GPIO_INPUT_DIRECTION 

General purpose input direction.

GPIO_OUTPUT_DIRECTION 

General purpose output direction.

GPIO_UNSPECIFIED_DIRECTION 

General purpose unspecified direction.

Definition at line 122 of file pins_driver.h.

Function Documentation

status_t PINS_DRV_Init ( const uint32_t  pin_count,
const pin_settings_config_t  config[] 
)

Initializes the pins with the given configuration structure.

This function configures the pins with the options provided in the provided structure.

Parameters
[in]pin_countthe number of configured pins in structure
[in]configthe configuration structure
Returns
the status of the operation

Definition at line 58 of file pins_driver.c.