Update repo
This commit is contained in:
1 parent
749dab5721
commit
ce65a0f59a
14950 files changed
+4408250
-1
No files matched your search
@@ -0,0 +1,60 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: Constants.h
|
||||
//
|
||||
// TITLE: A set of Constant Values.
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
#ifndef CONSTANTS_H
|
||||
#define CONSTANTS_H
|
||||
|
||||
#include "F2838x_CM.h"
|
||||
|
||||
/*!
|
||||
\brief Define to map the direct access to the TI OTP memory.
|
||||
*/
|
||||
#define F021_TIOTP_BASE_ADDRESS ((Fapi_TiOtpBytesType *)(F021_PROGRAM_TIOTP_OFFSET + F021_TIOTP_SETTINGS_BASE))
|
||||
|
||||
/*!
|
||||
\brief Define to map the direct access to the FMC registers.
|
||||
*/
|
||||
#define F021_CPU0_BASE_ADDRESS ((Fapi_FmcRegistersType *)F021_CPU0_REGISTER_ADDRESS)
|
||||
|
||||
#endif /* CONSTANTS_H */
|
||||
@@ -0,0 +1,157 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: F2838x_CM.h
|
||||
//
|
||||
// TITLE: A set of Constant Values for the F2838x CM Family.
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
#ifndef F2838x_CM_H
|
||||
#define F2838x_CM_H
|
||||
|
||||
/*!
|
||||
\brief Specifies the bit mask for determining all address bits exclusive of
|
||||
the offest imposed by the memory map register
|
||||
*/
|
||||
#define F021_PROGRAM_ADDRESS_MASK 0x07FFFFFF
|
||||
|
||||
/*!
|
||||
\brief Specifies the Offset to the TI OTP
|
||||
*/
|
||||
|
||||
#define F021_PROGRAM_TIOTP_OFFSET 0x00380000
|
||||
|
||||
|
||||
|
||||
/* Final values to be determined */
|
||||
|
||||
/*!
|
||||
\brief Maximum FClck Value
|
||||
*/
|
||||
#define F021_FCLK_MAX 0x18
|
||||
|
||||
|
||||
/*!
|
||||
\brief PGM_OSU Max Value
|
||||
*/
|
||||
#define F021_PGM_OSU_MAX 0xFF
|
||||
|
||||
/*!
|
||||
\brief PGM_OSU Min Value
|
||||
*/
|
||||
#define F021_PGM_OSU_MIN 0x02
|
||||
|
||||
/*!
|
||||
\brief ERA_OSU Max Value
|
||||
*/
|
||||
#define F021_ERA_OSU_MAX 0xFF
|
||||
|
||||
/*!
|
||||
\brief ERA_OSU Min Value
|
||||
*/
|
||||
#define F021_ERA_OSU_MIN 0x02
|
||||
|
||||
/*!
|
||||
\brief ADD_EXZ Max Value
|
||||
*/
|
||||
#define F021_ADD_EXZ_MAX 0x0F
|
||||
|
||||
/*!
|
||||
\brief ADD_EXZ Min Value
|
||||
*/
|
||||
#define F021_ADD_EXZ_MIN 0x02
|
||||
|
||||
/*!
|
||||
\brief EXE_VALD Max Value
|
||||
*/
|
||||
#define F021_EXE_VALD_MAX 0x0F
|
||||
|
||||
/*!
|
||||
\brief EXE_VALD Min Value
|
||||
*/
|
||||
#define F021_EXE_VALD_MIN 0x02
|
||||
|
||||
/*!
|
||||
\brief PROG_PUL_WIDTH Max Value
|
||||
*/
|
||||
#define F021_PROG_PUL_WIDTH_MAX 0xFFFF
|
||||
|
||||
/*!
|
||||
\brief PROG_PUL_WIDTH Min Value
|
||||
*/
|
||||
#define F021_PROG_PUL_WIDTH_MIN 0x0002
|
||||
|
||||
/*!
|
||||
\brief ERA_PUL_WIDTH Max Value
|
||||
*/
|
||||
#define F021_ERA_PUL_WIDTH_MAX 0xFFFFFFFF
|
||||
|
||||
/*!
|
||||
\brief ERA_PUL_WIDTH Min Value
|
||||
*/
|
||||
#define F021_ERA_PUL_WIDTH_MIN 0x00000002
|
||||
|
||||
/*!
|
||||
* FMC memory map defines
|
||||
*/
|
||||
#if defined (_F2838x_CM)
|
||||
#define F021_FLASH_MAP_BEGIN 0x200000
|
||||
#define F021_FLASH_MAP_END 0x27FFFF
|
||||
#define F021_OTP_MAP_BEGIN 0x3C0000 //USER OTP start
|
||||
#define F021_OTP_MAP_END 0x3C07FF //USER OTP End
|
||||
#define F021_OTPECC_MAP_BEGIN 0x888000
|
||||
#define F021_OTPECC_MAP_END 0x8880FF
|
||||
#define F021_FLASHECC_MAP_BEGIN 0x800000
|
||||
#define F021_FLASHECC_MAP_END 0x80FFFF
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\brief Define to map the direct access to the FMC registers.
|
||||
*/
|
||||
|
||||
#define F021_CPU0_REGISTER_ADDRESS 0x400FA000
|
||||
|
||||
/*!
|
||||
* Specific TI OTP Offsets
|
||||
*/
|
||||
|
||||
#define F021_TIOTP_PER_BANK_SIZE 0x1000 //Even though TI OTP is 2K, Size is mentioned here as 0x800 (4K) because code uses this to find the offset of TI OTP (1, 2) relative to OTP Base address
|
||||
#define F021_TIOTP_SETTINGS_BASE 0x150
|
||||
#define F021_TIOTP_BANK_SECTOR_OFFSET 0x158
|
||||
|
||||
#endif /* F2838x_CM_H */
|
||||
@@ -0,0 +1,161 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: F021.h
|
||||
//
|
||||
// TITLE: Main include file for F021 devices.
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
#ifndef F021_H
|
||||
#define F021_H
|
||||
|
||||
#include "Registers.h"
|
||||
#include "Init.h"
|
||||
#include "Constants/Constants.h"
|
||||
|
||||
#if !defined(F021)
|
||||
#define F021
|
||||
#endif
|
||||
|
||||
/* Flash C API functions*/
|
||||
|
||||
/* Flash State Machine commands */
|
||||
extern Fapi_FlashStatusType Fapi_getFsmStatus(void);
|
||||
|
||||
extern Fapi_StatusType Fapi_checkFsmForReady(void);
|
||||
|
||||
extern Fapi_StatusType Fapi_setActiveFlashBank(Fapi_FlashBankType oNewFlashBank);
|
||||
|
||||
extern Fapi_StatusType Fapi_issueFsmSuspendCommand(void);
|
||||
|
||||
extern void Fapi_flushPipeline(void);
|
||||
|
||||
/* Device Family Dependent FSM commands */
|
||||
extern uint32 * Fapi_remapEccAddress(uint32 u32EccAddress);
|
||||
|
||||
extern boolean Fapi_isAddressEcc(uint32 u32Address);
|
||||
|
||||
/* Async Commands */
|
||||
extern Fapi_StatusType Fapi_issueAsyncCommandWithAddress(
|
||||
Fapi_FlashStateCommandsType oCommand,
|
||||
uint32 *pu32StartAddress
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_issueAsyncCommand(Fapi_FlashStateCommandsType oCommand);
|
||||
|
||||
/* Info Commands */
|
||||
extern Fapi_LibraryInfoType Fapi_getLibraryInfo(void);
|
||||
|
||||
/* Init */
|
||||
extern Fapi_InitStruct Fapi_GlobalInit;
|
||||
extern Fapi_StatusType Fapi_initializeAPI(
|
||||
Fapi_FmcRegistersType *poFlashControlRegister,
|
||||
uint32 u32HclkFrequency
|
||||
);
|
||||
|
||||
/* Read commands */
|
||||
extern Fapi_StatusType Fapi_doBlankCheck(
|
||||
uint32 *pu32StartAddress,
|
||||
uint32 u32Length,
|
||||
Fapi_FlashStatusWordType *poFlashStatusWord
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_doVerify(
|
||||
uint32 *pu32StartAddress,
|
||||
uint32 u32Length,
|
||||
uint32 *pu32CheckValueBuffer,
|
||||
Fapi_FlashStatusWordType *poFlashStatusWord
|
||||
);
|
||||
|
||||
extern uint32 Fapi_calculatePsa(
|
||||
uint32 *pu32StartAddress,
|
||||
uint32 u32Length,
|
||||
uint32 u32PsaSeed,
|
||||
Fapi_FlashReadMarginModeType oReadMode
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_doPsaVerify(
|
||||
uint32 *pu32StartAddress,
|
||||
uint32 u32Length,
|
||||
uint32 u32PsaValue,
|
||||
Fapi_FlashStatusWordType *poFlashStatusWord
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_doBlankCheckByByte(
|
||||
uint8 *pu8StartAddress,
|
||||
uint32 u32Length,
|
||||
Fapi_FlashStatusWordType *poFlashStatusWord
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_doVerifyByByte(
|
||||
uint8 *pu8StartAddress,
|
||||
uint32 u32Length,
|
||||
uint8 *pu8CheckValueBuffer,
|
||||
Fapi_FlashStatusWordType *poFlashStatusWord
|
||||
);
|
||||
|
||||
/* Programming Commands */
|
||||
extern Fapi_StatusType Fapi_issueProgrammingCommand(
|
||||
uint32 *pu32StartAddress,
|
||||
uint8 *pu8DataBuffer,
|
||||
uint8 u8DataBufferSizeInBytes,
|
||||
uint8 *pu8EccBuffer,
|
||||
uint8 u8EccBufferSizeInBytes,
|
||||
Fapi_FlashProgrammingCommandsType oMode
|
||||
);
|
||||
|
||||
extern Fapi_StatusType Fapi_issueProgrammingCommandForEccAddresses(
|
||||
uint32 *pu32StartAddress,
|
||||
uint8 *pu8EccBuffer,
|
||||
uint8 u8EccBufferSizeInBytes
|
||||
);
|
||||
|
||||
/* Utility Commands */
|
||||
extern uint32 Fapi_calculateFletcherChecksum(
|
||||
uint16 const * pu16Data,
|
||||
uint16 u16Length
|
||||
);
|
||||
|
||||
extern uint8 Fapi_calculateEcc(
|
||||
uint32 u32Address,
|
||||
uint64 u64Data
|
||||
);
|
||||
|
||||
|
||||
#endif /*F021_H*/
|
||||
@@ -0,0 +1,58 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: F021_F2838x_CM.h
|
||||
//
|
||||
// TITLE: Setups the defines required for F2838x CM.
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
#ifndef F021_F2838x_CM_H
|
||||
#define F021_F2838x_CM_H
|
||||
|
||||
#if !defined(_F2838x_CM)
|
||||
#define _F2838x_CM
|
||||
#endif
|
||||
|
||||
#if !defined(_LITTLE_ENDIAN)
|
||||
#define _LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#include "F021.h"
|
||||
|
||||
#endif /*F021_F2838x_CM_H*/
|
||||
@@ -0,0 +1,60 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: Init.h
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef INIT_H
|
||||
#define INIT_H
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Fapi_FmcRegistersType *m_poFlashControlRegisters;
|
||||
uint8 m_u8MainBankWidth;
|
||||
uint8 m_u8EeBankWidth;
|
||||
uint8 m_u8MainEccWidth;
|
||||
uint8 m_u8EeEccWidth;
|
||||
uint8 m_u8CurrentRwait;
|
||||
uint8 m_u8CurrentEwait;
|
||||
uint16 m_u16HclkFrequency;
|
||||
} Fapi_InitStruct;
|
||||
|
||||
#endif /* INIT_H */
|
||||
@@ -0,0 +1,58 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: Registers.h
|
||||
//
|
||||
// TITLE: A complete mapping of the F021 Flash Registers
|
||||
//
|
||||
// Allows named access to the F021 Flash Registers.
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
#ifndef REGISTERS_H
|
||||
#define REGISTERS_H
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
/* Flash Configuration Registers */
|
||||
typedef volatile struct FMC_REGISTERS
|
||||
{
|
||||
uint32 u32Register[300];
|
||||
} Fapi_FmcRegistersType;
|
||||
|
||||
#endif /* REGISTERS_H */
|
||||
@@ -0,0 +1,266 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: Types.h
|
||||
//
|
||||
// TITLE: Types used by the F021 API.
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
#ifndef TYPES_H
|
||||
#define TYPES_H
|
||||
|
||||
/*****************************************************************************/
|
||||
/* GLOBAL DEFINITIONS */
|
||||
/*****************************************************************************/
|
||||
#if ((defined(__TMS470__) || defined(__TI_ARM__)) && (__TI_COMPILER_VERSION__ < 5002000))
|
||||
#if !defined(__GNUC__)
|
||||
#error “F021 Flash API requires GCC language extensions. Use the –gcc option.”
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__ICCARM__) /* IAR EWARM Compiler */
|
||||
#define ATTRIBUTE_PACKED __packed
|
||||
#elif defined(__TMS320C28XX__) /* TI CGT C28xx compilers */
|
||||
#define ATTRIBUTE_PACKED
|
||||
#else /* all other compilers */
|
||||
#define ATTRIBUTE_PACKED __attribute__((packed))
|
||||
#endif
|
||||
|
||||
#define HIGH_BYTE_FIRST 0
|
||||
#define LOW_BYTE_FIRST 1
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* ENDIANESS */
|
||||
/*****************************************************************************/
|
||||
|
||||
#if defined(_LITTLE_ENDIAN)
|
||||
#define CPU_BYTE_ORDER LOW_BYTE_FIRST
|
||||
#else
|
||||
#define CPU_BYTE_ORDER HIGH_BYTE_FIRST
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/* TYPE DEFINITIONS */
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef unsigned char boolean;
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned int uint32;
|
||||
typedef unsigned long long int uint64;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32 au32StatusWord[4];
|
||||
} ATTRIBUTE_PACKED Fapi_FlashStatusWordType;
|
||||
|
||||
/*!
|
||||
\brief This contains all the possible modes used in the Fapi_IssueAsyncProgrammingCommand().
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_AutoEccGeneration, /* This is the default mode for the command and will auto generate the ecc for the provided data buffer */
|
||||
Fapi_DataOnly, /* Command will only process the data buffer */
|
||||
Fapi_EccOnly, /* Command will only process the ecc buffer */
|
||||
Fapi_DataAndEcc /* Command will process data and ecc buffers */
|
||||
} ATTRIBUTE_PACKED Fapi_FlashProgrammingCommandsType;
|
||||
|
||||
/*!
|
||||
\brief This is used to indicate which Flash bank is being used.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_FlashBank0,
|
||||
Fapi_FlashBank1,
|
||||
Fapi_FlashBank2,
|
||||
Fapi_FlashBank3,
|
||||
Fapi_FlashBank4,
|
||||
Fapi_FlashBank5,
|
||||
Fapi_FlashBank6,
|
||||
Fapi_FlashBank7
|
||||
} ATTRIBUTE_PACKED Fapi_FlashBankType;
|
||||
|
||||
/*!
|
||||
\brief This contains all the possible Flash State Machine commands.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_ProgramData = 0x0002,
|
||||
Fapi_EraseSector = 0x0006,
|
||||
Fapi_ClearStatus = 0x0010,
|
||||
Fapi_ProgramResume = 0x0014,
|
||||
Fapi_EraseResume = 0x0016,
|
||||
Fapi_ClearMore = 0x0018
|
||||
} ATTRIBUTE_PACKED Fapi_FlashStateCommandsType;
|
||||
|
||||
typedef uint32 Fapi_FlashStatusType;
|
||||
|
||||
/*!
|
||||
\brief This contains all the possible Flash State Machine commands.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_NormalRead = 0x0
|
||||
} ATTRIBUTE_PACKED Fapi_FlashReadMarginModeType;
|
||||
|
||||
/*!
|
||||
\brief This is the master type containing all possible returned status codes.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Fapi_Status_Success=0, /* Function completed successfully */
|
||||
Fapi_Status_FsmBusy, /* FSM is Busy */
|
||||
Fapi_Status_FsmReady, /* FSM is Ready */
|
||||
Fapi_Status_AsyncBusy, /* Async function operation is Busy */
|
||||
Fapi_Status_AsyncComplete, /* Async function operation is Complete */
|
||||
Fapi_Error_Fail=500, /* Generic Function Fail code */
|
||||
Fapi_Error_StateMachineTimeout, /* State machine polling never returned ready and timed out */
|
||||
Fapi_Error_OtpChecksumMismatch, /* Returned if OTP checksum does not match expected value */
|
||||
Fapi_Error_InvalidDelayValue, /* Returned if the Calculated RWAIT value exceeds 15 - Legacy Error */
|
||||
Fapi_Error_InvalidHclkValue, /* Returned if FClk is above max FClk value - FClk is a calculated from HClk and RWAIT/EWAIT */
|
||||
Fapi_Error_InvalidCpu, /* Returned if the specified Cpu does not exist */
|
||||
Fapi_Error_InvalidBank, /* Returned if the specified bank does not exist */
|
||||
Fapi_Error_InvalidAddress, /* Returned if the specified Address does not exist in Flash or OTP */
|
||||
Fapi_Error_InvalidReadMode, /* Returned if the specified read mode does not exist */
|
||||
Fapi_Error_AsyncIncorrectDataBufferLength,
|
||||
Fapi_Error_AsyncIncorrectEccBufferLength,
|
||||
Fapi_Error_AsyncDataEccBufferLengthMismatch,
|
||||
Fapi_Error_FeatureNotAvailable, /* FMC feature is not available on this device */
|
||||
Fapi_Error_FlashRegsNotWritable, /* Returned if Flash registers are not writable due to security */
|
||||
Fapi_Error_InvalidCPUID /* Returned if OTP has an invalid CPUID */
|
||||
} ATTRIBUTE_PACKED Fapi_StatusType;
|
||||
|
||||
typedef union
|
||||
{
|
||||
volatile struct
|
||||
{
|
||||
uint32 ChecksumLength:16; /* 0x150 bits 15:0 */
|
||||
uint32 OtpVersion:16; /* 0x150 bits 31:16 */
|
||||
uint32 OtpChecksum; /* 0x154 bits 31:0 */
|
||||
uint32 NumberOfBanks:16; /* 0x158 bits 15:0 */
|
||||
uint32 NumberOfSectors:16; /* 0x158 bits 31:16 */
|
||||
uint32 MemorySize:16; /* 0x15C bits 15:0 */
|
||||
uint32 Package:16; /* 0x15C bits 31:16 */
|
||||
uint32 SiliconRevision:8; /* 0x160 bits 7:0 */
|
||||
uint32 AsicNumber:24; /* 0x160 bits 31:8 */
|
||||
uint32 LotNumber; /* 0x164 bits 31:0 */
|
||||
uint32 WaferNumber:16; /* 0x168 bits 15:0 */
|
||||
uint32 Flowbits:16; /* 0x168 bits 31:16 */
|
||||
uint32 YCoordinate:16; /* 0x16C bits 15:0 */
|
||||
uint32 XCoordinate:16; /* 0x16C bits 31:16 */
|
||||
uint32 EVSU:8; /* 0x170 bits 7:0 */
|
||||
uint32 PVSU:8; /* 0x170 bits 15:8 */
|
||||
uint32 ESU:8; /* 0x170 bits 23:16 */
|
||||
uint32 PSU:8; /* 0x170 bits 31:24 */
|
||||
uint32 CVSU:12; /* 0x174 bits 11:0 */
|
||||
uint32 Add_EXEZSU:4; /* 0x174 bits 15:12 */
|
||||
uint32 PVAcc:8; /* 0x174 bits 23:16 */
|
||||
uint32 RVSU:8; /* 0x174 bits 31:24 */
|
||||
uint32 PVH2:8; /* 0x178 bits 7:0 */
|
||||
uint32 PVH:8; /* 0x178 bits 15:8 */
|
||||
uint32 RH:8; /* 0x178 bits 23:16 */
|
||||
uint32 PH:8; /* 0x178 bits 31:24 */
|
||||
uint32 SmFrequency:12; /* 0x17C bits 11:0 */
|
||||
uint32 VSTAT:4; /* 0x17C bits 15:12 */
|
||||
uint32 Sequence:8; /* 0x17C bits 23:16 */
|
||||
uint32 EH:8; /* 0x17C bits 31:24 */
|
||||
uint32 VHV_EStep:16; /* 0x180 bits 15:0 */
|
||||
uint32 VHV_EStart:16; /* 0x180 bits 31:16 */
|
||||
uint32 MAX_PP:16; /* 0x184 bits 15:0 */
|
||||
uint32 OtpReserved1:16; /* 0x184 bits 31:16 */
|
||||
uint32 PROG_PW:16; /* 0x188 bits 15:0 */
|
||||
uint32 MAX_EP:16; /* 0x188 bits 31:16 */
|
||||
uint32 ERA_PW; /* 0x18C bits 31:0 */
|
||||
uint32 VHV_E:16; /* 0x190 bits 15:0 */
|
||||
uint32 VHV_P:16; /* 0x190 bits 31:16 */
|
||||
uint32 VINH:8; /* 0x194 bits 7:0 */
|
||||
uint32 VCG:8; /* 0x194 bits 15:8 */
|
||||
uint32 VHV_PV:16; /* 0x194 bits 31:16 */
|
||||
uint32 OtpReserved2:8; /* 0x198 bits 7:0 */
|
||||
uint32 VRead:8; /* 0x198 bits 15:8 */
|
||||
uint32 VWL_P:8; /* 0x198 bits 23:16 */
|
||||
uint32 VSL_P:8; /* 0x198 bits 31:24 */
|
||||
uint32 ApiChecksum:32; /* 0x19C bits 31:0 */
|
||||
uint32 OtpReserved3:32; /* 0x1A0 bits 31:0 */
|
||||
uint32 OtpReserved4:32; /* 0x1A4 bits 31:0 */
|
||||
uint32 OtpReserved5:32; /* 0x1A8 bits 31:0 */
|
||||
uint32 OtpReserved6:32; /* 0x1AC bits 31:0 */
|
||||
} OTP_VALUE;
|
||||
volatile uint32 au32OtpWord[0x18];
|
||||
}Fapi_TiOtpBytesType;
|
||||
|
||||
|
||||
/*!
|
||||
\brief
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
Alpha_Internal, /* For internal TI use only. Not intended to be used by customers */
|
||||
Alpha, /* Early Engineering release. May not be functionally complete */
|
||||
Beta_Internal, /* For internal TI use only. Not intended to be used by customers */
|
||||
Beta, /* Functionally complete, to be used for testing and validation */
|
||||
Production /* Fully validated, functionally complete, ready for production use */
|
||||
} ATTRIBUTE_PACKED Fapi_ApiProductionStatusType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8 u8ApiMajorVersion;
|
||||
uint8 u8ApiMinorVersion;
|
||||
uint8 u8ApiRevision;
|
||||
Fapi_ApiProductionStatusType oApiProductionStatus;
|
||||
uint32 u32ApiBuildNumber;
|
||||
uint8 u8ApiTechnologyType;
|
||||
uint8 u8ApiTechnologyRevision;
|
||||
uint8 u8ApiEndianness;
|
||||
uint32 u32ApiCompilerVersion;
|
||||
} Fapi_LibraryInfoType;
|
||||
|
||||
|
||||
|
||||
#endif /* TYPES_H */
|
||||
Binary file not shown.
Reference in new issue
Block a user