![]() |
MCUSW
|
The DIO Driver provides services for reading and writing to/from
This specification is applicable to drivers only for on chip DIO pins and ports
This module works on pins and ports which are configured by the PORT driver for this purpose.
For this reason, there is no configuration and initialization of this port structure in the DIO Driver
Sub Modules | |
| DIO Configuration | |
DIO Driver Module SW Version Info | |
Defines for DIO Driver version used for compatibility checks | |
| #define | DIO_SW_MAJOR_VERSION (10U) |
| Driver Implementation Major Version. More... | |
| #define | DIO_SW_MINOR_VERSION (1U) |
| Driver Implementation Minor Version. More... | |
| #define | DIO_SW_PATCH_VERSION (0U) |
| Driver Implementation Patch Version. More... | |
DIO Driver Module AUTOSAR Version Info | |
Defines for DIO Driver AUTOSAR version used for compatibility checks | |
| #define | DIO_AR_RELEASE_MAJOR_VERSION (4U) |
| AUTOSAR Major version specification implemented by DIO Driver. More... | |
| #define | DIO_AR_RELEASE_MINOR_VERSION (3U) |
| AUTOSAR Minor version specification implemented by DIO Driver. More... | |
| #define | DIO_AR_RELEASE_REVISION_VERSION (1U) |
| AUTOSAR Patch version specification implemented by DIO Driver. More... | |
DIO Driver ID Info | |
| #define | DIO_VENDOR_ID ((uint16) 44U) |
| Texas Instruments Vendor ID. More... | |
| #define | DIO_MODULE_ID ((uint16) 120U) |
| DIO Driver Module ID. More... | |
Dio Error Codes | |
| #define | DIO_E_PARAM_INVALID_CHANNEL_ID (0x0AU) |
| ERROR:API service called with invalid channel ID. More... | |
| #define | DIO_E_PARAM_INVALID_PORT_ID (0x14U) |
| ERROR:API service called with invalid port ID. More... | |
| #define | DIO_E_PARAM_INVALID_GROUP (0x1FU) |
| ERROR:API service called with invalid channel group ID. More... | |
| #define | DIO_E_PARAM_POINTER (0x20U) |
| ERROR:Dio_GetVersionInfo() called with NULL_PTR as parameter. More... | |
Dio Service Ids | |
The Service Id is one of the argument to Det_ReportError function and is used to identify the source of the error | |
| #define | DIO_SID_READ_CHANNEL (0U) |
| Dio_ReadChannel() More... | |
| #define | DIO_SID_WRITE_CHANNEL (1U) |
| Dio_WriteChannel() More... | |
| #define | DIO_SID_READ_PORT (2U) |
| Dio_ReadPort() More... | |
| #define | DIO_SID_WRITE_PORT (3U) |
| Dio_WritePort() More... | |
| #define | DIO_SID_READ_CHL_GROUP (4U) |
| Dio_ReadChannelGroup() More... | |
| #define | DIO_SID_WRITE_CHL_GROUP (5U) |
| Dio_WriteChannelGroup() More... | |
| #define | DIO_SID_FLIP_CHANNEL (17U) |
| Dio_FlipChannel() More... | |
| #define | DIO_SID_GET_VERSION_INFO (18U) |
| Dio_GetVersionInfo() More... | |
| #define | DIO_PORT_WIDTH (32U) |
| Width of GPIO register in this platform not to be modified. More... | |
| #define | DIO_MCAL_2139_FIXED (0U) |
| Read back issue in Maxwell is resolved or not. More... | |
| enum | Dio_DirectionType { DIO_DIR_INPUT = 0x1U, DIO_DIR_OUTPUT = 0x0U } |
| typedef uint32 | Dio_ChannelType |
| type definition for identifying DIO channels (meaning single port pins) More... | |
| typedef uint32 | Dio_PortType |
| type definition for identifying ports More... | |
| typedef uint32 | Dio_PortLevelType |
| type definition for setting port level values More... | |
| typedef uint8 | Dio_LevelType |
| type definition for setting DIO channnel level values (allowed values: STD_HIGH and STD_LOW) More... | |
| Dio_LevelType | Level |
| AUTOMATIC | |
| DIO_APPL_DATA | versioninfo |
| Dio_RegisterReadbackType * | DioRegRbPtr |
| FUNC (Dio_LevelType, DIO_CODE) Dio_ReadChannel(Dio_ChannelType ChannelId) | |
| Returns the value of the specified DIO channel. More... | |
| FUNC (void, DIO_CODE) Dio_WriteChannel(Dio_ChannelType ChannelId | |
| Service to set a level of a channel. More... | |
| FUNC (Dio_PortLevelType, DIO_CODE) Dio_ReadPort(Dio_PortType PortId) | |
| Returns the level of all channels of that port. More... | |
| FUNC (Std_ReturnType, DIO_CODE) Dio_RegisterReadback(Dio_ChannelType ChannelId | |
| This function reads the important registers of the hardware unit and returns the value in the structure. More... | |
| #define DIO_SW_MAJOR_VERSION (10U) |
Driver Implementation Major Version.
| #define DIO_SW_MINOR_VERSION (1U) |
Driver Implementation Minor Version.
| #define DIO_SW_PATCH_VERSION (0U) |
Driver Implementation Patch Version.
| #define DIO_AR_RELEASE_MAJOR_VERSION (4U) |
AUTOSAR Major version specification implemented by DIO Driver.
| #define DIO_AR_RELEASE_MINOR_VERSION (3U) |
AUTOSAR Minor version specification implemented by DIO Driver.
| #define DIO_AR_RELEASE_REVISION_VERSION (1U) |
AUTOSAR Patch version specification implemented by DIO Driver.
| #define DIO_VENDOR_ID ((uint16) 44U) |
Texas Instruments Vendor ID.
| #define DIO_MODULE_ID ((uint16) 120U) |
DIO Driver Module ID.
| #define DIO_E_PARAM_INVALID_CHANNEL_ID (0x0AU) |
ERROR:API service called with invalid channel ID.
| #define DIO_E_PARAM_INVALID_PORT_ID (0x14U) |
ERROR:API service called with invalid port ID.
| #define DIO_E_PARAM_INVALID_GROUP (0x1FU) |
ERROR:API service called with invalid channel group ID.
| #define DIO_E_PARAM_POINTER (0x20U) |
ERROR:Dio_GetVersionInfo() called with NULL_PTR as parameter.
| #define DIO_SID_READ_CHANNEL (0U) |
Dio_ReadChannel()
| #define DIO_SID_WRITE_CHANNEL (1U) |
Dio_WriteChannel()
| #define DIO_SID_READ_PORT (2U) |
Dio_ReadPort()
| #define DIO_SID_WRITE_PORT (3U) |
Dio_WritePort()
| #define DIO_SID_READ_CHL_GROUP (4U) |
Dio_ReadChannelGroup()
| #define DIO_SID_WRITE_CHL_GROUP (5U) |
Dio_WriteChannelGroup()
| #define DIO_SID_FLIP_CHANNEL (17U) |
Dio_FlipChannel()
| #define DIO_SID_GET_VERSION_INFO (18U) |
Dio_GetVersionInfo()
| #define DIO_PORT_WIDTH (32U) |
Width of GPIO register in this platform not to be modified.
| #define DIO_MCAL_2139_FIXED (0U) |
Read back issue in Maxwell is resolved or not.
| typedef uint32 Dio_ChannelType |
type definition for identifying DIO channels (meaning single port pins)
| typedef uint32 Dio_PortType |
type definition for identifying ports
| typedef uint32 Dio_PortLevelType |
type definition for setting port level values
This is a bitmask, where each bit with value '1' sets the corresponding port pin to HIGH and '0' sets the pin to LOW)
| typedef uint8 Dio_LevelType |
type definition for setting DIO channnel level values (allowed values: STD_HIGH and STD_LOW)
| enum Dio_DirectionType |
| FUNC | ( | Dio_LevelType | , |
| DIO_CODE | |||
| ) |
Returns the value of the specified DIO channel.
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.
* Service name : Dio_ReadChannel * Syntax : Dio_LevelType Dio_ReadChannel( * Dio_ChannelType ChannelId ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x00 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : ChannelId * ID of DIO channel * Parameters (inout): None * Parameters (out) : None * Return value : Dio_LevelType - STD_HIGH The physical level of the * corresponding Pin is STD_HIGH * - STD_LOW The physical level of the corresponding Pin * is STD_LOW * Description : Returns the value of the specified DIO channel. *
* Service name : Dio_FlipChannel * Syntax : Dio_LevelType Dio_FlipChannel( * Dio_ChannelType ChannelId ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x11 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : ChannelId * - ID of DIO channel * Parameters (inout): None * Parameters (out) : None * Return value : Dio_LevelType * Return value : Dio_LevelType - STD_HIGH The physical level of the * corresponding Pin is STD_HIGH * - STD_LOW The physical level of the corresponding Pin is * STD_LOW * Description : 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 *
| FUNC | ( | void | , |
| DIO_CODE | |||
| ) |
Service to set a level of a channel.
Service to get the version information of this module.
Service to set a subset of the adjoining bits of a port to a specified level.
Service to set a value of the port.
* Service name : Dio_WriteChannel * Syntax : void Dio_WriteChannel( Dio_ChannelType ChannelId, * Dio_LevelType Level ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x01 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : ChannelId - ID of DIO channel * Level - Value to be written * Parameters (inout): None * Parameters (out) : None * Return value : None * Description : Service to set a level of a channel. *
* Service name : Dio_WritePort * Syntax : void Dio_WritePort( Dio_PortType PortId, * Dio_PortLevelType Level ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x03 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : PortId - ID of DIO Port * Level - Value to be written * Parameters (inout): None * Parameters (out) : None * Return value : None * Description : Service to set a value of the port. *
* Service name : Dio_WriteChannelGroup * Syntax : void Dio_WriteChannelGroup( const Dio_ChannelGroupType* * ChannelGroupIdPtr, Dio_PortLevelType Level ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x05 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : ChannelGroupIdPtr - Pointer to ChannelGroup * Level - Value to be written * Parameters (inout): None * Parameters (out) : None * Return value : None * Description : Service to set a subset of the adjoining bits of a port * to a specified level *
* Service name : Dio_GetVersionInfo * Syntax : void Dio_GetVersionInfo( * Std_VersionInfoType* versioninfo ) * Mode : User Mode (Non-Privileged Mode) * Service ID[hex] : 0x12 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : None * Parameters (inout): None * Parameters (out) : versioninfo - Pointer to where to store the version * information of this module. * Return value : None * Description : Service to get the version information of this module *
| FUNC | ( | Dio_PortLevelType | , |
| DIO_CODE | |||
| ) |
Returns the level of all channels of that port.
This Service reads a subset of the adjoining bits of a port.
* Service name : Dio_ReadPort * Syntax : Dio_PortLevelType Dio_ReadPort( Dio_PortType PortId ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x02 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : PortId - ID of DIO Port * Parameters (inout): None * Parameters (out) : None * Return value : Dio_PortLevelType - Level of all channels of that port * Description : Returns the level of all channels of that port. *
* Service name : Dio_ReadChannelGroup * Syntax : Dio_PortLevelType Dio_ReadChannelGroup( * const Dio_ChannelGroupType* ChannelGroupIdPtr ) * Mode : Supervisor Mode (Privileged Mode) * Service ID[hex] : 0x04 * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : ChannelGroupIdPtr - Pointer to ChannelGroup * Parameters (inout): None * Parameters (out) : None * Return value : Dio_PortLevelType - Level of a subset of the adjoining * bits of a port * Description : This Service read a subset of the adjoining bits of a * port. *
| FUNC | ( | Std_ReturnType | , |
| DIO_CODE | |||
| ) |
This function reads the important registers of the hardware unit and returns the value in the structure.
* This API should be called after DIO initialization in the app. * * This API could be used to readback the register contents * and then the readback value could be compared during DIO execution to * check the correctness of the HW unit. Since this API is used for this * purpose, the register returned are the ones which doesn't * change during execution. * * \verbatim * Service name : Dio_RegisterReadback * Syntax : uint32 Dio_RegisterReadback( * Dio_ChannelType ChannelId ) * Mode : Supervisor Mode (Privileged Mode) * Sync/Async : Synchronous * Reentrancy : Reentrant * Parameters (in) : ChannelId * - ID of DIO channel * Parameters (inout) : None * Parameters (out) : Value of the PID register * Return value : uint32 *
| Dio_PortLevelType Level |
| AUTOMATIC |
| DIO_APPL_DATA versioninfo |
| Dio_RegisterReadbackType* DioRegRbPtr |