//---------------------------------------------------------------------------------------------------------------------
//  Copyright (C) {2019-2022} Texas Instruments Incorporated - http://www.ti.com/
//---------------------------------------------------------------------------------------------------------------------
//
//  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
//  following conditions are met:
//
//  - Redistributions of source code must retain the above copyright notice, this list of conditions and the following
//    disclaimer.
//  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
//    following disclaimer in the documentation and/or other materials provided with the distribution.
//  - Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or
//    promote products derived from this software without specific prior written permission.
//
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
//  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
//  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
//  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
//  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
//  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
//  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//---------------------------------------------------------------------------------------------------------------------
//
// \file   stl_cla_internal.h
//
// \brief  This file is an internal file required for support of the Dynamic Coverage Analysis (DCA) report created by 
//         LDRA.  It defines a macro called HWREGH_PRIV which is identical to the HWREGH macro and is functionally 
//         equivalent to that macro.  LDRA supports unit test development (which is a pre-requisite for DCA) and 
//         therefore provides support to stub functions.  It also supports the stubbing of macros by providing a method
//         for macro redefinition.  HWREGH_PRIV is used to limit the number of times the macro redefinition is used.
//         See related documentation in the cla_stl_pest.c and cla_stl_post.c files.
//
//
//         Device Family:     TMS320F28003x
//         Platform:          F28003x ControlCARD
//
// \References: Safety Manual: https://www.ti.com/lit/pdf/sffs277  (under development)
//              Data Sheet   : https://www.ti.com/lit/pdf/sprsp61
//              TRM          : https://www.ti.com/lit/pdf/spruiw9
//              LDRA         : https://www.ldra.com/  Tool used to demonstrate systematic capability of ISO26262/ASIL B
//
//---------------------------------------------------------------------------------------------------------------------
//                                                   VERSION HISTORY
//---------------------------------------------------------------------------------------------------------------------
// DATE         AUTHOR(ID)     JIRA ID           Description
//---------------------------------------------------------------------------------------------------------------------
// 06/29/2020   a0322200       C2000DL-203       CLA_STL - Implement memcpy to remove dependency on the RTS
// 12/18/2022   a0322200       C2000DL-354       CLA_STL - F28003x - Migrate all updates from F2838x
//---------------------------------------------------------------------------------------------------------------------

#ifndef STL_CLA_INTERNAL_H
#define STL_CLA_INTERNAL_H


#ifdef __cplusplus
extern "C"                                       // If building with a C++ compiler, make all definitions in this header
{                                                // have a C binding.
#endif

//---------------------------------------------------------------------------------------------------------------------
//                                        PRIVILEDGED MACRO DEFINITIONS
//---------------------------------------------------------------------------------------------------------------------
#define HWREGH_PRIV(x) (*((volatile uint16_t *)((uintptr_t)(x))))


#ifdef __cplusplus
}                                                // Mark the end of the C bindings section for C++ compilers.
#endif

#endif                                           // STL_CLA_INTERNAL_H

//---------------------------------------------------------------------------------------------------------------------
// End of File
//---------------------------------------------------------------------------------------------------------------------
