DEENESPTFRRUARHIKOZHNL

DIO Driver (Dio)

ModulDio (DIO Driver)
BSW-Modul-ID120
Standard-Header#include "Dio.h"
SWS-SpezifikationAUTOSAR_CP_SWS_DIODriver.pdf, AUTOSAR_SWS_DIODriver.pdf, AUTOSAR_SWS_DIO_Driver.pdf
Umfang35 Records · 3 Snippets
ClusterMikrocontroller-Abstraktion (MCAL & I/O)

DIO Driver (Dio)

AUTOSAR Classic I/O Drivers-Modul DIO Driver (Dio, Spezifikation: AUTOSAR_CP_SWS_DIODriver.pdf, AUTOSAR_SWS_DIODriver.pdf, AUTOSAR_SWS_DIO_Driver.pdf).

Funktionen — Übersicht

Typen — Übersicht

Anforderungen — Übersicht

Funktionen & Typen — Detailansicht

함수 Dio_ReadChannel [SWS_Dio_00133] 📄 PDF

Dio_LevelType Dio_ReadChannel(Dio_ChannelType ChannelId);

Returns the value of the specified DIO channel.

함수 Dio_WriteChannel [SWS_Dio_00134] 📄 PDF

void Dio_WriteChannel(Dio_ChannelType ChannelId, Dio_LevelType Level);

Service to set a level of a channel.

함수 Dio_ReadPort [SWS_Dio_00135] 📄 PDF

Dio_PortLevelType Dio_ReadPort(Dio_PortType PortId);

Returns the level of all channels of that port.

함수 Dio_WritePort [SWS_Dio_00136] 📄 PDF

void Dio_WritePort(Dio_PortType PortId, Dio_PortLevelType Level);

Service to set a value of the port.

함수 Dio_ReadChannelGroup [SWS_Dio_00137] 📄 PDF

Dio_PortLevelType Dio_ReadChannelGroup(const Dio_ChannelGroupType* ChannelGroupIdPtr);

This Service reads a subset of the adjoining bits of a port.

함수 Dio_WriteChannelGroup [SWS_Dio_00138] 📄 PDF

void Dio_WriteChannelGroup(const Dio_ChannelGroupType* ChannelGroupIdPtr, Dio_PortLevelType Level);

Service to set a subset of the adjoining bits of a port to a specified level.

함수 Dio_FlipChannel [SWS_Dio_00190] 📄 PDF

Dio_LevelType Dio_FlipChannel(Dio_ChannelType ChannelId);

Service to flip (change from 1 to 0 or from 0 to 1) the level of a channel and return the level of the channel after flip.

함수 Dio_MaskedWritePort [SWS_Dio_00300] 📄 PDF

void Dio_MaskedWritePort(Dio_PortType PortId, Dio_PortLevelType Level, Dio_PortLevelType Mask);

Service to set the value of a given port with required mask.

타입 Dio_ChannelGroupType [SWS_Dio_00184] 📄 PDF

Type for the definition of a channel group, which consists of several adjoining channels within a port.

타입 Dio_LevelType [SWS_Dio_00185] 📄 PDF

These are the possible levels a DIO channel can have (input or output)

타입 Dio_PortLevelType [SWS_Dio_00186] 📄 PDF

If the µC owns ports of different port widths (e.g. 4, 8,16...Bit) Dio_ Port Level Type inherits the size of the larg est port.

requirement SWS_Dio_00074 [SWS_Dio_00074] 📄 PDF

I f development error detection is enabled , the services Dio_ReadChannel , Dio_WriteChannel and Dio_Flip Channel shall check the “Channel Id ” parameter to be valid within the current configuration. If the “Channel Id ” paramet er is invalid, the functions shall report the error code DIO_E_PARAM_INVALID_CHANNEL_ID to the DET.

requirement SWS_Dio_00075 [SWS_Dio_00075] 📄 PDF

