4.20. PORT Module
4.20.1. Acronyms and Definitions
Abbreviation/Term |
Explanation |
---|---|
AUTOSAR |
Automotive Open System Architecture |
RTE |
Runtime Environment |
BSW |
Basic Software |
GPIO |
General Purpose Input Output |
ADC |
Analogue Digital Converter |
MCU |
Micro Controller Unit |
OS |
Operating System |
API |
Application Programming Interface |
HW |
Hardware |
SW |
Software |
4.20.2. Introduction
This document describes MCAL PORT Driver functionality, its application interfaces and configuration details as per AUTOSAR version 4.3.1
Supported AUTOSAR Release |
4.3.1 |
Supported Configuration Variants |
Pre-Compile, Post-build |
Vendor ID |
PORT_VENDOR_ID (44) |
Module ID |
PORT_MODULE_ID (124) |
Supported Platform |
AM263Px |
4.20.3. Functional Overview
The Port driver module is an I/O driver in AUTOSAR Basic Software (BSW) layer. PORT driver provide the services for initializing the whole PORT structure of the microcontroller. It is used to assign various functionalities to Port and port pins (e.g. GPIOs, ADC, SPI and other peripheral modes)
4.20.3.1. PORT Driver Architecture
The following figure shows where the PORT is located in the AUTOSAR architecture

Fig. 4.84 PORT in AUTOSAR architecture
4.20.3.2. Initialization
Port_Init API initializes the PORT driver and does pin configuration of specified PORT PIN Id’s. Port_Init also enables all pins for specified module selected in the config structure passed to Port_Init.
4.20.3.3. States
No state is maintained in the PORT driver.
4.20.3.4. Assumptions
None
4.20.3.5. Limitations
The Pins which are configured as GPIO, the parameter “PortInputOverrideCtrl” and “PortOutputOverrideCtrl” should be as disabled.

Fig. 4.85 Configuration settings
4.20.3.6. Design overview
Will be updated in future release:
4.20.4. Hardware Features
4.20.4.1. IP Supported Features
Configuring the pins for rising and/or falling edge, specified for each GPIO pin.
Configuring the GPIO signal conditioning chain
Invert/Non-invert
Signal Qualification:
Asynchronous input
Synchronize to SYSCLK
Qualification using sampling window
Enabling all pins of specified peripheral for given mode of operation. This option provides a way configuring all pins for a peripheral for required mode of operation.
GPIO Channel/Bank Interrupt notification is supported for Rising, Falling and Both edge interrupts.
4.20.4.2. AUTOSAR Supported Features
The PORT Driver module shall initialize the whole port structure of the microcontroller.
The PORT Driver module shall allow the configuration of different functionality for each port and port pin. e.g. ADC, SPI, DIO etc.
The PORT Driver module shall provide additional configurations for the MCU port/port pins:
Pin direction (input/output)
Pin level initial value
Pin direction changeable during runtime (yes/no)
Port mode changeable during runtime
The PORT Driver module shall provide a number of optional configurations for the MCU ports and port pins (if supported by hardware):
Slew rate control
Activation of internal pull-ups
Type of Readback support (pin level,output register value)
4.20.4.3. Not Supported Features
None
4.20.5. Source files
Description of static files is provided below:
📦AM263Px
┣ 📂build
┣ 📂mcal
┃ ┣ 📂Port
┃ ┃ ┣ 📂include
┃ ┃ ┃ ┗ 📜Port.h : Contains the API’s of the PORT driver to be used by upper layers
┃ ┃ ┣ 📂src
┃ ┃ ┃ ┗ 📜Port.c : Contains the implementation of the API’s for PORT driver
┃ ┃ ┣ 📂V0
┃ ┃ ┃ ┣ 📜Port_Irq.h : Contains ISR function declaration
┃ ┃ ┃ ┣ 📜Port_Irq.c : Contains ISR function definitions
┃ ┃ ┃ ┣ 📜Port_Priv.c : Contains Internal functions definition of PORT driver
┃ ┃ ┃ ┗ 📜Port_Priv.h : Contains Internal functions declaration of PORT driver
┃ ┃ ┗ 📜Makefile
┣ 📂mcal_config
┣ 📂mcal_docs
┗ 📜README.txt
Description of generated files is provided below:
Plugin Files |
Descriptions |
---|---|
Port_Cfg.h |
Contains the Precompile switches, Symbolic names of PortPin |
Port_PBcfg.c |
Contains all pins Post-Build Configured parameters for Resolver Package |
Port_Cfg.c |
Contains all pins Pre-Compile Configured parameters |
Port_PBcfg_C.c |
Contains all pins Post-Build Configured parameters for Compatible Package |
Port_PBcfg_SIP.c |
Contains all pins Post-Build Configured parameters for SIP Package |

