
/* ======================================================================
 *   Copyright (C) 2022 Texas Instruments Incorporated
 *
 *   All rights reserved. Property of Texas Instruments Incorporated.
 *   Restricted rights to use, duplicate or disclose this code are
 *   granted through contract.
 *
 *   The program may not be used without the written permission
 *   of Texas Instruments Incorporated or against the terms and conditions
 *   stipulated in the agreement under which this program has been
 *   supplied.
 * ==================================================================== */

/**
 *  \file     I2c_Priv.h
 *
 */

#ifndef I2C_PRIV_H_
#define I2C_PRIV_H_

/* ========================================================================== */
/*                             Include Files                                  */
/* ========================================================================== */

/*LDRA_NOANALYSIS*/
#include "Std_Types.h"
/*LDRA_ANALYSIS*/

#include "hal_stdtypes.h"
#include "Cdd_I2c_HwReg.h"

#if (I2C_DEV_ERROR_DETECT == STD_ON)
/*LDRA_NOANALYSIS*/
#include "Det.h"
/*LDRA_ANALYSIS*/
#endif

#ifdef __cplusplus
extern "C"
{
#endif


/* ========================================================================== */
/*                           Global Variables                                 */
/* ========================================================================== */

#define I2C_START_SEC_VAR_INIT_UNSPECIFIED
#include "I2c_MemMap.h"
extern VAR(I2C_HandlingType, AUTOMATIC) I2c_GenHandling;
#define I2C_STOP_SEC_VAR_INIT_UNSPECIFIED
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_INIT_UNSPECIFIED
#include "I2c_MemMap.h"
extern P2CONST(I2C_ConfigType, AUTOMATIC, I2C_CONST)I2c_GpConfigType;
#define I2C_STOP_SEC_VAR_INIT_UNSPECIFIED
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_INIT_UNSPECIFIED
#include "I2c_MemMap.h"
extern P2CONST(I2C_ChannelConfigType, AUTOMATIC, I2C_CONST)I2c_GpChannelConfigDataPtr;
#define I2C_STOP_SEC_VAR_INIT_UNSPECIFIED
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_INIT_UNSPECIFIED
#include "I2c_MemMap.h"
extern P2CONST(I2C_SequenceConfigType, AUTOMATIC, I2C_CONST)I2c_GpSequenceConfigDataPtr;
#define I2C_STOP_SEC_VAR_INIT_UNSPECIFIED
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_INIT_UNSPECIFIED
#include "I2c_MemMap.h"
extern VAR(StatusType, AUTOMATIC) I2c_GenModuleState;
#define I2C_STOP_SEC_VAR_INIT_UNSPECIFIED
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_CLEARED_16
#include "I2c_MemMap.h"
extern VAR(I2C_SequenceType, AUTOMATIC) I2c_GddSeqFrameCount;
#define I2C_STOP_SEC_VAR_CLEARED_16
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_CLEARED_UNSPECIFIED
#include "I2c_MemMap.h"
extern VAR(I2C_FrameType, AUTOMATIC) I2c_GaaSeqFrame[I2C_MAX_SEQUENCE_CONFIG];
#define I2C_STOP_SEC_VAR_CLEARED_UNSPECIFIED
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_CLEARED_16
#include "I2c_MemMap.h"
extern VAR(I2C_ChannelType, AUTOMATIC) I2C_GddChaCount;
#define I2C_STOP_SEC_VAR_CLEARED_16
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_CLEARED_16
#include "I2c_MemMap.h"
extern VAR(I2C_SequenceType, AUTOMATIC) I2c_GddCancelSeq;
#define I2C_STOP_SEC_VAR_CLEARED_16
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_CLEARED_UNSPECIFIED
#include "I2c_MemMap.h"
extern VAR(I2C_SequenceStatusType, AUTOMATIC)I2c_GaaSeqStatus[I2C_MAX_SEQUENCE_CONFIG];
#define I2C_STOP_SEC_VAR_CLEARED_UNSPECIFIED
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_CLEARED_16
#include "I2c_MemMap.h"
extern VAR(I2C_SequenceType, AUTOMATIC) I2C_GddSeqCount;
#define I2C_STOP_SEC_VAR_CLEARED_16
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_CLEARED_UNSPECIFIED
#include "I2c_MemMap.h"
extern VAR(I2C_ChannelStatusType, AUTOMATIC) I2c_GaaChStatus[I2C_MAX_CHANNEL_ACCEPT];
#define I2C_STOP_SEC_VAR_CLEARED_UNSPECIFIED
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_CLEARED_UNSPECIFIED
#include "I2c_MemMap.h"
extern P2VAR(I2c_HardwareConfigType, AUTOMATIC, I2C_CONST) I2c_GpHwReg;
#define I2C_STOP_SEC_VAR_INIT_UNSPECIFIED
#include "I2c_MemMap.h"

#define I2C_START_SEC_VAR_CLEARED_UNSPECIFIED
#include "I2c_MemMap.h"
extern P2VAR(I2C_HwConfigType, AUTOMATIC, I2C_VAR_PTR) I2c_GpHardwarewReg;
#define I2C_STOP_SEC_VAR_CLEARED_UNSPECIFIED
#include "I2c_MemMap.h"
/* ========================================================================== */
/*                         Structures and Enums                               */
/* ========================================================================== */




/* ========================================================================== */
/*                          Function Declarations                             */
/* ========================================================================== */
FUNC(void, I2C_CODE) I2c_InitHw(P2CONST(I2C_ConfigType, AUTOMATIC, I2C_CONST) LpConfigPtr);

FUNC(Std_ReturnType, I2C_CODE)I2c_ChannelValidate(VAR(I2C_ChannelType, I2C_VAR) Channel);

FUNC(void, I2C_CODE)I2c_UnInitHW(P2CONST(I2C_ConfigType, AUTOMATIC, I2C_CONST) LpConfigPtr);

FUNC(void, I2C_CODE) I2c_QueueSequenceAddr(VAR(I2C_ChannelType, AUTOMATIC) Channel, VAR(I2C_AddressType, AUTOMATIC) Address);

FUNC(void, I2C_CODE) I2c_QueueTxDataBufferPtr(VAR(I2C_ChannelType, AUTOMATIC) Channel, VAR(I2C_DataConstPtrType, AUTOMATIC) TxDataBufferPtr, VAR(I2C_DataLengthType, AUTOMATIC) Length);

FUNC(void, I2C_CODE) I2c_QueueRxDataBufferPtr( VAR(I2C_ChannelType, AUTOMATIC) Channel, VAR(I2C_DataPtrType, AUTOMATIC) RxDataBufferPtr, VAR(I2C_DataLengthType, AUTOMATIC) Length);

FUNC(void, I2C_CODE) I2c_QueueChanelStatusUpdate(VAR(I2C_ChannelType, AUTOMATIC) Channel, VAR(Std_ReturnType, AUTOMATIC) ChaAcceped);

FUNC(Std_ReturnType, I2C_CODE)I2c_SequenceValidate(VAR(I2C_SequenceType, I2C_VAR) Sequence);

FUNC(void, I2C_CODE) I2c_DeleteDuplicateSeqFromStatusBuf(VAR(I2C_SequenceType, AUTOMATIC) DupliCateSeq);

FUNC(void, I2C_CODE) I2c_CancelSequence(VAR(I2C_SequenceType, AUTOMATIC) Sequence);

FUNC(Std_ReturnType, I2C_CODE) I2c_SequenceTransmission();

FUNC(void, I2C_CODE) I2c_Local_SequenceEndNotification(void);

FUNC(void, I2C_CODE) I2c_Local_SequenceErrorNotification(void);

FUNC(void, I2C_CODE) I2c_DeleteExcutedSeqFromQueue(VAR(I2C_DataLengthType, AUTOMATIC) SeqQueueNum);

FUNC(void, I2C_CODE) DeleteChaAndSeqFromStatuBuf(void);

FUNC(void, I2C_CODE) I2c_UpdateSeqStatus(VAR(I2C_SequenceType, AUTOMATIC) Sequence, VAR(uint8, AUTOMATIC) SeqStat);

FUNC(void, I2C_CODE) I2c_UpdateChannelStatus (VAR(I2C_ChannelType, AUTOMATIC) Channel, VAR(uint8, AUTOMATIC) ChStat);

FUNC(uint32, I2C_CODE) GET_I2CBaseAddress(P2CONST(I2C_ConfigType, AUTOMATIC, I2C_CONST) LI2cBaseAddr);

FUNC(uint8, I2C_CODE) I2c_PollingMode(void);

#ifdef __cplusplus
}
#endif

#endif  /* #ifndef GPT_PRIV_H_ */