I f development error detection is enabled , the functions Dio_ReadPort , Dio_WritePort and Dio_ Masked WritePort shall check the “Port Id ” parameter to be valid within the current configuration. If the “Port Id ” parameter is invalid, the functions shall report the error code DIO_E_PARAM_INVALID_PORT_ID to the DET.

requirement SWS_Dio_00114 [SWS_Dio_00114] 📄 PDF

I f development error detection is enabled , the functions Dio_ReadChannelGroup and Dio_WriteChannelGroup shall check the “ChannelGroupId Ptr ” parameter to be valid within the current configuration. If the “ChannelGroupId P tr ” parameter is invalid, the functions shall report the error code DIO_E_PARAM_INVALID_GROUP to the DET.

requirement SWS_Dio_00131 [SWS_Dio_00131] 📄 PDF

Module Header File Imported Type Std Std_ Types.h Std _ Return Type Std_ Types.h Std _ Version Info Type

requirement SWS_Dio_00177 [SWS_Dio_00177] 📄 PDF

Invalid port requested. Related error code: DI O_E_PARAM_INVALID_PORT_ID Value: [hex]: 0x14

requirement SWS_Dio_00178 [SWS_Dio_00178] 📄 PDF

Invalid c hannel g roup requested. Related error code: DIO_E_PARAM_INVALID_GROUP Value: [hex]: 0x1F

requirement SWS_Dio_00188 [SWS_Dio_00188] 📄 PDF

API service called with a NULL pointer. Related error code: DIO_E_ PARAM_POINTER Value: [hex]: 0x20

requirement SWS_Dio_00189 [SWS_Dio_00189] 📄 PDF

[SWS_Dio_00189] Upstream requirements: SRS_BSW_00323 ⌈If DET is enabled for the DIO Driver module, the function Dio_GetVersionInfo shall raise DIO_E_PARAM_POINTER, if the argument is NULL pointer and return with- out any action.⌋

requirement SWS_Dio_00200 [SWS_Dio_00200] 📄 PDF

The Dio_MaskedWritePort function shall simultaneously set the levels of the selected output channels. Mask argument specifies which bits are selected: a bit value '0' means the corresponding channel is not selected, a bit value '1' means the corresponding channel is selected. Level argument s pecifies the physical levels: a bit value '0' sets the corresponding channel to physical STD_LOW , a bit value '1' sets the corresponding channel to physical STD_HIGH .

requirement SWS_Dio_00201 [SWS_Dio_00201] 📄 PDF

The Dio_MaskedWritePort function shall ensure that the functionality of the input channels of that port is not affected.

requirement SWS_Dio_00202 [SWS_Dio_00202] 📄 PDF

The Dio_MaskedWritePort function shall set the specified value for the channels in the specified port if the corresponding bit in Mask is '1'.

requirement SWS_Dio_00203 [SWS_Dio_00203] 📄 PDF

When the Dio_MaskedWritePort function is called, DIO Channels that are configured as input shall remain unchanged.

requirement SWS_Dio_00204 [SWS_Dio_00204] 📄 PDF

When writing a port which is smaller than the Dio_PortLevelType using the Dio_MaskedWritePort function (see [SWS_Dio_00103]), the function shall ignore the MSB.

requirement SWS_Dio_00205 [SWS_Dio_00205] 📄 PDF

The DIO module shall reject configurations with partition mappings which are not supported by the implementation .

requirement SWS_Dio_00206 [SWS_Dio_00206] 📄 PDF

The ECUC partitions referenced by DioPortEcucPartitionRef shall b e a subset of the ECUC partitions referenced by DioEcucPartitionRef.

requirement SWS_Dio_00207 [SWS_Dio_00207] 📄 PDF

The ECUC partitions referenced by DioChannelEcucPartitionRef shall be a subset of the ECUC partitions referenced by DioPortEcucPartitionRef.

requirement SWS_Dio_00209 [SWS_Dio_00209] 📄 PDF