Fig. 4.86 PORT header file include structure
4.20.6. Module requirements
Will be updated in future release:
4.20.6.1. Memory Mapping
Memory Mapping Sections |
PORT_CODE |
PORT_VAR_ZERO_INIT |
PORT_PBCFG |
---|---|---|---|
PORT_START_SEC_VAR_INIT_UNSPECIFIED (.data) |
x |
||
PORT_STOP_SEC_VAR_INIT_UNSPECIFIED |
x |
||
PORT_START_SEC_CODE (.bss) |
x |
||
PORT_STOP_SEC_CODE |
x |
||
PORT_START_SEC_CONFIG_DATA (.data) |
x |
||
PORT_STOP_SEC_CONFIG_DATA |
x |
||
PORT_START_SEC_ISR_CODE (.bss) |
x |
||
PORT_STOP_SEC_ISR_CODE |
x |
4.20.6.2. Scheduling
There is no scheduling functions in PORT.
4.20.6.3. Error handling
4.20.6.3.1. Development Error Reporting
The module PORT depends on the DET (by default) in order to report development errors. Detection and reporting of development errors can be enabled or disabled by the switch PORT_DEV_ERROR_DETECT = STD_ON in the Port_Cfg.h
AUTOSAR requires that API functions shall check the validity of their respective parameters. These checks are for development error reporting and can be enabled or disabled.
4.20.6.4. Error Code
4.20.6.4.1. Development Errors
The errors reported to DET module are described in the following table:
Type of Error |
Related Error code |
Value (Hex) |
---|---|---|
Invalid Port Pin ID requested. |
PORT_E_PARAM_PIN |
0x0A |
Port Pin not configured as changeable. |
PORT_E_DIRECTION_UNCHANGEABLE |
0x0B |
API Port_Init service called with wrong parameter. |
PORT_E_INIT_FAILED |
0x0C |
API Port_SetPinMode service called when mode is unchangeable.Invalid Mode Passed |
PORT_E_PARAM_INVALID_MODE |
0x0D |
API Port_SetPinMode service called when mode is unchangeable |
PORT_E_MODE_UNCHANGEABLE |
0x0E |
API service called without module initialization. |
PORT_E_UNINIT |
0x0F |
API called with a Null Pointer. |
PORT_E_PARAM_POINTER |
0x10 |
4.20.7. Used resources
4.20.7.1. Interrupt Handling
4.20.7.1.1. GPIO Interrupts
Individual channel Interrupt can be configured with particular channel and it’s being used to detect the rising/falling/both edge occurred on configured channel.

Bank channel Interrupt are the interrupt that can be configured with particular bank and it’s being used to detect the rising/falling/both edge occurred on all channels in configured bank.

Below are the four GPIO XBAR interrupts available.
GPIO Interrupt |
---|
GPIO XBAROUT14 INTR |
GPIO XBAROUT15 INTR |
GPIO XBAROUT16 INTR |
GPIO XBAROUT17 INTR |
The above mentioned 4 GPIO XBAR interrupts should be mapped to Software ISR’s mentioned below:
For Individual Channel Interrupt: Port_Ch<n>Isr , here <n> is between 0 to 138.
For Bank Interrupt: Port_Bnk<m>Isr , here <m> is between 0 to 8.
These all four GPIO cross bar interrupt source can be configured either Individual channel Interrupt or Bank interrupt.
Each GPIO pin is interrupt capable and can be configured in PortDioConfig container in PORT Plugins as shown below.

The PORT module depends on MCU module for the configuration of Channel/Bank Interrupt. All above 4 GPIO interrupts should be configured by MCU driver before usage. McuGpioXbarIntrConfiguration container from MCU plugins can be used to do to the same.

