Peripheral Drivers(Autosar)

Port Driver of Autosaur MCAL layer (S32K1xx MCU)

Motive: To get understanding of what Port Driver in Autosaur MCAL Layer stack do: Done: What is Port Driver in Autosaur? To get understanding of Different Functions and Data Types in Port Driver Module: Their description, their description with respect to parameters that are send to them, and how are those paramters configured via tool. How to configure different pins in autosar, using Port Driver Module. To get familiarity with Usecases and how to use different Port Driver Module APIs in what chronology. Autosar Documentation blogs: Understanding AUTOSAR and its Applications in the Automotive Industry (einfochips.com) AUTOSAR_SWS_BSWGeneral.pdf : This document explains the BSW layer configurtaion What is Port Driver in Autosar? Port Driver is Part of MCAL Layer in BSW layer of Autosar Stack. Port Driver is responsible for initializing and configuration of microcontroller pins and corresponding ports of those pins. Only Initilization part and configuration part. It initializes and configures pins and ports for various functionalities like: ADC, SPI, I2C, Ethernet, PWM and etc. According to alternate function pin mapping configurations of microcontroller. The Pins and ports which are configured by Port Driver Module, are used by the DIO (Digital Input/Output) Driver module. Only the pins and ports which are configured by Port Driver will be used by DIO Driver Module. Port Driver Module Provide following important functional specifications: Direction setting of Microcontroller pins (Input/Output). Initial value setting of microcontroller pin. Activation of Internal Pull-ups for microcontroller pin. Slew Rate control for microcontroller pins. Microcontroller Alternate function/GPIO registers are used by this layer. Important Data Types in Port Driver: Port_ConfigType: Port_PinType: Port_PinDirectionType: Port_PinModeType: Important Functions in Port Driver: Port_Init : Port_SetPinDirection: Port_RefreshPortDirection: Port_SetPinMode Documents to refer for Port Driver. AUTOSAR_SWS_PortDriver.pdf : This specification specifies the functionality, API and the configuration of the AUTOSAR Basic Software module PORT Driver. Important points of Port Driver? This PORT driver module completes the overall configuration and initialization of the port structure which is used in the DIO driver module. Therefore, the DIO driver works on pins and ports which are configured by the PORT driver. Important Data Types in Port Driver: Port_ConfigType: Port_PinType: Port_PinDirectionType: Port_PinModeType: Port_PinConfigType: Port_UnUsedPinConfigType: Port_Ci_Port_Ip_DigitalFilterConfigType: Port_Ci_Port_Ip_PinSettingsConfig: Port_ConfigType: Port_PinType: Port_PinDirectionType: Port_PinModeType: Port_ConfigType: It is a structure, which contains different contents to initialize the pin of the microcontroller as per user configuration. This Structure is used only in Port_Init() API. And the contents of this structure are changed automatically as we change the configurations in PORT Driver in .ebtresos. //This part has to be written more( Explain use configuration examples) Here by user configuration we mean: Input/Out direction, pull up enable or disable and etc. This structure contains the contents which are used for initialization of microcontroller pin. As the initialization of microcontroller pin is different in SoC’s. So, this structure has different contents from SoC to SoC and its content dependent on GPIO/DIO peripheral registers of corresponding microcontroller. S32K3xx typedef struct { uint16 u16NumPins; /**< @brief Number of used pads (to be configured) */ uint16 u16NumUnusedPins; /**< @brief Number of unused pads */ uint16 au16NumImcrs[PORT_NUM_SIUL2_INSTANCES_U8]; /**< @brief Used pads IMCRs number */ const Port_Siul2_UnUsedPinType *pUnusedPads; /**< @brief Unused pad id’s array and SIUL2 instance */ const Port_Siul2_UnUsedPinConfigType *pUnusedPadConfig; /**< @brief Unused pad configuration */ const Port_Siul2_PinConfigType *pUsedPadConfig; /**< @brief Used pads data configuration */ const Port_Siul2_ImcrConfigType *pImcrConfig[PORT_NUM_SIUL2_INSTANCES_U8]; /**< @brief Used pads IMCR configuration */ const uint32 *pau32Port_PinToPartitionMap; /**< @brief Pointer to pin partition mapping */ const uint8 *pau8Port_PartitionList; /**< @brief Pointer to used partitions */ const Siul2_Port_Ip_PinSettingsConfig *IpConfigPtr; /**< @brief Ip configuration */ const Tspc_Port_Ip_ObeGroupConfig *TspcIpConfigPtr; /**< @brief tspc configuration */ } Port_ConfigType; S32K1xx typedef struct { uint16 u16NumPins; /**< @brief Number of used pads (to be configured) */ uint16 u16NumUnusedPins; /**< @brief Number of unused pads */ const uint16 * pUnusedPads; /**< @brief Unused pad id’s array */ const Port_UnUsedPinConfigType * pUnusedPadConfig; /**< @brief Unused pad configuration */ const Port_PinConfigType * pUsedPadConfig; /**< @brief Used pads data configuration */ uint8 u8NumDigitalFilterPorts; /**< @brief Number of configured digital filter ports */ const Port_Ci_Port_Ip_DigitalFilterConfigType * pDigitalFilterConfig; /**< @brief Digital filter ports configuration */ const uint32 *pau32Port_PinToPartitionMap; /**< @brief Pointer to pin partition mapping */ const uint8 *pau8Port_PartitionList; /**< @brief Pointer to used partitions */ const Port_Ci_Port_Ip_PinSettingsConfig *IpConfigPtr; /**< @brief Ip configuration */ } Port_ConfigType; For now, we will focus on data structure elements of S32K1xx. u16NumPins : Number of pins which are configured u16NumUnusedPins : Number of unsused pins left( uint16 * pUnusedPads: const Port_UnUsedPinConfigType * pUnusedPadConfig: Port_PinConfigType * pUsedPadConfig: u8NumDigitalFilterPorts: Port_Ci_Port_Ip_DigitalFilterConfigType * pDigitalFilterConfig uint32 *pau32Port_PinToPartitionMap: uint8 *pau8Port_PartitionList: Port_Ci_Port_Ip_PinSettingsConfig *IpConfigPtr: Port_PinType: Use for symbolic name of a Port Pin. Sybolic name is the pin count of that pin. Port_PinDirectionType: Tab Content Port_PinModeType: Tab Content

Stay Updated With Us

Error: Contact form not found.