If DioEcucPartitionRef references one or more ECUC partitions, DioPortEcucPartitionRef shall have a multiplicity of greater than zero and reference one or several of these ECUC partitions as well.

requirement SWS_Dio_00210 [SWS_Dio_00210] 📄 PDF

If DioEcucPartitionRef references one or more ECUC part itions, DioChannelEcucPartitionRef shall have a multiplicity of greater than zero and reference one or several of these ECUC partitions as well.

requirement SWS_Dio_00211 [SWS_Dio_00211] 📄 PDF

If DioPortEcucPartitionRef references one or more ECUC partitions, DioChannelGroupEcucPartitio nRef shall have a multiplicity of greater than zero and reference one or several of these ECUC partitions as well.

requirement SWS_Dio_91001 [SWS_Dio_91001] 📄 PDF

Type of error Related error code Error value Invalid channel requested DIO_ E_ PARAM_ INVALID_ CHANNEL_ ID 0x0A Invalid port requested DIO_ E_ PARAM_ INVALID_ PORT_ ID 0x14 Invalid channel group requested DIO_ E_ PARAM_ INVALID_ GROUP 0x1F API service called with a NULL pointer DIO_ E_ PARAM_ POINTER 0x20

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_Dio
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_Dio@rel:R20-11#53582529
Content hash
53582529
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_DIODriver.pdf#nameddest=SWS_Dio_00133

초기화 및 상태

Service to get the version information of this module.

void Dio_GetVersionInfo(Std_VersionInfoType* VersionInfo);

서비스

Service to flip (change from 1 to 0 or from 0 to 1) the level of a channel and return the level of the channel after flip.

Dio_LevelType Dio_FlipChannel(Dio_ChannelType ChannelId);

Service to set the value of a given port with required mask.

void Dio_MaskedWritePort(Dio_PortType PortId, Dio_PortLevelType Level, Dio_PortLevelType Mask);

Returns the value of the specified DIO channel.

Dio_LevelType Dio_ReadChannel(Dio_ChannelType ChannelId);

Service to set a level of a channel.

void Dio_WriteChannel(Dio_ChannelType ChannelId, Dio_LevelType Level);

Service to set a subset of the adjoining bits of a port to a specified level.

void Dio_WriteChannelGroup(const Dio_ChannelGroupType* ChannelGroupIdPtr, Dio_PortLevelType Level);

Service to set a value of the port.

void Dio_WritePort(Dio_PortType PortId, Dio_PortLevelType Level);

This Service reads a subset of the adjoining bits of a port.

Dio_PortLevelType Dio_ReadChannelGroup(const Dio_ChannelGroupType* ChannelGroupIdPtr);

Returns the level of all channels of that port.

Dio_PortLevelType Dio_ReadPort(Dio_PortType PortId);

타입

Type for the definition of a channel group, which consists of several adjoining channels within a port.

Numeric ID of a DIO channel.

These are the possible levels a DIO channel can have (input or output)

If the µC owns ports of different port widths (e.g. 4, 8,16...Bit) Dio_ Port Level Type inherits the size of the larg est port.

Numeric ID of a DIO port.

요구사항

SWS_Dio_00074 requirement

I f development error detection is enabled , the services Dio_ReadChannel , Dio_WriteChannel and Dio_Flip Channel shall check the “Channel Id ” parameter to be valid within the current configuration. If the “Channel Id ” paramet er is invalid, the functions shall report the error code DIO_E_PARAM_INVALID_CHANNEL_ID to the DET.

SWS_Dio_00075 requirement

I f development error detection is enabled , the functions Dio_ReadPort , Dio_WritePort and Dio_ Masked WritePort shall check the “Port Id ” parameter to be valid within the current configuration. If the “Port Id ” parameter is invalid, the functions shall report the error code DIO_E_PARAM_INVALID_PORT_ID to the DET.

SWS_Dio_00114 requirement

