MCUSW
Loading...
Searching...
No Matches
Dio.h
Go to the documentation of this file.
1/*
2*
3* Copyright (c) 2024 Texas Instruments Incorporated
4*
5* All rights reserved not granted herein.
6*
7* Limited License.
8*
9* Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
10* license under copyrights and patents it now or hereafter owns or controls to make,
11* have made, use, import, offer to sell and sell ("Utilize") this software subject to the
12* terms herein. With respect to the foregoing patent license, such license is granted
13* solely to the extent that any such patent is necessary to Utilize the software alone.
14* The patent license shall not apply to any combinations which include this software,
15* other than combinations with devices manufactured by or for TI ("TI Devices").
16* No hardware patent is licensed hereunder.
17*
18* Redistributions must preserve existing copyright notices and reproduce this license
19* (including the above copyright notice and the disclaimer and (if applicable) source
20* code license limitations below) in the documentation and/or other materials provided
21* with the distribution
22*
23* Redistribution and use in binary form, without modification, are permitted provided
24* that the following conditions are met:
25*
26* * No reverse engineering, decompilation, or disassembly of this software is
27* permitted with respect to any software provided in binary form.
28*
29* * any redistribution and use are licensed by TI for use only with TI Devices.
30*
31* * Nothing shall obligate TI to provide you with source code for the software
32* licensed and provided to you in object code.
33*
34* If software source code is provided to you, modification and redistribution of the
35* source code are permitted provided that the following conditions are met:
36*
37* * any redistribution and use of the source code, including any resulting derivative
38* works, are licensed by TI for use only with TI Devices.
39*
40* * any redistribution and use of any object code compiled from the source code
41* and any resulting derivative works, are licensed by TI for use only with TI Devices.
42*
43* Neither the name of Texas Instruments Incorporated nor the names of its suppliers
44*
45* may be used to endorse or promote products derived from this software without
46* specific prior written permission.
47*
48* DISCLAIMER.
49*
50* THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
51* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
52* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
53* IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
54* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
55* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
57* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
58* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
59* OF THE POSSIBILITY OF SUCH DAMAGE.
60*
61*/
62
90/*
91 * Below are the global requirements which are met by this DIO
92 * driver which can't be mapped to a particular source ID
93 */
94/*
95 * Design: MCAL-5468,MCAL-5428
96 */
97#ifndef DIO_H_
98#define DIO_H_
99
100/* ========================================================================== */
101/* Include Files */
102/* ========================================================================== */
103
104/*
105 * Design: MCAL-5509
106 */
107#include "Std_Types.h"
108/*
109 * Design: MCAL-5492,MCAL-5461
110 */
111#include "Dio_Cfg.h"
112
113#ifdef __cplusplus
114extern "C"
115{
116#endif
117
118/* ========================================================================== */
119/* Macros & Typedefs */
120/* ========================================================================== */
121
129#define DIO_SW_MAJOR_VERSION (10U)
131#define DIO_SW_MINOR_VERSION (1U)
133#define DIO_SW_PATCH_VERSION (0U)
134/* @} */
135
143#define DIO_AR_RELEASE_MAJOR_VERSION (4U)
145#define DIO_AR_RELEASE_MINOR_VERSION (3U)
147#define DIO_AR_RELEASE_REVISION_VERSION (1U)
148/* @} */
149
155#define DIO_VENDOR_ID ((uint16) 44U)
157#define DIO_MODULE_ID ((uint16) 120U)
158/* @} */
159
166/*
167 * Design: MCAL-5443
168 */
169#ifndef DIO_E_PARAM_INVALID_CHANNEL_ID
171#define DIO_E_PARAM_INVALID_CHANNEL_ID (0x0AU)
172#endif
173/*
174 * Design: MCAL-5441
175 */
176#ifndef DIO_E_PARAM_INVALID_PORT_ID
178#define DIO_E_PARAM_INVALID_PORT_ID (0x14U)
179#endif
180/*
181 * Design: MCAL-5493
182 */
183#ifndef DIO_E_PARAM_INVALID_GROUP
185#define DIO_E_PARAM_INVALID_GROUP (0x1FU)
186#endif
187/*
188 * Design: MCAL-5425
189 */
190#ifndef DIO_E_PARAM_POINTER
192#define DIO_E_PARAM_POINTER (0x20U)
193#endif
194/* @} */
195
203/* DIO API service identification */
205#define DIO_SID_READ_CHANNEL (0U)
207#define DIO_SID_WRITE_CHANNEL (1U)
209#define DIO_SID_READ_PORT (2U)
211#define DIO_SID_WRITE_PORT (3U)
213#define DIO_SID_READ_CHL_GROUP (4U)
215#define DIO_SID_WRITE_CHL_GROUP (5U)
217#define DIO_SID_FLIP_CHANNEL (17U)
219#define DIO_SID_GET_VERSION_INFO (18U)
220/* @} */
221
222/*
223 * Design: MCAL-5447
224 */
227#define DIO_PORT_WIDTH (32U)
228
230#define DIO_MCAL_2139_FIXED (0U)
231/* ========================================================================== */
232/* Structures and Enums */
233/* ========================================================================== */
234
244/*
245 * Design: MCAL-5503,MCAL-5436,MCAL-5446,MCAL-5449
246 */
247typedef uint32 Dio_ChannelType;
248
250/*
251 * Design: MCAL-5533,MCAL-5521,MCAL-5504,MCAL-5516
252 */
253typedef uint32 Dio_PortType;
254
255/*
256 * Design: MCAL-5486,MCAL-5484
257 */
264typedef uint32 Dio_PortLevelType;
265/*
266 * Design: MCAL-5484,MCAL-5526,MCAL-5518
267 */
280
281/*
282 * Design: MCAL-5519,MCAL-5517
283 */
289typedef uint8 Dio_LevelType;
290
291/*
292** \name Values used to configure the direction of GPIO pins.
293* @{
294*/
295typedef enum {
297 DIO_DIR_OUTPUT = 0x0U
299/* @} */
300
301#if (STD_ON == DIO_REGISTER_READBACK_API)
302typedef struct
303{
304 /*
305 * DIO related registers
306 */
307 uint32 pid;
313#endif /* #if (STD_ON == DIO_REGISTER_READBACK_API) */
314
315
316
317/* @} */
318
319/* ========================================================================== */
320/* Function Declarations */
321/* ========================================================================== */
322
346
366FUNC(void, DIO_CODE) Dio_WriteChannel(
367 Dio_ChannelType ChannelId, Dio_LevelType Level);
368
387
407FUNC(void, DIO_CODE) Dio_WritePort(
408 Dio_PortType PortId, Dio_PortLevelType Level);
409
431 const Dio_ChannelGroupType *ChannelGroupIdPtr);
432
454FUNC(void, DIO_CODE) Dio_WriteChannelGroup(
455 const Dio_ChannelGroupType *ChannelGroupIdPtr, Dio_PortLevelType Level);
456
457#if (STD_ON == DIO_VERSION_INFO_API)
477FUNC(void, DIO_CODE) Dio_GetVersionInfo(
478 P2VAR(Std_VersionInfoType, AUTOMATIC, DIO_APPL_DATA) versioninfo);
479#endif
480
481#if (STD_ON == DIO_FLIP_CHANNEL_API)
509#endif
510
511#if (STD_ON == DIO_REGISTER_READBACK_API)
539FUNC(Std_ReturnType, DIO_CODE) Dio_RegisterReadback(Dio_ChannelType ChannelId, Dio_RegisterReadbackType *DioRegRbPtr);
540#endif
541
542#ifdef __cplusplus
543}
544#endif
545
546#endif /* #ifndef DIO_H_ */
547
548/* @} */
This file contains generated pre compile configuration file for DIO MCAL driver.
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 th...
uint32 Dio_PortType
type definition for identifying ports
Definition Dio.h:253
uint32 Dio_PortLevelType
type definition for setting port level values
Definition Dio.h:264
void Dio_WritePort(Dio_PortType PortId, Dio_PortLevelType Level)
Service to set a value of the port.
void Dio_GetVersionInfo(Std_VersionInfoType *versioninfo)
Service to get the version information of this module.
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.
uint8 Dio_LevelType
type definition for setting DIO channnel level values (allowed values: STD_HIGH and STD_LOW)
Definition Dio.h:289
Dio_DirectionType
Definition Dio.h:295
Dio_PortLevelType Dio_ReadPort(Dio_PortType PortId)
Returns the level of all channels of that port.
Dio_LevelType Dio_ReadChannel(Dio_ChannelType ChannelId)
Returns the value of the specified DIO channel.
uint32 Dio_ChannelType
type definition for identifying DIO channels (meaning single port pins)
Definition Dio.h:247
void Dio_WriteChannel(Dio_ChannelType ChannelId, Dio_LevelType Level)
Service to set a level of a channel.
Std_ReturnType Dio_RegisterReadback(Dio_ChannelType ChannelId, Dio_RegisterReadbackType *DioRegRbPtr)
This function reads the important registers of the hardware unit and returns the value in the structu...
Dio_PortLevelType Dio_ReadChannelGroup(const Dio_ChannelGroupType *ChannelGroupIdPtr)
This Service reads a subset of the adjoining bits of a port.
uint8 offset
Definition Dio.h:277
Dio_PortType port
Definition Dio.h:273
uint32 pid
Definition Dio.h:307
Dio_PortLevelType mask
Definition Dio.h:275
Dio_DirectionType Dio_Direction
Definition Dio.h:309
@ DIO_DIR_OUTPUT
Definition Dio.h:297
@ DIO_DIR_INPUT
Definition Dio.h:296
Type definition for identifying channel groups (meaning a set of pins in one port)
Definition Dio.h:272
Definition Dio.h:303