GPIO interrupt API’s:
APIs |
Description |
---|---|
Port_PinEnableIntrNotification |
This function is Non- Autosar based and is used to enable bank/channel GPIO Interrupts for particular channel |
Port_PinDisableIntrNotification |
This function is Non- Autosar based and is used to disable bank/channel GPIO Interrupts for particular channel |
Port_GetInterruptStatus |
This function is Non- Autosar based and is used to collect interrupt register value for each GPIO bank |
Port_ClearInterruptStatus |
This function is Non- Autosar based and is used to clear interrupt register for each GPIO bank |
Note
Mcu Plugins should be added with Port Plugins while Port configuration files generation.
Each used channel in PortDioConfig container should be configured as a GPIO with INPUT direction.
Please refer PORT Example Application to know more about GPIO Interrupt feature configuration and its usage.
4.20.7.1.2. Hardware - Software - ISR API name mapping
For interrupt notification, ISR is provided in PORT driver. The following interrupt is generated by PORT module. The supported ISR is a part of the Port_Irq.h file.
Following are PORT module ISR’s:
For Individual Channel Interrupt: Port_Ch<\n>Isr , here <n> is between 0 to 138.
For Bank Interrupt: Port_Bnk<m>Isr , here <m> is between 0 to 8.
4.20.7.2. Hardware-Software Mapping
4.20.7.2.1. GPIO Channels Mapping
AM263x have total 139 GPIO pins available which allocated from Bank A(Bank 0) to Bank I(Bank 8). Each Bank contains 16 channels except Bank I(Bank 8).
Bank I contains the 11 channels.
GPIO Banks |
GPIO Channels |
---|---|
BankA / Bank0 |
Channel 0 to channel 15 |
BankB / Bank1 |
Channel 16 to channel 31 |
BankC / Bank2 |
Channel 32 to channel 47 |
BankD / Bank3 |
Channel 48 to channel 63 |
BankE / Bank4 |
Channel 64 to channel 79 |
BankF / Bank5 |
Channel 80 to channel 95 |
BankG / Bank6 |
Channel 96 to channel 111 |
BankH / Bank7 |
Channel 112 to channel 127 |
BankI / Bank8 |
Channel 128 to channel 138 |
4.20.8. Integration description
4.20.8.1. Dependent modules
4.20.8.1.1. DET
This implementation depends on the DET in order to report development errors. The detection of development errors is configurable (ON / OFF). The switch PORT_DEV_ERROR_DETECT will activate or deactivate the detection of all development errors.
4.20.8.1.2. DEM
Note
Dem Event is enable only if $(Module_Name)DemEventParameterRefs is enabled.
4.20.8.1.3. SchM
If multiple AUTOSAR runnables have access to the same Data Store Memory block, the exported AUTOSAR specification enforces data consistency by using an AUTOSAR exclusive area. With this specification, the runnables have mutually exclusive access to the per-instance memory global data, which prevents data corruption. Beside the OS, the BSW Scheduler provides functions that PORT module calls at begin and end of critical sections. This implementation requires 1 level of exclusive access to guard critical sections.
The data consistency mechanism that has to be applied to an ExclusiveArea might be domain, ECU or even project specific. The decision which mechanism has to be applied by RTE / Basic Software Scheduler is taken during ECU integration by setting the Exclusive Area configuration parameter RteExclusiveAreaImplMechanism. This parameter is an input for RTE generator.
For PORT Module, data consistency and exclusive access to critical sections are required for the following sections as shown in the table below:
Exclusive Area Functions used |
PORT Function calling Exclusive Area |
Need for Exclusive Area |
Recommended Exclusive Area Mapping |
---|---|---|---|
PORT_EXCLUSIVE_AREA_0 |
Port_SetPinDirection |
To protect against multiple access for shared resources |
ALL_INTERRUPT_BLOCKING : All interrupts should be blocked as this API’s can be called in the interrupts |
4.20.8.1.4. Callback Notification
Notifications:
As it is a configurable interface, the PORT defines notifications that can be mapped to callback functions provided by other modules. The mapping is not statically defined by the PORT but can be performed at configuration time. The function prototypes that can be used for the configuration have to match the appropriate function prototype signatures, described below:
PortDioInterruptNotification:
This is of type Port_IsrNotificationType which is defined in Port_Cfg.h file. This is called to notify the group about the completion of the requested conversion and availability of the conversion results.
4.20.8.2. Multi-core support
Not Supported
4.20.9. Configuration
4.20.9.1. PortConfigSet
This container contains the multiple configuration set and sub containers of the AUTOSAR Port module
4.20.9.1.1. PortContainer
Container collecting the PortPins.
4.20.9.1.1.1. PortNumberOfPortPins
Item |
|
---|---|
Name |
PortNumberOfPortPins |
Description |
The number of specified PortPins in this PortContainer. |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
147 |
Max-value |
65535 |
Min-value |
1 |
4.20.9.1.2. PortPin
Configuration of the individual port pins.
4.20.9.1.2.1. PortPinPeripheral
Item |
|
---|---|
Name |
PortPinPeripheral |
Description |
Select peripheral of interest to narron down list of pins of interest |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Range |
CPTS0 |
4.20.9.1.2.2. PortPinPeripheralSignal
Item |
|
---|---|
Name |
PortPinPeripheralSignal |
Description |
Select specific peripheral signal pin of interest |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Range |
CHANNEL0 |
4.20.9.1.2.3. PortPinName
Item |
|
---|---|
Name |
PortPinName |
Description |
PAD IO name of the selected pin |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Range |
PIN_P1 |
4.20.9.1.2.4. PortPinId
Item |
|
---|---|
Name |
PortPinId |
Description |
Pin Id of the port pin. This value will be assigned to the symbolic name derived from the port pin container short name. |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
1 |
4.20.9.1.2.5. PortPinIdAddr
Item |
|
---|---|
Name |
PortPinIdAddr |
Description |
Pin Id of the port pin. This value will be assigned to the symbolic name derived from the port pin container short name. |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
1 |
4.20.9.1.2.6. PortPinDirection
Item |
|
---|---|
Name |
PortPinDirection |
Description |
The initial direction of the pin (IN or OUT). If the direction is not changeable, the value configured here is fixed. |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
PORT_PIN_DEFAULT |
Range |
PORT_PIN_IN |
4.20.9.1.2.7. PortPinDirectionChangeable
Item |
|
---|---|
Name |
PortPinDirectionChangeable |
Description |
Parameter to indicate if the direction is changeable on a port pin during runtime. |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
false |
4.20.9.1.2.8. PortPinInitialMode
Item |
|
---|---|
Name |
PortPinInitialMode |
Description |
Port pin mode from mode list for use with Port_Init() function. |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
CPTS0 |
Range |
CPTS0 |
4.20.9.1.2.9. PortPinLevelValue
Item |
|
---|---|
Name |
PortPinLevelValue |
Description |
Port Pin Level value from Port pin list. |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
PORT_PIN_LEVEL_HIGH |
Range |
PORT_PIN_LEVEL_HIGH |
4.20.9.1.2.10. PortPinMode
Item |
|
---|---|
Name |
PortPinMode |
Description |
Port pin mode from mode list. |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Pre-Compile Time |
VARIANT-PRE-COMPILE |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
TCK_MUXMODE_0 |
Range |
OSPI0_CSn0_MUXMODE_0 |
4.20.9.1.2.11. PortPinModeChangeable
Item |
|
---|---|
Name |
PortPinModeChangeable |
Description |
Parameter to indicate if the mode is changeable on a port pin during runtime. True: Port Pin mode changeable allowed. False: Port Pin mode changeable not permitted. |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
false |
4.20.9.1.2.12. PortPinInhibitEnable
Item |
|
---|---|
Name |
PortPinInhibitEnable |
Description |
The port pin inhibit enable. |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
PORT_PIN_PULL_INHIBIT_DISABLE |
Range |
PORT_PIN_PULL_INHIBIT_ENABLE |
4.20.9.1.2.13. PortPullTypeSelect
Item |
|
---|---|
Name |
PortPullTypeSelect |
Description |
Type of PULL U/D selection |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
PORT_PIN_PULLTYPE_PULLDOWN |
Range |
PORT_PIN_PULLTYPE_PULLDOWN |
4.20.9.1.2.14. PortPinHSmasterEnable
Item |
|
---|---|
Name |
PortPinHSmasterEnable |
Description |
Parameter to enable HSMASTER |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
false |
4.20.9.1.2.15. PortPinHSmodeEnable
Item |
|
---|---|
Name |
PortPinHSmodeEnable |
Description |
Parameter to enable HSMODE |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
false |
4.20.9.1.2.16. PortInputInversionSelect
Item |
|
---|---|
Name |
PortInputInversionSelect |
Description |
Parameter to select port pin inversion (select value for chosing inverted version of PAD input for chip) |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
PORT_INVTYPE_DEFAULT |
Range |
PORT_INV |
4.20.9.1.2.17. PortQualifierTypeSelect
Item |
|
---|---|
Name |
PortQualifierTypeSelect |
Description |
Parameter to select port Qualifier Type (select value for chosing input qualifer type for PAD.) |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
PORT_QUALTYPE_DEFAULT |
Range |
PORT_SYNC_QUAL |
4.20.9.1.2.18. PortSlewControlSelect
Item |
|
---|---|
Name |
PortSlewControlSelect |
Description |
Slew control configuration |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
PORT_PIN_SLEWCONTROL_FAST_SLEW |
Range |
PORT_PIN_SLEWCONTROL_FAST_SLEW |
4.20.9.1.2.19. PortInputOverrideCtrl
Item |
|
---|---|
Name |
PortInputOverrideCtrl |
Description |
Port inputOverride control (Keep these value as PORT_PIN_DISABLE_INPUT_OVERRIDE while configuring pin as a GPIO) |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
PORT_PIN_INPUT_RETAIN_HW_CTRL |
Range |
PORT_PIN_DISABLE_INPUT_OVERRIDE |
4.20.9.1.2.20. PortOutputOverrideCtrl
Item |
|
---|---|
Name |
PortOutputOverrideCtrl |
Description |
Port OutputOverride control (Keep these value as PORT_PIN_DISABLE_OUTPUT_OVERRIDE while configuring pin as a GPIO) |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
PORT_PIN_OUTPUT_RETAIN_HW_CTRL |
Range |
PORT_PIN_DISABLE_OUTPUT_OVERRIDE |
4.20.9.1.2.21. PortGpioOwnerCore
Item |
|
---|---|
Name |
PortGpioOwnerCore |
Description |
PIN ownership of GPIO. 0 - R5FSS0 Core0, 1 - R5FSS0 Core1, 2 - R5FSS1 Core0, 3 - R5FSS1 Core1 |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
0 |
Max-value |
3 |
Min-value |
0 |
4.20.9.1.3. PortDioConfig
Structure for GPIO Interrupt configuration
4.20.9.1.3.1. PortDioPinNumber
Item |
|
---|---|
Name |
PortDioPinNumber |
Description |
Port GPIO Pin Numbers (0 to 138) |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
0 |
Max-value |
9223372036854775807 |
Min-value |
-9223372036854775808 |
4.20.9.1.3.2. PortPinSelectEdgeTrigger
Item |
|
---|---|
Name |
PortPinSelectEdgeTrigger |
Description |
Type of EdgeTrigger selection |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
PORT_RISING_EDGE |
Range |
PORT_RISING_EDGE |
4.20.9.1.3.3. PortPinSelectInterruptType
Item |
|
---|---|
Name |
PortPinSelectInterruptType |
Description |
Select Interrupt type |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
PORT_BANK_INTR |
Range |
PORT_CHANNEL_INTR |
4.20.9.1.3.4. PortDioInterruptNotification
Item |
|
---|---|
Name |
PortDioInterruptNotification |
Description |
Definition of the Callback function. |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
NULL_PTR |
4.20.9.1.3.5. PortMcuGpioXbarReference
Item |
|
---|---|
Name |
PortMcuGpioXbarReference |
Description |
Reference to the McuGpioXbarIntrConfiguration container |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
4.20.9.2. PortGeneral
Module wide configuration parameters of the PORT driver.
4.20.9.2.1. PortDevErrorDetect
Item |
|
---|---|
Name |
PortDevErrorDetect |
Description |
Switches the Development Error Detection and Notification on or off. |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
true |
4.20.9.2.2. PortDeviceVariant
Item |
|
---|---|
Name |
PortDeviceVariant |
Description |
Select SOC variant .This parameter shall be used by driver to impose device specific constraints. The user guide shall detail the device specific constraints |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
AM263Px |
Range |
AM263Px |
4.20.9.2.3. PortSetPinDirectionApi
Item |
|
---|---|
Name |
PortSetPinDirectionApi |
Description |
Pre-processor switch to enable / disable the use of the function Port_SetPinDirection(). |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
true |
4.20.9.2.4. PortSetPinModeApi
Item |
|
---|---|
Name |
PortSetPinModeApi |
Description |
Pre-processor switch to enable / disable the use of the function Port_SetPinMode(). |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
true |
4.20.9.2.5. PortVersionInfoApi
Item |
|
---|---|
Name |
PortVersionInfoApi |
Description |
Pre-processor switch to enable / disable the API to read out the modules version information. |
Origin |
AUTOSAR_ECUC |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
true |
4.20.9.2.6. PortRefreshPortDirectionApi
Item |
|
---|---|
Name |
PortRefreshPortDirectionApi |
Description |
Pre-processor switch to enable / disable the API to refresh the port direction. |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
true |
4.20.9.2.7. PortDefaultOSCounterId
Item |
|
---|---|
Name |
PortDefaultOSCounterId |
Description |
Default Os Counter Id if node reference to OsCounter ref PortOsCounterRef is not set |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Pre-Compile Time |
VARIANT-PRE-COMPILE |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
0 |
Max-value |
16 |
Min-value |
0 |
4.20.9.2.8. PortSafeTIApi
Item |
|
---|---|
Name |
PortSafeTIApi |
Description |
Enable/Disable SAFETI Configuration register readback. |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
true |
4.20.9.2.9. PortEnableIntrApi
Item |
|
---|---|
Name |
PortEnableIntrApi |
Description |
Pre-processor switch to enable / disable the use of Interrupt Functionality |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
true |
4.20.9.2.10. PortGetIntrStatusApi
Item |
|
---|---|
Name |
PortGetIntrStatusApi |
Description |
Pre-processor switch to enable / disable the use of Port_GetInterruptStatus API |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
true |
4.20.9.2.11. PortClearIntrStatusApi
Item |
|
---|---|
Name |
PortClearIntrStatusApi |
Description |
Pre-processor switch to enable / disable the use of Port_ClearInterruptStatus API |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
true |
4.20.9.2.12. PortTimeoutDuration
Item |
|
---|---|
Name |
PortTimeoutDuration |
Description |
PORT timeout - used in PORT busy wait |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
32000 |
Max-value |
4294967295 |
Min-value |
1 |
4.20.9.2.13. PortTypeofInterruptFunction
Item |
|
---|---|
Name |
PortTypeofInterruptFunction |
Description |
Type of ISR function |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
PORT_ISR_CAT1 |
Range |
PORT_ISR_VOID |
4.20.9.2.14. PortGpioHostCoreId
Item |
|
---|---|
Name |
PortGpioHostCoreId |
Description |
R5F CPU ownership of GPIO. 0 - R5FSS0 Core0, 1 - R5FSS0 Core1, 2 - R5FSS1 Core0, 3 - R5FSS1 Core1 |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
Default-value |
0 |
Max-value |
3 |
Min-value |
0 |
4.20.9.2.15. PortOsCounterRef
Item |
|
---|---|
Name |
PortOsCounterRef |
Description |
This parameter contains a reference to the OsCounter, which is used by the PORT driver. |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Pre-Compile Time |
VARIANT-PRE-COMPILE |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Pre-Compile-Time |
VARIANT-PRE-COMPILE |
4.20.9.3. Port Plugins
AM263Px Port have 3 different plugins.
Resolver Package |
Port_TI_AM263Px |
Compatible Package |
Port_TI_AM263Px_C |
SIP Package |
Port_TI_AM263Px_SIP |
User should load only one package plugin in EB Tresos at a given point of time to successfully generate the output.
Note
PortDioConfig container is specifically used only to configure the GPIO interrupt feature parameters.
To use the GPIO interrupt feature, user should configure the required GPIO channels in PortDioConfig container.
4.20.9.4. Steps To Configure Port Module
Open EB Tresos configurator tool and Select the Config Variant ( Precompile/Post-Build) and Device Variant ( Pin Package ) parameters
Go to Port Container tab and create a new container
Open the created container and go to PortPin container to create a portPin configuration. ( Multiple PortPin configurations can be created )
Open the created Port pin, and configure the pin parameters
Select the Port pin peripheral instance ( Mode ) which needs to be configured and accordingly select the Peripheral Signal. As per selected Signal, physical pin ID needs to be selected from the list
Configure the other parameters as per pin usage.
Open Port pin Mode tab and add the default port pin mode ( at least one mode is required for this field ). Other supported modes for that pin can also be configured if user needs to change the mode for the pin afterwards.
Configure the number of port pins in port container general tab
Save the configuration and generate the configuration.
4.20.10. Examples
The example application demonstrates use of Port module, the list below identifies key steps performed in the example.
4.20.10.1. Overview
Port Example:
Initialize clock using Mcu_Init()
Initialize port using Port_Init()
Configure Gpio Interrupt
Test Port Interrupt Functionality
Set Port pin direction of GPIOGH_120 to PORT_PIN_OUT using Port_SetPinDirection()
Read the Port pin channel level using Dio_ReadChannel()
Toggle the channel level using Dio_FlipChannel()
Verify the read result
4.20.10.2. Setup required to run example
PORT module is tested using CC board (PROC111E2).
4.20.10.3. How to run examples
4.20.10.3.1. Steps to build and run example
PORT example application demonstrating the MCAL PORT driver features is in folder <MCAL_ROOT>/examples/Port.
This application can be built from the root folder by giving gmake –s port_app PLATFORM=am263px.
Once the build is completed we get a binary file, which is loaded in our controller and executed.
4.20.10.3.2. Configuration used to test this example
Pin configurations : Following pins are configured as a GPIO and used in example application to test.
Pin Ball Number |
Pin Signal Name |
---|---|
C15 |
GPIOGH_120 |
B8 |
GPIOAB_21 |
4.20.10.4. Sample Log
PORT Example application logs with Resolver Package.
CLANG compiled : portApp: Sample Application - STARTS !!!
Port Driver version info:9.1.0
Port Driver Module/Driver:124.44
Pin Value for channel 120 : 1
Dio_FlipChannel(channel_120)
Pin Value for channel 120 : 0
Dio_FlipChannel(channel_120)
Pin Value for channel 120 : 1
Pin Value for channel 120 : 1
Dio_FlipChannel(channel_120)
Pin Value for channel 120 : 1
PORT Test Passed!!!
PORT Example application logs with Compatible Package.
Note
Please change the GPIO_PIN_ID macro value as per generated configuration while testing with compatible package.
þCLANG compiled : portApp: Sample Application - STARTS !!!
Port Driver version info:9.1.0
Port Driver Module/Driver:124.44
Pin Value for channel 120 : 1
Dio_FlipChannel(channel_120)
Pin Value for channel 120 : 0
Dio_FlipChannel(channel_120)
Pin Value for channel 120 : 1
Pin Value for channel 120 : 1
Dio_FlipChannel(channel_120)
Pin Value for channel 120 : 1
PORT Test Passed!!!
4.20.10.5. File Structure
📦AM263Px
┣ 📂build
┣ 📂mcal
┃ ┣ 📂examples
┃ ┃ ┣ 📂Port
┃ ┃ ┃ ┣ 📂soc
┃ ┃ ┃ ┣ 📜Portapp.c : Contains Port test example
┃ ┃ ┃ ┗ 📜Makefile
┃ ┣ 📂examples_config
┃ ┃ ┣ 📂Port_Demo_Cfg
┃ ┃ ┃ ┗ 📂soc
┃ ┃ ┃ ┃ ┣ 📂am263px
┃ ┃ ┃ ┃ ┃ ┗ 📂r5f0_0
┃ ┃ ┃ ┃ ┃ ┃ ┣ 📂include
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗📜Port_Cfg.h : Contains the configuration parameters
┃ ┃ ┃ ┃ ┃ ┃ ┗ 📂src
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣📜Port_Cfg.c : Contains all Pre-Compile Configured parameters
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣📜Port_PBcfg.c : contains all Post build configured parameters
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣📜Port_PBcfg_C.c : Contains all Post Build Configured parameters
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗📜Port_PBcfg_CAN.c : contains all Post Build configured parameters
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣📜Port_PBcfg_Intr.c : Contains all Pre-Compile Configured parameters
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣📜Port_PBcfg_LIN.c : contains all Post build configured parameters
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣📜Port_PBcfg_Ospi.c : Contains all Post Build Configured parameters
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣📜Port_PBcfg_SIP.c : Contains all Post Build Configured parameters
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗📜Port_PBcfg_UART0.c : contains all Post Build configured parameters
┃ 📂mcal_config
┃ 📂mcal_docs
┗ 📜README.txt