I f development error detection is enabled , the functions Dio_ReadChannelGroup and Dio_WriteChannelGroup shall check the “ChannelGroupId Ptr ” parameter to be valid within the current configuration. If the “ChannelGroupId P tr ” parameter is invalid, the functions shall report the error code DIO_E_PARAM_INVALID_GROUP to the DET.

SWS_Dio_00131 requirement

Module Header File Imported Type Std Std_ Types.h Std _ Return Type Std_ Types.h Std _ Version Info Type

SWS_Dio_00140 requirement

Det _ Report Error Det.h Service to report development errors.

SWS_Dio_00177 requirement

Invalid port requested. Related error code: DI O_E_PARAM_INVALID_PORT_ID Value: [hex]: 0x14

SWS_Dio_00178 requirement

Invalid c hannel g roup requested. Related error code: DIO_E_PARAM_INVALID_GROUP Value: [hex]: 0x1F

SWS_Dio_00188 requirement

API service called with a NULL pointer. Related error code: DIO_E_ PARAM_POINTER Value: [hex]: 0x20

SWS_Dio_00189 requirement

[SWS_Dio_00189] Upstream requirements: SRS_BSW_00323 ⌈If DET is enabled for the DIO Driver module, the function Dio_GetVersionInfo shall raise DIO_E_PARAM_POINTER, if the argument is NULL pointer and return with- out any action.⌋

SWS_Dio_00200 requirement

The Dio_MaskedWritePort function shall simultaneously set the levels of the selected output channels. Mask argument specifies which bits are selected: a bit value '0' means the corresponding channel is not selected, a bit value '1' means the corresponding channel is selected. Level argument s pecifies the physical levels: a bit value '0' sets the corresponding channel to physical STD_LOW , a bit value '1' sets the corresponding channel to physical STD_HIGH .

SWS_Dio_00201 requirement

The Dio_MaskedWritePort function shall ensure that the functionality of the input channels of that port is not affected.

SWS_Dio_00202 requirement

The Dio_MaskedWritePort function shall set the specified value for the channels in the specified port if the corresponding bit in Mask is '1'.

SWS_Dio_00203 requirement

When the Dio_MaskedWritePort function is called, DIO Channels that are configured as input shall remain unchanged.

SWS_Dio_00204 requirement

When writing a port which is smaller than the Dio_PortLevelType using the Dio_MaskedWritePort function (see [SWS_Dio_00103]), the function shall ignore the MSB.

SWS_Dio_00205 requirement

The DIO module shall reject configurations with partition mappings which are not supported by the implementation .

SWS_Dio_00206 requirement

The ECUC partitions referenced by DioPortEcucPartitionRef shall b e a subset of the ECUC partitions referenced by DioEcucPartitionRef.

SWS_Dio_00207 requirement

The ECUC partitions referenced by DioChannelEcucPartitionRef shall be a subset of the ECUC partitions referenced by DioPortEcucPartitionRef.

SWS_Dio_00209 requirement

If DioEcucPartitionRef references one or more ECUC partitions, DioPortEcucPartitionRef shall have a multiplicity of greater than zero and reference one or several of these ECUC partitions as well.

SWS_Dio_00210 requirement

If DioEcucPartitionRef references one or more ECUC part itions, DioChannelEcucPartitionRef shall have a multiplicity of greater than zero and reference one or several of these ECUC partitions as well.

SWS_Dio_00211 requirement

If DioPortEcucPartitionRef references one or more ECUC partitions, DioChannelGroupEcucPartitio nRef shall have a multiplicity of greater than zero and reference one or several of these ECUC partitions as well.

SWS_Dio_91001 requirement

Type of error Related error code Error value Invalid channel requested DIO_ E_ PARAM_ INVALID_ CHANNEL_ ID 0x0A Invalid port requested DIO_ E_ PARAM_ INVALID_ PORT_ ID 0x14 Invalid channel group requested DIO_ E_ PARAM_ INVALID_ GROUP 0x1F API service called with a NULL pointer DIO_ E_ PARAM_ POINTER 0x20