Update repo

This commit is contained in:
hangpersonal committed 2026-08-30 23:04:35 -07:00
1 parent 749dab5721
commit ce65a0f59a
14950 files changed
+4408250 -1

No files matched your search

+1
View File
@@ -0,0 +1 @@
../../device_support/f2838x/docs
+303
View File
@@ -0,0 +1,303 @@
//###########################################################################
//
// FILE: adc.c
//
// TITLE: C28x ADC driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "adc.h"
//
// The following macro calculates the INL trim location in OTP memory
// required to calibrate the ADC linearity. Use this in the
// ADC_setMode() function only.
//
#define ADC_getINLTrimOTPLoc(offset) ((uint32_t *)(0x70128U + (0xCU * offset)))
//
// This macro calculates the ADC offset trim location in OTP memory required
// to calibrate ADC offset. Use this in the ADC_setMode() function only.
//
#define ADC_getOffsetTrimOTPLoc(offset) ((uint16_t *)(0x70158U + offset))
//
// TI-OTP key value expected to be programmed in trimmed device
//
#define TI_OTP_DEV_KEY (0x5A5AU)
//
// Macro to read the key value programmed in the device
//
#define TI_OTP_DEV_PRG_KEY (HWREGH(0x70238UL))
//*****************************************************************************
//
// ADC_setMode
//
//*****************************************************************************
void
ADC_setMode(uint32_t base, ADC_Resolution resolution,
ADC_SignalMode signalMode)
{
//
// Check the arguments.
//
ASSERT(ADC_isBaseValid(base));
//
// Check for correct signal mode & resolution. In this device:
// Differential signal conversions are supported in 16-bit only
//
if(signalMode == ADC_MODE_DIFFERENTIAL)
{
ASSERT(resolution == ADC_RESOLUTION_16BIT);
}
//
// Apply the resolution and signalMode to the specified ADC.
//
EALLOW;
HWREGH(base + ADC_O_CTL2) = (HWREGH(base + ADC_O_CTL2) &
~(ADC_CTL2_RESOLUTION | ADC_CTL2_SIGNALMODE)) |
((uint16_t)resolution | (uint16_t)signalMode);
EDIS;
//
// Apply INL and offset trims
//
ADC_setINLTrim(base);
ADC_setOffsetTrim(base);
}
//*****************************************************************************
//
// ADC_setINLTrim
//
//*****************************************************************************
void
ADC_setINLTrim(uint32_t base)
{
uint16_t i;
uint32_t * inlTrimAddress;
ADC_Resolution resolution;
//
// Check the arguments.
//
ASSERT(ADC_isBaseValid(base));
resolution = (ADC_Resolution)
(HWREGH(base + ADC_O_CTL2) & ADC_CTL2_RESOLUTION);
if(TI_OTP_DEV_PRG_KEY == TI_OTP_DEV_KEY)
{
switch(base)
{
case ADCA_BASE:
inlTrimAddress = ADC_getINLTrimOTPLoc(0U);
break;
case ADCB_BASE:
inlTrimAddress = ADC_getINLTrimOTPLoc(1U);
break;
case ADCC_BASE:
inlTrimAddress = ADC_getINLTrimOTPLoc(2U);
break;
case ADCD_BASE:
inlTrimAddress = ADC_getINLTrimOTPLoc(3U);
break;
default:
//
// Invalid base address!
//
inlTrimAddress = ADC_getINLTrimOTPLoc(0U);
break;
}
//
// Update INL trim values to ADC trim registers
//
EALLOW;
for(i = 0U; i < 6U; i++)
{
HWREG(base + ADC_O_INLTRIM1 + (i * 2U)) = (*inlTrimAddress++);
}
//
// Apply linearity trim workaround for 12-bit resolution
//
if(resolution == ADC_RESOLUTION_12BIT)
{
//
// 12-bit linearity trim workaround
//
HWREG(base + ADC_O_INLTRIM1) &= 0xFFFF0000U;
HWREG(base + ADC_O_INLTRIM2) &= 0xFFFF0000U;
HWREG(base + ADC_O_INLTRIM4) &= 0xFFFF0000U;
HWREG(base + ADC_O_INLTRIM5) &= 0xFFFF0000U;
}
EDIS;
}
}
//*****************************************************************************
//
// ADC_setOffsetTrim
//
//*****************************************************************************
void
ADC_setOffsetTrim(uint32_t base)
{
uint16_t offsetIndex = 0U, offsetTrim = 0U;
ADC_Resolution resolution;
ADC_SignalMode signalMode;
//
// Check the arguments.
//
ASSERT(ADC_isBaseValid(base));
//
// Check the configured resoultion and signal mode for the ADC base.
//
resolution = (ADC_Resolution)
(HWREGH(base + ADC_O_CTL2) & ADC_CTL2_RESOLUTION);
signalMode = (ADC_SignalMode)
(HWREGH(base + ADC_O_CTL2) & ADC_CTL2_SIGNALMODE);
//
// Get the offset index for the ADC base
//
switch(base)
{
case ADCA_BASE:
offsetIndex = (uint16_t)(0U);
break;
case ADCB_BASE:
offsetIndex = (uint16_t)(1U);
break;
case ADCC_BASE:
offsetIndex = (uint16_t)(2U);
break;
case ADCD_BASE:
offsetIndex = (uint16_t)(3U);
break;
default:
//
// Invalid base address!
//
offsetIndex = (uint16_t)(0U);
break;
}
//
// Get the offset trim value programmed into OTP
//
offsetIndex += (4U * ((resolution == ADC_RESOLUTION_16BIT) ? 1U : 0U));
if(TI_OTP_DEV_PRG_KEY == TI_OTP_DEV_KEY)
{
offsetTrim = (*(uint16_t *)(ADC_getOffsetTrimOTPLoc(offsetIndex)));
offsetTrim = (signalMode == ADC_MODE_SINGLE_ENDED) ?
(offsetTrim >> 8U):(offsetTrim & 0xFFU);
}
else
{
offsetTrim = 0U;
}
//
// Configure the offset trim, offset trim is not updated here in case of
// untrimmed devices.
//
if(offsetTrim > 0x0U)
{
EALLOW;
HWREGH(base + ADC_O_OFFTRIM) = offsetTrim;
EDIS;
}
}
//*****************************************************************************
//
// ADC_setPPBTripLimits
//
//*****************************************************************************
void
ADC_setPPBTripLimits(uint32_t base, ADC_PPBNumber ppbNumber,
int32_t tripHiLimit, int32_t tripLoLimit)
{
uint32_t ppbHiOffset;
uint32_t ppbLoOffset;
//
// Check the arguments.
//
ASSERT(ADC_isBaseValid(base));
ASSERT((tripHiLimit <= 65535) && (tripHiLimit >= -65536));
ASSERT((tripLoLimit <= 65535) && (tripLoLimit >= -65536));
//
// Get the offset to the appropriate trip limit registers.
//
ppbHiOffset = (ADC_PPBxTRIPHI_STEP * (uint32_t)ppbNumber) +
ADC_O_PPB1TRIPHI;
ppbLoOffset = (ADC_PPBxTRIPLO_STEP * (uint32_t)ppbNumber) +
ADC_O_PPB1TRIPLO;
EALLOW;
//
// Set the trip high limit.
//
HWREG(base + ppbHiOffset) =
(HWREG(base + ppbHiOffset) & ~ADC_PPBTRIP_MASK) |
((uint32_t)tripHiLimit & ADC_PPBTRIP_MASK);
//
// Set the trip low limit.
//
HWREG(base + ppbLoOffset) =
(HWREG(base + ppbLoOffset) & ~ADC_PPBTRIP_MASK) |
((uint32_t)tripLoLimit & ADC_PPBTRIP_MASK);
EDIS;
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,43 @@
//###########################################################################
//
// FILE: asysctl.c
//
// TITLE: C28x Driver for Analog System Control.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "asysctl.h"
@@ -0,0 +1,160 @@
//###########################################################################
//
// FILE: asysctl.h
//
// TITLE: C28x driver for Analog System Control.
//
//###########################################################################
//
// 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 ASYSCTL_H
#define ASYSCTL_H
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
//
//! \addtogroup asysctl_api ASysCtl
//! @{
//
//*****************************************************************************
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_asysctl.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "debug.h"
#include "cpu.h"
//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************
//*****************************************************************************
//
//! Enable temperature sensor.
//!
//! This function enables the temperature sensor output to the ADC.
//!
//! \return None.
//
//*****************************************************************************
static inline void
ASysCtl_enableTemperatureSensor(void)
{
EALLOW;
//
// Set the temperature sensor enable bit.
//
HWREGH(ANALOGSUBSYS_BASE + ASYSCTL_O_TSNSCTL) |= ASYSCTL_TSNSCTL_ENABLE;
EDIS;
}
//*****************************************************************************
//
//! Disable temperature sensor.
//!
//! This function disables the temperature sensor output to the ADC.
//!
//! \return None.
//
//*****************************************************************************
static inline void
ASysCtl_disableTemperatureSensor(void)
{
EALLOW;
//
// Clear the temperature sensor enable bit.
//
HWREGH(ANALOGSUBSYS_BASE + ASYSCTL_O_TSNSCTL) &= ~(ASYSCTL_TSNSCTL_ENABLE);
EDIS;
}
//*****************************************************************************
//
//! Locks the temperature sensor control register.
//!
//! \return None.
//
//*****************************************************************************
static inline void ASysCtl_lockTemperatureSensor(void)
{
EALLOW;
//
// Write a 1 to the lock bit in the LOCK register.
//
HWREGH(ANALOGSUBSYS_BASE + ASYSCTL_O_LOCK) |= ASYSCTL_LOCK_TSNSCTL;
EDIS;
}
//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // ASYSCTL_H
@@ -0,0 +1,44 @@
//###########################################################################
//
// FILE: bgcrc.c
//
// TITLE: C28x BGCRC driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "bgcrc.h"
@@ -0,0 +1,955 @@
//###########################################################################
//
// FILE: bgcrc.h
//
// TITLE: C28x BGCRC driver.
//
//###########################################################################
//
// 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 BGCRC_H
#define BGCRC_H
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
//
//! \addtogroup bgcrc_api BGCRC
//! \brief This module is used for configuring BGCRC.
//! @{
//
//*****************************************************************************
#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_bgcrc.h"
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "debug.h"
#include "cpu.h"
//*****************************************************************************
//
//! Values that can be passed to BGCRC_setConfig() as the \e nmiConfig
//! parameter
//
//*****************************************************************************
#define BGCRC_NMI_ENABLE 0x5U //!< Generate NMI on memory check failure
#define BGCRC_NMI_DISABLE 0xAU //!< Do not generate NMI on memory check
//!<failure
//*****************************************************************************
//
//! Values that can be passed to BGCRC_setConfig() as the \e emuCtrl parameter
//
//*****************************************************************************
#define BGCRC_EMUCTRL_SOFT 0x00U //!< CRC module and CRC watchdog stops
//!< immediately on DEBUG SUSPEND
#define BGCRC_EMUCTRL_FREE 0x10U //!< CRC calculation and CRC watchdog is
//!< not affected by DEBUG HALT
//*****************************************************************************
//
//! Values that can be passed to BGCRC_setRegion() as the \e mode parameter
//
//*****************************************************************************
#define BGCRC_SCRUB_MODE 0xAU //!< CRC of data is not compared with the
//!< golden CRC. Error check is done using
//!< the ECC/Parity logic.
#define BGCRC_CRC_MODE 0x5U //!< CRC value is compared with golden CRC
//!< at the end in addition to the data
//!< correctness check by ECC/Parity logic
//*****************************************************************************
//
//! Values that can be passed to all interrupt/NMI functions as \e intflags or
//! \e nmiflags parameter
//
//*****************************************************************************
#define BGCRC_GLOBAL_INT 0x01U //!< Global Interrupt
#define BGCRC_TEST_DONE 0x02U //!< Test done interrupt
#define BGCRC_CRC_FAIL 0x04U //!< CRC Fail Interrupt/NMI
#define BGCRC_UNCORR_ERR 0x08U //!< Uncorrectable Error Interrupt/NMI
#define BGCRC_CORR_ERR 0x10U //!< Correctable Error Interrupt/NMI
#define BGCRC_WD_UNDERFLOW 0x20U //!< Watchdog Underflow Error Interrupt/NMI
#define BGCRC_WD_OVERFLOW 0x40U //!< Watchdog Overflow Error Interrupt/NMI
#define BGCRC_ALL_ERROR_FLAGS (BGCRC_CRC_FAIL | BGCRC_UNCORR_ERR | \
BGCRC_CORR_ERR | BGCRC_WD_UNDERFLOW | \
BGCRC_WD_OVERFLOW)
//*****************************************************************************
//
//! Values that can be passed to BGCRC_setRegion as the \e blockSize parameter
//! For example, to configure a region of size 2.5KB, set \e blockSize as
//! BGCRC_SIZE_KBYTES(2) + BGCRC_SIZE_BYTES_512
//
//*****************************************************************************
#define BGCRC_SIZE_BYTES_0 0U
#define BGCRC_SIZE_BYTES_256 1U
#define BGCRC_SIZE_BYTES_512 2U
#define BGCRC_SIZE_BYTES_768 3U
#define BGCRC_SIZE_KBYTES(x) (4U * (x))
//*****************************************************************************
//
//! Values returned by the function BGCRC_getRunStatus
//
//*****************************************************************************
#define BGCRC_ACTIVE 0x80000000U
#define BGCRC_IDLE 0x00000000U
//*****************************************************************************
//
//! Values that can be passed to BGCRC_lockRegister(), BGCRC_unlockRegister()
//! and BGCRC_commitLockRegister() as the \e regs parameter
//!
//
//*****************************************************************************
#define BGCRC_REG_EN 0x00000001U
#define BGCRC_REG_CTRL1 0x00000002U
#define BGCRC_REG_CTRL2 0x00000004U
#define BGCRC_REG_START_ADDR 0x00000008U
#define BGCRC_REG_SEED 0x00000010U
#define BGCRC_REG_GOLDEN 0x00000080U
#define BGCRC_REG_WD_CFG 0x00004000U
#define BGCRC_REG_WD_MIN 0x00008000U
#define BGCRC_REG_WD_MAX 0x00010000U
#define BGCRC_REG_NMIFRC 0x00800000U
#define BGCRC_REG_INTEN 0x04000000U
#define BGCRC_REG_INTFRC 0x20000000U
#define BGCRC_REG_ALL 0xFFFFFFFFU
//*****************************************************************************
//
//! Values that are used by the BGCRC APIs
//
//*****************************************************************************
#define BGCRC_WD_ENABLE 0x5UL
#define BGCRC_WD_DISABLE 0xAUL
#define BGCRC_START_KEY 0xAUL
#define BGCRC_HALT_KEY 0xAUL
//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************
//*****************************************************************************
//
//! \internal
//! Checks an BGCRC base address.
//!
//! \param base is the BGCRC module base address.
//!
//! This function determines if a BGCRC module base address is valid.
//!
//! \return Returns \b true if the base address is valid and \b false
//! otherwise.
//
//*****************************************************************************
#ifdef DEBUG
static inline bool
BGCRC_isBaseValid(uint32_t base)
{
return(
(base == BGCRC_CPU_BASE) ||
(base == BGCRC_CLA1_BASE)
);
}
#endif
//*****************************************************************************
//
//! Sets the NMI and emulation control configurations
//!
//! \param base is the BGCRC module base address.
//! \param nmiConfig specifies whether NMI needs to be enabled or not for
//! memory check failure
//! \param emuCtrl specifies the behaviour of CRC during emulation
//!
//! This function configures the NMI and emulation control configurations for
//! the BGCRC module.
//!
//! \e nmiConfig can take values \b BGCRC_NMI_ENABLE or \b BGCRC_NMI_DISABLE.
//! NMI is enabled by default for the memory check failures.
//!
//! \e emuCtrl can take values \b BGCRC_EMUCTRL_FREE or \b BGCRC_EMUCTRL_SOFT.
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_setConfig(uint32_t base, uint32_t nmiConfig, uint32_t emuCtrl)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
ASSERT((nmiConfig == BGCRC_NMI_ENABLE) || (nmiConfig == BGCRC_NMI_DISABLE));
ASSERT((emuCtrl == BGCRC_EMUCTRL_FREE) || (emuCtrl == BGCRC_EMUCTRL_SOFT));
//
// Set emulation control and NMI configuration
//
EALLOW;
HWREG(base + BGCRC_O_CTRL1) = (nmiConfig << BGCRC_CTRL1_NMIDIS_S) | emuCtrl;
EDIS;
}
//*****************************************************************************
//
//! Enables the watchdog
//!
//! \param base is the BGCRC module base address.
//!
//! This function enables the BGCRC watchdog timer. The counter is started
//! when the BGCRC test starts
//!
//! \note The watchDog window can be configured using the function
//! BGCRC_setWatchdogWindow()
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_enableWatchdog(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
//
// Enable watchdog
//
EALLOW;
HWREG(base + BGCRC_O_WD_CFG) = BGCRC_WD_ENABLE;
EDIS;
}
//*****************************************************************************
//
//! Disables the watchdog
//!
//! \param base is the BGCRC module base address.
//!
//! This function disables the BGCRC watchdog.
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_disableWatchdog(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
//
// Disable watchdog
//
EALLOW;
HWREG(base + BGCRC_O_WD_CFG) = BGCRC_WD_DISABLE;
EDIS;
}
//*****************************************************************************
//
//! Configures the BGCRC watchdog window
//!
//! \param base is the BGCRC module base address.
//! \param min is minimum value configuration for the windowed watchdog
//! \param max is maximum value configuration for the windowed watchdog
//!
//! This function configures the BGCRC windowed watchdog
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_setWatchdogWindow(uint32_t base, uint32_t min, uint32_t max)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
ASSERT(max > min);
//
// Set the min and max values
//
EALLOW;
HWREG(base + BGCRC_O_WD_MIN) = min;
HWREG(base + BGCRC_O_WD_MAX) = max;
EDIS;
}
//*****************************************************************************
//
//! Configures the memory region for check
//!
//! \param base is the BGCRC module base address.
//! \param startAddr is the start address of the block
//! \param blockSize is the size of the block
//! \param mode is the BGCRC test mode
//!
//! This function configures the memory region to be checked
//!
//! \e blockSize can take values \b BGCRC_SIZE_KBYTES(x) and/or
//! \b BGCRC_SIZE_BYTES_x. For example, to configure a region of size 2.5KB,
//! set \e blockSize as BGCRC_SIZE_KBYTES(2) + BGCRC_SIZE_BYTES_512
//!
//! \e mode can take values \b BGCRC_SCRUB_MODE or \b BGCRC_CRC_MODE. In Scrub
//! mode, CRC of data is not compared with the golden CRC. Error check is done
//! using the ECC/Parity logic. In CRC mode, value is compared with golden CRC
//! at the end in addition to the data correctness check by ECC/Parity logic.
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_setRegion(uint32_t base, uint32_t startAddr,
uint32_t blockSize, uint32_t mode)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
ASSERT((blockSize > BGCRC_SIZE_BYTES_0) &&
(blockSize <= BGCRC_SIZE_KBYTES(256U)));
ASSERT((mode == BGCRC_SCRUB_MODE) || (mode == BGCRC_CRC_MODE));
//
// Set the start address and size of the block. Set the mode of operation
//
EALLOW;
HWREG(base + BGCRC_O_START_ADDR) = startAddr;
HWREG(base + BGCRC_O_CTRL2) =
((blockSize - 1U) << BGCRC_CTRL2_BLOCK_SIZE_S) |
(mode << BGCRC_CTRL2_SCRUB_MODE_S);
EDIS;
}
//*****************************************************************************
//
//! Gets the BGCRC watchdog counter value
//!
//! \param base is the BGCRC module base address.
//!
//! This function returns the BGCRC watchdog counter value
//!
//! \return Watchdog counter value.
//
//*****************************************************************************
static inline uint32_t
BGCRC_getWatchdogCounterValue(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
return(HWREG(base + BGCRC_O_WD_CNT));
}
//*****************************************************************************
//
//! Enables individual BGCRC interrupt sources
//!
//! \param base is the BGCRC module base address.
//! \param intFlags is the bit mask of the interrupt sources to be disabled.
//!
//! This function enables the indicated BGCRC interrupt sources. Only the
//! sources that are enabled can be reflected to the processor interrupt,
//! disabled sources have no effect on the processor.
//!
//! The \e intFlags parameter is the logical OR of any of the following:
//!
//! - \b BGCRC_TEST_DONE - Test done interrupt
//! - \b BGCRC_CRC_FAIL - CRC Fail Interrupt
//! - \b BGCRC_UNCORR_ERR - Uncorrectable Error Interrupt
//! - \b BGCRC_CORR_ERR - Correctable Error Interrupt
//! - \b BGCRC_WD_UNDERFLOW - Watchdog Underflow Error Interrupt
//! - \b BGCRC_WD_OVERFLOW - Watchdog Overflow Error Interrupt
//!
//! \return None
//
//*****************************************************************************
static inline void
BGCRC_enableInterrupt(uint32_t base, uint32_t intFlags)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
ASSERT((intFlags & (BGCRC_TEST_DONE | BGCRC_ALL_ERROR_FLAGS)) == intFlags);
EALLOW;
HWREG(base + BGCRC_O_INTEN) |= intFlags;
EDIS;
}
//*****************************************************************************
//
//! Disables individual BGCRC interrupt sources.
//!
//! \param base is the BGCRC module base address.
//! \param intFlags is the bit mask of the interrupt sources to be disabled.
//!
//! This function disables the indicated BGCRC interrupt sources. Only the
//! sources that are enabled can be reflected to the processor interrupt
//! disabled sources have no effect on the processor.
//!
//! The \e intFlags parameter has the same definition as the
//! \e intFlags parameter to BGCRC_enableInterrupt().
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_disableInterrupt(uint32_t base, uint32_t intFlags)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
ASSERT((intFlags & (BGCRC_TEST_DONE | BGCRC_ALL_ERROR_FLAGS)) == intFlags);
EALLOW;
HWREG(base + BGCRC_O_INTEN) &= ~intFlags;
EDIS;
}
//*****************************************************************************
//
//! Gets the current BGCRC interrupt status
//!
//! \param base is the BGCRC module base address
//!
//! This function returns the status of the BGCRC interrupts
//!
//! \return The current interrupt status, which is a logical OR of any of the
//! following:
//!
//! - \b BGCRC_GLOBAL_INT - Global Interrupt
//! - \b BGCRC_TEST_DONE - Test done interrupt
//! - \b BGCRC_CRC_FAIL - CRC Fail Interrupt
//! - \b BGCRC_UNCORR_ERR - Uncorrectable Error Interrupt
//! - \b BGCRC_CORR_ERR - Correctable Error Interrupt
//! - \b BGCRC_WD_UNDERFLOW - Watchdog Underflow Error Interrupt
//! - \b BGCRC_WD_OVERFLOW - Watchdog Overflow Error Interrupt
//
//*****************************************************************************
static inline uint32_t
BGCRC_getInterruptStatus(uint32_t base)
{
return(HWREG(base + BGCRC_O_INTFLG));
}
//*****************************************************************************
//
//! Clears the BGCRC interrupt sources
//!
//! \param base is the BGCRC module base address
//! \param intFlags is a bit mask of the interrupt sources to be cleared.
//!
//! The specified BGCRC interrupt sources are cleared, so that they no longer
//! assert. This function must be called in the interrupt handler to keep the
//! interrupt from being triggered again immediately upon exit.
//!
//! The \e intFlags parameter has the same definition as the
//! \e intFlags parameter to BGCRC_getInterruptStatus().
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_clearInterruptStatus(uint32_t base, uint32_t intFlags)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
ASSERT((intFlags & (BGCRC_GLOBAL_INT | BGCRC_TEST_DONE |
BGCRC_ALL_ERROR_FLAGS)) == intFlags);
EALLOW;
HWREG(base + BGCRC_O_INTCLR) = intFlags;
EDIS;
}
//*****************************************************************************
//
//! Force the BGCRC interrupt flag
//!
//! \param base is the BGCRC module base address
//! \param intFlags is a bit mask of the interrupt flags to be forced.
//!
//! This function forces the specified interrupt flags
//!
//! The \e intFlags parameter has the same definition as the
//! \e intFlags parameter to BGCRC_enableInterrupt().
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_forceInterrupt(uint32_t base, uint32_t intFlags)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
ASSERT((intFlags & (BGCRC_TEST_DONE | BGCRC_ALL_ERROR_FLAGS)) == intFlags);
EALLOW;
HWREG(base + BGCRC_O_INTFRC) = intFlags;
EDIS;
}
//*****************************************************************************
//
//! Gets the current BGCRC NMI status
//!
//! \param base is the BGCRC module base address
//!
//! This function returns the status of the BGCRC NMI flags
//!
//! \return The current NMI status, which is a logical OR of any of the
//! following:
//!
//! - \b BGCRC_CRC_FAIL - CRC Fail NMI
//! - \b BGCRC_UNCORR_ERR - Uncorrectable Error NMI
//! - \b BGCRC_CORR_ERR - Correctable Error NMI
//! - \b BGCRC_WD_UNDERFLOW - Watchdog Underflow Error NMI
//! - \b BGCRC_WD_OVERFLOW - Watchdog Overflow Error NMI
//
//*****************************************************************************
static inline uint32_t
BGCRC_getNMIStatus(uint32_t base)
{
return(HWREG(base + BGCRC_O_NMIFLG));
}
//*****************************************************************************
//
//! Clears the BGCRC NMI sources
//!
//! \param base is the BGCRC module base address
//! \param nmiFlags is a bit mask of the NMI sources to be cleared.
//!
//! The specified BGCRC NMI sources are cleared, so that they no longer
//! assert. This function must be called in the NMI handler to keep the
//! NMI from being triggered again immediately upon exit.
//!
//! The \e nmiFlags parameter has the same definition as the
//! \e nmiFlags parameter to BGCRC_getNMIStatus().
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_clearNMIStatus(uint32_t base, uint32_t nmiFlags)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
ASSERT((nmiFlags & BGCRC_ALL_ERROR_FLAGS) == nmiFlags);
EALLOW;
HWREG(base + BGCRC_O_NMICLR) = nmiFlags;
EDIS;
}
//*****************************************************************************
//
//! Force the BGCRC NMI flag
//!
//! \param base is the BGCRC module base address
//! \param nmiFlags is a bit mask of the NMI flags to be forced.
//!
//! This function forces the specified interrupt flags
//!
//! The \e nmiFlags parameter has the same definition as the
//! \e nmiFlags parameter to BGCRC_getNMIStatus().
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_forceNMI(uint32_t base, uint32_t nmiFlags)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
ASSERT((nmiFlags & BGCRC_ALL_ERROR_FLAGS) == nmiFlags);
EALLOW;
HWREG(base + BGCRC_O_NMIFRC) = nmiFlags;
EDIS;
}
//*****************************************************************************
//
//! Sets the golden CRC value
//!
//! \param base is the BGCRC module base address
//! \param crcVal is a golden CRC value to be programmed
//!
//! This function sets the golden CRC value of the memory block being tested.
//! If run in CRC mode, the calculated CRC value is compared with golden CRC
//! and status is updated.
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_setGoldenCRCValue(uint32_t base, uint32_t crcVal)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
EALLOW;
HWREG(base + BGCRC_O_GOLDEN) = crcVal;
EDIS;
}
//*****************************************************************************
//
//! Starts the module operation
//!
//! \param base is the BGCRC module base address
//!
//! This function starts the module operation. Calling this function during
//! the CRC calculation will reset and re-start the CRC calculation.
//! This also resets the watchdog timer.
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_start(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
EALLOW;
HWREG(base + BGCRC_O_EN) = BGCRC_START_KEY;
EDIS;
}
//*****************************************************************************
//
//! Halts the module operation
//!
//! \param base is the BGCRC module base address
//!
//! This function halts the module operation. This function does not stall the
//! watchdog timer.
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_halt(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
EALLOW;
HWREG(base + BGCRC_O_CTRL2) =
(HWREG(base + BGCRC_O_CTRL2) & ~BGCRC_CTRL2_TEST_HALT_M) |
(BGCRC_HALT_KEY << BGCRC_CTRL2_TEST_HALT_S);
EDIS;
}
//*****************************************************************************
//
//! Resumes the module operation
//!
//! \param base is the BGCRC module base address
//!
//! This function resumes the module operation. The CRC calculation will
//! continue/resume from where it was halted
//!
//! \return None.
//
//*****************************************************************************
static inline void
BGCRC_resume(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
EALLOW;
HWREG(base + BGCRC_O_CTRL2) &= ~BGCRC_CTRL2_TEST_HALT_M;
EDIS;
}
//*****************************************************************************
//
//! Gets the running status of the module
//!
//! \param base is the BGCRC module base address
//!
//! This function returns whether the module is in ACTIVE or IDLE state
//!
//! \return \b BGCRC_ACTIVE if CRC module is active,
//! \b BGCRC_IDLE if CRC module is idle
//
//*****************************************************************************
static inline uint32_t
BGCRC_getRunStatus(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
return(HWREG(base + BGCRC_O_EN) & BGCRC_EN_RUN_STS);
}
//*****************************************************************************
//
//! Sets the seed value for CRC calculations
//!
//! \param base is the BGCRC module base address
//! \param seed is the seed value to be set
//!
//! This function sets the seed value for the CRC calculations
//!
//! \return None
//
//*****************************************************************************
static inline void
BGCRC_setSeedValue(uint32_t base, uint32_t seed)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
EALLOW;
HWREG(base + BGCRC_O_SEED) = seed;
EDIS;
}
//*****************************************************************************
//
//! Gets the calculated CRC value
//!
//! \param base is the BGCRC module base address
//!
//! This function returns the calculated CRC value
//!
//! \return 32-bit CRC result
//
//*****************************************************************************
static inline uint32_t
BGCRC_getResult(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
return(HWREG(base + BGCRC_O_RESULT));
}
//*****************************************************************************
//
//! Gets the current address
//!
//! \param base is the BGCRC module base address
//!
//! This function returns the current address from where the data is fetched
//!
//! \return 32-bit address
//
//*****************************************************************************
static inline uint32_t
BGCRC_getCurrentAddress(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
return(HWREG(base + BGCRC_O_CURR_ADDR));
}
//*****************************************************************************
//
//! Locks the register configuration
//!
//! \param base is the BGCRC module base address
//! \param regs is the configuration registers to be locked
//!
//! This function locks the register configuration. The register once
//! locked, cannot be updated until the lock is removed
//!
//! The \e regs parameter is the logical OR of any of the following:
//!
//! - \b BGCRC_REG_EN
//! - \b BGCRC_REG_CTRL1
//! - \b BGCRC_REG_CTRL2
//! - \b BGCRC_REG_START_ADDR
//! - \b BGCRC_REG_SEED
//! - \b BGCRC_REG_GOLDEN
//! - \b BGCRC_REG_WD_CFG
//! - \b BGCRC_REG_WD_MIN
//! - \b BGCRC_REG_WD_MAX
//! - \b BGCRC_REG_NMIFRC
//! - \b BGCRC_REG_INTEN
//! - \b BGCRC_REG_INTFRC
//! - \b BGCRC_REG_ALL
//!
//! \return None
//
//*****************************************************************************
static inline void
BGCRC_lockRegister(uint32_t base, uint32_t regs)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
EALLOW;
HWREG(base + BGCRC_O_LOCK) |= regs;
EDIS;
}
//*****************************************************************************
//
//! Unlocks the register configuration
//!
//! \param base is the BGCRC module base address
//! \param regs is the configuration registers to be unlocked
//!
//! This function unlocks the register configuration.
//!
//! The \e regs parameter has the same definition as the \e regs parameter
//! to BGCRC_lockRegister().
//!
//! \return None
//
//*****************************************************************************
static inline void
BGCRC_unlockRegister(uint32_t base, uint32_t regs)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
EALLOW;
HWREG(base + BGCRC_O_LOCK) &= ~regs;
EDIS;
}
//*****************************************************************************
//
//! Commits the register configuration
//!
//! \param base is the BGCRC module base address
//! \param regs is the configuration registers to be unlocked
//!
//! This function commits the register configuration. Once configuration is
//! committed, only reset can change the configuration.
//!
//! The \e regs parameter has the same definition as the \e regs parameter
//! to BGCRC_lockRegister().
//!
//! \return None
//
//*****************************************************************************
static inline void
BGCRC_commitRegisterLock(uint32_t base, uint32_t regs)
{
//
// Check the arguments.
//
ASSERT(BGCRC_isBaseValid(base));
EALLOW;
HWREG(base + BGCRC_O_COMMIT) |= regs;
EDIS;
}
//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // BGCRC_H
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,52 @@
<projectSpec>
<project
name="f2838x_driverlib"
device="Generic C28xx Device"
cgtVersion="22.6.1.LTS"
products="C2000WARE"
launchWizard="False"
outputType="staticLibrary"
location="."
outputFormat="ELF"
>
<configuration name="Debug" compilerBuildOptions="--opt_level=off -I../ -v28 -ml -mt --float_support=fpu64 --abi=eabi --define=DEBUG -g --diag_warning=225 --diag_wrap=off --gen_func_subsections=on --gen_data_subsections=on " archiverBuildOptions="driverlib.lib" />
<configuration name="Release" compilerBuildOptions="-O2 -I../ -v28 -ml -mt --float_support=fpu64 -g --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --gen_data_subsections=on --abi=eabi" archiverBuildOptions="driverlib.lib" />
<file action="link" path="../adc.c" targetDirectory="." />
<file action="link" path="../asysctl.c" targetDirectory="." />
<file action="link" path="../bgcrc.c" targetDirectory="." />
<file action="link" path="../can.c" targetDirectory="." />
<file action="link" path="../cla.c" targetDirectory="." />
<file action="link" path="../clb.c" targetDirectory="." />
<file action="link" path="../cmpss.c" targetDirectory="." />
<file action="link" path="../cputimer.c" targetDirectory="." />
<file action="link" path="../dac.c" targetDirectory="." />
<file action="link" path="../dcc.c" targetDirectory="." />
<file action="link" path="../dcsm.c" targetDirectory="." />
<file action="link" path="../dma.c" targetDirectory="." />
<file action="link" path="../ecap.c" targetDirectory="." />
<file action="link" path="../emif.c" targetDirectory="." />
<file action="link" path="../epwm.c" targetDirectory="." />
<file action="link" path="../eqep.c" targetDirectory="." />
<file action="link" path="../erad.c" targetDirectory="." />
<file action="link" path="../escss.c" targetDirectory="." />
<file action="link" path="../flash.c" targetDirectory="." />
<file action="link" path="../fsi.c" targetDirectory="." />
<file action="link" path="../gpio.c" targetDirectory="." />
<file action="link" path="../hrcap.c" targetDirectory="." />
<file action="link" path="../hrpwm.c" targetDirectory="." />
<file action="link" path="../i2c.c" targetDirectory="." />
<file action="link" path="../interrupt.c" targetDirectory="." />
<file action="link" path="../ipc.c" targetDirectory="." />
<file action="link" path="../mcan.c" targetDirectory="." />
<file action="link" path="../mcbsp.c" targetDirectory="." />
<file action="link" path="../memcfg.c" targetDirectory="." />
<file action="link" path="../pmbus.c" targetDirectory="." />
<file action="link" path="../sci.c" targetDirectory="." />
<file action="link" path="../sdfm.c" targetDirectory="." />
<file action="link" path="../spi.c" targetDirectory="." />
<file action="link" path="../sysctl.c" targetDirectory="." />
<file action="link" path="../usb.c" targetDirectory="." />
<file action="link" path="../version.c" targetDirectory="." />
<file action="link" path="../xbar.c" targetDirectory="." />
</project>
</projectSpec>
@@ -0,0 +1,89 @@
//###########################################################################
//
// FILE: cla.c
//
// TITLE: CLA Driver Implementation File
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "cla.h"
//*****************************************************************************
//
// CLA_setTriggerSource()
//
//*****************************************************************************
void
CLA_setTriggerSource(CLA_TaskNumber taskNumber, CLA_Trigger trigger)
{
uint32_t srcSelReg;
uint32_t shiftVal;
//
// Calculate the shift value for the specified task.
//
shiftVal = ((uint32_t)taskNumber * SYSCTL_CLA1TASKSRCSEL1_TASK2_S) % 32U;
//
// Calculate the register address for the specified task.
//
if(taskNumber <= CLA_TASK_4)
{
//
// Tasks 1-4
//
srcSelReg = (uint32_t)DMACLASRCSEL_BASE + SYSCTL_O_CLA1TASKSRCSEL1;
}
else
{
//
// Tasks 5-8
//
srcSelReg = (uint32_t)DMACLASRCSEL_BASE + SYSCTL_O_CLA1TASKSRCSEL2;
}
EALLOW;
//
// Write trigger selection to the appropriate register.
//
HWREG(srcSelReg) &= ~((uint32_t)SYSCTL_CLA1TASKSRCSEL1_TASK1_M
<< shiftVal);
HWREG(srcSelReg) = HWREG(srcSelReg) | ((uint32_t)trigger << shiftVal);
EDIS;
}
File diff suppressed because it is too large. Load diff
+145
View File
@@ -0,0 +1,145 @@
//###########################################################################
//
// FILE: clb.c
//
// TITLE: C28x CLB driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "clb.h"
//*****************************************************************************
//
// CLB_configCounterLoadMatch
//
//*****************************************************************************
void CLB_configCounterLoadMatch(uint32_t base, CLB_Counters counterID,
uint32_t load, uint32_t match1, uint32_t match2)
{
ASSERT(CLB_isBaseValid(base));
EALLOW;
switch(counterID)
{
case CLB_CTR0:
CLB_writeInterface(base, CLB_ADDR_COUNTER_0_LOAD, load);
CLB_writeInterface(base, CLB_ADDR_COUNTER_0_MATCH1, match1);
CLB_writeInterface(base, CLB_ADDR_COUNTER_0_MATCH2, match2);
break;
case CLB_CTR1:
CLB_writeInterface(base, CLB_ADDR_COUNTER_1_LOAD, load);
CLB_writeInterface(base, CLB_ADDR_COUNTER_1_MATCH1, match1);
CLB_writeInterface(base, CLB_ADDR_COUNTER_1_MATCH2, match2);
break;
case CLB_CTR2:
CLB_writeInterface(base, CLB_ADDR_COUNTER_2_LOAD, load);
CLB_writeInterface(base, CLB_ADDR_COUNTER_2_MATCH1, match1);
CLB_writeInterface(base, CLB_ADDR_COUNTER_2_MATCH2, match2);
break;
default:
//
// Invalid counterID value
//
break;
}
EDIS;
}
//*****************************************************************************
//
// CLB_clearFIFOs
//
//*****************************************************************************
void CLB_clearFIFOs(uint32_t base)
{
uint16_t i;
ASSERT(CLB_isBaseValid(base));
for(i = 0U; i < CLB_FIFO_SIZE; i++)
{
HWREG(base + CLB_DATAEXCH + CLB_O_PULL(i)) = 0U;
}
HWREG(base + CLB_LOGICCTL + CLB_O_BUF_PTR) = 0U;
}
//*****************************************************************************
//
// CLB_writeFIFOs
//
//*****************************************************************************
void CLB_writeFIFOs(uint32_t base , const uint32_t pullData[])
{
ASSERT(CLB_isBaseValid(base));
//
// Clear the FIFO and pointer
//
CLB_clearFIFOs(base);
//
// Write data into the FIFO.
//
HWREG(base + CLB_DATAEXCH + CLB_O_PULL(0U)) = pullData[0U];
HWREG(base + CLB_DATAEXCH + CLB_O_PULL(1U)) = pullData[1U];
HWREG(base + CLB_DATAEXCH + CLB_O_PULL(2U)) = pullData[2U];
HWREG(base + CLB_DATAEXCH + CLB_O_PULL(3U)) = pullData[3U];
}
//*****************************************************************************
//
// CLB_readFIFOs
//
//*****************************************************************************
void CLB_readFIFOs(uint32_t base , uint32_t pushData[])
{
ASSERT(CLB_isBaseValid(base));
//
// Read data from the FIFO.
//
pushData[0U] = HWREG(base + CLB_DATAEXCH + CLB_O_PUSH(0U)) ;
pushData[1U] = HWREG(base + CLB_DATAEXCH + CLB_O_PUSH(1U)) ;
pushData[2U] = HWREG(base + CLB_DATAEXCH + CLB_O_PUSH(2U)) ;
pushData[3U] = HWREG(base + CLB_DATAEXCH + CLB_O_PUSH(3U)) ;
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,227 @@
//###########################################################################
//
// FILE: cmpss.c
//
// TITLE: C28x CMPSS driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "cmpss.h"
//*****************************************************************************
//
// CMPSS_configFilterHigh
//
//*****************************************************************************
void
CMPSS_configFilterHigh(uint32_t base, uint16_t samplePrescale,
uint16_t sampleWindow, uint16_t threshold)
{
uint16_t regValue;
//
// Check the arguments.
//
ASSERT(CMPSS_isBaseValid(base));
ASSERT(samplePrescale <= 1023U);
ASSERT((sampleWindow >= 1U) && (sampleWindow <= 32U));
ASSERT((threshold - 1U) >= ((sampleWindow - 1U) / 2U));
//
// Shift the sample window and threshold values into the correct positions
// and write them to the appropriate register.
//
regValue = ((sampleWindow - 1U) << CMPSS_CTRIPHFILCTL_SAMPWIN_S) |
((threshold - 1U) << CMPSS_CTRIPHFILCTL_THRESH_S);
EALLOW;
HWREGH(base + CMPSS_O_CTRIPHFILCTL) =
(HWREGH(base + CMPSS_O_CTRIPHFILCTL) &
~(CMPSS_CTRIPHFILCTL_SAMPWIN_M | CMPSS_CTRIPHFILCTL_THRESH_M)) |
regValue;
//
// Set the filter sample clock prescale for the high comparator.
//
HWREGH(base + CMPSS_O_CTRIPHFILCLKCTL) = samplePrescale;
EDIS;
}
//*****************************************************************************
//
// CMPSS_configFilterLow
//
//*****************************************************************************
void
CMPSS_configFilterLow(uint32_t base, uint16_t samplePrescale,
uint16_t sampleWindow, uint16_t threshold)
{
uint16_t regValue;
//
// Check the arguments.
//
ASSERT(CMPSS_isBaseValid(base));
ASSERT(samplePrescale <= 1023U);
ASSERT((sampleWindow >= 1U) && (sampleWindow <= 32U));
ASSERT((threshold - 1U) >= ((sampleWindow - 1U) / 2U));
//
// Shift the sample window and threshold values into the correct positions
// and write them to the appropriate register.
//
regValue = ((sampleWindow - 1U) << CMPSS_CTRIPLFILCTL_SAMPWIN_S) |
((threshold - 1U) << CMPSS_CTRIPLFILCTL_THRESH_S);
EALLOW;
HWREGH(base + CMPSS_O_CTRIPLFILCTL) =
(HWREGH(base + CMPSS_O_CTRIPLFILCTL) &
~(CMPSS_CTRIPLFILCTL_SAMPWIN_M | CMPSS_CTRIPLFILCTL_THRESH_M)) |
regValue;
//
// Set the filter sample clock prescale for the low comparator.
//
HWREGH(base + CMPSS_O_CTRIPLFILCLKCTL) = samplePrescale;
EDIS;
}
//*****************************************************************************
//
// CMPSS_configLatchOnPWMSYNC
//
//*****************************************************************************
void
CMPSS_configLatchOnPWMSYNC(uint32_t base, bool highEnable, bool lowEnable)
{
//
// Check the arguments.
//
ASSERT(CMPSS_isBaseValid(base));
//
// If the highEnable is true, set the bit that will enable PWMSYNC to reset
// the high comparator digital filter latch. If not, clear the bit.
//
EALLOW;
if(highEnable)
{
HWREGH(base + CMPSS_O_COMPSTSCLR) |= CMPSS_COMPSTSCLR_HSYNCCLREN;
}
else
{
HWREGH(base + CMPSS_O_COMPSTSCLR) &= ~CMPSS_COMPSTSCLR_HSYNCCLREN;
}
//
// If the lowEnable is true, set the bit that will enable PWMSYNC to reset
// the low comparator digital filter latch. If not, clear the bit.
//
if(lowEnable)
{
HWREGH(base + CMPSS_O_COMPSTSCLR) |= CMPSS_COMPSTSCLR_LSYNCCLREN;
}
else
{
HWREGH(base + CMPSS_O_COMPSTSCLR) &= ~CMPSS_COMPSTSCLR_LSYNCCLREN;
}
EDIS;
}
//*****************************************************************************
//
// CMPSS_configRamp
//
//*****************************************************************************
void
CMPSS_configRamp(uint32_t base, uint16_t maxRampVal, uint16_t decrementVal,
uint16_t delayVal, uint16_t pwmSyncSrc, bool useRampValShdw)
{
//
// Check the arguments.
//
ASSERT(CMPSS_isBaseValid(base));
ASSERT(delayVal <= CMPSS_RAMPDLYS_DELAY_M);
ASSERT((pwmSyncSrc >= 1U) && (pwmSyncSrc <= 16U));
EALLOW;
//
// Write the ramp generator source to the register
//
HWREGH(base + CMPSS_O_COMPDACCTL) =
(HWREGH(base + CMPSS_O_COMPDACCTL) &
~CMPSS_COMPDACCTL_RAMPSOURCE_M) |
((uint16_t)(pwmSyncSrc - 1U) << CMPSS_COMPDACCTL_RAMPSOURCE_S);
//
// Set or clear the bit that determines from where the max ramp value
// should be loaded.
//
if(useRampValShdw)
{
HWREGH(base + CMPSS_O_COMPDACCTL) |= CMPSS_COMPDACCTL_RAMPLOADSEL;
}
else
{
HWREGH(base + CMPSS_O_COMPDACCTL) &= ~CMPSS_COMPDACCTL_RAMPLOADSEL;
}
EDIS;
//
// Write the maximum ramp value to the shadow register.
//
HWREGH(base + CMPSS_O_RAMPMAXREFS) = maxRampVal;
//
// Write the ramp decrement value to the shadow register.
//
HWREGH(base + CMPSS_O_RAMPDECVALS) = decrementVal;
//
// Write the ramp delay value to the shadow register.
//
HWREGH(base + CMPSS_O_RAMPDLYS) = delayVal;
}
File diff suppressed because it is too large. Load diff
+172
View File
@@ -0,0 +1,172 @@
//###########################################################################
//
// FILE: cpu.h
//
// TITLE: Useful C28x CPU defines.
//
//###########################################################################
//
// 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 CPU_H
#define CPU_H
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
#include "stdint.h"
//
// External reference to the interrupt flag register (IFR) register
//
#ifndef __TMS320C28XX_CLA__
extern __cregister volatile uint16_t IFR;
#endif
//
// External reference to the interrupt enable register (IER) register
//
#ifndef __TMS320C28XX_CLA__
extern __cregister volatile uint16_t IER;
#endif
//
// Define to enable interrupts
//
#ifndef EINT
#define EINT __asm(" clrc INTM")
#endif
//
// Define to disable interrupts
//
#ifndef DINT
#define DINT __asm(" setc INTM")
#endif
//
// Define to enable debug events
//
#ifndef ERTM
#define ERTM __asm(" clrc DBGM")
#endif
//
// Define to disable debug events
//
#ifndef DRTM
#define DRTM __asm(" setc DBGM")
#endif
//
// Define to allow writes to protected registers
//
#ifndef EALLOW
#ifndef __TMS320C28XX_CLA__
#define EALLOW __eallow()
#else
#define EALLOW __meallow()
#endif // __TMS320C28XX_CLA__
#endif // EALLOW
//
// Define to disable writes to protected registers
//
#ifndef EDIS
#ifndef __TMS320C28XX_CLA__
#define EDIS __edis()
#else
#define EDIS __medis()
#endif // __TMS320C28XX_CLA__
#endif // EDIS
//
// Define for emulation stop
//
#ifndef ESTOP0
#define ESTOP0 __asm(" ESTOP0")
#endif
//
// Define for emulation stop
//
#ifndef ESTOP1
#define ESTOP1 __asm(" ESTOP1")
#endif
//
// Define for no operation
//
#ifndef NOP
#define NOP __asm(" NOP")
#endif
//
// Define for putting processor into a low-power mode
//
#ifndef _DUAL_HEADERS
#ifndef IDLE
#define IDLE __asm(" IDLE")
#endif
#else
#define IDLE_ASM __asm(" IDLE");
#endif
//*****************************************************************************
//
// Extern compiler intrinsic prototypes. See compiler User's Guide for details.
//
//*****************************************************************************
extern void __eallow(void);
extern void __edis(void);
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // CPU_H
@@ -0,0 +1,61 @@
//#############################################################################
//
// FILE: cputimer.c
//
// TITLE: C28x CPU timer Driver
//
//#############################################################################
//
// 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.
// $
//#############################################################################
#include "cputimer.h"
//*****************************************************************************
//
// CPUTimer_setEmulationMode
//
//*****************************************************************************
void CPUTimer_setEmulationMode(uint32_t base, CPUTimer_EmulationMode mode)
{
ASSERT(CPUTimer_isBaseValid(base));
//
// Write to FREE_SOFT bits of register TCR
//
HWREGH(base + CPUTIMER_O_TCR) =
(HWREGH(base + CPUTIMER_O_TCR) &
~(CPUTIMER_TCR_FREE | CPUTIMER_TCR_SOFT)) |
(uint16_t)mode;
}
@@ -0,0 +1,509 @@
//#############################################################################
//
// FILE: cputimer.h
//
// TITLE: C28x CPU timer Driver
//
//#############################################################################
//
// 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 CPUTIMER_H
#define CPUTIMER_H
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
#ifdef __TMS320C28XX__
//*****************************************************************************
//
//! \addtogroup cputimer_api CPUTimer
//! @{
//
//*****************************************************************************
#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_cputimer.h"
#include "debug.h"
#include "sysctl.h"
//*****************************************************************************
//
// Defines for the API.
//
//*****************************************************************************
//*****************************************************************************
//
//! Values that can be passed to CPUTimer_setEmulationMode() as the
//! \e mode parameter.
//
//****************************************************************************
typedef enum
{
//! Denotes that the timer will stop after the next decrement
CPUTIMER_EMULATIONMODE_STOPAFTERNEXTDECREMENT = 0x0000,
//! Denotes that the timer will stop when it reaches zero
CPUTIMER_EMULATIONMODE_STOPATZERO = 0x0400,
//! Denotes that the timer will run free
CPUTIMER_EMULATIONMODE_RUNFREE = 0x0800
}CPUTimer_EmulationMode;
//*****************************************************************************
//
//! The following are values that can be passed to
//! CPUTimer_selectClockSource() as the \e source parameter.
//
//*****************************************************************************
typedef enum
{
//! System Clock Source
CPUTIMER_CLOCK_SOURCE_SYS = 0x0,
//! Internal Oscillator 1 Clock Source
CPUTIMER_CLOCK_SOURCE_INTOSC1 = 0x1,
//! Internal Oscillator 2 Clock Source
CPUTIMER_CLOCK_SOURCE_INTOSC2 = 0x2,
//! External Clock Source
CPUTIMER_CLOCK_SOURCE_XTAL = 0x3,
//! Auxiliary PLL Clock Source
CPUTIMER_CLOCK_SOURCE_AUX = 0x6
} CPUTimer_ClockSource;
//*****************************************************************************
//
//! The following are values that can be passed to
//! CPUTimer_selectClockSource() as the \e prescaler parameter.
//
//*****************************************************************************
typedef enum
{
CPUTIMER_CLOCK_PRESCALER_1 = 0, //!< Prescaler value of / 1
CPUTIMER_CLOCK_PRESCALER_2 = 1, //!< Prescaler value of / 2
CPUTIMER_CLOCK_PRESCALER_4 = 2, //!< Prescaler value of / 4
CPUTIMER_CLOCK_PRESCALER_8 = 3, //!< Prescaler value of / 8
CPUTIMER_CLOCK_PRESCALER_16 = 4 //!< Prescaler value of / 16
} CPUTimer_Prescaler;
//*****************************************************************************
//
//! \internal
//! Checks CPU timer base address.
//!
//! \param base specifies the Timer module base address.
//!
//! This function determines if a CPU timer module base address is valid.
//!
//! \return Returns \b true if the base address is valid and \b false
//! otherwise.
//
//*****************************************************************************
#ifdef DEBUG
static inline bool CPUTimer_isBaseValid(uint32_t base)
{
return((base == CPUTIMER0_BASE) || (base == CPUTIMER1_BASE) ||
(base == CPUTIMER2_BASE));
}
#endif
//*****************************************************************************
//
//! Clears CPU timer overflow flag.
//!
//! \param base is the base address of the timer module.
//!
//! This function clears the CPU timer overflow flag.
//!
//! \return None.
//
//*****************************************************************************
static inline void CPUTimer_clearOverflowFlag(uint32_t base)
{
ASSERT(CPUTimer_isBaseValid(base));
//
// Set TIF bit of TCR register
//
HWREGH(base + CPUTIMER_O_TCR) |= CPUTIMER_TCR_TIF;
}
//*****************************************************************************
//
//! Disables CPU timer interrupt.
//!
//! \param base is the base address of the timer module.
//!
//! This function disables the CPU timer interrupt.
//!
//! \return None.
//
//*****************************************************************************
static inline void CPUTimer_disableInterrupt(uint32_t base)
{
ASSERT(CPUTimer_isBaseValid(base));
//
// Clear TIE bit of TCR register
//
HWREGH(base + CPUTIMER_O_TCR) &= ~CPUTIMER_TCR_TIE;
}
//*****************************************************************************
//
//! Enables CPU timer interrupt.
//!
//! \param base is the base address of the timer module.
//!
//! This function enables the CPU timer interrupt.
//!
//! \return None.
//
//*****************************************************************************
static inline void CPUTimer_enableInterrupt(uint32_t base)
{
uint16_t tcrValue = 0;
ASSERT(CPUTimer_isBaseValid(base));
//
// Set TIE bit of TCR register
//
tcrValue = HWREGH(base + CPUTIMER_O_TCR) & (~CPUTIMER_TCR_TIF);
HWREGH(base + CPUTIMER_O_TCR) = tcrValue | CPUTIMER_TCR_TIE;
}
//*****************************************************************************
//
//! Reloads CPU timer counter.
//!
//! \param base is the base address of the timer module.
//!
//! This function reloads the CPU timer counter with the values contained in
//! the CPU timer period register.
//!
//! \return None.
//
//*****************************************************************************
static inline void CPUTimer_reloadTimerCounter(uint32_t base)
{
uint16_t tcrValue = 0;
ASSERT(CPUTimer_isBaseValid(base));
//
// Set TRB bit of register TCR
//
tcrValue = HWREGH(base + CPUTIMER_O_TCR) & (~CPUTIMER_TCR_TIF);
HWREGH(base + CPUTIMER_O_TCR) = tcrValue | CPUTIMER_TCR_TRB;
}
//*****************************************************************************
//
//! Stops CPU timer.
//!
//! \param base is the base address of the timer module.
//!
//! This function stops the CPU timer.
//!
//! \return None.
//
//*****************************************************************************
static inline void CPUTimer_stopTimer(uint32_t base)
{
uint16_t tcrValue = 0;
ASSERT(CPUTimer_isBaseValid(base));
//
// Set TSS bit of register TCR
//
tcrValue = HWREGH(base + CPUTIMER_O_TCR) & (~CPUTIMER_TCR_TIF);
HWREGH(base + CPUTIMER_O_TCR) = tcrValue | CPUTIMER_TCR_TSS;
}
//*****************************************************************************
//
//! Starts(restarts) CPU timer.
//!
//! \param base is the base address of the timer module.
//!
//! This function starts (restarts) the CPU timer.
//!
//! \b Note: This function doesn't reset the timer counter.
//!
//! \return None.
//
//*****************************************************************************
static inline void CPUTimer_resumeTimer(uint32_t base)
{
ASSERT(CPUTimer_isBaseValid(base));
//
// Clear TSS bit of register TCR
//
HWREGH(base + CPUTIMER_O_TCR) &= ~CPUTIMER_TCR_TSS;
}
//*****************************************************************************
//
//! Starts(restarts) CPU timer.
//!
//! \param base is the base address of the timer module.
//!
//! This function starts (restarts) the CPU timer.
//!
//! \b Note: This function reloads the timer counter.
//!
//! \return None.
//
//*****************************************************************************
static inline void CPUTimer_startTimer(uint32_t base)
{
uint16_t tcrValue = 0;
ASSERT(CPUTimer_isBaseValid(base));
//
// Reload the timer counter
//
tcrValue = HWREGH(base + CPUTIMER_O_TCR) & (~CPUTIMER_TCR_TIF);
HWREGH(base + CPUTIMER_O_TCR) = tcrValue | CPUTIMER_TCR_TRB;
//
// Clear TSS bit of register TCR
//
HWREGH(base + CPUTIMER_O_TCR) &= ~CPUTIMER_TCR_TSS;
}
//*****************************************************************************
//
//! Sets CPU timer period.
//!
//! \param base is the base address of the timer module.
//! \param periodCount is the CPU timer period count.
//!
//! This function sets the CPU timer period count.
//!
//! \return None.
//
//*****************************************************************************
static inline void CPUTimer_setPeriod(uint32_t base, uint32_t periodCount)
{
ASSERT(CPUTimer_isBaseValid(base));
//
// Load the MSB period Count
//
HWREG(base + CPUTIMER_O_PRD) = periodCount;
}
//*****************************************************************************
//
//! Returns the current CPU timer counter value.
//!
//! \param base is the base address of the timer module.
//!
//! This function returns the current CPU timer counter value.
//!
//! \return Returns the current CPU timer count value.
//
//*****************************************************************************
static inline uint32_t CPUTimer_getTimerCount(uint32_t base)
{
ASSERT(CPUTimer_isBaseValid(base));
//
// Get the TIMH:TIM registers value
//
return(HWREG(base + CPUTIMER_O_TIM));
}
//*****************************************************************************
//
//! Set CPU timer pre-scaler value.
//!
//! \param base is the base address of the timer module.
//! \param prescaler is the CPU timer pre-scaler value.
//!
//! This function sets the pre-scaler value for the CPU timer. For every value
//! of (prescaler + 1), the CPU timer counter decrements by 1.
//!
//! \return None.
//
//*****************************************************************************
static inline void CPUTimer_setPreScaler(uint32_t base, uint16_t prescaler)
{
ASSERT(CPUTimer_isBaseValid(base));
//
// Writes to TPR.TDDR and TPRH.TDDRH bits
//
HWREGH(base + CPUTIMER_O_TPRH) = prescaler >> 8U;
HWREGH(base + CPUTIMER_O_TPR) = (prescaler & CPUTIMER_TPR_TDDR_M) ;
}
//*****************************************************************************
//
//! Return the CPU timer overflow status.
//!
//! \param base is the base address of the timer module.
//!
//! This function returns the CPU timer overflow status.
//!
//! \return Returns true if the CPU timer has overflowed, false if not.
//
//*****************************************************************************
static inline bool CPUTimer_getTimerOverflowStatus(uint32_t base)
{
ASSERT(CPUTimer_isBaseValid(base));
//
// Check if TIF bits of register TCR are set
//
return(((HWREGH(base + CPUTIMER_O_TCR) & CPUTIMER_TCR_TIF) ==
CPUTIMER_TCR_TIF) ? true : false);
}
//*****************************************************************************
//
//! Select CPU Timer 2 Clock Source and Prescaler
//!
//! \param base is the base address of the timer module.
//! \param source is the clock source to use for CPU Timer 2
//! \param prescaler is the value that configures the selected clock source
//! relative to the system clock
//!
//! This function selects the specified clock source and prescaler value
//! for the CPU timer (CPU timer 2 only).
//!
//! The \e source parameter can be any one of the following:
//! - \b CPUTIMER_CLOCK_SOURCE_SYS - System Clock
//! - \b CPUTIMER_CLOCK_SOURCE_INTOSC1 - Internal Oscillator 1 Clock
//! - \b CPUTIMER_CLOCK_SOURCE_INTOSC2 - Internal Oscillator 2 Clock
//! - \b CPUTIMER_CLOCK_SOURCE_XTAL - External Clock
//! - \b CPUTIMER_CLOCK_SOURCE_AUX - Auxiliary PLL Clock
//!
//! The \e prescaler parameter can be any one of the following:
//! - \b CPUTIMER_CLOCK_PRESCALER_1 - Prescaler value of / 1
//! - \b CPUTIMER_CLOCK_PRESCALER_2 - Prescaler value of / 2
//! - \b CPUTIMER_CLOCK_PRESCALER_4 - Prescaler value of / 4
//! - \b CPUTIMER_CLOCK_PRESCALER_8 - Prescaler value of / 8
//! - \b CPUTIMER_CLOCK_PRESCALER_16 - Prescaler value of / 16
//!
//! \return None.
//
//*****************************************************************************
static inline void CPUTimer_selectClockSource(uint32_t base,
CPUTimer_ClockSource source,
CPUTimer_Prescaler prescaler)
{
ASSERT(base == CPUTIMER2_BASE);
//
// Set source and prescaler for CPU Timer 2
//
if(base == CPUTIMER2_BASE)
{
EALLOW;
//
// Set Clock Source
//
HWREGH(CPUSYS_BASE + SYSCTL_O_TMR2CLKCTL) =
(HWREGH(CPUSYS_BASE + SYSCTL_O_TMR2CLKCTL) &
~SYSCTL_TMR2CLKCTL_TMR2CLKSRCSEL_M) | (uint16_t)source;
SYSCTL_REGWRITE_DELAY;
//
// Set Clock Prescaler
//
HWREGH(CPUSYS_BASE + SYSCTL_O_TMR2CLKCTL) =
(HWREGH(CPUSYS_BASE + SYSCTL_O_TMR2CLKCTL) &
~SYSCTL_TMR2CLKCTL_TMR2CLKPRESCALE_M) |
((uint16_t)prescaler <<SYSCTL_TMR2CLKCTL_TMR2CLKPRESCALE_S);
EDIS;
}
SYSCTL_REGWRITE_DELAY;
}
//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************
//*****************************************************************************
//
//! Sets Emulation mode for CPU timer.
//!
//! \param base is the base address of the timer module.
//! \param mode is the emulation mode of the timer.
//!
//! This function sets the behaviour of CPU timer during emulation. Valid
//! values mode are: CPUTIMER_EMULATIONMODE_STOPAFTERNEXTDECREMENT,
//! CPUTIMER_EMULATIONMODE_STOPATZERO and CPUTIMER_EMULATIONMODE_RUNFREE.
//!
//! \return None.
//
//*****************************************************************************
extern void CPUTimer_setEmulationMode(uint32_t base,
CPUTimer_EmulationMode mode);
//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************
#endif // #ifdef __TMS320C28XX__
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // CPUTIMER_H
@@ -0,0 +1,93 @@
//###########################################################################
//
// FILE: dac.c
//
// TITLE: C28x DAC driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "dac.h"
//*****************************************************************************
//
// DAC_tuneOffsetTrim()
//
//*****************************************************************************
void
DAC_tuneOffsetTrim(uint32_t base, float32_t referenceVoltage)
{
uint16_t oldOffsetTrim;
float32_t newOffsetTrim;
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
ASSERT(referenceVoltage > 0.0F);
//
// Get the sign-extended offset trim value
//
oldOffsetTrim = (HWREGH(base + DAC_O_TRIM) & DAC_TRIM_OFFSET_TRIM_M);
oldOffsetTrim = ((oldOffsetTrim & (uint16_t)DAC_REG_BYTE_MASK) ^
(uint16_t)0x80) - (uint16_t)0x80;
//
// Calculate new offset trim value if DAC is operating at a reference
// voltage other than 2.5v.
//
newOffsetTrim = ((float32_t)(2.5 / referenceVoltage) *
(int16_t)oldOffsetTrim);
//
// Check if the new offset trim value is valid
//
ASSERT(((int16_t)newOffsetTrim > -129) && ((int16_t)newOffsetTrim < 128));
//
// Set the new offset trim value
//
EALLOW;
HWREGH(base + DAC_O_TRIM) = (HWREGH(base + DAC_O_TRIM) &
~DAC_TRIM_OFFSET_TRIM_M) |
(int16_t)newOffsetTrim;
EDIS;
}
+604
View File
@@ -0,0 +1,604 @@
//###########################################################################
//
// FILE: dac.h
//
// TITLE: C28x DAC driver.
//
//###########################################################################
//
// 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 DAC_H
#define DAC_H
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
//
//! \addtogroup dac_api DAC
//! @{
//
//*****************************************************************************
#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_dac.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "cpu.h"
#include "debug.h"
//
// A 8-bit register mask
//
#define DAC_REG_BYTE_MASK (0xFFU) //!< Register Byte Mask
//
// Lock Key
//
#define DAC_LOCK_KEY (0xA000U) //!< DAC Lock Key
#ifndef DOXYGEN_PDF_IGNORE
//*****************************************************************************
//
// The following are defines for the reg parameter of the
// DAC_lockRegister() and DAC_isRegisterLocked() functions.
//
//*****************************************************************************
#define DAC_LOCK_CONTROL (0x1U) //!< Lock the control register
#define DAC_LOCK_SHADOW (0x2U) //!< Lock the shadow value register
#define DAC_LOCK_OUTPUT (0x4U) //!< Lock the output enable register
#endif // DOXYGEN_PDF_IGNORE
//*****************************************************************************
//
//! Values that can be passed to DAC_setReferenceVoltage() as the \e source
//! parameter.
//
//*****************************************************************************
typedef enum
{
DAC_REF_VDAC = 0, //!< VDAC reference voltage
DAC_REF_ADC_VREFHI = 1 //!< ADC VREFHI reference voltage
}DAC_ReferenceVoltage;
//*****************************************************************************
//
//! Values that can be passed to DAC_setLoadMode() as the \e mode parameter.
//
//*****************************************************************************
typedef enum
{
DAC_LOAD_SYSCLK = 0, //!< Load on next SYSCLK
DAC_LOAD_PWMSYNC = 4 //!< Load on next PWMSYNC specified by SYNCSEL
}DAC_LoadMode;
//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************
//*****************************************************************************
//
//! \internal
//! Checks DAC base address.
//!
//! \param base specifies the DAC module base address.
//!
//! This function determines if an DAC module base address is valid.
//!
//! \return Returns \b true if the base address is valid and \b false
//! otherwise.
//
//*****************************************************************************
#ifdef DEBUG
static inline bool
DAC_isBaseValid(uint32_t base)
{
return(
(base == DACA_BASE) ||
(base == DACB_BASE) ||
(base == DACC_BASE)
);
}
#endif
//*****************************************************************************
//
//! Get the DAC Revision value
//!
//! \param base is the DAC module base address
//!
//! This function gets the DAC revision value.
//!
//! \return Returns the DAC revision value.
//
//*****************************************************************************
static inline uint16_t
DAC_getRevision(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
//
// Get the revision value.
//
return(HWREGH(base + DAC_O_REV) & DAC_REV_REV_M);
}
//*****************************************************************************
//
//! Sets the DAC Reference Voltage
//!
//! \param base is the DAC module base address
//! \param source is the selected reference voltage
//!
//! This function sets the DAC reference voltage.
//!
//! The \e source parameter can have the following value:
//! - \b DAC_REF_VDAC - The VDAC reference voltage
//! - \b DAC_REF_ADC_VREFHI - The ADC VREFHI reference voltage
//!
//! \return None.
//
//*****************************************************************************
static inline void
DAC_setReferenceVoltage(uint32_t base, DAC_ReferenceVoltage source)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
//
// Set the reference voltage
//
EALLOW;
HWREGH(base + DAC_O_CTL) = (HWREGH(base + DAC_O_CTL) &
~DAC_CTL_DACREFSEL) | (uint16_t)source;
EDIS;
}
//*****************************************************************************
//
//! Sets the DAC Load Mode
//!
//! \param base is the DAC module base address
//! \param mode is the selected load mode
//!
//! This function sets the DAC load mode.
//!
//! The \e mode parameter can have one of two values:
//! - \b DAC_LOAD_SYSCLK - Load on next SYSCLK
//! - \b DAC_LOAD_PWMSYNC - Load on next PWMSYNC specified by SYNCSEL
//!
//! \return None.
//
//*****************************************************************************
static inline void
DAC_setLoadMode(uint32_t base, DAC_LoadMode mode)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
//
// Set the load mode
//
EALLOW;
HWREGH(base + DAC_O_CTL) = (HWREGH(base + DAC_O_CTL) &
~DAC_CTL_LOADMODE) | (uint16_t)mode;
EDIS;
}
//*****************************************************************************
//
//! Sets the DAC PWMSYNC Signal
//!
//! \param base is the DAC module base address
//! \param signal is the selected PWM signal
//!
//! This function sets the DAC PWMSYNC signal.
//!
//! The \e signal parameter must be set to a number that represents the PWM
//! signal that will be set. For instance, passing 2 into \e signal will
//! select PWM sync signal 2.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DAC_setPWMSyncSignal(uint32_t base, uint16_t pwmSignal)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
ASSERT((pwmSignal > 0U) && (pwmSignal < 17U));
//
// Set the PWM sync signal
//
EALLOW;
HWREGH(base + DAC_O_CTL) = (HWREGH(base + DAC_O_CTL) &
~DAC_CTL_SYNCSEL_M) |
((uint16_t)(pwmSignal - 1U) <<
DAC_CTL_SYNCSEL_S);
EDIS;
}
//*****************************************************************************
//
//! Get the DAC Active Output Value
//!
//! \param base is the DAC module base address
//!
//! This function gets the DAC active output value.
//!
//! \return Returns the DAC active output value.
//
//*****************************************************************************
static inline uint16_t
DAC_getActiveValue(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
//
// Get the active value
//
return(HWREGH(base + DAC_O_VALA) & DAC_VALA_DACVALA_M);
}
//*****************************************************************************
//
//! Set the DAC Shadow Output Value
//!
//! \param base is the DAC module base address
//! \param value is the 12-bit code to be loaded into the active value register
//!
//! This function sets the DAC shadow output value.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DAC_setShadowValue(uint32_t base, uint16_t value)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
ASSERT(value <= DAC_VALS_DACVALS_M);
//
// Set the shadow value
//
HWREGH(base + DAC_O_VALS) = (HWREGH(base + DAC_O_VALS) &
~DAC_VALS_DACVALS_M) |
(uint16_t)(value & DAC_VALS_DACVALS_M);
}
//*****************************************************************************
//
//! Get the DAC Shadow Output Value
//!
//! \param base is the DAC module base address
//!
//! This function gets the DAC shadow output value.
//!
//! \return Returns the DAC shadow output value.
//
//*****************************************************************************
static inline uint16_t
DAC_getShadowValue(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
//
// Get the shadow value
//
return(HWREGH(base + DAC_O_VALS) & DAC_VALS_DACVALS_M);
}
//*****************************************************************************
//
//! Enable the DAC Output
//!
//! \param base is the DAC module base address
//!
//! This function enables the DAC output.
//!
//! \note A delay is required after enabling the DAC. Further details
//! regarding the exact delay time length can be found in the device datasheet.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DAC_enableOutput(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
//
// Enable the output
//
EALLOW;
HWREGH(base + DAC_O_OUTEN) |= DAC_OUTEN_DACOUTEN;
EDIS;
}
//*****************************************************************************
//
//! Disable the DAC Output
//!
//! \param base is the DAC module base address
//!
//! This function disables the DAC output.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DAC_disableOutput(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
//
// Disable the output
//
EALLOW;
HWREGH(base + DAC_O_OUTEN) &= ~DAC_OUTEN_DACOUTEN;
EDIS;
}
//*****************************************************************************
//
//! Set DAC Offset Trim
//!
//! \param base is the DAC module base address
//! \param offset is the specified value for the offset trim
//!
//! This function sets the DAC offset trim. The \e offset value should be a
//! signed number in the range of -128 to 127.
//!
//! \note The offset should not be modified unless specifically indicated by
//! TI Errata or other documentation. Modifying the offset value could cause
//! this module to operate outside of the datasheet specifications.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DAC_setOffsetTrim(uint32_t base, int16_t offset)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
ASSERT((offset > -129) && (offset < 128));
//
// Set the offset trim value
//
EALLOW;
HWREGH(base + DAC_O_TRIM) = (HWREGH(base + DAC_O_TRIM) &
~DAC_TRIM_OFFSET_TRIM_M) | (int16_t)offset;
EDIS;
}
//*****************************************************************************
//
//! Get DAC Offset Trim
//!
//! \param base is the DAC module base address
//!
//! This function gets the DAC offset trim value.
//!
//! \return None.
//
//*****************************************************************************
static inline int16_t
DAC_getOffsetTrim(uint32_t base)
{
uint16_t value;
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
//
// Get the sign-extended offset trim value
//
value = (HWREGH(base + DAC_O_TRIM) & DAC_TRIM_OFFSET_TRIM_M);
value = ((value & (uint16_t)DAC_REG_BYTE_MASK) ^ (uint16_t)0x80) -
(uint16_t)0x80;
return((int16_t)value);
}
//*****************************************************************************
//
//! Lock write-access to DAC Register
//!
//! \param base is the DAC module base address
//! \param reg is the selected DAC registers
//!
//! This function locks the write-access to the specified DAC register. Only a
//! system reset can unlock the register once locked.
//!
//! The \e reg parameter can be an ORed combination of any of the following
//! values:
//! - \b DAC_LOCK_CONTROL - Lock the DAC control register
//! - \b DAC_LOCK_SHADOW - Lock the DAC shadow value register
//! - \b DAC_LOCK_OUTPUT - Lock the DAC output enable/disable register
//!
//! \return None.
//
//*****************************************************************************
static inline void
DAC_lockRegister(uint32_t base, uint16_t reg)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
ASSERT((reg & ~(DAC_LOCK_CONTROL | DAC_LOCK_SHADOW |
DAC_LOCK_OUTPUT)) == 0U);
//
// Lock the specified registers
//
EALLOW;
HWREGH(base + DAC_O_LOCK) |= (DAC_LOCK_KEY | reg);
EDIS;
}
//*****************************************************************************
//
//! Check if DAC Register is locked
//!
//! \param base is the DAC module base address
//! \param reg is the selected DAC register locks to check
//!
//! This function checks if write-access has been locked on the specified DAC
//! register.
//!
//! The \e reg parameter can be an ORed combination of any of the following
//! values:
//! - \b DAC_LOCK_CONTROL - Lock the DAC control register
//! - \b DAC_LOCK_SHADOW - Lock the DAC shadow value register
//! - \b DAC_LOCK_OUTPUT - Lock the DAC output enable/disable register
//!
//! \return Returns \b true if any of the registers specified are locked, and
//! \b false if all specified registers aren't locked.
//
//*****************************************************************************
static inline bool
DAC_isRegisterLocked(uint32_t base, uint16_t reg)
{
//
// Check the arguments.
//
ASSERT(DAC_isBaseValid(base));
ASSERT((reg & ~(DAC_LOCK_CONTROL | DAC_LOCK_SHADOW |
DAC_LOCK_OUTPUT)) == 0U);
//
// Return the lock status on the specified registers
//
return((bool)((HWREGH(base + DAC_O_LOCK) & reg) != 0U));
}
//*****************************************************************************
//
//! Tune DAC Offset Trim
//!
//! \param base is the DAC module base address
//! \param referenceVoltage is the reference voltage the DAC
//! module is operating at.
//!
//! This function adjusts/tunes the DAC offset trim. The \e referenceVoltage
//! value should be a floating point number in the range specified in the
//! device data manual.
//!
//! \note Use this function to adjust the DAC offset trim if operating
//! at a reference voltage other than 2.5v. Since this function modifies
//! the DAC offset trim register, it should only be called once after
//! Device_cal. If it is called multiple times after Device_cal, the offset
//! value scaled would be the wrong value.
//!
//! \return None.
//
//*****************************************************************************
extern void
DAC_tuneOffsetTrim(uint32_t base, float32_t referenceVoltage);
//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // DAC_H
+405
View File
@@ -0,0 +1,405 @@
//###########################################################################
//
// FILE: dcc.c
//
// TITLE: C28x DCC driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "dcc.h"
//*****************************************************************************
//
// DCC_verifyClockFrequency
//
//*****************************************************************************
bool
DCC_verifyClockFrequency(uint32_t base,
DCC_Count1ClockSource clock1,
float32_t freq1,
DCC_Count0ClockSource clock0,
float32_t freq0,
float32_t tolerance,
float32_t freqerr,
float32_t freq_sysclk)
{
float32_t total_error;
float32_t window;
uint32_t count0;
uint32_t valid;
uint32_t count1;
bool status;
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// If Fclk1 > Fclk0,
// Async. Error (In Clock0 cycles) = 2 + 2*(Fsysclk/Fclk0)
//
// If Fclk1 < Fclk0,
// Async. Error (In Clock0 cycles) = 2*(Fclk0/Fclk1) + 2*(Fsysclk/Fclk0)
//
if(freq1 > freq0)
{
total_error = (2.0F + (2.0F * (freq_sysclk / freq0)));
}
else
{
total_error = ((2.0F * (freq0 / freq1)) +
(2.0F * (freq_sysclk / freq0)));
}
//
// Digitization error = 8 Clock0 cycles
//
total_error += 8.0F;
//
// Window (in Cycles) = (Total Error) / (0.01 * Tolerance)
//
window = total_error / (0.01F * tolerance);
//
// Error due to variance in clock frequency =
// window * (Allowable Frequency Tolerance (in %) / 100)
//
total_error += window * (freqerr / 100.0F);
//
// DCC counter configuration :
// Counter0 = Window - Total Error
// Valid0 = 2 * Total Error
// Counter1 = Window * (Fclk1 / Fclk0)
//
count0 = window - total_error;
valid = 2U * (uint32_t)total_error;
count1 = window * freq1 / freq0;
//
// Clear Error & Done Flag
//
DCC_clearErrorFlag(base);
DCC_clearDoneFlag(base);
//
// Disable DCC and the error and done signals
//
DCC_disableModule(base);
DCC_disableErrorSignal(base);
DCC_disableDoneSignal(base);
//
// Configure Clock Source0 and clock source1
//
DCC_setCounter0ClkSource(base, clock0);
DCC_setCounter1ClkSource(base, clock1);
//
// Configure COUNTER-0, COUNTER-1 & Valid Window
//
DCC_setCounterSeeds(base, count0, valid, count1);
//
// Enable Single Shot mode
//
DCC_enableSingleShotMode(base, DCC_MODE_COUNTER_ZERO);
//
// Enable Error Signal and Done signal
//
DCC_enableErrorSignal(base);
DCC_enableDoneSignal(base);
//
// Enable DCC to start counting
//
DCC_enableModule(base);
//
// Wait until Error or Done Flag is generated
//
while(!(DCC_getSingleShotStatus(base) || DCC_getErrorStatus(base)))
{
}
//
// Returns true if DCC completes without error
//
if(DCC_getSingleShotStatus(base))
{
status = true;
}
else
{
status = false;
}
return(status);
}
//*****************************************************************************
//
// DCC_measureClockFrequency
//
//*****************************************************************************
float32_t
DCC_measureClockFrequency(uint32_t base,
DCC_Count1ClockSource clock1,
DCC_Count0ClockSource clock0,
float32_t freq0,
float32_t tolerance,
float32_t freqerr,
float32_t freq_sysclk)
{
float32_t total_error;
float32_t window;
uint32_t count0;
uint32_t valid;
uint32_t count1;
uint32_t actual_cnt1;
float32_t freq1;
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Async. Error = 2 + 2*(Fsysclk/Fclk0)
// Digitization error = 8 Clock0 cycles
// Total DCC error = Async Error + Digitization error
//
total_error = (2.0F + (2.0F * (freq_sysclk / freq0)));
total_error += 8.0F;
//
// Window (in Cycles) = (Total Error) / (0.01 * Tolerance)
//
window = total_error / (0.01F * tolerance);
//
// Error due to variance in clock frequency =
// window * (Allowable Frequency Tolerance (in %) / 100)
//
total_error += window * (freqerr / 100.0F);
//
// DCC counter configuration :
// Counter0 = Window - Total Error
// Valid0 = 2 * Total Error
// Counter1 = Maximum counter value (0xFFFFF)
//
count0 = window - total_error;
valid = 2U * (uint32_t)total_error;
count1 = 0xFFFFFU;
//
// Clear Error & Done Flag
//
DCC_clearErrorFlag(base);
DCC_clearDoneFlag(base);
//
// Disable DCC and the error and done signals
//
DCC_disableModule(base);
DCC_disableErrorSignal(base);
DCC_disableDoneSignal(base);
//
// Configure Clock Source0 and clock source1
//
DCC_setCounter0ClkSource(base, clock0);
DCC_setCounter1ClkSource(base, clock1);
//
// Configure COUNTER-0, COUNTER-1 & Valid Window
//
DCC_setCounterSeeds(base, count0, valid, count1);
//
// Enable Single Shot mode
//
DCC_enableSingleShotMode(base, DCC_MODE_COUNTER_ZERO);
//
// Enable Error Signal and Done signal
//
DCC_enableErrorSignal(base);
DCC_enableDoneSignal(base);
//
// Enable DCC to start counting
//
DCC_enableModule(base);
//
// Wait until Error or Done Flag is generated
//
while(!(DCC_getSingleShotStatus(base) || DCC_getErrorStatus(base)))
{
}
//
// Calculate the difference of the current counter
// values with the initial fed counter values. This
// will give the counts corresponding to the frequency
// of each clock source
//
actual_cnt1 = count1 - DCC_getCounter1Value(base);
//
// Compute the frequency using relation F1 = (F0 * Actual C1)/Window.
//
freq1 = (freq0 * (float32_t)actual_cnt1) /
((float32_t)count0 + (float32_t)valid);
return(freq1);
}
//*****************************************************************************
//
// DCC_continuousMonitor
//
//*****************************************************************************
void
DCC_continuousMonitor(uint32_t base,
DCC_Count1ClockSource clock1,
float32_t freq1,
DCC_Count0ClockSource clock0,
float32_t freq0,
float32_t tolerance,
float32_t freqerr,
float32_t freq_sysclk)
{
float32_t total_error;
float32_t window;
uint32_t count0;
uint32_t valid;
uint32_t count1;
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// If Fclk1 > Fclk0,
// Async. Error (In Clock0 cycles) = 2 + 2*(Fsysclk/Fclk0)
//
// If Fclk1 < Fclk0,
// Async. Error (In Clock0 cycles) = 2*(Fclk0/Fclk1) + 2*(Fsysclk/Fclk0)
//
if(freq1 > freq0)
{
total_error = (2.0F + (2.0F * (freq_sysclk / freq0)));
}
else
{
total_error = ((2.0F * (freq0 / freq1)) +
(2.0F * (freq_sysclk / freq0)));
}
//
// Digitization error = 8 Clock0 cycles
//
total_error += 8.0F;
//
// Window (in Cycles) = (Total Error) / (0.01 * Tolerance)
//
window = total_error / (0.01F * tolerance);
//
// Error due to variance in clock frequency =
// window * (Allowable Frequency Tolerance (in %) / 100)
//
total_error += window * (freqerr / 100.0F);
//
// DCC counter configuration :
// Counter0 = Window - Total Error
// Valid0 = 2 * Total Error
// Counter1 = Window * (Fclk1 / Fclk0)
//
count0 = window - total_error;
valid = 2U * (uint32_t)total_error;
count1 = window * freq1 / freq0;
//
// Clear Error & Done Flag
//
DCC_clearErrorFlag(base);
DCC_clearDoneFlag(base);
//
// Disable DCC and the error and done signals
//
DCC_disableModule(base);
DCC_disableErrorSignal(base);
DCC_disableDoneSignal(base);
//
// Configure Clock Source0 and clock source1
//
DCC_setCounter0ClkSource(base, clock0);
DCC_setCounter1ClkSource(base, clock1);
//
// Configure COUNTER-0, COUNTER-1 & Valid Window
//
DCC_setCounterSeeds(base, count0, valid, count1);
//
// Enable Continuous mode
//
DCC_disableSingleShotMode(base);
//
// Enable Error Signal
//
DCC_enableErrorSignal(base);
//
// Enable DCC to start counting
//
DCC_enableModule(base);
}
+965
View File
@@ -0,0 +1,965 @@
//###########################################################################
//
// FILE: dcc.h
//
// TITLE: C28x DCC driver.
//
//###########################################################################
//
// 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 DCC_H
#define DCC_H
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
//
//! \addtogroup dcc_api DCC
//! @{
//
//*****************************************************************************
#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_dcc.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "cpu.h"
#include "debug.h"
//
// Minimum and maximum values of valid seed value
//
#define DCC_VALIDSEED_MIN 4U
#define DCC_VALIDSEED_MAX 0xFFFFU
//
// Minimum and maximum values of counter0/1 seed value
//
#define DCC_COUNTSEED_MIN 1U
#define DCC_COUNTSEED_MAX 0xFFFFFU
//
// The reset value required to start or enable specific DCC operations
//
#define DCC_ENABLE_VALUE (0xAU)
//
// The reset value required to stop or disable specific DCC operations
//
#define DCC_DISABLE_VALUE (0x5U)
//
// A 16-bit register mask
//
#define DCC_REG_WORD_MASK (0xFFFFU)
//
// A 7-bit register mask
//
#define DCC_REG_BYTE_MASK (0x7FU)
//
// A mask for the DCC counter seed registers
//
#define DCC_SEED_REG_MASK (0xFFF0U)
//
// A mask for the DCC counter seed value
//
#define DCC_SEED_CNT_MASK (0xF0000U)
//*****************************************************************************
//
//! The following are defines for the mode parameter of the
//! DCC_enableSingleShotMode() function.
//
//*****************************************************************************
typedef enum
{
//! Use to stop counting when counter0 and valid0 both reach zero
DCC_MODE_COUNTER_ZERO = 0xA00U,
//! Use to stop counting when counter1 reaches zero
DCC_MODE_COUNTER_ONE = 0xB00U
} DCC_SingleShotMode;
//*****************************************************************************
//
//! The following are defines for the source parameter of the
//! DCC_setCounter1ClkSource() function.
//
//*****************************************************************************
typedef enum
{
DCC_COUNT1SRC_PLL = 0x0U, //!< PLLRAWCLK Clock Out Source
DCC_COUNT1SRC_AUXPLL = 0x1U, //!< AUXPLL Clock Out Source
DCC_COUNT1SRC_INTOSC1 = 0x2U, //!< Internal Oscillator1 Clock Source
DCC_COUNT1SRC_INTOSC2 = 0x3U, //!< Internal Oscillator2 Clock Source
DCC_COUNT1SRC_CMCLK = 0x5U, //!< CM Clock Source
DCC_COUNT1SRC_CPU1SYSCLK = 0x6U, //!< CPU1 SYSCLK (System Clock) Source
DCC_COUNT1SRC_ENETRXCLK = 0x7U, //!< etherNET RXCLK Clock Source
DCC_COUNT1SRC_CPU2SYSCLK = 0x8U, //!< CPU2 SYSCLK (System Clock) Source
DCC_COUNT1SRC_CROSSBAR = 0x9U, //!< Input XBAR Clock Source
DCC_COUNT1SRC_AUXCLKIN = 0xAU, //!< AUXCLK (Auxiliary Clock) Source
DCC_COUNT1SRC_EPWM = 0xBU, //!< EPWM Clock Source
DCC_COUNT1SRC_LSPCLK = 0xCU, //!< LSPCLK (Low Speed Clock) Source
DCC_COUNT1SRC_ECATMII0RXCLK = 0xDU, //!< MII0 RXCLK (etherCAT) Clock Source
DCC_COUNT1SRC_WDCLK = 0xEU, //!< Watch Dog Clock Source
DCC_COUNT1SRC_CANX = 0xFU, //!< CANxBIT Clock Source
DCC_COUNT1SRC_ECATMII1RXCLK = 0x17U, //!< MII1 RXCLK (etherCAT) Clk Src
} DCC_Count1ClockSource;
//*****************************************************************************
//
//! The following are defines for the source parameter of the
//! DCC_setCounter0ClkSource() function.
//
//*****************************************************************************
typedef enum
{
DCC_COUNT0SRC_XTAL = 0x0U, //!< XTAL Clock Source
DCC_COUNT0SRC_INTOSC1 = 0x1U, //!< Internal Oscillator1 Clock Source
DCC_COUNT0SRC_INTOSC2 = 0x2U, //!< Internal Oscillator2 Clock Source
DCC_COUNT0SRC_CPU1SYSCLK = 0x5U, //!< CPU1 SYSCLK (System Clock) Source
DCC_COUNT0SRC_CPU2SYSCLK = 0x6U, //!< CPU2 SYSCLK (System Clock) Source
DCC_COUNT0SRC_XBAR = 0xCU, //!< Input XBAR Clock Source
} DCC_Count0ClockSource;
//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************
//*****************************************************************************
//
//! \internal
//! Checks DCC base address.
//!
//! \param base specifies the DCC module base address.
//!
//! This function determines if an DCC module base address is valid.
//!
//! \return Returns \b true if the base address is valid and \b false
//! otherwise.
//
//*****************************************************************************
#ifdef DEBUG
static inline bool
DCC_isBaseValid(uint32_t base)
{
return(
(base == DCC0_BASE) ||
(base == DCC1_BASE) ||
(base == DCC2_BASE)
);
}
#endif
//*****************************************************************************
//
//! Enables the DCC module.
//!
//! \param base is the DCC module base address
//!
//! This function starts the DCC counter operation.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_enableModule(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Set DCC enable bit field.
//
EALLOW;
HWREGH(base + DCC_O_GCTRL) = (HWREGH(base + DCC_O_GCTRL) &
~(DCC_GCTRL_DCCENA_M)) | DCC_ENABLE_VALUE;
EDIS;
}
//*****************************************************************************
//
//! Disable the DCC module.
//!
//! \param base is the DCC module base address
//!
//! This function stops the DCC counter operation.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_disableModule(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Reset DCC enable bit field.
//
EALLOW;
HWREGH(base + DCC_O_GCTRL) = (HWREGH(base + DCC_O_GCTRL) &
~(DCC_GCTRL_DCCENA_M)) | DCC_DISABLE_VALUE;
EDIS;
}
//*****************************************************************************
//
//! Enable DCC Error Signal
//!
//! \param base is the DCC module base address
//!
//! This function enables the error signal interrupt.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_enableErrorSignal(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Enable the error signal
//
EALLOW;
HWREGH(base + DCC_O_GCTRL) = (HWREGH(base + DCC_O_GCTRL) &
~(DCC_GCTRL_ERRENA_M)) |
(DCC_ENABLE_VALUE << 4U);
EDIS;
}
//*****************************************************************************
//
//! Enable DCC Done Signal
//!
//! \param base is the DCC module base address
//!
//! This function enables the done signal interrupt.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_enableDoneSignal(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Enable the done interrupt signal
//
EALLOW;
HWREGH(base + DCC_O_GCTRL) = (HWREGH(base + DCC_O_GCTRL) &
~(DCC_GCTRL_DONEENA_M)) |
(DCC_ENABLE_VALUE << 12U);
EDIS;
}
//*****************************************************************************
//
//! Disable DCC Error Signal
//!
//! \param base is the DCC module base address
//!
//! This function disables the error signal interrupt.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_disableErrorSignal(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Disable the error signal
//
EALLOW;
HWREGH(base + DCC_O_GCTRL) = (HWREGH(base + DCC_O_GCTRL) &
~(DCC_GCTRL_ERRENA_M)) |
(DCC_DISABLE_VALUE << 4U);
EDIS;
}
//*****************************************************************************
//
//! Disable DCC Done Signal
//!
//! \param base is the DCC module base address
//!
//! This function disables the done signal interrupt.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_disableDoneSignal(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Disable the done interrupt signal
//
EALLOW;
HWREGH(base + DCC_O_GCTRL) = (HWREGH(base + DCC_O_GCTRL) &
~(DCC_GCTRL_DONEENA_M)) |
(DCC_DISABLE_VALUE << DCC_GCTRL_DONEENA_S);
EDIS;
}
//*****************************************************************************
//
//! Enable DCC Single-Shot Mode
//!
//! \param base is the DCC module base address
//! \param mode is the selected Single-Shot operation mode
//!
//! This function enables the single-shot mode and sets the operation mode.
//!
//! The \e mode parameter can have one of two values:
//! - \b DCC_MODE_COUNTER_ZERO - Stops counting when counter0 and valid0 both
//! reach zero
//! - \b DCC_MODE_COUNTER_ONE - Stops counting when counter1 reaches zero
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_enableSingleShotMode(uint32_t base, DCC_SingleShotMode mode)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Set Single-Shot mode value to the appropriate register
//
if(mode == DCC_MODE_COUNTER_ZERO)
{
EALLOW;
HWREGH(base + DCC_O_GCTRL) = (HWREGH(base + DCC_O_GCTRL) &
~(DCC_GCTRL_SINGLESHOT_M)) |
(uint16_t)DCC_MODE_COUNTER_ZERO;
EDIS;
}
else
{
EALLOW;
HWREGH(base + DCC_O_GCTRL) = (HWREGH(base + DCC_O_GCTRL) &
~(DCC_GCTRL_SINGLESHOT_M)) |
(uint16_t)DCC_MODE_COUNTER_ONE;
EDIS;
}
}
//*****************************************************************************
//
//! Disable DCC Single-Shot Mode
//!
//! \param base is the DCC module base address
//!
//! This function disables the DCC Single-Shot operation mode
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_disableSingleShotMode(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Reset Single-Shot enable bit field.
//
EALLOW;
HWREGH(base + DCC_O_GCTRL) = (HWREGH(base + DCC_O_GCTRL) &
~(DCC_GCTRL_SINGLESHOT_M)) |
(DCC_DISABLE_VALUE << DCC_GCTRL_SINGLESHOT_S);
EDIS;
}
//*****************************************************************************
//
//! Get Error Flag Status
//!
//! \param base is the DCC module base address
//!
//! This function gets the error flag status.
//!
//! \return Returns \b true if an error has occurred, \b false if no errors
//! have occurred.
//
//*****************************************************************************
static inline bool
DCC_getErrorStatus(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Get the error flag
//
return((bool)((HWREGH(base + DCC_O_STATUS) & DCC_STATUS_ERR) ==
DCC_STATUS_ERR));
}
//*****************************************************************************
//
//! Get Single-Shot Done Flag Status
//!
//! \param base is the DCC module base address
//!
//! This function gets the single-shot done flag status.
//!
//! \return Returns \b true if single-shot mode has completed, \b false if
//! single-shot mode has not completed.
//
//*****************************************************************************
static inline bool
DCC_getSingleShotStatus(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Read the done flag
//
return((bool)((HWREGH(base + DCC_O_STATUS) & DCC_STATUS_DONE) ==
DCC_STATUS_DONE));
}
//*****************************************************************************
//
//! Clear Error Status Flag
//!
//! \param base is the DCC module base address
//!
//! This function clears the DCC error status flag.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_clearErrorFlag(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Clear error status flag
//
EALLOW;
HWREGH(base + DCC_O_STATUS) |= DCC_STATUS_ERR;
EDIS;
}
//*****************************************************************************
//
//! Clear Single-Shot Done Status Flag
//!
//! \param base is the DCC module base address
//!
//! This function clears the DCC single-shot done status flag.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_clearDoneFlag(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Clear done status flag
//
EALLOW;
HWREGH(base + DCC_O_STATUS) |= DCC_STATUS_DONE;
EDIS;
}
//*****************************************************************************
//
//! Get Current Value of Counter 0
//!
//! \param base is the DCC module base address
//!
//! This function gets current value of counter 0.
//!
//! \note Reads of the counter value may not be exact since the read operation
//! is synchronized to the vbus clock.
//!
//! \return Returns the current value of counter 0.
//
//*****************************************************************************
static inline uint32_t
DCC_getCounter0Value(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Get the current counter 0 value
//
return(HWREG(base + DCC_O_CNT0));
}
//*****************************************************************************
//
//! Get Current Value of the Valid Duration Counter for Counter 0
//!
//! \param base is the DCC module base address
//!
//! This function gets current value of the valid duration counter for
//! counter 0.
//!
//! \note Reads of the counter value may not be exact since the read operation
//! is synchronized to the vbus clock.
//!
//! \return Returns the current value of the valid duration counter.
//
//*****************************************************************************
static inline uint16_t
DCC_getValidCounter0Value(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Get the current valid duration counter value
//
return(HWREGH(base + DCC_O_VALID0));
}
//*****************************************************************************
//
//! Get Current Value of Counter 1
//!
//! \param base is the DCC module base address
//!
//! This function gets current value of counter 1.
//!
//! \note Reads of the counter value may not be exact since the read operation
//! is synchronized to the vbus clock.
//!
//! \return Returns the current value of counter 1.
//
//*****************************************************************************
static inline uint32_t
DCC_getCounter1Value(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Get the current counter 1 value
//
return(HWREG(base + DCC_O_CNT1));
}
//*****************************************************************************
//
//! Set Counter 1 Clock Source
//!
//! \param base is the DCC module base address
//! \param source is the selected clock source for counter 1
//!
//! This function sets the counter 1 clock source.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_setCounter1ClkSource(uint32_t base, DCC_Count1ClockSource source)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Set the specified clock source
//
EALLOW;
//
// DCC Clk source is of 5bits DCCCLKSRC1[4:0]
//
HWREGH(base + DCC_O_CLKSRC1) = (HWREGH(base + DCC_O_CLKSRC1) &
(DCC_REG_BYTE_MASK << 5U)) |
((DCC_ENABLE_VALUE << 12U) |
(uint16_t)source);
EDIS;
}
//*****************************************************************************
//
//! Set Counter 0 Clock Source
//!
//! \param base is the DCC module base address
//! \param source is the selected clock source for counter 0
//!
//! This function sets the counter 0 clock source.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_setCounter0ClkSource(uint32_t base, DCC_Count0ClockSource source)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Set the specified clock source
//
EALLOW;
//
// DCC Clk source is of 5bits DCCCLKSRC0[4:0]
//
HWREGH(base + DCC_O_CLKSRC0) = (HWREGH(base + DCC_O_CLKSRC0) &
(DCC_REG_BYTE_MASK << 5U)) |
((DCC_ENABLE_VALUE << 12U) |
(uint16_t)source);
EDIS;
}
//*****************************************************************************
//
//! Get Counter 1 Clock Source
//!
//! \param base is the DCC module base address
//!
//! This function gets the counter 1 clock source.
//!
//! \return Returns Counter 1 clock source from the enum DCC_Count1ClockSource
//
//*****************************************************************************
static inline uint16_t
DCC_getCounter1ClkSource(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Get the specified clock source
//
return(HWREGH(base + DCC_O_CLKSRC1) & DCC_CLKSRC1_CLKSRC1_M);
}
//*****************************************************************************
//
//! Get Counter 0 Clock Source
//!
//! \param base is the DCC module base address
//!
//! This function gets the counter 0 clock source.
//!
//! \return Returns Counter 0 clock source from the enum DCC_Count0ClockSource
//
//*****************************************************************************
static inline uint16_t
DCC_getCounter0ClkSource(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
//
// Get the specified clock source
//
return(HWREGH(base + DCC_O_CLKSRC0) & DCC_CLKSRC0_CLKSRC0_M);
}
//*****************************************************************************
//
//! Set the seed values
//!
//! \param base is the DCC module base address
//! \param counter0 sets the seed value that gets loaded into Counter 0
//! \param validCounter0 sets the seed value that gets loaded into the valid
//! duration counter for Counter 0
//! \param counter1 sets the seed value that gets loaded into Counter 1
//!
//! This function sets the seed values for Counter 0, Valid Duration Counter 0,
//! and Counter 1.
//!
//! \note
//! -# Operating DCC with '0' set as the seed value for Counter 0, Valid
//! Duration Counter 0, and/or Counter 1 will result in undefined operation.
//! -# The Valid Duration Counter 0 is designed to be at least four cycles
//! wide and shouldn't be programmed with a value less than '4'.
//!
//! \return None.
//
//*****************************************************************************
static inline void
DCC_setCounterSeeds(uint32_t base, uint32_t counter0, uint32_t validCounter0,
uint32_t counter1)
{
//
// Check the arguments.
//
ASSERT(DCC_isBaseValid(base));
ASSERT(validCounter0 >= DCC_VALIDSEED_MIN);
ASSERT(counter0 >= DCC_COUNTSEED_MIN);
ASSERT(counter1 >= DCC_COUNTSEED_MIN);
ASSERT(validCounter0 <= DCC_VALIDSEED_MAX);
ASSERT(counter0 <= DCC_COUNTSEED_MAX);
ASSERT(counter1 <= DCC_COUNTSEED_MAX);
EALLOW;
//
// Set Counter 0 Seed
//
HWREGH(base + DCC_O_CNTSEED0) = counter0 & DCC_REG_WORD_MASK;
HWREGH(base + DCC_O_CNTSEED0 + 2U) = (HWREGH(base + DCC_O_CNTSEED0 + 2U) &
DCC_SEED_REG_MASK) |
((uint32_t)(counter0 &
DCC_SEED_CNT_MASK) >> 16U);
//
// Set Valid Duration Counter 0 Seed
//
HWREGH(base + DCC_O_VALIDSEED0) = validCounter0;
//
// Set Counter 1 Seed
//
HWREGH(base + DCC_O_CNTSEED1) = counter1 & DCC_REG_WORD_MASK;
HWREGH(base + DCC_O_CNTSEED1 + 2U) = (HWREGH(base + DCC_O_CNTSEED1 + 2U) &
DCC_SEED_REG_MASK) |
((uint32_t)(counter1 &
DCC_SEED_CNT_MASK) >> 16U);
EDIS;
}
//*****************************************************************************
//
//! Verify the frequency of a clock source using a reference clock
//!
//! \param base is the DCC module base address
//! \param clock1 is the clock source to be verified
//! \param freq1 is the frequency of the clock source to be verified
//! \param clock0 is the reference clock
//! \param freq0 is the frequency of the reference clock
//! \param tolerance is the DCC error tolerance in percentage
//! \param freqerr is the allowable Frequency Tolerance in percentage
//! \param freq_sysclk is the frequency of the system clock
//!
//! This function verifies the frequency of the specified clock using a
//! reference clock.
//!
//! \note Make sure that the frequency of all the clocks are in the same unit
//!
//! \return Returns \b true if the actual frequency of clock1 is matching
//! freq1, \b false otherwise
//
//*****************************************************************************
extern bool
DCC_verifyClockFrequency(uint32_t base,
DCC_Count1ClockSource clock1,
float32_t freq1,
DCC_Count0ClockSource clock0,
float32_t freq0,
float32_t tolerance,
float32_t freqerr,
float32_t freq_sysclk);
//*****************************************************************************
//
//! Measure the frequency of a clock source using a reference clock
//!
//! \param base is the DCC module base address
//! \param clock1 is the clock source to be measured
//! \param clock0 is the reference clock
//! \param freq0 is the frequency of the reference clock
//! \param tolerance is the DCC error tolerance in percentage
//! \param freqerr is the allowable Frequency Tolerance in percentage
//! \param freq_sysclk is the frequency of the system clock
//!
//! This function measures the frequency of the specified clock using a
//! reference clock.
//!
//! \note Make sure that the frequency of all the clocks are in the same unit
//!
//! \return Measured clock frequency
//
//*****************************************************************************
extern float32_t
DCC_measureClockFrequency(uint32_t base,
DCC_Count1ClockSource clock1,
DCC_Count0ClockSource clock0,
float32_t freq0,
float32_t tolerance,
float32_t freqerr,
float32_t freq_sysclk);
//*****************************************************************************
//
//! Continuously monitor the frequency of a clock source using a reference clock
//!
//! \param base is the DCC module base address
//! \param clock1 is the clock source to be verified
//! \param freq1 is the frequency of the clock source to be verified
//! \param clock0 is the reference clock
//! \param freq0 is the frequency of the reference clock
//! \param tolerance is the DCC error tolerance in percentage
//! \param freqerr is the allowable Frequency Tolerance in percentage
//! \param freq_sysclk is the frequency of the system clock
//!
//! This function continuously monitors the frequency of the specified clock
//! using a reference clock. An error signal is generated if the frequency
//! ratio is altered.
//!
//! \note Make sure that the frequency of all the clocks are in the same unit
//!
//! \note This function does not enable the DCC interrupt. The user application
//! must enable it to trigger an intetrupt when an error is detected.
//!
//! \return Returns None
//
//*****************************************************************************
extern void
DCC_continuousMonitor(uint32_t base,
DCC_Count1ClockSource clock1,
float32_t freq1,
DCC_Count0ClockSource clock0,
float32_t freq0,
float32_t tolerance,
float32_t freqerr,
float32_t freq_sysclk);
//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // DCC_H
+645
View File
@@ -0,0 +1,645 @@
//#############################################################################
//
// FILE: dcsm.c
//
// TITLE: C28x Driver for the DCSM security module.
//
//#############################################################################
//
// 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.
// $
//#############################################################################
#include "dcsm.h"
//*****************************************************************************
//
// DCSM_unlockZone1CSM
//
//*****************************************************************************
void
DCSM_unlockZone1CSM(const DCSM_CSMPasswordKey * const psCMDKey)
{
uint32_t linkPointer;
uint32_t zsbBase = (DCSM_Z1OTP_BASE + 0x20U); // base address of the ZSB
int32_t bitPos = 13; // Bits [13:0] point to a ZSB (14-bit link pointer)
int32_t zeroFound = 0;
//
// Check the arguments.
//
ASSERT(psCMDKey != NULL);
linkPointer = HWREG(DCSM_Z1_BASE + DCSM_O_Z1_LINKPOINTER);
//
// Bits 31 - 14 as most-significant 0 are invalid LinkPointer options
//
linkPointer = linkPointer << 18;
//
// Zone-Select Block (ZSB) selection using Link-Pointers
// and 0's bit position within the Link pointer
//
while((zeroFound == 0) && (bitPos > -1))
{
//
// The most significant bit position in the resolved link pointer
// which is 0, defines the valid base address for the ZSB.
//
if((linkPointer & 0x80000000U) == 0U)
{
zeroFound = 1;
//
// Base address of the ZSB is calculated using
// 0x20 as the slope/step with which zsbBase expands with
// change in the bitPos and 2*0x20 is the offset
//
zsbBase = (DCSM_Z1OTP_BASE + (((uint32_t)bitPos + 2U) * 0x20U));
}
else
{
//
// Move through the linkPointer to find the most significant
// bit position of 0
//
bitPos--;
linkPointer = linkPointer << 1;
}
}
//
// Perform dummy reads on the 128-bit password
// Using linkPointer because it is no longer needed
//
linkPointer = HWREG(zsbBase + DCSM_O_Z1_CSMPSWD0);
linkPointer = HWREG(zsbBase + DCSM_O_Z1_CSMPSWD1);
linkPointer = HWREG(zsbBase + DCSM_O_Z1_CSMPSWD2);
linkPointer = HWREG(zsbBase + DCSM_O_Z1_CSMPSWD3);
if(psCMDKey != NULL)
{
HWREG(DCSM_Z1_BASE + DCSM_O_Z1_CSMKEY0) = psCMDKey->csmKey0;
HWREG(DCSM_Z1_BASE + DCSM_O_Z1_CSMKEY1) = psCMDKey->csmKey1;
HWREG(DCSM_Z1_BASE + DCSM_O_Z1_CSMKEY2) = psCMDKey->csmKey2;
HWREG(DCSM_Z1_BASE + DCSM_O_Z1_CSMKEY3) = psCMDKey->csmKey3;
}
}
//*****************************************************************************
//
// DCSM_unlockZone2CSM
//
//*****************************************************************************
void
DCSM_unlockZone2CSM(const DCSM_CSMPasswordKey * const psCMDKey)
{
uint32_t linkPointer;
uint32_t zsbBase = (DCSM_Z2OTP_BASE + 0x20U); // base address of the ZSB
int32_t bitPos = 13; // Bits [13:0] point to a ZSB (14-bit link pointer)
int32_t zeroFound = 0;
//
// Check the arguments.
//
ASSERT(psCMDKey != NULL);
linkPointer = HWREG(DCSM_Z2_BASE + DCSM_O_Z2_LINKPOINTER);
//
// Bits 31 - 14 as most-significant 0 are invalid LinkPointer options
//
linkPointer = linkPointer << 18;
//
// Zone-Select Block (ZSB) selection using Link-Pointers
// and 0's bit position within the Link pointer
//
while((zeroFound == 0) && (bitPos > -1))
{
//
// The most significant bit position in the resolved link pointer
// which is 0, defines the valid base address for the ZSB.
//
if((linkPointer & 0x80000000U) == 0U)
{
zeroFound = 1;
//
// Base address of the ZSB is calculated using
// 0x20 as the slope/step with which zsbBase expands with
// change in the bitPos and 2*0x20 is the offset
//
zsbBase = (DCSM_Z2OTP_BASE + (((uint32_t)bitPos + 2U) * 0x20U));
}
else
{
//
// Move through the linkPointer to find the most significant
// bit position of 0
//
bitPos--;
linkPointer = linkPointer << 1;
}
}
//
// Perform dummy reads on the 128-bit password
// Using linkPointer because it is no longer needed
//
linkPointer = HWREG(zsbBase + DCSM_O_Z2_CSMPSWD0);
linkPointer = HWREG(zsbBase + DCSM_O_Z2_CSMPSWD1);
linkPointer = HWREG(zsbBase + DCSM_O_Z2_CSMPSWD2);
linkPointer = HWREG(zsbBase + DCSM_O_Z2_CSMPSWD3);
if(psCMDKey != NULL)
{
HWREG(DCSM_Z2_BASE + DCSM_O_Z2_CSMKEY0) = psCMDKey->csmKey0;
HWREG(DCSM_Z2_BASE + DCSM_O_Z2_CSMKEY1) = psCMDKey->csmKey1;
HWREG(DCSM_Z2_BASE + DCSM_O_Z2_CSMKEY2) = psCMDKey->csmKey2;
HWREG(DCSM_Z2_BASE + DCSM_O_Z2_CSMKEY3) = psCMDKey->csmKey3;
}
}
//*****************************************************************************
//
// DCSM_writeZone1CSM
//
//*****************************************************************************
void
DCSM_writeZone1CSM(const DCSM_CSMPasswordKey * const psCMDKey)
{
//
// Check the arguments.
//
ASSERT(psCMDKey != NULL);
if(psCMDKey != NULL)
{
HWREG(DCSM_Z1_BASE + DCSM_O_Z1_CSMKEY0) = psCMDKey->csmKey0;
HWREG(DCSM_Z1_BASE + DCSM_O_Z1_CSMKEY1) = psCMDKey->csmKey1;
HWREG(DCSM_Z1_BASE + DCSM_O_Z1_CSMKEY2) = psCMDKey->csmKey2;
HWREG(DCSM_Z1_BASE + DCSM_O_Z1_CSMKEY3) = psCMDKey->csmKey3;
}
}
//*****************************************************************************
//
// DCSM_writeZone2CSM
//
//*****************************************************************************
void
DCSM_writeZone2CSM(const DCSM_CSMPasswordKey * const psCMDKey)
{
//
// Check the arguments.
//
ASSERT(psCMDKey != NULL);
if(psCMDKey != NULL)
{
HWREG(DCSM_Z2_BASE + DCSM_O_Z2_CSMKEY0) = psCMDKey->csmKey0;
HWREG(DCSM_Z2_BASE + DCSM_O_Z2_CSMKEY1) = psCMDKey->csmKey1;
HWREG(DCSM_Z2_BASE + DCSM_O_Z2_CSMKEY2) = psCMDKey->csmKey2;
HWREG(DCSM_Z2_BASE + DCSM_O_Z2_CSMKEY3) = psCMDKey->csmKey3;
}
}
//*****************************************************************************
//
// DCSM_getZone1FlashEXEStatus
//
//*****************************************************************************
DCSM_EXEOnlyStatus
DCSM_getZone1FlashEXEStatus(DCSM_Sector sector, DCSM_CPUSel cpuInst)
{
uint16_t regValue;
uint32_t regintValue;
DCSM_EXEOnlyStatus status;
//
// Check if sector belongs to this zone
//
if(DCSM_getFlashSectorZone(sector, cpuInst) != DCSM_MEMORY_ZONE1)
{
status = DCSM_INCORRECT_ZONE;
}
else
{
//
// Get the EXE status register
//
if(cpuInst == DCSM_CPUSEL_CPU1)
{
regintValue = ((HWREG(DCSM_Z1_BASE + DCSM_O_Z1_EXEONLYSECT1R)) &
DCSM_EXEONLYSECTR_M);
regValue = (uint16_t)regintValue;
}
else if(cpuInst == DCSM_CPUSEL_CM)
{
regintValue = ((HWREG(DCSM_Z1_BASE + DCSM_O_Z1_EXEONLYSECT1R))
>> DCSM_EXEONLYSECTR_S);
regValue = (uint16_t)regintValue;
}
else
{
regValue = (HWREGH(DCSM_Z1_BASE + DCSM_O_Z1_EXEONLYSECT2R));
}
//
// Get the EXE status of the Flash Sector
//
status = (DCSM_EXEOnlyStatus)((uint16_t)
((regValue >> (uint16_t)sector) &
0x01U));
}
return(status);
}
//*****************************************************************************
//
// DCSM_getZone1RAMEXEStatus
//
//*****************************************************************************
DCSM_EXEOnlyStatus
DCSM_getZone1RAMEXEStatus(DCSM_RAMModule module, DCSM_CPUSel cpuInst)
{
uint32_t status;
uint16_t moduleCM = 0U;
ASSERT(cpuInst <= DCSM_CPUSEL_CPU2);
if((cpuInst == DCSM_CPUSEL_CPU1) || (cpuInst == DCSM_CPUSEL_CPU2))
{
ASSERT(module < DCSM_C28_RAM_END);
}
if(cpuInst == DCSM_CPUSEL_CM)
{
ASSERT((module > DCSM_C28_RAM_END) &&
(module < DCSM_CM_RAM_END));
moduleCM = (uint16_t)module - ((uint16_t)DCSM_C28_RAM_END + 1U);
}
//
// Check if module belongs to this zone
//
if(DCSM_getRAMZone(module, cpuInst) != DCSM_MEMORY_ZONE1)
{
status = DCSM_INCORRECT_ZONE;
}
else
{
//
// Get the EXE status of the RAM Module
//
if(cpuInst == DCSM_CPUSEL_CPU1)
{
status = (uint16_t)((HWREGH(DCSM_Z1_BASE +
DCSM_O_Z1_EXEONLYRAM1R) >>
(uint16_t)module) & 0x01U);
}
else if(cpuInst == DCSM_CPUSEL_CM)
{
status = ((HWREG(DCSM_Z1_BASE + DCSM_O_Z1_EXEONLYRAM1R) >>
(DCSM_Z1_EXEONLYRAM1R_CM + moduleCM)) & 0x01UL);
}
else
{
status = ((HWREG(DCSM_Z1_BASE + DCSM_O_Z1_EXEONLYRAM1R) >>
(DCSM_Z1_EXEONLYRAM1R_CPU2 - (uint16_t)module)) & 0x01U);
}
}
return((DCSM_EXEOnlyStatus)status);
}
//*****************************************************************************
//
// DCSM_getZone2FlashEXEStatus
//
//*****************************************************************************
DCSM_EXEOnlyStatus
DCSM_getZone2FlashEXEStatus(DCSM_Sector sector, DCSM_CPUSel cpuInst)
{
uint16_t regValue;
uint32_t regintValue;
DCSM_EXEOnlyStatus status;
//
// Check if sector belongs to this zone
//
if(DCSM_getFlashSectorZone(sector, cpuInst) != DCSM_MEMORY_ZONE2)
{
status = DCSM_INCORRECT_ZONE;
}
else
{
//
// Get the EXE status register
//
if(cpuInst == DCSM_CPUSEL_CPU1)
{
regintValue = ((HWREG(DCSM_Z2_BASE +
DCSM_O_Z2_EXEONLYSECT1R)) &
DCSM_EXEONLYSECTR_M);
regValue = (uint16_t)regintValue;
}
else if(cpuInst == DCSM_CPUSEL_CM)
{
regintValue = ((HWREG(DCSM_Z2_BASE + DCSM_O_Z2_EXEONLYSECT1R))
>> DCSM_EXEONLYSECTR_S);
regValue = (uint16_t)regintValue;
}
else
{
regValue = HWREGH(DCSM_Z2_BASE + DCSM_O_Z2_EXEONLYSECT2R);
}
//
// Get the EXE status of the Flash Sector
//
status = (DCSM_EXEOnlyStatus)((uint16_t)((regValue >>
(uint16_t)sector) & 0x01U));
}
return(status);
}
//*****************************************************************************
//
// DCSM_getZone2RAMEXEStatus
//
//*****************************************************************************
DCSM_EXEOnlyStatus
DCSM_getZone2RAMEXEStatus(DCSM_RAMModule module, DCSM_CPUSel cpuInst)
{
uint32_t status;
uint16_t moduleCM = 0U;
ASSERT(cpuInst <= DCSM_CPUSEL_CPU2);
if((cpuInst == DCSM_CPUSEL_CPU1) || (cpuInst == DCSM_CPUSEL_CPU2))
{
ASSERT(module < DCSM_C28_RAM_END);
}
if(cpuInst == DCSM_CPUSEL_CM)
{
ASSERT((module > DCSM_C28_RAM_END) &&
(module < DCSM_CM_RAM_END));
moduleCM = (uint16_t)module - ((uint16_t)DCSM_C28_RAM_END + 1U);
}
//
// Check if module belongs to this zone
//
if(DCSM_getRAMZone(module, cpuInst) != DCSM_MEMORY_ZONE2)
{
status = DCSM_INCORRECT_ZONE;
}
else
{
//
// Get the EXE status of the RAM Module
//
if(cpuInst == DCSM_CPUSEL_CPU1)
{
status = (uint16_t)((HWREGH(DCSM_Z2_BASE +
DCSM_O_Z2_EXEONLYRAM1R) >>
(uint16_t)module) & 0x01U);
}
else if(cpuInst == DCSM_CPUSEL_CM)
{
status = ((HWREG(DCSM_Z2_BASE + DCSM_O_Z2_EXEONLYRAM1R) >>
(DCSM_Z2_EXEONLYRAM1R_CM + moduleCM)) & 0x01U);
}
else
{
status = ((HWREG(DCSM_Z2_BASE + DCSM_O_Z2_EXEONLYRAM1R) >>
(DCSM_Z2_EXEONLYRAM1R_CPU2 - (uint16_t)module)) &
0x01U);
}
}
return((DCSM_EXEOnlyStatus)status);
}
//*****************************************************************************
//
// DCSM_claimZoneSemaphore
//
//*****************************************************************************
bool
DCSM_claimZoneSemaphore(DCSM_SemaphoreZone zone)
{
//
// FLSEM register address.
//
uint32_t regAddress = DCSMCOMMON_BASE + DCSM_O_FLSEM;
EALLOW;
//
// Write 0xA5 to the key and write the zone that is attempting to claim the
// Flash Pump Semaphore to the semaphore bits.
//
HWREGH(regAddress) = ((uint16_t)FLSEM_KEY << DCSM_FLSEM_KEY_S) |
(uint16_t)zone;
EDIS;
//
// If the calling function was unable to claim the zone semaphore, then
// return false
//
return(((HWREGH(regAddress) & DCSM_FLSEM_SEM_M) == (uint16_t)zone) ?
true : false);
}
//*****************************************************************************
//
// DCSM_releaseZoneSemaphore
//
//*****************************************************************************
bool
DCSM_releaseZoneSemaphore(void)
{
//
// FLSEM register address.
//
uint32_t regAddress = DCSMCOMMON_BASE + DCSM_O_FLSEM;
EALLOW;
//
// Write 0xA5 to the key and write the zone that is attempting to claim the
// Flash Pump Semaphore to the semaphore bits.
//
HWREGH(regAddress) = ((uint16_t)FLSEM_KEY << DCSM_FLSEM_KEY_S);
EDIS;
//
// If the calling function was unable to release the zone semaphore, then
// return false
//
return(((HWREGH(regAddress) & DCSM_FLSEM_SEM_M) == 0x0U) ? true : false);
}
//*****************************************************************************
//
// DCSM_readZone1CSMPwd
//
//*****************************************************************************
void
DCSM_readZone1CSMPwd(void)
{
uint32_t linkPointer;
uint32_t zsbBase = (DCSM_Z1OTP_BASE + 0x20U); // base address of the ZSB
linkPointer = HWREG(DCSM_Z1_BASE + DCSM_O_Z1_LINKPOINTER);
//
// Bits 31 - 14 as most-significant 0 are invalid LinkPointer options
//
linkPointer = linkPointer << 18;
int32_t bitPos = 13; // Bits [13:0] point to a ZSB (14-bit link pointer)
int32_t zeroFound = 0;
//
// Zone-Select Block (ZSB) selection using Link-Pointers
// and 0's bit position within the Link pointer
//
while((zeroFound == 0) && (bitPos > -1))
{
//
// The most significant bit position in the resolved link pointer
// which is 0, defines the valid base address for the ZSB.
//
if((linkPointer & 0x80000000U) == 0U)
{
zeroFound = 1;
//
// Base address of the ZSB is calculated using
// 0x20 as the slope/step with which zsbBase expands with
// change in the bitPos and 2*0x20 is the offset
//
zsbBase = (DCSM_Z1OTP_BASE + (((uint32_t)bitPos + 2U) * 0x20U));
}
else
{
//
// Move through the linkPointer to find the most significant
// bit position of 0
//
bitPos--;
linkPointer = linkPointer << 1;
}
}
//
// Perform dummy reads on the 128-bit password
// Using linkPointer because it is no longer needed
//
linkPointer = HWREG(zsbBase + DCSM_O_Z1_CSMPSWD0);
linkPointer = HWREG(zsbBase + DCSM_O_Z1_CSMPSWD1);
linkPointer = HWREG(zsbBase + DCSM_O_Z1_CSMPSWD2);
linkPointer = HWREG(zsbBase + DCSM_O_Z1_CSMPSWD3);
}
//*****************************************************************************
//
// DCSM_readZone2CSMPwd
//
//*****************************************************************************
void
DCSM_readZone2CSMPwd(void)
{
uint32_t linkPointer;
uint32_t zsbBase = (DCSM_Z2OTP_BASE + 0x20U); // base address of the ZSB
linkPointer = HWREG(DCSM_Z2_BASE + DCSM_O_Z2_LINKPOINTER);
//
// Bits 31 - 14 as most-significant 0 are invalid LinkPointer options
//
linkPointer = linkPointer << 18;
int32_t bitPos = 13; // Bits [13:0] point to a ZSB (14-bit link pointer)
int32_t zeroFound = 0;
//
// Zone-Select Block (ZSB) selection using Link-Pointers
// and 0's bit position within the Link pointer
//
while((zeroFound == 0) && (bitPos > -1))
{
//
// The most significant bit position in the resolved link pointer
// which is 0, defines the valid base address for the ZSB.
//
if((linkPointer & 0x80000000U) == 0U)
{
zeroFound = 1;
//
// Base address of the ZSB is calculated using
// 0x20 as the slope/step with which zsbBase expands with
// change in the bitPos and 2*0x20 is the offset
//
zsbBase = (DCSM_Z2OTP_BASE + (((uint32_t)bitPos + 2U) * 0x20U));
}
else
{
//
// Move through the linkPointer to find the most significant
// bit position of 0
//
bitPos--;
linkPointer = linkPointer << 1;
}
}
//
// Perform dummy reads on the 128-bit password
// Using linkPointer because it is no longer needed
//
linkPointer = HWREG(zsbBase + DCSM_O_Z2_CSMPSWD0);
linkPointer = HWREG(zsbBase + DCSM_O_Z2_CSMPSWD1);
linkPointer = HWREG(zsbBase + DCSM_O_Z2_CSMPSWD2);
linkPointer = HWREG(zsbBase + DCSM_O_Z2_CSMPSWD3);
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,91 @@
//###########################################################################
//
// FILE: debug.h
//
// TITLE: Assert definition macro for debug.
//
//###########################################################################
//
// 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 DEBUG_H
#define DEBUG_H
//*****************************************************************************
//
// Prototype for the function that is called when an invalid argument is passed
// to an API. This is only used when doing a DEBUG build. It is the
// application's responsibility to define the __error__ function.
//
//*****************************************************************************
extern void __error__(const char *filename, uint32_t line);
//*****************************************************************************
//
// The ASSERT macro, which does the actual assertion checking. Typically, this
// will be for procedure arguments.
//
//*****************************************************************************
#ifdef DEBUG
#ifdef __TMS320C28XX__
//
// When called from C28x application
//
#define ASSERT(expr) do \
{ \
if(!(expr)) \
{ \
__error__(__FILE__, __LINE__); \
} \
} \
while((_Bool)0)
#else
//
// When called from CLA application. Update as needed.
//
#define ASSERT(expr) do \
{ \
if(!(expr)) \
{ \
__mdebugstop(); \
} \
} \
while((_Bool)0)
#endif
#else
#define ASSERT(expr)
#endif
#endif // DEBUG_H
+370
View File
@@ -0,0 +1,370 @@
//###########################################################################
//
// FILE: dma.c
//
// TITLE: C28x DMA driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "dma.h"
//*****************************************************************************
//
// DMA_configAddresses
//
//*****************************************************************************
void DMA_configAddresses(uint32_t base, const void *destAddr,
const void *srcAddr)
{
//
// Check the arguments.
//
ASSERT(DMA_isBaseValid(base));
EALLOW;
//
// Set up SOURCE address.
//
HWREG(base + DMA_O_SRC_BEG_ADDR_SHADOW) = (uint32_t)srcAddr;
HWREG(base + DMA_O_SRC_ADDR_SHADOW) = (uint32_t)srcAddr;
//
// Set up DESTINATION address.
//
HWREG(base + DMA_O_DST_BEG_ADDR_SHADOW) = (uint32_t)destAddr;
HWREG(base + DMA_O_DST_ADDR_SHADOW) = (uint32_t)destAddr;
EDIS;
}
//*****************************************************************************
//
// DMA_configBurst
//
//*****************************************************************************
void DMA_configBurst(uint32_t base, uint16_t size, int16_t srcStep,
int16_t destStep)
{
//
// Check the arguments.
//
ASSERT(DMA_isBaseValid(base));
ASSERT((size >= 1U) && (size <= 32U));
ASSERT(((srcStep >= -4096) && (srcStep <= 4095)) &&
((destStep >= -4096) && (destStep <= 4095)));
EALLOW;
//
// Set up BURST registers.
//
HWREGH(base + DMA_O_BURST_SIZE) = size - 1U;
HWREGH(base + DMA_O_SRC_BURST_STEP) = srcStep;
HWREGH(base + DMA_O_DST_BURST_STEP) = destStep;
EDIS;
}
//*****************************************************************************
//
// DMA_configTransfer
//
//*****************************************************************************
void DMA_configTransfer(uint32_t base, uint32_t transferSize, int16_t srcStep,
int16_t destStep)
{
//
// Check the arguments.
//
ASSERT(DMA_isBaseValid(base));
ASSERT(transferSize <= 0x10000U);
ASSERT(((srcStep >= -4096) && (srcStep <= 4095)) &&
((destStep >= -4096) && (destStep <= 4095)));
EALLOW;
//
// Set up TRANSFER registers.
//
HWREGH(base + DMA_O_TRANSFER_SIZE) = (uint16_t)(transferSize - 1U);
HWREGH(base + DMA_O_SRC_TRANSFER_STEP) = srcStep;
HWREGH(base + DMA_O_DST_TRANSFER_STEP) = destStep;
EDIS;
}
//*****************************************************************************
//
// DMA_configWrap
//
//*****************************************************************************
void DMA_configWrap(uint32_t base, uint32_t srcWrapSize, int16_t srcStep,
uint32_t destWrapSize, int16_t destStep)
{
//
// Check the arguments.
//
ASSERT(DMA_isBaseValid(base));
ASSERT((srcWrapSize <= 0x10000U) || (destWrapSize <= 0x10000U));
ASSERT(((srcStep >= -4096) && (srcStep <= 4095)) &&
((destStep >= -4096) && (destStep <= 4095)));
EALLOW;
//
// Set up WRAP registers.
//
HWREGH(base + DMA_O_SRC_WRAP_SIZE) = (uint16_t)(srcWrapSize - 1U);
HWREGH(base + DMA_O_SRC_WRAP_STEP) = srcStep;
HWREGH(base + DMA_O_DST_WRAP_SIZE) = (uint16_t)(destWrapSize - 1U);
HWREGH(base + DMA_O_DST_WRAP_STEP) = destStep;
EDIS;
}
//*****************************************************************************
//
// DMA_configMode
//
//*****************************************************************************
void DMA_configMode(uint32_t base, DMA_Trigger trigger, uint32_t config)
{
//
// Check the arguments.
//
ASSERT(DMA_isBaseValid(base));
EALLOW;
//
// Set up trigger selection in the CMA/CLA trigger source selection
// registers. These are considered part of system control.
//
switch(base)
{
case DMA_CH1_BASE:
//
// Channel 1
//
HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL1) =
(HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL1) &
~((uint32_t)SYSCTL_DMACHSRCSEL1_CH1_M)) |
((uint32_t)trigger << SYSCTL_DMACHSRCSEL1_CH1_S);
//
// Set peripheral interrupt select bits to the channel number.
//
HWREGH(DMA_CH1_BASE + DMA_O_MODE) =
(HWREGH(DMA_CH1_BASE + DMA_O_MODE) & ~DMA_MODE_PERINTSEL_M) | 1U;
break;
case DMA_CH2_BASE:
//
// Channel 2
//
HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL1) =
(HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL1) &
~((uint32_t)SYSCTL_DMACHSRCSEL1_CH2_M)) |
((uint32_t)trigger << SYSCTL_DMACHSRCSEL1_CH2_S);
//
// Set peripheral interrupt select bits to the channel number.
//
HWREGH(DMA_CH2_BASE + DMA_O_MODE) =
(HWREGH(DMA_CH2_BASE + DMA_O_MODE) & ~DMA_MODE_PERINTSEL_M) | 2U;
break;
case DMA_CH3_BASE:
//
// Channel 3
//
HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL1) =
(HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL1) &
~((uint32_t)SYSCTL_DMACHSRCSEL1_CH3_M)) |
((uint32_t)trigger << SYSCTL_DMACHSRCSEL1_CH3_S);
//
// Set peripheral interrupt select bits to the channel number.
//
HWREGH(DMA_CH3_BASE + DMA_O_MODE) =
(HWREGH(DMA_CH3_BASE + DMA_O_MODE) & ~DMA_MODE_PERINTSEL_M) | 3U;
break;
case DMA_CH4_BASE:
//
// Channel 4
//
HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL1) =
(HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL1) &
~((uint32_t)SYSCTL_DMACHSRCSEL1_CH4_M)) |
((uint32_t)trigger << SYSCTL_DMACHSRCSEL1_CH4_S);
//
// Set peripheral interrupt select bits to the channel number.
//
HWREGH(DMA_CH4_BASE + DMA_O_MODE) =
(HWREGH(DMA_CH4_BASE + DMA_O_MODE) & ~DMA_MODE_PERINTSEL_M) | 4U;
break;
case DMA_CH5_BASE:
//
// Channel 5
//
HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL2) =
(HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL2) &
~((uint32_t)SYSCTL_DMACHSRCSEL2_CH5_M)) |
((uint32_t)trigger << SYSCTL_DMACHSRCSEL2_CH5_S);
//
// Set peripheral interrupt select bits to the channel number.
//
HWREGH(DMA_CH5_BASE + DMA_O_MODE) =
(HWREGH(DMA_CH5_BASE + DMA_O_MODE) & ~DMA_MODE_PERINTSEL_M) | 5U;
break;
case DMA_CH6_BASE:
//
// Channel 6
//
HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL2) =
(HWREG(DMACLASRCSEL_BASE + SYSCTL_O_DMACHSRCSEL2) &
~((uint32_t)SYSCTL_DMACHSRCSEL2_CH6_M)) |
((uint32_t)trigger << SYSCTL_DMACHSRCSEL2_CH6_S);
//
// Set peripheral interrupt select bits to the channel number.
//
HWREGH(DMA_CH6_BASE + DMA_O_MODE) =
(HWREGH(DMA_CH6_BASE + DMA_O_MODE) & ~DMA_MODE_PERINTSEL_M) | 6U;
break;
default:
//
// Invalid base.
//
break;
}
//
// Write the configuration to the mode register.
//
HWREGH(base + DMA_O_MODE) &= ~(DMA_MODE_DATASIZE | DMA_MODE_CONTINUOUS |
DMA_MODE_ONESHOT);
HWREGH(base + DMA_O_MODE) |= config;
EDIS;
}
//*****************************************************************************
//
// DMA_configChannel
//
//*****************************************************************************
void DMA_configChannel(uint32_t base, const DMA_ConfigParams *transfParams)
{
//
// Check the arguments.
//
ASSERT(DMA_isBaseValid(base));
ASSERT(((transfParams->configSize == DMA_CFG_SIZE_16BIT) ||
(transfParams->configSize == DMA_CFG_SIZE_32BIT)) &&
((transfParams->transferMode == DMA_CFG_ONESHOT_DISABLE) ||
(transfParams->transferMode == DMA_CFG_ONESHOT_ENABLE)) &&
((transfParams->reinitMode == DMA_CFG_CONTINUOUS_DISABLE) ||
(transfParams->reinitMode == DMA_CFG_CONTINUOUS_ENABLE)));
//
// Configure DMA Channel
//
DMA_configAddresses(base, (const void *)transfParams->destAddr,
(const void *)transfParams->srcAddr);
//
// Configure the size of each burst and the address step size
//
DMA_configBurst(base, transfParams->burstSize, transfParams->srcBurstStep,
transfParams->destBurstStep);
//
// Configure the transfer size and the address step that is
// made after each burst.
//
DMA_configTransfer(base, transfParams->transferSize,
transfParams->srcTransferStep,
transfParams->destTransferStep);
//
// Configure the DMA channel's wrap settings
//
DMA_configWrap(base, transfParams->srcWrapSize, transfParams->srcWrapStep,
transfParams->destWrapSize, transfParams->destWrapStep);
//
// Configure the DMA channel's trigger and mode
//
DMA_configMode(base, transfParams->transferTrigger,
transfParams->transferMode | transfParams->reinitMode |
transfParams->configSize);
//
// Enable the selected peripheral trigger to start a DMA transfer
//
DMA_enableTrigger(base);
if(transfParams->enableInterrupt)
{
//
// Set the channel interrupt mode
//
DMA_setInterruptMode(base, transfParams->interruptMode);
//
// Enable the indicated DMA channel interrupt source
//
DMA_enableInterrupt(base);
}
else
{
//
// Disable the indicated DMA channel interrupt source
//
DMA_disableInterrupt(base);
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,142 @@
#ifndef DRIVER_INCLUSIVE_TERMINOLOGY_MAPPING_H_
#define DRIVER_INCLUSIVE_TERMINOLOGY_MAPPING_H_
//*****************************************************************************
// CLB
//*****************************************************************************
#define CLB_LOCAL_IN_MUX_SPISIMO_SLAVE CLB_LOCAL_IN_MUX_SPIPICO_PERIPHERAL
#define CLB_LOCAL_IN_MUX_SPISIMO_MASTER CLB_LOCAL_IN_MUX_SPIPICO_CONTROLLER
#define CLB_GLOBAL_IN_MUX_SPI1_SPISOMI_MASTER CLB_GLOBAL_IN_MUX_SPI1_SPIPOCI_CONTROLLER
#define CLB_GLOBAL_IN_MUX_SPI1_SPISTE CLB_GLOBAL_IN_MUX_SPI1_SPIPTE
#define CLB_GLOBAL_IN_MUX_SPI2_SPISOMI_MASTER CLB_GLOBAL_IN_MUX_SPI2_SPIPOCI_CONTROLLER
#define CLB_GLOBAL_IN_MUX_SPI2_SPISTE CLB_GLOBAL_IN_MUX_SPI2_SPIPTE
#define CLB_GLOBAL_IN_MUX_SPI3_SPISOMI_MASTER CLB_GLOBAL_IN_MUX_SPI3_SPIPOCI_CONTROLLER
#define CLB_GLOBAL_IN_MUX_SPI3_SPISTE CLB_GLOBAL_IN_MUX_SPI3_SPIPTE
#define CLB_GLOBAL_IN_MUX_SPI4_SPISOMI_MASTER CLB_GLOBAL_IN_MUX_SPI4_SPIPOCI_CONTROLLER
#define CLB_GLOBAL_IN_MUX_SPI4_SPISTE CLB_GLOBAL_IN_MUX_SPI4_SPIPTE
//*****************************************************************************
// FSI
//*****************************************************************************
#define FSI_TX_MASTER_CORE_RESET FSI_TX_MAIN_CORE_RESET
#define FSI_RX_MASTER_CORE_RESET FSI_RX_MAIN_CORE_RESET
//*****************************************************************************
// SPI
//*****************************************************************************
#define SPI_MODE_SLAVE SPI_MODE_PERIPHERAL
#define SPI_MODE_MASTER SPI_MODE_CONTROLLER
#define SPI_MODE_SLAVE_OD SPI_MODE_PERIPHERAL_OD
#define SPI_MODE_MASTER_OD SPI_MODE_CONTROLLER_OD
#define SPI_STE_ACTIVE_LOW SPI_PTE_ACTIVE_LOW
#define SPI_STE_ACTIVE_HIGH SPI_PTE_ACTIVE_HIGH
#define SPI_setSTESignalPolarity SPI_setPTESignalPolarity
//*****************************************************************************
// Interrupt
//*****************************************************************************
#define Interrupt_enableMaster Interrupt_enableGlobal
#define Interrupt_disableMaster Interrupt_disableGlobal
//*****************************************************************************
// SysCtrl
//*****************************************************************************
#define SysCtl_AccessMaster SysCtl_AccessController
//*****************************************************************************
// GPIO
//*****************************************************************************
#define GPIO_setMasterCore GPIO_setControllerCore
//*****************************************************************************
// Memcfg
//*****************************************************************************
#define MemCfg_LSRAMMMasterSel MemCfg_LSRAMMControllerSel
#define MEMCFG_LSRAMMASTER_CPU_ONLY MEMCFG_LSRAMCONTROLLER_CPU_ONLY
#define MEMCFG_LSRAMMASTER_CPU_CLA1 MEMCFG_LSRAMCONTROLLER_CPU_CLA1
#define MemCfg_setLSRAMMasterSel MemCfg_setLSRAMControllerSel
#define MemCfg_GSRAMMasterSel MemCfg_GSRAMControllerSel
#define MEMCFG_GSRAMMASTER_CPU1 MEMCFG_GSRAMCONTROLLER_CPU1
#define MEMCFG_GSRAMMASTER_CPU2 MEMCFG_GSRAMCONTROLLER_CPU2
#define MemCfg_setGSRAMMasterSel MemCfg_setGSRAMControllerSel
//*****************************************************************************
// EMIF
//*****************************************************************************
#define EMIF_MasterSelect EMIF_ControllerSelect
#define EMIF_selectMaster EMIF_selectController
#define EMIF_MASTER_CPU1_NG EMIF_CONTROLLER_CPU1_NG
#define EMIF_MASTER_CPU1_G EMIF_CONTROLLER_CPU1_G
#define EMIF_MASTER_CPU2_G EMIF_CONTROLLER_CPU2_G
#define EMIF_MASTER_CPU1_NG2 EMIF_CONTROLLER_CPU1_NG2
//*****************************************************************************
// I2C
//*****************************************************************************
#define I2C_MASTER_SEND_MODE I2C_CONTROLLER_SEND_MODE
#define I2C_MASTER_RECEIVE_MODE I2C_CONTROLLER_RECEIVE_MODE
#define I2C_SLAVE_SEND_MODE I2C_TARGET_SEND_MODE
#define I2C_SLAVE_RECEIVE_MODE I2C_TARGET_RECEIVE_MODE
#define I2C_INT_ADDR_SLAVE I2C_INT_ADDR_TARGET
#define I2C_STS_ADDR_SLAVE I2C_STS_ADDR_TARGET
#define I2C_STS_SLAVE_DIR I2C_STS_TARGET_DIR
#define I2C_INTSRC_ADDR_SLAVE I2C_INTSRC_ADDR_TARGET
#define I2C_initMaster I2C_initController
#define I2C_setSlaveAddress I2C_setTargetAddress
#define I2C_setOwnSlaveAddress I2C_setOwnAddress
//*****************************************************************************
// PMBUS
//*****************************************************************************
#define PMBUS_MASTER_ENABLE_PRC_CALL PMBUS_CONTROLLER_ENABLE_PRC_CALL
#define PMBUS_MASTER_ENABLE_GRP_CMD PMBUS_CONTROLLER_ENABLE_GRP_CMD
#define PMBUS_MASTER_ENABLE_PEC PMBUS_CONTROLLER_ENABLE_PEC
#define PMBUS_MASTER_ENABLE_EXT_CMD PMBUS_CONTROLLER_ENABLE_EXT_CMD
#define PMBUS_MASTER_ENABLE_CMD PMBUS_CONTROLLER_ENABLE_CMD
#define PMBUS_MASTER_ENABLE_READ PMBUS_CONTROLLER_ENABLE_READ
#define PMBUS_INT_SLAVE_ADDR_READY PMBUS_INT_TARGET_ADDR_READY
#define PMBUS_SLAVE_ENABLE_MANUAL_ACK PMBUS_TARGET_ENABLE_MANUAL_ACK
#define PMBUS_SLAVE_ENABLE_PEC_PROCESSING PMBUS_TARGET_ENABLE_PEC_PROCESSING
#define PMBUS_SLAVE_TRANSMIT_PEC PMBUS_TARGET_TRANSMIT_PEC
#define PMBUS_SLAVE_ENABLE_MANUAL_CMD_ACK PMBUS_TARGET_ENABLE_MANUAL_CMD_ACK
#define PMBUS_SLAVE_DISABLE_ADDRESS_MASK PMBUS_TARGET_DISABLE_ADDRESS_MASK
#define PMBUS_SLAVE_AUTO_ACK_1_BYTES PMBUS_TARGET_AUTO_ACK_1_BYTES
#define PMBUS_SLAVE_AUTO_ACK_2_BYTES PMBUS_TARGET_AUTO_ACK_2_BYTES
#define PMBUS_SLAVE_AUTO_ACK_3_BYTES PMBUS_TARGET_AUTO_ACK_3_BYTES
#define PMBUS_SLAVE_AUTO_ACK_4_BYTES PMBUS_TARGET_AUTO_ACK_4_BYTES
#define PMBUS_ENABLE_SLAVE_ALERT PMBUS_ENABLE_TARGET_ALERT
#define PMBUS_ENABLE_SLAVE_MODE PMBUS_ENABLE_TARGET_MODE
#define PMBUS_ENABLE_MASTER_MODE PMBUS_ENABLE_CONTROLLER_MODE
#define PMBUS_INTSRC_SLAVE_ADDR_READY PMBUS_INTSRC_TARGET_ADDR_READY
#define PMBus_getMasterData PMBus_getControllerData
#define PMBus_getSlaveData PMBus_getTargetData
#define PMBus_configMaster PMBus_configControlleer
#define PMBus_putMasterData PMBus_putControllerData
#define PMBus_putSlaveData PMBus_putTargetData
#define PMBus_initSlaveMode PMBus_initTargetMode
#define PMBus_initMasterMode PMBus_initControllerMode
//*****************************************************************************
// SDFM
//*****************************************************************************
#define SDFM_enableMasterInterrupt SDFM_enableMainInterrupt
#define SDFM_disableMasterInterrupt SDFM_disableMainInterrupt
#define SDFM_enableMasterFilter SDFM_enableMainFilter
#define SDFM_disableMasterFilter SDFM_disableMainFilter
#define SDFM_MASTER_INTERRUPT_FLAG SDFM_MAIN_INTERRUPT_FLAG
#endif /* DRIVER_INCLUSIVE_TERMINOLOGY_MAPPING_H_ */
@@ -0,0 +1,63 @@
//###########################################################################
//
// FILE: ecap.c
//
// TITLE: C28x ECAP driver
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "ecap.h"
//*****************************************************************************
//
// ECAP_setEmulationMode
//
//*****************************************************************************
void ECAP_setEmulationMode(uint32_t base, ECAP_EmulationMode mode)
{
ASSERT(ECAP_isBaseValid(base));
EALLOW;
//
// Write to FREE/SOFT bit
//
HWREGH(base + ECAP_O_ECCTL1) =
((HWREGH(base + ECAP_O_ECCTL1) & (~ECAP_ECCTL1_FREE_SOFT_M)) |
((uint16_t)mode << ECAP_ECCTL1_FREE_SOFT_S));
EDIS;
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,46 @@
//###########################################################################
//
// FILE: emif.c
//
// TITLE: C28x EMIF driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include <stdbool.h>
#include <stdint.h>
#include "emif.h"
File diff suppressed because it is too large. Load diff
+363
View File
@@ -0,0 +1,363 @@
//###########################################################################
//
// FILE: epwm.c
//
// TITLE: C28x EPWM driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "epwm.h"
//*****************************************************************************
//
// EPWM_setEmulationMode
//
//*****************************************************************************
void EPWM_setEmulationMode(uint32_t base, EPWM_EmulationMode emulationMode)
{
//
// Check the arguments.
//
ASSERT(EPWM_isBaseValid(base));
//
// Write to FREE_SOFT bits
//
HWREGH(base + EPWM_O_TBCTL) =
((HWREGH(base + EPWM_O_TBCTL) & (~EPWM_TBCTL_FREE_SOFT_M)) |
((uint16_t)emulationMode << EPWM_TBCTL_FREE_SOFT_S));
}
//*****************************************************************************
//
// EPWM_configureSignal
//
//*****************************************************************************
void EPWM_configureSignal(uint32_t base, const EPWM_SignalParams *signalParams)
{
float32_t tbClkInHz = 0.0F;
uint16_t tbPrdVal = 0U, cmpAVal = 0U, cmpBVal = 0U;
//
// Check the arguments.
//
ASSERT(EPWM_isBaseValid(base));
//
// Valid values in the function for TBCTR Mode are UP, DOWN
// and UP-DOWN count.
//
ASSERT((uint16_t)signalParams->tbCtrMode <= 2U);
//
// Configure EPWM clock Divider
//
SysCtl_setEPWMClockDivider(signalParams->epwmClkDiv);
//
// Configure Time Base counter Clock
//
EPWM_setClockPrescaler(base, signalParams->tbClkDiv,
signalParams->tbHSClkDiv);
//
// Configure Time Base Counter Mode
//
EPWM_setTimeBaseCounterMode(base, signalParams->tbCtrMode);
//
// Calculate TBCLK, TBPRD and CMPx values to be configured for
// achieving desired signal
//
tbClkInHz = ((float32_t)signalParams->sysClkInHz /
(float32_t)(1U << ((uint16_t)signalParams->epwmClkDiv +
(uint16_t)signalParams->tbClkDiv)));
if(signalParams->tbHSClkDiv <= EPWM_HSCLOCK_DIVIDER_4)
{
tbClkInHz /= (float32_t)(1U << (uint16_t)signalParams->tbHSClkDiv);
}
else
{
tbClkInHz /= (float32_t)(2U * (uint16_t)signalParams->tbHSClkDiv);
}
if(signalParams->tbCtrMode == EPWM_COUNTER_MODE_UP)
{
tbPrdVal = (uint16_t)((tbClkInHz / signalParams->freqInHz) - 1.0f);
cmpAVal = (uint16_t)(signalParams->dutyValA *
(float32_t)(tbPrdVal + 1U));
cmpBVal = (uint16_t)(signalParams->dutyValB *
(float32_t)(tbPrdVal + 1U));
}
else if(signalParams->tbCtrMode == EPWM_COUNTER_MODE_DOWN)
{
tbPrdVal = (uint16_t)((tbClkInHz / signalParams->freqInHz) - 1.0f);
cmpAVal = (uint16_t)((float32_t)(tbPrdVal + 1U) -
(signalParams->dutyValA * (float32_t)(tbPrdVal + 1U)));
cmpBVal = (uint16_t)((float32_t)(tbPrdVal + 1U) -
(signalParams->dutyValB * (float32_t)(tbPrdVal + 1U)));
}
else
{
tbPrdVal = (uint16_t)(tbClkInHz / (2.0f * signalParams->freqInHz));
cmpAVal = (uint16_t)(((float32_t)tbPrdVal -
((signalParams->dutyValA *
(float32_t)tbPrdVal))) + 0.5f);
cmpBVal = (uint16_t)(((float32_t)tbPrdVal -
((signalParams->dutyValB *
(float32_t)tbPrdVal))) + 0.5f);
}
//
// Configure TBPRD value
//
EPWM_setTimeBasePeriod(base, tbPrdVal);
//
// Default Configurations.
//
EPWM_disablePhaseShiftLoad(base);
EPWM_setPhaseShift(base, 0U);
EPWM_setTimeBaseCounter(base, 0U);
//
// Setup shadow register load on ZERO
//
EPWM_setCounterCompareShadowLoadMode(base,
EPWM_COUNTER_COMPARE_A,
EPWM_COMP_LOAD_ON_CNTR_ZERO);
EPWM_setCounterCompareShadowLoadMode(base,
EPWM_COUNTER_COMPARE_B,
EPWM_COMP_LOAD_ON_CNTR_ZERO);
//
// Set Compare values
//
EPWM_setCounterCompareValue(base, EPWM_COUNTER_COMPARE_A,
cmpAVal);
EPWM_setCounterCompareValue(base, EPWM_COUNTER_COMPARE_B,
cmpBVal);
//
// Set actions for ePWMxA & ePWMxB
//
if(signalParams->tbCtrMode == EPWM_COUNTER_MODE_UP)
{
//
// Set PWMxA on Zero
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
//
// Clear PWMxA on event A, up count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
if(signalParams->invertSignalB == true)
{
//
// Clear PWMxB on Zero
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
//
// Set PWMxB on event B, up count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
}
else
{
//
// Set PWMxB on Zero
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
//
// Clear PWMxB on event B, up count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
}
}
else if((signalParams->tbCtrMode == EPWM_COUNTER_MODE_DOWN))
{
//
// Set PWMxA on Zero
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
//
// Clear PWMxA on event A, down count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
if(signalParams->invertSignalB == true)
{
//
// Clear PWMxB on Zero
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
//
// Set PWMxB on event B, down count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);
}
else
{
//
// Set PWMxB on Zero
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
//
// Clear PWMxB on event B, down count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);
}
}
else
{
//
// Clear PWMxA on Zero
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
//
// Set PWMxA on event A, up count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
//
// Clear PWMxA on event A, down count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
if(signalParams->invertSignalB == true)
{
//
// Set PWMxB on Zero
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
//
// Clear PWMxB on event B, up count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
//
// Set PWMxB on event B, down count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);
}
else
{
//
// Clear PWMxB on Zero
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
//
// Set PWMxB on event B, up count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
//
// Clear PWMxB on event B, down count
//
EPWM_setActionQualifierAction(base,
EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);
}
}
}
File diff suppressed because it is too large. Load diff
+149
View File
@@ -0,0 +1,149 @@
//###########################################################################
//
// FILE: eqep.c
//
// TITLE: C28x eQEP driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "eqep.h"
//*****************************************************************************
//
// EQEP_setCompareConfig
//
//*****************************************************************************
void
EQEP_setCompareConfig(uint32_t base, uint16_t config, uint32_t compareValue,
uint16_t cycles)
{
uint16_t regValue;
//
// Check the arguments.
//
ASSERT(EQEP_isBaseValid(base));
ASSERT(cycles <= (EQEP_QPOSCTL_PCSPW_M + 1U));
//
// Set the compare match value
//
HWREG(base + EQEP_O_QPOSCMP) = compareValue;
//
// Set the shadow register settings and pulse width.
//
regValue = (config & (uint16_t)(EQEP_QPOSCTL_PCSHDW |
EQEP_QPOSCTL_PCLOAD)) | (cycles - 1U);
HWREGH(base + EQEP_O_QPOSCTL) = (HWREGH(base + EQEP_O_QPOSCTL) &
~(EQEP_QPOSCTL_PCSPW_M |
EQEP_QPOSCTL_PCLOAD |
EQEP_QPOSCTL_PCSHDW)) | regValue;
//
// Set position compare sync-output mode.
//
regValue = config & (uint16_t)(EQEP_QDECCTL_SOEN | EQEP_QDECCTL_SPSEL);
HWREGH(base + EQEP_O_QDECCTL) = (HWREGH(base + EQEP_O_QDECCTL) &
~(EQEP_QDECCTL_SOEN |
EQEP_QDECCTL_SPSEL)) | regValue;
}
//*****************************************************************************
//
// EQEP_setInputPolarity
//
//*****************************************************************************
void
EQEP_setInputPolarity(uint32_t base, bool invertQEPA, bool invertQEPB,
bool invertIndex, bool invertStrobe)
{
//
// Check the arguments.
//
ASSERT(EQEP_isBaseValid(base));
//
// Configure QEPA signal
//
if(invertQEPA)
{
HWREGH(base + EQEP_O_QDECCTL) |= EQEP_QDECCTL_QAP;
}
else
{
HWREGH(base + EQEP_O_QDECCTL) &= ~EQEP_QDECCTL_QAP;
}
//
// Configure QEPB signal
//
if(invertQEPB)
{
HWREGH(base + EQEP_O_QDECCTL) |= EQEP_QDECCTL_QBP;
}
else
{
HWREGH(base + EQEP_O_QDECCTL) &= ~EQEP_QDECCTL_QBP;
}
//
// Configure index signal
//
if(invertIndex)
{
HWREGH(base + EQEP_O_QDECCTL) |= EQEP_QDECCTL_QIP;
}
else
{
HWREGH(base + EQEP_O_QDECCTL) &= ~EQEP_QDECCTL_QIP;
}
//
// Configure strobe signal
//
if(invertStrobe)
{
HWREGH(base + EQEP_O_QDECCTL) |= EQEP_QDECCTL_QSP;
}
else
{
HWREGH(base + EQEP_O_QDECCTL) &= ~EQEP_QDECCTL_QSP;
}
}
File diff suppressed because it is too large. Load diff
+549
View File
@@ -0,0 +1,549 @@
//###########################################################################
//
// FILE: erad.c
//
// TITLE: C28x ERAD driver.
//
//###########################################################################
#include "erad.h"
//*****************************************************************************
//
// ERAD_configBusComp
//
//*****************************************************************************
void
ERAD_configBusComp(uint32_t base, ERAD_BusComp_Config config_params)
{
//
// Check if owner is APPLICATION or NO_OWNER
//
ASSERT((ERAD_getOwnership() == ERAD_OWNER_APPLICATION) ||
(ERAD_getOwnership() == ERAD_OWNER_NOOWNER));
//
// Check if the base is valid
//
ASSERT(ERAD_isValidBusCompBase(base));
//
// Check if the bus comparator is in ERAD_STATE_IDLE
//
ASSERT(ERAD_getBusCompStatus(base) == ERAD_STATE_IDLE);
//
// Write into necessary registers to configure the bus comparator
//
EALLOW;
HWREG(base + ERAD_O_HWBP_MASK) = config_params.mask;
HWREG(base + ERAD_O_HWBP_REF) = config_params.reference;
//
// Set the comparison mode and the CPU bus to be monitored
// Enable interrupt and CPU halt if specified in the parameters
//
HWREGH(base + ERAD_O_HWBP_CNTL) =
((uint16_t)config_params.comp_mode << ERAD_HWBP_CNTL_COMP_MODE_S) |
((uint16_t)config_params.bus_sel << ERAD_HWBP_CNTL_BUS_SEL_S) |
((uint16_t)config_params.enable_stop << ERAD_HWBP_CNTL_STOP_S) |
((uint16_t)config_params.enable_int << ERAD_HWBP_CNTL_RTOSINT_S);
EDIS;
}
//*****************************************************************************
//
// ERAD_configCounterInCountingMode
//
//*****************************************************************************
void
ERAD_configCounterInCountingMode(uint32_t base,
ERAD_Counter_Config config_params)
{
//
// Check if owner is APPLICATION or NO_OWNER
//
ASSERT((ERAD_getOwnership() == ERAD_OWNER_APPLICATION) ||
(ERAD_getOwnership() == ERAD_OWNER_NOOWNER));
//
// Check if the base is valid
//
ASSERT(ERAD_isValidCounterBase(base));
//
// Check if the counter is in ERAD_STATE_IDLE
//
ASSERT(ERAD_getCounterStatus(base) == ERAD_STATE_IDLE);
//
// Write into registers to configure the counter
//
EALLOW;
HWREG(base + ERAD_O_CTM_REF) = config_params.reference;
if(config_params.event == ERAD_EVENT_NO_EVENT)
{
//
// If ERAD_EVENT_NO_EVENT is selected, clear the counter input select
// enable bit. The counter will count CPU cycles.
//
HWREGH(base + ERAD_O_CTM_CNTL) &= ERAD_CTM_CNTL_CNT_INP_SEL_EN;
}
else
{
//
// For any other value, set the event to be counted and counter input
// select enable bit.
//
HWREGH(base + ERAD_O_CTM_INPUT_SEL) =
(((uint16_t)config_params.event << ERAD_CTM_INPUT_SEL_CNT_INP_SEL_S) &
ERAD_CTM_INPUT_SEL_CNT_INP_SEL_M);
HWREGH(base + ERAD_O_CTM_CNTL) |= ERAD_CTM_CNTL_CNT_INP_SEL_EN;
}
//
// Set the counter in Normal count mode
// Set the event mode as Rising edge or Active
// Enable interrupt, CPU halt and reset on match if specified in the
// parameters
//
HWREGH(base + ERAD_O_CTM_CNTL) =
(HWREGH(base + ERAD_O_CTM_CNTL) & (~(ERAD_CTM_CNTL_START_STOP_CUMULATIVE |
ERAD_CTM_CNTL_RTOSINT |
ERAD_CTM_CNTL_STOP |
ERAD_CTM_CNTL_RST_ON_MATCH |
ERAD_CTM_CNTL_EVENT_MODE |
ERAD_CTM_CNTL_START_STOP_MODE))) |
((uint16_t)config_params.enable_int << ERAD_CTM_CNTL_RTOSINT_S) |
((uint16_t)config_params.enable_stop << ERAD_CTM_CNTL_STOP_S) |
((uint16_t)config_params.event_mode << ERAD_CTM_CNTL_EVENT_MODE_S) |
((uint16_t)config_params.rst_on_match << ERAD_CTM_CNTL_RST_ON_MATCH_S);
EDIS;
}
//*****************************************************************************
//
// ERAD_configCounterInStartStopMode
//
//*****************************************************************************
void
ERAD_configCounterInStartStopMode(uint32_t base,
ERAD_Counter_Config config_params,
ERAD_Counter_Input_Event start_event,
ERAD_Counter_Input_Event stop_event)
{
//
// Check if owner is APPLICATION or NO_OWNER
//
ASSERT((ERAD_getOwnership() == ERAD_OWNER_APPLICATION) ||
(ERAD_getOwnership() == ERAD_OWNER_NOOWNER));
//
// Check if the base is valid
//
ASSERT(ERAD_isValidCounterBase(base));
//
// Check if the counter is in IDLE state
//
ASSERT(ERAD_getCounterStatus(base) == ERAD_STATE_IDLE);
//
// Write into registers to configure the counter
//
EALLOW;
HWREG(base + ERAD_O_CTM_REF) = config_params.reference;
if(config_params.event == ERAD_EVENT_NO_EVENT)
{
//
// If ERAD_EVENT_NO_EVENT is selected, clear the counter input select
// enable bit. The counter will count CPU cycles.
// Set start and stop events
//
HWREGH(base + ERAD_O_CTM_CNTL) &= ~ERAD_CTM_CNTL_CNT_INP_SEL_EN;
HWREGH(base + ERAD_O_CTM_INPUT_SEL) =
((uint16_t)start_event << ERAD_CTM_INPUT_SEL_STA_INP_SEL_S);
HWREGH(base + ERAD_O_CTM_INPUT_SEL_2) |=
((uint16_t)stop_event << ERAD_CTM_INPUT_SEL_2_STO_INP_SEL_S);
}
else
{
//
// For any other value, set the counter input select enable bit and
// configure the counter input, start event and stop event,
//
//
HWREGH(base + ERAD_O_CTM_CNTL) |= ERAD_CTM_CNTL_CNT_INP_SEL_EN;
HWREGH(base + ERAD_O_CTM_INPUT_SEL) =
((uint16_t)config_params.event << ERAD_CTM_INPUT_SEL_CNT_INP_SEL_S) |
((uint16_t)start_event << ERAD_CTM_INPUT_SEL_STA_INP_SEL_S);
HWREGH(base + ERAD_O_CTM_INPUT_SEL_2) |=
((uint16_t)stop_event << ERAD_CTM_INPUT_SEL_2_STO_INP_SEL_S);
}
//
// Set the counter in Normal count mode
// Set the event mode as Rising edge or Active
// Enable interrupt, CPU halt and reset on match if specified in the
// parameters
//
HWREGH(base + ERAD_O_CTM_CNTL) =
(HWREGH(base + ERAD_O_CTM_CNTL) & (~(ERAD_CTM_CNTL_START_STOP_CUMULATIVE |
ERAD_CTM_CNTL_RTOSINT |
ERAD_CTM_CNTL_STOP |
ERAD_CTM_CNTL_RST_ON_MATCH |
ERAD_CTM_CNTL_EVENT_MODE))) |
ERAD_CTM_CNTL_START_STOP_MODE |
((uint16_t)config_params.enable_int << ERAD_CTM_CNTL_RTOSINT_S) |
((uint16_t)config_params.enable_stop << ERAD_CTM_CNTL_STOP_S) |
((uint16_t)config_params.event_mode << ERAD_CTM_CNTL_EVENT_MODE_S) |
((uint16_t)config_params.rst_on_match << ERAD_CTM_CNTL_RST_ON_MATCH_S);
EDIS;
}
//*****************************************************************************
//
// ERAD_configCounterInCumulativeMode
//
//*****************************************************************************
void
ERAD_configCounterInCumulativeMode(uint32_t base,
ERAD_Counter_Config config_params,
ERAD_Counter_Input_Event start_event,
ERAD_Counter_Input_Event stop_event)
{
//
// Check if owner is APPLICATION or NO_OWNER
//
ASSERT((ERAD_getOwnership() == ERAD_OWNER_APPLICATION) ||
(ERAD_getOwnership() == ERAD_OWNER_NOOWNER));
//
// Check if the base is valid
//
ASSERT(ERAD_isValidCounterBase(base));
//
// Check if the counter is in IDLE state
//
ASSERT(ERAD_getCounterStatus(base) == ERAD_STATE_IDLE);
//
// Write into registers to configure the counter
//
EALLOW;
HWREG(base + ERAD_O_CTM_REF) = config_params.reference;
if(config_params.event == ERAD_EVENT_NO_EVENT)
{
//
// If ERAD_EVENT_NO_EVENT is selected, clear the counter input select
// enable bit. The counter will count CPU cycles.
// Set start and stop events
//
HWREGH(base + ERAD_O_CTM_CNTL) &= ~ERAD_CTM_CNTL_CNT_INP_SEL_EN;
HWREGH(base + ERAD_O_CTM_INPUT_SEL) =
((uint16_t)start_event << ERAD_CTM_INPUT_SEL_STA_INP_SEL_S);
HWREGH(base + ERAD_O_CTM_INPUT_SEL_2) |=
((uint16_t)stop_event << ERAD_CTM_INPUT_SEL_2_STO_INP_SEL_S);
}
else
{
//
// For any other value, set the counter input select enable bit and
// configure the counter input, start event and stop event,
//
//
HWREGH(base + ERAD_O_CTM_CNTL) |= ERAD_CTM_CNTL_CNT_INP_SEL_EN;
HWREGH(base + ERAD_O_CTM_INPUT_SEL) =
((uint16_t)config_params.event << ERAD_CTM_INPUT_SEL_CNT_INP_SEL_S) |
((uint16_t)start_event << ERAD_CTM_INPUT_SEL_STA_INP_SEL_S);
HWREGH(base + ERAD_O_CTM_INPUT_SEL_2) |=
((uint16_t)stop_event << ERAD_CTM_INPUT_SEL_2_STO_INP_SEL_S);
}
//
// Set the counter in Normal count mode
// Set the event mode as Rising edge or Active
// Enable interrupt, CPU halt and reset on match if specified in the
// parameters
//
HWREGH(base + ERAD_O_CTM_CNTL) =
(HWREGH(base + ERAD_O_CTM_CNTL) & (~(ERAD_CTM_CNTL_RTOSINT |
ERAD_CTM_CNTL_STOP |
ERAD_CTM_CNTL_RST_ON_MATCH |
ERAD_CTM_CNTL_EVENT_MODE))) |
ERAD_CTM_CNTL_START_STOP_MODE |
ERAD_CTM_CNTL_START_STOP_CUMULATIVE |
((uint16_t)config_params.enable_int << ERAD_CTM_CNTL_RTOSINT_S) |
((uint16_t)config_params.enable_stop << ERAD_CTM_CNTL_STOP_S) |
((uint16_t)config_params.event_mode << ERAD_CTM_CNTL_EVENT_MODE_S) |
((uint16_t)config_params.rst_on_match << ERAD_CTM_CNTL_RST_ON_MATCH_S);
EDIS;
}
//*****************************************************************************
//
// ERAD_configMask
//
//*****************************************************************************
void
ERAD_configMask(ERAD_Mask mask, uint32_t instances, bool enable_int)
{
uint16_t bitpos;
uint16_t mask_tmp = (uint16_t)mask;
EALLOW;
if(mask_tmp < 4U)
{
bitpos = mask_tmp << 3U;
HWREG(ERAD_GLOBAL_BASE + ERAD_O_GLBL_EVENT_AND_MASK) =
(HWREG(ERAD_GLOBAL_BASE + ERAD_O_GLBL_EVENT_AND_MASK) |
(0xFFUL << bitpos)) & (~(instances << bitpos));
bitpos = mask_tmp;
if(enable_int)
{
HWREGH(ERAD_GLOBAL_BASE + ERAD_O_GLBL_AND_EVENT_INT_MASK) &=
~(1U << bitpos);
}
else
{
HWREGH(ERAD_GLOBAL_BASE + ERAD_O_GLBL_AND_EVENT_INT_MASK) |=
(1U << bitpos);
}
}
else
{
bitpos = (mask_tmp - 4U) << 3U;
HWREG(ERAD_GLOBAL_BASE + ERAD_O_GLBL_EVENT_OR_MASK) =
(HWREG(ERAD_GLOBAL_BASE + ERAD_O_GLBL_EVENT_OR_MASK) |
(0xFFUL << bitpos)) & (~(instances << bitpos));
bitpos = mask_tmp - 4U;
if(enable_int)
{
HWREGH(ERAD_GLOBAL_BASE + ERAD_O_GLBL_OR_EVENT_INT_MASK) &=
~(1U << bitpos);
}
else
{
HWREGH(ERAD_GLOBAL_BASE + ERAD_O_GLBL_OR_EVENT_INT_MASK) |=
(1U << bitpos);
}
}
EDIS;
}
//*****************************************************************************
//
// ERAD_profile
//
//*****************************************************************************
void
ERAD_profile(ERAD_Profile_Params config_params)
{
ERAD_BusComp_Config buscomp1_params, buscomp2_params;
ERAD_Counter_Config counter_params;
//
// Clear any previous events
//
ERAD_clearBusCompEvent(config_params.busComp_base1);
ERAD_clearBusCompEvent(config_params.busComp_base2);
//
// Clear any previous events and overflow
//
ERAD_clearCounterEvent(config_params.counter_base);
ERAD_clearCounterOverflow(config_params.counter_base);
//
// Reset the counter
//
ERAD_resetCounter(ERAD_getCounterInstance(config_params.counter_base));
//
// Configure the first bus comparator
// No interrupt or CPU halt. Compare for equality. No mask.
// Reference is the address of the first instruction
//
buscomp1_params.bus_sel = config_params.bus_sel;
buscomp1_params.comp_mode = ERAD_BUSCOMP_COMPMODE_EQ;
buscomp1_params.enable_stop = 0;
buscomp1_params.enable_int = 0;
buscomp1_params.mask = 0x0;
buscomp1_params.reference = config_params.start_address;
ERAD_configBusComp(config_params.busComp_base1, buscomp1_params);
//
// Configure the second bus comparator
// No interrupt or CPU halt. Compare for equality. No mask.
// Reference is the address of the last instruction
//
buscomp2_params.bus_sel = config_params.bus_sel;
buscomp2_params.comp_mode = ERAD_BUSCOMP_COMPMODE_EQ;
buscomp2_params.enable_stop = 0;
buscomp2_params.enable_int = 0;
buscomp2_params.mask = 0x0;
buscomp2_params.reference = config_params.end_address;
ERAD_configBusComp(config_params.busComp_base2, buscomp2_params);
//
// Configure the counter
// No interrupt, no CPU halt, no reset on match, no reference.
// Counting the number of CPU cycles
// Start event is the first bus comparator and stop is the second
//
counter_params.enable_int = 0;
counter_params.enable_stop = 0;
counter_params.rst_on_match = 0;
counter_params.reference = 0x0;
counter_params.event_mode = ERAD_COUNTER_MODE_ACTIVE;
counter_params.event = ERAD_EVENT_NO_EVENT;
ERAD_Counter_Input_Event start = (ERAD_Counter_Input_Event)
(ERAD_BUSCOMP_BASE_TO_EVENT(config_params.busComp_base1));
ERAD_Counter_Input_Event stop = (ERAD_Counter_Input_Event)
(ERAD_BUSCOMP_BASE_TO_EVENT(config_params.busComp_base2));
ERAD_configCounterInStartStopMode(config_params.counter_base,
counter_params, start, stop);
//
// Enable the modules
//
ERAD_enableModules(ERAD_getBusCompInstance(config_params.busComp_base1) |
ERAD_getBusCompInstance(config_params.busComp_base2) |
ERAD_getCounterInstance(config_params.counter_base));
}
//*****************************************************************************
//
// ERAD_enableInterruptAtAddress
//
//*****************************************************************************
void
ERAD_enableInterruptOnAddressHit(ERAD_AddressHit_Params config_params,
uint32_t busComp_base)
{
ERAD_BusComp_Config buscomp_params;
//
// Clear any previous events
//
ERAD_clearBusCompEvent(busComp_base);
//
// Set the address and mask. Disable CPU halt
// and enable Interrupt
//
buscomp_params.reference = config_params.address;
buscomp_params.mask = config_params.mask;
buscomp_params.enable_stop = 0;
buscomp_params.enable_int = 1;
//
// Comparison mode is set to equality and the bus to be
// monitored is the Virtual Program Counter
//
buscomp_params.comp_mode = ERAD_BUSCOMP_COMPMODE_EQ;
buscomp_params.bus_sel = config_params.bus_sel;
//
// Configure the bus comparator
//
ERAD_configBusComp(busComp_base, buscomp_params);
//
// Enable the bus comparator
//
ERAD_enableModules(ERAD_getBusCompInstance(busComp_base));
}
//*****************************************************************************
//
// ERAD_countEventHits
//
//*****************************************************************************
void
ERAD_countAddressHits(ERAD_AddressHit_Params config_params,
uint32_t busComp_base, uint32_t counter_base)
{
ERAD_BusComp_Config buscomp_params;
ERAD_Counter_Config counter_params;
//
// Clear any previous events and overflows
//
ERAD_clearBusCompEvent(busComp_base);
ERAD_clearCounterEvent(counter_base);
ERAD_clearCounterOverflow(counter_base);
//
// Reset the counter
//
ERAD_resetCounter(ERAD_getCounterInstance(counter_base));
//
// Configure the bus comparator
// No interrupt or CPU halt. Compare for equality. No mask.
// Reference is the address of the instruction to be counted
// Bus to be monitored is specified in the bus argument
//
buscomp_params.reference = config_params.address;
buscomp_params.mask = config_params.mask;
buscomp_params.comp_mode = ERAD_BUSCOMP_COMPMODE_EQ;
buscomp_params.enable_stop = 0;
buscomp_params.bus_sel = config_params.bus_sel;
buscomp_params.enable_int = 0;
ERAD_configBusComp(busComp_base, buscomp_params);
//
// Configure the counter
// No interrupt, no CPU halt, no reset on match, no reference.
// Counting the number of rising edges of the bus comparator event
//
counter_params.enable_int = 0;
counter_params.enable_stop = 0;
counter_params.event_mode = ERAD_COUNTER_MODE_RISING_EDGE;
counter_params.rst_on_match = 0;
counter_params.reference = 0x0;
counter_params.event = (ERAD_Counter_Input_Event)
(ERAD_BUSCOMP_BASE_TO_EVENT(busComp_base));
ERAD_configCounterInCountingMode(counter_base, counter_params);
//
// Enable the modules
//
ERAD_enableModules(ERAD_getBusCompInstance(busComp_base) |
ERAD_getCounterInstance(counter_base));
}
//
// End of file
//
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,165 @@
//###########################################################################
//
// FILE: flash.c
//
// TITLE: C28x Flash driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "flash.h"
#ifndef __cplusplus
#pragma CODE_SECTION(Flash_initModule, ".TI.ramfunc");
#pragma CODE_SECTION(Flash_powerDown, ".TI.ramfunc");
#pragma CODE_SECTION(Flash_wakeFromLPM, ".TI.ramfunc");
#endif
//*****************************************************************************
//
// Flash_initModule
//
//*****************************************************************************
#ifdef __cplusplus
#pragma CODE_SECTION(".TI.ramfunc");
#endif
void
Flash_initModule(uint32_t ctrlBase, uint32_t eccBase, uint16_t waitstates)
{
//
// Check the arguments.
//
ASSERT(Flash_isCtrlBaseValid(ctrlBase));
ASSERT(Flash_isECCBaseValid(eccBase));
ASSERT(waitstates <= 0xFU);
//
// Set the bank fallback power mode to active.
//
Flash_setBankPowerMode(ctrlBase, FLASH_BANK, FLASH_BANK_PWR_ACTIVE);
//
// Power up flash bank and pump and this also sets the fall back mode of
// flash and pump as active
//
Flash_setPumpPowerMode(ctrlBase, FLASH_PUMP_PWR_ACTIVE);
//
// Disable cache and prefetch mechanism before changing wait states
//
Flash_disableCache(ctrlBase);
Flash_disablePrefetch(ctrlBase);
//
// Set waitstates according to frequency.
//
Flash_setWaitstates(ctrlBase, waitstates);
//
// Enable cache and prefetch mechanism to improve performance of code
// executed from flash.
//
Flash_enableCache(ctrlBase);
Flash_enablePrefetch(ctrlBase);
//
// At reset, ECC is enabled. If it is disabled by application software and
// if application again wants to enable ECC.
//
Flash_enableECC(eccBase);
//
// Force a pipeline flush to ensure that the write to the last register
// configured occurs before returning.
//
FLASH_DELAY_CONFIG;
}
//*****************************************************************************
//
// Flash_powerDown
//
//*****************************************************************************
#ifdef __cplusplus
#pragma CODE_SECTION(".TI.ramfunc");
#endif
void
Flash_powerDown(uint32_t ctrlBase)
{
//
// Check the arguments.
//
ASSERT(Flash_isCtrlBaseValid(ctrlBase));
//
// Power down the flash bank.
//
Flash_setBankPowerMode(ctrlBase, FLASH_BANK, FLASH_BANK_PWR_SLEEP);
//
// Power down the flash pump.
//
Flash_setPumpPowerMode(ctrlBase, FLASH_PUMP_PWR_SLEEP);
}
//*****************************************************************************
//
// Flash_wakeFromLPM
//
//*****************************************************************************
#ifdef __cplusplus
#pragma CODE_SECTION(".TI.ramfunc");
#endif
void
Flash_wakeFromLPM(uint32_t ctrlBase)
{
//
// Check the arguments.
//
ASSERT(Flash_isCtrlBaseValid(ctrlBase));
//
// Set the bank fallback power modes to active.
//
Flash_setBankPowerMode(ctrlBase, FLASH_BANK, FLASH_BANK_PWR_ACTIVE);
//
// Set the flash pump power mode to active.
//
Flash_setPumpPowerMode(ctrlBase, FLASH_PUMP_PWR_ACTIVE);
}
File diff suppressed because it is too large. Load diff
+452
View File
@@ -0,0 +1,452 @@
//###########################################################################
//
// FILE: fsi.c
//
// TITLE: C28x FSI driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "fsi.h"
//*****************************************************************************
//
//! \internal
//!
//! Provides delay based on requested count. Needed while performing reset and
//! flush sequence, sufficient delay ensures reliability in operation.
//
//*****************************************************************************
static void FSI_delayWait(uint32_t n)
{
//
// Taking local temp counter to avoid MISRAC:2012 rule 17.8 which states not
// to modify parameter passed to a function call.
//
uint32_t temp;
for(temp = n; temp > 0U; temp--)
{
}
}
//*****************************************************************************
//
// FSI_resetTxModule
//
//*****************************************************************************
void
FSI_resetTxModule(uint32_t base, FSI_TxSubmoduleInReset submodule)
{
//
// Check the arguments.
//
ASSERT(FSI_isTxBaseValid(base));
EALLOW;
switch(submodule)
{
case FSI_TX_MAIN_CORE_RESET:
HWREGH(base + FSI_O_TX_MAIN_CTRL) =
((uint16_t)FSI_TX_MAIN_CTRL_CORE_RST |
(FSI_CTRL_REG_KEY << FSI_TX_MAIN_CTRL_KEY_S));
break;
case FSI_TX_CLOCK_RESET:
HWREGH(base + FSI_O_TX_CLK_CTRL) |= FSI_TX_CLK_CTRL_CLK_RST;
break;
case FSI_TX_PING_TIMEOUT_CNT_RESET:
HWREGH(base + FSI_O_TX_PING_CTRL) |= FSI_TX_PING_CTRL_CNT_RST;
break;
default:
//
// Invalid submodule input
//
ASSERT(false);
break;
}
EDIS;
}
//*****************************************************************************
//
// FSI_clearTxModuleReset
//
//*****************************************************************************
void
FSI_clearTxModuleReset(uint32_t base, FSI_TxSubmoduleInReset submodule)
{
//
// Check the arguments.
//
ASSERT(FSI_isTxBaseValid(base));
EALLOW;
switch(submodule)
{
//
// Key value must be written into main control register and ensure
// that FLUSH pattern is not sent while doing Tx core reset
//
case FSI_TX_MAIN_CORE_RESET:
HWREGH(base + FSI_O_TX_MAIN_CTRL) =
(HWREGH(base + FSI_O_TX_MAIN_CTRL) &
(~FSI_TX_MAIN_CTRL_CORE_RST)) |
(FSI_CTRL_REG_KEY << FSI_TX_MAIN_CTRL_KEY_S);
break;
case FSI_TX_CLOCK_RESET:
HWREGH(base + FSI_O_TX_CLK_CTRL) &= ~FSI_TX_CLK_CTRL_CLK_RST;
break;
case FSI_TX_PING_TIMEOUT_CNT_RESET:
HWREGH(base + FSI_O_TX_PING_CTRL) &= ~FSI_TX_PING_CTRL_CNT_RST;
break;
default:
//
// Invalid submodule input
//
ASSERT(false);
break;
}
EDIS;
}
//*****************************************************************************
//
// FSI_writeTxBuffer
//
//*****************************************************************************
void
FSI_writeTxBuffer(uint32_t base, const uint16_t array[], uint16_t length,
uint16_t bufOffset)
{
//
// Check the arguments.
//
ASSERT(FSI_isTxBaseValid(base));
ASSERT((length - 1U) <= FSI_MAX_VALUE_BUF_PTR_OFF);
ASSERT(bufOffset <= FSI_MAX_VALUE_BUF_PTR_OFF);
uint16_t i = 0U, j, tempBufOffset = bufOffset;
for(j = 0U; j < length; j++)
{
//
// Check for wrap around in case more words to be written in buffer
// when last write happened at maximum offset in Tx buffer
//
if((tempBufOffset + i) > FSI_MAX_VALUE_BUF_PTR_OFF)
{
tempBufOffset = 0U;
i = 0U;
}
//
// Write one 16 bit word, increment buffer pointer
//
HWREGH(base + FSI_O_TX_BUF_BASE(tempBufOffset) + i) = array[j];
i++;
}
}
//*****************************************************************************
//
// FSI_resetRxModule
//
//*****************************************************************************
void
FSI_resetRxModule(uint32_t base, FSI_RxSubmoduleInReset submodule)
{
//
// Check the arguments.
//
ASSERT(FSI_isRxBaseValid(base));
EALLOW;
switch(submodule)
{
case FSI_RX_MAIN_CORE_RESET:
HWREGH(base + FSI_O_RX_MAIN_CTRL) |=
((uint16_t)FSI_RX_MAIN_CTRL_CORE_RST |
(FSI_CTRL_REG_KEY << FSI_RX_MAIN_CTRL_KEY_S));
break;
case FSI_RX_FRAME_WD_CNT_RESET:
HWREGH(base + FSI_O_RX_FRAME_WD_CTRL) |=
FSI_RX_FRAME_WD_CTRL_FRAME_WD_CNT_RST;
break;
case FSI_RX_PING_WD_CNT_RESET:
HWREGH(base + FSI_O_RX_PING_WD_CTRL) |=
FSI_RX_PING_WD_CTRL_PING_WD_RST;
break;
default:
//
// Invalid submodule input
//
ASSERT(false);
break;
}
EDIS;
}
//*****************************************************************************
//
// FSI_clearRxModuleReset
//
//*****************************************************************************
void
FSI_clearRxModuleReset(uint32_t base, FSI_RxSubmoduleInReset submodule)
{
//
// Check the arguments.
//
ASSERT(FSI_isRxBaseValid(base));
EALLOW;
switch(submodule)
{
case FSI_RX_MAIN_CORE_RESET:
HWREGH(base + FSI_O_RX_MAIN_CTRL) =
(HWREGH(base + FSI_O_RX_MAIN_CTRL) &
(~FSI_RX_MAIN_CTRL_CORE_RST)) |
(FSI_CTRL_REG_KEY << FSI_RX_MAIN_CTRL_KEY_S);
break;
case FSI_RX_FRAME_WD_CNT_RESET:
HWREGH(base + FSI_O_RX_FRAME_WD_CTRL) &=
~FSI_RX_FRAME_WD_CTRL_FRAME_WD_CNT_RST;
break;
case FSI_RX_PING_WD_CNT_RESET:
HWREGH(base + FSI_O_RX_PING_WD_CTRL) &=
~FSI_RX_PING_WD_CTRL_PING_WD_RST;
break;
default:
//
// Invalid submodule input
//
ASSERT(false);
break;
}
EDIS;
}
//*****************************************************************************
//
// FSI_readRxBuffer
//
//*****************************************************************************
void
FSI_readRxBuffer(uint32_t base, uint16_t array[], uint16_t length,
uint16_t bufOffset)
{
//
// Check the arguments.
//
ASSERT(FSI_isRxBaseValid(base));
ASSERT((length - 1U) <= FSI_MAX_VALUE_BUF_PTR_OFF);
ASSERT(bufOffset <= FSI_MAX_VALUE_BUF_PTR_OFF);
uint16_t i = 0U, j, tempBufOffset = bufOffset;
for(j = 0U; j < length; j++)
{
//
// Check for wrap around in case more words to be read in buffer when
// last read happened at maximum offset in Rx buffer
//
if((tempBufOffset + i) > FSI_MAX_VALUE_BUF_PTR_OFF)
{
tempBufOffset = 0U;
i = 0U;
}
//
// Read one 16 bit word, increment buffer pointer
//
array[j] = HWREGH(base + FSI_O_RX_BUF_BASE(tempBufOffset) + i);
i++;
}
}
//*****************************************************************************
//
// FSI_configRxDelayLine
//
//*****************************************************************************
void
FSI_configRxDelayLine(uint32_t base, FSI_RxDelayTapType delayTapType,
uint16_t tapValue)
{
//
// Check the arguments.
//
ASSERT(FSI_isRxBaseValid(base));
ASSERT(tapValue <= FSI_RX_MAX_DELAY_LINE_VAL);
EALLOW;
switch(delayTapType)
{
case FSI_RX_DELAY_CLK:
HWREGH(base + FSI_O_RX_DLYLINE_CTRL) =
(HWREGH(base + FSI_O_RX_DLYLINE_CTRL) &
(~FSI_RX_DLYLINE_CTRL_RXCLK_DLY_M)) |
(tapValue << FSI_RX_DLYLINE_CTRL_RXCLK_DLY_S);
break;
case FSI_RX_DELAY_D0:
HWREGH(base + FSI_O_RX_DLYLINE_CTRL) =
(HWREGH(base + FSI_O_RX_DLYLINE_CTRL) &
(~FSI_RX_DLYLINE_CTRL_RXD0_DLY_M)) |
(tapValue << FSI_RX_DLYLINE_CTRL_RXD0_DLY_S);
break;
case FSI_RX_DELAY_D1:
HWREGH(base + FSI_O_RX_DLYLINE_CTRL) =
(HWREGH(base + FSI_O_RX_DLYLINE_CTRL) &
(~FSI_RX_DLYLINE_CTRL_RXD1_DLY_M)) |
(tapValue << FSI_RX_DLYLINE_CTRL_RXD1_DLY_S);
break;
default:
//
// Invalid tap selection input
//
ASSERT(false);
break;
}
EDIS;
}
//*****************************************************************************
//
// FSI_performTxInitialization
//
//*****************************************************************************
void FSI_performTxInitialization(uint32_t base, uint16_t prescalar)
{
//
// Check the arguments.
//
ASSERT(FSI_isTxBaseValid(base));
ASSERT(prescalar <= 0xFFU );
//
// Reset the Tx core
//
FSI_resetTxModule(base, FSI_TX_MAIN_CORE_RESET);
//
// Select PLL clock as source for clock dividers
//
FSI_selectTxPLLClock(base);
//
// Sequence is :: Reset clock divider -> Set prescalar value
// in reset -> Wait -> Enable clock -> Release reset
//
FSI_resetTxModule(base, FSI_TX_CLOCK_RESET);
FSI_configPrescalar(base, prescalar);
FSI_delayWait(1);
FSI_enableTxClock(base);
FSI_clearTxModuleReset(base, FSI_TX_CLOCK_RESET);
//
// Wait sufficient time before releasing reset of Tx core
//
FSI_delayWait(prescalar);
FSI_clearTxEvents(base, FSI_TX_EVTMASK);
FSI_clearTxModuleReset(base, FSI_TX_MAIN_CORE_RESET);
FSI_delayWait(2UL * prescalar);
}
//*****************************************************************************
//
// FSI_performRxInitialization
//
//*****************************************************************************
void FSI_performRxInitialization(uint32_t base)
{
//
// Check the arguments.
//
ASSERT(FSI_isRxBaseValid(base));
FSI_resetRxModule(base, FSI_RX_MAIN_CORE_RESET);
FSI_clearRxEvents(base, FSI_RX_EVTMASK);
//
// It is important to ensure that there is no active clocks on RXCLK before
// releasing the reset. This can be accomplished by handshaking or by using
// the chip level connectivity options to ensure that no receive clocks are
// seen till the reset is released.
// FSI Rx module will come out of reset only when the receive clock is sent
// in or by sending a Flush pattern from FSI Tx.
//
FSI_delayWait(1);
FSI_clearRxModuleReset(base, FSI_RX_MAIN_CORE_RESET);
}
//*****************************************************************************
//
// FSI_executeTxFlushSequence
//
//*****************************************************************************
void FSI_executeTxFlushSequence(uint32_t base, uint16_t prescalar)
{
//
// Check the arguments.
//
ASSERT(FSI_isTxBaseValid(base));
ASSERT(prescalar <= 0xFFU );
FSI_sendTxFlush(base);
//
// Inserting delay as recommended in TRM, It ensures that the transmit
// module core sees sufficient TXCLK cycles before stopping FLUSH pattern.
//
FSI_delayWait(2UL * prescalar);
FSI_stopTxFlush(base);
}
File diff suppressed because it is too large. Load diff
+489
View File
@@ -0,0 +1,489 @@
//###########################################################################
//
// FILE: gpio.c
//
// TITLE: C28x GPIO driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "gpio.h"
//*****************************************************************************
//
// GPIO_setDirectionMode
//
//*****************************************************************************
void
GPIO_setDirectionMode(uint32_t pin, GPIO_Direction pinIO)
{
volatile uint32_t *gpioBaseAddr;
uint32_t pinMask;
//
// Check the arguments.
//
ASSERT(GPIO_isPinValid(pin));
gpioBaseAddr = (uint32_t *)GPIOCTRL_BASE +
((pin / 32U) * GPIO_CTRL_REGS_STEP);
pinMask = (uint32_t)1U << (pin % 32U);
EALLOW;
//
// Set the data direction
//
if(pinIO == GPIO_DIR_MODE_OUT)
{
//
// Output
//
gpioBaseAddr[GPIO_GPxDIR_INDEX] |= pinMask;
}
else
{
//
// Input
//
gpioBaseAddr[GPIO_GPxDIR_INDEX] &= ~pinMask;
}
EDIS;
}
//*****************************************************************************
//
// GPIO_getDirectionMode
//
//*****************************************************************************
GPIO_Direction
GPIO_getDirectionMode(uint32_t pin)
{
volatile uint32_t *gpioBaseAddr;
//
// Check the arguments.
//
ASSERT(GPIO_isPinValid(pin));
gpioBaseAddr = (uint32_t *)GPIOCTRL_BASE +
((pin / 32U) * GPIO_CTRL_REGS_STEP);
return((GPIO_Direction)((uint32_t)((gpioBaseAddr[GPIO_GPxDIR_INDEX] >>
(pin % 32U)) & 1U)));
}
//*****************************************************************************
//
// GPIO_setInterruptPin
//
//*****************************************************************************
void
GPIO_setInterruptPin(uint32_t pin, GPIO_ExternalIntNum extIntNum)
{
XBAR_InputNum input;
//
// Check the arguments.
//
ASSERT(GPIO_isPinValid(pin));
//
// Pick the X-BAR input that corresponds to the requested XINT.
//
switch(extIntNum)
{
case GPIO_INT_XINT1:
input = XBAR_INPUT4;
break;
case GPIO_INT_XINT2:
input = XBAR_INPUT5;
break;
case GPIO_INT_XINT3:
input = XBAR_INPUT6;
break;
case GPIO_INT_XINT4:
input = XBAR_INPUT13;
break;
case GPIO_INT_XINT5:
input = XBAR_INPUT14;
break;
default:
//
// Invalid interrupt. Shouldn't happen if enum value is used.
// XBAR_INPUT1 isn't tied to an XINT, so we'll use it to check for
// a bad value.
//
input = XBAR_INPUT1;
break;
}
if(input != XBAR_INPUT1)
{
XBAR_setInputPin(INPUTXBAR_BASE, input, (uint16_t)pin);
}
}
//*****************************************************************************
//
// GPIO_setPadConfig
//
//*****************************************************************************
void
GPIO_setPadConfig(uint32_t pin, uint32_t pinType)
{
volatile uint32_t *gpioBaseAddr;
uint32_t pinMask;
//
// Check the arguments.
//
ASSERT(GPIO_isPinValid(pin));
gpioBaseAddr = (uint32_t *)GPIOCTRL_BASE +
((pin / 32U) * GPIO_CTRL_REGS_STEP);
pinMask = (uint32_t)1U << (pin % 32U);
EALLOW;
//
// Enable open drain if necessary
//
if((pinType & GPIO_PIN_TYPE_OD) != 0U)
{
gpioBaseAddr[GPIO_GPxODR_INDEX] |= pinMask;
}
else
{
gpioBaseAddr[GPIO_GPxODR_INDEX] &= ~pinMask;
}
//
// Enable pull-up if necessary
//
if((pinType & GPIO_PIN_TYPE_PULLUP) != 0U)
{
gpioBaseAddr[GPIO_GPxPUD_INDEX] &= ~pinMask;
}
else
{
gpioBaseAddr[GPIO_GPxPUD_INDEX] |= pinMask;
}
//
// Invert polarity if necessary
//
if((pinType & GPIO_PIN_TYPE_INVERT) != 0U)
{
gpioBaseAddr[GPIO_GPxINV_INDEX] |= pinMask;
}
else
{
gpioBaseAddr[GPIO_GPxINV_INDEX] &= ~pinMask;
}
EDIS;
}
//*****************************************************************************
//
// GPIO_getPadConfig
//
//*****************************************************************************
uint32_t
GPIO_getPadConfig(uint32_t pin)
{
volatile uint32_t *gpioBaseAddr;
uint32_t pinMask;
uint32_t pinTypeRes;
//
// Check the arguments.
//
ASSERT(GPIO_isPinValid(pin));
gpioBaseAddr = (uint32_t *)GPIOCTRL_BASE +
((pin / 32U) * GPIO_CTRL_REGS_STEP);
pinMask = (uint32_t)1U << (pin % 32U);
pinTypeRes = GPIO_PIN_TYPE_STD;
//
// Get open drain value
//
if((gpioBaseAddr[GPIO_GPxODR_INDEX] & pinMask) != 0U)
{
pinTypeRes |= GPIO_PIN_TYPE_OD;
}
//
// Get pull-up value
//
if((gpioBaseAddr[GPIO_GPxPUD_INDEX] & pinMask) == 0U)
{
pinTypeRes |= GPIO_PIN_TYPE_PULLUP;
}
//
// Get polarity value
//
if((gpioBaseAddr[GPIO_GPxINV_INDEX] & pinMask) != 0U)
{
pinTypeRes |= GPIO_PIN_TYPE_INVERT;
}
return(pinTypeRes);
}
//*****************************************************************************
//
// GPIO_setQualificationMode
//
//*****************************************************************************
void
GPIO_setQualificationMode(uint32_t pin, GPIO_QualificationMode qualification)
{
volatile uint32_t *gpioBaseAddr;
uint32_t qSelIndex;
uint32_t shiftAmt;
//
// Check the arguments.
//
ASSERT(GPIO_isPinValid(pin));
gpioBaseAddr = (uint32_t *)GPIOCTRL_BASE +
((pin / 32U) * GPIO_CTRL_REGS_STEP);
shiftAmt = (uint32_t)GPIO_GPAQSEL1_GPIO1_S * (pin % 16U);
qSelIndex = GPIO_GPxQSEL_INDEX + ((pin % 32U) / 16U);
//
// Write the input qualification mode to the register.
//
EALLOW;
gpioBaseAddr[qSelIndex] &= ~((uint32_t)GPIO_GPAQSEL1_GPIO0_M << shiftAmt);
gpioBaseAddr[qSelIndex] |= (uint32_t)qualification << shiftAmt;
EDIS;
}
//*****************************************************************************
//
// GPIO_getQualificationMode
//
//*****************************************************************************
GPIO_QualificationMode
GPIO_getQualificationMode(uint32_t pin)
{
volatile uint32_t *gpioBaseAddr;
uint32_t qSelIndex;
uint32_t qualRes;
uint32_t shiftAmt;
//
// Check the arguments.
//
ASSERT(GPIO_isPinValid(pin));
gpioBaseAddr = (uint32_t *)GPIOCTRL_BASE +
((pin / 32U) * GPIO_CTRL_REGS_STEP);
shiftAmt = (uint32_t)GPIO_GPAQSEL1_GPIO1_S * (pin % 16U);
qSelIndex = GPIO_GPxQSEL_INDEX + ((pin % 32U) / 16U);
//
// Read the qualification mode register and shift and mask to get the
// value for the specified pin.
//
qualRes = (gpioBaseAddr[qSelIndex] >> shiftAmt) &
(uint32_t)GPIO_GPAQSEL1_GPIO0_M;
return((GPIO_QualificationMode)qualRes);
}
//*****************************************************************************
//
// GPIO_setQualificationPeriod
//
//*****************************************************************************
void
GPIO_setQualificationPeriod(uint32_t pin, uint32_t divider)
{
volatile uint32_t *gpioBaseAddr;
uint32_t pinMask, regVal, shiftAmt;
//
// Check the arguments.
//
ASSERT(GPIO_isPinValid(pin));
ASSERT((divider >= 1U) && (divider <= 510U));
shiftAmt = (pin % 32U) & ~((uint32_t)0x7U);
pinMask = (uint32_t)0xFFU << shiftAmt;
//
// Divide divider by two to get the value that needs to go into the field.
// Then shift it into the right place.
//
regVal = (divider / 2U) << shiftAmt;
//
// Write the divider parameter into the register.
//
gpioBaseAddr = (uint32_t *)GPIOCTRL_BASE +
((pin / 32U) * GPIO_CTRL_REGS_STEP);
EALLOW;
gpioBaseAddr[GPIO_GPxCTRL_INDEX] &= ~pinMask;
gpioBaseAddr[GPIO_GPxCTRL_INDEX] |= regVal;
EDIS;
}
//*****************************************************************************
//
// GPIO_setControllerCore
//
//*****************************************************************************
void
GPIO_setControllerCore(uint32_t pin, GPIO_CoreSelect core)
{
volatile uint32_t *gpioBaseAddr;
uint32_t cSelIndex;
uint32_t shiftAmt;
//
// Check the arguments.
//
ASSERT(GPIO_isPinValid(pin));
gpioBaseAddr = (uint32_t *)GPIOCTRL_BASE +
((pin / 32U) * GPIO_CTRL_REGS_STEP);
shiftAmt = (uint32_t)GPIO_GPACSEL1_GPIO1_S * (pin % 8U);
cSelIndex = GPIO_GPxCSEL_INDEX + ((pin % 32U) / 8U);
//
// Write the core parameter into the register.
//
EALLOW;
gpioBaseAddr[cSelIndex] &= ~((uint32_t)GPIO_GPACSEL1_GPIO0_M << shiftAmt);
gpioBaseAddr[cSelIndex] |= (uint32_t)core << shiftAmt;
EDIS;
}
//*****************************************************************************
//
// GPIO_setAnalogMode
//
//*****************************************************************************
void
GPIO_setAnalogMode(uint32_t pin, GPIO_AnalogMode mode)
{
volatile uint32_t *gpioBaseAddr;
uint32_t pinMask;
//
// Check the arguments.
//
ASSERT((pin == 42U) || (pin == 43U));
pinMask = (uint32_t)1U << (pin % 32U);
gpioBaseAddr = (uint32_t *)GPIOCTRL_BASE +
((pin / 32U) * GPIO_CTRL_REGS_STEP);
EALLOW;
//
// Set the analog mode selection.
//
if(mode == GPIO_ANALOG_ENABLED)
{
//
// Enable analog mode
//
gpioBaseAddr[GPIO_GPxAMSEL_INDEX] |= pinMask;
}
else
{
//
// Disable analog mode
//
gpioBaseAddr[GPIO_GPxAMSEL_INDEX] &= ~pinMask;
}
EDIS;
}
//*****************************************************************************
//
// GPIO_setPinConfig
//
//*****************************************************************************
void
GPIO_setPinConfig(uint32_t pinConfig)
{
uint32_t muxRegAddr;
uint32_t pinMask, shiftAmt;
muxRegAddr = (uint32_t)GPIOCTRL_BASE + (pinConfig >> 16);
shiftAmt = ((pinConfig >> 8) & (uint32_t)0xFFU);
pinMask = (uint32_t)0x3U << shiftAmt;
EALLOW;
//
// Clear fields in MUX register first to avoid glitches
//
HWREG(muxRegAddr) &= ~pinMask;
//
// Write value into GMUX register
//
HWREG(muxRegAddr + GPIO_MUX_TO_GMUX) =
(HWREG(muxRegAddr + GPIO_MUX_TO_GMUX) & ~pinMask) |
(((pinConfig >> 2) & (uint32_t)0x3U) << shiftAmt);
//
// Write value into MUX register
//
HWREG(muxRegAddr) |= ((pinConfig & (uint32_t)0x3U) << shiftAmt);
EDIS;
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,44 @@
//###########################################################################
//
// FILE: hrcap.c
//
// TITLE: C28x HRCAP driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "hrcap.h"
@@ -0,0 +1,619 @@
//###########################################################################
//
// FILE: hrcap.h
//
// TITLE: C28x HRCAP Driver.
//
//#############################################################################
//
// 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 HRCAP_H
#define HRCAP_H
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
//
//! \addtogroup hrcap_api HRCAP
//! @{
//
//*****************************************************************************
#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_hrcap.h"
#include "cpu.h"
#include "debug.h"
//*****************************************************************************
//
// Values that can be passed to HRCAP_enableCalibrationInterrupt(),
// HRCAP_disableCalibrationInterrupt() as the intFlags parameter and
// HRCAP_clearCalibrationFlags() and HRCAP_forceCalibrationFlags() as the flags
// parameter and returned by HRCAP_getCalibrationFlags().
//
//*****************************************************************************
//! Global calibration interrupt flag
//!
#define HRCAP_GLOBAL_CALIBRATION_INTERRUPT 0x1U
//! Calibration done flag
//!
#define HRCAP_CALIBRATION_DONE 0x2U
//! Calibration period overflow flag
//!
#define HRCAP_CALIBRATION_PERIOD_OVERFLOW 0x4U
//*****************************************************************************
//
//! Values that can be passed to HRCAP_getCalibrationClockPeriod() as the
//! \e clockSource parameter.
//
//*****************************************************************************
typedef enum
{
HRCAP_CALIBRATION_CLOCK_SYSCLK = 0x0, //!< Use SYSCLK for period match.
HRCAP_CALIBRATION_CLOCK_HRCLK = 0x4 //!< Use HRCLK for period match.
}HRCAP_CalibrationClockSource;
//*****************************************************************************
//
//! Values that can be passed to HRCAP_setCalibrationMode(),
//! as the \e continuousMode parameter.
//
//*****************************************************************************
typedef enum
{
//! Continuous calibration disabled.
HRCAP_CONTINUOUS_CALIBRATION_DISABLED = 0x00,
//! Continuous calibration enabled.
HRCAP_CONTINUOUS_CALIBRATION_ENABLED = 0x20
}HRCAP_ContinuousCalibrationMode;
//*****************************************************************************
//
//! \internal
//! Checks HRCAP base address.
//!
//! \param base specifies the HRCAP module base address.
//!
//! This function determines if an HRCAP module base address is valid.
//!
//! \return Returns \b true if the base address is valid and \b false
//! otherwise.
//
//*****************************************************************************
#ifdef DEBUG
static inline bool
HRCAP_isBaseValid(uint32_t base)
{
return(
(base == HRCAP6_BASE) ||
(base == HRCAP7_BASE)
);
}
#endif
//*****************************************************************************
//
//! enables HRCAP.
//!
//! \param base is the base address of the HRCAP instance used.
//!
//! This function enables High Resolution Capture module.
//!
//! \note High resolution clock must be enabled before High Resolution Module
//! is enabled.
//!
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_enableHighResolution(uint32_t base)
{
ASSERT(HRCAP_isBaseValid(base));
EALLOW;
//
// Set HRE bit.
//
HWREGH(base + HRCAP_O_HRCTL) |= HRCAP_HRCTL_HRE;
EDIS;
}
//*****************************************************************************
//
//! Disables HRCAP.
//!
//! \param base is the base address of the HRCAP instance used.
//!
//! This function disable High Resolution Capture module.
//!
//!
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_disableHighResolution(uint32_t base)
{
ASSERT(HRCAP_isBaseValid(base));
EALLOW;
//
// Set HRE bit.
//
HWREGH(base + HRCAP_O_HRCTL) &= ~HRCAP_HRCTL_HRE;
EDIS;
}
//*****************************************************************************
//
//! Enables high resolution clock.
//!
//! \param base is the base address of the HRCAP instance used.
//!
//! This function enables High Resolution clock.
//!
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_enableHighResolutionClock(uint32_t base)
{
ASSERT(HRCAP_isBaseValid(base));
EALLOW;
//
// Set HRCLKE bit.
//
HWREGH(base + HRCAP_O_HRCTL) |= HRCAP_HRCTL_HRCLKE;
EDIS;
}
//*****************************************************************************
//
//! Disables High resolution clock.
//!
//! \param base is the base address of the HRCAP instance used.
//!
//! This function disables High Resolution clock.
//!
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_disbleHighResolutionClock(uint32_t base)
{
ASSERT(HRCAP_isBaseValid(base));
EALLOW;
//
// Clear HRCLKE bit.
//
HWREGH(base + HRCAP_O_HRCTL) &= ~HRCAP_HRCTL_HRCLKE;
EDIS;
}
//*****************************************************************************
//
//! Starts calibration.
//!
//! \param base is the base address of the HRCAP instance used.
//!
//! This function starts calibration.
//!
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_startCalibration(uint32_t base)
{
ASSERT(HRCAP_isBaseValid(base));
EALLOW;
//
// Set CALIBSTART bit.
//
HWREGH(base + HRCAP_O_HRCTL) |= HRCAP_HRCTL_CALIBSTART;
EDIS;
}
//*****************************************************************************
//
//! Sets the calibration mode.
//!
//! \param base is the base address of the HRCAP instance used.
//!
//! This function sets the the calibration mode by turning on continuous
//! calibration.
//!
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_setCalibrationMode(uint32_t base)
{
ASSERT(HRCAP_isBaseValid(base));
EALLOW;
//
// Write to CALIBSTS and CALIBCONT bits.
//
HWREGH(base + HRCAP_O_HRCTL) |= HRCAP_HRCTL_CALIBCONT;
EDIS;
}
//*****************************************************************************
//
//! Enables calibration interrupt.
//!
//! \param base is the base address of the HRCAP module.
//! \param intFlags is the calibration interrupt flags to be enabled.
//!
//! This function enables HRCAP calibration interrupt flags.
//! Valid values for intFlags are:
//! - HRCAP_CALIBRATION_DONE - Calibration done interrupt.
//! - HRCAP_CALIBRATION_PERIOD_OVERFLOW - Calibration period overflow
//! check interrupt.
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_enableCalibrationInterrupt(uint32_t base, uint16_t intFlags)
{
ASSERT(HRCAP_isBaseValid(base));
ASSERT((intFlags & ~(HRCAP_CALIBRATION_DONE |
HRCAP_CALIBRATION_PERIOD_OVERFLOW)) == 0U);
EALLOW;
//
// Set CALIBDONE or CALPRDCHKSTS.
//
HWREGH(base + HRCAP_O_HRINTEN) |= intFlags;
EDIS;
}
//*****************************************************************************
//
//! Disables calibration interrupt source.
//!
//! \param base is the base address of the HRCAP module.
//! \param intFlags is the calibration interrupt flags to be disabled.
//!
//! This function disables HRCAP calibration interrupt flags.
//! Valid values for intFlags are:
//! - HRCAP_CALIBRATION_DONE - Calibration done interrupt.
//! - HRCAP_CALIBRATION_PERIOD_OVERFLOW - Calibration period check
//! interrupt.
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_disableCalibrationInterrupt(uint32_t base, uint16_t intFlags)
{
ASSERT(HRCAP_isBaseValid(base));
ASSERT((intFlags & ~(HRCAP_CALIBRATION_DONE |
HRCAP_CALIBRATION_PERIOD_OVERFLOW)) == 0U);
EALLOW;
//
// Clear CALIBDONE or CALPRDCHKSTS.
//
HWREGH(base + HRCAP_O_HRINTEN) &= ~intFlags;
EDIS;
}
//*****************************************************************************
//
//! Returns the calibration interrupt source.
//!
//! \param base is the base address of the HRCAP module.
//!
//! This function returns the HRCAP calibration interrupt source.
//!
//! \return Returns the HRCAP interrupt that has occurred. The following are
//! valid return values.
//! - HRCAP_GLOBAL_CALIBRATION_INTERRUPT - Global calibration
//! interrupt.
//! - HRCAP_CALIBRATION_DONE - Calibration done interrupt.
//! - HRCAP_CALIBRATION_PERIOD_OVERFLOW - Calibration period overflow
//! interrupt.
//!
//! \note - User can check if a combination of the interrupts have occurred
//! by ORing the above return values.
//
//*****************************************************************************
static inline uint16_t
HRCAP_getCalibrationFlags(uint32_t base)
{
ASSERT(HRCAP_isBaseValid(base));
//
// Return contents of HRFLG register.
//
return((uint16_t)(HWREGH(base + HRCAP_O_HRFLG) & 0x7U));
}
//*****************************************************************************
//
//! Clears calibration flags.
//!
//! \param base is the base address of the HRCAP module.
//! \param flags is the calibration flags to be cleared.
//!
//! This function clears HRCAP calibration flags.
//! The following are valid values for flags.
//! - HRCAP_GLOBAL_CALIBRATION_INTERRUPT - Global calibration interrupt.
//! - HRCAP_CALIBRATION_DONE - Calibration done flag.
//! - HRCAP_CALIBRATION_PERIOD_OVERFLOW - Calibration period overflow flag.
//!
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_clearCalibrationFlags(uint32_t base, uint16_t flags)
{
ASSERT(HRCAP_isBaseValid(base));
ASSERT((flags == (HRCAP_CALIBRATION_DONE |
HRCAP_GLOBAL_CALIBRATION_INTERRUPT)) ||
(flags == (HRCAP_CALIBRATION_PERIOD_OVERFLOW |
HRCAP_GLOBAL_CALIBRATION_INTERRUPT)) ||
(flags == (HRCAP_CALIBRATION_DONE |
HRCAP_GLOBAL_CALIBRATION_INTERRUPT |
HRCAP_CALIBRATION_PERIOD_OVERFLOW)));
//
// Write to HRCLR register.
//
HWREGH(base + HRCAP_O_HRCLR) |= flags;
}
//*****************************************************************************
//
//! Return the Calibration status
//!
//! \param base is the base address of the HRCAP instance used.
//!
//! This function returns the calibration status.
//!
//! \return This functions returns true if the calibration is in process,false
//! if there is no active calibration.
//
//*****************************************************************************
static inline bool
HRCAP_isCalibrationBusy(uint32_t base)
{
ASSERT(HRCAP_isBaseValid(base));
//
// Read CALIBSTS bit.
//
return((HWREGH(base + HRCAP_O_HRCTL) & HRCAP_HRCTL_CALIBSTS) ==
HRCAP_HRCTL_CALIBSTS);
}
//*****************************************************************************
//
//! Force a software based calibration
//!
//! \param base is the base address of the HRCAP instance used.
//! \param flag is the calibration flag source.
//!
//! This function forces a software based calibration done flag.
//! The following are valid values for flag.
//! - HRCAP_CALIBRATION_DONE - Calibration done flag.
//! - HRCAP_CALIBRATION_PERIOD_OVERFLOW - Calibration period overflow flag.
//!
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_forceCalibrationFlags(uint32_t base, uint16_t flag)
{
ASSERT(HRCAP_isBaseValid(base));
ASSERT((flag & ~(HRCAP_CALIBRATION_DONE |
HRCAP_CALIBRATION_PERIOD_OVERFLOW)) == 0U);
EALLOW;
//
// Write to CALIBDONE or CALPRDCHKSTS bit.
//
HWREGH(base + HRCAP_O_HRFRC) |= flag;
EDIS;
}
//*****************************************************************************
//
//! Sets the calibration period count
//!
//! \param base is the base address of the HRCAP instance used.
//! \param sysclkHz is the rate of the SYSCLK in Hz.
//!
//! This function sets the calibration period count value to achieve a period
//! of 1.6 milliseconds given the SYSCLK frequency in Hz (the \e sysclkHz
//! parameter).
//!
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_setCalibrationPeriod(uint32_t base, uint32_t sysclkHz)
{
ASSERT(HRCAP_isBaseValid(base));
EALLOW;
HWREG(base + HRCAP_O_HRCALPRD) = (sysclkHz * 16U) / 10000U;
EDIS;
}
//*****************************************************************************
//
//! Sets the calibration period count at a user configurable value.
//!
//! \param base is the base address of the HRCAP instance used.
//! \param sysclkHz is the rate of the SYSCLK in Hz.
//! \param periodInMs is the calibration period to be configured.
//!
//! This function sets the calibration period count value to the provided
//! period in milliseconds given the SYSCLK frequency in Hz (the \e sysclkHz
//! parameter).
//!
//! \return None.
//
//*****************************************************************************
static inline void
HRCAP_configCalibrationPeriod(uint32_t base, uint32_t sysclkHz,
float periodInMs)
{
ASSERT(HRCAP_isBaseValid(base));
EALLOW;
HWREG(base + HRCAP_O_HRCALPRD) =
(uint32_t)((float32_t)sysclkHz * periodInMs / 1000.0F);
EDIS;
}
//*****************************************************************************
//
//! Returns the calibration clock period
//!
//! \param base is the base address of the HRCAP instance used.
//! \param clockSource is the calibration clock source
//! (\b HRCAP_CALIBRATION_CLOCK_SYSCLK or \b HRCAP_CALIBRATION_CLOCK_HRCLK).
//!
//! This function returns the period match value of the calibration clock. The
//! return value has a valid count when a period match occurs.
//!
//! \return This function returns the captured value of the clock counter
//! specified by clockSource.
//
//*****************************************************************************
static inline uint32_t
HRCAP_getCalibrationClockPeriod(uint32_t base,
HRCAP_CalibrationClockSource clockSource)
{
ASSERT(HRCAP_isBaseValid(base));
//
// Return HRCAP_O_HRSYSCLKCAP or HRCAP_O_HRCLKCAP.
//
return(HWREG(base + HRCAP_O_HRSYSCLKCAP + (uint32_t)clockSource));
}
//*****************************************************************************
//
//! Calculates the scale factor
//!
//! \param base is the base address of the HRCAP instance used.
//!
//! This function reads the SYSCLK and HRCLK calibration periods and then
//! uses them to calculate the scale factor.
//!
//! \return This function returns the calculated scale factor.
//
//*****************************************************************************
static inline float32_t
HRCAP_getScaleFactor(uint32_t base)
{
ASSERT(HRCAP_isBaseValid(base));
//
// Calculate and return the scale factor.
//
return((float32_t)HRCAP_getCalibrationClockPeriod(base,
HRCAP_CALIBRATION_CLOCK_SYSCLK) /
(float32_t)HRCAP_getCalibrationClockPeriod(base,
HRCAP_CALIBRATION_CLOCK_HRCLK));
}
//*****************************************************************************
//
//! Returns event time stamp in nanoseconds
//!
//! \param timeStamp is a raw time stamp count returned by
//! ECAP_getEventTimeStamp().
//! \param scaleFactor is the calculated scale factor returned by
//! HRCAP_getScaleFactor().
//!
//! This function converts a raw CAP time stamp (the \e timeStamp parameter) to
//! nanoseconds using the provided scale factor (the \e scaleFactor parameter).
//!
//! \return Returns the converted time stamp in nanoseconds.
//
//*****************************************************************************
static inline float32_t
HRCAP_convertEventTimeStampNanoseconds(uint32_t timeStamp,
float32_t scaleFactor)
{
//
// Convert the raw count value to nanoseconds using the given scale factor.
//
return((float32_t)timeStamp * scaleFactor * ((float32_t)5.0 /
(float32_t)128.0));
}
//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // HRCAP_H
@@ -0,0 +1,47 @@
//###########################################################################
//
// FILE: hrpwm.c
//
// TITLE: C28x HRPWM driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include "hrpwm.h"
//
// All the API functions are in-lined in hrpwm.h
//
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,89 @@
#ifndef HW_REG_INCLUSIVE_TERMINOLOGY_H
#define HW_REG_INCLUSIVE_TERMINOLOGY_H
//*****************************************************************************
// PMBUS
//*****************************************************************************
#define PMBUS_O_PMBCCR PMBUS_O_PMBMC
#define PMBUS_O_PMBTCR PMBUS_O_PMBSC
#define PMBUS_O_PMBHTA PMBUS_O_PMBHSA
#define PMBUS_PMBCCR_RW PMBUS_PMBMC_RW
#define PMBUS_PMBCCR_TARGET_ADDR_S PMBUS_PMBMC_SLAVE_ADDR_S
#define PMBUS_PMBCCR_TARGET_ADDR_M PMBUS_PMBMC_SLAVE_ADDR_M
#define PMBUS_PMBCCR_BYTE_COUNT_S PMBUS_PMBMC_BYTE_COUNT_S
#define PMBUS_PMBCCR_BYTE_COUNT_M PMBUS_PMBMC_BYTE_COUNT_M
#define PMBUS_PMBCCR_CMD_ENA PMBUS_PMBMC_CMD_ENA
#define PMBUS_PMBCCR_EXT_CMD PMBUS_PMBMC_EXT_CMD
#define PMBUS_PMBCCR_PEC_ENA PMBUS_PMBMC_PEC_ENA
#define PMBUS_PMBCCR_GRP_CMD PMBUS_PMBMC_GRP_CMD
#define PMBUS_PMBCCR_PRC_CALL PMBUS_PMBMC_PRC_CALL
#define PMBUS_PMBTCR_TARGET_ADDR_S PMBUS_PMBSC_SLAVE_ADDR_S
#define PMBUS_PMBTCR_TARGET_ADDR_M PMBUS_PMBSC_SLAVE_ADDR_M
#define PMBUS_PMBTCR_MAN_TARGET_ACK PMBUS_PMBSC_MAN_SLAVE_ACK
#define PMBUS_PMBTCR_TARGET_MASK_S PMBUS_PMBSC_SLAVE_MASK_S
#define PMBUS_PMBTCR_TARGET_MASK_M PMBUS_PMBSC_SLAVE_MASK_M
#define PMBUS_PMBTCR_PEC_ENA PMBUS_PMBSC_PEC_ENA
#define PMBUS_PMBTCR_TX_COUNT_S PMBUS_PMBSC_TX_COUNT_S
#define PMBUS_PMBTCR_TX_COUNT_M PMBUS_PMBSC_TX_COUNT_M
#define PMBUS_PMBTCR_TX_PEC PMBUS_PMBSC_TX_PEC
#define PMBUS_PMBTCR_MAN_CMD PMBUS_PMBSC_MAN_CMD
#define PMBUS_PMBTCR_RX_BYTE_ACK_CNT_S PMBUS_PMBSC_RX_BYTE_ACK_CNT_S
#define PMBUS_PMBTCR_RX_BYTE_ACK_CNT_M PMBUS_PMBSC_RX_BYTE_ACK_CNT_M
#define PMBUS_PMBHTA_TARGET_RW PMBUS_PMBHSA_SLAVE_RW
#define PMBUS_PMBHTA_TARGET_ADDR_S PMBUS_PMBHSA_SLAVE_ADDR_S
#define PMBUS_PMBHTA_TARGET_ADDR_M PMBUS_PMBHSA_SLAVE_ADDR_M
#define PMBUS_PMBCTRL_CONTROLLER_EN PMBUS_PMBCTRL_MASTER_EN
#define PMBUS_PMBCTRL_TARGET_EN PMBUS_PMBCTRL_SLAVE_EN
#define PMBUS_PMBSTS_CONTROLLER PMBUS_PMBSTS_MASTER
#define PMBUS_PMBSTS_TARGET_ADDR_READY PMBUS_PMBSTS_SLAVE_ADDR_READY
#define PMBUS_PMBINTM_TARGET_ADDR_READY PMBUS_PMBINTM_SLAVE_ADDR_READY
//*****************************************************************************
// FSI
//*****************************************************************************
#define FSI_O_TX_MAIN_CTRL FSI_O_TX_MASTER_CTRL
#define FSI_O_RX_MAIN_CTRL FSI_O_RX_MASTER_CTRL
#define FSI_TX_MAIN_CTRL_CORE_RST FSI_TX_MASTER_CTRL_CORE_RST
#define FSI_TX_MAIN_CTRL_FLUSH FSI_TX_MASTER_CTRL_FLUSH
#define FSI_TX_MAIN_CTRL_KEY_S FSI_TX_MASTER_CTRL_KEY_S
#define FSI_TX_MAIN_CTRL_KEY_M FSI_TX_MASTER_CTRL_KEY_M
#define FSI_RX_MAIN_CTRL_CORE_RST FSI_RX_MASTER_CTRL_CORE_RST
#define FSI_RX_MAIN_CTRL_INT_LOOPBACK FSI_RX_MASTER_CTRL_INT_LOOPBACK
#define FSI_RX_MAIN_CTRL_SPI_PAIRING FSI_RX_MASTER_CTRL_SPI_PAIRING
#define FSI_RX_MAIN_CTRL_INPUT_ISOLATE FSI_RX_MASTER_CTRL_INPUT_ISOLATE
#define FSI_RX_MAIN_CTRL_DATA_FILTER_EN FSI_RX_MASTER_CTRL_DATA_FILTER_EN
#define FSI_RX_MAIN_CTRL_KEY_S FSI_RX_MASTER_CTRL_KEY_S
#define FSI_RX_MAIN_CTRL_KEY_M FSI_RX_MASTER_CTRL_KEY_M
//*****************************************************************************
// SPI
//*****************************************************************************
#define SPI_CTL_CONTROLLER_PERIPHERAL SPI_CTL_MASTER_SLAVE
#define SPI_PRI_PTEINV SPI_PRI_STEINV
//*****************************************************************************
// I2C
//*****************************************************************************
#define I2C_O_TAR I2C_O_SAR
#define I2C_TAR_TAR_S I2C_SAR_SAR_S
#define I2C_TAR_TAR_M I2C_SAR_SAR_M
#define I2C_IER_AAT I2C_IER_AAS
#define I2C_STR_AAT I2C_STR_AAS
#define I2C_STR_TDIR I2C_STR_SDIR
#define I2C_MDR_CNT I2C_MDR_MST
#endif // HW_REG_INCLUSIVE_TERMINOLOGY_H
+351
View File
@@ -0,0 +1,351 @@
//###########################################################################
//
// FILE: i2c.c
//
// TITLE: C28x I2C driver.
//
//###########################################################################
//
// 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.
// $
//###########################################################################
#include <stdbool.h>
#include <stdint.h>
#include "i2c.h"
//*****************************************************************************
//
// I2C_initController
//
//*****************************************************************************
void
I2C_initController(uint32_t base, uint32_t sysclkHz, uint32_t bitRate,
I2C_DutyCycle dutyCycle)
{
uint32_t modPrescale;
uint32_t divider;
uint32_t dValue;
//
// Check the arguments.
//
ASSERT(I2C_isBaseValid(base));
ASSERT((10000000U / bitRate) > 10U);
//
// Set the prescaler for the module clock.
//
modPrescale = (sysclkHz / 10000000U) - 1U;
HWREGH(base + I2C_O_PSC) = I2C_PSC_IPSC_M & modPrescale;
switch(modPrescale)
{
case 0U:
dValue = 7U;
break;
case 1U:
dValue = 6U;
break;
default:
dValue = 5U;
break;
}
//
// Set the divider for the time low
//
divider = (10000000U / bitRate) - (2U * dValue);
if(dutyCycle == I2C_DUTYCYCLE_50)
{
HWREGH(base + I2C_O_CLKH) = divider / 2U;
}
else
{
HWREGH(base + I2C_O_CLKH) = divider / 3U;
}
HWREGH(base + I2C_O_CLKL) = divider - HWREGH(base + I2C_O_CLKH);
}
//*****************************************************************************
//
// I2C_initControllerModuleFrequency
//
//*****************************************************************************
void
I2C_initControllerModuleFrequency(uint32_t base, uint32_t sysclkHz, uint32_t bitRate,
I2C_DutyCycle dutyCycle, uint32_t moduleFrequency)
{
uint32_t modPrescale;
uint32_t divider;
uint32_t dValue;
//
// Check the arguments.
//
ASSERT(I2C_isBaseValid(base));
ASSERT((moduleFrequency / bitRate) > 10U);
//
// Set the prescaler for the module clock.
//
modPrescale = (sysclkHz / moduleFrequency) - 1U;
HWREGH(base + I2C_O_PSC) = I2C_PSC_IPSC_M & modPrescale;
switch(modPrescale)
{
case 0U:
dValue = 7U;
break;
case 1U:
dValue = 6U;
break;
default:
dValue = 5U;
break;
}
//
// Set the divider for the time low
//
divider = (moduleFrequency / bitRate) - (2U * dValue);
if(dutyCycle == I2C_DUTYCYCLE_50)
{
HWREGH(base + I2C_O_CLKH) = divider / 2U;
}
else
{
HWREGH(base + I2C_O_CLKH) = divider / 3U;
}
HWREGH(base + I2C_O_CLKL) = divider - HWREGH(base + I2C_O_CLKH);
}
//*****************************************************************************
//
// I2C_enableInterrupt
//
//*****************************************************************************
void
I2C_enableInterrupt(uint32_t base, uint32_t intFlags)
{
//
// Check the arguments.
//
ASSERT(I2C_isBaseValid(base));
//
// Enable the desired basic interrupts
//
HWREGH(base + I2C_O_IER) |= (intFlags & 0xFFFFU);
//
// Enabling addressed-as-target interrupt separately because its bit is
// different between the IER and STR registers.
//
if((intFlags & I2C_INT_ADDR_TARGET) != 0U)
{
HWREGH(base + I2C_O_IER) |= I2C_IER_AAT;
}
//
// Enable desired FIFO interrupts.
//
if((intFlags & I2C_INT_TXFF) != 0U)
{
HWREGH(base + I2C_O_FFTX) |= I2C_FFTX_TXFFIENA;
}
if((intFlags & I2C_INT_RXFF) != 0U)
{
HWREGH(base + I2C_O_FFRX) |= I2C_FFRX_RXFFIENA;
}
}
//*****************************************************************************
//
// I2C_disableInterrupt
//
//*****************************************************************************
void
I2C_disableInterrupt(uint32_t base, uint32_t intFlags)
{
//
// Check the arguments.
//
ASSERT(I2C_isBaseValid(base));
//
// Disable the desired basic interrupts.
//
HWREGH(base + I2C_O_IER) &= ~(intFlags & 0xFFFFU);
//
// Disabling addressed-as-target interrupt separately because its bit is
// different between the IER and STR registers.
//
if((intFlags & I2C_INT_ADDR_TARGET) != 0U)
{
HWREGH(base + I2C_O_IER) &= ~I2C_IER_AAT;
}
//
// Disable the desired FIFO interrupts.
//
if((intFlags & I2C_INT_TXFF) != 0U)
{
HWREGH(base + I2C_O_FFTX) &= ~(I2C_FFTX_TXFFIENA);
}
if((intFlags & I2C_INT_RXFF) != 0U)
{
HWREGH(base + I2C_O_FFRX) &= ~(I2C_FFRX_RXFFIENA);
}
}
//*****************************************************************************
//
// I2C_getInterruptStatus
//
//*****************************************************************************
uint32_t
I2C_getInterruptStatus(uint32_t base)
{
uint32_t temp;
//
// Check the arguments.
//
ASSERT(I2C_isBaseValid(base));
//
// Return only the status bits associated with interrupts.
//
temp = (uint32_t)(HWREGH(base + I2C_O_STR) & I2C_STR_INTMASK);
//
// Read FIFO interrupt flags.
//
if((HWREGH(base + I2C_O_FFTX) & I2C_FFTX_TXFFINT) != 0U)
{
temp |= I2C_INT_TXFF;
}
if((HWREGH(base + I2C_O_FFRX) & I2C_FFRX_RXFFINT) != 0U)
{
temp |= I2C_INT_RXFF;
}
return(temp);
}
//*****************************************************************************
//
// I2C_clearInterruptStatus
//
//*****************************************************************************
void
I2C_clearInterruptStatus(uint32_t base, uint32_t intFlags)
{
//
// Check the arguments.
//
ASSERT(I2C_isBaseValid(base));
//
// Clear the interrupt flags that are located in STR.
//
HWREGH(base + I2C_O_STR) = ((uint16_t)intFlags & I2C_STR_INTMASK);
//
// Clear the FIFO interrupt flags if needed.
//
if((intFlags & I2C_INT_TXFF) != 0U)
{
HWREGH(base + I2C_O_FFTX) |= I2C_FFTX_TXFFINTCLR;
}
if((intFlags & I2C_INT_RXFF) != 0U)
{
HWREGH(base + I2C_O_FFRX) |= I2C_FFRX_RXFFINTCLR;
}
}
//*****************************************************************************
//
// I2C_configureModuleFrequency
//
//*****************************************************************************
void
I2C_configureModuleFrequency(uint32_t base, uint32_t sysclkHz)
{
uint32_t modPrescale;
//
// Check the arguments.
//
ASSERT(I2C_isBaseValid(base));
//
// Set the prescaler for the module clock.
//
modPrescale = (sysclkHz / 10000000U) - 1U;
HWREGH(base + I2C_O_PSC) = I2C_PSC_IPSC_M & modPrescale;
}
//*****************************************************************************
//
// I2C_configureModuleClockFrequency
//
//*****************************************************************************
void
I2C_configureModuleClockFrequency(uint32_t base, uint32_t sysclkHz, uint32_t moduleFrequency)
{
uint32_t modPrescale;
//
// Check the arguments.
//
ASSERT(I2C_isBaseValid(base));
//
// Set the prescaler for the module clock.
//
modPrescale = (sysclkHz / moduleFrequency) - 1U;
HWREGH(base + I2C_O_PSC) = I2C_PSC_IPSC_M & modPrescale;
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,916 @@
//###########################################################################
//
// FILE: hw_adc.h
//
// TITLE: Definitions for the ADC 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 HW_ADC_H
#define HW_ADC_H
//*************************************************************************************************
//
// The following are defines for the ADC register offsets
//
//*************************************************************************************************
#define ADC_O_CTL1 0x0U // ADC Control 1 Register
#define ADC_O_CTL2 0x1U // ADC Control 2 Register
#define ADC_O_BURSTCTL 0x2U // ADC Burst Control Register
#define ADC_O_INTFLG 0x3U // ADC Interrupt Flag Register
#define ADC_O_INTFLGCLR 0x4U // ADC Interrupt Flag Clear Register
#define ADC_O_INTOVF 0x5U // ADC Interrupt Overflow Register
#define ADC_O_INTOVFCLR 0x6U // ADC Interrupt Overflow Clear Register
#define ADC_O_INTSEL1N2 0x7U // ADC Interrupt 1 and 2 Selection Register
#define ADC_O_INTSEL3N4 0x8U // ADC Interrupt 3 and 4 Selection Register
#define ADC_O_SOCPRICTL 0x9U // ADC SOC Priority Control Register
#define ADC_O_INTSOCSEL1 0xAU // ADC Interrupt SOC Selection 1 Register
#define ADC_O_INTSOCSEL2 0xBU // ADC Interrupt SOC Selection 2 Register
#define ADC_O_SOCFLG1 0xCU // ADC SOC Flag 1 Register
#define ADC_O_SOCFRC1 0xDU // ADC SOC Force 1 Register
#define ADC_O_SOCOVF1 0xEU // ADC SOC Overflow 1 Register
#define ADC_O_SOCOVFCLR1 0xFU // ADC SOC Overflow Clear 1 Register
#define ADC_O_SOC0CTL 0x10U // ADC SOC0 Control Register
#define ADC_O_SOC1CTL 0x12U // ADC SOC1 Control Register
#define ADC_O_SOC2CTL 0x14U // ADC SOC2 Control Register
#define ADC_O_SOC3CTL 0x16U // ADC SOC3 Control Register
#define ADC_O_SOC4CTL 0x18U // ADC SOC4 Control Register
#define ADC_O_SOC5CTL 0x1AU // ADC SOC5 Control Register
#define ADC_O_SOC6CTL 0x1CU // ADC SOC6 Control Register
#define ADC_O_SOC7CTL 0x1EU // ADC SOC7 Control Register
#define ADC_O_SOC8CTL 0x20U // ADC SOC8 Control Register
#define ADC_O_SOC9CTL 0x22U // ADC SOC9 Control Register
#define ADC_O_SOC10CTL 0x24U // ADC SOC10 Control Register
#define ADC_O_SOC11CTL 0x26U // ADC SOC11 Control Register
#define ADC_O_SOC12CTL 0x28U // ADC SOC12 Control Register
#define ADC_O_SOC13CTL 0x2AU // ADC SOC13 Control Register
#define ADC_O_SOC14CTL 0x2CU // ADC SOC14 Control Register
#define ADC_O_SOC15CTL 0x2EU // ADC SOC15 Control Register
#define ADC_O_EVTSTAT 0x30U // ADC Event Status Register
#define ADC_O_EVTCLR 0x32U // ADC Event Clear Register
#define ADC_O_EVTSEL 0x34U // ADC Event Selection Register
#define ADC_O_EVTINTSEL 0x36U // ADC Event Interrupt Selection Register
#define ADC_O_OSDETECT 0x38U // ADC Open and Shorts Detect Register
#define ADC_O_COUNTER 0x39U // ADC Counter Register
#define ADC_O_REV 0x3AU // ADC Revision Register
#define ADC_O_OFFTRIM 0x3BU // ADC Offset Trim Register
#define ADC_O_PPB1CONFIG 0x40U // ADC PPB1 Config Register
#define ADC_O_PPB1STAMP 0x41U // ADC PPB1 Sample Delay Time Stamp Register
#define ADC_O_PPB1OFFCAL 0x42U // ADC PPB1 Offset Calibration Register
#define ADC_O_PPB1OFFREF 0x43U // ADC PPB1 Offset Reference Register
#define ADC_O_PPB1TRIPHI 0x44U // ADC PPB1 Trip High Register
#define ADC_O_PPB1TRIPLO 0x46U // ADC PPB1 Trip Low/Trigger Time Stamp Register
#define ADC_O_PPB2CONFIG 0x48U // ADC PPB2 Config Register
#define ADC_O_PPB2STAMP 0x49U // ADC PPB2 Sample Delay Time Stamp Register
#define ADC_O_PPB2OFFCAL 0x4AU // ADC PPB2 Offset Calibration Register
#define ADC_O_PPB2OFFREF 0x4BU // ADC PPB2 Offset Reference Register
#define ADC_O_PPB2TRIPHI 0x4CU // ADC PPB2 Trip High Register
#define ADC_O_PPB2TRIPLO 0x4EU // ADC PPB2 Trip Low/Trigger Time Stamp Register
#define ADC_O_PPB3CONFIG 0x50U // ADC PPB3 Config Register
#define ADC_O_PPB3STAMP 0x51U // ADC PPB3 Sample Delay Time Stamp Register
#define ADC_O_PPB3OFFCAL 0x52U // ADC PPB3 Offset Calibration Register
#define ADC_O_PPB3OFFREF 0x53U // ADC PPB3 Offset Reference Register
#define ADC_O_PPB3TRIPHI 0x54U // ADC PPB3 Trip High Register
#define ADC_O_PPB3TRIPLO 0x56U // ADC PPB3 Trip Low/Trigger Time Stamp Register
#define ADC_O_PPB4CONFIG 0x58U // ADC PPB4 Config Register
#define ADC_O_PPB4STAMP 0x59U // ADC PPB4 Sample Delay Time Stamp Register
#define ADC_O_PPB4OFFCAL 0x5AU // ADC PPB4 Offset Calibration Register
#define ADC_O_PPB4OFFREF 0x5BU // ADC PPB4 Offset Reference Register
#define ADC_O_PPB4TRIPHI 0x5CU // ADC PPB4 Trip High Register
#define ADC_O_PPB4TRIPLO 0x5EU // ADC PPB4 Trip Low/Trigger Time Stamp Register
#define ADC_O_INTCYCLE 0x6FU // ADC Early Interrupt Generation Cycle
#define ADC_O_INLTRIM1 0x70U // ADC Linearity Trim 1 Register
#define ADC_O_INLTRIM2 0x72U // ADC Linearity Trim 2 Register
#define ADC_O_INLTRIM3 0x74U // ADC Linearity Trim 3 Register
#define ADC_O_INLTRIM4 0x76U // ADC Linearity Trim 4 Register
#define ADC_O_INLTRIM5 0x78U // ADC Linearity Trim 5 Register
#define ADC_O_INLTRIM6 0x7AU // ADC Linearity Trim 6 Register
#define ADC_O_RESULT0 0x0U // ADC Result 0 Register
#define ADC_O_RESULT1 0x1U // ADC Result 1 Register
#define ADC_O_RESULT2 0x2U // ADC Result 2 Register
#define ADC_O_RESULT3 0x3U // ADC Result 3 Register
#define ADC_O_RESULT4 0x4U // ADC Result 4 Register
#define ADC_O_RESULT5 0x5U // ADC Result 5 Register
#define ADC_O_RESULT6 0x6U // ADC Result 6 Register
#define ADC_O_RESULT7 0x7U // ADC Result 7 Register
#define ADC_O_RESULT8 0x8U // ADC Result 8 Register
#define ADC_O_RESULT9 0x9U // ADC Result 9 Register
#define ADC_O_RESULT10 0xAU // ADC Result 10 Register
#define ADC_O_RESULT11 0xBU // ADC Result 11 Register
#define ADC_O_RESULT12 0xCU // ADC Result 12 Register
#define ADC_O_RESULT13 0xDU // ADC Result 13 Register
#define ADC_O_RESULT14 0xEU // ADC Result 14 Register
#define ADC_O_RESULT15 0xFU // ADC Result 15 Register
#define ADC_O_PPB1RESULT 0x10U // ADC Post Processing Block 1 Result Register
#define ADC_O_PPB2RESULT 0x12U // ADC Post Processing Block 2 Result Register
#define ADC_O_PPB3RESULT 0x14U // ADC Post Processing Block 3 Result Register
#define ADC_O_PPB4RESULT 0x16U // ADC Post Processing Block 4 Result Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCCTL1 register
//
//*************************************************************************************************
#define ADC_CTL1_INTPULSEPOS 0x4U // ADC Interrupt Pulse Position
#define ADC_CTL1_ADCPWDNZ 0x80U // ADC Power Down
#define ADC_CTL1_ADCBSYCHN_S 8U
#define ADC_CTL1_ADCBSYCHN_M 0xF00U // ADC Busy Channel
#define ADC_CTL1_ADCBSY 0x2000U // ADC Busy
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCCTL2 register
//
//*************************************************************************************************
#define ADC_CTL2_PRESCALE_S 0U
#define ADC_CTL2_PRESCALE_M 0xFU // ADC Clock Prescaler
#define ADC_CTL2_RESOLUTION 0x40U // SOC Conversion Resolution
#define ADC_CTL2_SIGNALMODE 0x80U // SOC Signaling Mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCBURSTCTL register
//
//*************************************************************************************************
#define ADC_BURSTCTL_BURSTTRIGSEL_S 0U
#define ADC_BURSTCTL_BURSTTRIGSEL_M 0x3FU // SOC Burst Trigger Source Select
#define ADC_BURSTCTL_BURSTSIZE_S 8U
#define ADC_BURSTCTL_BURSTSIZE_M 0xF00U // SOC Burst Size Select
#define ADC_BURSTCTL_BURSTEN 0x8000U // SOC Burst Mode Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCINTFLG register
//
//*************************************************************************************************
#define ADC_INTFLG_ADCINT1 0x1U // ADC Interrupt 1 Flag
#define ADC_INTFLG_ADCINT2 0x2U // ADC Interrupt 2 Flag
#define ADC_INTFLG_ADCINT3 0x4U // ADC Interrupt 3 Flag
#define ADC_INTFLG_ADCINT4 0x8U // ADC Interrupt 4 Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCINTFLGCLR register
//
//*************************************************************************************************
#define ADC_INTFLGCLR_ADCINT1 0x1U // ADC Interrupt 1 Flag Clear
#define ADC_INTFLGCLR_ADCINT2 0x2U // ADC Interrupt 2 Flag Clear
#define ADC_INTFLGCLR_ADCINT3 0x4U // ADC Interrupt 3 Flag Clear
#define ADC_INTFLGCLR_ADCINT4 0x8U // ADC Interrupt 4 Flag Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCINTOVF register
//
//*************************************************************************************************
#define ADC_INTOVF_ADCINT1 0x1U // ADC Interrupt 1 Overflow Flags
#define ADC_INTOVF_ADCINT2 0x2U // ADC Interrupt 2 Overflow Flags
#define ADC_INTOVF_ADCINT3 0x4U // ADC Interrupt 3 Overflow Flags
#define ADC_INTOVF_ADCINT4 0x8U // ADC Interrupt 4 Overflow Flags
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCINTOVFCLR register
//
//*************************************************************************************************
#define ADC_INTOVFCLR_ADCINT1 0x1U // ADC Interrupt 1 Overflow Clear Bits
#define ADC_INTOVFCLR_ADCINT2 0x2U // ADC Interrupt 2 Overflow Clear Bits
#define ADC_INTOVFCLR_ADCINT3 0x4U // ADC Interrupt 3 Overflow Clear Bits
#define ADC_INTOVFCLR_ADCINT4 0x8U // ADC Interrupt 4 Overflow Clear Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCINTSEL1N2 register
//
//*************************************************************************************************
#define ADC_INTSEL1N2_INT1SEL_S 0U
#define ADC_INTSEL1N2_INT1SEL_M 0xFU // ADCINT1 EOC Source Select
#define ADC_INTSEL1N2_INT1E 0x20U // ADCINT1 Interrupt Enable
#define ADC_INTSEL1N2_INT1CONT 0x40U // ADCINT1 Continue to Interrupt Mode
#define ADC_INTSEL1N2_INT2SEL_S 8U
#define ADC_INTSEL1N2_INT2SEL_M 0xF00U // ADCINT2 EOC Source Select
#define ADC_INTSEL1N2_INT2E 0x2000U // ADCINT2 Interrupt Enable
#define ADC_INTSEL1N2_INT2CONT 0x4000U // ADCINT2 Continue to Interrupt Mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCINTSEL3N4 register
//
//*************************************************************************************************
#define ADC_INTSEL3N4_INT3SEL_S 0U
#define ADC_INTSEL3N4_INT3SEL_M 0xFU // ADCINT3 EOC Source Select
#define ADC_INTSEL3N4_INT3E 0x20U // ADCINT3 Interrupt Enable
#define ADC_INTSEL3N4_INT3CONT 0x40U // ADCINT3 Continue to Interrupt Mode
#define ADC_INTSEL3N4_INT4SEL_S 8U
#define ADC_INTSEL3N4_INT4SEL_M 0xF00U // ADCINT4 EOC Source Select
#define ADC_INTSEL3N4_INT4E 0x2000U // ADCINT4 Interrupt Enable
#define ADC_INTSEL3N4_INT4CONT 0x4000U // ADCINT4 Continue to Interrupt Mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOCPRICTL register
//
//*************************************************************************************************
#define ADC_SOCPRICTL_SOCPRIORITY_S 0U
#define ADC_SOCPRICTL_SOCPRIORITY_M 0x1FU // SOC Priority
#define ADC_SOCPRICTL_RRPOINTER_S 5U
#define ADC_SOCPRICTL_RRPOINTER_M 0x3E0U // Round Robin Pointer
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCINTSOCSEL1 register
//
//*************************************************************************************************
#define ADC_INTSOCSEL1_SOC0_S 0U
#define ADC_INTSOCSEL1_SOC0_M 0x3U // SOC0 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL1_SOC1_S 2U
#define ADC_INTSOCSEL1_SOC1_M 0xCU // SOC1 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL1_SOC2_S 4U
#define ADC_INTSOCSEL1_SOC2_M 0x30U // SOC2 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL1_SOC3_S 6U
#define ADC_INTSOCSEL1_SOC3_M 0xC0U // SOC3 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL1_SOC4_S 8U
#define ADC_INTSOCSEL1_SOC4_M 0x300U // SOC4 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL1_SOC5_S 10U
#define ADC_INTSOCSEL1_SOC5_M 0xC00U // SOC5 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL1_SOC6_S 12U
#define ADC_INTSOCSEL1_SOC6_M 0x3000U // SOC6 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL1_SOC7_S 14U
#define ADC_INTSOCSEL1_SOC7_M 0xC000U // SOC7 ADC Interrupt Trigger Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCINTSOCSEL2 register
//
//*************************************************************************************************
#define ADC_INTSOCSEL2_SOC8_S 0U
#define ADC_INTSOCSEL2_SOC8_M 0x3U // SOC8 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL2_SOC9_S 2U
#define ADC_INTSOCSEL2_SOC9_M 0xCU // SOC9 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL2_SOC10_S 4U
#define ADC_INTSOCSEL2_SOC10_M 0x30U // SOC10 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL2_SOC11_S 6U
#define ADC_INTSOCSEL2_SOC11_M 0xC0U // SOC11 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL2_SOC12_S 8U
#define ADC_INTSOCSEL2_SOC12_M 0x300U // SOC12 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL2_SOC13_S 10U
#define ADC_INTSOCSEL2_SOC13_M 0xC00U // SOC13 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL2_SOC14_S 12U
#define ADC_INTSOCSEL2_SOC14_M 0x3000U // SOC14 ADC Interrupt Trigger Select
#define ADC_INTSOCSEL2_SOC15_S 14U
#define ADC_INTSOCSEL2_SOC15_M 0xC000U // SOC15 ADC Interrupt Trigger Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOCFLG1 register
//
//*************************************************************************************************
#define ADC_SOCFLG1_SOC0 0x1U // SOC0 Start of Conversion Flag
#define ADC_SOCFLG1_SOC1 0x2U // SOC1 Start of Conversion Flag
#define ADC_SOCFLG1_SOC2 0x4U // SOC2 Start of Conversion Flag
#define ADC_SOCFLG1_SOC3 0x8U // SOC3 Start of Conversion Flag
#define ADC_SOCFLG1_SOC4 0x10U // SOC4 Start of Conversion Flag
#define ADC_SOCFLG1_SOC5 0x20U // SOC5 Start of Conversion Flag
#define ADC_SOCFLG1_SOC6 0x40U // SOC6 Start of Conversion Flag
#define ADC_SOCFLG1_SOC7 0x80U // SOC7 Start of Conversion Flag
#define ADC_SOCFLG1_SOC8 0x100U // SOC8 Start of Conversion Flag
#define ADC_SOCFLG1_SOC9 0x200U // SOC9 Start of Conversion Flag
#define ADC_SOCFLG1_SOC10 0x400U // SOC10 Start of Conversion Flag
#define ADC_SOCFLG1_SOC11 0x800U // SOC11 Start of Conversion Flag
#define ADC_SOCFLG1_SOC12 0x1000U // SOC12 Start of Conversion Flag
#define ADC_SOCFLG1_SOC13 0x2000U // SOC13 Start of Conversion Flag
#define ADC_SOCFLG1_SOC14 0x4000U // SOC14 Start of Conversion Flag
#define ADC_SOCFLG1_SOC15 0x8000U // SOC15 Start of Conversion Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOCFRC1 register
//
//*************************************************************************************************
#define ADC_SOCFRC1_SOC0 0x1U // SOC0 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC1 0x2U // SOC1 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC2 0x4U // SOC2 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC3 0x8U // SOC3 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC4 0x10U // SOC4 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC5 0x20U // SOC5 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC6 0x40U // SOC6 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC7 0x80U // SOC7 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC8 0x100U // SOC8 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC9 0x200U // SOC9 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC10 0x400U // SOC10 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC11 0x800U // SOC11 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC12 0x1000U // SOC12 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC13 0x2000U // SOC13 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC14 0x4000U // SOC14 Force Start of Conversion Bit
#define ADC_SOCFRC1_SOC15 0x8000U // SOC15 Force Start of Conversion Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOCOVF1 register
//
//*************************************************************************************************
#define ADC_SOCOVF1_SOC0 0x1U // SOC0 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC1 0x2U // SOC1 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC2 0x4U // SOC2 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC3 0x8U // SOC3 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC4 0x10U // SOC4 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC5 0x20U // SOC5 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC6 0x40U // SOC6 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC7 0x80U // SOC7 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC8 0x100U // SOC8 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC9 0x200U // SOC9 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC10 0x400U // SOC10 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC11 0x800U // SOC11 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC12 0x1000U // SOC12 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC13 0x2000U // SOC13 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC14 0x4000U // SOC14 Start of Conversion Overflow Flag
#define ADC_SOCOVF1_SOC15 0x8000U // SOC15 Start of Conversion Overflow Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOCOVFCLR1 register
//
//*************************************************************************************************
#define ADC_SOCOVFCLR1_SOC0 0x1U // SOC0 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC1 0x2U // SOC1 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC2 0x4U // SOC2 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC3 0x8U // SOC3 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC4 0x10U // SOC4 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC5 0x20U // SOC5 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC6 0x40U // SOC6 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC7 0x80U // SOC7 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC8 0x100U // SOC8 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC9 0x200U // SOC9 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC10 0x400U // SOC10 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC11 0x800U // SOC11 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC12 0x1000U // SOC12 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC13 0x2000U // SOC13 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC14 0x4000U // SOC14 Clear Start of Conversion Overflow Bit
#define ADC_SOCOVFCLR1_SOC15 0x8000U // SOC15 Clear Start of Conversion Overflow Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC0CTL register
//
//*************************************************************************************************
#define ADC_SOC0CTL_ACQPS_S 0U
#define ADC_SOC0CTL_ACQPS_M 0x1FFU // SOC0 Acquisition Prescale
#define ADC_SOC0CTL_CHSEL_S 15U
#define ADC_SOC0CTL_CHSEL_M 0x78000U // SOC0 Channel Select
#define ADC_SOC0CTL_TRIGSEL_S 20U
#define ADC_SOC0CTL_TRIGSEL_M 0x3F00000U // SOC0 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC1CTL register
//
//*************************************************************************************************
#define ADC_SOC1CTL_ACQPS_S 0U
#define ADC_SOC1CTL_ACQPS_M 0x1FFU // SOC1 Acquisition Prescale
#define ADC_SOC1CTL_CHSEL_S 15U
#define ADC_SOC1CTL_CHSEL_M 0x78000U // SOC1 Channel Select
#define ADC_SOC1CTL_TRIGSEL_S 20U
#define ADC_SOC1CTL_TRIGSEL_M 0x3F00000U // SOC1 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC2CTL register
//
//*************************************************************************************************
#define ADC_SOC2CTL_ACQPS_S 0U
#define ADC_SOC2CTL_ACQPS_M 0x1FFU // SOC2 Acquisition Prescale
#define ADC_SOC2CTL_CHSEL_S 15U
#define ADC_SOC2CTL_CHSEL_M 0x78000U // SOC2 Channel Select
#define ADC_SOC2CTL_TRIGSEL_S 20U
#define ADC_SOC2CTL_TRIGSEL_M 0x3F00000U // SOC2 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC3CTL register
//
//*************************************************************************************************
#define ADC_SOC3CTL_ACQPS_S 0U
#define ADC_SOC3CTL_ACQPS_M 0x1FFU // SOC3 Acquisition Prescale
#define ADC_SOC3CTL_CHSEL_S 15U
#define ADC_SOC3CTL_CHSEL_M 0x78000U // SOC3 Channel Select
#define ADC_SOC3CTL_TRIGSEL_S 20U
#define ADC_SOC3CTL_TRIGSEL_M 0x3F00000U // SOC3 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC4CTL register
//
//*************************************************************************************************
#define ADC_SOC4CTL_ACQPS_S 0U
#define ADC_SOC4CTL_ACQPS_M 0x1FFU // SOC4 Acquisition Prescale
#define ADC_SOC4CTL_CHSEL_S 15U
#define ADC_SOC4CTL_CHSEL_M 0x78000U // SOC4 Channel Select
#define ADC_SOC4CTL_TRIGSEL_S 20U
#define ADC_SOC4CTL_TRIGSEL_M 0x3F00000U // SOC4 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC5CTL register
//
//*************************************************************************************************
#define ADC_SOC5CTL_ACQPS_S 0U
#define ADC_SOC5CTL_ACQPS_M 0x1FFU // SOC5 Acquisition Prescale
#define ADC_SOC5CTL_CHSEL_S 15U
#define ADC_SOC5CTL_CHSEL_M 0x78000U // SOC5 Channel Select
#define ADC_SOC5CTL_TRIGSEL_S 20U
#define ADC_SOC5CTL_TRIGSEL_M 0x3F00000U // SOC5 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC6CTL register
//
//*************************************************************************************************
#define ADC_SOC6CTL_ACQPS_S 0U
#define ADC_SOC6CTL_ACQPS_M 0x1FFU // SOC6 Acquisition Prescale
#define ADC_SOC6CTL_CHSEL_S 15U
#define ADC_SOC6CTL_CHSEL_M 0x78000U // SOC6 Channel Select
#define ADC_SOC6CTL_TRIGSEL_S 20U
#define ADC_SOC6CTL_TRIGSEL_M 0x3F00000U // SOC6 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC7CTL register
//
//*************************************************************************************************
#define ADC_SOC7CTL_ACQPS_S 0U
#define ADC_SOC7CTL_ACQPS_M 0x1FFU // SOC7 Acquisition Prescale
#define ADC_SOC7CTL_CHSEL_S 15U
#define ADC_SOC7CTL_CHSEL_M 0x78000U // SOC7 Channel Select
#define ADC_SOC7CTL_TRIGSEL_S 20U
#define ADC_SOC7CTL_TRIGSEL_M 0x3F00000U // SOC7 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC8CTL register
//
//*************************************************************************************************
#define ADC_SOC8CTL_ACQPS_S 0U
#define ADC_SOC8CTL_ACQPS_M 0x1FFU // SOC8 Acquisition Prescale
#define ADC_SOC8CTL_CHSEL_S 15U
#define ADC_SOC8CTL_CHSEL_M 0x78000U // SOC8 Channel Select
#define ADC_SOC8CTL_TRIGSEL_S 20U
#define ADC_SOC8CTL_TRIGSEL_M 0x3F00000U // SOC8 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC9CTL register
//
//*************************************************************************************************
#define ADC_SOC9CTL_ACQPS_S 0U
#define ADC_SOC9CTL_ACQPS_M 0x1FFU // SOC9 Acquisition Prescale
#define ADC_SOC9CTL_CHSEL_S 15U
#define ADC_SOC9CTL_CHSEL_M 0x78000U // SOC9 Channel Select
#define ADC_SOC9CTL_TRIGSEL_S 20U
#define ADC_SOC9CTL_TRIGSEL_M 0x3F00000U // SOC9 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC10CTL register
//
//*************************************************************************************************
#define ADC_SOC10CTL_ACQPS_S 0U
#define ADC_SOC10CTL_ACQPS_M 0x1FFU // SOC10 Acquisition Prescale
#define ADC_SOC10CTL_CHSEL_S 15U
#define ADC_SOC10CTL_CHSEL_M 0x78000U // SOC10 Channel Select
#define ADC_SOC10CTL_TRIGSEL_S 20U
#define ADC_SOC10CTL_TRIGSEL_M 0x3F00000U // SOC10 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC11CTL register
//
//*************************************************************************************************
#define ADC_SOC11CTL_ACQPS_S 0U
#define ADC_SOC11CTL_ACQPS_M 0x1FFU // SOC11 Acquisition Prescale
#define ADC_SOC11CTL_CHSEL_S 15U
#define ADC_SOC11CTL_CHSEL_M 0x78000U // SOC11 Channel Select
#define ADC_SOC11CTL_TRIGSEL_S 20U
#define ADC_SOC11CTL_TRIGSEL_M 0x3F00000U // SOC11 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC12CTL register
//
//*************************************************************************************************
#define ADC_SOC12CTL_ACQPS_S 0U
#define ADC_SOC12CTL_ACQPS_M 0x1FFU // SOC12 Acquisition Prescale
#define ADC_SOC12CTL_CHSEL_S 15U
#define ADC_SOC12CTL_CHSEL_M 0x78000U // SOC12 Channel Select
#define ADC_SOC12CTL_TRIGSEL_S 20U
#define ADC_SOC12CTL_TRIGSEL_M 0x3F00000U // SOC12 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC13CTL register
//
//*************************************************************************************************
#define ADC_SOC13CTL_ACQPS_S 0U
#define ADC_SOC13CTL_ACQPS_M 0x1FFU // SOC13 Acquisition Prescale
#define ADC_SOC13CTL_CHSEL_S 15U
#define ADC_SOC13CTL_CHSEL_M 0x78000U // SOC13 Channel Select
#define ADC_SOC13CTL_TRIGSEL_S 20U
#define ADC_SOC13CTL_TRIGSEL_M 0x3F00000U // SOC13 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC14CTL register
//
//*************************************************************************************************
#define ADC_SOC14CTL_ACQPS_S 0U
#define ADC_SOC14CTL_ACQPS_M 0x1FFU // SOC14 Acquisition Prescale
#define ADC_SOC14CTL_CHSEL_S 15U
#define ADC_SOC14CTL_CHSEL_M 0x78000U // SOC14 Channel Select
#define ADC_SOC14CTL_TRIGSEL_S 20U
#define ADC_SOC14CTL_TRIGSEL_M 0x3F00000U // SOC14 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCSOC15CTL register
//
//*************************************************************************************************
#define ADC_SOC15CTL_ACQPS_S 0U
#define ADC_SOC15CTL_ACQPS_M 0x1FFU // SOC15 Acquisition Prescale
#define ADC_SOC15CTL_CHSEL_S 15U
#define ADC_SOC15CTL_CHSEL_M 0x78000U // SOC15 Channel Select
#define ADC_SOC15CTL_TRIGSEL_S 20U
#define ADC_SOC15CTL_TRIGSEL_M 0x3F00000U // SOC15 Trigger Source Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCEVTSTAT register
//
//*************************************************************************************************
#define ADC_EVTSTAT_PPB1TRIPHI 0x1U // Post Processing Block 1 Trip High Flag
#define ADC_EVTSTAT_PPB1TRIPLO 0x2U // Post Processing Block 1 Trip Low Flag
#define ADC_EVTSTAT_PPB1ZERO 0x4U // Post Processing Block 1 Zero Crossing Flag
#define ADC_EVTSTAT_PPB2TRIPHI 0x10U // Post Processing Block 2 Trip High Flag
#define ADC_EVTSTAT_PPB2TRIPLO 0x20U // Post Processing Block 2 Trip Low Flag
#define ADC_EVTSTAT_PPB2ZERO 0x40U // Post Processing Block 2 Zero Crossing Flag
#define ADC_EVTSTAT_PPB3TRIPHI 0x100U // Post Processing Block 3 Trip High Flag
#define ADC_EVTSTAT_PPB3TRIPLO 0x200U // Post Processing Block 3 Trip Low Flag
#define ADC_EVTSTAT_PPB3ZERO 0x400U // Post Processing Block 3 Zero Crossing Flag
#define ADC_EVTSTAT_PPB4TRIPHI 0x1000U // Post Processing Block 4 Trip High Flag
#define ADC_EVTSTAT_PPB4TRIPLO 0x2000U // Post Processing Block 4 Trip Low Flag
#define ADC_EVTSTAT_PPB4ZERO 0x4000U // Post Processing Block 4 Zero Crossing Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCEVTCLR register
//
//*************************************************************************************************
#define ADC_EVTCLR_PPB1TRIPHI 0x1U // Post Processing Block 1 Trip High Clear
#define ADC_EVTCLR_PPB1TRIPLO 0x2U // Post Processing Block 1 Trip Low Clear
#define ADC_EVTCLR_PPB1ZERO 0x4U // Post Processing Block 1 Zero Crossing Clear
#define ADC_EVTCLR_PPB2TRIPHI 0x10U // Post Processing Block 2 Trip High Clear
#define ADC_EVTCLR_PPB2TRIPLO 0x20U // Post Processing Block 2 Trip Low Clear
#define ADC_EVTCLR_PPB2ZERO 0x40U // Post Processing Block 2 Zero Crossing Clear
#define ADC_EVTCLR_PPB3TRIPHI 0x100U // Post Processing Block 3 Trip High Clear
#define ADC_EVTCLR_PPB3TRIPLO 0x200U // Post Processing Block 3 Trip Low Clear
#define ADC_EVTCLR_PPB3ZERO 0x400U // Post Processing Block 3 Zero Crossing Clear
#define ADC_EVTCLR_PPB4TRIPHI 0x1000U // Post Processing Block 4 Trip High Clear
#define ADC_EVTCLR_PPB4TRIPLO 0x2000U // Post Processing Block 4 Trip Low Clear
#define ADC_EVTCLR_PPB4ZERO 0x4000U // Post Processing Block 4 Zero Crossing Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCEVTSEL register
//
//*************************************************************************************************
#define ADC_EVTSEL_PPB1TRIPHI 0x1U // Post Processing Block 1 Trip High Event Enable
#define ADC_EVTSEL_PPB1TRIPLO 0x2U // Post Processing Block 1 Trip Low Event Enable
#define ADC_EVTSEL_PPB1ZERO 0x4U // Post Processing Block 1 Zero Crossing Event Enable
#define ADC_EVTSEL_PPB2TRIPHI 0x10U // Post Processing Block 2 Trip High Event Enable
#define ADC_EVTSEL_PPB2TRIPLO 0x20U // Post Processing Block 2 Trip Low Event Enable
#define ADC_EVTSEL_PPB2ZERO 0x40U // Post Processing Block 2 Zero Crossing Event Enable
#define ADC_EVTSEL_PPB3TRIPHI 0x100U // Post Processing Block 3 Trip High Event Enable
#define ADC_EVTSEL_PPB3TRIPLO 0x200U // Post Processing Block 3 Trip Low Event Enable
#define ADC_EVTSEL_PPB3ZERO 0x400U // Post Processing Block 3 Zero Crossing Event Enable
#define ADC_EVTSEL_PPB4TRIPHI 0x1000U // Post Processing Block 4 Trip High Event Enable
#define ADC_EVTSEL_PPB4TRIPLO 0x2000U // Post Processing Block 4 Trip Low Event Enable
#define ADC_EVTSEL_PPB4ZERO 0x4000U // Post Processing Block 4 Zero Crossing Event Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCEVTINTSEL register
//
//*************************************************************************************************
#define ADC_EVTINTSEL_PPB1TRIPHI 0x1U // Post Processing Block 1 Trip High Interrupt Enable
#define ADC_EVTINTSEL_PPB1TRIPLO 0x2U // Post Processing Block 1 Trip Low Interrupt Enable
#define ADC_EVTINTSEL_PPB1ZERO 0x4U // Post Processing Block 1 Zero Crossing Interrupt
// Enable
#define ADC_EVTINTSEL_PPB2TRIPHI 0x10U // Post Processing Block 2 Trip High Interrupt Enable
#define ADC_EVTINTSEL_PPB2TRIPLO 0x20U // Post Processing Block 2 Trip Low Interrupt Enable
#define ADC_EVTINTSEL_PPB2ZERO 0x40U // Post Processing Block 2 Zero Crossing Interrupt
// Enable
#define ADC_EVTINTSEL_PPB3TRIPHI 0x100U // Post Processing Block 3 Trip High Interrupt Enable
#define ADC_EVTINTSEL_PPB3TRIPLO 0x200U // Post Processing Block 3 Trip Low Interrupt Enable
#define ADC_EVTINTSEL_PPB3ZERO 0x400U // Post Processing Block 3 Zero Crossing Interrupt
// Enable
#define ADC_EVTINTSEL_PPB4TRIPHI 0x1000U // Post Processing Block 4 Trip High Interrupt Enable
#define ADC_EVTINTSEL_PPB4TRIPLO 0x2000U // Post Processing Block 4 Trip Low Interrupt Enable
#define ADC_EVTINTSEL_PPB4ZERO 0x4000U // Post Processing Block 4 Zero Crossing Interrupt
// Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCOSDETECT register
//
//*************************************************************************************************
#define ADC_OSDETECT_DETECTCFG_S 0U
#define ADC_OSDETECT_DETECTCFG_M 0x7U // ADC Opens and Shorts Detect Configuration
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCCOUNTER register
//
//*************************************************************************************************
#define ADC_COUNTER_FREECOUNT_S 0U
#define ADC_COUNTER_FREECOUNT_M 0xFFFU // ADC Free Running Counter Value
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCREV register
//
//*************************************************************************************************
#define ADC_REV_TYPE_S 0U
#define ADC_REV_TYPE_M 0xFFU // ADC Type
#define ADC_REV_REV_S 8U
#define ADC_REV_REV_M 0xFF00U // ADC Revision
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCOFFTRIM register
//
//*************************************************************************************************
#define ADC_OFFTRIM_OFFTRIM_S 0U
#define ADC_OFFTRIM_OFFTRIM_M 0xFFU // ADC Offset Trim
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB1CONFIG register
//
//*************************************************************************************************
#define ADC_PPB1CONFIG_CONFIG_S 0U
#define ADC_PPB1CONFIG_CONFIG_M 0xFU // ADC Post Processing Block 1 Configuration
#define ADC_PPB1CONFIG_TWOSCOMPEN 0x10U // ADC Post Processing Block 1 Two's Complement Enable
#define ADC_PPB1CONFIG_CBCEN 0x20U // Cycle By Cycle Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB1STAMP register
//
//*************************************************************************************************
#define ADC_PPB1STAMP_DLYSTAMP_S 0U
#define ADC_PPB1STAMP_DLYSTAMP_M 0xFFFU // ADC Post Processing Block 1 Delay Time Stamp
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB1OFFCAL register
//
//*************************************************************************************************
#define ADC_PPB1OFFCAL_OFFCAL_S 0U
#define ADC_PPB1OFFCAL_OFFCAL_M 0x3FFU // ADC Post Processing Block Offset Correction
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB1TRIPHI register
//
//*************************************************************************************************
#define ADC_PPB1TRIPHI_LIMITHI_S 0U
#define ADC_PPB1TRIPHI_LIMITHI_M 0xFFFFU // ADC Post Processing Block 1 Trip High Limit
#define ADC_PPB1TRIPHI_HSIGN 0x10000U // High Limit Sign Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB1TRIPLO register
//
//*************************************************************************************************
#define ADC_PPB1TRIPLO_LIMITLO_S 0U
#define ADC_PPB1TRIPLO_LIMITLO_M 0xFFFFU // ADC Post Processing Block 1 Trip Low Limit
#define ADC_PPB1TRIPLO_LSIGN 0x10000U // Low Limit Sign Bit
#define ADC_PPB1TRIPLO_REQSTAMP_S 20U
#define ADC_PPB1TRIPLO_REQSTAMP_M 0xFFF00000U // ADC Post Processing Block 1 Request Time Stamp
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB2CONFIG register
//
//*************************************************************************************************
#define ADC_PPB2CONFIG_CONFIG_S 0U
#define ADC_PPB2CONFIG_CONFIG_M 0xFU // ADC Post Processing Block 2 Configuration
#define ADC_PPB2CONFIG_TWOSCOMPEN 0x10U // ADC Post Processing Block 2 Two's Complement Enable
#define ADC_PPB2CONFIG_CBCEN 0x20U // Cycle By Cycle Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB2STAMP register
//
//*************************************************************************************************
#define ADC_PPB2STAMP_DLYSTAMP_S 0U
#define ADC_PPB2STAMP_DLYSTAMP_M 0xFFFU // ADC Post Processing Block 2 Delay Time Stamp
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB2OFFCAL register
//
//*************************************************************************************************
#define ADC_PPB2OFFCAL_OFFCAL_S 0U
#define ADC_PPB2OFFCAL_OFFCAL_M 0x3FFU // ADC Post Processing Block Offset Correction
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB2TRIPHI register
//
//*************************************************************************************************
#define ADC_PPB2TRIPHI_LIMITHI_S 0U
#define ADC_PPB2TRIPHI_LIMITHI_M 0xFFFFU // ADC Post Processing Block 2 Trip High Limit
#define ADC_PPB2TRIPHI_HSIGN 0x10000U // High Limit Sign Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB2TRIPLO register
//
//*************************************************************************************************
#define ADC_PPB2TRIPLO_LIMITLO_S 0U
#define ADC_PPB2TRIPLO_LIMITLO_M 0xFFFFU // ADC Post Processing Block 2 Trip Low Limit
#define ADC_PPB2TRIPLO_LSIGN 0x10000U // Low Limit Sign Bit
#define ADC_PPB2TRIPLO_REQSTAMP_S 20U
#define ADC_PPB2TRIPLO_REQSTAMP_M 0xFFF00000U // ADC Post Processing Block 2 Request Time Stamp
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB3CONFIG register
//
//*************************************************************************************************
#define ADC_PPB3CONFIG_CONFIG_S 0U
#define ADC_PPB3CONFIG_CONFIG_M 0xFU // ADC Post Processing Block 3 Configuration
#define ADC_PPB3CONFIG_TWOSCOMPEN 0x10U // ADC Post Processing Block 3 Two's Complement Enable
#define ADC_PPB3CONFIG_CBCEN 0x20U // Cycle By Cycle Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB3STAMP register
//
//*************************************************************************************************
#define ADC_PPB3STAMP_DLYSTAMP_S 0U
#define ADC_PPB3STAMP_DLYSTAMP_M 0xFFFU // ADC Post Processing Block 3 Delay Time Stamp
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB3OFFCAL register
//
//*************************************************************************************************
#define ADC_PPB3OFFCAL_OFFCAL_S 0U
#define ADC_PPB3OFFCAL_OFFCAL_M 0x3FFU // ADC Post Processing Block Offset Correction
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB3TRIPHI register
//
//*************************************************************************************************
#define ADC_PPB3TRIPHI_LIMITHI_S 0U
#define ADC_PPB3TRIPHI_LIMITHI_M 0xFFFFU // ADC Post Processing Block 3 Trip High Limit
#define ADC_PPB3TRIPHI_HSIGN 0x10000U // High Limit Sign Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB3TRIPLO register
//
//*************************************************************************************************
#define ADC_PPB3TRIPLO_LIMITLO_S 0U
#define ADC_PPB3TRIPLO_LIMITLO_M 0xFFFFU // ADC Post Processing Block 3 Trip Low Limit
#define ADC_PPB3TRIPLO_LSIGN 0x10000U // Low Limit Sign Bit
#define ADC_PPB3TRIPLO_REQSTAMP_S 20U
#define ADC_PPB3TRIPLO_REQSTAMP_M 0xFFF00000U // ADC Post Processing Block 3 Request Time Stamp
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB4CONFIG register
//
//*************************************************************************************************
#define ADC_PPB4CONFIG_CONFIG_S 0U
#define ADC_PPB4CONFIG_CONFIG_M 0xFU // ADC Post Processing Block 4 Configuration
#define ADC_PPB4CONFIG_TWOSCOMPEN 0x10U // ADC Post Processing Block 4 Two's Complement Enable
#define ADC_PPB4CONFIG_CBCEN 0x20U // Cycle By Cycle Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB4STAMP register
//
//*************************************************************************************************
#define ADC_PPB4STAMP_DLYSTAMP_S 0U
#define ADC_PPB4STAMP_DLYSTAMP_M 0xFFFU // ADC Post Processing Block 4 Delay Time Stamp
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB4OFFCAL register
//
//*************************************************************************************************
#define ADC_PPB4OFFCAL_OFFCAL_S 0U
#define ADC_PPB4OFFCAL_OFFCAL_M 0x3FFU // ADC Post Processing Block Offset Correction
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB4TRIPHI register
//
//*************************************************************************************************
#define ADC_PPB4TRIPHI_LIMITHI_S 0U
#define ADC_PPB4TRIPHI_LIMITHI_M 0xFFFFU // ADC Post Processing Block 4 Trip High Limit
#define ADC_PPB4TRIPHI_HSIGN 0x10000U // High Limit Sign Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB4TRIPLO register
//
//*************************************************************************************************
#define ADC_PPB4TRIPLO_LIMITLO_S 0U
#define ADC_PPB4TRIPLO_LIMITLO_M 0xFFFFU // ADC Post Processing Block 4 Trip Low Limit
#define ADC_PPB4TRIPLO_LSIGN 0x10000U // Low Limit Sign Bit
#define ADC_PPB4TRIPLO_REQSTAMP_S 20U
#define ADC_PPB4TRIPLO_REQSTAMP_M 0xFFF00000U // ADC Post Processing Block 4 Request Time Stamp
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB1RESULT register
//
//*************************************************************************************************
#define ADC_PPB1RESULT_PPBRESULT_S 0U
#define ADC_PPB1RESULT_PPBRESULT_M 0xFFFFU // ADC Post Processing Block Result
#define ADC_PPB1RESULT_SIGN_S 16U
#define ADC_PPB1RESULT_SIGN_M 0xFFFF0000U // Sign Extended Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB2RESULT register
//
//*************************************************************************************************
#define ADC_PPB2RESULT_PPBRESULT_S 0U
#define ADC_PPB2RESULT_PPBRESULT_M 0xFFFFU // ADC Post Processing Block Result
#define ADC_PPB2RESULT_SIGN_S 16U
#define ADC_PPB2RESULT_SIGN_M 0xFFFF0000U // Sign Extended Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB3RESULT register
//
//*************************************************************************************************
#define ADC_PPB3RESULT_PPBRESULT_S 0U
#define ADC_PPB3RESULT_PPBRESULT_M 0xFFFFU // ADC Post Processing Block Result
#define ADC_PPB3RESULT_SIGN_S 16U
#define ADC_PPB3RESULT_SIGN_M 0xFFFF0000U // Sign Extended Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the ADCPPB4RESULT register
//
//*************************************************************************************************
#define ADC_PPB4RESULT_PPBRESULT_S 0U
#define ADC_PPB4RESULT_PPBRESULT_M 0xFFFFU // ADC Post Processing Block Result
#define ADC_PPB4RESULT_SIGN_S 16U
#define ADC_PPB4RESULT_SIGN_M 0xFFFF0000U // Sign Extended Bits
#endif
@@ -0,0 +1,141 @@
//###########################################################################
//
// FILE: hw_asysctl.h
//
// TITLE: Definitions for the ASYSCTL 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 HW_ASYSCTL_H
#define HW_ASYSCTL_H
//*************************************************************************************************
//
// The following are defines for the ASYSCTL register offsets
//
//*************************************************************************************************
#define ASYSCTL_O_INTOSC1TRIM 0x20U // Internal Oscillator 1 Trim Register
#define ASYSCTL_O_INTOSC2TRIM 0x22U // Internal Oscillator 2 Trim Register
#define ASYSCTL_O_TSNSCTL 0x26U // Temperature Sensor Control Register
#define ASYSCTL_O_LOCK 0x2EU // Lock Register
#define ASYSCTL_O_ANAREFTRIMA 0x36U // Analog Reference Trim A Register
#define ASYSCTL_O_ANAREFTRIMB 0x38U // Analog Reference Trim B Register
#define ASYSCTL_O_ANAREFTRIMC 0x3AU // Analog Reference Trim C Register
#define ASYSCTL_O_ANAREFTRIMD 0x3CU // Analog Reference Trim D Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the INTOSC1TRIM register
//
//*************************************************************************************************
#define ASYSCTL_INTOSC1TRIM_VALFINETRIM_S 0U
#define ASYSCTL_INTOSC1TRIM_VALFINETRIM_M 0xFFFU // Oscillator Value Fine Trim Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the INTOSC2TRIM register
//
//*************************************************************************************************
#define ASYSCTL_INTOSC2TRIM_VALFINETRIM_S 0U
#define ASYSCTL_INTOSC2TRIM_VALFINETRIM_M 0xFFFU // Oscillator Value Fine Trim Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the TSNSCTL register
//
//*************************************************************************************************
#define ASYSCTL_TSNSCTL_ENABLE 0x1U // Temperature Sensor Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the LOCK register
//
//*************************************************************************************************
#define ASYSCTL_LOCK_TSNSCTL 0x8U // Temperature Sensor Control Register Lock
//*************************************************************************************************
//
// The following are defines for the bit fields in the ANAREFTRIMA register
//
//*************************************************************************************************
#define ASYSCTL_ANAREFTRIMA_BGVALTRIM_S 0U
#define ASYSCTL_ANAREFTRIMA_BGVALTRIM_M 0x3FU // Bandgap Value Trim
#define ASYSCTL_ANAREFTRIMA_BGSLOPETRIM_S 6U
#define ASYSCTL_ANAREFTRIMA_BGSLOPETRIM_M 0x7C0U // Bandgap Slope Trim
#define ASYSCTL_ANAREFTRIMA_IREFTRIM_S 11U
#define ASYSCTL_ANAREFTRIMA_IREFTRIM_M 0xF800U // Reference Current Trim
//*************************************************************************************************
//
// The following are defines for the bit fields in the ANAREFTRIMB register
//
//*************************************************************************************************
#define ASYSCTL_ANAREFTRIMB_BGVALTRIM_S 0U
#define ASYSCTL_ANAREFTRIMB_BGVALTRIM_M 0x3FU // Bandgap Value Trim
#define ASYSCTL_ANAREFTRIMB_BGSLOPETRIM_S 6U
#define ASYSCTL_ANAREFTRIMB_BGSLOPETRIM_M 0x7C0U // Bandgap Slope Trim
#define ASYSCTL_ANAREFTRIMB_IREFTRIM_S 11U
#define ASYSCTL_ANAREFTRIMB_IREFTRIM_M 0xF800U // Reference Current Trim
//*************************************************************************************************
//
// The following are defines for the bit fields in the ANAREFTRIMC register
//
//*************************************************************************************************
#define ASYSCTL_ANAREFTRIMC_BGVALTRIM_S 0U
#define ASYSCTL_ANAREFTRIMC_BGVALTRIM_M 0x3FU // Bandgap Value Trim
#define ASYSCTL_ANAREFTRIMC_BGSLOPETRIM_S 6U
#define ASYSCTL_ANAREFTRIMC_BGSLOPETRIM_M 0x7C0U // Bandgap Slope Trim
#define ASYSCTL_ANAREFTRIMC_IREFTRIM_S 11U
#define ASYSCTL_ANAREFTRIMC_IREFTRIM_M 0xF800U // Reference Current Trim
//*************************************************************************************************
//
// The following are defines for the bit fields in the ANAREFTRIMD register
//
//*************************************************************************************************
#define ASYSCTL_ANAREFTRIMD_BGVALTRIM_S 0U
#define ASYSCTL_ANAREFTRIMD_BGVALTRIM_M 0x3FU // Bandgap Value Trim
#define ASYSCTL_ANAREFTRIMD_BGSLOPETRIM_S 6U
#define ASYSCTL_ANAREFTRIMD_BGSLOPETRIM_M 0x7C0U // Bandgap Slope Trim
#define ASYSCTL_ANAREFTRIMD_IREFTRIM_S 11U
#define ASYSCTL_ANAREFTRIMD_IREFTRIM_M 0xF800U // Reference Current Trim
#endif
@@ -0,0 +1,239 @@
//###########################################################################
//
// FILE: hw_bgcrc.h
//
// TITLE: Definitions for the BGCRC 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 HW_BGCRC_H
#define HW_BGCRC_H
//*************************************************************************************************
//
// The following are defines for the BGCRC register offsets
//
//*************************************************************************************************
#define BGCRC_O_EN 0x0U // BGCRC Enable
#define BGCRC_O_CTRL1 0x2U // BGCRC Control register 1
#define BGCRC_O_CTRL2 0x4U // BGCRC Control register 2
#define BGCRC_O_START_ADDR 0x6U // Start address for the BGCRC check
#define BGCRC_O_SEED 0x8U // Seed for CRC calculation
#define BGCRC_O_GOLDEN 0xEU // Golden CRC to be compared against
#define BGCRC_O_RESULT 0x10U // CRC calculated
#define BGCRC_O_CURR_ADDR 0x12U // Current address regsiter
#define BGCRC_O_WD_CFG 0x1CU // BGCRC windowed watchdog configuration
#define BGCRC_O_WD_MIN 0x1EU // BGCRC windowed watchdog min value
#define BGCRC_O_WD_MAX 0x20U // BGCRC windowed watchdog max value
#define BGCRC_O_WD_CNT 0x22U // BGCRC windowed watchdog count
#define BGCRC_O_NMIFLG 0x2AU // BGCRC NMI flag register
#define BGCRC_O_NMICLR 0x2CU // BGCRC NMI flag clear register
#define BGCRC_O_NMIFRC 0x2EU // BGCRC NMI flag force register
#define BGCRC_O_INTEN 0x34U // Interrupt enable
#define BGCRC_O_INTFLG 0x36U // Interrupt flag
#define BGCRC_O_INTCLR 0x38U // Interrupt flag clear
#define BGCRC_O_INTFRC 0x3AU // Interrupt flag force
#define BGCRC_O_LOCK 0x3CU // BGCRC register map lockconfiguration
#define BGCRC_O_COMMIT 0x3EU // BGCRC register map commit configuration
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_EN register
//
//*************************************************************************************************
#define BGCRC_EN_START_S 0U
#define BGCRC_EN_START_M 0xFU // Start Bit used to Kick-off CRC calculations
#define BGCRC_EN_RUN_STS 0x80000000U // CRC module activity monitor
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_CTRL1 register
//
//*************************************************************************************************
#define BGCRC_CTRL1_FREE_SOFT 0x10U // emulation control bit
#define BGCRC_CTRL1_NMIDIS_S 16U
#define BGCRC_CTRL1_NMIDIS_M 0xF0000U // NMI disable configuration
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_CTRL2 register
//
//*************************************************************************************************
#define BGCRC_CTRL2_BLOCK_SIZE_S 0U
#define BGCRC_CTRL2_BLOCK_SIZE_M 0x3FFU // block size for memory check
#define BGCRC_CTRL2_TEST_HALT_S 12U
#define BGCRC_CTRL2_TEST_HALT_M 0xF000U // TEST_HALT configuration
#define BGCRC_CTRL2_SCRUB_MODE_S 16U
#define BGCRC_CTRL2_SCRUB_MODE_M 0xF0000U // Scrub mode configuration
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_WD_CFG register
//
//*************************************************************************************************
#define BGCRC_WD_CFG_WDDIS_S 0U
#define BGCRC_WD_CFG_WDDIS_M 0xFU // CRC Watchdog disable
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_NMIFLG register
//
//*************************************************************************************************
#define BGCRC_NMIFLG_CRC_FAIL 0x4U // CRC computation failed
#define BGCRC_NMIFLG_UNCORRECTABLE_ERR 0x8U // Uncorrectable error obtained during memory data
// read.
#define BGCRC_NMIFLG_CORRECTABLE_ERR 0x10U // Correctable ECC error obtained during memory
// data read.
#define BGCRC_NMIFLG_WD_UNDERFLOW 0x20U // CRC/scrubbing completed before BGCRC_WD_MIN
#define BGCRC_NMIFLG_WD_OVERFLOW 0x40U // CRC/scrubbing did not complete within
// BGCRC_WD_MAX
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_NMICLR register
//
//*************************************************************************************************
#define BGCRC_NMICLR_CRC_FAIL 0x4U // CRC_FAIL NMI flag clear
#define BGCRC_NMICLR_UNCORRECTABLE_ERR 0x8U // UNCORRECTABLE_ERR NMI flag clear
#define BGCRC_NMICLR_CORRECTABLE_ERR 0x10U // CORRECTABLE_ERR NMI flag clear
#define BGCRC_NMICLR_WD_UNDERFLOW 0x20U // WD_UNDERFLOW NMI flag clear
#define BGCRC_NMICLR_WD_OVERFLOW 0x40U // WD_OVERFLOW NMI flag clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_NMIFRC register
//
//*************************************************************************************************
#define BGCRC_NMIFRC_CRC_FAIL 0x4U // CRC_FAIL NMI force
#define BGCRC_NMIFRC_UNCORRECTABLE_ERR 0x8U // UNCORRECTABLE_ERR NMI force
#define BGCRC_NMIFRC_CORRECTABLE_ERR 0x10U // CORRECTABLE_ERR NMI force
#define BGCRC_NMIFRC_WD_UNDERFLOW 0x20U // WD_UNDERFLOW NMI force
#define BGCRC_NMIFRC_WD_OVERFLOW 0x40U // WD_OVERFLOW NMI force
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_INTEN register
//
//*************************************************************************************************
#define BGCRC_INTEN_TEST_DONE 0x2U // TEST_DONE interrupt enable register
#define BGCRC_INTEN_CRC_FAIL 0x4U // CRC_FAIL interrupt enable register
#define BGCRC_INTEN_UNCORRECTABLE_ERR 0x8U // UNCORRECTABLE_ERR interrupt enable register
#define BGCRC_INTEN_CORRECTABLE_ERR 0x10U // CORRECTABLE_ERR interrupt enable register
#define BGCRC_INTEN_WD_UNDERFLOW 0x20U // WD_UNDERFLOW interrupt enable register
#define BGCRC_INTEN_WD_OVERFLOW 0x40U // WD_OVERFLOW interrupt enable register
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_INTFLG register
//
//*************************************************************************************************
#define BGCRC_INTFLG_INT 0x1U // Global Interrupt status flag
#define BGCRC_INTFLG_TEST_DONE 0x2U // TEST_DONE Interrupt status flag
#define BGCRC_INTFLG_CRC_FAIL 0x4U // CRC computation failed
#define BGCRC_INTFLG_UNCORRECTABLE_ERR 0x8U // Uncorrectable error obtained during memory data
// read.
#define BGCRC_INTFLG_CORRECTABLE_ERR 0x10U // Correctable ECC error obtained during memory
// data read.
#define BGCRC_INTFLG_WD_UNDERFLOW 0x20U // CRC/scrubbing completed before BGCRC_WD_MIN
#define BGCRC_INTFLG_WD_OVERFLOW 0x40U // CRC/scrubbing did not complete within
// BGCRC_WD_MAX
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_INTCLR register
//
//*************************************************************************************************
#define BGCRC_INTCLR_INT 0x1U // Global Interrupt clear
#define BGCRC_INTCLR_TEST_DONE 0x2U // TEST_DONE Interrupt clear
#define BGCRC_INTCLR_CRC_FAIL 0x4U // CRC_FAIL interrupt clear
#define BGCRC_INTCLR_UNCORRECTABLE_ERR 0x8U // UNCORRECTABLE_ERR interrupt clear
#define BGCRC_INTCLR_CORRECTABLE_ERR 0x10U // CORRECTABLE_ERR interrupt clear
#define BGCRC_INTCLR_WD_UNDERFLOW 0x20U // WD_UNDERFLOW interrupt clear
#define BGCRC_INTCLR_WD_OVERFLOW 0x40U // WD_OVERFLOW interrupt clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_INTFRC register
//
//*************************************************************************************************
#define BGCRC_INTFRC_TEST_DONE 0x2U // TEST_DONE Interrupt force
#define BGCRC_INTFRC_CRC_FAIL 0x4U // CRC_FAIL interrupt force
#define BGCRC_INTFRC_UNCORRECTABLE_ERR 0x8U // UNCORRECTABLE_ERR interrupt force
#define BGCRC_INTFRC_CORRECTABLE_ERR 0x10U // CORRECTABLE_ERR interrupt force
#define BGCRC_INTFRC_WD_UNDERFLOW 0x20U // WD_UNDERFLOW interrupt force
#define BGCRC_INTFRC_WD_OVERFLOW 0x40U // WD_OVERFLOW interrupt force
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_LOCK register
//
//*************************************************************************************************
#define BGCRC_LOCK_BGCRC_EN 0x1U // Register lock configuration
#define BGCRC_LOCK_BGCRC_CTRL1 0x2U // Register lock configuration
#define BGCRC_LOCK_BGCRC_CTRL2 0x4U // Register lock configuration
#define BGCRC_LOCK_BGCRC_START_ADDR 0x8U // Register lock configuration
#define BGCRC_LOCK_BGCRC_SEED 0x10U // Register lock configuration
#define BGCRC_LOCK_BGCRC_GOLDEN 0x80U // Register lock configuration
#define BGCRC_LOCK_BGCRC_WD_CFG 0x4000U // Register lock configuration
#define BGCRC_LOCK_BGCRC_WD_MIN 0x8000U // Register lock configuration
#define BGCRC_LOCK_BGCRC_WD_MAX 0x10000U // Register lock configuration
#define BGCRC_LOCK_BGCRC_NMIFRC 0x800000U // Register lock configuration
#define BGCRC_LOCK_BGCRC_INTEN 0x4000000U // Register lock configuration
#define BGCRC_LOCK_BGCRC_INTFRC 0x20000000U // Register lock configuration
//*************************************************************************************************
//
// The following are defines for the bit fields in the BGCRC_COMMIT register
//
//*************************************************************************************************
#define BGCRC_COMMIT_BGCRC_EN 0x1U // Register lock committed
#define BGCRC_COMMIT_BGCRC_CTRL1 0x2U // Register lock committed
#define BGCRC_COMMIT_BGCRC_CTRL2 0x4U // Register lock committed
#define BGCRC_COMMIT_BGCRC_START_ADDR 0x8U // Register lock committed
#define BGCRC_COMMIT_BGCRC_SEED 0x10U // Register lock committed
#define BGCRC_COMMIT_BGCRC_GOLDEN 0x80U // Register lock committed
#define BGCRC_COMMIT_BGCRC_WD_CFG 0x4000U // Register lock committed
#define BGCRC_COMMIT_BGCRC_WD_MIN 0x8000U // Register lock committed
#define BGCRC_COMMIT_BGCRC_WD_MAX 0x10000U // Register lock committed
#define BGCRC_COMMIT_BGCRC_NMIFRC 0x800000U // Register lock committed
#define BGCRC_COMMIT_BGCRC_INTEN 0x4000000U // Register lock committed
#define BGCRC_COMMIT_BGCRC_INTFRC 0x20000000U // Register lock committed
#endif
@@ -0,0 +1,519 @@
//###########################################################################
//
// FILE: hw_can.h
//
// TITLE: Definitions for the CAN 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 HW_CAN_H
#define HW_CAN_H
//*************************************************************************************************
//
// The following are defines for the CAN register offsets
//
//*************************************************************************************************
#define CAN_O_CTL 0x0U // CAN Control Register
#define CAN_O_ES 0x4U // Error and Status Register
#define CAN_O_ERRC 0x8U // Error Counter Register
#define CAN_O_BTR 0xCU // Bit Timing Register
#define CAN_O_INT 0x10U // Interrupt Register
#define CAN_O_TEST 0x14U // Test Register
#define CAN_O_PERR 0x1CU // CAN Parity Error Code Register
#define CAN_O_RAM_INIT 0x40U // CAN RAM Initialization Register
#define CAN_O_GLB_INT_EN 0x50U // CAN Global Interrupt Enable Register
#define CAN_O_GLB_INT_FLG 0x54U // CAN Global Interrupt Flag Register
#define CAN_O_GLB_INT_CLR 0x58U // CAN Global Interrupt Clear Register
#define CAN_O_ABOTR 0x80U // Auto-Bus-On Time Register
#define CAN_O_TXRQ_X 0x84U // CAN Transmission Request Register
#define CAN_O_TXRQ_21 0x88U // CAN Transmission Request 2_1 Register
#define CAN_O_NDAT_X 0x98U // CAN New Data Register
#define CAN_O_NDAT_21 0x9CU // CAN New Data 2_1 Register
#define CAN_O_IPEN_X 0xACU // CAN Interrupt Pending Register
#define CAN_O_IPEN_21 0xB0U // CAN Interrupt Pending 2_1 Register
#define CAN_O_MVAL_X 0xC0U // CAN Message Valid Register
#define CAN_O_MVAL_21 0xC4U // CAN Message Valid 2_1 Register
#define CAN_O_IP_MUX21 0xD8U // CAN Interrupt Multiplexer 2_1 Register
#define CAN_O_IF1CMD 0x100U // IF1 Command Register
#define CAN_O_IF1MSK 0x104U // IF1 Mask Register
#define CAN_O_IF1ARB 0x108U // IF1 Arbitration Register
#define CAN_O_IF1MCTL 0x10CU // IF1 Message Control Register
#define CAN_O_IF1DATA 0x110U // IF1 Data A Register
#define CAN_O_IF1DATB 0x114U // IF1 Data B Register
#define CAN_O_IF2CMD 0x120U // IF2 Command Register
#define CAN_O_IF2MSK 0x124U // IF2 Mask Register
#define CAN_O_IF2ARB 0x128U // IF2 Arbitration Register
#define CAN_O_IF2MCTL 0x12CU // IF2 Message Control Register
#define CAN_O_IF2DATA 0x130U // IF2 Data A Register
#define CAN_O_IF2DATB 0x134U // IF2 Data B Register
#define CAN_O_IF3OBS 0x140U // IF3 Observation Register
#define CAN_O_IF3MSK 0x144U // IF3 Mask Register
#define CAN_O_IF3ARB 0x148U // IF3 Arbitration Register
#define CAN_O_IF3MCTL 0x14CU // IF3 Message Control Register
#define CAN_O_IF3DATA 0x150U // IF3 Data A Register
#define CAN_O_IF3DATB 0x154U // IF3 Data B Register
#define CAN_O_IF3UPD 0x160U // IF3 Update Enable Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_CTL register
//
//*************************************************************************************************
#define CAN_CTL_INIT 0x1U // Initialization
#define CAN_CTL_IE0 0x2U // Interrupt line 0 Enable
#define CAN_CTL_SIE 0x4U // Status Change Interrupt Enable
#define CAN_CTL_EIE 0x8U // Error Interrupt Enable
#define CAN_CTL_DAR 0x20U // Disable Automatic Retransmission
#define CAN_CTL_CCE 0x40U // Configuration Change Enable
#define CAN_CTL_TEST 0x80U // Test Mode Enable
#define CAN_CTL_IDS 0x100U // Interruption Debug Support Enable
#define CAN_CTL_ABO 0x200U // Auto-Bus-On Enable
#define CAN_CTL_PMD_S 10U
#define CAN_CTL_PMD_M 0x3C00U // Parity on/off
#define CAN_CTL_SWR 0x8000U // SW Reset Enable
#define CAN_CTL_INITDBG 0x10000U // Debug Mode Status
#define CAN_CTL_IE1 0x20000U // Interrupt line 1 Enable Disabled
#define CAN_CTL_DE1 0x40000U // Enable DMA request line
#define CAN_CTL_DE2 0x80000U // Enable DMA request line
#define CAN_CTL_DE3 0x100000U // Enable DMA request line
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_ES register
//
//*************************************************************************************************
#define CAN_ES_LEC_S 0U
#define CAN_ES_LEC_M 0x7U // Last Error Code
#define CAN_ES_TXOK 0x8U // Transmission status
#define CAN_ES_RXOK 0x10U // Reception status
#define CAN_ES_EPASS 0x20U // Error Passive State
#define CAN_ES_EWARN 0x40U // Warning State
#define CAN_ES_BOFF 0x80U // Bus-Off State
#define CAN_ES_PER 0x100U // Parity Error Detected
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_ERRC register
//
//*************************************************************************************************
#define CAN_ERRC_TEC_S 0U
#define CAN_ERRC_TEC_M 0xFFU // Transmit Error Counter
#define CAN_ERRC_REC_S 8U
#define CAN_ERRC_REC_M 0x7F00U // Receive Error Counter
#define CAN_ERRC_RP 0x8000U // Receive Error Passive
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_BTR register
//
//*************************************************************************************************
#define CAN_BTR_BRP_S 0U
#define CAN_BTR_BRP_M 0x3FU // Baud Rate Prescaler
#define CAN_BTR_SJW_S 6U
#define CAN_BTR_SJW_M 0xC0U // Synchronization Jump Width
#define CAN_BTR_TSEG1_S 8U
#define CAN_BTR_TSEG1_M 0xF00U // Time segment
#define CAN_BTR_TSEG2_S 12U
#define CAN_BTR_TSEG2_M 0x7000U // Time segment
#define CAN_BTR_BRPE_S 16U
#define CAN_BTR_BRPE_M 0xF0000U // Baud Rate Prescaler Extension
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_INT register
//
//*************************************************************************************************
#define CAN_INT_INT0ID_S 0U
#define CAN_INT_INT0ID_M 0xFFFFU // Interrupt Identifier
#define CAN_INT_INT1ID_S 16U
#define CAN_INT_INT1ID_M 0xFF0000U // Interrupt 1 Identifier
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_TEST register
//
//*************************************************************************************************
#define CAN_TEST_SILENT 0x8U // Silent Mode
#define CAN_TEST_LBACK 0x10U // Loopback Mode
#define CAN_TEST_TX_S 5U
#define CAN_TEST_TX_M 0x60U // CANTX Pin Control
#define CAN_TEST_RX 0x80U // CANRX Pin Status
#define CAN_TEST_EXL 0x100U // External Loopback Mode
#define CAN_TEST_RDA 0x200U // RAM Direct Access Enable:
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_PERR register
//
//*************************************************************************************************
#define CAN_PERR_MSG_NUM_S 0U
#define CAN_PERR_MSG_NUM_M 0xFFU // Message Number
#define CAN_PERR_WORD_NUM_S 8U
#define CAN_PERR_WORD_NUM_M 0x700U // Word Number
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_RAM_INIT register
//
//*************************************************************************************************
#define CAN_RAM_INIT_KEY0 0x1U // KEY0
#define CAN_RAM_INIT_KEY1 0x2U // KEY1
#define CAN_RAM_INIT_KEY2 0x4U // KEY2
#define CAN_RAM_INIT_KEY3 0x8U // KEY3
#define CAN_RAM_INIT_CAN_RAM_INIT 0x10U // Initialize CAN Mailbox RAM
#define CAN_RAM_INIT_RAM_INIT_DONE 0x20U // CAN RAM initialization complete
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_GLB_INT_EN register
//
//*************************************************************************************************
#define CAN_GLB_INT_EN_GLBINT0_EN 0x1U // Global Interrupt Enable for CANINT0
#define CAN_GLB_INT_EN_GLBINT1_EN 0x2U // Global Interrupt Enable for CANINT1
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_GLB_INT_FLG register
//
//*************************************************************************************************
#define CAN_GLB_INT_FLG_INT0_FLG 0x1U // Global Interrupt Flag for CANINT0
#define CAN_GLB_INT_FLG_INT1_FLG 0x2U // Global Interrupt Flag for CANINT1
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_GLB_INT_CLR register
//
//*************************************************************************************************
#define CAN_GLB_INT_CLR_INT0_FLG_CLR 0x1U // Global Interrupt flag clear for CANINT0
#define CAN_GLB_INT_CLR_INT1_FLG_CLR 0x2U // Global Interrupt flag clear for CANINT1
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_TXRQ_X register
//
//*************************************************************************************************
#define CAN_TXRQ_X_TXRQSTREG1_S 0U
#define CAN_TXRQ_X_TXRQSTREG1_M 0x3U // Transmit Request Register 1
#define CAN_TXRQ_X_TXRQSTREG2_S 2U
#define CAN_TXRQ_X_TXRQSTREG2_M 0xCU // Transmit Request Register 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_NDAT_X register
//
//*************************************************************************************************
#define CAN_NDAT_X_NEWDATREG1_S 0U
#define CAN_NDAT_X_NEWDATREG1_M 0x3U // New Data Register 1
#define CAN_NDAT_X_NEWDATREG2_S 2U
#define CAN_NDAT_X_NEWDATREG2_M 0xCU // New Data Register 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IPEN_X register
//
//*************************************************************************************************
#define CAN_IPEN_X_INTPNDREG1_S 0U
#define CAN_IPEN_X_INTPNDREG1_M 0x3U // Interrupt Pending Register 1
#define CAN_IPEN_X_INTPNDREG2_S 2U
#define CAN_IPEN_X_INTPNDREG2_M 0xCU // Interrupt Pending Register 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_MVAL_X register
//
//*************************************************************************************************
#define CAN_MVAL_X_MSGVALREG1_S 0U
#define CAN_MVAL_X_MSGVALREG1_M 0x3U // Message Valid Register 1
#define CAN_MVAL_X_MSGVALREG2_S 2U
#define CAN_MVAL_X_MSGVALREG2_M 0xCU // Message Valid Register 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF1CMD register
//
//*************************************************************************************************
#define CAN_IF1CMD_MSG_NUM_S 0U
#define CAN_IF1CMD_MSG_NUM_M 0xFFU // Message Number
#define CAN_IF1CMD_DMAACTIVE 0x4000U // DMA Status
#define CAN_IF1CMD_BUSY 0x8000U // Busy Flag
#define CAN_IF1CMD_DATA_B 0x10000U // Access Data Bytes 4-7
#define CAN_IF1CMD_DATA_A 0x20000U // Access Data Bytes 0-3
#define CAN_IF1CMD_TXRQST 0x40000U // Access Transmission Request Bit
#define CAN_IF1CMD_CLRINTPND 0x80000U // Clear Interrupt Pending Bit
#define CAN_IF1CMD_CONTROL 0x100000U // Access Control Bits
#define CAN_IF1CMD_ARB 0x200000U // Access Arbitration Bits
#define CAN_IF1CMD_MASK 0x400000U // Access Mask Bits
#define CAN_IF1CMD_DIR 0x800000U // Write/Read Direction
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF1MSK register
//
//*************************************************************************************************
#define CAN_IF1MSK_MSK_S 0U
#define CAN_IF1MSK_MSK_M 0x1FFFFFFFU // Identifier Mask
#define CAN_IF1MSK_MDIR 0x40000000U // Mask Message Direction
#define CAN_IF1MSK_MXTD 0x80000000U // Mask Extended Identifier
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF1ARB register
//
//*************************************************************************************************
#define CAN_IF1ARB_ID_S 0U
#define CAN_IF1ARB_ID_M 0x1FFFFFFFU // `
#define CAN_IF1ARB_DIR 0x20000000U // Message Direction
#define CAN_IF1ARB_XTD 0x40000000U // Extended Identifier
#define CAN_IF1ARB_MSGVAL 0x80000000U // Message Valid
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF1MCTL register
//
//*************************************************************************************************
#define CAN_IF1MCTL_DLC_S 0U
#define CAN_IF1MCTL_DLC_M 0xFU // Data length code
#define CAN_IF1MCTL_EOB 0x80U // End of Block
#define CAN_IF1MCTL_TXRQST 0x100U // Transmit Request
#define CAN_IF1MCTL_RMTEN 0x200U // Remote Enable
#define CAN_IF1MCTL_RXIE 0x400U // Receive Interrupt Enable
#define CAN_IF1MCTL_TXIE 0x800U // Transmit Interrupt Enable
#define CAN_IF1MCTL_UMASK 0x1000U // Use Acceptance Mask
#define CAN_IF1MCTL_INTPND 0x2000U // Interrupt Pending
#define CAN_IF1MCTL_MSGLST 0x4000U // Message Lost
#define CAN_IF1MCTL_NEWDAT 0x8000U // New Data
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF1DATA register
//
//*************************************************************************************************
#define CAN_IF1DATA_DATA_0_S 0U
#define CAN_IF1DATA_DATA_0_M 0xFFU // Data Byte 0
#define CAN_IF1DATA_DATA_1_S 8U
#define CAN_IF1DATA_DATA_1_M 0xFF00U // Data Byte 1
#define CAN_IF1DATA_DATA_2_S 16U
#define CAN_IF1DATA_DATA_2_M 0xFF0000U // Data Byte 2
#define CAN_IF1DATA_DATA_3_S 24U
#define CAN_IF1DATA_DATA_3_M 0xFF000000U // Data Byte 3
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF1DATB register
//
//*************************************************************************************************
#define CAN_IF1DATB_DATA_4_S 0U
#define CAN_IF1DATB_DATA_4_M 0xFFU // Data Byte 4
#define CAN_IF1DATB_DATA_5_S 8U
#define CAN_IF1DATB_DATA_5_M 0xFF00U // Data Byte 5
#define CAN_IF1DATB_DATA_6_S 16U
#define CAN_IF1DATB_DATA_6_M 0xFF0000U // Data Byte 6
#define CAN_IF1DATB_DATA_7_S 24U
#define CAN_IF1DATB_DATA_7_M 0xFF000000U // Data Byte 7
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF2CMD register
//
//*************************************************************************************************
#define CAN_IF2CMD_MSG_NUM_S 0U
#define CAN_IF2CMD_MSG_NUM_M 0xFFU // Message Number
#define CAN_IF2CMD_DMAACTIVE 0x4000U // DMA Status
#define CAN_IF2CMD_BUSY 0x8000U // Busy Flag
#define CAN_IF2CMD_DATA_B 0x10000U // Access Data Bytes 4-7
#define CAN_IF2CMD_DATA_A 0x20000U // Access Data Bytes 0-3
#define CAN_IF2CMD_TXRQST 0x40000U // Access Transmission Request Bit
#define CAN_IF2CMD_CLRINTPND 0x80000U // Clear Interrupt Pending Bit
#define CAN_IF2CMD_CONTROL 0x100000U // Access Control Bits
#define CAN_IF2CMD_ARB 0x200000U // Access Arbitration Bits
#define CAN_IF2CMD_MASK 0x400000U // Access Mask Bits
#define CAN_IF2CMD_DIR 0x800000U // Write/Read Direction
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF2MSK register
//
//*************************************************************************************************
#define CAN_IF2MSK_MSK_S 0U
#define CAN_IF2MSK_MSK_M 0x1FFFFFFFU // Identifier Mask
#define CAN_IF2MSK_MDIR 0x40000000U // Mask Message Direction
#define CAN_IF2MSK_MXTD 0x80000000U // Mask Extended Identifier
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF2ARB register
//
//*************************************************************************************************
#define CAN_IF2ARB_ID_S 0U
#define CAN_IF2ARB_ID_M 0x1FFFFFFFU // Message Identifier
#define CAN_IF2ARB_DIR 0x20000000U // Message Direction
#define CAN_IF2ARB_XTD 0x40000000U // Extended Identifier
#define CAN_IF2ARB_MSGVAL 0x80000000U // Message Valid
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF2MCTL register
//
//*************************************************************************************************
#define CAN_IF2MCTL_DLC_S 0U
#define CAN_IF2MCTL_DLC_M 0xFU // Data length code
#define CAN_IF2MCTL_EOB 0x80U // End of Block
#define CAN_IF2MCTL_TXRQST 0x100U // Transmit Request
#define CAN_IF2MCTL_RMTEN 0x200U // Remote Enable
#define CAN_IF2MCTL_RXIE 0x400U // Receive Interrupt Enable
#define CAN_IF2MCTL_TXIE 0x800U // Transmit Interrupt Enable
#define CAN_IF2MCTL_UMASK 0x1000U // Use Acceptance Mask
#define CAN_IF2MCTL_INTPND 0x2000U // Interrupt Pending
#define CAN_IF2MCTL_MSGLST 0x4000U // Message Lost
#define CAN_IF2MCTL_NEWDAT 0x8000U // New Data
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF2DATA register
//
//*************************************************************************************************
#define CAN_IF2DATA_DATA_0_S 0U
#define CAN_IF2DATA_DATA_0_M 0xFFU // Data Byte 0
#define CAN_IF2DATA_DATA_1_S 8U
#define CAN_IF2DATA_DATA_1_M 0xFF00U // Data Byte 1
#define CAN_IF2DATA_DATA_2_S 16U
#define CAN_IF2DATA_DATA_2_M 0xFF0000U // Data Byte 2
#define CAN_IF2DATA_DATA_3_S 24U
#define CAN_IF2DATA_DATA_3_M 0xFF000000U // Data Byte 3
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF2DATB register
//
//*************************************************************************************************
#define CAN_IF2DATB_DATA_4_S 0U
#define CAN_IF2DATB_DATA_4_M 0xFFU // Data Byte 4
#define CAN_IF2DATB_DATA_5_S 8U
#define CAN_IF2DATB_DATA_5_M 0xFF00U // Data Byte 5
#define CAN_IF2DATB_DATA_6_S 16U
#define CAN_IF2DATB_DATA_6_M 0xFF0000U // Data Byte 6
#define CAN_IF2DATB_DATA_7_S 24U
#define CAN_IF2DATB_DATA_7_M 0xFF000000U // Data Byte 7
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF3OBS register
//
//*************************************************************************************************
#define CAN_IF3OBS_MASK 0x1U // Mask data read observation
#define CAN_IF3OBS_ARB 0x2U // Arbitration data read observation
#define CAN_IF3OBS_CTRL 0x4U // Ctrl read observation
#define CAN_IF3OBS_DATA_A 0x8U // Data A read observation
#define CAN_IF3OBS_DATA_B 0x10U // Data B read observation
#define CAN_IF3OBS_IF3SM 0x100U // IF3 Status of Mask data read access
#define CAN_IF3OBS_IF3SA 0x200U // IF3 Status of Arbitration data read access
#define CAN_IF3OBS_IF3SC 0x400U // IF3 Status of Control bits read access
#define CAN_IF3OBS_IF3SDA 0x800U // IF3 Status of Data A read access
#define CAN_IF3OBS_IF3SDB 0x1000U // IF3 Status of Data B read access
#define CAN_IF3OBS_IF3UPD 0x8000U // IF3 Update Data
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF3MSK register
//
//*************************************************************************************************
#define CAN_IF3MSK_MSK_S 0U
#define CAN_IF3MSK_MSK_M 0x1FFFFFFFU // Mask
#define CAN_IF3MSK_MDIR 0x40000000U // Mask Message Direction
#define CAN_IF3MSK_MXTD 0x80000000U // Mask Extended Identifier
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF3ARB register
//
//*************************************************************************************************
#define CAN_IF3ARB_ID_S 0U
#define CAN_IF3ARB_ID_M 0x1FFFFFFFU // Message Identifier
#define CAN_IF3ARB_DIR 0x20000000U // Message Direction
#define CAN_IF3ARB_XTD 0x40000000U // Extended Identifier
#define CAN_IF3ARB_MSGVAL 0x80000000U // Message Valid
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF3MCTL register
//
//*************************************************************************************************
#define CAN_IF3MCTL_DLC_S 0U
#define CAN_IF3MCTL_DLC_M 0xFU // Data length code
#define CAN_IF3MCTL_EOB 0x80U // End of Block
#define CAN_IF3MCTL_TXRQST 0x100U // Transmit Request
#define CAN_IF3MCTL_RMTEN 0x200U // Remote Enable
#define CAN_IF3MCTL_RXIE 0x400U // Receive Interrupt Enable
#define CAN_IF3MCTL_TXIE 0x800U // Transmit Interrupt Enable
#define CAN_IF3MCTL_UMASK 0x1000U // Use Acceptance Mask
#define CAN_IF3MCTL_INTPND 0x2000U // Interrupt Pending
#define CAN_IF3MCTL_MSGLST 0x4000U // Message Lost
#define CAN_IF3MCTL_NEWDAT 0x8000U // New Data
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF3DATA register
//
//*************************************************************************************************
#define CAN_IF3DATA_DATA_0_S 0U
#define CAN_IF3DATA_DATA_0_M 0xFFU // Data Byte 0
#define CAN_IF3DATA_DATA_1_S 8U
#define CAN_IF3DATA_DATA_1_M 0xFF00U // Data Byte 1
#define CAN_IF3DATA_DATA_2_S 16U
#define CAN_IF3DATA_DATA_2_M 0xFF0000U // Data Byte 2
#define CAN_IF3DATA_DATA_3_S 24U
#define CAN_IF3DATA_DATA_3_M 0xFF000000U // Data Byte 3
//*************************************************************************************************
//
// The following are defines for the bit fields in the CAN_IF3DATB register
//
//*************************************************************************************************
#define CAN_IF3DATB_DATA_4_S 0U
#define CAN_IF3DATB_DATA_4_M 0xFFU // Data Byte 4
#define CAN_IF3DATB_DATA_5_S 8U
#define CAN_IF3DATB_DATA_5_M 0xFF00U // Data Byte 5
#define CAN_IF3DATB_DATA_6_S 16U
#define CAN_IF3DATB_DATA_6_M 0xFF0000U // Data Byte 6
#define CAN_IF3DATB_DATA_7_S 24U
#define CAN_IF3DATB_DATA_7_M 0xFF000000U // Data Byte 7
#endif
@@ -0,0 +1,315 @@
//###########################################################################
//
// FILE: hw_cla.h
//
// TITLE: Definitions for the CLA 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 HW_CLA_H
#define HW_CLA_H
//*************************************************************************************************
//
// The following are defines for the CLA register offsets
//
//*************************************************************************************************
#ifndef __TMS320C28XX_CLA__
#define CLA_O_MVECT1 0x0U // Task Interrupt Vector
#define CLA_O_MVECT2 0x1U // Task Interrupt Vector
#define CLA_O_MVECT3 0x2U // Task Interrupt Vector
#define CLA_O_MVECT4 0x3U // Task Interrupt Vector
#define CLA_O_MVECT5 0x4U // Task Interrupt Vector
#define CLA_O_MVECT6 0x5U // Task Interrupt Vector
#define CLA_O_MVECT7 0x6U // Task Interrupt Vector
#define CLA_O_MVECT8 0x7U // Task Interrupt Vector
#define CLA_O_MCTL 0x10U // Control Register
#define CLA_O_MVECTBGRNDACTIVE 0x1BU // Active register for MVECTBGRND.
#define CLA_O_SOFTINTEN 0x1CU // CLA Software Interrupt Enable Register
#define CLA_O_MSTSBGRND 0x1DU // Status register for the back ground task.
#define CLA_O_MCTLBGRND 0x1EU // Control register for the back ground task.
#define CLA_O_MVECTBGRND 0x1FU // Vector for the back ground task.
#define CLA_O_MIFR 0x20U // Interrupt Flag Register
#define CLA_O_MIOVF 0x21U // Interrupt Overflow Flag Register
#define CLA_O_MIFRC 0x22U // Interrupt Force Register
#define CLA_O_MICLR 0x23U // Interrupt Flag Clear Register
#define CLA_O_MICLROVF 0x24U // Interrupt Overflow Flag Clear Register
#define CLA_O_MIER 0x25U // Interrupt Enable Register
#define CLA_O_MIRUN 0x26U // Interrupt Run Status Register
#define CLA_O_MPC 0x28U // CLA Program Counter
#define CLA_O_MAR0 0x2AU // CLA Auxiliary Register 0
#define CLA_O_MAR1 0x2BU // CLA Auxiliary Register 1
#define CLA_O_MSTF 0x2EU // CLA Floating-Point Status Register
#define CLA_O_MR0 0x30U // CLA Floating-Point Result Register 0
#define CLA_O_MR1 0x34U // CLA Floating-Point Result Register 1
#define CLA_O_MR2 0x38U // CLA Floating-Point Result Register 2
#define CLA_O_MR3 0x3CU // CLA Floating-Point Result Register 3
#define CLA_O_MPSACTL 0x42U // CLA PSA Control Register
#define CLA_O_MPSA1 0x44U // CLA PSA1 Register
#define CLA_O_MPSA2 0x46U // CLA PSA2 Register
#endif
#ifdef __TMS320C28XX_CLA__
#define CLA_O_MVECTBGRNDACTIVE 0x80U // Active register for MVECTBGRND.
#define CLA_O_MPSACTL 0xC0U // CLA PSA Control Register
#define CLA_O_MPSA1 0xC2U // CLA PSA1 Register
#define CLA_O_MPSA2 0xC4U // CLA PSA2 Register
#define CLA_O_SOFTINTEN 0xE0U // CLA Software Interrupt Enable Register
#define CLA_O_SOFTINTFRC 0xE2U // CLA Software Interrupt Force Register
#endif
#ifndef __TMS320C28XX_CLA__
//*************************************************************************************************
//
// The following are defines for the bit fields in the MCTL register
//
//*************************************************************************************************
#define CLA_MCTL_HARDRESET 0x1U // Hard Reset
#define CLA_MCTL_SOFTRESET 0x2U // Soft Reset
#define CLA_MCTL_IACKE 0x4U // IACK enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the SOFTINTEN register
//
//*************************************************************************************************
#define CLA_SOFTINTEN_TASK1 0x1U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK2 0x2U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK3 0x4U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK4 0x8U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK5 0x10U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK6 0x20U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK7 0x40U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK8 0x80U // Configure Software Interrupt or End of Task interrupt.
//*************************************************************************************************
//
// The following are defines for the bit fields in the _MSTSBGRND register
//
//*************************************************************************************************
#define CLA_MSTSBGRND_RUN 0x1U // Background task run status bit.
#define CLA_MSTSBGRND_BGINTM 0x2U // Indicates whether background task can be interrupted.
#define CLA_MSTSBGRND_BGOVF 0x4U // background task harware trigger overflow.
//*************************************************************************************************
//
// The following are defines for the bit fields in the _MCTLBGRND register
//
//*************************************************************************************************
#define CLA_MCTLBGRND_BGSTART 0x1U // Background task start bit
#define CLA_MCTLBGRND_TRIGEN 0x2U // Background task hardware trigger enable
#define CLA_MCTLBGRND_BGEN 0x8000U // Enable background task
//*************************************************************************************************
//
// The following are defines for the bit fields in the MIFR register
//
//*************************************************************************************************
#define CLA_MIFR_INT1 0x1U // Task 1 Interrupt Flag
#define CLA_MIFR_INT2 0x2U // Task 2 Interrupt Flag
#define CLA_MIFR_INT3 0x4U // Task 3 Interrupt Flag
#define CLA_MIFR_INT4 0x8U // Task 4 Interrupt Flag
#define CLA_MIFR_INT5 0x10U // Task 5 Interrupt Flag
#define CLA_MIFR_INT6 0x20U // Task 6 Interrupt Flag
#define CLA_MIFR_INT7 0x40U // Task 7 Interrupt Flag
#define CLA_MIFR_INT8 0x80U // Task 8 Interrupt Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the MIOVF register
//
//*************************************************************************************************
#define CLA_MIOVF_INT1 0x1U // Task 1 Interrupt Overflow Flag
#define CLA_MIOVF_INT2 0x2U // Task 2 Interrupt Overflow Flag
#define CLA_MIOVF_INT3 0x4U // Task 3 Interrupt Overflow Flag
#define CLA_MIOVF_INT4 0x8U // Task 4 Interrupt Overflow Flag
#define CLA_MIOVF_INT5 0x10U // Task 5 Interrupt Overflow Flag
#define CLA_MIOVF_INT6 0x20U // Task 6 Interrupt Overflow Flag
#define CLA_MIOVF_INT7 0x40U // Task 7 Interrupt Overflow Flag
#define CLA_MIOVF_INT8 0x80U // Task 8 Interrupt Overflow Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the MIFRC register
//
//*************************************************************************************************
#define CLA_MIFRC_INT1 0x1U // Task 1 Interrupt Force
#define CLA_MIFRC_INT2 0x2U // Task 2 Interrupt Force
#define CLA_MIFRC_INT3 0x4U // Task 3 Interrupt Force
#define CLA_MIFRC_INT4 0x8U // Task 4 Interrupt Force
#define CLA_MIFRC_INT5 0x10U // Task 5 Interrupt Force
#define CLA_MIFRC_INT6 0x20U // Task 6 Interrupt Force
#define CLA_MIFRC_INT7 0x40U // Task 7 Interrupt Force
#define CLA_MIFRC_INT8 0x80U // Task 8 Interrupt Force
//*************************************************************************************************
//
// The following are defines for the bit fields in the MICLR register
//
//*************************************************************************************************
#define CLA_MICLR_INT1 0x1U // Task 1 Interrupt Flag Clear
#define CLA_MICLR_INT2 0x2U // Task 2 Interrupt Flag Clear
#define CLA_MICLR_INT3 0x4U // Task 3 Interrupt Flag Clear
#define CLA_MICLR_INT4 0x8U // Task 4 Interrupt Flag Clear
#define CLA_MICLR_INT5 0x10U // Task 5 Interrupt Flag Clear
#define CLA_MICLR_INT6 0x20U // Task 6 Interrupt Flag Clear
#define CLA_MICLR_INT7 0x40U // Task 7 Interrupt Flag Clear
#define CLA_MICLR_INT8 0x80U // Task 8 Interrupt Flag Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the MICLROVF register
//
//*************************************************************************************************
#define CLA_MICLROVF_INT1 0x1U // Task 1 Interrupt Overflow Flag Clear
#define CLA_MICLROVF_INT2 0x2U // Task 2 Interrupt Overflow Flag Clear
#define CLA_MICLROVF_INT3 0x4U // Task 3 Interrupt Overflow Flag Clear
#define CLA_MICLROVF_INT4 0x8U // Task 4 Interrupt Overflow Flag Clear
#define CLA_MICLROVF_INT5 0x10U // Task 5 Interrupt Overflow Flag Clear
#define CLA_MICLROVF_INT6 0x20U // Task 6 Interrupt Overflow Flag Clear
#define CLA_MICLROVF_INT7 0x40U // Task 7 Interrupt Overflow Flag Clear
#define CLA_MICLROVF_INT8 0x80U // Task 8 Interrupt Overflow Flag Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the MIER register
//
//*************************************************************************************************
#define CLA_MIER_INT1 0x1U // Task 1 Interrupt Enable
#define CLA_MIER_INT2 0x2U // Task 2 Interrupt Enable
#define CLA_MIER_INT3 0x4U // Task 3 Interrupt Enable
#define CLA_MIER_INT4 0x8U // Task 4 Interrupt Enable
#define CLA_MIER_INT5 0x10U // Task 5 Interrupt Enable
#define CLA_MIER_INT6 0x20U // Task 6 Interrupt Enable
#define CLA_MIER_INT7 0x40U // Task 7 Interrupt Enable
#define CLA_MIER_INT8 0x80U // Task 8 Interrupt Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the MIRUN register
//
//*************************************************************************************************
#define CLA_MIRUN_INT1 0x1U // Task 1 Run Status
#define CLA_MIRUN_INT2 0x2U // Task 2 Run Status
#define CLA_MIRUN_INT3 0x4U // Task 3 Run Status
#define CLA_MIRUN_INT4 0x8U // Task 4 Run Status
#define CLA_MIRUN_INT5 0x10U // Task 5 Run Status
#define CLA_MIRUN_INT6 0x20U // Task 6 Run Status
#define CLA_MIRUN_INT7 0x40U // Task 7 Run Status
#define CLA_MIRUN_INT8 0x80U // Task 8 Run Status
//*************************************************************************************************
//
// The following are defines for the bit fields in the _MSTF register
//
//*************************************************************************************************
#define CLA_MSTF_LVF 0x1U // Latched Overflow Flag
#define CLA_MSTF_LUF 0x2U // Latched Underflow Flag
#define CLA_MSTF_NF 0x4U // Negative Float Flag
#define CLA_MSTF_ZF 0x8U // Zero Float Flag
#define CLA_MSTF_TF 0x40U // Test Flag
#define CLA_MSTF_RNDF32 0x200U // Round 32-bit Floating-Point Mode
#define CLA_MSTF_MEALLOW 0x800U // MEALLOW Status
#define CLA_MSTF_RPC_S 12U
#define CLA_MSTF_RPC_M 0xFFFF000U // Return PC
//*************************************************************************************************
//
// The following are defines for the bit fields in the _MPSACTL register
//
//*************************************************************************************************
#define CLA_MPSACTL_MPABSTART 0x1U // Start logging PAB onto PSA1
#define CLA_MPSACTL_MPABCYC 0x2U // PAB logging into PSA1 is on every cycle or when PAB
// changes.
#define CLA_MPSACTL_MDWDBSTART 0x4U // Start logging DWDB onto PSA2
#define CLA_MPSACTL_MDWDBCYC 0x8U // DWDB logging into PSA2 is on every cycle.
#define CLA_MPSACTL_MPSA1CLEAR 0x10U // PSA1 clear
#define CLA_MPSACTL_MPSA2CLEAR 0x20U // PSA2 Clear
#define CLA_MPSACTL_MPSA2CFG_S 6U
#define CLA_MPSACTL_MPSA2CFG_M 0xC0U // PSA2 Polynomial Configuration
#endif
#ifdef __TMS320C28XX_CLA__
//*************************************************************************************************
//
// The following are defines for the bit fields in the _MPSACTL register
//
//*************************************************************************************************
#define CLA_MPSACTL_MPABSTART 0x1U // Start logging PAB onto PSA1
#define CLA_MPSACTL_MPABCYC 0x2U // PAB logging into PSA1 is on every cycle or when PAB
// changes.
#define CLA_MPSACTL_MDWDBSTART 0x4U // Start logging DWDB onto PSA2
#define CLA_MPSACTL_MDWDBCYC 0x8U // DWDB logging into PSA2 is on every cycle.
#define CLA_MPSACTL_MPSA1CLEAR 0x10U // PSA1 clear
#define CLA_MPSACTL_MPSA2CLEAR 0x20U // PSA2 Clear
#define CLA_MPSACTL_MPSA2CFG_S 6U
#define CLA_MPSACTL_MPSA2CFG_M 0xC0U // PSA2 Polynomial Configuration
//*************************************************************************************************
//
// The following are defines for the bit fields in the SOFTINTEN register
//
//*************************************************************************************************
#define CLA_SOFTINTEN_TASK1 0x1U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK2 0x2U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK3 0x4U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK4 0x8U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK5 0x10U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK6 0x20U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK7 0x40U // Configure Software Interrupt or End of Task interrupt.
#define CLA_SOFTINTEN_TASK8 0x80U // Configure Software Interrupt or End of Task interrupt.
//*************************************************************************************************
//
// The following are defines for the bit fields in the SOFTINTFRC register
//
//*************************************************************************************************
#define CLA_SOFTINTFRC_TASK1 0x1U // Force CLA software interrupt for the corresponding task.
#define CLA_SOFTINTFRC_TASK2 0x2U // Force CLA software interrupt for the corresponding task.
#define CLA_SOFTINTFRC_TASK3 0x4U // Force CLA software interrupt for the corresponding task.
#define CLA_SOFTINTFRC_TASK4 0x8U // Force CLA software interrupt for the corresponding task.
#define CLA_SOFTINTFRC_TASK5 0x10U // Force CLA software interrupt for the corresponding task.
#define CLA_SOFTINTFRC_TASK6 0x20U // Force CLA software interrupt for the corresponding task.
#define CLA_SOFTINTFRC_TASK7 0x40U // Force CLA software interrupt for the corresponding task.
#define CLA_SOFTINTFRC_TASK8 0x80U // Force CLA software interrupt for the corresponding task.
#endif
#endif
@@ -0,0 +1,951 @@
//###########################################################################
//
// FILE: hw_clb.h
//
// TITLE: Definitions for the CLB 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 HW_CLB_H
#define HW_CLB_H
//*************************************************************************************************
//
// The following are defines for the CLB register offsets
//
//*************************************************************************************************
#define CLB_O_COUNT_RESET 0x2U // Counter Block RESET
#define CLB_O_COUNT_MODE_1 0x4U // Counter Block MODE_1
#define CLB_O_COUNT_MODE_0 0x6U // Counter Block MODE_0
#define CLB_O_COUNT_EVENT 0x8U // Counter Block EVENT
#define CLB_O_FSM_EXTRA_IN0 0xAU // FSM Extra EXT_IN0
#define CLB_O_FSM_EXTERNAL_IN0 0xCU // FSM EXT_IN0
#define CLB_O_FSM_EXTERNAL_IN1 0xEU // FSM_EXT_IN1
#define CLB_O_FSM_EXTRA_IN1 0x10U // FSM Extra_EXT_IN1
#define CLB_O_LUT4_IN0 0x12U // LUT4_0/1/2 IN0 input source
#define CLB_O_LUT4_IN1 0x14U // LUT4_0/1/2 IN1 input source
#define CLB_O_LUT4_IN2 0x16U // LUT4_0/1/2 IN2 input source
#define CLB_O_LUT4_IN3 0x18U // LUT4_0/1/2 IN3 input source
#define CLB_O_FSM_LUT_FN1_0 0x1CU // LUT function for FSM Unit 1 and Unit 0
#define CLB_O_FSM_LUT_FN2 0x1EU // LUT function for FSM Unit 2
#define CLB_O_LUT4_FN1_0 0x20U // LUT function for LUT4 block of Unit 1 and 0
#define CLB_O_LUT4_FN2 0x22U // LUT function for LUT4 block of Unit 2
#define CLB_O_FSM_NEXT_STATE_0 0x24U // FSM Next state equations for Unit 0
#define CLB_O_FSM_NEXT_STATE_1 0x26U // FSM Next state equations for Unit 1
#define CLB_O_FSM_NEXT_STATE_2 0x28U // FSM Next state equations for Unit 2
#define CLB_O_MISC_CONTROL 0x2AU // Static controls for Ctr,FSM
#define CLB_O_OUTPUT_LUT_0 0x2CU // Inp Sel, LUT fns for Out0
#define CLB_O_OUTPUT_LUT_1 0x2EU // Inp Sel, LUT fns for Out1
#define CLB_O_OUTPUT_LUT_2 0x30U // Inp Sel, LUT fns for Out2
#define CLB_O_OUTPUT_LUT_3 0x32U // Inp Sel, LUT fns for Out3
#define CLB_O_OUTPUT_LUT_4 0x34U // Inp Sel, LUT fns for Out4
#define CLB_O_OUTPUT_LUT_5 0x36U // Inp Sel, LUT fns for Out5
#define CLB_O_OUTPUT_LUT_6 0x38U // Inp Sel, LUT fns for Out6
#define CLB_O_OUTPUT_LUT_7 0x3AU // Inp Sel, LUT fns for Out7
#define CLB_O_HLC_EVENT_SEL 0x3CU // Event Selector register for the High Level
// controller
#define CLB_O_COUNT_MATCH_TAP_SEL 0x3EU // Counter tap values for match1 and match2 outputs
#define CLB_O_OUTPUT_COND_CTRL_0 0x40U // Output conditioning control for output 0
#define CLB_O_OUTPUT_COND_CTRL_1 0x42U // Output conditioning control for output 1
#define CLB_O_OUTPUT_COND_CTRL_2 0x44U // Output conditioning control for output 2
#define CLB_O_OUTPUT_COND_CTRL_3 0x46U // Output conditioning control for output 3
#define CLB_O_OUTPUT_COND_CTRL_4 0x48U // Output conditioning control for output 4
#define CLB_O_OUTPUT_COND_CTRL_5 0x4AU // Output conditioning control for output 5
#define CLB_O_OUTPUT_COND_CTRL_6 0x4CU // Output conditioning control for output 6
#define CLB_O_OUTPUT_COND_CTRL_7 0x4EU // Output conditioning control for output 7
#define CLB_O_MISC_ACCESS_CTRL 0x50U // Miscellaneous Access and enable control
#define CLB_O_SPI_DATA_CTRL_HI 0x51U // CLB to SPI buffer control High
#define CLB_O_LOAD_EN 0x0U // Global enable & indirect load enable control
#define CLB_O_LOAD_ADDR 0x2U // Indirect address
#define CLB_O_LOAD_DATA 0x4U // Data for indirect loads
#define CLB_O_INPUT_FILTER 0x6U // Input filter selection for both edge detection and
// synchronizers
#define CLB_O_IN_MUX_SEL_0 0x8U // Input selection to decide between Signals and GP
// register
#define CLB_O_LCL_MUX_SEL_1 0xAU // Input Mux selection for local mux
#define CLB_O_LCL_MUX_SEL_2 0xCU // Input Mux selection for local mux
#define CLB_O_BUF_PTR 0xEU // PUSH and PULL pointers
#define CLB_O_GP_REG 0x10U // General purpose register for CELL inputs
#define CLB_O_OUT_EN 0x12U // CELL output enable register
#define CLB_O_GLBL_MUX_SEL_1 0x14U // Global Mux select for CELL inputs
#define CLB_O_GLBL_MUX_SEL_2 0x16U // Global Mux select for CELL inputs
#define CLB_O_PRESCALE_CTRL 0x18U // Prescaler register control
#define CLB_O_INTR_TAG_REG 0x20U // Interrupt Tag register
#define CLB_O_LOCK 0x22U // Lock control register
#define CLB_O_HLC_INSTR_READ_PTR 0x24U // HLC instruction read pointer
#define CLB_O_HLC_INSTR_VALUE 0x26U // HLC instruction read value
#define CLB_O_DBG_OUT_2 0x2EU // Visibility for CLB inputs and final asynchronous
// outputs
#define CLB_O_DBG_R0 0x30U // R0 of High level Controller
#define CLB_O_DBG_R1 0x32U // R1 of High level Controller
#define CLB_O_DBG_R2 0x34U // R2 of High level Controller
#define CLB_O_DBG_R3 0x36U // R3 of High level Controller
#define CLB_O_DBG_C0 0x38U // Count of Unit 0
#define CLB_O_DBG_C1 0x3AU // Count of Unit 1
#define CLB_O_DBG_C2 0x3CU // Count of Unit 2
#define CLB_O_DBG_OUT 0x3EU // Outputs of various units in the Cell
#define CLB_O_PUSH(i) (0x0U + ((i) * 0x2U)) // (0 <= i < 4) CLB_PUSH FIFO Registers (from HLC)
#define CLB_O_PULL(i) (0x40U + ((i) * 0x2U)) // (0 <= i < 4) CLB_PULL FIFO Registers (TO HLC)
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_COUNT_RESET register
//
//*************************************************************************************************
#define CLB_COUNT_RESET_SEL_0_S 0U
#define CLB_COUNT_RESET_SEL_0_M 0x1FU // Count Reset Select 0
#define CLB_COUNT_RESET_SEL_1_S 5U
#define CLB_COUNT_RESET_SEL_1_M 0x3E0U // Count Reset Select 1
#define CLB_COUNT_RESET_SEL_2_S 10U
#define CLB_COUNT_RESET_SEL_2_M 0x7C00U // Count Reset Select 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_COUNT_MODE_1 register
//
//*************************************************************************************************
#define CLB_COUNT_MODE_1_SEL_0_S 0U
#define CLB_COUNT_MODE_1_SEL_0_M 0x1FU // Counter mode 1 select 0
#define CLB_COUNT_MODE_1_SEL_1_S 5U
#define CLB_COUNT_MODE_1_SEL_1_M 0x3E0U // Counter mode 1 select 1
#define CLB_COUNT_MODE_1_SEL_2_S 10U
#define CLB_COUNT_MODE_1_SEL_2_M 0x7C00U // Counter mode 1 select 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_COUNT_MODE_0 register
//
//*************************************************************************************************
#define CLB_COUNT_MODE_0_SEL_0_S 0U
#define CLB_COUNT_MODE_0_SEL_0_M 0x1FU // Counter mode 0 select 0
#define CLB_COUNT_MODE_0_SEL_1_S 5U
#define CLB_COUNT_MODE_0_SEL_1_M 0x3E0U // Counter mode 0 select 1
#define CLB_COUNT_MODE_0_SEL_2_S 10U
#define CLB_COUNT_MODE_0_SEL_2_M 0x7C00U // Counter mode 0 select 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_COUNT_EVENT register
//
//*************************************************************************************************
#define CLB_COUNT_EVENT_SEL_0_S 0U
#define CLB_COUNT_EVENT_SEL_0_M 0x1FU // Counter event select 0
#define CLB_COUNT_EVENT_SEL_1_S 5U
#define CLB_COUNT_EVENT_SEL_1_M 0x3E0U // Counter event select 1
#define CLB_COUNT_EVENT_SEL_2_S 10U
#define CLB_COUNT_EVENT_SEL_2_M 0x7C00U // Counter event select 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_FSM_EXTRA_IN0 register
//
//*************************************************************************************************
#define CLB_FSM_EXTRA_IN0_SEL_0_S 0U
#define CLB_FSM_EXTRA_IN0_SEL_0_M 0x1FU // FSM extra ext input select 0
#define CLB_FSM_EXTRA_IN0_SEL_1_S 5U
#define CLB_FSM_EXTRA_IN0_SEL_1_M 0x3E0U // FSM extra ext input select 1
#define CLB_FSM_EXTRA_IN0_SEL_2_S 10U
#define CLB_FSM_EXTRA_IN0_SEL_2_M 0x7C00U // FSM extra ext input select 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_FSM_EXTERNAL_IN0 register
//
//*************************************************************************************************
#define CLB_FSM_EXTERNAL_IN0_SEL_0_S 0U
#define CLB_FSM_EXTERNAL_IN0_SEL_0_M 0x1FU // FSM EXT_IN0 select input for unit 0
#define CLB_FSM_EXTERNAL_IN0_SEL_1_S 5U
#define CLB_FSM_EXTERNAL_IN0_SEL_1_M 0x3E0U // FSM EXT_IN0 select input for unit 1
#define CLB_FSM_EXTERNAL_IN0_SEL_2_S 10U
#define CLB_FSM_EXTERNAL_IN0_SEL_2_M 0x7C00U // FSM EXT_IN0 select input for unit 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_FSM_EXTERNAL_IN1 register
//
//*************************************************************************************************
#define CLB_FSM_EXTERNAL_IN1_SEL_0_S 0U
#define CLB_FSM_EXTERNAL_IN1_SEL_0_M 0x1FU // FSM EXT_IN1 select input for unit 0
#define CLB_FSM_EXTERNAL_IN1_SEL_1_S 5U
#define CLB_FSM_EXTERNAL_IN1_SEL_1_M 0x3E0U // FSM EXT_IN1 select input for unit 1
#define CLB_FSM_EXTERNAL_IN1_SEL_2_S 10U
#define CLB_FSM_EXTERNAL_IN1_SEL_2_M 0x7C00U // FSM EXT_IN1 select input for unit 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_FSM_EXTRA_IN1 register
//
//*************************************************************************************************
#define CLB_FSM_EXTRA_IN1_SEL_0_S 0U
#define CLB_FSM_EXTRA_IN1_SEL_0_M 0x1FU // FSM extra ext input select 0
#define CLB_FSM_EXTRA_IN1_SEL_1_S 5U
#define CLB_FSM_EXTRA_IN1_SEL_1_M 0x3E0U // FSM extra ext input select 1
#define CLB_FSM_EXTRA_IN1_SEL_2_S 10U
#define CLB_FSM_EXTRA_IN1_SEL_2_M 0x7C00U // FSM extra ext input select 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_LUT4_IN0 register
//
//*************************************************************************************************
#define CLB_LUT4_IN0_SEL_0_S 0U
#define CLB_LUT4_IN0_SEL_0_M 0x1FU // Select inputs for unit 0
#define CLB_LUT4_IN0_SEL_1_S 5U
#define CLB_LUT4_IN0_SEL_1_M 0x3E0U // Select inputs for unit 1
#define CLB_LUT4_IN0_SEL_2_S 10U
#define CLB_LUT4_IN0_SEL_2_M 0x7C00U // Select inputs for unit 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_LUT4_IN1 register
//
//*************************************************************************************************
#define CLB_LUT4_IN1_SEL_0_S 0U
#define CLB_LUT4_IN1_SEL_0_M 0x1FU // Select inputs for unit 0
#define CLB_LUT4_IN1_SEL_1_S 5U
#define CLB_LUT4_IN1_SEL_1_M 0x3E0U // Select inputs for unit 1
#define CLB_LUT4_IN1_SEL_2_S 10U
#define CLB_LUT4_IN1_SEL_2_M 0x7C00U // Select inputs for unit 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_LUT4_IN2 register
//
//*************************************************************************************************
#define CLB_LUT4_IN2_SEL_0_S 0U
#define CLB_LUT4_IN2_SEL_0_M 0x1FU // Select inputs for unit 0
#define CLB_LUT4_IN2_SEL_1_S 5U
#define CLB_LUT4_IN2_SEL_1_M 0x3E0U // Select inputs for unit 1
#define CLB_LUT4_IN2_SEL_2_S 10U
#define CLB_LUT4_IN2_SEL_2_M 0x7C00U // Select inputs for unit 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_LUT4_IN3 register
//
//*************************************************************************************************
#define CLB_LUT4_IN3_SEL_0_S 0U
#define CLB_LUT4_IN3_SEL_0_M 0x1FU // Select inputs for unit 0
#define CLB_LUT4_IN3_SEL_1_S 5U
#define CLB_LUT4_IN3_SEL_1_M 0x3E0U // Select inputs for unit 1
#define CLB_LUT4_IN3_SEL_2_S 10U
#define CLB_LUT4_IN3_SEL_2_M 0x7C00U // Select inputs for unit 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_FSM_LUT_FN1_0 register
//
//*************************************************************************************************
#define CLB_FSM_LUT_FN1_0_FN0_S 0U
#define CLB_FSM_LUT_FN1_0_FN0_M 0xFFFFU // FSM LUT output function for unit 0
#define CLB_FSM_LUT_FN1_0_FN1_S 16U
#define CLB_FSM_LUT_FN1_0_FN1_M 0xFFFF0000U // FSM LUT output function for unit 1
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_FSM_LUT_FN2 register
//
//*************************************************************************************************
#define CLB_FSM_LUT_FN2_FN1_S 0U
#define CLB_FSM_LUT_FN2_FN1_M 0xFFFFU // FSM LUT output function for unit 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_LUT4_FN1_0 register
//
//*************************************************************************************************
#define CLB_LUT4_FN1_0_FN0_S 0U
#define CLB_LUT4_FN1_0_FN0_M 0xFFFFU // LUT4 output function for unit 0
#define CLB_LUT4_FN1_0_FN1_S 16U
#define CLB_LUT4_FN1_0_FN1_M 0xFFFF0000U // LUT4 output function for unit 1
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_LUT4_FN2 register
//
//*************************************************************************************************
#define CLB_LUT4_FN2_FN1_S 0U
#define CLB_LUT4_FN2_FN1_M 0xFFFFU // LUT4 output function for unit 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_FSM_NEXT_STATE_0 register
//
//*************************************************************************************************
#define CLB_FSM_NEXT_STATE_0_S0_S 0U
#define CLB_FSM_NEXT_STATE_0_S0_M 0xFFFFU // FSM next state function for S0
#define CLB_FSM_NEXT_STATE_0_S1_S 16U
#define CLB_FSM_NEXT_STATE_0_S1_M 0xFFFF0000U // FSM next state function for S1
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_FSM_NEXT_STATE_1 register
//
//*************************************************************************************************
#define CLB_FSM_NEXT_STATE_1_S0_S 0U
#define CLB_FSM_NEXT_STATE_1_S0_M 0xFFFFU // FSM next state function for S0
#define CLB_FSM_NEXT_STATE_1_S1_S 16U
#define CLB_FSM_NEXT_STATE_1_S1_M 0xFFFF0000U // FSM next state function for S1
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_FSM_NEXT_STATE_2 register
//
//*************************************************************************************************
#define CLB_FSM_NEXT_STATE_2_S0_S 0U
#define CLB_FSM_NEXT_STATE_2_S0_M 0xFFFFU // FSM next state function for S0
#define CLB_FSM_NEXT_STATE_2_S1_S 16U
#define CLB_FSM_NEXT_STATE_2_S1_M 0xFFFF0000U // FSM next state function for S1
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_MISC_CONTROL register
//
//*************************************************************************************************
#define CLB_MISC_CONTROL_COUNT_ADD_SHIFT_0 0x1U // Add/Shift for counter 0
#define CLB_MISC_CONTROL_COUNT_DIR_0 0x2U // Direction for counter 0
#define CLB_MISC_CONTROL_COUNT_EVENT_CTRL_0 0x4U // Event control for counter 0
#define CLB_MISC_CONTROL_COUNT_ADD_SHIFT_1 0x8U // Add/Shift for counter 1
#define CLB_MISC_CONTROL_COUNT_DIR_1 0x10U // Direction for counter 1
#define CLB_MISC_CONTROL_COUNT_EVENT_CTRL_1 0x20U // Event control for counter 1
#define CLB_MISC_CONTROL_COUNT_ADD_SHIFT_2 0x40U // Add/Shift for counter 2
#define CLB_MISC_CONTROL_COUNT_DIR_2 0x80U // Direction for counter 2
#define CLB_MISC_CONTROL_COUNT_EVENT_CTRL_2 0x100U // Event control for counter 2
#define CLB_MISC_CONTROL_COUNT_SERIALIZER_0 0x200U // Serializer enable 0
#define CLB_MISC_CONTROL_COUNT_SERIALIZER_1 0x400U // Serializer enable 1
#define CLB_MISC_CONTROL_COUNT_SERIALIZER_2 0x800U // Serializer enable 2
#define CLB_MISC_CONTROL_FSM_EXTRA_SEL0_0 0x1000U // FSM extra_sel0 for 0
#define CLB_MISC_CONTROL_FSM_EXTRA_SEL1_0 0x2000U // FSM extra_sel1 for 0
#define CLB_MISC_CONTROL_FSM_EXTRA_SEL0_1 0x4000U // FSM extra_sel0 for 1
#define CLB_MISC_CONTROL_FSM_EXTRA_SEL1_1 0x8000U // FSM extra_sel1 for 1
#define CLB_MISC_CONTROL_FSM_EXTRA_SEL0_2 0x10000U // FSM extra_sel0 for 2
#define CLB_MISC_CONTROL_FSM_EXTRA_SEL1_2 0x20000U // FSM extra_sel1 for 2
#define CLB_MISC_CONTROL_COUNT0_MATCH1_TAP_EN 0x40000U // Match1 Tap Enable for Counter 0
#define CLB_MISC_CONTROL_COUNT1_MATCH1_TAP_EN 0x80000U // Match1 Tap Enable for Counter 1
#define CLB_MISC_CONTROL_COUNT2_MATCH1_TAP_EN 0x100000U // Match1 Tap Enable for Counter 2
#define CLB_MISC_CONTROL_COUNT0_MATCH2_TAP_EN 0x200000U // Match2 Tap Enable for Counter 0
#define CLB_MISC_CONTROL_COUNT1_MATCH2_TAP_EN 0x400000U // Match2 Tap Enable for Counter 1
#define CLB_MISC_CONTROL_COUNT2_MATCH2_TAP_EN 0x800000U // Match2 Tap Enable for Counter 2
#define CLB_MISC_CONTROL_COUNT0_LFSR_EN 0x1000000U // Enable LFSR mode for Counter 0
#define CLB_MISC_CONTROL_COUNT1_LFSR_EN 0x2000000U // Enable LFSR mode for Counter 1
#define CLB_MISC_CONTROL_COUNT2_LFSR_EN 0x4000000U // Enable LFSR mode for Counter 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_LUT_0 register
//
//*************************************************************************************************
#define CLB_OUTPUT_LUT_0_IN0_S 0U
#define CLB_OUTPUT_LUT_0_IN0_M 0x1FU // Select value for IN0 of output LUT
#define CLB_OUTPUT_LUT_0_IN1_S 5U
#define CLB_OUTPUT_LUT_0_IN1_M 0x3E0U // Select value for IN1 of output LUT
#define CLB_OUTPUT_LUT_0_IN2_S 10U
#define CLB_OUTPUT_LUT_0_IN2_M 0x7C00U // Select value for IN2 of output LUT
#define CLB_OUTPUT_LUT_0_FN_S 15U
#define CLB_OUTPUT_LUT_0_FN_M 0x7F8000U // Output function for output LUT
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_LUT_1 register
//
//*************************************************************************************************
#define CLB_OUTPUT_LUT_1_IN0_S 0U
#define CLB_OUTPUT_LUT_1_IN0_M 0x1FU // Select value for IN0 of output LUT
#define CLB_OUTPUT_LUT_1_IN1_S 5U
#define CLB_OUTPUT_LUT_1_IN1_M 0x3E0U // Select value for IN1 of output LUT
#define CLB_OUTPUT_LUT_1_IN2_S 10U
#define CLB_OUTPUT_LUT_1_IN2_M 0x7C00U // Select value for IN2 of output LUT
#define CLB_OUTPUT_LUT_1_FN_S 15U
#define CLB_OUTPUT_LUT_1_FN_M 0x7F8000U // Output function for output LUT
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_LUT_2 register
//
//*************************************************************************************************
#define CLB_OUTPUT_LUT_2_IN0_S 0U
#define CLB_OUTPUT_LUT_2_IN0_M 0x1FU // Select value for IN0 of output LUT
#define CLB_OUTPUT_LUT_2_IN1_S 5U
#define CLB_OUTPUT_LUT_2_IN1_M 0x3E0U // Select value for IN1 of output LUT
#define CLB_OUTPUT_LUT_2_IN2_S 10U
#define CLB_OUTPUT_LUT_2_IN2_M 0x7C00U // Select value for IN2 of output LUT
#define CLB_OUTPUT_LUT_2_FN_S 15U
#define CLB_OUTPUT_LUT_2_FN_M 0x7F8000U // Output function for output LUT
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_LUT_3 register
//
//*************************************************************************************************
#define CLB_OUTPUT_LUT_3_IN0_S 0U
#define CLB_OUTPUT_LUT_3_IN0_M 0x1FU // Select value for IN0 of output LUT
#define CLB_OUTPUT_LUT_3_IN1_S 5U
#define CLB_OUTPUT_LUT_3_IN1_M 0x3E0U // Select value for IN1 of output LUT
#define CLB_OUTPUT_LUT_3_IN2_S 10U
#define CLB_OUTPUT_LUT_3_IN2_M 0x7C00U // Select value for IN2 of output LUT
#define CLB_OUTPUT_LUT_3_FN_S 15U
#define CLB_OUTPUT_LUT_3_FN_M 0x7F8000U // Output function for output LUT
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_LUT_4 register
//
//*************************************************************************************************
#define CLB_OUTPUT_LUT_4_IN0_S 0U
#define CLB_OUTPUT_LUT_4_IN0_M 0x1FU // Select value for IN0 of output LUT
#define CLB_OUTPUT_LUT_4_IN1_S 5U
#define CLB_OUTPUT_LUT_4_IN1_M 0x3E0U // Select value for IN1 of output LUT
#define CLB_OUTPUT_LUT_4_IN2_S 10U
#define CLB_OUTPUT_LUT_4_IN2_M 0x7C00U // Select value for IN2 of output LUT
#define CLB_OUTPUT_LUT_4_FN_S 15U
#define CLB_OUTPUT_LUT_4_FN_M 0x7F8000U // Output function for output LUT
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_LUT_5 register
//
//*************************************************************************************************
#define CLB_OUTPUT_LUT_5_IN0_S 0U
#define CLB_OUTPUT_LUT_5_IN0_M 0x1FU // Select value for IN0 of output LUT
#define CLB_OUTPUT_LUT_5_IN1_S 5U
#define CLB_OUTPUT_LUT_5_IN1_M 0x3E0U // Select value for IN1 of output LUT
#define CLB_OUTPUT_LUT_5_IN2_S 10U
#define CLB_OUTPUT_LUT_5_IN2_M 0x7C00U // Select value for IN2 of output LUT
#define CLB_OUTPUT_LUT_5_FN_S 15U
#define CLB_OUTPUT_LUT_5_FN_M 0x7F8000U // Output function for output LUT
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_LUT_6 register
//
//*************************************************************************************************
#define CLB_OUTPUT_LUT_6_IN0_S 0U
#define CLB_OUTPUT_LUT_6_IN0_M 0x1FU // Select value for IN0 of output LUT
#define CLB_OUTPUT_LUT_6_IN1_S 5U
#define CLB_OUTPUT_LUT_6_IN1_M 0x3E0U // Select value for IN1 of output LUT
#define CLB_OUTPUT_LUT_6_IN2_S 10U
#define CLB_OUTPUT_LUT_6_IN2_M 0x7C00U // Select value for IN2 of output LUT
#define CLB_OUTPUT_LUT_6_FN_S 15U
#define CLB_OUTPUT_LUT_6_FN_M 0x7F8000U // Output function for output LUT
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_LUT_7 register
//
//*************************************************************************************************
#define CLB_OUTPUT_LUT_7_IN0_S 0U
#define CLB_OUTPUT_LUT_7_IN0_M 0x1FU // Select value for IN0 of output LUT
#define CLB_OUTPUT_LUT_7_IN1_S 5U
#define CLB_OUTPUT_LUT_7_IN1_M 0x3E0U // Select value for IN1 of output LUT
#define CLB_OUTPUT_LUT_7_IN2_S 10U
#define CLB_OUTPUT_LUT_7_IN2_M 0x7C00U // Select value for IN2 of output LUT
#define CLB_OUTPUT_LUT_7_FN_S 15U
#define CLB_OUTPUT_LUT_7_FN_M 0x7F8000U // Output function for output LUT
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_HLC_EVENT_SEL register
//
//*************************************************************************************************
#define CLB_HLC_EVENT_SEL_EVENT0_SEL_S 0U
#define CLB_HLC_EVENT_SEL_EVENT0_SEL_M 0x1FU // Event Select 0
#define CLB_HLC_EVENT_SEL_EVENT1_SEL_S 5U
#define CLB_HLC_EVENT_SEL_EVENT1_SEL_M 0x3E0U // Event Select 1
#define CLB_HLC_EVENT_SEL_EVENT2_SEL_S 10U
#define CLB_HLC_EVENT_SEL_EVENT2_SEL_M 0x7C00U // Event Select 2
#define CLB_HLC_EVENT_SEL_EVENT3_SEL_S 15U
#define CLB_HLC_EVENT_SEL_EVENT3_SEL_M 0xF8000U // Event Select 3
#define CLB_HLC_EVENT_SEL_ALT_EVENT0_SEL 0x100000U // Event Select 3
#define CLB_HLC_EVENT_SEL_ALT_EVENT1_SEL 0x200000U // Event Select 3
#define CLB_HLC_EVENT_SEL_ALT_EVENT2_SEL 0x400000U // Event Select 3
#define CLB_HLC_EVENT_SEL_ALT_EVENT3_SEL 0x800000U // Event Select 3
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_COUNT_MATCH_TAP_SEL register
//
//*************************************************************************************************
#define CLB_COUNT_MATCH_TAP_SEL_COUNT0_MATCH1_S 0U
#define CLB_COUNT_MATCH_TAP_SEL_COUNT0_MATCH1_M 0x1FU // Match1 tap select for Counter 0
#define CLB_COUNT_MATCH_TAP_SEL_COUNT1_MATCH1_S 5U
#define CLB_COUNT_MATCH_TAP_SEL_COUNT1_MATCH1_M 0x3E0U // Match1 tap select for Counter 1
#define CLB_COUNT_MATCH_TAP_SEL_COUNT2_MATCH1_S 10U
#define CLB_COUNT_MATCH_TAP_SEL_COUNT2_MATCH1_M 0x7C00U // Match1 tap select for Counter 2
#define CLB_COUNT_MATCH_TAP_SEL_COUNT0_MATCH2_S 16U
#define CLB_COUNT_MATCH_TAP_SEL_COUNT0_MATCH2_M 0x1F0000U // Match2 tap select for Counter 0
#define CLB_COUNT_MATCH_TAP_SEL_COUNT1_MATCH2_S 21U
#define CLB_COUNT_MATCH_TAP_SEL_COUNT1_MATCH2_M 0x3E00000U // Match2 tap select for Counter 1
#define CLB_COUNT_MATCH_TAP_SEL_COUNT2_MATCH2_S 26U
#define CLB_COUNT_MATCH_TAP_SEL_COUNT2_MATCH2_M 0x7C000000U // Match2 tap select for Counter 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_COND_CTRL_0 register
//
//*************************************************************************************************
#define CLB_OUTPUT_COND_CTRL_0_LEVEL_1_SEL 0x1U // Level 1 Mux Select
#define CLB_OUTPUT_COND_CTRL_0_LEVEL_2_SEL_S 1U
#define CLB_OUTPUT_COND_CTRL_0_LEVEL_2_SEL_M 0x6U // Level 2 Mux Select
#define CLB_OUTPUT_COND_CTRL_0_LEVEL_3_SEL_S 3U
#define CLB_OUTPUT_COND_CTRL_0_LEVEL_3_SEL_M 0x18U // Level 3 Mux Select
#define CLB_OUTPUT_COND_CTRL_0_SEL_GATING_CTRL_S 5U
#define CLB_OUTPUT_COND_CTRL_0_SEL_GATING_CTRL_M 0xE0U // Gating control mux select
#define CLB_OUTPUT_COND_CTRL_0_SEL_RELEASE_CTRL_S 8U
#define CLB_OUTPUT_COND_CTRL_0_SEL_RELEASE_CTRL_M 0x700U // Releast control mux select
#define CLB_OUTPUT_COND_CTRL_0_HW_GATING_CTRL_SEL 0x800U // Select HW for gating control
#define CLB_OUTPUT_COND_CTRL_0_HW_RLS_CTRL_SEL 0x1000U // Select HW for release control
#define CLB_OUTPUT_COND_CTRL_0_SEL_RAW_IN 0x2000U // Select input mode for the CLB AOC
#define CLB_OUTPUT_COND_CTRL_0_ASYNC_COND_EN 0x4000U // Enable for conditioning
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_COND_CTRL_1 register
//
//*************************************************************************************************
#define CLB_OUTPUT_COND_CTRL_1_LEVEL_1_SEL 0x1U // Level 1 Mux Select
#define CLB_OUTPUT_COND_CTRL_1_LEVEL_2_SEL_S 1U
#define CLB_OUTPUT_COND_CTRL_1_LEVEL_2_SEL_M 0x6U // Level 2 Mux Select
#define CLB_OUTPUT_COND_CTRL_1_LEVEL_3_SEL_S 3U
#define CLB_OUTPUT_COND_CTRL_1_LEVEL_3_SEL_M 0x18U // Level 3 Mux Select
#define CLB_OUTPUT_COND_CTRL_1_SEL_GATING_CTRL_S 5U
#define CLB_OUTPUT_COND_CTRL_1_SEL_GATING_CTRL_M 0xE0U // Gating control mux select
#define CLB_OUTPUT_COND_CTRL_1_SEL_RELEASE_CTRL_S 8U
#define CLB_OUTPUT_COND_CTRL_1_SEL_RELEASE_CTRL_M 0x700U // Releast control mux select
#define CLB_OUTPUT_COND_CTRL_1_HW_GATING_CTRL_SEL 0x800U // Select HW for gating control
#define CLB_OUTPUT_COND_CTRL_1_HW_RLS_CTRL_SEL 0x1000U // Select HW for release control
#define CLB_OUTPUT_COND_CTRL_1_SEL_RAW_IN 0x2000U // Select input mode for the CLB AOC
#define CLB_OUTPUT_COND_CTRL_1_ASYNC_COND_EN 0x4000U // Enable for conditioning
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_COND_CTRL_2 register
//
//*************************************************************************************************
#define CLB_OUTPUT_COND_CTRL_2_LEVEL_1_SEL 0x1U // Level 1 Mux Select
#define CLB_OUTPUT_COND_CTRL_2_LEVEL_2_SEL_S 1U
#define CLB_OUTPUT_COND_CTRL_2_LEVEL_2_SEL_M 0x6U // Level 2 Mux Select
#define CLB_OUTPUT_COND_CTRL_2_LEVEL_3_SEL_S 3U
#define CLB_OUTPUT_COND_CTRL_2_LEVEL_3_SEL_M 0x18U // Level 3 Mux Select
#define CLB_OUTPUT_COND_CTRL_2_SEL_GATING_CTRL_S 5U
#define CLB_OUTPUT_COND_CTRL_2_SEL_GATING_CTRL_M 0xE0U // Gating control mux select
#define CLB_OUTPUT_COND_CTRL_2_SEL_RELEASE_CTRL_S 8U
#define CLB_OUTPUT_COND_CTRL_2_SEL_RELEASE_CTRL_M 0x700U // Releast control mux select
#define CLB_OUTPUT_COND_CTRL_2_HW_GATING_CTRL_SEL 0x800U // Select HW for gating control
#define CLB_OUTPUT_COND_CTRL_2_HW_RLS_CTRL_SEL 0x1000U // Select HW for release control
#define CLB_OUTPUT_COND_CTRL_2_SEL_RAW_IN 0x2000U // Select input mode for the CLB AOC
#define CLB_OUTPUT_COND_CTRL_2_ASYNC_COND_EN 0x4000U // Enable for conditioning
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_COND_CTRL_3 register
//
//*************************************************************************************************
#define CLB_OUTPUT_COND_CTRL_3_LEVEL_1_SEL 0x1U // Level 1 Mux Select
#define CLB_OUTPUT_COND_CTRL_3_LEVEL_2_SEL_S 1U
#define CLB_OUTPUT_COND_CTRL_3_LEVEL_2_SEL_M 0x6U // Level 2 Mux Select
#define CLB_OUTPUT_COND_CTRL_3_LEVEL_3_SEL_S 3U
#define CLB_OUTPUT_COND_CTRL_3_LEVEL_3_SEL_M 0x18U // Level 3 Mux Select
#define CLB_OUTPUT_COND_CTRL_3_SEL_GATING_CTRL_S 5U
#define CLB_OUTPUT_COND_CTRL_3_SEL_GATING_CTRL_M 0xE0U // Gating control mux select
#define CLB_OUTPUT_COND_CTRL_3_SEL_RELEASE_CTRL_S 8U
#define CLB_OUTPUT_COND_CTRL_3_SEL_RELEASE_CTRL_M 0x700U // Releast control mux select
#define CLB_OUTPUT_COND_CTRL_3_HW_GATING_CTRL_SEL 0x800U // Select HW for gating control
#define CLB_OUTPUT_COND_CTRL_3_HW_RLS_CTRL_SEL 0x1000U // Select HW for release control
#define CLB_OUTPUT_COND_CTRL_3_SEL_RAW_IN 0x2000U // Select input mode for the CLB AOC
#define CLB_OUTPUT_COND_CTRL_3_ASYNC_COND_EN 0x4000U // Enable for conditioning
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_COND_CTRL_4 register
//
//*************************************************************************************************
#define CLB_OUTPUT_COND_CTRL_4_LEVEL_1_SEL 0x1U // Level 1 Mux Select
#define CLB_OUTPUT_COND_CTRL_4_LEVEL_2_SEL_S 1U
#define CLB_OUTPUT_COND_CTRL_4_LEVEL_2_SEL_M 0x6U // Level 2 Mux Select
#define CLB_OUTPUT_COND_CTRL_4_LEVEL_3_SEL_S 3U
#define CLB_OUTPUT_COND_CTRL_4_LEVEL_3_SEL_M 0x18U // Level 3 Mux Select
#define CLB_OUTPUT_COND_CTRL_4_SEL_GATING_CTRL_S 5U
#define CLB_OUTPUT_COND_CTRL_4_SEL_GATING_CTRL_M 0xE0U // Gating control mux select
#define CLB_OUTPUT_COND_CTRL_4_SEL_RELEASE_CTRL_S 8U
#define CLB_OUTPUT_COND_CTRL_4_SEL_RELEASE_CTRL_M 0x700U // Releast control mux select
#define CLB_OUTPUT_COND_CTRL_4_HW_GATING_CTRL_SEL 0x800U // Select HW for gating control
#define CLB_OUTPUT_COND_CTRL_4_HW_RLS_CTRL_SEL 0x1000U // Select HW for release control
#define CLB_OUTPUT_COND_CTRL_4_SEL_RAW_IN 0x2000U // Select input mode for the CLB AOC
#define CLB_OUTPUT_COND_CTRL_4_ASYNC_COND_EN 0x4000U // Enable for conditioning
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_COND_CTRL_5 register
//
//*************************************************************************************************
#define CLB_OUTPUT_COND_CTRL_5_LEVEL_1_SEL 0x1U // Level 1 Mux Select
#define CLB_OUTPUT_COND_CTRL_5_LEVEL_2_SEL_S 1U
#define CLB_OUTPUT_COND_CTRL_5_LEVEL_2_SEL_M 0x6U // Level 2 Mux Select
#define CLB_OUTPUT_COND_CTRL_5_LEVEL_3_SEL_S 3U
#define CLB_OUTPUT_COND_CTRL_5_LEVEL_3_SEL_M 0x18U // Level 3 Mux Select
#define CLB_OUTPUT_COND_CTRL_5_SEL_GATING_CTRL_S 5U
#define CLB_OUTPUT_COND_CTRL_5_SEL_GATING_CTRL_M 0xE0U // Gating control mux select
#define CLB_OUTPUT_COND_CTRL_5_SEL_RELEASE_CTRL_S 8U
#define CLB_OUTPUT_COND_CTRL_5_SEL_RELEASE_CTRL_M 0x700U // Releast control mux select
#define CLB_OUTPUT_COND_CTRL_5_HW_GATING_CTRL_SEL 0x800U // Select HW for gating control
#define CLB_OUTPUT_COND_CTRL_5_HW_RLS_CTRL_SEL 0x1000U // Select HW for release control
#define CLB_OUTPUT_COND_CTRL_5_SEL_RAW_IN 0x2000U // Select input mode for the CLB AOC
#define CLB_OUTPUT_COND_CTRL_5_ASYNC_COND_EN 0x4000U // Enable for conditioning
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_COND_CTRL_6 register
//
//*************************************************************************************************
#define CLB_OUTPUT_COND_CTRL_6_LEVEL_1_SEL 0x1U // Level 1 Mux Select
#define CLB_OUTPUT_COND_CTRL_6_LEVEL_2_SEL_S 1U
#define CLB_OUTPUT_COND_CTRL_6_LEVEL_2_SEL_M 0x6U // Level 2 Mux Select
#define CLB_OUTPUT_COND_CTRL_6_LEVEL_3_SEL_S 3U
#define CLB_OUTPUT_COND_CTRL_6_LEVEL_3_SEL_M 0x18U // Level 3 Mux Select
#define CLB_OUTPUT_COND_CTRL_6_SEL_GATING_CTRL_S 5U
#define CLB_OUTPUT_COND_CTRL_6_SEL_GATING_CTRL_M 0xE0U // Gating control mux select
#define CLB_OUTPUT_COND_CTRL_6_SEL_RELEASE_CTRL_S 8U
#define CLB_OUTPUT_COND_CTRL_6_SEL_RELEASE_CTRL_M 0x700U // Releast control mux select
#define CLB_OUTPUT_COND_CTRL_6_HW_GATING_CTRL_SEL 0x800U // Select HW for gating control
#define CLB_OUTPUT_COND_CTRL_6_HW_RLS_CTRL_SEL 0x1000U // Select HW for release control
#define CLB_OUTPUT_COND_CTRL_6_SEL_RAW_IN 0x2000U // Select input mode for the CLB AOC
#define CLB_OUTPUT_COND_CTRL_6_ASYNC_COND_EN 0x4000U // Enable for conditioning
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_OUTPUT_COND_CTRL_7 register
//
//*************************************************************************************************
#define CLB_OUTPUT_COND_CTRL_7_LEVEL_1_SEL 0x1U // Level 1 Mux Select
#define CLB_OUTPUT_COND_CTRL_7_LEVEL_2_SEL_S 1U
#define CLB_OUTPUT_COND_CTRL_7_LEVEL_2_SEL_M 0x6U // Level 2 Mux Select
#define CLB_OUTPUT_COND_CTRL_7_LEVEL_3_SEL_S 3U
#define CLB_OUTPUT_COND_CTRL_7_LEVEL_3_SEL_M 0x18U // Level 3 Mux Select
#define CLB_OUTPUT_COND_CTRL_7_SEL_GATING_CTRL_S 5U
#define CLB_OUTPUT_COND_CTRL_7_SEL_GATING_CTRL_M 0xE0U // Gating control mux select
#define CLB_OUTPUT_COND_CTRL_7_SEL_RELEASE_CTRL_S 8U
#define CLB_OUTPUT_COND_CTRL_7_SEL_RELEASE_CTRL_M 0x700U // Releast control mux select
#define CLB_OUTPUT_COND_CTRL_7_HW_GATING_CTRL_SEL 0x800U // Select HW for gating control
#define CLB_OUTPUT_COND_CTRL_7_HW_RLS_CTRL_SEL 0x1000U // Select HW for release control
#define CLB_OUTPUT_COND_CTRL_7_SEL_RAW_IN 0x2000U // Select input mode for the CLB AOC
#define CLB_OUTPUT_COND_CTRL_7_ASYNC_COND_EN 0x4000U // Enable for conditioning
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_MISC_ACCESS_CTRL register
//
//*************************************************************************************************
#define CLB_MISC_ACCESS_CTRL_SPIEN 0x1U // Enable CLB SPI Buffer feature
#define CLB_MISC_ACCESS_CTRL_BLKEN 0x2U // Block Register write
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_SPI_DATA_CTRL_HI register
//
//*************************************************************************************************
#define CLB_SPI_DATA_CTRL_HI_STRB_S 0U
#define CLB_SPI_DATA_CTRL_HI_STRB_M 0x1FU // Select value for strobe
#define CLB_SPI_DATA_CTRL_HI_SHIFT_S 8U
#define CLB_SPI_DATA_CTRL_HI_SHIFT_M 0x1F00U // Shift value select
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_LOAD_EN register
//
//*************************************************************************************************
#define CLB_LOAD_EN_LOAD_EN 0x1U // Load Enable
#define CLB_LOAD_EN_GLOBAL_EN 0x2U // Global Enable
#define CLB_LOAD_EN_STOP 0x4U // Debug stop control
#define CLB_LOAD_EN_NMI_EN 0x8U // NMI output enable
#define CLB_LOAD_EN_PIPELINE_EN 0x10U // Enable input pipelining
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_LOAD_ADDR register
//
//*************************************************************************************************
#define CLB_LOAD_ADDR_ADDR_S 0U
#define CLB_LOAD_ADDR_ADDR_M 0x3FU // Indirect Address
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_INPUT_FILTER register
//
//*************************************************************************************************
#define CLB_INPUT_FILTER_FIN0_S 0U
#define CLB_INPUT_FILTER_FIN0_M 0x3U // Input filter control 0
#define CLB_INPUT_FILTER_FIN1_S 2U
#define CLB_INPUT_FILTER_FIN1_M 0xCU // Input filter control 1
#define CLB_INPUT_FILTER_FIN2_S 4U
#define CLB_INPUT_FILTER_FIN2_M 0x30U // Input filter control 2
#define CLB_INPUT_FILTER_FIN3_S 6U
#define CLB_INPUT_FILTER_FIN3_M 0xC0U // Input filter control 3
#define CLB_INPUT_FILTER_FIN4_S 8U
#define CLB_INPUT_FILTER_FIN4_M 0x300U // Input filter control 4
#define CLB_INPUT_FILTER_FIN5_S 10U
#define CLB_INPUT_FILTER_FIN5_M 0xC00U // Input filter control 5
#define CLB_INPUT_FILTER_FIN6_S 12U
#define CLB_INPUT_FILTER_FIN6_M 0x3000U // Input filter control 6
#define CLB_INPUT_FILTER_FIN7_S 14U
#define CLB_INPUT_FILTER_FIN7_M 0xC000U // Input filter control 7
#define CLB_INPUT_FILTER_SYNC0 0x10000U // Synchronizer control 0
#define CLB_INPUT_FILTER_SYNC1 0x20000U // Synchronizer control 1
#define CLB_INPUT_FILTER_SYNC2 0x40000U // Synchronizer control 2
#define CLB_INPUT_FILTER_SYNC3 0x80000U // Synchronizer control 3
#define CLB_INPUT_FILTER_SYNC4 0x100000U // Synchronizer control 4
#define CLB_INPUT_FILTER_SYNC5 0x200000U // Synchronizer control 5
#define CLB_INPUT_FILTER_SYNC6 0x400000U // Synchronizer control 6
#define CLB_INPUT_FILTER_SYNC7 0x800000U // Synchronizer control 7
#define CLB_INPUT_FILTER_PIPE0 0x1000000U // Enable pipeline 0
#define CLB_INPUT_FILTER_PIPE1 0x2000000U // Enable pipeline 1
#define CLB_INPUT_FILTER_PIPE2 0x4000000U // Enable pipeline 2
#define CLB_INPUT_FILTER_PIPE3 0x8000000U // Enable pipeline 3
#define CLB_INPUT_FILTER_PIPE4 0x10000000U // Enable pipeline 4
#define CLB_INPUT_FILTER_PIPE5 0x20000000U // Enable pipeline 5
#define CLB_INPUT_FILTER_PIPE6 0x40000000U // Enable pipeline 6
#define CLB_INPUT_FILTER_PIPE7 0x80000000U // Enable pipeline 7
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_IN_MUX_SEL_0 register
//
//*************************************************************************************************
#define CLB_IN_MUX_SEL_0_SEL_GP_IN_0 0x1U // Select GP register 0
#define CLB_IN_MUX_SEL_0_SEL_GP_IN_1 0x2U // Select GP register 1
#define CLB_IN_MUX_SEL_0_SEL_GP_IN_2 0x4U // Select GP register 2
#define CLB_IN_MUX_SEL_0_SEL_GP_IN_3 0x8U // Select GP register 3
#define CLB_IN_MUX_SEL_0_SEL_GP_IN_4 0x10U // Select GP register 4
#define CLB_IN_MUX_SEL_0_SEL_GP_IN_5 0x20U // Select GP register 5
#define CLB_IN_MUX_SEL_0_SEL_GP_IN_6 0x40U // Select GP register 6
#define CLB_IN_MUX_SEL_0_SEL_GP_IN_7 0x80U // Select GP register 7
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_LCL_MUX_SEL_1 register
//
//*************************************************************************************************
#define CLB_LCL_MUX_SEL_1_LCL_MUX_SEL_IN_0_S 0U
#define CLB_LCL_MUX_SEL_1_LCL_MUX_SEL_IN_0_M 0x1FU // Local Mux select 0
#define CLB_LCL_MUX_SEL_1_LCL_MUX_SEL_IN_1_S 5U
#define CLB_LCL_MUX_SEL_1_LCL_MUX_SEL_IN_1_M 0x3E0U // Local Mux select 1
#define CLB_LCL_MUX_SEL_1_LCL_MUX_SEL_IN_2_S 10U
#define CLB_LCL_MUX_SEL_1_LCL_MUX_SEL_IN_2_M 0x7C00U // Local Mux select 2
#define CLB_LCL_MUX_SEL_1_LCL_MUX_SEL_IN_3_S 15U
#define CLB_LCL_MUX_SEL_1_LCL_MUX_SEL_IN_3_M 0xF8000U // Local Mux select 3
#define CLB_LCL_MUX_SEL_1_MISC_INPUT_SEL_0 0x10000000U // Select MISC_INPUT
#define CLB_LCL_MUX_SEL_1_MISC_INPUT_SEL_1 0x20000000U // Select MISC_INPUT
#define CLB_LCL_MUX_SEL_1_MISC_INPUT_SEL_2 0x40000000U // Select MISC_INPUT
#define CLB_LCL_MUX_SEL_1_MISC_INPUT_SEL_3 0x80000000U // Select MISC_INPUT
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_LCL_MUX_SEL_2 register
//
//*************************************************************************************************
#define CLB_LCL_MUX_SEL_2_LCL_MUX_SEL_IN_4_S 0U
#define CLB_LCL_MUX_SEL_2_LCL_MUX_SEL_IN_4_M 0x1FU // Local Mux select 4
#define CLB_LCL_MUX_SEL_2_LCL_MUX_SEL_IN_5_S 5U
#define CLB_LCL_MUX_SEL_2_LCL_MUX_SEL_IN_5_M 0x3E0U // Local Mux select 5
#define CLB_LCL_MUX_SEL_2_LCL_MUX_SEL_IN_6_S 10U
#define CLB_LCL_MUX_SEL_2_LCL_MUX_SEL_IN_6_M 0x7C00U // Local Mux select 6
#define CLB_LCL_MUX_SEL_2_LCL_MUX_SEL_IN_7_S 15U
#define CLB_LCL_MUX_SEL_2_LCL_MUX_SEL_IN_7_M 0xF8000U // Local Mux select 7
#define CLB_LCL_MUX_SEL_2_MISC_INPUT_SEL_4 0x10000000U // Select MISC_INPUT
#define CLB_LCL_MUX_SEL_2_MISC_INPUT_SEL_5 0x20000000U // Select MISC_INPUT
#define CLB_LCL_MUX_SEL_2_MISC_INPUT_SEL_6 0x40000000U // Select MISC_INPUT
#define CLB_LCL_MUX_SEL_2_MISC_INPUT_SEL_7 0x80000000U // Select MISC_INPUT
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_BUF_PTR register
//
//*************************************************************************************************
#define CLB_BUF_PTR_PULL_S 0U
#define CLB_BUF_PTR_PULL_M 0xFFU // Data pointer for pull
#define CLB_BUF_PTR_PUSH_S 16U
#define CLB_BUF_PTR_PUSH_M 0xFF0000U // Data pointer for pull
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_GP_REG register
//
//*************************************************************************************************
#define CLB_GP_REG_REG_S 0U
#define CLB_GP_REG_REG_M 0xFFU // General Purpose bit register
#define CLB_GP_REG_SW_GATING_CTRL_0 0x10000U // Software gating control 0
#define CLB_GP_REG_SW_GATING_CTRL_1 0x20000U // Software gating control 1
#define CLB_GP_REG_SW_GATING_CTRL_2 0x40000U // Software gating control 2
#define CLB_GP_REG_SW_GATING_CTRL_3 0x80000U // Software gating control 3
#define CLB_GP_REG_SW_GATING_CTRL_4 0x100000U // Software gating control 4
#define CLB_GP_REG_SW_GATING_CTRL_5 0x200000U // Software gating control 5
#define CLB_GP_REG_SW_GATING_CTRL_6 0x400000U // Software gating control 6
#define CLB_GP_REG_SW_GATING_CTRL_7 0x800000U // Software gating control 7
#define CLB_GP_REG_SW_RLS_CTRL_0 0x1000000U // Software release control 0
#define CLB_GP_REG_SW_RLS_CTRL_1 0x2000000U // Software release control 1
#define CLB_GP_REG_SW_RLS_CTRL_2 0x4000000U // Software release control 2
#define CLB_GP_REG_SW_RLS_CTRL_3 0x8000000U // Software release control 3
#define CLB_GP_REG_SW_RLS_CTRL_4 0x10000000U // Software release control 4
#define CLB_GP_REG_SW_RLS_CTRL_5 0x20000000U // Software release control 5
#define CLB_GP_REG_SW_RLS_CTRL_6 0x40000000U // Software release control 6
#define CLB_GP_REG_SW_RLS_CTRL_7 0x80000000U // Software release control 7
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_GLBL_MUX_SEL_1 register
//
//*************************************************************************************************
#define CLB_GLBL_MUX_SEL_1_GLBL_MUX_SEL_IN_0_S 0U
#define CLB_GLBL_MUX_SEL_1_GLBL_MUX_SEL_IN_0_M 0x7FU // Global Mux select 0
#define CLB_GLBL_MUX_SEL_1_GLBL_MUX_SEL_IN_1_S 7U
#define CLB_GLBL_MUX_SEL_1_GLBL_MUX_SEL_IN_1_M 0x3F80U // Global Mux select 1
#define CLB_GLBL_MUX_SEL_1_GLBL_MUX_SEL_IN_2_S 14U
#define CLB_GLBL_MUX_SEL_1_GLBL_MUX_SEL_IN_2_M 0x1FC000U // Global Mux select 2
#define CLB_GLBL_MUX_SEL_1_GLBL_MUX_SEL_IN_3_S 21U
#define CLB_GLBL_MUX_SEL_1_GLBL_MUX_SEL_IN_3_M 0xFE00000U // Global Mux select 3
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_GLBL_MUX_SEL_2 register
//
//*************************************************************************************************
#define CLB_GLBL_MUX_SEL_2_GLBL_MUX_SEL_IN_4_S 0U
#define CLB_GLBL_MUX_SEL_2_GLBL_MUX_SEL_IN_4_M 0x7FU // Global Mux select 4
#define CLB_GLBL_MUX_SEL_2_GLBL_MUX_SEL_IN_5_S 7U
#define CLB_GLBL_MUX_SEL_2_GLBL_MUX_SEL_IN_5_M 0x3F80U // Global Mux select 5
#define CLB_GLBL_MUX_SEL_2_GLBL_MUX_SEL_IN_6_S 14U
#define CLB_GLBL_MUX_SEL_2_GLBL_MUX_SEL_IN_6_M 0x1FC000U // Global Mux select 6
#define CLB_GLBL_MUX_SEL_2_GLBL_MUX_SEL_IN_7_S 21U
#define CLB_GLBL_MUX_SEL_2_GLBL_MUX_SEL_IN_7_M 0xFE00000U // Global Mux select 7
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_PRESCALE_CTRL register
//
//*************************************************************************************************
#define CLB_PRESCALE_CTRL_CLKEN 0x1U // Enable the prescale clock generator
#define CLB_PRESCALE_CTRL_STRB 0x2U // Enable the Strobe mode of operation
#define CLB_PRESCALE_CTRL_TAP_S 2U
#define CLB_PRESCALE_CTRL_TAP_M 0x3CU // TAP Select value
#define CLB_PRESCALE_CTRL_PRESCALE_S 16U
#define CLB_PRESCALE_CTRL_PRESCALE_M 0xFFFF0000U // Value of prescale register
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_INTR_TAG_REG register
//
//*************************************************************************************************
#define CLB_INTR_TAG_REG_TAG_S 0U
#define CLB_INTR_TAG_REG_TAG_M 0x3FU // Interrupt tag
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_LOCK register
//
//*************************************************************************************************
#define CLB_LOCK_LOCK 0x1U // LOCK enable
#define CLB_LOCK_KEY_S 16U
#define CLB_LOCK_KEY_M 0xFFFF0000U // Key for enabling write
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_HLC_INSTR_READ_PTR register
//
//*************************************************************************************************
#define CLB_HLC_INSTR_READ_PTR_READ_PTR_S 0U
#define CLB_HLC_INSTR_READ_PTR_READ_PTR_M 0x1FU // HLC instruction read pointer
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_HLC_INSTR_VALUE register
//
//*************************************************************************************************
#define CLB_HLC_INSTR_VALUE_INSTR_S 0U
#define CLB_HLC_INSTR_VALUE_INSTR_M 0xFFFU // HLC instruction value
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_DBG_OUT_2 register
//
//*************************************************************************************************
#define CLB_DBG_OUT_2_OUT_S 0U
#define CLB_DBG_OUT_2_OUT_M 0xFFU // Outputs of CLB Async block
#define CLB_DBG_OUT_2_IN_S 8U
#define CLB_DBG_OUT_2_IN_M 0xFF00U // CLB CELL Inputs
//*************************************************************************************************
//
// The following are defines for the bit fields in the CLB_DBG_OUT register
//
//*************************************************************************************************
#define CLB_DBG_OUT_COUNT0_MATCH2 0x2U // COUNT_MATCH2 UNIT 0
#define CLB_DBG_OUT_COUNT0_ZERO 0x4U // COUNT_ZERO UNIT 0
#define CLB_DBG_OUT_COUNT0_MATCH1 0x8U // COUNT_MATCH1 UNIT 0
#define CLB_DBG_OUT_FSM0_S0 0x10U // FSM_S0 UNIT 0
#define CLB_DBG_OUT_FSM0_S1 0x20U // FSM_S1 UNIT 0
#define CLB_DBG_OUT_FSM0_LUTOUT 0x40U // FSM_LUT_OUT UNIT 0
#define CLB_DBG_OUT_LUT40_OUT 0x80U // LUT4_OUT UNIT 0
#define CLB_DBG_OUT_COUNT1_MATCH2 0x200U // COUNT_MATCH2 UNIT 1
#define CLB_DBG_OUT_COUNT1_ZERO 0x400U // COUNT_ZERO UNIT 1
#define CLB_DBG_OUT_COUNT1_MATCH1 0x800U // COUNT_MATCH1 UNIT 1
#define CLB_DBG_OUT_FSM1_S0 0x1000U // FSM_S0 UNIT 1
#define CLB_DBG_OUT_FSM1_S1 0x2000U // FSM_S1 UNIT 1
#define CLB_DBG_OUT_FSM1_LUTOUT 0x4000U // FSM_LUT_OUT UNIT 1
#define CLB_DBG_OUT_LUT41_OUT 0x8000U // LUT4_OUT UNIT 1
#define CLB_DBG_OUT_COUNT2_MATCH2 0x20000U // COUNT_MATCH2 UNIT 2
#define CLB_DBG_OUT_COUNT2_ZERO 0x40000U // COUNT_ZERO UNIT 2
#define CLB_DBG_OUT_COUNT2_MATCH1 0x80000U // COUNT_MATCH1 UNIT 2
#define CLB_DBG_OUT_FSM2_S0 0x100000U // FSM_S0 UNIT 2
#define CLB_DBG_OUT_FSM2_S1 0x200000U // FSM_S1 UNIT 2
#define CLB_DBG_OUT_FSM2_LUTOUT 0x400000U // FSM_LUT_OUT UNIT 2
#define CLB_DBG_OUT_LUT42_OUT 0x800000U // LUT4_OUT UNIT 2
#define CLB_DBG_OUT_OUT0 0x1000000U // CELL Output 0
#define CLB_DBG_OUT_OUT1 0x2000000U // CELL Output 1
#define CLB_DBG_OUT_OUT2 0x4000000U // CELL Output 2
#define CLB_DBG_OUT_OUT3 0x8000000U // CELL Output 3
#define CLB_DBG_OUT_OUT4 0x10000000U // CELL Output 4
#define CLB_DBG_OUT_OUT5 0x20000000U // CELL Output 5
#define CLB_DBG_OUT_OUT6 0x40000000U // CELL Output 6
#define CLB_DBG_OUT_OUT7 0x80000000U // CELL Output 7
#endif
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,238 @@
//###########################################################################
//
// FILE: hw_cmpss.h
//
// TITLE: Definitions for the CMPSS 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 HW_CMPSS_H
#define HW_CMPSS_H
//*************************************************************************************************
//
// The following are defines for the CMPSS register offsets
//
//*************************************************************************************************
#define CMPSS_O_COMPCTL 0x0U // CMPSS Comparator Control Register
#define CMPSS_O_COMPHYSCTL 0x1U // CMPSS Comparator Hysteresis Control Register
#define CMPSS_O_COMPSTS 0x2U // CMPSS Comparator Status Register
#define CMPSS_O_COMPSTSCLR 0x3U // CMPSS Comparator Status Clear Register
#define CMPSS_O_COMPDACCTL 0x4U // CMPSS DAC Control Register
#define CMPSS_O_DACHVALS 0x6U // CMPSS High DAC Value Shadow Register
#define CMPSS_O_DACHVALA 0x7U // CMPSS High DAC Value Active Register
#define CMPSS_O_RAMPMAXREFA 0x8U // CMPSS Ramp Max Reference Active Register
#define CMPSS_O_RAMPMAXREFS 0xAU // CMPSS Ramp Max Reference Shadow Register
#define CMPSS_O_RAMPDECVALA 0xCU // CMPSS Ramp Decrement Value Active Register
#define CMPSS_O_RAMPDECVALS 0xEU // CMPSS Ramp Decrement Value Shadow Register
#define CMPSS_O_RAMPSTS 0x10U // CMPSS Ramp Status Register
#define CMPSS_O_DACLVALS 0x12U // CMPSS Low DAC Value Shadow Register
#define CMPSS_O_DACLVALA 0x13U // CMPSS Low DAC Value Active Register
#define CMPSS_O_RAMPDLYA 0x14U // CMPSS Ramp Delay Active Register
#define CMPSS_O_RAMPDLYS 0x15U // CMPSS Ramp Delay Shadow Register
#define CMPSS_O_CTRIPLFILCTL 0x16U // CTRIPL Filter Control Register
#define CMPSS_O_CTRIPLFILCLKCTL 0x17U // CTRIPL Filter Clock Control Register
#define CMPSS_O_CTRIPHFILCTL 0x18U // CTRIPH Filter Control Register
#define CMPSS_O_CTRIPHFILCLKCTL 0x19U // CTRIPH Filter Clock Control Register
#define CMPSS_O_COMPLOCK 0x1AU // CMPSS Lock Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the COMPCTL register
//
//*************************************************************************************************
#define CMPSS_COMPCTL_COMPHSOURCE 0x1U // High Comparator Source Select
#define CMPSS_COMPCTL_COMPHINV 0x2U // High Comparator Invert Select
#define CMPSS_COMPCTL_CTRIPHSEL_S 2U
#define CMPSS_COMPCTL_CTRIPHSEL_M 0xCU // High Comparator Trip Select
#define CMPSS_COMPCTL_CTRIPOUTHSEL_S 4U
#define CMPSS_COMPCTL_CTRIPOUTHSEL_M 0x30U // High Comparator Trip Output Select
#define CMPSS_COMPCTL_ASYNCHEN 0x40U // High Comparator Asynchronous Path Enable
#define CMPSS_COMPCTL_COMPLSOURCE 0x100U // Low Comparator Source Select
#define CMPSS_COMPCTL_COMPLINV 0x200U // Low Comparator Invert Select
#define CMPSS_COMPCTL_CTRIPLSEL_S 10U
#define CMPSS_COMPCTL_CTRIPLSEL_M 0xC00U // Low Comparator Trip Select
#define CMPSS_COMPCTL_CTRIPOUTLSEL_S 12U
#define CMPSS_COMPCTL_CTRIPOUTLSEL_M 0x3000U // Low Comparator Trip Output Select
#define CMPSS_COMPCTL_ASYNCLEN 0x4000U // Low Comparator Asynchronous Path Enable
#define CMPSS_COMPCTL_COMPDACE 0x8000U // Comparator/DAC Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the COMPHYSCTL register
//
//*************************************************************************************************
#define CMPSS_COMPHYSCTL_COMPHYS_S 0U
#define CMPSS_COMPHYSCTL_COMPHYS_M 0xFU // Comparator Hysteresis Trim
//*************************************************************************************************
//
// The following are defines for the bit fields in the COMPSTS register
//
//*************************************************************************************************
#define CMPSS_COMPSTS_COMPHSTS 0x1U // High Comparator Status
#define CMPSS_COMPSTS_COMPHLATCH 0x2U // High Comparator Latched Status
#define CMPSS_COMPSTS_COMPLSTS 0x100U // Low Comparator Status
#define CMPSS_COMPSTS_COMPLLATCH 0x200U // Low Comparator Latched Status
//*************************************************************************************************
//
// The following are defines for the bit fields in the COMPSTSCLR register
//
//*************************************************************************************************
#define CMPSS_COMPSTSCLR_HLATCHCLR 0x2U // High Comparator Latched Status Clear
#define CMPSS_COMPSTSCLR_HSYNCCLREN 0x4U // High Comparator EPWMSYNCPER Clear Enable
#define CMPSS_COMPSTSCLR_LLATCHCLR 0x200U // Low Comparator Latched Status Clear
#define CMPSS_COMPSTSCLR_LSYNCCLREN 0x400U // Low Comparator EPWMSYNCPER Clear Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the COMPDACCTL register
//
//*************************************************************************************************
#define CMPSS_COMPDACCTL_DACSOURCE 0x1U // DAC Source Control
#define CMPSS_COMPDACCTL_RAMPSOURCE_S 1U
#define CMPSS_COMPDACCTL_RAMPSOURCE_M 0x1EU // Ramp Generator Source Control
#define CMPSS_COMPDACCTL_SELREF 0x20U // DAC Reference Select
#define CMPSS_COMPDACCTL_RAMPLOADSEL 0x40U // Ramp Load Select
#define CMPSS_COMPDACCTL_SWLOADSEL 0x80U // Software Load Select
#define CMPSS_COMPDACCTL_BLANKSOURCE_S 8U
#define CMPSS_COMPDACCTL_BLANKSOURCE_M 0xF00U // EPWMBLANK Source Select
#define CMPSS_COMPDACCTL_BLANKEN 0x1000U // EPWMBLANK Enable
#define CMPSS_COMPDACCTL_FREESOFT_S 14U
#define CMPSS_COMPDACCTL_FREESOFT_M 0xC000U // Free/Soft Emulation Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the DACHVALS register
//
//*************************************************************************************************
#define CMPSS_DACHVALS_DACVAL_S 0U
#define CMPSS_DACHVALS_DACVAL_M 0xFFFU // DAC Value Control
//*************************************************************************************************
//
// The following are defines for the bit fields in the DACHVALA register
//
//*************************************************************************************************
#define CMPSS_DACHVALA_DACVAL_S 0U
#define CMPSS_DACHVALA_DACVAL_M 0xFFFU // DAC Value Control
//*************************************************************************************************
//
// The following are defines for the bit fields in the DACLVALS register
//
//*************************************************************************************************
#define CMPSS_DACLVALS_DACVAL_S 0U
#define CMPSS_DACLVALS_DACVAL_M 0xFFFU // DAC Value Control
//*************************************************************************************************
//
// The following are defines for the bit fields in the DACLVALA register
//
//*************************************************************************************************
#define CMPSS_DACLVALA_DACVAL_S 0U
#define CMPSS_DACLVALA_DACVAL_M 0xFFFU // DAC Value Control
//*************************************************************************************************
//
// The following are defines for the bit fields in the RAMPDLYA register
//
//*************************************************************************************************
#define CMPSS_RAMPDLYA_DELAY_S 0U
#define CMPSS_RAMPDLYA_DELAY_M 0x1FFFU // Ramp Delay Value
//*************************************************************************************************
//
// The following are defines for the bit fields in the RAMPDLYS register
//
//*************************************************************************************************
#define CMPSS_RAMPDLYS_DELAY_S 0U
#define CMPSS_RAMPDLYS_DELAY_M 0x1FFFU // Ramp Delay Value
//*************************************************************************************************
//
// The following are defines for the bit fields in the CTRIPLFILCTL register
//
//*************************************************************************************************
#define CMPSS_CTRIPLFILCTL_SAMPWIN_S 4U
#define CMPSS_CTRIPLFILCTL_SAMPWIN_M 0x1F0U // Sample Window
#define CMPSS_CTRIPLFILCTL_THRESH_S 9U
#define CMPSS_CTRIPLFILCTL_THRESH_M 0x3E00U // Majority Voting Threshold
#define CMPSS_CTRIPLFILCTL_FILINIT 0x8000U // Filter Initialization Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the CTRIPLFILCLKCTL register
//
//*************************************************************************************************
#define CMPSS_CTRIPLFILCLKCTL_CLKPRESCALE_S 0U
#define CMPSS_CTRIPLFILCLKCTL_CLKPRESCALE_M 0x3FFU // Sample Clock Prescale
//*************************************************************************************************
//
// The following are defines for the bit fields in the CTRIPHFILCTL register
//
//*************************************************************************************************
#define CMPSS_CTRIPHFILCTL_SAMPWIN_S 4U
#define CMPSS_CTRIPHFILCTL_SAMPWIN_M 0x1F0U // Sample Window
#define CMPSS_CTRIPHFILCTL_THRESH_S 9U
#define CMPSS_CTRIPHFILCTL_THRESH_M 0x3E00U // Majority Voting Threshold
#define CMPSS_CTRIPHFILCTL_FILINIT 0x8000U // Filter Initialization Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the CTRIPHFILCLKCTL register
//
//*************************************************************************************************
#define CMPSS_CTRIPHFILCLKCTL_CLKPRESCALE_S 0U
#define CMPSS_CTRIPHFILCLKCTL_CLKPRESCALE_M 0x3FFU // Sample Clock Prescale
//*************************************************************************************************
//
// The following are defines for the bit fields in the COMPLOCK register
//
//*************************************************************************************************
#define CMPSS_COMPLOCK_COMPCTL 0x1U // COMPCTL Lock
#define CMPSS_COMPLOCK_COMPHYSCTL 0x2U // COMPHYSCTL Lock
#define CMPSS_COMPLOCK_DACCTL 0x4U // DACCTL Lock
#define CMPSS_COMPLOCK_CTRIP 0x8U // CTRIP Lock
#endif
@@ -0,0 +1,112 @@
//###########################################################################
//
// FILE: hw_cputimer.h
//
// TITLE: Definitions for the CPUTIMER 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 HW_CPUTIMER_H
#define HW_CPUTIMER_H
//*************************************************************************************************
//
// The following are defines for the CPUTIMER register offsets
//
//*************************************************************************************************
#define CPUTIMER_O_TIM 0x0U // CPU-Timer, Counter Register
#define CPUTIMER_O_PRD 0x2U // CPU-Timer, Period Register
#define CPUTIMER_O_TCR 0x4U // CPU-Timer, Control Register
#define CPUTIMER_O_TPR 0x6U // CPU-Timer, Prescale Register
#define CPUTIMER_O_TPRH 0x7U // CPU-Timer, Prescale Register High
//*************************************************************************************************
//
// The following are defines for the bit fields in the TIM register
//
//*************************************************************************************************
#define CPUTIMER_TIM_LSW_S 0U
#define CPUTIMER_TIM_LSW_M 0xFFFFU // CPU-Timer Counter Registers
#define CPUTIMER_TIM_MSW_S 16U
#define CPUTIMER_TIM_MSW_M 0xFFFF0000U // CPU-Timer Counter Registers High
//*************************************************************************************************
//
// The following are defines for the bit fields in the PRD register
//
//*************************************************************************************************
#define CPUTIMER_PRD_LSW_S 0U
#define CPUTIMER_PRD_LSW_M 0xFFFFU // CPU-Timer Period Registers
#define CPUTIMER_PRD_MSW_S 16U
#define CPUTIMER_PRD_MSW_M 0xFFFF0000U // CPU-Timer Period Registers High
//*************************************************************************************************
//
// The following are defines for the bit fields in the TCR register
//
//*************************************************************************************************
#define CPUTIMER_TCR_TSS 0x10U // CPU-Timer stop status bit.
#define CPUTIMER_TCR_TRB 0x20U // Timer reload
#define CPUTIMER_TCR_SOFT 0x400U // Emulation modes
#define CPUTIMER_TCR_FREE 0x800U // Emulation modes
#define CPUTIMER_TCR_TIE 0x4000U // CPU-Timer Interrupt Enable.
#define CPUTIMER_TCR_TIF 0x8000U // CPU-Timer Interrupt Flag.
//*************************************************************************************************
//
// The following are defines for the bit fields in the TPR register
//
//*************************************************************************************************
#define CPUTIMER_TPR_TDDR_S 0U
#define CPUTIMER_TPR_TDDR_M 0xFFU // CPU-Timer Divide-Down.
#define CPUTIMER_TPR_PSC_S 8U
#define CPUTIMER_TPR_PSC_M 0xFF00U // CPU-Timer Prescale Counter.
//*************************************************************************************************
//
// The following are defines for the bit fields in the TPRH register
//
//*************************************************************************************************
#define CPUTIMER_TPRH_TDDRH_S 0U
#define CPUTIMER_TPRH_TDDRH_M 0xFFU // CPU-Timer Divide-Down.
#define CPUTIMER_TPRH_PSCH_S 8U
#define CPUTIMER_TPRH_PSCH_M 0xFF00U // CPU-Timer Prescale Counter.
#endif
@@ -0,0 +1,122 @@
//###########################################################################
//
// FILE: hw_dac.h
//
// TITLE: Definitions for the DAC 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 HW_DAC_H
#define HW_DAC_H
//*************************************************************************************************
//
// The following are defines for the DAC register offsets
//
//*************************************************************************************************
#define DAC_O_REV 0x0U // DAC Revision Register
#define DAC_O_CTL 0x1U // DAC Control Register
#define DAC_O_VALA 0x2U // DAC Value Register - Active
#define DAC_O_VALS 0x3U // DAC Value Register - Shadow
#define DAC_O_OUTEN 0x4U // DAC Output Enable Register
#define DAC_O_LOCK 0x5U // DAC Lock Register
#define DAC_O_TRIM 0x6U // DAC Trim Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the DACREV register
//
//*************************************************************************************************
#define DAC_REV_REV_S 0U
#define DAC_REV_REV_M 0xFFU // DAC Revision Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the DACCTL register
//
//*************************************************************************************************
#define DAC_CTL_DACREFSEL 0x1U // DAC Reference Select
#define DAC_CTL_LOADMODE 0x4U // DACVALA Load Mode
#define DAC_CTL_SYNCSEL_S 4U
#define DAC_CTL_SYNCSEL_M 0xF0U // DAC EPWMSYNCPER Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the DACVALA register
//
//*************************************************************************************************
#define DAC_VALA_DACVALA_S 0U
#define DAC_VALA_DACVALA_M 0xFFFU // DAC Active Output Code
//*************************************************************************************************
//
// The following are defines for the bit fields in the DACVALS register
//
//*************************************************************************************************
#define DAC_VALS_DACVALS_S 0U
#define DAC_VALS_DACVALS_M 0xFFFU // DAC Shadow Output Code
//*************************************************************************************************
//
// The following are defines for the bit fields in the DACOUTEN register
//
//*************************************************************************************************
#define DAC_OUTEN_DACOUTEN 0x1U // DAC Output Code
//*************************************************************************************************
//
// The following are defines for the bit fields in the DACLOCK register
//
//*************************************************************************************************
#define DAC_LOCK_DACCTL 0x1U // DAC Control Register Lock
#define DAC_LOCK_DACVAL 0x2U // DAC Value Register Lock
#define DAC_LOCK_DACOUTEN 0x4U // DAC Output Enable Register Lock
#define DAC_LOCK_KEY_S 12U
#define DAC_LOCK_KEY_M 0xF000U // DAC Register Lock Key
//*************************************************************************************************
//
// The following are defines for the bit fields in the DACTRIM register
//
//*************************************************************************************************
#define DAC_TRIM_OFFSET_TRIM_S 0U
#define DAC_TRIM_OFFSET_TRIM_M 0xFFU // DAC Offset Trim
#endif
@@ -0,0 +1,156 @@
//###########################################################################
//
// FILE: hw_dcc.h
//
// TITLE: Definitions for the DCC 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 HW_DCC_H
#define HW_DCC_H
//*************************************************************************************************
//
// The following are defines for the DCC register offsets
//
//*************************************************************************************************
#define DCC_O_GCTRL 0x0U // Starts / stops the counters. Clears the error signal.
#define DCC_O_CNTSEED0 0x8U // Seed value for the counter attached to Clock Source 0.
#define DCC_O_VALIDSEED0 0xCU // Seed value for the timeout counter attached to Clock Source
// 0.
#define DCC_O_CNTSEED1 0x10U // Seed value for the counter attached to Clock Source 1.
#define DCC_O_STATUS 0x14U // Specifies the status of the DCC Module.
#define DCC_O_CNT0 0x18U // Value of the counter attached to Clock Source 0.
#define DCC_O_VALID0 0x1CU // Value of the valid counter attached to Clock Source 0.
#define DCC_O_CNT1 0x20U // Value of the counter attached to Clock Source 1.
#define DCC_O_CLKSRC1 0x24U // Selects the clock source for Counter 1.
#define DCC_O_CLKSRC0 0x28U // Selects the clock source for Counter 0.
//*************************************************************************************************
//
// The following are defines for the bit fields in the DCCGCTRL register
//
//*************************************************************************************************
#define DCC_GCTRL_DCCENA_S 0U
#define DCC_GCTRL_DCCENA_M 0xFU // DCC Enable
#define DCC_GCTRL_ERRENA_S 4U
#define DCC_GCTRL_ERRENA_M 0xF0U // Error Enable
#define DCC_GCTRL_SINGLESHOT_S 8U
#define DCC_GCTRL_SINGLESHOT_M 0xF00U // Single-Shot Enable
#define DCC_GCTRL_DONEENA_S 12U
#define DCC_GCTRL_DONEENA_M 0xF000U // DONE Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the DCCCNTSEED0 register
//
//*************************************************************************************************
#define DCC_CNTSEED0_COUNTSEED0_S 0U
#define DCC_CNTSEED0_COUNTSEED0_M 0xFFFFFU // Seed Value for Counter 0
//*************************************************************************************************
//
// The following are defines for the bit fields in the DCCVALIDSEED0 register
//
//*************************************************************************************************
#define DCC_VALIDSEED0_VALIDSEED_S 0U
#define DCC_VALIDSEED0_VALIDSEED_M 0xFFFFU // Seed Value for Valid Duration Counter 0
//*************************************************************************************************
//
// The following are defines for the bit fields in the DCCCNTSEED1 register
//
//*************************************************************************************************
#define DCC_CNTSEED1_COUNTSEED1_S 0U
#define DCC_CNTSEED1_COUNTSEED1_M 0xFFFFFU // Seed Value for Counter 1
//*************************************************************************************************
//
// The following are defines for the bit fields in the DCCSTATUS register
//
//*************************************************************************************************
#define DCC_STATUS_ERR 0x1U // Error Flag
#define DCC_STATUS_DONE 0x2U // Single-Shot Done Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the DCCCNT0 register
//
//*************************************************************************************************
#define DCC_CNT0_COUNT0_S 0U
#define DCC_CNT0_COUNT0_M 0xFFFFFU // Current Value of Counter 0
//*************************************************************************************************
//
// The following are defines for the bit fields in the DCCVALID0 register
//
//*************************************************************************************************
#define DCC_VALID0_VALID0_S 0U
#define DCC_VALID0_VALID0_M 0xFFFFU // Current Value of Valid 0
//*************************************************************************************************
//
// The following are defines for the bit fields in the DCCCNT1 register
//
//*************************************************************************************************
#define DCC_CNT1_COUNT1_S 0U
#define DCC_CNT1_COUNT1_M 0xFFFFFU // Current Value of Counter 1
//*************************************************************************************************
//
// The following are defines for the bit fields in the DCCCLKSRC1 register
//
//*************************************************************************************************
#define DCC_CLKSRC1_CLKSRC1_S 0U
#define DCC_CLKSRC1_CLKSRC1_M 0x1FU // Clock Source Select for Counter 1
#define DCC_CLKSRC1_KEY_S 12U
#define DCC_CLKSRC1_KEY_M 0xF000U // Enables or Disables Clock Source Selection for COUNT1
//*************************************************************************************************
//
// The following are defines for the bit fields in the DCCCLKSRC0 register
//
//*************************************************************************************************
#define DCC_CLKSRC0_CLKSRC0_S 0U
#define DCC_CLKSRC0_CLKSRC0_M 0xFU // Clock Source Select for Counter 0
#define DCC_CLKSRC0_KEY_S 12U
#define DCC_CLKSRC0_KEY_M 0xF000U // Enables or Disables Clock Source Selection for COUNT0
#endif
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,165 @@
//###########################################################################
//
// FILE: hw_dma.h
//
// TITLE: Definitions for the DMA 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 HW_DMA_H
#define HW_DMA_H
//*************************************************************************************************
//
// The following are defines for the DMA register offsets
//
//*************************************************************************************************
#define DMA_O_CTRL 0x0U // DMA Control Register
#define DMA_O_DEBUGCTRL 0x1U // Debug Control Register
#define DMA_O_PRIORITYCTRL1 0x4U // Priority Control 1 Register
#define DMA_O_PRIORITYSTAT 0x6U // Priority Status Register
#define DMA_O_MODE 0x0U // Mode Register
#define DMA_O_CONTROL 0x1U // Control Register
#define DMA_O_BURST_SIZE 0x2U // Burst Size Register
#define DMA_O_BURST_COUNT 0x3U // Burst Count Register
#define DMA_O_SRC_BURST_STEP 0x4U // Source Burst Step Register
#define DMA_O_DST_BURST_STEP 0x5U // Destination Burst Step Register
#define DMA_O_TRANSFER_SIZE 0x6U // Transfer Size Register
#define DMA_O_TRANSFER_COUNT 0x7U // Transfer Count Register
#define DMA_O_SRC_TRANSFER_STEP 0x8U // Source Transfer Step Register
#define DMA_O_DST_TRANSFER_STEP 0x9U // Destination Transfer Step Register
#define DMA_O_SRC_WRAP_SIZE 0xAU // Source Wrap Size Register
#define DMA_O_SRC_WRAP_COUNT 0xBU // Source Wrap Count Register
#define DMA_O_SRC_WRAP_STEP 0xCU // Source Wrap Step Register
#define DMA_O_DST_WRAP_SIZE 0xDU // Destination Wrap Size Register
#define DMA_O_DST_WRAP_COUNT 0xEU // Destination Wrap Count Register
#define DMA_O_DST_WRAP_STEP 0xFU // Destination Wrap Step Register
#define DMA_O_SRC_BEG_ADDR_SHADOW 0x10U // Source Begin Address Shadow Register
#define DMA_O_SRC_ADDR_SHADOW 0x12U // Source Address Shadow Register
#define DMA_O_SRC_BEG_ADDR_ACTIVE 0x14U // Source Begin Address Active Register
#define DMA_O_SRC_ADDR_ACTIVE 0x16U // Source Address Active Register
#define DMA_O_DST_BEG_ADDR_SHADOW 0x18U // Destination Begin Address Shadow Register
#define DMA_O_DST_ADDR_SHADOW 0x1AU // Destination Address Shadow Register
#define DMA_O_DST_BEG_ADDR_ACTIVE 0x1CU // Destination Begin Address Active Register
#define DMA_O_DST_ADDR_ACTIVE 0x1EU // Destination Address Active Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the DMACTRL register
//
//*************************************************************************************************
#define DMA_CTRL_HARDRESET 0x1U // Hard Reset Bit
#define DMA_CTRL_PRIORITYRESET 0x2U // Priority Reset Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the DEBUGCTRL register
//
//*************************************************************************************************
#define DMA_DEBUGCTRL_FREE 0x8000U // Debug Mode Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the PRIORITYCTRL1 register
//
//*************************************************************************************************
#define DMA_PRIORITYCTRL1_CH1PRIORITY 0x1U // Ch1 Priority Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the PRIORITYSTAT register
//
//*************************************************************************************************
#define DMA_PRIORITYSTAT_ACTIVESTS_S 0U
#define DMA_PRIORITYSTAT_ACTIVESTS_M 0x7U // Active Channel Status Bits
#define DMA_PRIORITYSTAT_ACTIVESTS_SHADOW_S 4U
#define DMA_PRIORITYSTAT_ACTIVESTS_SHADOW_M 0x70U // Active Channel Status Shadow Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the MODE register
//
//*************************************************************************************************
#define DMA_MODE_PERINTSEL_S 0U
#define DMA_MODE_PERINTSEL_M 0x1FU // Peripheral Interrupt and Sync Select
#define DMA_MODE_OVRINTE 0x80U // Overflow Interrupt Enable
#define DMA_MODE_PERINTE 0x100U // Peripheral Interrupt Enable
#define DMA_MODE_CHINTMODE 0x200U // Channel Interrupt Mode
#define DMA_MODE_ONESHOT 0x400U // One Shot Mode Bit
#define DMA_MODE_CONTINUOUS 0x800U // Continuous Mode Bit
#define DMA_MODE_DATASIZE 0x4000U // Data Size Mode Bit
#define DMA_MODE_CHINTE 0x8000U // Channel Interrupt Enable Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the CONTROL register
//
//*************************************************************************************************
#define DMA_CONTROL_RUN 0x1U // Run Bit
#define DMA_CONTROL_HALT 0x2U // Halt Bit
#define DMA_CONTROL_SOFTRESET 0x4U // Soft Reset Bit
#define DMA_CONTROL_PERINTFRC 0x8U // Interrupt Force Bit
#define DMA_CONTROL_PERINTCLR 0x10U // Interrupt Clear Bit
#define DMA_CONTROL_ERRCLR 0x80U // Error Clear Bit
#define DMA_CONTROL_PERINTFLG 0x100U // Interrupt Flag Bit
#define DMA_CONTROL_TRANSFERSTS 0x800U // Transfer Status Bit
#define DMA_CONTROL_BURSTSTS 0x1000U // Burst Status Bit
#define DMA_CONTROL_RUNSTS 0x2000U // Run Status Bit
#define DMA_CONTROL_OVRFLG 0x4000U // Overflow Flag Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the BURST_SIZE register
//
//*************************************************************************************************
#define DMA_BURST_SIZE_BURSTSIZE_S 0U
#define DMA_BURST_SIZE_BURSTSIZE_M 0x1FU // Burst Transfer Size
//*************************************************************************************************
//
// The following are defines for the bit fields in the BURST_COUNT register
//
//*************************************************************************************************
#define DMA_BURST_COUNT_BURSTCOUNT_S 0U
#define DMA_BURST_COUNT_BURSTCOUNT_M 0x1FU // Burst Transfer Size
#endif
@@ -0,0 +1,181 @@
//###########################################################################
//
// FILE: hw_ecap.h
//
// TITLE: Definitions for the ECAP 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 HW_ECAP_H
#define HW_ECAP_H
//*************************************************************************************************
//
// The following are defines for the ECAP register offsets
//
//*************************************************************************************************
#define ECAP_O_TSCTR 0x0U // Time-Stamp Counter
#define ECAP_O_CTRPHS 0x2U // Counter Phase Offset Value Register
#define ECAP_O_CAP1 0x4U // Capture 1 Register
#define ECAP_O_CAP2 0x6U // Capture 2 Register
#define ECAP_O_CAP3 0x8U // Capture 3 Register
#define ECAP_O_CAP4 0xAU // Capture 4 Register
#define ECAP_O_ECCTL0 0x12U // Capture Control Register 0
#define ECAP_O_ECCTL1 0x14U // Capture Control Register 1
#define ECAP_O_ECCTL2 0x15U // Capture Control Register 2
#define ECAP_O_ECEINT 0x16U // Capture Interrupt Enable Register
#define ECAP_O_ECFLG 0x17U // Capture Interrupt Flag Register
#define ECAP_O_ECCLR 0x18U // Capture Interrupt Clear Register
#define ECAP_O_ECFRC 0x19U // Capture Interrupt Force Register
#define ECAP_O_SYNCINSEL 0x1EU // SYNC source select register
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECCTL0 register
//
//*************************************************************************************************
#define ECAP_ECCTL0_INPUTSEL_S 0U
#define ECAP_ECCTL0_INPUTSEL_M 0x7FU // INPUT source select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECCTL1 register
//
//*************************************************************************************************
#define ECAP_ECCTL1_CAP1POL 0x1U // Capture Event 1 Polarity select
#define ECAP_ECCTL1_CTRRST1 0x2U // Counter Reset on Capture Event 1
#define ECAP_ECCTL1_CAP2POL 0x4U // Capture Event 2 Polarity select
#define ECAP_ECCTL1_CTRRST2 0x8U // Counter Reset on Capture Event 2
#define ECAP_ECCTL1_CAP3POL 0x10U // Capture Event 3 Polarity select
#define ECAP_ECCTL1_CTRRST3 0x20U // Counter Reset on Capture Event 3
#define ECAP_ECCTL1_CAP4POL 0x40U // Capture Event 4 Polarity select
#define ECAP_ECCTL1_CTRRST4 0x80U // Counter Reset on Capture Event 4
#define ECAP_ECCTL1_CAPLDEN 0x100U // Enable Loading CAP1-4 regs on a Cap Event
#define ECAP_ECCTL1_PRESCALE_S 9U
#define ECAP_ECCTL1_PRESCALE_M 0x3E00U // Event Filter prescale select
#define ECAP_ECCTL1_FREE_SOFT_S 14U
#define ECAP_ECCTL1_FREE_SOFT_M 0xC000U // Emulation mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECCTL2 register
//
//*************************************************************************************************
#define ECAP_ECCTL2_CONT_ONESHT 0x1U // Continuous or one-shot
#define ECAP_ECCTL2_STOP_WRAP_S 1U
#define ECAP_ECCTL2_STOP_WRAP_M 0x6U // Stop value for one-shot, Wrap for continuous
#define ECAP_ECCTL2_REARM 0x8U // One-shot re-arm
#define ECAP_ECCTL2_TSCTRSTOP 0x10U // TSCNT counter stop
#define ECAP_ECCTL2_SYNCI_EN 0x20U // Counter sync-in select
#define ECAP_ECCTL2_SYNCO_SEL_S 6U
#define ECAP_ECCTL2_SYNCO_SEL_M 0xC0U // Sync-out mode
#define ECAP_ECCTL2_SWSYNC 0x100U // SW forced counter sync
#define ECAP_ECCTL2_CAP_APWM 0x200U // CAP/APWM operating mode select
#define ECAP_ECCTL2_APWMPOL 0x400U // APWM output polarity select
#define ECAP_ECCTL2_CTRFILTRESET 0x800U // Reset event filter, modulus counter, and interrupt
// flags.
#define ECAP_ECCTL2_DMAEVTSEL_S 12U
#define ECAP_ECCTL2_DMAEVTSEL_M 0x3000U // DMA event select
#define ECAP_ECCTL2_MODCNTRSTS_S 14U
#define ECAP_ECCTL2_MODCNTRSTS_M 0xC000U // modulo counter status
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECEINT register
//
//*************************************************************************************************
#define ECAP_ECEINT_CEVT1 0x2U // Capture Event 1 Interrupt Enable
#define ECAP_ECEINT_CEVT2 0x4U // Capture Event 2 Interrupt Enable
#define ECAP_ECEINT_CEVT3 0x8U // Capture Event 3 Interrupt Enable
#define ECAP_ECEINT_CEVT4 0x10U // Capture Event 4 Interrupt Enable
#define ECAP_ECEINT_CTROVF 0x20U // Counter Overflow Interrupt Enable
#define ECAP_ECEINT_CTR_EQ_PRD 0x40U // Period Equal Interrupt Enable
#define ECAP_ECEINT_CTR_EQ_CMP 0x80U // Compare Equal Interrupt Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECFLG register
//
//*************************************************************************************************
#define ECAP_ECFLG_INT 0x1U // Global Flag
#define ECAP_ECFLG_CEVT1 0x2U // Capture Event 1 Interrupt Flag
#define ECAP_ECFLG_CEVT2 0x4U // Capture Event 2 Interrupt Flag
#define ECAP_ECFLG_CEVT3 0x8U // Capture Event 3 Interrupt Flag
#define ECAP_ECFLG_CEVT4 0x10U // Capture Event 4 Interrupt Flag
#define ECAP_ECFLG_CTROVF 0x20U // Counter Overflow Interrupt Flag
#define ECAP_ECFLG_CTR_PRD 0x40U // Period Equal Interrupt Flag
#define ECAP_ECFLG_CTR_CMP 0x80U // Compare Equal Interrupt Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECCLR register
//
//*************************************************************************************************
#define ECAP_ECCLR_INT 0x1U // ECAP Global Interrupt Status Clear
#define ECAP_ECCLR_CEVT1 0x2U // Capture Event 1 Status Clear
#define ECAP_ECCLR_CEVT2 0x4U // Capture Event 2 Status Clear
#define ECAP_ECCLR_CEVT3 0x8U // Capture Event 3 Status Clear
#define ECAP_ECCLR_CEVT4 0x10U // Capture Event 4 Status Clear
#define ECAP_ECCLR_CTROVF 0x20U // Counter Overflow Status Clear
#define ECAP_ECCLR_CTR_PRD 0x40U // Period Equal Status Clear
#define ECAP_ECCLR_CTR_CMP 0x80U // Compare Equal Status Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECFRC register
//
//*************************************************************************************************
#define ECAP_ECFRC_CEVT1 0x2U // Capture Event 1 Force Interrupt
#define ECAP_ECFRC_CEVT2 0x4U // Capture Event 2 Force Interrupt
#define ECAP_ECFRC_CEVT3 0x8U // Capture Event 3 Force Interrupt
#define ECAP_ECFRC_CEVT4 0x10U // Capture Event 4 Force Interrupt
#define ECAP_ECFRC_CTROVF 0x20U // Counter Overflow Force Interrupt
#define ECAP_ECFRC_CTR_PRD 0x40U // Period Equal Force Interrupt
#define ECAP_ECFRC_CTR_CMP 0x80U // Compare Equal Force Interrupt
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECAPSYNCINSEL register
//
//*************************************************************************************************
#define ECAP_SYNCINSEL_SEL_S 0U
#define ECAP_SYNCINSEL_SEL_M 0x1FU // SYNCIN source select
#endif
@@ -0,0 +1,259 @@
//###########################################################################
//
// FILE: hw_emif.h
//
// TITLE: Definitions for the EMIF 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 HW_EMIF_H
#define HW_EMIF_H
//*************************************************************************************************
//
// The following are defines for the EMIF register offsets
//
//*************************************************************************************************
#define EMIF_O_RCSR 0x0U // Revision Code and Status Register
#define EMIF_O_ASYNC_WCCR 0x2U // Async Wait Cycle Config Register
#define EMIF_O_SDRAM_CR 0x4U // SDRAM (EMxCS0n) Config Register
#define EMIF_O_SDRAM_RCR 0x6U // SDRAM Refresh Control Register
#define EMIF_O_ASYNC_CS2_CR 0x8U // Async 1 (EMxCS2n) Config Register
#define EMIF_O_ASYNC_CS3_CR 0xAU // Async 2 (EMxCS3n) Config Register
#define EMIF_O_ASYNC_CS4_CR 0xCU // Async 3 (EMxCS4n) Config Register
#define EMIF_O_SDRAM_TR 0x10U // SDRAM Timing Register
#define EMIF_O_TOTAL_SDRAM_AR 0x18U // Total SDRAM Accesses Register
#define EMIF_O_TOTAL_SDRAM_ACTR 0x1AU // Total SDRAM Activate Register
#define EMIF_O_SDR_EXT_TMNG 0x1EU // SDRAM SR/PD Exit Timing Register
#define EMIF_O_INT_RAW 0x20U // Interrupt Raw Register
#define EMIF_O_INT_MSK 0x22U // Interrupt Masked Register
#define EMIF_O_INT_MSK_SET 0x24U // Interrupt Mask Set Register
#define EMIF_O_INT_MSK_CLR 0x26U // Interrupt Mask Clear Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the RCSR register
//
//*************************************************************************************************
#define EMIF_RCSR_MINOR_REVISION_S 0U
#define EMIF_RCSR_MINOR_REVISION_M 0xFFU // Minor Revision.
#define EMIF_RCSR_MAJOR_REVISION_S 8U
#define EMIF_RCSR_MAJOR_REVISION_M 0xFF00U // Major Revision.
#define EMIF_RCSR_MODULE_ID_S 16U
#define EMIF_RCSR_MODULE_ID_M 0x3FFF0000U // EMIF module ID.
#define EMIF_RCSR_FR 0x40000000U // EMIF is running in full rate or half rate.
#define EMIF_RCSR_BE 0x80000000U // EMIF endian mode.
//*************************************************************************************************
//
// The following are defines for the bit fields in the ASYNC_WCCR register
//
//*************************************************************************************************
#define EMIF_ASYNC_WCCR_MAX_EXT_WAIT_S 0U
#define EMIF_ASYNC_WCCR_MAX_EXT_WAIT_M 0xFFU // Maximum Extended Wait cycles.
#define EMIF_ASYNC_WCCR_WP0 0x10000000U // Polarity for EMxWAIT.
//*************************************************************************************************
//
// The following are defines for the bit fields in the SDRAM_CR register
//
//*************************************************************************************************
#define EMIF_SDRAM_CR_PAGESIGE_S 0U
#define EMIF_SDRAM_CR_PAGESIGE_M 0x7U // Page Size.
#define EMIF_SDRAM_CR_IBANK_S 4U
#define EMIF_SDRAM_CR_IBANK_M 0x70U // Internal Bank setup of SDRAM devices.
#define EMIF_SDRAM_CR_BIT_11_9_LOCK 0x100U // Bits 11 to 9 are writable only if this bit
// is set.
#define EMIF_SDRAM_CR_CL_S 9U
#define EMIF_SDRAM_CR_CL_M 0xE00U // CAS Latency.
#define EMIF_SDRAM_CR_NM 0x4000U // Narrow Mode.
#define EMIF_SDRAM_CR_PDWR 0x20000000U // Perform refreshes during Power Down.
#define EMIF_SDRAM_CR_PD 0x40000000U // Power Down.
#define EMIF_SDRAM_CR_SR 0x80000000U // Self Refresh.
//*************************************************************************************************
//
// The following are defines for the bit fields in the SDRAM_RCR register
//
//*************************************************************************************************
#define EMIF_SDRAM_RCR_REFRESH_RATE_S 0U
#define EMIF_SDRAM_RCR_REFRESH_RATE_M 0x1FFFU // Refresh Rate.
//*************************************************************************************************
//
// The following are defines for the bit fields in the ASYNC_CS2_CR register
//
//*************************************************************************************************
#define EMIF_ASYNC_CS2_CR_ASIZE_S 0U
#define EMIF_ASYNC_CS2_CR_ASIZE_M 0x3U // Asynchronous Memory Size.
#define EMIF_ASYNC_CS2_CR_TA_S 2U
#define EMIF_ASYNC_CS2_CR_TA_M 0xCU // Turn Around cycles.
#define EMIF_ASYNC_CS2_CR_R_HOLD_S 4U
#define EMIF_ASYNC_CS2_CR_R_HOLD_M 0x70U // Read Strobe Hold cycles.
#define EMIF_ASYNC_CS2_CR_R_STROBE_S 7U
#define EMIF_ASYNC_CS2_CR_R_STROBE_M 0x1F80U // Read Strobe Duration cycles.
#define EMIF_ASYNC_CS2_CR_R_SETUP_S 13U
#define EMIF_ASYNC_CS2_CR_R_SETUP_M 0x1E000U // Read Strobe Setup cycles.
#define EMIF_ASYNC_CS2_CR_W_HOLD_S 17U
#define EMIF_ASYNC_CS2_CR_W_HOLD_M 0xE0000U // Write Strobe Hold cycles.
#define EMIF_ASYNC_CS2_CR_W_STROBE_S 20U
#define EMIF_ASYNC_CS2_CR_W_STROBE_M 0x3F00000U // Write Strobe Duration cycles.
#define EMIF_ASYNC_CS2_CR_W_SETUP_S 26U
#define EMIF_ASYNC_CS2_CR_W_SETUP_M 0x3C000000U // Write Strobe Setup cycles.
#define EMIF_ASYNC_CS2_CR_EW 0x40000000U // Extend Wait mode.
#define EMIF_ASYNC_CS2_CR_SS 0x80000000U // Select Strobe mode.
//*************************************************************************************************
//
// The following are defines for the bit fields in the ASYNC_CS3_CR register
//
//*************************************************************************************************
#define EMIF_ASYNC_CS3_CR_ASIZE_S 0U
#define EMIF_ASYNC_CS3_CR_ASIZE_M 0x3U // Asynchronous Memory Size.
#define EMIF_ASYNC_CS3_CR_TA_S 2U
#define EMIF_ASYNC_CS3_CR_TA_M 0xCU // Turn Around cycles.
#define EMIF_ASYNC_CS3_CR_R_HOLD_S 4U
#define EMIF_ASYNC_CS3_CR_R_HOLD_M 0x70U // Read Strobe Hold cycles.
#define EMIF_ASYNC_CS3_CR_R_STROBE_S 7U
#define EMIF_ASYNC_CS3_CR_R_STROBE_M 0x1F80U // Read Strobe Duration cycles.
#define EMIF_ASYNC_CS3_CR_R_SETUP_S 13U
#define EMIF_ASYNC_CS3_CR_R_SETUP_M 0x1E000U // Read Strobe Setup cycles.
#define EMIF_ASYNC_CS3_CR_W_HOLD_S 17U
#define EMIF_ASYNC_CS3_CR_W_HOLD_M 0xE0000U // Write Strobe Hold cycles.
#define EMIF_ASYNC_CS3_CR_W_STROBE_S 20U
#define EMIF_ASYNC_CS3_CR_W_STROBE_M 0x3F00000U // Write Strobe Duration cycles.
#define EMIF_ASYNC_CS3_CR_W_SETUP_S 26U
#define EMIF_ASYNC_CS3_CR_W_SETUP_M 0x3C000000U // Write Strobe Setup cycles.
#define EMIF_ASYNC_CS3_CR_EW 0x40000000U // Extend Wait mode.
#define EMIF_ASYNC_CS3_CR_SS 0x80000000U // Select Strobe mode.
//*************************************************************************************************
//
// The following are defines for the bit fields in the ASYNC_CS4_CR register
//
//*************************************************************************************************
#define EMIF_ASYNC_CS4_CR_ASIZE_S 0U
#define EMIF_ASYNC_CS4_CR_ASIZE_M 0x3U // Asynchronous Memory Size.
#define EMIF_ASYNC_CS4_CR_TA_S 2U
#define EMIF_ASYNC_CS4_CR_TA_M 0xCU // Turn Around cycles.
#define EMIF_ASYNC_CS4_CR_R_HOLD_S 4U
#define EMIF_ASYNC_CS4_CR_R_HOLD_M 0x70U // Read Strobe Hold cycles.
#define EMIF_ASYNC_CS4_CR_R_STROBE_S 7U
#define EMIF_ASYNC_CS4_CR_R_STROBE_M 0x1F80U // Read Strobe Duration cycles.
#define EMIF_ASYNC_CS4_CR_R_SETUP_S 13U
#define EMIF_ASYNC_CS4_CR_R_SETUP_M 0x1E000U // Read Strobe Setup cycles.
#define EMIF_ASYNC_CS4_CR_W_HOLD_S 17U
#define EMIF_ASYNC_CS4_CR_W_HOLD_M 0xE0000U // Write Strobe Hold cycles.
#define EMIF_ASYNC_CS4_CR_W_STROBE_S 20U
#define EMIF_ASYNC_CS4_CR_W_STROBE_M 0x3F00000U // Write Strobe Duration cycles.
#define EMIF_ASYNC_CS4_CR_W_SETUP_S 26U
#define EMIF_ASYNC_CS4_CR_W_SETUP_M 0x3C000000U // Write Strobe Setup cycles.
#define EMIF_ASYNC_CS4_CR_EW 0x40000000U // Extend Wait mode.
#define EMIF_ASYNC_CS4_CR_SS 0x80000000U // Select Strobe mode.
//*************************************************************************************************
//
// The following are defines for the bit fields in the SDRAM_TR register
//
//*************************************************************************************************
#define EMIF_SDRAM_TR_T_RRD_S 4U
#define EMIF_SDRAM_TR_T_RRD_M 0x70U // Activate to Activate timing for different bank.
#define EMIF_SDRAM_TR_T_RC_S 8U
#define EMIF_SDRAM_TR_T_RC_M 0xF00U // Activate to Activate timing .
#define EMIF_SDRAM_TR_T_RAS_S 12U
#define EMIF_SDRAM_TR_T_RAS_M 0xF000U // Activate to Precharge timing.
#define EMIF_SDRAM_TR_T_WR_S 16U
#define EMIF_SDRAM_TR_T_WR_M 0x70000U // Last Write to Precharge timing.
#define EMIF_SDRAM_TR_T_RCD_S 20U
#define EMIF_SDRAM_TR_T_RCD_M 0x700000U // Activate to Read/Write timing.
#define EMIF_SDRAM_TR_T_RP_S 24U
#define EMIF_SDRAM_TR_T_RP_M 0x7000000U // Precharge to Activate/Refresh timing.
#define EMIF_SDRAM_TR_T_RFC_S 27U
#define EMIF_SDRAM_TR_T_RFC_M 0xF8000000U // Refresh/Load Mode to Refresh/Activate timing
//*************************************************************************************************
//
// The following are defines for the bit fields in the SDR_EXT_TMNG register
//
//*************************************************************************************************
#define EMIF_SDR_EXT_TMNG_T_XS_S 0U
#define EMIF_SDR_EXT_TMNG_T_XS_M 0x1FU // Self Refresh exit to new command timing.
//*************************************************************************************************
//
// The following are defines for the bit fields in the INT_RAW register
//
//*************************************************************************************************
#define EMIF_INT_RAW_AT 0x1U // Asynchronous Timeout.
#define EMIF_INT_RAW_LT 0x2U // Line Trap.
#define EMIF_INT_RAW_WR_S 2U
#define EMIF_INT_RAW_WR_M 0x3CU // Wait Rise.
//*************************************************************************************************
//
// The following are defines for the bit fields in the INT_MSK register
//
//*************************************************************************************************
#define EMIF_INT_MSK_AT_MASKED 0x1U // Asynchronous Timeout.
#define EMIF_INT_MSK_LT_MASKED 0x2U // Line Trap.
#define EMIF_INT_MSK_WR_MASKED_S 2U
#define EMIF_INT_MSK_WR_MASKED_M 0x3CU // Wait Rise.
//*************************************************************************************************
//
// The following are defines for the bit fields in the INT_MSK_SET register
//
//*************************************************************************************************
#define EMIF_INT_MSK_SET_AT_MASK_SET 0x1U // Asynchronous Timeout.
#define EMIF_INT_MSK_SET_LT_MASK_SET 0x2U // Line Trap.
#define EMIF_INT_MSK_SET_WR_MASK_SET_S 2U
#define EMIF_INT_MSK_SET_WR_MASK_SET_M 0x3CU // Wait Rise.
//*************************************************************************************************
//
// The following are defines for the bit fields in the INT_MSK_CLR register
//
//*************************************************************************************************
#define EMIF_INT_MSK_CLR_AT_MASK_CLR 0x1U // Asynchronous Timeout.
#define EMIF_INT_MSK_CLR_LT_MASK_CLR 0x2U // Line Trap.
#define EMIF_INT_MSK_CLR_WR_MASK_CLR_S 2U
#define EMIF_INT_MSK_CLR_WR_MASK_CLR_M 0x3CU // Wait Rise.
#endif
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,274 @@
//###########################################################################
//
// FILE: hw_eqep.h
//
// TITLE: Definitions for the EQEP 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 HW_EQEP_H
#define HW_EQEP_H
//*************************************************************************************************
//
// The following are defines for the EQEP register offsets
//
//*************************************************************************************************
#define EQEP_O_QPOSCNT 0x0U // Position Counter
#define EQEP_O_QPOSINIT 0x2U // Position Counter Init
#define EQEP_O_QPOSMAX 0x4U // Maximum Position Count
#define EQEP_O_QPOSCMP 0x6U // Position Compare
#define EQEP_O_QPOSILAT 0x8U // Index Position Latch
#define EQEP_O_QPOSSLAT 0xAU // Strobe Position Latch
#define EQEP_O_QPOSLAT 0xCU // Position Latch
#define EQEP_O_QUTMR 0xEU // QEP Unit Timer
#define EQEP_O_QUPRD 0x10U // QEP Unit Period
#define EQEP_O_QWDTMR 0x12U // QEP Watchdog Timer
#define EQEP_O_QWDPRD 0x13U // QEP Watchdog Period
#define EQEP_O_QDECCTL 0x14U // Quadrature Decoder Control
#define EQEP_O_QEPCTL 0x15U // QEP Control
#define EQEP_O_QCAPCTL 0x16U // Qaudrature Capture Control
#define EQEP_O_QPOSCTL 0x17U // Position Compare Control
#define EQEP_O_QEINT 0x18U // QEP Interrupt Control
#define EQEP_O_QFLG 0x19U // QEP Interrupt Flag
#define EQEP_O_QCLR 0x1AU // QEP Interrupt Clear
#define EQEP_O_QFRC 0x1BU // QEP Interrupt Force
#define EQEP_O_QEPSTS 0x1CU // QEP Status
#define EQEP_O_QCTMR 0x1DU // QEP Capture Timer
#define EQEP_O_QCPRD 0x1EU // QEP Capture Period
#define EQEP_O_QCTMRLAT 0x1FU // QEP Capture Latch
#define EQEP_O_QCPRDLAT 0x20U // QEP Capture Period Latch
#define EQEP_O_REV 0x30U // QEP Revision Number
#define EQEP_O_QEPSTROBESEL 0x32U // QEP Strobe select register
#define EQEP_O_QMACTRL 0x34U // QMA Control register
#define EQEP_O_QEPSRCSEL 0x36U // QEP Source Select Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the QDECCTL register
//
//*************************************************************************************************
#define EQEP_QDECCTL_QIDIRE 0x1U // Qep Index Direction Enhancement enable
#define EQEP_QDECCTL_QSP 0x20U // QEPS input polarity
#define EQEP_QDECCTL_QIP 0x40U // QEPI input polarity
#define EQEP_QDECCTL_QBP 0x80U // QEPB input polarity
#define EQEP_QDECCTL_QAP 0x100U // QEPA input polarity
#define EQEP_QDECCTL_IGATE 0x200U // Index pulse gating option
#define EQEP_QDECCTL_SWAP 0x400U // CLK/DIR Signal Source for Position Counter
#define EQEP_QDECCTL_XCR 0x800U // External Clock Rate
#define EQEP_QDECCTL_SPSEL 0x1000U // Sync output pin selection
#define EQEP_QDECCTL_SOEN 0x2000U // Sync output-enable
#define EQEP_QDECCTL_QSRC_S 14U
#define EQEP_QDECCTL_QSRC_M 0xC000U // Position-counter source selection
//*************************************************************************************************
//
// The following are defines for the bit fields in the QEPCTL register
//
//*************************************************************************************************
#define EQEP_QEPCTL_WDE 0x1U // QEP watchdog enable
#define EQEP_QEPCTL_UTE 0x2U // QEP unit timer enable
#define EQEP_QEPCTL_QCLM 0x4U // QEP capture latch mode
#define EQEP_QEPCTL_QPEN 0x8U // Quadrature postotion counter enable
#define EQEP_QEPCTL_IEL_S 4U
#define EQEP_QEPCTL_IEL_M 0x30U // Index event latch
#define EQEP_QEPCTL_SEL 0x40U // Strobe event latch
#define EQEP_QEPCTL_SWI 0x80U // Software init position counter
#define EQEP_QEPCTL_IEI_S 8U
#define EQEP_QEPCTL_IEI_M 0x300U // Index event init of position count
#define EQEP_QEPCTL_SEI_S 10U
#define EQEP_QEPCTL_SEI_M 0xC00U // Strobe event init
#define EQEP_QEPCTL_PCRM_S 12U
#define EQEP_QEPCTL_PCRM_M 0x3000U // Postion counter reset
#define EQEP_QEPCTL_FREE_SOFT_S 14U
#define EQEP_QEPCTL_FREE_SOFT_M 0xC000U // Emulation mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the QCAPCTL register
//
//*************************************************************************************************
#define EQEP_QCAPCTL_UPPS_S 0U
#define EQEP_QCAPCTL_UPPS_M 0xFU // Unit position event prescaler
#define EQEP_QCAPCTL_CCPS_S 4U
#define EQEP_QCAPCTL_CCPS_M 0x70U // eQEP capture timer clock prescaler
#define EQEP_QCAPCTL_CEN 0x8000U // Enable eQEP capture
//*************************************************************************************************
//
// The following are defines for the bit fields in the QPOSCTL register
//
//*************************************************************************************************
#define EQEP_QPOSCTL_PCSPW_S 0U
#define EQEP_QPOSCTL_PCSPW_M 0xFFFU // Position compare sync pulse width
#define EQEP_QPOSCTL_PCE 0x1000U // Position compare enable/disable
#define EQEP_QPOSCTL_PCPOL 0x2000U // Polarity of sync output
#define EQEP_QPOSCTL_PCLOAD 0x4000U // Position compare of shadow load
#define EQEP_QPOSCTL_PCSHDW 0x8000U // Position compare of shadow enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the QEINT register
//
//*************************************************************************************************
#define EQEP_QEINT_PCE 0x2U // Position counter error interrupt enable
#define EQEP_QEINT_QPE 0x4U // Quadrature phase error interrupt enable
#define EQEP_QEINT_QDC 0x8U // Quadrature direction change interrupt enable
#define EQEP_QEINT_WTO 0x10U // Watchdog time out interrupt enable
#define EQEP_QEINT_PCU 0x20U // Position counter underflow interrupt enable
#define EQEP_QEINT_PCO 0x40U // Position counter overflow interrupt enable
#define EQEP_QEINT_PCR 0x80U // Position-compare ready interrupt enable
#define EQEP_QEINT_PCM 0x100U // Position-compare match interrupt enable
#define EQEP_QEINT_SEL 0x200U // Strobe event latch interrupt enable
#define EQEP_QEINT_IEL 0x400U // Index event latch interrupt enable
#define EQEP_QEINT_UTO 0x800U // Unit time out interrupt enable
#define EQEP_QEINT_QMAE 0x1000U // QMA error interrupt enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the QFLG register
//
//*************************************************************************************************
#define EQEP_QFLG_INT 0x1U // Global interrupt status flag
#define EQEP_QFLG_PCE 0x2U // Position counter error interrupt flag
#define EQEP_QFLG_PHE 0x4U // Quadrature phase error interrupt flag
#define EQEP_QFLG_QDC 0x8U // Quadrature direction change interrupt flag
#define EQEP_QFLG_WTO 0x10U // Watchdog timeout interrupt flag
#define EQEP_QFLG_PCU 0x20U // Position counter underflow interrupt flag
#define EQEP_QFLG_PCO 0x40U // Position counter overflow interrupt flag
#define EQEP_QFLG_PCR 0x80U // Position-compare ready interrupt flag
#define EQEP_QFLG_PCM 0x100U // eQEP compare match event interrupt flag
#define EQEP_QFLG_SEL 0x200U // Strobe event latch interrupt flag
#define EQEP_QFLG_IEL 0x400U // Index event latch interrupt flag
#define EQEP_QFLG_UTO 0x800U // Unit time out interrupt flag
#define EQEP_QFLG_QMAE 0x1000U // QMA error interrupt flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the QCLR register
//
//*************************************************************************************************
#define EQEP_QCLR_INT 0x1U // Global interrupt clear flag
#define EQEP_QCLR_PCE 0x2U // Clear position counter error interrupt flag
#define EQEP_QCLR_PHE 0x4U // Clear quadrature phase error interrupt flag
#define EQEP_QCLR_QDC 0x8U // Clear quadrature direction change interrupt flag
#define EQEP_QCLR_WTO 0x10U // Clear watchdog timeout interrupt flag
#define EQEP_QCLR_PCU 0x20U // Clear position counter underflow interrupt flag
#define EQEP_QCLR_PCO 0x40U // Clear position counter overflow interrupt flag
#define EQEP_QCLR_PCR 0x80U // Clear position-compare ready interrupt flag
#define EQEP_QCLR_PCM 0x100U // Clear eQEP compare match event interrupt flag
#define EQEP_QCLR_SEL 0x200U // Clear strobe event latch interrupt flag
#define EQEP_QCLR_IEL 0x400U // Clear index event latch interrupt flag
#define EQEP_QCLR_UTO 0x800U // Clear unit time out interrupt flag
#define EQEP_QCLR_QMAE 0x1000U // Clear QMA error interrupt flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the QFRC register
//
//*************************************************************************************************
#define EQEP_QFRC_PCE 0x2U // Force position counter error interrupt
#define EQEP_QFRC_PHE 0x4U // Force quadrature phase error interrupt
#define EQEP_QFRC_QDC 0x8U // Force quadrature direction change interrupt
#define EQEP_QFRC_WTO 0x10U // Force watchdog time out interrupt
#define EQEP_QFRC_PCU 0x20U // Force position counter underflow interrupt
#define EQEP_QFRC_PCO 0x40U // Force position counter overflow interrupt
#define EQEP_QFRC_PCR 0x80U // Force position-compare ready interrupt
#define EQEP_QFRC_PCM 0x100U // Force position-compare match interrupt
#define EQEP_QFRC_SEL 0x200U // Force strobe event latch interrupt
#define EQEP_QFRC_IEL 0x400U // Force index event latch interrupt
#define EQEP_QFRC_UTO 0x800U // Force unit time out interrupt
#define EQEP_QFRC_QMAE 0x1000U // Force QMA error interrupt
//*************************************************************************************************
//
// The following are defines for the bit fields in the QEPSTS register
//
//*************************************************************************************************
#define EQEP_QEPSTS_PCEF 0x1U // Position counter error flag.
#define EQEP_QEPSTS_FIMF 0x2U // First index marker flag
#define EQEP_QEPSTS_CDEF 0x4U // Capture direction error flag
#define EQEP_QEPSTS_COEF 0x8U // Capture overflow error flag
#define EQEP_QEPSTS_QDLF 0x10U // eQEP direction latch flag
#define EQEP_QEPSTS_QDF 0x20U // Quadrature direction flag
#define EQEP_QEPSTS_FIDF 0x40U // The first index marker
#define EQEP_QEPSTS_UPEVNT 0x80U // Unit position event flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the REV register
//
//*************************************************************************************************
#define EQEP_REV_MAJOR_S 0U
#define EQEP_REV_MAJOR_M 0x7U // Major Revision Number
#define EQEP_REV_MINOR_S 3U
#define EQEP_REV_MINOR_M 0x38U // Minor Revision Number
//*************************************************************************************************
//
// The following are defines for the bit fields in the QEPSTROBESEL register
//
//*************************************************************************************************
#define EQEP_QEPSTROBESEL_STROBESEL_S 0U
#define EQEP_QEPSTROBESEL_STROBESEL_M 0x3U // QMA Mode Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the QMACTRL register
//
//*************************************************************************************************
#define EQEP_QMACTRL_MODE_S 0U
#define EQEP_QMACTRL_MODE_M 0x7U // QMA Mode Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the QEPSRCSEL register
//
//*************************************************************************************************
#define EQEP_QEPSRCSEL_QEPASEL_S 0U
#define EQEP_QEPSRCSEL_QEPASEL_M 0xFU // QEPA Source select
#define EQEP_QEPSRCSEL_QEPBSEL_S 4U
#define EQEP_QEPSRCSEL_QEPBSEL_M 0xF0U // QEPB Source select
#define EQEP_QEPSRCSEL_QEPISEL_S 8U
#define EQEP_QEPSRCSEL_QEPISEL_M 0xF00U // QEPI Source select
#define EQEP_QEPSRCSEL_QEPSSEL_S 12U
#define EQEP_QEPSRCSEL_QEPSSEL_M 0xF000U // QEPS Source select
#endif
@@ -0,0 +1,485 @@
//###########################################################################
//
// FILE: hw_erad.h
//
// TITLE: Definitions for the ERAD 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 HW_ERAD_H
#define HW_ERAD_H
//*************************************************************************************************
//
// The following are defines for the ERAD register offsets
//
//*************************************************************************************************
#define ERAD_O_GLBL_EVENT_STAT 0x0U // Global Event Status Register
#define ERAD_O_GLBL_HALT_STAT 0x2U // Global Halt Status Register
#define ERAD_O_GLBL_ENABLE 0x4U // Global Enable Register
#define ERAD_O_GLBL_CTM_RESET 0x6U // Global Counter Reset
#define ERAD_O_GLBL_NMI_CTL 0x8U // Global Debug NMI control
#define ERAD_O_GLBL_OWNER 0xAU // Global Ownership
#define ERAD_O_GLBL_EVENT_AND_MASK 0xCU // Global Bus Comparator Event AND Mask Register
#define ERAD_O_GLBL_EVENT_OR_MASK 0xEU // Global Bus Comparator Event OR Mask Register
#define ERAD_O_GLBL_AND_EVENT_INT_MASK 0x10U // Global AND Event Interrupt Mask Register
#define ERAD_O_GLBL_OR_EVENT_INT_MASK 0x12U // Global OR Event Interrupt Mask Register
#define ERAD_O_HWBP_MASK 0x0U // HWBP (EBC) Mask Register
#define ERAD_O_HWBP_REF 0x2U // HWBP (EBC) Reference Register
#define ERAD_O_HWBP_CLEAR 0x4U // HWBP (EBC) Clear Register
#define ERAD_O_HWBP_CNTL 0x6U // HWBP (EBC) Control Register
#define ERAD_O_HWBP_STATUS 0x7U // HWBP (EBC) Status Register
#define ERAD_O_CTM_CNTL 0x0U // Counter Control Register
#define ERAD_O_CTM_STATUS 0x1U // Counter Status Register
#define ERAD_O_CTM_REF 0x2U // Counter Reference Register
#define ERAD_O_CTM_COUNT 0x4U // Counter Current Value Register
#define ERAD_O_CTM_MAX_COUNT 0x6U // Counter Max Count Value Register
#define ERAD_O_CTM_INPUT_SEL 0x8U // Counter Input Select Register
#define ERAD_O_CTM_CLEAR 0x9U // Counter Clear Register
#define ERAD_O_CTM_INPUT_SEL_2 0xAU // Counter Input Select Extension Register
#define ERAD_O_CTM_INPUT_COND 0xBU // Counter Input Conditioning Register
#define ERAD_O_CRC_GLOBAL_CTRL 0x0U // CRC_GLOBAL_CRTL
#define ERAD_O_CRC_CURRENT 0x0U // CRC_CURRENT
#define ERAD_O_CRC_SEED 0x2U // CRC SEED value
#define ERAD_O_CRC_QUALIFIER 0x4U // CRC_QUALIFIER
//*************************************************************************************************
//
// The following are defines for the bit fields in the GLBL_EVENT_STAT register
//
//*************************************************************************************************
#define ERAD_GLBL_EVENT_STAT_HWBP1 0x1U // Enhanced Bus Comparator (EBC) Module Event Status
#define ERAD_GLBL_EVENT_STAT_HWBP2 0x2U // Enhanced Bus Comparator (EBC) Module Event Status
#define ERAD_GLBL_EVENT_STAT_HWBP3 0x4U // Enhanced Bus Comparator (EBC) Module Event Status
#define ERAD_GLBL_EVENT_STAT_HWBP4 0x8U // Enhanced Bus Comparator (EBC) Module Event Status
#define ERAD_GLBL_EVENT_STAT_HWBP5 0x10U // Enhanced Bus Comparator (EBC) Module Event Status
#define ERAD_GLBL_EVENT_STAT_HWBP6 0x20U // Enhanced Bus Comparator (EBC) Module Event Status
#define ERAD_GLBL_EVENT_STAT_HWBP7 0x40U // Enhanced Bus Comparator (EBC) Module Event Status
#define ERAD_GLBL_EVENT_STAT_HWBP8 0x80U // Enhanced Bus Comparator (EBC) Module Event Status
#define ERAD_GLBL_EVENT_STAT_CTM1 0x100U // Counter Module Event Status
#define ERAD_GLBL_EVENT_STAT_CTM2 0x200U // Counter Module Event Status
#define ERAD_GLBL_EVENT_STAT_CTM3 0x400U // Counter Module Event Status
#define ERAD_GLBL_EVENT_STAT_CTM4 0x800U // Counter Module Event Status
//*************************************************************************************************
//
// The following are defines for the bit fields in the GLBL_HALT_STAT register
//
//*************************************************************************************************
#define ERAD_GLBL_HALT_STAT_HWBP1 0x1U // Enhanced Bus Comparator (EBC) Module Halt Status
#define ERAD_GLBL_HALT_STAT_HWBP2 0x2U // Enhanced Bus Comparator (EBC) Module Halt Status
#define ERAD_GLBL_HALT_STAT_HWBP3 0x4U // Enhanced Bus Comparator (EBC) Module Halt Status
#define ERAD_GLBL_HALT_STAT_HWBP4 0x8U // Enhanced Bus Comparator (EBC) Module Halt Status
#define ERAD_GLBL_HALT_STAT_HWBP5 0x10U // Enhanced Bus Comparator (EBC) Module Halt Status
#define ERAD_GLBL_HALT_STAT_HWBP6 0x20U // Enhanced Bus Comparator (EBC) Module Halt Status
#define ERAD_GLBL_HALT_STAT_HWBP7 0x40U // Enhanced Bus Comparator (EBC) Module Halt Status
#define ERAD_GLBL_HALT_STAT_HWBP8 0x80U // Enhanced Bus Comparator (EBC) Module Halt Status
#define ERAD_GLBL_HALT_STAT_CTM1 0x100U // Counter Module Halt Status
#define ERAD_GLBL_HALT_STAT_CTM2 0x200U // Counter Module Halt Status
#define ERAD_GLBL_HALT_STAT_CTM3 0x400U // Counter Module Halt Status
#define ERAD_GLBL_HALT_STAT_CTM4 0x800U // Counter Module Halt Status
//*************************************************************************************************
//
// The following are defines for the bit fields in the GLBL_ENABLE register
//
//*************************************************************************************************
#define ERAD_GLBL_ENABLE_HWBP1 0x1U // Enhanced Bus Comparator (EBC) Module Global Enable
#define ERAD_GLBL_ENABLE_HWBP2 0x2U // Enhanced Bus Comparator (EBC) Module Global Enable
#define ERAD_GLBL_ENABLE_HWBP3 0x4U // Enhanced Bus Comparator (EBC) Module Global Enable
#define ERAD_GLBL_ENABLE_HWBP4 0x8U // Enhanced Bus Comparator (EBC) Module Global Enable
#define ERAD_GLBL_ENABLE_HWBP5 0x10U // Enhanced Bus Comparator (EBC) Module Global Enable
#define ERAD_GLBL_ENABLE_HWBP6 0x20U // Enhanced Bus Comparator (EBC) Module Global Enable
#define ERAD_GLBL_ENABLE_HWBP7 0x40U // Enhanced Bus Comparator (EBC) Module Global Enable
#define ERAD_GLBL_ENABLE_HWBP8 0x80U // Enhanced Bus Comparator (EBC) Module Global Enable
#define ERAD_GLBL_ENABLE_CTM1 0x100U // Counter Module Global Enable
#define ERAD_GLBL_ENABLE_CTM2 0x200U // Counter Module Global Enable
#define ERAD_GLBL_ENABLE_CTM3 0x400U // Counter Module Global Enable
#define ERAD_GLBL_ENABLE_CTM4 0x800U // Counter Module Global Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the GLBL_CTM_RESET register
//
//*************************************************************************************************
#define ERAD_GLBL_CTM_RESET_CTM1 0x1U // Global Reset for the counters
#define ERAD_GLBL_CTM_RESET_CTM2 0x2U // Global Reset for the counters
#define ERAD_GLBL_CTM_RESET_CTM3 0x4U // Global Reset for the counters
#define ERAD_GLBL_CTM_RESET_CTM4 0x8U // Global Reset for the counters
//*************************************************************************************************
//
// The following are defines for the bit fields in the GLBL_NMI_CTL register
//
//*************************************************************************************************
#define ERAD_GLBL_NMI_CTL_HWBP1 0x1U // Enhanced Bus Comparator (EBC) non-maskable interrupt
// enable
#define ERAD_GLBL_NMI_CTL_HWBP2 0x2U // Enhanced Bus Comparator (EBC) non-maskable interrupt
// enable
#define ERAD_GLBL_NMI_CTL_HWBP3 0x4U // Enhanced Bus Comparator (EBC) non-maskable interrupt
// enable
#define ERAD_GLBL_NMI_CTL_HWBP4 0x8U // Enhanced Bus Comparator (EBC) non-maskable interrupt
// enable
#define ERAD_GLBL_NMI_CTL_HWBP5 0x10U // Enhanced Bus Comparator (EBC) non-maskable interrupt
// enable
#define ERAD_GLBL_NMI_CTL_HWBP6 0x20U // Enhanced Bus Comparator (EBC) non-maskable interrupt
// enable
#define ERAD_GLBL_NMI_CTL_HWBP7 0x40U // Enhanced Bus Comparator (EBC) non-maskable interrupt
// enable
#define ERAD_GLBL_NMI_CTL_HWBP8 0x80U // Enhanced Bus Comparator (EBC) non-maskable interrupt
// enable
#define ERAD_GLBL_NMI_CTL_CTM1 0x100U // Counter non-maskable interrupt enable
#define ERAD_GLBL_NMI_CTL_CTM2 0x200U // Counter non-maskable interrupt enable
#define ERAD_GLBL_NMI_CTL_CTM3 0x400U // Counter non-maskable interrupt enable
#define ERAD_GLBL_NMI_CTL_CTM4 0x800U // Counter non-maskable interrupt enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the GLBL_OWNER register
//
//*************************************************************************************************
#define ERAD_GLBL_OWNER_OWNER_S 0U
#define ERAD_GLBL_OWNER_OWNER_M 0x3U // Global Ownership Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the GLBL_EVENT_AND_MASK register
//
//*************************************************************************************************
#define ERAD_GLBL_EVENT_AND_MASK_MASK1_HWBP1 0x1U // Enhanced Bus Comparator (EBC) AND
// Event Mask1
#define ERAD_GLBL_EVENT_AND_MASK_MASK1_HWBP2 0x2U // Enhanced Bus Comparator (EBC) AND
// Event Mask1
#define ERAD_GLBL_EVENT_AND_MASK_MASK1_HWBP3 0x4U // Enhanced Bus Comparator (EBC) AND
// Event Mask1
#define ERAD_GLBL_EVENT_AND_MASK_MASK1_HWBP4 0x8U // Enhanced Bus Comparator (EBC) AND
// Event Mask1
#define ERAD_GLBL_EVENT_AND_MASK_MASK1_HWBP5 0x10U // Enhanced Bus Comparator (EBC) AND
// Event Mask1
#define ERAD_GLBL_EVENT_AND_MASK_MASK1_HWBP6 0x20U // Enhanced Bus Comparator (EBC) AND
// Event Mask1
#define ERAD_GLBL_EVENT_AND_MASK_MASK1_HWBP7 0x40U // Enhanced Bus Comparator (EBC) AND
// Event Mask1
#define ERAD_GLBL_EVENT_AND_MASK_MASK1_HWBP8 0x80U // Enhanced Bus Comparator (EBC) AND
// Event Mask1
#define ERAD_GLBL_EVENT_AND_MASK_MASK2_HWBP1 0x100U // Enhanced Bus Comparator (EBC) AND
// Event Mask2
#define ERAD_GLBL_EVENT_AND_MASK_MASK2_HWBP2 0x200U // Enhanced Bus Comparator (EBC) AND
// Event Mask2
#define ERAD_GLBL_EVENT_AND_MASK_MASK2_HWBP3 0x400U // Enhanced Bus Comparator (EBC) AND
// Event Mask2
#define ERAD_GLBL_EVENT_AND_MASK_MASK2_HWBP4 0x800U // Enhanced Bus Comparator (EBC) AND
// Event Mask2
#define ERAD_GLBL_EVENT_AND_MASK_MASK2_HWBP5 0x1000U // Enhanced Bus Comparator (EBC) AND
// Event Mask2
#define ERAD_GLBL_EVENT_AND_MASK_MASK2_HWBP6 0x2000U // Enhanced Bus Comparator (EBC) AND
// Event Mask2
#define ERAD_GLBL_EVENT_AND_MASK_MASK2_HWBP7 0x4000U // Enhanced Bus Comparator (EBC) AND
// Event Mask2
#define ERAD_GLBL_EVENT_AND_MASK_MASK2_HWBP8 0x8000U // Enhanced Bus Comparator (EBC) AND
// Event Mask2
#define ERAD_GLBL_EVENT_AND_MASK_MASK3_HWBP1 0x10000U // Enhanced Bus Comparator (EBC) AND
// Event Mask3
#define ERAD_GLBL_EVENT_AND_MASK_MASK3_HWBP2 0x20000U // Enhanced Bus Comparator (EBC) AND
// Event Mask3
#define ERAD_GLBL_EVENT_AND_MASK_MASK3_HWBP3 0x40000U // Enhanced Bus Comparator (EBC) AND
// Event Mask3
#define ERAD_GLBL_EVENT_AND_MASK_MASK3_HWBP4 0x80000U // Enhanced Bus Comparator (EBC) AND
// Event Mask3
#define ERAD_GLBL_EVENT_AND_MASK_MASK3_HWBP5 0x100000U // Enhanced Bus Comparator (EBC) AND
// Event Mask3
#define ERAD_GLBL_EVENT_AND_MASK_MASK3_HWBP6 0x200000U // Enhanced Bus Comparator (EBC) AND
// Event Mask3
#define ERAD_GLBL_EVENT_AND_MASK_MASK3_HWBP7 0x400000U // Enhanced Bus Comparator (EBC) AND
// Event Mask3
#define ERAD_GLBL_EVENT_AND_MASK_MASK3_HWBP8 0x800000U // Enhanced Bus Comparator (EBC) AND
// Event Mask3
#define ERAD_GLBL_EVENT_AND_MASK_MASK4_HWBP1 0x1000000U // Enhanced Bus Comparator (EBC) AND
// Event Mask4
#define ERAD_GLBL_EVENT_AND_MASK_MASK4_HWBP2 0x2000000U // Enhanced Bus Comparator (EBC) AND
// Event Mask4
#define ERAD_GLBL_EVENT_AND_MASK_MASK4_HWBP3 0x4000000U // Enhanced Bus Comparator (EBC) AND
// Event Mask4
#define ERAD_GLBL_EVENT_AND_MASK_MASK4_HWBP4 0x8000000U // Enhanced Bus Comparator (EBC) AND
// Event Mask4
#define ERAD_GLBL_EVENT_AND_MASK_MASK4_HWBP5 0x10000000U // Enhanced Bus Comparator (EBC) AND
// Event Mask4
#define ERAD_GLBL_EVENT_AND_MASK_MASK4_HWBP6 0x20000000U // Enhanced Bus Comparator (EBC) AND
// Event Mask4
#define ERAD_GLBL_EVENT_AND_MASK_MASK4_HWBP7 0x40000000U // Enhanced Bus Comparator (EBC) AND
// Event Mask4
#define ERAD_GLBL_EVENT_AND_MASK_MASK4_HWBP8 0x80000000U // Enhanced Bus Comparator (EBC) AND
// Event Mask4
//*************************************************************************************************
//
// The following are defines for the bit fields in the GLBL_EVENT_OR_MASK register
//
//*************************************************************************************************
#define ERAD_GLBL_EVENT_OR_MASK_MASK1_HWBP1 0x1U // Enhanced Bus Comparator (EBC) OR
// Event Mask1
#define ERAD_GLBL_EVENT_OR_MASK_MASK1_HWBP2 0x2U // Enhanced Bus Comparator (EBC) OR
// Event Mask1
#define ERAD_GLBL_EVENT_OR_MASK_MASK1_HWBP3 0x4U // Enhanced Bus Comparator (EBC) OR
// Event Mask1
#define ERAD_GLBL_EVENT_OR_MASK_MASK1_HWBP4 0x8U // Enhanced Bus Comparator (EBC) OR
// Event Mask1
#define ERAD_GLBL_EVENT_OR_MASK_MASK1_HWBP5 0x10U // Enhanced Bus Comparator (EBC) OR
// Event Mask1
#define ERAD_GLBL_EVENT_OR_MASK_MASK1_HWBP6 0x20U // Enhanced Bus Comparator (EBC) OR
// Event Mask1
#define ERAD_GLBL_EVENT_OR_MASK_MASK1_HWBP7 0x40U // Enhanced Bus Comparator (EBC) OR
// Event Mask1
#define ERAD_GLBL_EVENT_OR_MASK_MASK1_HWBP8 0x80U // Enhanced Bus Comparator (EBC) OR
// Event Mask1
#define ERAD_GLBL_EVENT_OR_MASK_MASK2_HWBP1 0x100U // Enhanced Bus Comparator (EBC) OR
// Event Mask2
#define ERAD_GLBL_EVENT_OR_MASK_MASK2_HWBP2 0x200U // Enhanced Bus Comparator (EBC) OR
// Event Mask2
#define ERAD_GLBL_EVENT_OR_MASK_MASK2_HWBP3 0x400U // Enhanced Bus Comparator (EBC) OR
// Event Mask2
#define ERAD_GLBL_EVENT_OR_MASK_MASK2_HWBP4 0x800U // Enhanced Bus Comparator (EBC) OR
// Event Mask2
#define ERAD_GLBL_EVENT_OR_MASK_MASK2_HWBP5 0x1000U // Enhanced Bus Comparator (EBC) OR
// Event Mask2
#define ERAD_GLBL_EVENT_OR_MASK_MASK2_HWBP6 0x2000U // Enhanced Bus Comparator (EBC) OR
// Event Mask2
#define ERAD_GLBL_EVENT_OR_MASK_MASK2_HWBP7 0x4000U // Enhanced Bus Comparator (EBC) OR
// Event Mask2
#define ERAD_GLBL_EVENT_OR_MASK_MASK2_HWBP8 0x8000U // Enhanced Bus Comparator (EBC) OR
// Event Mask2
#define ERAD_GLBL_EVENT_OR_MASK_MASK3_HWBP1 0x10000U // Enhanced Bus Comparator (EBC) OR
// Event Mask3
#define ERAD_GLBL_EVENT_OR_MASK_MASK3_HWBP2 0x20000U // Enhanced Bus Comparator (EBC) OR
// Event Mask3
#define ERAD_GLBL_EVENT_OR_MASK_MASK3_HWBP3 0x40000U // Enhanced Bus Comparator (EBC) OR
// Event Mask3
#define ERAD_GLBL_EVENT_OR_MASK_MASK3_HWBP4 0x80000U // Enhanced Bus Comparator (EBC) OR
// Event Mask3
#define ERAD_GLBL_EVENT_OR_MASK_MASK3_HWBP5 0x100000U // Enhanced Bus Comparator (EBC) OR
// Event Mask3
#define ERAD_GLBL_EVENT_OR_MASK_MASK3_HWBP6 0x200000U // Enhanced Bus Comparator (EBC) OR
// Event Mask3
#define ERAD_GLBL_EVENT_OR_MASK_MASK3_HWBP7 0x400000U // Enhanced Bus Comparator (EBC) OR
// Event Mask3
#define ERAD_GLBL_EVENT_OR_MASK_MASK3_HWBP8 0x800000U // Enhanced Bus Comparator (EBC) OR
// Event Mask3
#define ERAD_GLBL_EVENT_OR_MASK_MASK4_HWBP1 0x1000000U // Enhanced Bus Comparator (EBC) OR
// Event Mask4
#define ERAD_GLBL_EVENT_OR_MASK_MASK4_HWBP2 0x2000000U // Enhanced Bus Comparator (EBC) OR
// Event Mask4
#define ERAD_GLBL_EVENT_OR_MASK_MASK4_HWBP3 0x4000000U // Enhanced Bus Comparator (EBC) OR
// Event Mask4
#define ERAD_GLBL_EVENT_OR_MASK_MASK4_HWBP4 0x8000000U // Enhanced Bus Comparator (EBC) OR
// Event Mask4
#define ERAD_GLBL_EVENT_OR_MASK_MASK4_HWBP5 0x10000000U // Enhanced Bus Comparator (EBC) OR
// Event Mask4
#define ERAD_GLBL_EVENT_OR_MASK_MASK4_HWBP6 0x20000000U // Enhanced Bus Comparator (EBC) OR
// Event Mask4
#define ERAD_GLBL_EVENT_OR_MASK_MASK4_HWBP7 0x40000000U // Enhanced Bus Comparator (EBC) OR
// Event Mask4
#define ERAD_GLBL_EVENT_OR_MASK_MASK4_HWBP8 0x80000000U // Enhanced Bus Comparator (EBC) OR
// Event Mask4
//*************************************************************************************************
//
// The following are defines for the bit fields in the GLBL_AND_EVENT_INT_MASK register
//
//*************************************************************************************************
#define ERAD_GLBL_AND_EVENT_INT_MASK_RTOSINT_MASK1 0x1U // RTOSINT generation mask for global
// AND events
#define ERAD_GLBL_AND_EVENT_INT_MASK_RTOSINT_MASK2 0x2U // RTOSINT generation mask for global
// AND events
#define ERAD_GLBL_AND_EVENT_INT_MASK_RTOSINT_MASK3 0x4U // RTOSINT generation mask for global
// AND events
#define ERAD_GLBL_AND_EVENT_INT_MASK_RTOSINT_MASK4 0x8U // RTOSINT generation mask for global
// AND events
//*************************************************************************************************
//
// The following are defines for the bit fields in the GLBL_OR_EVENT_INT_MASK register
//
//*************************************************************************************************
#define ERAD_GLBL_OR_EVENT_INT_MASK_RTOSINT_MASK1 0x1U // RTOSINT generation mask for global OR
// events
#define ERAD_GLBL_OR_EVENT_INT_MASK_RTOSINT_MASK2 0x2U // RTOSINT generation mask for global OR
// events
#define ERAD_GLBL_OR_EVENT_INT_MASK_RTOSINT_MASK3 0x4U // RTOSINT generation mask for global OR
// events
#define ERAD_GLBL_OR_EVENT_INT_MASK_RTOSINT_MASK4 0x8U // RTOSINT generation mask for global OR
// events
//*************************************************************************************************
//
// The following are defines for the bit fields in the HWBP_CLEAR register
//
//*************************************************************************************************
#define ERAD_HWBP_CLEAR_EVENT_CLR 0x1U // Event Clear register
//*************************************************************************************************
//
// The following are defines for the bit fields in the HWBP_CNTL register
//
//*************************************************************************************************
#define ERAD_HWBP_CNTL_BUS_SEL_S 1U
#define ERAD_HWBP_CNTL_BUS_SEL_M 0x1EU // Bus select bits
#define ERAD_HWBP_CNTL_STOP 0x20U // Stop bit (Halt/No Halt of CPU)
#define ERAD_HWBP_CNTL_RTOSINT 0x40U // RTOSINT bit
#define ERAD_HWBP_CNTL_COMP_MODE_S 7U
#define ERAD_HWBP_CNTL_COMP_MODE_M 0x380U // Compare mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the HWBP_STATUS register
//
//*************************************************************************************************
#define ERAD_HWBP_STATUS_EVENT_FIRED 0x1U // HWBP (EBC) Event Fired bits
#define ERAD_HWBP_STATUS_MODULE_ID_S 8U
#define ERAD_HWBP_STATUS_MODULE_ID_M 0x3F00U // Identification bits
#define ERAD_HWBP_STATUS_STATUS_S 14U
#define ERAD_HWBP_STATUS_STATUS_M 0xC000U // Status bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the CTM_CNTL register
//
//*************************************************************************************************
#define ERAD_CTM_CNTL_START_STOP_MODE 0x4U // Start_stop mode bit
#define ERAD_CTM_CNTL_EVENT_MODE 0x8U // Event mode bit
#define ERAD_CTM_CNTL_RST_ON_MATCH 0x10U // Reset_on_match bit
#define ERAD_CTM_CNTL_STOP 0x40U // Stop bit (Halt/No Halt of CPU)
#define ERAD_CTM_CNTL_RTOSINT 0x80U // RTOSINT bit
#define ERAD_CTM_CNTL_START_STOP_CUMULATIVE 0x100U // Start stop cumulative bit
#define ERAD_CTM_CNTL_RST_EN 0x400U // Enable Reset
#define ERAD_CTM_CNTL_CNT_INP_SEL_EN 0x800U // Counter Input Select Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the CTM_STATUS register
//
//*************************************************************************************************
#define ERAD_CTM_STATUS_EVENT_FIRED 0x1U // Counter Event Fired bits
#define ERAD_CTM_STATUS_OVERFLOW 0x2U // Counter Overflowed
#define ERAD_CTM_STATUS_MODULE_ID_S 2U
#define ERAD_CTM_STATUS_MODULE_ID_M 0xFFCU // Identification bits
#define ERAD_CTM_STATUS_STATUS_S 12U
#define ERAD_CTM_STATUS_STATUS_M 0xF000U // Status bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the CTM_INPUT_SEL register
//
//*************************************************************************************************
#define ERAD_CTM_INPUT_SEL_CNT_INP_SEL_S 0U
#define ERAD_CTM_INPUT_SEL_CNT_INP_SEL_M 0x7FU // Counter Input Select
#define ERAD_CTM_INPUT_SEL_STA_INP_SEL_S 8U
#define ERAD_CTM_INPUT_SEL_STA_INP_SEL_M 0x7F00U // Counter Sart Input Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the CTM_CLEAR register
//
//*************************************************************************************************
#define ERAD_CTM_CLEAR_EVENT_CLEAR 0x1U // Clear EVENT_FIRED
#define ERAD_CTM_CLEAR_OVERFLOW_CLEAR 0x2U // Clear OVERFLOW
//*************************************************************************************************
//
// The following are defines for the bit fields in the CTM_INPUT_SEL_2 register
//
//*************************************************************************************************
#define ERAD_CTM_INPUT_SEL_2_STO_INP_SEL_S 0U
#define ERAD_CTM_INPUT_SEL_2_STO_INP_SEL_M 0x7FU // Counter Stop Input Select
#define ERAD_CTM_INPUT_SEL_2_RST_INP_SEL_S 8U
#define ERAD_CTM_INPUT_SEL_2_RST_INP_SEL_M 0x7F00U // Counter Reset input Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the CTM_INPUT_COND register
//
//*************************************************************************************************
#define ERAD_CTM_INPUT_COND_CTM_INP_INV 0x1U // Counter Input Invert
#define ERAD_CTM_INPUT_COND_CTM_INP_SYNCH 0x2U // Counter input synchronizer enable
#define ERAD_CTM_INPUT_COND_STA_INP_INV 0x10U // Start input Invert
#define ERAD_CTM_INPUT_COND_STA_INP_SYNCH 0x20U // Start input synchronizer enable
#define ERAD_CTM_INPUT_COND_STO_INP_INV 0x100U // Stop input Invert
#define ERAD_CTM_INPUT_COND_STO_INP_SYNCH 0x200U // Stop input synchronizer enable
#define ERAD_CTM_INPUT_COND_RST_INP_INV 0x1000U // Reset input Invert
#define ERAD_CTM_INPUT_COND_RST_INP_SYNCH 0x2000U // Reset input synchronizer enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the CRC_GLOBAL_CTRL register
//
//*************************************************************************************************
#define ERAD_CRC_GLOBAL_CTRL_CRC1_INIT 0x1U // Initialize CRC Module 1
#define ERAD_CRC_GLOBAL_CTRL_CRC2_INIT 0x2U // Initialize CRC Module 2
#define ERAD_CRC_GLOBAL_CTRL_CRC3_INIT 0x4U // Initialize CRC Module 3
#define ERAD_CRC_GLOBAL_CTRL_CRC4_INIT 0x8U // Initialize CRC Module 4
#define ERAD_CRC_GLOBAL_CTRL_CRC5_INIT 0x10U // Initialize CRC Module 5
#define ERAD_CRC_GLOBAL_CTRL_CRC6_INIT 0x20U // Initialize CRC Module 6
#define ERAD_CRC_GLOBAL_CTRL_CRC7_INIT 0x40U // Initialize CRC Module 7
#define ERAD_CRC_GLOBAL_CTRL_CRC8_INIT 0x80U // Initialize CRC Module 8
#define ERAD_CRC_GLOBAL_CTRL_CRC1_EN 0x100U // Enable CRC Module 1
#define ERAD_CRC_GLOBAL_CTRL_CRC2_EN 0x200U // Enable CRC Module 2
#define ERAD_CRC_GLOBAL_CTRL_CRC3_EN 0x400U // Enable CRC Module 3
#define ERAD_CRC_GLOBAL_CTRL_CRC4_EN 0x800U // Enable CRC Module 4
#define ERAD_CRC_GLOBAL_CTRL_CRC5_EN 0x1000U // Enable CRC Module 5
#define ERAD_CRC_GLOBAL_CTRL_CRC6_EN 0x2000U // Enable CRC Module 6
#define ERAD_CRC_GLOBAL_CTRL_CRC7_EN 0x4000U // Enable CRC Module 7
#define ERAD_CRC_GLOBAL_CTRL_CRC8_EN 0x8000U // Enable CRC Module 8
//*************************************************************************************************
//
// The following are defines for the bit fields in the CRC_QUALIFIER register
//
//*************************************************************************************************
#define ERAD_CRC_QUALIFIER_CRC_QUALIFIER_S 0U
#define ERAD_CRC_QUALIFIER_CRC_QUALIFIER_M 0x1FU // CRC Qualifier Register
#endif
@@ -0,0 +1,357 @@
//###########################################################################
//
// FILE: hw_esc_ss.h
//
// TITLE: Definitions for the ESCSS 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 HW_ESC_SS_H
#define HW_ESC_SS_H
//*************************************************************************************************
//
// The following are defines for the ESCSS register offsets
//
//*************************************************************************************************
#define ESCSS_O_IPREVNUM 0x0U // IP Revision Number
#define ESCSS_O_INTR_RIS 0x2U // EtherCATSS Interrupt Raw Status
#define ESCSS_O_INTR_MASK 0x4U // EtherCATSS Interrupt Mask
#define ESCSS_O_INTR_MIS 0x6U // EtherCATSS Masked Interrupt Status
#define ESCSS_O_INTR_CLR 0x8U // EtherCATSS Interrupt Clear
#define ESCSS_O_INTR_SET 0xAU // EtherCATSS Interrupt Set to emulate
#define ESCSS_O_LATCH_SEL 0xCU // Select for Latch0/1 inputs and LATCHIN input
#define ESCSS_O_ACCESS_CTRL 0xEU // PDI interface access control config.
#define ESCSS_O_GPIN_DAT 0x10U // GPIN data capture for debug & override
#define ESCSS_O_GPIN_PIPE 0x12U // GPIN pipeline select
#define ESCSS_O_GPIN_GRP_CAP_SEL 0x14U // GPIN pipe group capture trigger
#define ESCSS_O_GPOUT_DAT 0x16U // GPOUT data capture for debug & override
#define ESCSS_O_GPOUT_PIPE 0x18U // GPOUT pipeline select
#define ESCSS_O_GPOUT_GRP_CAP_SEL 0x1AU // GPOUT pipe group capture trigger
#define ESCSS_O_MEM_TEST 0x1CU // Memory Test Control
#define ESCSS_O_RESET_DEST_CONFIG 0x1EU // ResetOut impact or destination config
#define ESCSS_O_SYNC0_CONFIG 0x20U // SYNC0 Configuration for various triggers
#define ESCSS_O_SYNC1_CONFIG 0x22U // SYNC1 Configuration for various triggers
#define ESCSS_O_CONFIG_LOCK 0x0U // EtherCATSS Configuration Lock
#define ESCSS_O_MISC_IO_CONFIG 0x2U // RESET_IN, EEPROM IO connections select
#define ESCSS_O_PHY_IO_CONFIG 0x4U // Control Register of ESCSS
#define ESCSS_O_SYNC_IO_CONFIG 0x6U // SYNC Signals IO configurations
#define ESCSS_O_LATCH_IO_CONFIG 0x8U // LATCH inputs IO pad select
#define ESCSS_O_GPIN_SEL 0xAU // GPIN Select between IO PAD & tieoff
#define ESCSS_O_GPIN_IOPAD_SEL 0xCU // GPIN IO pad Select
#define ESCSS_O_GPOUT_SEL 0xEU // GPOUT IO pad connect select
#define ESCSS_O_GPOUT_IOPAD_SEL 0x10U // GPOUT IO pad select
#define ESCSS_O_LED_CONFIG 0x12U // Selection of LED o/p connect to IO pad
#define ESCSS_O_MISC_CONFIG 0x14U // Miscelleneous Configuration
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_IPREVNUM register
//
//*************************************************************************************************
#define ESCSS_IPREVNUM_IP_REV_MINOR_S 0U
#define ESCSS_IPREVNUM_IP_REV_MINOR_M 0xFU // Minor IP Revision Number
#define ESCSS_IPREVNUM_IP_REV_MAJOR_S 4U
#define ESCSS_IPREVNUM_IP_REV_MAJOR_M 0xF0U // Major IP Revision Number
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_INTR_RIS register
//
//*************************************************************************************************
#define ESCSS_INTR_RIS_SYNC0_RIS 0x1U // SYNC0 feature RIS
#define ESCSS_INTR_RIS_SYNC1_RIS 0x2U // SYNC1 feature RIS
#define ESCSS_INTR_RIS_IRQ_RIS 0x4U // EtherCATSS IRQ RIS
#define ESCSS_INTR_RIS_DMA_DONE_RIS 0x8U // DMA Done RIS
#define ESCSS_INTR_RIS_TIMEOUT_ERR_RIS 0x10U // PDI bus Timeout Error RIS
#define ESCSS_INTR_RIS_MASTER_RESET_RIS 0x20U // ECAT RESET RIS
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_INTR_MASK register
//
//*************************************************************************************************
#define ESCSS_INTR_MASK_SYNC0_MASK 0x1U // SYNC0 feature Mask
#define ESCSS_INTR_MASK_SYNC1_MASK 0x2U // SYNC1 feature Mask
#define ESCSS_INTR_MASK_IRQ_MASK 0x4U // EtherCATSS IRQ Mask
#define ESCSS_INTR_MASK_DMA_DONE_MASK 0x8U // DMA Done Mask
#define ESCSS_INTR_MASK_TIMEOUT_ERR_MASK 0x10U // PDI Access Timeout Error Mask
#define ESCSS_INTR_MASK_MASTER_RESET_MASK 0x20U // EtherCAT Master Reset Mask
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_INTR_MIS register
//
//*************************************************************************************************
#define ESCSS_INTR_MIS_SYNC0_MIS 0x1U // SYNC0 feature MIS
#define ESCSS_INTR_MIS_SYNC1_MIS 0x2U // SYNC1 feature MIS
#define ESCSS_INTR_MIS_IRQ_MIS 0x4U // EtherCATSS IRQ MIS
#define ESCSS_INTR_MIS_DMA_DONE_MIS 0x8U // DMA Done MIS
#define ESCSS_INTR_MIS_TIMEOUT_ERR_MIS 0x10U // PDI bus Timeout Error MIS
#define ESCSS_INTR_MIS_MASTER_RESET_MIS 0x20U // EtherCAT Master Reset MIS
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_INTR_CLR register
//
//*************************************************************************************************
#define ESCSS_INTR_CLR_SYNC0_CLR 0x1U // SYNC0 feature Clear
#define ESCSS_INTR_CLR_SYNC1_CLR 0x2U // SYNC1 feature Clear
#define ESCSS_INTR_CLR_IRQ_CLR 0x4U // EtherCATSS IRQ Clear
#define ESCSS_INTR_CLR_DMA_DONE_CLR 0x8U // DMA Done Clear
#define ESCSS_INTR_CLR_TIMEOUT_ERR_CLR 0x10U // PDI Access Timeout Error Clear
#define ESCSS_INTR_CLR_MASTER_RESET_CLR 0x20U // EtherCAT Master Reset Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_INTR_SET register
//
//*************************************************************************************************
#define ESCSS_INTR_SET_SYNC0_SET 0x1U // SYNC0 Set Emulate
#define ESCSS_INTR_SET_SYNC1_SET 0x2U // SYNC1 Set Emulate
#define ESCSS_INTR_SET_IRQ_SET 0x4U // EtherCATSS IRQ Set Emulate
#define ESCSS_INTR_SET_DMA_DONE_SET 0x8U // DMA Done Set Emulate
#define ESCSS_INTR_SET_TIMEOUT_ERR_SET 0x10U // PDI Access Timeout Error Set Emulate
#define ESCSS_INTR_SET_MASTER_RESET_SET 0x20U // EtherCAT Master Reset Emulate
#define ESCSS_INTR_SET_WRITE_KEY_S 8U
#define ESCSS_INTR_SET_WRITE_KEY_M 0xFF00U // Key to enable writing lock
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_LATCH_SEL register
//
//*************************************************************************************************
#define ESCSS_LATCH_SEL_LATCH0_SELECT_S 0U
#define ESCSS_LATCH_SEL_LATCH0_SELECT_M 0x1FU // LATCH0 Inputs mux select
#define ESCSS_LATCH_SEL_LATCH1_SELECT_S 8U
#define ESCSS_LATCH_SEL_LATCH1_SELECT_M 0x1F00U // LATCH1 Inputs mux select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_ACCESS_CTRL register
//
//*************************************************************************************************
#define ESCSS_ACCESS_CTRL_WAIT_STATES_S 0U
#define ESCSS_ACCESS_CTRL_WAIT_STATES_M 0x7FU // Minimum Wait States for
// VBUS Bridge
#define ESCSS_ACCESS_CTRL_EN_TIMEOUT 0x80U // PDI Timeout enable
#define ESCSS_ACCESS_CTRL_ENABLE_DEBUG_ACCESS 0x200U // Debug access enable
#define ESCSS_ACCESS_CTRL_ENABLE_PARALLEL_PORT_ACCESS 0x400U // Parallel port access enable
#define ESCSS_ACCESS_CTRL_TIMEOUT_COUNT_S 16U
#define ESCSS_ACCESS_CTRL_TIMEOUT_COUNT_M 0xFFF0000U // Max timecount programmed
// and count while enabled.
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_GPIN_GRP_CAP_SEL register
//
//*************************************************************************************************
#define ESCSS_GPIN_GRP_CAP_SEL_GPI_GRP_CAP_SEL0_S 0U
#define ESCSS_GPIN_GRP_CAP_SEL_GPI_GRP_CAP_SEL0_M 0x7U // GPI7-0 capture trigger select
#define ESCSS_GPIN_GRP_CAP_SEL_GPI_GRP_CAP_SEL1_S 4U
#define ESCSS_GPIN_GRP_CAP_SEL_GPI_GRP_CAP_SEL1_M 0x70U // GPI15-8 capture trigger select
#define ESCSS_GPIN_GRP_CAP_SEL_GPI_GRP_CAP_SEL2_S 8U
#define ESCSS_GPIN_GRP_CAP_SEL_GPI_GRP_CAP_SEL2_M 0x700U // GPI23-16 capture trigger select
#define ESCSS_GPIN_GRP_CAP_SEL_GPI_GRP_CAP_SEL3_S 12U
#define ESCSS_GPIN_GRP_CAP_SEL_GPI_GRP_CAP_SEL3_M 0x7000U // GPI31-24 capture trigger select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_GPOUT_GRP_CAP_SEL register
//
//*************************************************************************************************
#define ESCSS_GPOUT_GRP_CAP_SEL_GPO_GRP_CAP_SEL0_S 0U
#define ESCSS_GPOUT_GRP_CAP_SEL_GPO_GRP_CAP_SEL0_M 0x3U // GPO7-0 capture trigger select
#define ESCSS_GPOUT_GRP_CAP_SEL_GPO_GRP_CAP_SEL1_S 4U
#define ESCSS_GPOUT_GRP_CAP_SEL_GPO_GRP_CAP_SEL1_M 0x30U // GPO15-8 capture trigger select
#define ESCSS_GPOUT_GRP_CAP_SEL_GPO_GRP_CAP_SEL2_S 8U
#define ESCSS_GPOUT_GRP_CAP_SEL_GPO_GRP_CAP_SEL2_M 0x300U // GPO23-16 capture trigger select
#define ESCSS_GPOUT_GRP_CAP_SEL_GPO_GRP_CAP_SEL3_S 12U
#define ESCSS_GPOUT_GRP_CAP_SEL_GPO_GRP_CAP_SEL3_M 0x3000U // GPO31-24 capture trigger select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_MEM_TEST register
//
//*************************************************************************************************
#define ESCSS_MEM_TEST_INITIATE_MEM_INIT 0x1U // Initialize memory init
#define ESCSS_MEM_TEST_MEM_INIT_DONE 0x2U // Memory Init done status
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_RESET_DEST_CONFIG register
//
//*************************************************************************************************
#define ESCSS_RESET_DEST_CONFIG_CPU_RESET_EN 0x1U // CPU reset enable for ResetOut
#define ESCSS_RESET_DEST_CONFIG_CPU_NMI_EN 0x2U // CPU NMI enable for ResetOut
#define ESCSS_RESET_DEST_CONFIG_CPU_INT_EN 0x4U // CPU Interrupt enable for ResetOut
#define ESCSS_RESET_DEST_CONFIG_DEVICE_RESET_EN 0x80U // Enables RESET_OUT to impact the
// device reset
#define ESCSS_RESET_DEST_CONFIG_WRITE_KEY_S 8U
#define ESCSS_RESET_DEST_CONFIG_WRITE_KEY_M 0xFF00U // Key to enable writing lock
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_SYNC0_CONFIG register
//
//*************************************************************************************************
#define ESCSS_SYNC0_CONFIG_C28X_PIE_EN 0x1U // Connects the SYNC0 to C28x PIE Interrupt
#define ESCSS_SYNC0_CONFIG_CLA_INT_EN 0x2U // Connects the SYNC0 to CLA Interrupt
#define ESCSS_SYNC0_CONFIG_C28X_DMA_EN 0x4U // Connects the SYNC0 to C28x DMA Trigger
#define ESCSS_SYNC0_CONFIG_CM4_NVIC_EN 0x8U // Connects the SYNC0 to CM4 NVIC Interrupt
#define ESCSS_SYNC0_CONFIG_UDMA_TRIG_EN 0x10U // Connects the SYNC0 to uDMA Trigger
#define ESCSS_SYNC0_CONFIG_WRITE_KEY_S 8U
#define ESCSS_SYNC0_CONFIG_WRITE_KEY_M 0xFF00U // Key to enable writing lock
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_SYNC1_CONFIG register
//
//*************************************************************************************************
#define ESCSS_SYNC1_CONFIG_C28X_PIE_EN 0x1U // Connects the SYNC1 to C28x PIE Interrupt
#define ESCSS_SYNC1_CONFIG_CLA_INT_EN 0x2U // Connects the SYNC1 to CLA Interrupt
#define ESCSS_SYNC1_CONFIG_C28X_DMA_EN 0x4U // Connects the SYNC1 to C28x DMA Trigger
#define ESCSS_SYNC1_CONFIG_CM4_NVIC_EN 0x8U // Connects the SYNC1 to CM4 NVIC Interrupt
#define ESCSS_SYNC1_CONFIG_UDMA_TRIG_EN 0x10U // Connects the SYNC1 to uDMA Trigger
#define ESCSS_SYNC1_CONFIG_WRITE_KEY_S 8U
#define ESCSS_SYNC1_CONFIG_WRITE_KEY_M 0xFF00U // Key to enable writing lock
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_CONFIG_LOCK register
//
//*************************************************************************************************
#define ESCSS_CONFIG_LOCK_LOCK_ENABLE 0x1U // Locking writes to ECATSS
#define ESCSS_CONFIG_LOCK_IO_CONFIG_ENABLE 0x10U // Locking the IO Configuration
#define ESCSS_CONFIG_LOCK_WRITE_KEY_S 8U
#define ESCSS_CONFIG_LOCK_WRITE_KEY_M 0xFF00U // Key to enable writing lock
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_MISC_IO_CONFIG register
//
//*************************************************************************************************
#define ESCSS_MISC_IO_CONFIG_RESETIN_GPIO_EN 0x1U // Enabled ResetIN from GPIO
#define ESCSS_MISC_IO_CONFIG_EEPROM_I2C_IO_EN 0x2U // Enables the EEPROM I2C IOPAD
// connection
#define ESCSS_MISC_IO_CONFIG_WRITE_KEY_S 8U
#define ESCSS_MISC_IO_CONFIG_WRITE_KEY_M 0xFF00U // Key to enable writing lock
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_PHY_IO_CONFIG register
//
//*************************************************************************************************
#define ESCSS_PHY_IO_CONFIG_PHY_PORT_CNT_S 2U
#define ESCSS_PHY_IO_CONFIG_PHY_PORT_CNT_M 0xCU // Number of PHY port counts
#define ESCSS_PHY_IO_CONFIG_PHY_INTF_IOPAD_SEL_S 4U
#define ESCSS_PHY_IO_CONFIG_PHY_INTF_IOPAD_SEL_M 0x30U // IO Combination select for PHY
// Interface
#define ESCSS_PHY_IO_CONFIG_TX_CLK_AUTO_COMP 0x40U // Selects TX_CLK IO to do Auto
// compensation
#define ESCSS_PHY_IO_CONFIG_WRITE_KEY_S 8U
#define ESCSS_PHY_IO_CONFIG_WRITE_KEY_M 0xFF00U // Key to enable writing lock
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_SYNC_IO_CONFIG register
//
//*************************************************************************************************
#define ESCSS_SYNC_IO_CONFIG_SYNC0_IOPAD_SEL_S 0U
#define ESCSS_SYNC_IO_CONFIG_SYNC0_IOPAD_SEL_M 0x3U // SYNC0 IO PAD select option
#define ESCSS_SYNC_IO_CONFIG_SYNC0_GPIO_EN 0x8U // SYNC0 connection to OUT pad enabled
#define ESCSS_SYNC_IO_CONFIG_SYNC1_IOPAD_SEL_S 4U
#define ESCSS_SYNC_IO_CONFIG_SYNC1_IOPAD_SEL_M 0x30U // SYNC1 IO PAD select option
#define ESCSS_SYNC_IO_CONFIG_SYNC1_GPIO_EN 0x80U // SYNC1 connection to OUT pad enabled
#define ESCSS_SYNC_IO_CONFIG_WRITE_KEY_S 8U
#define ESCSS_SYNC_IO_CONFIG_WRITE_KEY_M 0xFF00U // Key to enable writing lock
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_LATCH_IO_CONFIG register
//
//*************************************************************************************************
#define ESCSS_LATCH_IO_CONFIG_LATCH0_IOPAD_SEL_S 0U
#define ESCSS_LATCH_IO_CONFIG_LATCH0_IOPAD_SEL_M 0x3U // LATCH0 IO PAD select option
#define ESCSS_LATCH_IO_CONFIG_LATCH0_GPIO_EN 0x8U // LATCH0 connection to IN pad enabled
#define ESCSS_LATCH_IO_CONFIG_LATCH1_IOPAD_SEL_S 4U
#define ESCSS_LATCH_IO_CONFIG_LATCH1_IOPAD_SEL_M 0x30U // LATCH1 IO PAD select option
#define ESCSS_LATCH_IO_CONFIG_LATCH1_GPIO_EN 0x80U // LATCH1 connection to IN pad enabled
#define ESCSS_LATCH_IO_CONFIG_WRITE_KEY_S 8U
#define ESCSS_LATCH_IO_CONFIG_WRITE_KEY_M 0xFF00U // Key to enable writing lock
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_LED_CONFIG register
//
//*************************************************************************************************
#define ESCSS_LED_CONFIG_LINKACT0 0x1U // GPIO enable for LINKACT0 LED
#define ESCSS_LED_CONFIG_LINKACT1 0x2U // GPIO enable for LINKACT1 LED
#define ESCSS_LED_CONFIG_STATE 0x4U // GPIO enable for STATE LED
#define ESCSS_LED_CONFIG_ERR 0x8U // GPIO enable for ERR LED
#define ESCSS_LED_CONFIG_RUN 0x10U // GPIO enable for RUN LED
#define ESCSS_LED_CONFIG_LINKACT0_IOPAD_SEL_S 6U
#define ESCSS_LED_CONFIG_LINKACT0_IOPAD_SEL_M 0xC0U // LINKACT0 LED IO PAD select
#define ESCSS_LED_CONFIG_LINKACT1_IOPAD_SEL_S 8U
#define ESCSS_LED_CONFIG_LINKACT1_IOPAD_SEL_M 0x300U // LINKACT1 LED IO PAD select
#define ESCSS_LED_CONFIG_STATE_IOPAD_SEL_S 10U
#define ESCSS_LED_CONFIG_STATE_IOPAD_SEL_M 0xC00U // STATE LED IO PAD select
#define ESCSS_LED_CONFIG_ERR_IOPAD_SEL_S 12U
#define ESCSS_LED_CONFIG_ERR_IOPAD_SEL_M 0x3000U // ERROR LED IO PAD select
#define ESCSS_LED_CONFIG_RUN_IOPAD_SEL_S 14U
#define ESCSS_LED_CONFIG_RUN_IOPAD_SEL_M 0xC000U // RUN LED IO PAD select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ESCSS_MISC_CONFIG register
//
//*************************************************************************************************
#define ESCSS_MISC_CONFIG_TX0_SHIFT_CONFIG_S 0U
#define ESCSS_MISC_CONFIG_TX0_SHIFT_CONFIG_M 0x3U // TX Shift configuration for Port0
#define ESCSS_MISC_CONFIG_TX1_SHIFT_CONFIG_S 2U
#define ESCSS_MISC_CONFIG_TX1_SHIFT_CONFIG_M 0xCU // TX Shift configuration for Port1
#define ESCSS_MISC_CONFIG_EEPROM_SIZE 0x10U // EEPROM Size bound select
#define ESCSS_MISC_CONFIG_PDI_EMULATION 0x20U // PDI Emulation enable
#define ESCSS_MISC_CONFIG_PHY_ADDR_S 6U
#define ESCSS_MISC_CONFIG_PHY_ADDR_M 0x7C0U // PHY Address Offset
#endif
@@ -0,0 +1,271 @@
//###########################################################################
//
// FILE: hw_flash.h
//
// TITLE: Definitions for the 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 HW_FLASH_H
#define HW_FLASH_H
//*************************************************************************************************
//
// The following are defines for the FLASH register offsets
//
//*************************************************************************************************
#define FLASH_O_FRDCNTL 0x0U // Flash Read Control Register
#define FLASH_O_FBAC 0x1EU // Flash Bank Access Control Register
#define FLASH_O_FBFALLBACK 0x20U // Flash Bank Fallback Power Register
#define FLASH_O_FBPRDY 0x22U // Flash Bank Pump Ready Register
#define FLASH_O_FPAC1 0x24U // Flash Pump Access Control Register 1
#define FLASH_O_FMSTAT 0x2AU // Flash Module Status Register
#define FLASH_O_FRD_INTF_CTRL 0x180U // Flash Read Interface Control Register
#define FLASH_O_ECC_ENABLE 0x0U // ECC Enable
#define FLASH_O_SINGLE_ERR_ADDR_LOW 0x2U // Single Error Address Low
#define FLASH_O_SINGLE_ERR_ADDR_HIGH 0x4U // Single Error Address High
#define FLASH_O_UNC_ERR_ADDR_LOW 0x6U // Uncorrectable Error Address Low
#define FLASH_O_UNC_ERR_ADDR_HIGH 0x8U // Uncorrectable Error Address High
#define FLASH_O_ERR_STATUS 0xAU // Error Status
#define FLASH_O_ERR_POS 0xCU // Error Position
#define FLASH_O_ERR_STATUS_CLR 0xEU // Error Status Clear
#define FLASH_O_ERR_CNT 0x10U // Error Control
#define FLASH_O_ERR_THRESHOLD 0x12U // Error Threshold
#define FLASH_O_ERR_INTFLG 0x14U // Error Interrupt Flag
#define FLASH_O_ERR_INTCLR 0x16U // Error Interrupt Flag Clear
#define FLASH_O_FDATAH_TEST 0x18U // Data High Test
#define FLASH_O_FDATAL_TEST 0x1AU // Data Low Test
#define FLASH_O_FADDR_TEST 0x1CU // ECC Test Address
#define FLASH_O_FECC_TEST 0x1EU // ECC Test Address
#define FLASH_O_FECC_CTRL 0x20U // ECC Control
#define FLASH_O_FOUTH_TEST 0x22U // Test Data Out High
#define FLASH_O_FOUTL_TEST 0x24U // Test Data Out Low
#define FLASH_O_FECC_STATUS 0x26U // ECC Status
//*************************************************************************************************
//
// The following are defines for the bit fields in the FRDCNTL register
//
//*************************************************************************************************
#define FLASH_FRDCNTL_RWAIT_S 8U
#define FLASH_FRDCNTL_RWAIT_M 0xF00U // Random Read Waitstate
//*************************************************************************************************
//
// The following are defines for the bit fields in the FBAC register
//
//*************************************************************************************************
#define FLASH_FBAC_BAGP_S 8U
#define FLASH_FBAC_BAGP_M 0xFF00U // Bank Active Grace Period
//*************************************************************************************************
//
// The following are defines for the bit fields in the FBFALLBACK register
//
//*************************************************************************************************
#define FLASH_FBFALLBACK_BNKPWR0_S 0U
#define FLASH_FBFALLBACK_BNKPWR0_M 0x3U // Bank Power Mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the FBPRDY register
//
//*************************************************************************************************
#define FLASH_FBPRDY_BANKRDY 0x1U // Flash Bank Active Power State
#define FLASH_FBPRDY_PUMPRDY 0x8000U // Flash Pump Active Power Mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the FPAC1 register
//
//*************************************************************************************************
#define FLASH_FPAC1_PMPPWR 0x1U // Charge Pump Fallback Power Mode
#define FLASH_FPAC1_PSLEEP_S 16U
#define FLASH_FPAC1_PSLEEP_M 0xFFF0000U // Pump Sleep Down Count
//*************************************************************************************************
//
// The following are defines for the bit fields in the FMSTAT register
//
//*************************************************************************************************
#define FLASH_FMSTAT_PSUSP 0x2U // Program Suspend.
#define FLASH_FMSTAT_ESUSP 0x4U // Erase Suspend.
#define FLASH_FMSTAT_VOLTSTAT 0x8U // Core Voltage Status.
#define FLASH_FMSTAT_CSTAT 0x10U // Command Status.
#define FLASH_FMSTAT_INVDAT 0x20U // Invalid Data.
#define FLASH_FMSTAT_PGM 0x40U // Program Active.
#define FLASH_FMSTAT_ERS 0x80U // Erase Active.
#define FLASH_FMSTAT_BUSY 0x100U // Busy Bit.
#define FLASH_FMSTAT_EV 0x400U // Erase verify
#define FLASH_FMSTAT_PGV 0x1000U // Program verify
//*************************************************************************************************
//
// The following are defines for the bit fields in the FRD_INTF_CTRL register
//
//*************************************************************************************************
#define FLASH_FRD_INTF_CTRL_PREFETCH_EN 0x1U // Prefetch Enable
#define FLASH_FRD_INTF_CTRL_DATA_CACHE_EN 0x2U // Data Cache Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECC_ENABLE register
//
//*************************************************************************************************
#define FLASH_ECC_ENABLE_ENABLE_S 0U
#define FLASH_ECC_ENABLE_ENABLE_M 0xFU // Enable ECC
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERR_STATUS register
//
//*************************************************************************************************
#define FLASH_ERR_STATUS_FAIL_0_L 0x1U // Lower 64bits Single Bit Error Corrected Value 0
#define FLASH_ERR_STATUS_FAIL_1_L 0x2U // Lower 64bits Single Bit Error Corrected Value 1
#define FLASH_ERR_STATUS_UNC_ERR_L 0x4U // Lower 64 bits Uncorrectable error occurred
#define FLASH_ERR_STATUS_FAIL_0_H 0x10000U // Upper 64bits Single Bit Error Corrected Value 0
#define FLASH_ERR_STATUS_FAIL_1_H 0x20000U // Upper 64bits Single Bit Error Corrected Value 1
#define FLASH_ERR_STATUS_UNC_ERR_H 0x40000U // Upper 64 bits Uncorrectable error occurred
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERR_POS register
//
//*************************************************************************************************
#define FLASH_ERR_POS_ERR_POS_L_S 0U
#define FLASH_ERR_POS_ERR_POS_L_M 0x3FU // Bit Position of Single bit Error in lower 64
// bits
#define FLASH_ERR_POS_ERR_TYPE_L 0x100U // Error Type in lower 64 bits
#define FLASH_ERR_POS_ERR_POS_H_S 16U
#define FLASH_ERR_POS_ERR_POS_H_M 0x3F0000U // Bit Position of Single bit Error in upper 64
// bits
#define FLASH_ERR_POS_ERR_TYPE_H 0x1000000U // Error Type in upper 64 bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERR_STATUS_CLR register
//
//*************************************************************************************************
#define FLASH_ERR_STATUS_CLR_FAIL_0_L_CLR 0x1U // Lower 64bits Single Bit Error Corrected
// Value 0 Clear
#define FLASH_ERR_STATUS_CLR_FAIL_1_L_CLR 0x2U // Lower 64bits Single Bit Error Corrected
// Value 1 Clear
#define FLASH_ERR_STATUS_CLR_UNC_ERR_L_CLR 0x4U // Lower 64 bits Uncorrectable error
// occurred Clear
#define FLASH_ERR_STATUS_CLR_FAIL_0_H_CLR 0x10000U // Upper 64bits Single Bit Error Corrected
// Value 0 Clear
#define FLASH_ERR_STATUS_CLR_FAIL_1_H_CLR 0x20000U // Upper 64bits Single Bit Error Corrected
// Value 1 Clear
#define FLASH_ERR_STATUS_CLR_UNC_ERR_H_CLR 0x40000U // Upper 64 bits Uncorrectable error
// occurred Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERR_CNT register
//
//*************************************************************************************************
#define FLASH_ERR_CNT_ERR_CNT_S 0U
#define FLASH_ERR_CNT_ERR_CNT_M 0xFFFFU // Error counter
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERR_THRESHOLD register
//
//*************************************************************************************************
#define FLASH_ERR_THRESHOLD_ERR_THRESHOLD_S 0U
#define FLASH_ERR_THRESHOLD_ERR_THRESHOLD_M 0xFFFFU // Error Threshold
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERR_INTFLG register
//
//*************************************************************************************************
#define FLASH_ERR_INTFLG_SINGLE_ERR_INTFLG 0x1U // Single Error Interrupt Flag
#define FLASH_ERR_INTFLG_UNC_ERR_INTFLG 0x2U // Uncorrectable Interrupt Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERR_INTCLR register
//
//*************************************************************************************************
#define FLASH_ERR_INTCLR_SINGLE_ERR_INTCLR 0x1U // Single Error Interrupt Flag Clear
#define FLASH_ERR_INTCLR_UNC_ERR_INTCLR 0x2U // Uncorrectable Interrupt Flag Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the FADDR_TEST register
//
//*************************************************************************************************
#define FLASH_FADDR_TEST_ADDRL_S 3U
#define FLASH_FADDR_TEST_ADDRL_M 0xFFF8U // ECC Address Low
#define FLASH_FADDR_TEST_ADDRH_S 16U
#define FLASH_FADDR_TEST_ADDRH_M 0x3F0000U // ECC Address High
//*************************************************************************************************
//
// The following are defines for the bit fields in the FECC_TEST register
//
//*************************************************************************************************
#define FLASH_FECC_TEST_ECC_S 0U
#define FLASH_FECC_TEST_ECC_M 0xFFU // ECC Control Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the FECC_CTRL register
//
//*************************************************************************************************
#define FLASH_FECC_CTRL_ECC_TEST_EN 0x1U // Enable ECC Test Logic
#define FLASH_FECC_CTRL_ECC_SELECT 0x2U // ECC Bit Select
#define FLASH_FECC_CTRL_DO_ECC_CALC 0x4U // Enable ECC Calculation
//*************************************************************************************************
//
// The following are defines for the bit fields in the FECC_STATUS register
//
//*************************************************************************************************
#define FLASH_FECC_STATUS_SINGLE_ERR 0x1U // Test Result is Single Bit Error
#define FLASH_FECC_STATUS_UNC_ERR 0x2U // Test Result is Uncorrectable Error
#define FLASH_FECC_STATUS_DATA_ERR_POS_S 2U
#define FLASH_FECC_STATUS_DATA_ERR_POS_M 0xFCU // Holds Bit Position of Error
#define FLASH_FECC_STATUS_ERR_TYPE 0x100U // Holds Bit Position of 8 Check Bits of Error
#endif
@@ -0,0 +1,613 @@
//###########################################################################
//
// FILE: hw_fsi.h
//
// TITLE: Definitions for the FSI 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 HW_FSI_H
#define HW_FSI_H
//*************************************************************************************************
//
// The following are defines for the FSI register offsets
//
//*************************************************************************************************
#define FSI_O_TX_MASTER_CTRL 0x0U // Transmit master control register
#define FSI_O_TX_CLK_CTRL 0x2U // Transmit clock control register
#define FSI_O_TX_OPER_CTRL_LO 0x4U // Transmit operation control register low
#define FSI_O_TX_OPER_CTRL_HI 0x5U // Transmit operation control register high
#define FSI_O_TX_FRAME_CTRL 0x6U // Transmit frame control register
#define FSI_O_TX_FRAME_TAG_UDATA 0x7U // Transmit frame tag and user data register
#define FSI_O_TX_BUF_PTR_LOAD 0x8U // Transmit buffer pointer control load register
#define FSI_O_TX_BUF_PTR_STS 0x9U // Transmit buffer pointer control status
// register
#define FSI_O_TX_PING_CTRL 0xAU // Transmit ping control register
#define FSI_O_TX_PING_TAG 0xBU // Transmit ping tag register
#define FSI_O_TX_PING_TO_REF 0xCU // Transmit ping timeout counter reference
#define FSI_O_TX_PING_TO_CNT 0xEU // Transmit ping timeout current count
#define FSI_O_TX_INT_CTRL 0x10U // Transmit interrupt event control register
#define FSI_O_TX_DMA_CTRL 0x11U // Transmit DMA event control register
#define FSI_O_TX_LOCK_CTRL 0x12U // Transmit lock control register
#define FSI_O_TX_EVT_STS 0x14U // Transmit event and error status flag register
#define FSI_O_TX_EVT_CLR 0x16U // Transmit event and error clear register
#define FSI_O_TX_EVT_FRC 0x17U // Transmit event and error flag force register
#define FSI_O_TX_USER_CRC 0x18U // Transmit user-defined CRC register
#define FSI_O_TX_ECC_DATA 0x20U // Transmit ECC data register
#define FSI_O_TX_ECC_VAL 0x22U // Transmit ECC value register
#define FSI_O_TX_BUF_BASE(i) (0x40U + (i)) // (0 <= i < 16) Base address for transmit
// buffer
#define FSI_O_RX_MASTER_CTRL 0x0U // Receive main control register
#define FSI_O_RX_OPER_CTRL 0x4U // Receive operation control register
#define FSI_O_RX_FRAME_INFO 0x6U // Receive frame control register
#define FSI_O_RX_FRAME_TAG_UDATA 0x7U // Receive frame tag and user data register
#define FSI_O_RX_DMA_CTRL 0x8U // Receive DMA event control register
#define FSI_O_RX_EVT_STS 0xAU // Receive event and error status flag register
#define FSI_O_RX_CRC_INFO 0xBU // Receive CRC info of received and computed CRC
#define FSI_O_RX_EVT_CLR 0xCU // Receive event and error clear register
#define FSI_O_RX_EVT_FRC 0xDU // Receive event and error flag force register
#define FSI_O_RX_BUF_PTR_LOAD 0xEU // Receive buffer pointer load register
#define FSI_O_RX_BUF_PTR_STS 0xFU // Receive buffer pointer status register
#define FSI_O_RX_FRAME_WD_CTRL 0x10U // Receive frame watchdog control register
#define FSI_O_RX_FRAME_WD_REF 0x12U // Receive frame watchdog counter reference
#define FSI_O_RX_FRAME_WD_CNT 0x14U // Receive frame watchdog current count
#define FSI_O_RX_PING_WD_CTRL 0x16U // Receive ping watchdog control register
#define FSI_O_RX_PING_TAG 0x17U // Receive ping tag register
#define FSI_O_RX_PING_WD_REF 0x18U // Receive ping watchdog counter reference
#define FSI_O_RX_PING_WD_CNT 0x1AU // Receive pingwatchdog current count
#define FSI_O_RX_INT1_CTRL 0x1CU // Receive interrupt control register for
// RX_INT1
#define FSI_O_RX_INT2_CTRL 0x1DU // Receive interrupt control register for
// RX_INT2
#define FSI_O_RX_LOCK_CTRL 0x1EU // Receive lock control register
#define FSI_O_RX_ECC_DATA 0x20U // Receive ECC data register
#define FSI_O_RX_ECC_VAL 0x22U // Receive ECC value register
#define FSI_O_RX_ECC_SEC_DATA 0x24U // Receive ECC corrected data register
#define FSI_O_RX_ECC_LOG 0x26U // Receive ECC log and status register
#define FSI_O_RX_FRAME_TAG_CMP 0x28U // Receive frame tag compare register
#define FSI_O_RX_PING_TAG_CMP 0x29U // Receive ping tag compare register
#define FSI_O_RX_DLYLINE_CTRL 0x30U // Receive delay line control register
#define FSI_O_RX_VIS_1 0x38U // Receive debug visibility register 1
#define FSI_O_RX_BUF_BASE(i) (0x40U + (i)) // (0 <= i < 16) Base address for receive data
// buffer
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_MASTER_CTRL register
//
//*************************************************************************************************
#define FSI_TX_MASTER_CTRL_CORE_RST 0x1U // Transmitter Main Core Reset
#define FSI_TX_MASTER_CTRL_FLUSH 0x2U // Flush Operation Start
#define FSI_TX_MASTER_CTRL_KEY_S 8U
#define FSI_TX_MASTER_CTRL_KEY_M 0xFF00U // Write Key
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_CLK_CTRL register
//
//*************************************************************************************************
#define FSI_TX_CLK_CTRL_CLK_RST 0x1U // Soft Reset for the Clock Divider
#define FSI_TX_CLK_CTRL_CLK_EN 0x2U // Clock Divider Enable
#define FSI_TX_CLK_CTRL_PRESCALE_VAL_S 2U
#define FSI_TX_CLK_CTRL_PRESCALE_VAL_M 0x3FCU // Prescale value
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_OPER_CTRL_LO register
//
//*************************************************************************************************
#define FSI_TX_OPER_CTRL_LO_DATA_WIDTH_S 0U
#define FSI_TX_OPER_CTRL_LO_DATA_WIDTH_M 0x3U // Transmit Data width
#define FSI_TX_OPER_CTRL_LO_SPI_MODE 0x4U // SPI Mode Select
#define FSI_TX_OPER_CTRL_LO_START_MODE_S 3U
#define FSI_TX_OPER_CTRL_LO_START_MODE_M 0x38U // Transmission Start Mode Select
#define FSI_TX_OPER_CTRL_LO_SW_CRC 0x40U // CRC Source Select
#define FSI_TX_OPER_CTRL_LO_PING_TO_MODE 0x80U // Ping Counter Reset Mode Select
#define FSI_TX_OPER_CTRL_LO_SEL_PLLCLK 0x100U // Input Clock Select
#define FSI_TX_OPER_CTRL_LO_TDM_ENABLE 0x200U // Transmit TDM Mode Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_OPER_CTRL_HI register
//
//*************************************************************************************************
#define FSI_TX_OPER_CTRL_HI_FORCE_ERR 0x20U // Error Frame Force
#define FSI_TX_OPER_CTRL_HI_ECC_SEL 0x40U // ECC Data Width Select
#define FSI_TX_OPER_CTRL_HI_EXT_TRIG_SEL_S 7U
#define FSI_TX_OPER_CTRL_HI_EXT_TRIG_SEL_M 0x1F80U // External Trigger Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_FRAME_CTRL register
//
//*************************************************************************************************
#define FSI_TX_FRAME_CTRL_FRAME_TYPE_S 0U
#define FSI_TX_FRAME_CTRL_FRAME_TYPE_M 0xFU // Transmit Frame Type
#define FSI_TX_FRAME_CTRL_N_WORDS_S 4U
#define FSI_TX_FRAME_CTRL_N_WORDS_M 0xF0U // Number of Words to be Transmitted
#define FSI_TX_FRAME_CTRL_START 0x8000U // Start Transmission
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_FRAME_TAG_UDATA register
//
//*************************************************************************************************
#define FSI_TX_FRAME_TAG_UDATA_FRAME_TAG_S 0U
#define FSI_TX_FRAME_TAG_UDATA_FRAME_TAG_M 0xFU // Frame Tag
#define FSI_TX_FRAME_TAG_UDATA_USER_DATA_S 8U
#define FSI_TX_FRAME_TAG_UDATA_USER_DATA_M 0xFF00U // User Data
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_BUF_PTR_LOAD register
//
//*************************************************************************************************
#define FSI_TX_BUF_PTR_LOAD_BUF_PTR_LOAD_S 0U
#define FSI_TX_BUF_PTR_LOAD_BUF_PTR_LOAD_M 0xFU // Buffer Pointer Force Load
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_BUF_PTR_STS register
//
//*************************************************************************************************
#define FSI_TX_BUF_PTR_STS_CURR_BUF_PTR_S 0U
#define FSI_TX_BUF_PTR_STS_CURR_BUF_PTR_M 0xFU // Current Buffer Pointer Index
#define FSI_TX_BUF_PTR_STS_CURR_WORD_CNT_S 8U
#define FSI_TX_BUF_PTR_STS_CURR_WORD_CNT_M 0x1F00U // Remaining Words in Buffer
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_PING_CTRL register
//
//*************************************************************************************************
#define FSI_TX_PING_CTRL_CNT_RST 0x1U // Ping Counter Reset
#define FSI_TX_PING_CTRL_TIMER_EN 0x2U // Ping Counter Enable
#define FSI_TX_PING_CTRL_EXT_TRIG_EN 0x4U // External Trigger Enable
#define FSI_TX_PING_CTRL_EXT_TRIG_SEL_S 3U
#define FSI_TX_PING_CTRL_EXT_TRIG_SEL_M 0x1F8U // External Trigger Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_PING_TAG register
//
//*************************************************************************************************
#define FSI_TX_PING_TAG_TAG_S 0U
#define FSI_TX_PING_TAG_TAG_M 0xFU // Ping Frame Tag
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_INT_CTRL register
//
//*************************************************************************************************
#define FSI_TX_INT_CTRL_INT1_EN_FRAME_DONE 0x1U // Enable Frame Done Interrupt to INT1
#define FSI_TX_INT_CTRL_INT1_EN_BUF_UNDERRUN 0x2U // Enable Buffer Underrun Interrupt to INT1
#define FSI_TX_INT_CTRL_INT1_EN_BUF_OVERRUN 0x4U // Enable Buffer Overrun Interrupt to INT1
#define FSI_TX_INT_CTRL_INT1_EN_PING_TO 0x8U // Enable Ping Timer Interrupt to INT1
#define FSI_TX_INT_CTRL_INT2_EN_FRAME_DONE 0x100U // Enable Frame Done Interrupt to INT2
#define FSI_TX_INT_CTRL_INT2_EN_BUF_UNDERRUN 0x200U // Enable Buffer Underrun Interrupt to INT2
#define FSI_TX_INT_CTRL_INT2_EN_BUF_OVERRUN 0x400U // Enable Buffer Overrun Interrupt to INT2
#define FSI_TX_INT_CTRL_INT2_EN_PING_TO 0x800U // Enable Ping Timer Interrupt to INT2
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_DMA_CTRL register
//
//*************************************************************************************************
#define FSI_TX_DMA_CTRL_DMA_EVT_EN 0x1U // DMA Event Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_LOCK_CTRL register
//
//*************************************************************************************************
#define FSI_TX_LOCK_CTRL_LOCK 0x1U // Control Register Lock Enable
#define FSI_TX_LOCK_CTRL_KEY_S 8U
#define FSI_TX_LOCK_CTRL_KEY_M 0xFF00U // Write Key
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_EVT_STS register
//
//*************************************************************************************************
#define FSI_TX_EVT_STS_FRAME_DONE 0x1U // Frame Done Flag
#define FSI_TX_EVT_STS_BUF_UNDERRUN 0x2U // Buffer Underrun Flag
#define FSI_TX_EVT_STS_BUF_OVERRUN 0x4U // Buffer Overrun Flag
#define FSI_TX_EVT_STS_PING_TRIGGERED 0x8U // Ping Frame Triggered Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_EVT_CLR register
//
//*************************************************************************************************
#define FSI_TX_EVT_CLR_FRAME_DONE 0x1U // Frame Done Flag Clear
#define FSI_TX_EVT_CLR_BUF_UNDERRUN 0x2U // Buffer Underrun Flag Clear
#define FSI_TX_EVT_CLR_BUF_OVERRUN 0x4U // Buffer Overrun Flag Clear
#define FSI_TX_EVT_CLR_PING_TRIGGERED 0x8U // Ping Frame Triggered Flag Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_EVT_FRC register
//
//*************************************************************************************************
#define FSI_TX_EVT_FRC_FRAME_DONE 0x1U // Frame Done Flag Force
#define FSI_TX_EVT_FRC_BUF_UNDERRUN 0x2U // Buffer Underrun Flag Force
#define FSI_TX_EVT_FRC_BUF_OVERRUN 0x4U // Buffer Overrun Flag Force
#define FSI_TX_EVT_FRC_PING_TRIGGERED 0x8U // Ping Frame Triggered Flag Force
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_USER_CRC register
//
//*************************************************************************************************
#define FSI_TX_USER_CRC_USER_CRC_S 0U
#define FSI_TX_USER_CRC_USER_CRC_M 0xFFU // User-defined CRC
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_ECC_DATA register
//
//*************************************************************************************************
#define FSI_TX_ECC_DATA_DATA_LOW_S 0U
#define FSI_TX_ECC_DATA_DATA_LOW_M 0xFFFFU // ECC Data Lower 16 Bits
#define FSI_TX_ECC_DATA_DATA_HIGH_S 16U
#define FSI_TX_ECC_DATA_DATA_HIGH_M 0xFFFF0000U // ECC Data Upper 16 Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the TX_ECC_VAL register
//
//*************************************************************************************************
#define FSI_TX_ECC_VAL_ECC_VAL_S 0U
#define FSI_TX_ECC_VAL_ECC_VAL_M 0x7FU // Computed ECC Value
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_MASTER_CTRL register
//
//*************************************************************************************************
#define FSI_RX_MASTER_CTRL_CORE_RST 0x1U // Receiver Main Core Reset
#define FSI_RX_MASTER_CTRL_INT_LOOPBACK 0x2U // Internal Loopback Enable
#define FSI_RX_MASTER_CTRL_SPI_PAIRING 0x4U // Clock Pairing for SPI-like Behaviour
#define FSI_RX_MASTER_CTRL_KEY_S 8U
#define FSI_RX_MASTER_CTRL_KEY_M 0xFF00U // Write Key
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_OPER_CTRL register
//
//*************************************************************************************************
#define FSI_RX_OPER_CTRL_DATA_WIDTH_S 0U
#define FSI_RX_OPER_CTRL_DATA_WIDTH_M 0x3U // Receive Data Width Select
#define FSI_RX_OPER_CTRL_SPI_MODE 0x4U // SPI Mode Enable
#define FSI_RX_OPER_CTRL_N_WORDS_S 3U
#define FSI_RX_OPER_CTRL_N_WORDS_M 0x78U // Number of Words to be Received
#define FSI_RX_OPER_CTRL_ECC_SEL 0x80U // ECC Data Width Select
#define FSI_RX_OPER_CTRL_PING_WD_RST_MODE 0x100U // Ping Watchdog Timeout Mode Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_FRAME_INFO register
//
//*************************************************************************************************
#define FSI_RX_FRAME_INFO_FRAME_TYPE_S 0U
#define FSI_RX_FRAME_INFO_FRAME_TYPE_M 0xFU // Received Frame Type
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_FRAME_TAG_UDATA register
//
//*************************************************************************************************
#define FSI_RX_FRAME_TAG_UDATA_FRAME_TAG_S 1U
#define FSI_RX_FRAME_TAG_UDATA_FRAME_TAG_M 0x1EU // Received Frame Tag
#define FSI_RX_FRAME_TAG_UDATA_USER_DATA_S 8U
#define FSI_RX_FRAME_TAG_UDATA_USER_DATA_M 0xFF00U // Received User Data
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_DMA_CTRL register
//
//*************************************************************************************************
#define FSI_RX_DMA_CTRL_DMA_EVT_EN 0x1U // DMA Event Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_EVT_STS register
//
//*************************************************************************************************
#define FSI_RX_EVT_STS_PING_WD_TO 0x1U // Ping Watchdog Timeout Flag
#define FSI_RX_EVT_STS_FRAME_WD_TO 0x2U // Frame Watchdog Timeout Flag.
#define FSI_RX_EVT_STS_CRC_ERR 0x4U // CRC Error Flag
#define FSI_RX_EVT_STS_TYPE_ERR 0x8U // Frame Type Error Flag
#define FSI_RX_EVT_STS_EOF_ERR 0x10U // End-of-Frame Error Flag
#define FSI_RX_EVT_STS_BUF_OVERRUN 0x20U // Receive Buffer Overrun Flag
#define FSI_RX_EVT_STS_FRAME_DONE 0x40U // Frame Done Flag
#define FSI_RX_EVT_STS_BUF_UNDERRUN 0x80U // Receive Buffer Underrun Flag
#define FSI_RX_EVT_STS_ERR_FRAME 0x100U // Error Frame Received Flag
#define FSI_RX_EVT_STS_PING_FRAME 0x200U // Ping Frame Received Flag
#define FSI_RX_EVT_STS_FRAME_OVERRUN 0x400U // Frame Overrun Flag
#define FSI_RX_EVT_STS_DATA_FRAME 0x800U // Data Frame Received Flag
#define FSI_RX_EVT_STS_PING_TAG_MATCH 0x1000U // Ping Tag Match Flag
#define FSI_RX_EVT_STS_DATA_TAG_MATCH 0x2000U // Data Tag Match Flag
#define FSI_RX_EVT_STS_ERROR_TAG_MATCH 0x4000U // Error Tag Match Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_CRC_INFO register
//
//*************************************************************************************************
#define FSI_RX_CRC_INFO_RX_CRC_S 0U
#define FSI_RX_CRC_INFO_RX_CRC_M 0xFFU // Received CRC Value
#define FSI_RX_CRC_INFO_CALC_CRC_S 8U
#define FSI_RX_CRC_INFO_CALC_CRC_M 0xFF00U // Hardware Calculated CRC
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_EVT_CLR register
//
//*************************************************************************************************
#define FSI_RX_EVT_CLR_PING_WD_TO 0x1U // Ping Watchdog Timeout Flag Clear
#define FSI_RX_EVT_CLR_FRAME_WD_TO 0x2U // Frame Watchdog Timeout Flag Clear
#define FSI_RX_EVT_CLR_CRC_ERR 0x4U // CRC Error Flag Clear
#define FSI_RX_EVT_CLR_TYPE_ERR 0x8U // Frame Type Error Flag Clear
#define FSI_RX_EVT_CLR_EOF_ERR 0x10U // End-of-Frame Error Flag Clear
#define FSI_RX_EVT_CLR_BUF_OVERRUN 0x20U // Receive Buffer Overrun Flag Clear
#define FSI_RX_EVT_CLR_FRAME_DONE 0x40U // Frame Done Flag Clear
#define FSI_RX_EVT_CLR_BUF_UNDERRUN 0x80U // Receive Buffer Underrun Flag Clear
#define FSI_RX_EVT_CLR_ERR_FRAME 0x100U // Error Frame Received Flag Clear
#define FSI_RX_EVT_CLR_PING_FRAME 0x200U // PING Frame Received Flag Clear
#define FSI_RX_EVT_CLR_FRAME_OVERRUN 0x400U // Frame Overrun Flag Clear
#define FSI_RX_EVT_CLR_DATA_FRAME 0x800U // Data Frame Received Flag Clear
#define FSI_RX_EVT_CLR_PING_TAG_MATCH 0x1000U // Ping Tag Match Flag Clear
#define FSI_RX_EVT_CLR_DATA_TAG_MATCH 0x2000U // Data Tag Match Flag Clear
#define FSI_RX_EVT_CLR_ERROR_TAG_MATCH 0x4000U // Error Tag Match Flag Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_EVT_FRC register
//
//*************************************************************************************************
#define FSI_RX_EVT_FRC_PING_WD_TO 0x1U // Ping Watchdog Timeout Flag Force
#define FSI_RX_EVT_FRC_FRAME_WD_TO 0x2U // Frame Watchdog Timeout Flag Force
#define FSI_RX_EVT_FRC_CRC_ERR 0x4U // CRC Error Flag Force
#define FSI_RX_EVT_FRC_TYPE_ERR 0x8U // Frame Type Error Flag Force
#define FSI_RX_EVT_FRC_EOF_ERR 0x10U // End-of-Frame Error Flag Force
#define FSI_RX_EVT_FRC_BUF_OVERRUN 0x20U // Receive Buffer Overrun Flag Force
#define FSI_RX_EVT_FRC_FRAME_DONE 0x40U // Frame Done Flag Force
#define FSI_RX_EVT_FRC_BUF_UNDERRUN 0x80U // Receive Buffer Underrun Flag Force
#define FSI_RX_EVT_FRC_ERR_FRAME 0x100U // Error Frame Received Flag Force
#define FSI_RX_EVT_FRC_PING_FRAME 0x200U // Ping Frame Received Flag Force
#define FSI_RX_EVT_FRC_FRAME_OVERRUN 0x400U // Frame Overrun Flag Force
#define FSI_RX_EVT_FRC_DATA_FRAME 0x800U // Data Frame Received Flag Force
#define FSI_RX_EVT_FRC_PING_TAG_MATCH 0x1000U // Ping Tag Match Flag Force
#define FSI_RX_EVT_FRC_DATA_TAG_MATCH 0x2000U // Data Tag Match Flag Force
#define FSI_RX_EVT_FRC_ERROR_TAG_MATCH 0x4000U // Error Tag Match Flag Force
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_BUF_PTR_LOAD register
//
//*************************************************************************************************
#define FSI_RX_BUF_PTR_LOAD_BUF_PTR_LOAD_S 0U
#define FSI_RX_BUF_PTR_LOAD_BUF_PTR_LOAD_M 0xFU // Load value for receive buffer pointer
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_BUF_PTR_STS register
//
//*************************************************************************************************
#define FSI_RX_BUF_PTR_STS_CURR_BUF_PTR_S 0U
#define FSI_RX_BUF_PTR_STS_CURR_BUF_PTR_M 0xFU // Current Buffer Pointer Index
#define FSI_RX_BUF_PTR_STS_CURR_WORD_CNT_S 8U
#define FSI_RX_BUF_PTR_STS_CURR_WORD_CNT_M 0x1F00U // Available Words in Buffer
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_FRAME_WD_CTRL register
//
//*************************************************************************************************
#define FSI_RX_FRAME_WD_CTRL_FRAME_WD_CNT_RST 0x1U // Frame Watchdog Counter Reset
#define FSI_RX_FRAME_WD_CTRL_FRAME_WD_EN 0x2U // Frame Watchdog Counter Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_PING_WD_CTRL register
//
//*************************************************************************************************
#define FSI_RX_PING_WD_CTRL_PING_WD_RST 0x1U // Ping Watchdog Counter Reset
#define FSI_RX_PING_WD_CTRL_PING_WD_EN 0x2U // Ping Watchdog Counter Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_PING_TAG register
//
//*************************************************************************************************
#define FSI_RX_PING_TAG_PING_TAG_S 1U
#define FSI_RX_PING_TAG_PING_TAG_M 0x1EU // Ping Frame Tag
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_INT1_CTRL register
//
//*************************************************************************************************
#define FSI_RX_INT1_CTRL_INT1_EN_PING_WD_TO 0x1U // Enable Ping Watchdog Timeout
// Interrupt to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_FRAME_WD_TO 0x2U // Enable Frame Watchdog Timeout
// Interrupt to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_CRC_ERR 0x4U // Enable CRC Error Interrupt to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_TYPE_ERR 0x8U // Enable Frame Type Error Interrupt
// to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_EOF_ERR 0x10U // Enable End-of-Frame Error Interrupt
// to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_OVERRUN 0x20U // Enable Receive Buffer Overrun
// Interrupt to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_FRAME_DONE 0x40U // Enable Frame Done Interrupt to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_UNDERRUN 0x80U // Enable Buffer Underrun Interrupt to
// INT1
#define FSI_RX_INT1_CTRL_INT1_EN_ERR_FRAME 0x100U // Enable Error Frame Received
// Interrupt to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_PING_FRAME 0x200U // Enable Ping Frame Received
// Interrupt to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_FRAME_OVERRUN 0x400U // Enable Frame Overrun Interrupt to
// INT1
#define FSI_RX_INT1_CTRL_INT1_EN_DATA_FRAME 0x800U // Enable Data Frame Received
// Interrupt to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_PING_TAG_MATCH 0x1000U // Enable Ping Frame Tag Matched
// Interrupt to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_DATA_TAG_MATCH 0x2000U // Enable Data Frame Tag Matched
// Interrupt to INT1
#define FSI_RX_INT1_CTRL_INT1_EN_ERROR_TAG_MATCH 0x4000U // Enable Error Frame Tag Matched
// Interrupt to INT1
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_INT2_CTRL register
//
//*************************************************************************************************
#define FSI_RX_INT2_CTRL_INT2_EN_PING_WD_TO 0x1U // Enable Ping Watchdog Timeout
// Interrupt to INT2
#define FSI_RX_INT2_CTRL_INT2_EN_FRAME_WD_TO 0x2U // Enable Frame Watchdog Timeout
// Interrupt to INT2
#define FSI_RX_INT2_CTRL_INT2_EN_CRC_ERR 0x4U // Enable CRC Errror Interrupt to INT2
#define FSI_RX_INT2_CTRL_INT2_EN_TYPE_ERR 0x8U // Enable Frame Type Error Interrupt
// to INT2
#define FSI_RX_INT2_CTRL_INT2_EN_EOF_ERR 0x10U // Enable End-of-Frame Error Interrupt
// to INT2
#define FSI_RX_INT2_CTRL_INT2_EN_OVERRUN 0x20U // Enable Buffer Overrun Interrupt to
// INT2
#define FSI_RX_INT2_CTRL_INT2_EN_FRAME_DONE 0x40U // Enable Frame Done Interrupt to INT2
#define FSI_RX_INT2_CTRL_INT2_EN_UNDERRUN 0x80U // Enable Buffer Underrun Interrupt to
// INT2
#define FSI_RX_INT2_CTRL_INT2_EN_ERR_FRAME 0x100U // Enable Error Frame Received
// Interrupt to INT2
#define FSI_RX_INT2_CTRL_INT2_EN_PING_FRAME 0x200U // Enable Ping Frame Received
// Interrupt to INT2
#define FSI_RX_INT2_CTRL_INT2_EN_FRAME_OVERRUN 0x400U // Enable Frame Overrun Interrupt to
// INT2
#define FSI_RX_INT2_CTRL_INT2_EN_DATA_FRAME 0x800U // Enable Data Frame Received
// Interrupt to INT2
#define FSI_RX_INT2_CTRL_INT2_EN_PING_TAG_MATCH 0x1000U // Enable Ping Frame Tag Matched
// Interrupt to INT2
#define FSI_RX_INT2_CTRL_INT2_EN_DATA_TAG_MATCH 0x2000U // Enable Data Frame Tag Matched
// Interrupt to INT2
#define FSI_RX_INT2_CTRL_INT2_EN_ERROR_TAG_MATCH 0x4000U // Enable Error Frame Tag Matched
// Interrupt to INT2
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_LOCK_CTRL register
//
//*************************************************************************************************
#define FSI_RX_LOCK_CTRL_LOCK 0x1U // Control Register Lock Enable
#define FSI_RX_LOCK_CTRL_KEY_S 8U
#define FSI_RX_LOCK_CTRL_KEY_M 0xFF00U // Write Key
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_ECC_DATA register
//
//*************************************************************************************************
#define FSI_RX_ECC_DATA_DATA_LOW_S 0U
#define FSI_RX_ECC_DATA_DATA_LOW_M 0xFFFFU // ECC Data Lower 16 Bits
#define FSI_RX_ECC_DATA_DATA_HIGH_S 16U
#define FSI_RX_ECC_DATA_DATA_HIGH_M 0xFFFF0000U // ECC Data Upper 16 Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_ECC_VAL register
//
//*************************************************************************************************
#define FSI_RX_ECC_VAL_ECC_VAL_S 0U
#define FSI_RX_ECC_VAL_ECC_VAL_M 0x7FU // Computed ECC Value
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_ECC_LOG register
//
//*************************************************************************************************
#define FSI_RX_ECC_LOG_SBE 0x1U // Single Bit Error Detected
#define FSI_RX_ECC_LOG_MBE 0x2U // Multiple Bit Errors Detected
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_FRAME_TAG_CMP register
//
//*************************************************************************************************
#define FSI_RX_FRAME_TAG_CMP_TAG_REF_S 0U
#define FSI_RX_FRAME_TAG_CMP_TAG_REF_M 0xFU // Frame Tag Reference
#define FSI_RX_FRAME_TAG_CMP_TAG_MASK_S 4U
#define FSI_RX_FRAME_TAG_CMP_TAG_MASK_M 0xF0U // Frame Tag Mask
#define FSI_RX_FRAME_TAG_CMP_CMP_EN 0x100U // Frame Tag Compare Enable
#define FSI_RX_FRAME_TAG_CMP_BROADCAST_EN 0x200U // Broadcast Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_PING_TAG_CMP register
//
//*************************************************************************************************
#define FSI_RX_PING_TAG_CMP_TAG_REF_S 0U
#define FSI_RX_PING_TAG_CMP_TAG_REF_M 0xFU // Ping Tag Reference
#define FSI_RX_PING_TAG_CMP_TAG_MASK_S 4U
#define FSI_RX_PING_TAG_CMP_TAG_MASK_M 0xF0U // Ping Tag Mask
#define FSI_RX_PING_TAG_CMP_CMP_EN 0x100U // Ping Tag Compare Enable
#define FSI_RX_PING_TAG_CMP_BROADCAST_EN 0x200U // Broadcast Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_DLYLINE_CTRL register
//
//*************************************************************************************************
#define FSI_RX_DLYLINE_CTRL_RXCLK_DLY_S 0U
#define FSI_RX_DLYLINE_CTRL_RXCLK_DLY_M 0x1FU // Delay Line Tap Select for RXCLK
#define FSI_RX_DLYLINE_CTRL_RXD0_DLY_S 5U
#define FSI_RX_DLYLINE_CTRL_RXD0_DLY_M 0x3E0U // Delay Line Tap Select for RXD0
#define FSI_RX_DLYLINE_CTRL_RXD1_DLY_S 10U
#define FSI_RX_DLYLINE_CTRL_RXD1_DLY_M 0x7C00U // Delay Line Tap Select for RXD1
//*************************************************************************************************
//
// The following are defines for the bit fields in the RX_VIS_1 register
//
//*************************************************************************************************
#define FSI_RX_VIS_1_RX_CORE_STS 0x8U // Receiver Core Status
#endif
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,344 @@
//###########################################################################
//
// FILE: hw_hic.h
//
// TITLE: Definitions for the HIC registers.
//
//###########################################################################
// $TI Release: $
// $Release Date: $
//
// 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 HW_HIC_H
#define HW_HIC_H
//*************************************************************************************************
//
// The following are defines for the HIC register offsets
//
//*************************************************************************************************
#define HIC_O_REV 0x0U // Module Revision Register
#define HIC_O_GCR 0x2U // Global Control Register
#define HIC_O_LOCK 0x4U // Lock Register
#define HIC_O_MODECR 0x6U // Mode Control Register
#define HIC_O_PINPOLCR 0x8U // Pin Polarity Control Register
#define HIC_O_BASESEL 0xAU // Base Select Register
#define HIC_O_HOSTCR 0xCU // Host Control Register
#define HIC_O_ERRADDR 0xEU // Host Error Address register
#define HIC_O_H2DTOKEN 0x10U // Host to Device Token Register
#define HIC_O_D2HTOKEN 0x12U // Devie to Host Token Register
#define HIC_O_DBADDR0 0x14U // Device Base Address Register 0
#define HIC_O_DBADDR1 0x16U // Device Base Address Register 1
#define HIC_O_DBADDR2 0x18U // Device Base Address Register 2
#define HIC_O_DBADDR3 0x1AU // Device Base Address Register 3
#define HIC_O_DBADDR4 0x1CU // Device Base Address Register 4
#define HIC_O_DBADDR5 0x1EU // Device Base Address Register 5
#define HIC_O_DBADDR6 0x20U // Device Base Address Register 6
#define HIC_O_DBADDR7 0x22U // Device Base Address Register 7
#define HIC_O_H2DINTEN 0x28U // H2D Interrupt Enable
#define HIC_O_H2DINTFLG 0x2AU // H2D Interrupt status Flag
#define HIC_O_H2DINTCLR 0x2CU // H2D Interrupt status Clear
#define HIC_O_H2DINTFRC 0x2EU // H2D Interrupt Set Force
#define HIC_O_D2HINTEN 0x30U // D2H Interrupt Enable
#define HIC_O_D2HINTFLG 0x32U // D2H Interrupt status Flag
#define HIC_O_D2HINTCLR 0x34U // D2H Interrupt status Clear
#define HIC_O_D2HINTFRC 0x36U // D2H Interrupt Set Force
#define HIC_O_ACCVIOADDR 0x38U // Access Violation Address
#define HIC_O_H2D_BUF0 0x40U // Host to Device Buffer 0
#define HIC_O_H2D_BUF1 0x42U // Host to Device Buffer 1
#define HIC_O_H2D_BUF2 0x44U // Host to Device Buffer 2
#define HIC_O_H2D_BUF3 0x46U // Host to Device Buffer 3
#define HIC_O_H2D_BUF4 0x48U // Host to Device Buffer 4
#define HIC_O_H2D_BUF5 0x4AU // Host to Device Buffer 5
#define HIC_O_H2D_BUF6 0x4CU // Host to Device Buffer 6
#define HIC_O_H2D_BUF7 0x4EU // Host to Device Buffer 7
#define HIC_O_H2D_BUF8 0x50U // Host to Device Buffer 8
#define HIC_O_H2D_BUF9 0x52U // Host to Device Buffer 9
#define HIC_O_H2D_BUF10 0x54U // Host to Device Buffer 10
#define HIC_O_H2D_BUF11 0x56U // Host to Device Buffer 11
#define HIC_O_H2D_BUF12 0x58U // Host to Device Buffer 12
#define HIC_O_H2D_BUF13 0x5AU // Host to Device Buffer 13
#define HIC_O_H2D_BUF14 0x5CU // Host to Device Buffer 14
#define HIC_O_H2D_BUF15 0x5EU // Host to Device Buffer 15
#define HIC_O_D2H_BUF0 0x60U // Device to Host Buffer 0
#define HIC_O_D2H_BUF1 0x62U // Device to Host Buffer 1
#define HIC_O_D2H_BUF2 0x64U // Device to Host Buffer 2
#define HIC_O_D2H_BUF3 0x66U // Device to Host Buffer 3
#define HIC_O_D2H_BUF4 0x68U // Device to Host Buffer 4
#define HIC_O_D2H_BUF5 0x6AU // Device to Host Buffer 5
#define HIC_O_D2H_BUF6 0x6CU // Device to Host Buffer 6
#define HIC_O_D2H_BUF7 0x6EU // Device to Host Buffer 7
#define HIC_O_D2H_BUF8 0x70U // Device to Host Buffer 8
#define HIC_O_D2H_BUF9 0x72U // Device to Host Buffer 9
#define HIC_O_D2H_BUF10 0x74U // Device to Host Buffer 10
#define HIC_O_D2H_BUF11 0x76U // Device to Host Buffer 11
#define HIC_O_D2H_BUF12 0x78U // Device to Host Buffer 12
#define HIC_O_D2H_BUF13 0x7AU // Device to Host Buffer 13
#define HIC_O_D2H_BUF14 0x7CU // Device to Host Buffer 14
#define HIC_O_D2H_BUF15 0x7EU // Device to Host Buffer 15
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICREV register
//
//*************************************************************************************************
#define HIC_REV_MINOR_S 0U
#define HIC_REV_MINOR_M 0x3FU // Minor Revision Number
#define HIC_REV_CUSTOM_S 6U
#define HIC_REV_CUSTOM_M 0xC0U // Custom Module Number
#define HIC_REV_MAJOR_S 8U
#define HIC_REV_MAJOR_M 0x700U // Major Revision Number
#define HIC_REV_RTL_S 11U
#define HIC_REV_RTL_M 0xF800U // Design Release Number
#define HIC_REV_FUNC_S 16U
#define HIC_REV_FUNC_M 0xFFF0000U // Functional Release Number
#define HIC_REV_SCHEME_S 30U
#define HIC_REV_SCHEME_M 0xC0000000U // Defines Scheme for Module
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICGCR register
//
//*************************************************************************************************
#define HIC_GCR_HICEN_S 0U
#define HIC_GCR_HICEN_M 0xFU // Host Interface Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICLOCK register
//
//*************************************************************************************************
#define HIC_LOCK_LOCK 0x1U // LOCK enable
#define HIC_LOCK_WRITE_ENABLE_KEY_S 16U
#define HIC_LOCK_WRITE_ENABLE_KEY_M 0xFFFF0000U // Key for enabling write
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICMODECR register
//
//*************************************************************************************************
#define HIC_MODECR_DW_MODE_S 0U
#define HIC_MODECR_DW_MODE_M 0x3U // Data Width Mode
#define HIC_MODECR_RW_MODE 0x10U // Read-Write Mode
#define HIC_MODECR_BEN_PRESENT 0x20U // Byte Enable Pins are present
#define HIC_MODECR_RDY_PRESENT 0x40U // Ready pin present
#define HIC_MODECR_H2DBUF_DEVWREN 0x100U // Write Enable for Device to H2D Buffer
#define HIC_MODECR_D2HBUF_HOSTWREN 0x200U // Write Enable for Host to D2H Buffer
#define HIC_MODECR_EN_DEVACC 0x400U // Enable Host access to Device region
#define HIC_MODECR_EN_HOSTWREALLOW 0x800U // Enable Host Write to EALLOWCTL register
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICPINPOLCR register
//
//*************************************************************************************************
#define HIC_PINPOLCR_CS_POL 0x1U // Chip Select Polarity
#define HIC_PINPOLCR_BEN_POL 0x2U // Byte Enable Polarity
#define HIC_PINPOLCR_OE_POL 0x4U // Output Enable Polarity
#define HIC_PINPOLCR_WE_POL 0x8U // Write Enable Polarity
#define HIC_PINPOLCR_RDY_POL 0x10U // Ready Polarity
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICBASESEL register
//
//*************************************************************************************************
#define HIC_BASESEL_BASE_SELECT_S 0U
#define HIC_BASESEL_BASE_SELECT_M 0x7U // Base Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICHOSTCR register
//
//*************************************************************************************************
#define HIC_HOSTCR_EALLOW_EN 0x1U // EALLOW Enable
#define HIC_HOSTCR_ACCSIZE 0x2U // Access Size
#define HIC_HOSTCR_PAGESEL 0x4U // Page Select
#define HIC_HOSTCR_HKEY_S 8U
#define HIC_HOSTCR_HKEY_M 0xFF00U // Host Key
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICERRADDR register
//
//*************************************************************************************************
#define HIC_ERRADDR_H2D_ERR_ADDR_S 0U
#define HIC_ERRADDR_H2D_ERR_ADDR_M 0xFFU // Address of the Host bus captured upon an
// error for Device
#define HIC_ERRADDR_H2D_BASE_SEL_S 12U
#define HIC_ERRADDR_H2D_BASE_SEL_M 0x7000U // Base Select corresponding to H2D error event
#define HIC_ERRADDR_D2H_ERR_ADDR_S 16U
#define HIC_ERRADDR_D2H_ERR_ADDR_M 0xFF0000U // Address of the Host bus captured upon an
// error for Host
#define HIC_ERRADDR_D2H_BASE_SEL_S 28U
#define HIC_ERRADDR_D2H_BASE_SEL_M 0x70000000U // Base Select corresponding to D2H error event
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICDBADDR0 register
//
//*************************************************************************************************
#define HIC_DBADDR0_BASE_ADDR_S 7U
#define HIC_DBADDR0_BASE_ADDR_M 0xFFFFFF80U // Base address of device region
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICDBADDR1 register
//
//*************************************************************************************************
#define HIC_DBADDR1_BASE_ADDR_S 7U
#define HIC_DBADDR1_BASE_ADDR_M 0xFFFFFF80U // Base address of device region
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICDBADDR2 register
//
//*************************************************************************************************
#define HIC_DBADDR2_BASE_ADDR_S 7U
#define HIC_DBADDR2_BASE_ADDR_M 0xFFFFFF80U // Base address of device region
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICDBADDR3 register
//
//*************************************************************************************************
#define HIC_DBADDR3_BASE_ADDR_S 7U
#define HIC_DBADDR3_BASE_ADDR_M 0xFFFFFF80U // Base address of device region
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICDBADDR4 register
//
//*************************************************************************************************
#define HIC_DBADDR4_BASE_ADDR_S 7U
#define HIC_DBADDR4_BASE_ADDR_M 0xFFFFFF80U // Base address of device region
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICDBADDR5 register
//
//*************************************************************************************************
#define HIC_DBADDR5_BASE_ADDR_S 7U
#define HIC_DBADDR5_BASE_ADDR_M 0xFFFFFF80U // Base address of device region
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICDBADDR6 register
//
//*************************************************************************************************
#define HIC_DBADDR6_BASE_ADDR_S 7U
#define HIC_DBADDR6_BASE_ADDR_M 0xFFFFFF80U // Base address of device region
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICDBADDR7 register
//
//*************************************************************************************************
#define HIC_DBADDR7_BASE_ADDR_S 7U
#define HIC_DBADDR7_BASE_ADDR_M 0xFFFFFF80U // Base address of device region
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICH2DINTEN register
//
//*************************************************************************************************
#define HIC_H2DINTEN_H2D_INTEN 0x1U // Host To Device Interrupt Enable
#define HIC_H2DINTEN_BUSERR_INTEN 0x2U // BusError Interrupt Enable
#define HIC_H2DINTEN_ILLWR_INTEN 0x4U // Illegal Write event interrupt enable
#define HIC_H2DINTEN_ILLRD_INTEN 0x8U // Illegal Read event interrupt enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICH2DINTFLG register
//
//*************************************************************************************************
#define HIC_H2DINTFLG_H2D_FLG 0x1U // Host To Device Interrupt Flag
#define HIC_H2DINTFLG_BUSERR_FLG 0x2U // BusError Interrupt Flag
#define HIC_H2DINTFLG_ILLWR_FLG 0x4U // Illegal write event interrupt flag
#define HIC_H2DINTFLG_ILLRD_FLG 0x8U // Illegal read event interrupt flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICH2DINTCLR register
//
//*************************************************************************************************
#define HIC_H2DINTCLR_H2D_CLR 0x1U // Host To Device Interrupt Clear
#define HIC_H2DINTCLR_BUSERR_CLR 0x2U // BusError Interrupt Clear
#define HIC_H2DINTCLR_ILLWR_CLR 0x4U // Illegal Write Interrupt Clear
#define HIC_H2DINTCLR_ILLRD_CLR 0x8U // Illegal Read Interrupt Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICH2DINTFRC register
//
//*************************************************************************************************
#define HIC_H2DINTFRC_H2D_INTFRC 0x1U // Host To Device Force Set
#define HIC_H2DINTFRC_BUSERR_INTFRC 0x2U // BusError Interrupt Force Set
#define HIC_H2DINTFRC_ILLWR_INTFRC 0x4U // Illegal Write Interrupt Force Set
#define HIC_H2DINTFRC_ILLRD_INTFRC 0x8U // Illegal Read Interrupt Force Set
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICD2HINTEN register
//
//*************************************************************************************************
#define HIC_D2HINTEN_D2H_INTEN 0x1U // Device to Host Data Ready Interrupt Enable
#define HIC_D2HINTEN_BUSERR_INTEN 0x2U // BusError Interrupt Enable
#define HIC_D2HINTEN_ILLWR_INTEN 0x4U // Illegal Write event Interrupt Enable
#define HIC_D2HINTEN_ILLRD_INTEN 0x8U // Illegal Read event Interrupt Enable
#define HIC_D2HINTEN_ACCVIO_INTEN 0x10U // Access Violation Interrupt Enable
#define HIC_D2HINTEN_EVTRIG_INTEN_S 16U
#define HIC_D2HINTEN_EVTRIG_INTEN_M 0xFFFF0000U // Event Trigger Interrupt Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICD2HINTFLG register
//
//*************************************************************************************************
#define HIC_D2HINTFLG_D2H_FLG 0x1U // Device to Host Data Ready Flag
#define HIC_D2HINTFLG_BUSERR_FLG 0x2U // BusError Flag
#define HIC_D2HINTFLG_ILLWR_FLG 0x4U // Illegal Write event Flag
#define HIC_D2HINTFLG_ILLRD_FLG 0x8U // Illegal Read event Flag
#define HIC_D2HINTFLG_ACCVIO_FLG 0x10U // Access Violation Flag
#define HIC_D2HINTFLG_EVTRIG_FLG_S 16U
#define HIC_D2HINTFLG_EVTRIG_FLG_M 0xFFFF0000U // Event Trigger Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICD2HINTCLR register
//
//*************************************************************************************************
#define HIC_D2HINTCLR_D2H_CLR 0x1U // Device to Host Interrupt Clear
#define HIC_D2HINTCLR_BUSERR_CLR 0x2U // BusError Interrupt Clear
#define HIC_D2HINTCLR_ILLWR_CLR 0x4U // Illegal Write Interrupt Clear
#define HIC_D2HINTCLR_ILLRD_CLR 0x8U // Illegal Read Interrupt Clear
#define HIC_D2HINTCLR_ACCVIO_CLR 0x10U // Access Violation Interrupt Clear
#define HIC_D2HINTCLR_EVTRIG_CLR_S 16U
#define HIC_D2HINTCLR_EVTRIG_CLR_M 0xFFFF0000U // Event Trigger Interrupt Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the HICD2HINTFRC register
//
//*************************************************************************************************
#define HIC_D2HINTFRC_D2H_INTFRC 0x1U // Device to Host Force Set
#define HIC_D2HINTFRC_BUSERR_INTFRC 0x2U // BusError Interrupt Force Set
#define HIC_D2HINTFRC_ILLWR_INTFRC 0x4U // Illegal Write Interrupt Force Set
#define HIC_D2HINTFRC_ILLRD_INTFRC 0x8U // Illegal Read Interrupt Force Set
#define HIC_D2HINTFRC_ACCVIO_INTFRC 0x10U // Access Violation Interrupt Force Set
#define HIC_D2HINTFRC_EVTRIG_INTFRC_S 16U
#define HIC_D2HINTFRC_EVTRIG_INTFRC_M 0xFFFF0000U // Event Trigger Interrupt Force Set
#endif
@@ -0,0 +1,239 @@
//###########################################################################
//
// FILE: hw_hrcap.h
//
// TITLE: Definitions for the HRCAP 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 HW_HRCAP_H
#define HW_HRCAP_H
//*************************************************************************************************
//
// The following are defines for the HRCAP register offsets
//
//*************************************************************************************************
#define HRCAP_O_TSCTR 0x0U // Time-Stamp Counter
#define HRCAP_O_CTRPHS 0x2U // Counter Phase Offset Value Register
#define HRCAP_O_CAP1 0x4U // Capture 1 Register
#define HRCAP_O_CAP2 0x6U // Capture 2 Register
#define HRCAP_O_CAP3 0x8U // Capture 3 Register
#define HRCAP_O_CAP4 0xAU // Capture 4 Register
#define HRCAP_O_ECCTL0 0x12U // Capture Control Register 0
#define HRCAP_O_ECCTL1 0x14U // Capture Control Register 1
#define HRCAP_O_ECCTL2 0x15U // Capture Control Register 2
#define HRCAP_O_ECEINT 0x16U // Capture Interrupt Enable Register
#define HRCAP_O_ECFLG 0x17U // Capture Interrupt Flag Register
#define HRCAP_O_ECCLR 0x18U // Capture Interrupt Clear Register
#define HRCAP_O_ECFRC 0x19U // Capture Interrupt Force Register
#define HRCAP_O_ECAPSYNCINSEL 0x1EU // SYNC source select register
#define HRCAP_O_HRCTL 0x0U // High-Res Control Register
#define HRCAP_O_HRINTEN 0x4U // High-Res Calibration Interrupt Enable Register
#define HRCAP_O_HRFLG 0x6U // High-Res Calibration Interrupt Flag Register
#define HRCAP_O_HRCLR 0x8U // High-Res Calibration Interrupt Clear Register
#define HRCAP_O_HRFRC 0xAU // High-Res Calibration Interrupt Force Register
#define HRCAP_O_HRCALPRD 0xCU // High-Res Calibration Period Register
#define HRCAP_O_HRSYSCLKCTR 0xEU // High-Res Calibration SYSCLK Counter Register
#define HRCAP_O_HRSYSCLKCAP 0x10U // High-Res Calibration SYSCLK Capture Register
#define HRCAP_O_HRCLKCTR 0x12U // High-Res Calibration HRCLK Counter Register
#define HRCAP_O_HRCLKCAP 0x14U // High-Res Calibration HRCLK Capture Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECCTL0 register
//
//*************************************************************************************************
#define HRCAP_ECCTL0_INPUTSEL_S 0U
#define HRCAP_ECCTL0_INPUTSEL_M 0x7FU // INPUT source select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECCTL1 register
//
//*************************************************************************************************
#define HRCAP_ECCTL1_CAP1POL 0x1U // Capture Event 1 Polarity select
#define HRCAP_ECCTL1_CTRRST1 0x2U // Counter Reset on Capture Event 1
#define HRCAP_ECCTL1_CAP2POL 0x4U // Capture Event 2 Polarity select
#define HRCAP_ECCTL1_CTRRST2 0x8U // Counter Reset on Capture Event 2
#define HRCAP_ECCTL1_CAP3POL 0x10U // Capture Event 3 Polarity select
#define HRCAP_ECCTL1_CTRRST3 0x20U // Counter Reset on Capture Event 3
#define HRCAP_ECCTL1_CAP4POL 0x40U // Capture Event 4 Polarity select
#define HRCAP_ECCTL1_CTRRST4 0x80U // Counter Reset on Capture Event 4
#define HRCAP_ECCTL1_CAPLDEN 0x100U // Enable Loading CAP1-4 regs on a Cap Event
#define HRCAP_ECCTL1_PRESCALE_S 9U
#define HRCAP_ECCTL1_PRESCALE_M 0x3E00U // Event Filter prescale select
#define HRCAP_ECCTL1_FREE_SOFT_S 14U
#define HRCAP_ECCTL1_FREE_SOFT_M 0xC000U // Emulation mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECCTL2 register
//
//*************************************************************************************************
#define HRCAP_ECCTL2_CONT_ONESHT 0x1U // Continuous or one-shot
#define HRCAP_ECCTL2_STOP_WRAP_S 1U
#define HRCAP_ECCTL2_STOP_WRAP_M 0x6U // Stop value for one-shot, Wrap for continuous
#define HRCAP_ECCTL2_REARM 0x8U // One-shot re-arm
#define HRCAP_ECCTL2_TSCTRSTOP 0x10U // TSCNT counter stop
#define HRCAP_ECCTL2_SYNCI_EN 0x20U // Counter sync-in select
#define HRCAP_ECCTL2_SYNCO_SEL_S 6U
#define HRCAP_ECCTL2_SYNCO_SEL_M 0xC0U // Sync-out mode
#define HRCAP_ECCTL2_SWSYNC 0x100U // SW forced counter sync
#define HRCAP_ECCTL2_CAP_APWM 0x200U // CAP/APWM operating mode select
#define HRCAP_ECCTL2_APWMPOL 0x400U // APWM output polarity select
#define HRCAP_ECCTL2_CTRFILTRESET 0x800U // Reset event filter, modulus counter, and interrupt
// flags.
#define HRCAP_ECCTL2_DMAEVTSEL_S 12U
#define HRCAP_ECCTL2_DMAEVTSEL_M 0x3000U // DMA event select
#define HRCAP_ECCTL2_MODCNTRSTS_S 14U
#define HRCAP_ECCTL2_MODCNTRSTS_M 0xC000U // modulo counter status
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECEINT register
//
//*************************************************************************************************
#define HRCAP_ECEINT_CEVT1 0x2U // Capture Event 1 Interrupt Enable
#define HRCAP_ECEINT_CEVT2 0x4U // Capture Event 2 Interrupt Enable
#define HRCAP_ECEINT_CEVT3 0x8U // Capture Event 3 Interrupt Enable
#define HRCAP_ECEINT_CEVT4 0x10U // Capture Event 4 Interrupt Enable
#define HRCAP_ECEINT_CTROVF 0x20U // Counter Overflow Interrupt Enable
#define HRCAP_ECEINT_CTR_EQ_PRD 0x40U // Period Equal Interrupt Enable
#define HRCAP_ECEINT_CTR_EQ_CMP 0x80U // Compare Equal Interrupt Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECFLG register
//
//*************************************************************************************************
#define HRCAP_ECFLG_INT 0x1U // Global Flag
#define HRCAP_ECFLG_CEVT1 0x2U // Capture Event 1 Interrupt Flag
#define HRCAP_ECFLG_CEVT2 0x4U // Capture Event 2 Interrupt Flag
#define HRCAP_ECFLG_CEVT3 0x8U // Capture Event 3 Interrupt Flag
#define HRCAP_ECFLG_CEVT4 0x10U // Capture Event 4 Interrupt Flag
#define HRCAP_ECFLG_CTROVF 0x20U // Counter Overflow Interrupt Flag
#define HRCAP_ECFLG_CTR_PRD 0x40U // Period Equal Interrupt Flag
#define HRCAP_ECFLG_CTR_CMP 0x80U // Compare Equal Interrupt Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECCLR register
//
//*************************************************************************************************
#define HRCAP_ECCLR_INT 0x1U // ECAP Global Interrupt Status Clear
#define HRCAP_ECCLR_CEVT1 0x2U // Capture Event 1 Status Clear
#define HRCAP_ECCLR_CEVT2 0x4U // Capture Event 2 Status Clear
#define HRCAP_ECCLR_CEVT3 0x8U // Capture Event 3 Status Clear
#define HRCAP_ECCLR_CEVT4 0x10U // Capture Event 4 Status Clear
#define HRCAP_ECCLR_CTROVF 0x20U // Counter Overflow Status Clear
#define HRCAP_ECCLR_CTR_PRD 0x40U // Period Equal Status Clear
#define HRCAP_ECCLR_CTR_CMP 0x80U // Compare Equal Status Clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECFRC register
//
//*************************************************************************************************
#define HRCAP_ECFRC_CEVT1 0x2U // Capture Event 1 Force Interrupt
#define HRCAP_ECFRC_CEVT2 0x4U // Capture Event 2 Force Interrupt
#define HRCAP_ECFRC_CEVT3 0x8U // Capture Event 3 Force Interrupt
#define HRCAP_ECFRC_CEVT4 0x10U // Capture Event 4 Force Interrupt
#define HRCAP_ECFRC_CTROVF 0x20U // Counter Overflow Force Interrupt
#define HRCAP_ECFRC_CTR_PRD 0x40U // Period Equal Force Interrupt
#define HRCAP_ECFRC_CTR_CMP 0x80U // Compare Equal Force Interrupt
//*************************************************************************************************
//
// The following are defines for the bit fields in the ECAPSYNCINSEL register
//
//*************************************************************************************************
#define HRCAP_ECAPSYNCINSEL_SEL_S 0U
#define HRCAP_ECAPSYNCINSEL_SEL_M 0x1FU // SYNCIN source select
//*************************************************************************************************
//
// The following are defines for the bit fields in the HRCTL register
//
//*************************************************************************************************
#define HRCAP_HRCTL_HRE 0x1U // High Resolution Enable
#define HRCAP_HRCTL_HRCLKE 0x2U // High Resolution Clock Enable
#define HRCAP_HRCTL_PRDSEL 0x4U // Calibration Period Match
#define HRCAP_HRCTL_CALIBSTART 0x8U // Calibration start
#define HRCAP_HRCTL_CALIBSTS 0x10U // Calibration status
#define HRCAP_HRCTL_CALIBCONT 0x20U // Continuous mode Calibration Select
//*************************************************************************************************
//
// The following are defines for the bit fields in the HRINTEN register
//
//*************************************************************************************************
#define HRCAP_HRINTEN_CALIBDONE 0x2U // Calibration doe interrupt enable
#define HRCAP_HRINTEN_CALPRDCHKSTS 0x4U // Calibration period check status enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the HRFLG register
//
//*************************************************************************************************
#define HRCAP_HRFLG_CALIBINT 0x1U // Global calibration Interrupt Status Flag
#define HRCAP_HRFLG_CALIBDONE 0x2U // Calibration Done Interrupt Flag Bit
#define HRCAP_HRFLG_CALPRDCHKSTS 0x4U // Calibration period check status Flag Bi
//*************************************************************************************************
//
// The following are defines for the bit fields in the HRCLR register
//
//*************************************************************************************************
#define HRCAP_HRCLR_CALIBINT 0x1U // Clear Global calibration Interrupt Flag
#define HRCAP_HRCLR_CALIBDONE 0x2U // Clear Calibration Done Interrupt Flag Bit
#define HRCAP_HRCLR_CALPRDCHKSTS 0x4U // Clear Calibration period check status Flag Bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the HRFRC register
//
//*************************************************************************************************
#define HRCAP_HRFRC_CALIBDONE 0x2U // Force Calibration Done Interrupt Flag Bit
#define HRCAP_HRFRC_CALPRDCHKSTS 0x4U // Force Calibration period check status Flag Bit
#endif
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,210 @@
//###########################################################################
//
// FILE: hw_hwbist.h
//
// TITLE: Definitions for the HWBIST 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 HW_HWBIST_H
#define HW_HWBIST_H
//*************************************************************************************************
//
// The following are defines for the HWBIST register offsets
//
//*************************************************************************************************
#define HWBIST_O_CSTCGCR1 0x4U // STC Global Control Register1
#define HWBIST_O_CSTCGCR3 0xCU // STC Global Control Register3
#define HWBIST_O_CSTCGCR4 0x10U // STC Global Control Register4
#define HWBIST_O_CSTCGCR5 0x14U // STC Global Control Register5
#define HWBIST_O_CSTCGCR6 0x18U // STC Global Control Register6
#define HWBIST_O_CSTCGCR7 0x1CU // STC Global Control Register7
#define HWBIST_O_CSTCGCR8 0x20U // STC Global Control Register8
#define HWBIST_O_CSTCPCNT 0x24U // STC Pattern Count Register
#define HWBIST_O_CSTCCONFIG 0x28U // STC Registers Configuration Status
#define HWBIST_O_CSTCSADDR 0x2CU // STC ROM Start Address
#define HWBIST_O_CSTCTEST 0x30U // C28 HW BIST Test Register
#define HWBIST_O_CSTCRET 0x34U // C28 Return PC Address
#define HWBIST_O_CSTCCRD 0x38U // C28 Context Restore Done Register
#define HWBIST_O_CSTCGSTAT 0x40U // STC Global Status Register
#define HWBIST_O_CSTCCPCR 0x48U // STC Current Pattern Count Register
#define HWBIST_O_CSTCCADDR 0x4CU // STC Current ROM Address Register
#define HWBIST_O_CSTCMISR0 0x50U // MISR Result Register 0
#define HWBIST_O_CSTCMISR1 0x54U // MISR Result Register 1
#define HWBIST_O_CSTCMISR2 0x58U // MISR Result Register 2
#define HWBIST_O_CSTCMISR3 0x5CU // MISR Result Register 3
#define HWBIST_O_CSTCMISR4 0x60U // MISR Result Register 4
#define HWBIST_O_CSTCMISR5 0x64U // MISR Result Register 5
#define HWBIST_O_CSTCMISR6 0x68U // MISR Result Register 6
#define HWBIST_O_CSTCMISR7 0x6CU // MISR Result Register 7
#define HWBIST_O_CSTCMISR8 0x70U // MISR Result Register 8
#define HWBIST_O_CSTCMISR9 0x74U // MISR Result Register 9
#define HWBIST_O_CSTCMISR10 0x78U // MISR Result Register 10
#define HWBIST_O_CSTCMISR11 0x7CU // MISR Result Register 11
#define HWBIST_O_CSTCMISR12 0x80U // MISR Result Register 12
#define HWBIST_O_CSTCMISR13 0x84U // MISR Result Register 13
#define HWBIST_O_CSTCMISR14 0x88U // MISR Result Register 14
#define HWBIST_O_CSTCMISR15 0x8CU // MISR Result Register 15
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCGCR3 register
//
//*************************************************************************************************
#define HWBIST_CSTCGCR3_ILS_S 0U
#define HWBIST_CSTCGCR3_ILS_M 0xFU // Interrupt Logging Start
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCGCR4 register
//
//*************************************************************************************************
#define HWBIST_CSTCGCR4_BISTGO_S 0U
#define HWBIST_CSTCGCR4_BISTGO_M 0xFU // BIST Start
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCGCR5 register
//
//*************************************************************************************************
#define HWBIST_CSTCGCR5_RESTART_S 0U
#define HWBIST_CSTCGCR5_RESTART_M 0xFU // Restart Enable
#define HWBIST_CSTCGCR5_SOFT_RESET 0x80000000U // Soft reset to BIST controller
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCGCR6 register
//
//*************************************************************************************************
#define HWBIST_CSTCGCR6_COV_S 0U
#define HWBIST_CSTCGCR6_COV_M 0x3U // COVERAGE
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCGCR7 register
//
//*************************************************************************************************
#define HWBIST_CSTCGCR7_MCL_S 0U
#define HWBIST_CSTCGCR7_MCL_M 0xFFU // MAX CHAIN LENGTH
#define HWBIST_CSTCGCR7_DC_S 8U
#define HWBIST_CSTCGCR7_DC_M 0xF00U // DEAD CYCLES
#define HWBIST_CSTCGCR7_NP_S 12U
#define HWBIST_CSTCGCR7_NP_M 0xF000U // NUM OF PIPELINE STAGES
#define HWBIST_CSTCGCR7_PST_S 16U
#define HWBIST_CSTCGCR7_PST_M 0x30000U // PATTERN SET TYPE
#define HWBIST_CSTCGCR7_SCD_S 18U
#define HWBIST_CSTCGCR7_SCD_M 0xC0000U // SHIFT_CLOCK_DIVISION
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCGCR8 register
//
//*************************************************************************************************
#define HWBIST_CSTCGCR8_CPC_S 0U
#define HWBIST_CSTCGCR8_CPC_M 0xFFFFU // COMPARE PATTERN CNT
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCPCNT register
//
//*************************************************************************************************
#define HWBIST_CSTCPCNT_PCNT_95_S 0U
#define HWBIST_CSTCPCNT_PCNT_95_M 0xFFFFU // PATTERNS FOR 95% COVERAGE
#define HWBIST_CSTCPCNT_PCNT_99_S 16U
#define HWBIST_CSTCPCNT_PCNT_99_M 0xFFFF0000U // PATTERNS FOR 99% COVERAGE
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCCONFIG register
//
//*************************************************************************************************
#define HWBIST_CSTCCONFIG_CFGDONE_S 0U
#define HWBIST_CSTCCONFIG_CFGDONE_M 0xFU // Configuration done
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCSADDR register
//
//*************************************************************************************************
#define HWBIST_CSTCSADDR_SAPAT_S 0U
#define HWBIST_CSTCSADDR_SAPAT_M 0xFFFFU // PATTERN ROM Start Address
#define HWBIST_CSTCSADDR_SAMISR_S 16U
#define HWBIST_CSTCSADDR_SAMISR_M 0xFFFF0000U // MISR ROM Start Address
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCTEST register
//
//*************************************************************************************************
#define HWBIST_CSTCTEST_TEST_TO_S 0U
#define HWBIST_CSTCTEST_TEST_TO_M 0xFU // Test_ Time_Out
#define HWBIST_CSTCTEST_TEST_CMP_FAIL_S 4U
#define HWBIST_CSTCTEST_TEST_CMP_FAIL_M 0xF0U // Test MISR compare fail
#define HWBIST_CSTCTEST_TEST_NMI_S 8U
#define HWBIST_CSTCTEST_TEST_NMI_M 0xF00U // Test_NMI
#define HWBIST_CSTCTEST_TEST_S 12U
#define HWBIST_CSTCTEST_TEST_M 0xFFFFF000U // TEST Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCCRD register
//
//*************************************************************************************************
#define HWBIST_CSTCCRD_RESTORE_DONE_S 0U
#define HWBIST_CSTCCRD_RESTORE_DONE_M 0xFU // Context Restone Done
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCGSTAT register
//
//*************************************************************************************************
#define HWBIST_CSTCGSTAT_BISTDONE 0x1U // HW BIST Complete
#define HWBIST_CSTCGSTAT_MACRODONE 0x2U // Macro test slot Complete
#define HWBIST_CSTCGSTAT_NMI 0x4U // Exit due to NMI
#define HWBIST_CSTCGSTAT_BISTFAIL 0x8U // HW BIST Failure
#define HWBIST_CSTCGSTAT_INTCMPF 0x10U // Intermediate Comparison Failure
#define HWBIST_CSTCGSTAT_TOFAIL 0x20U // Time Out Failure
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCCPCR register
//
//*************************************************************************************************
#define HWBIST_CSTCCPCR_PATCNT_S 0U
#define HWBIST_CSTCCPCR_PATCNT_M 0xFFFFU // Current Pattern Count
//*************************************************************************************************
//
// The following are defines for the bit fields in the CSTCCADDR register
//
//*************************************************************************************************
#define HWBIST_CSTCCADDR_PATADDR_S 0U
#define HWBIST_CSTCCADDR_PATADDR_M 0xFFFFU // Current Pattern ROM Address
#define HWBIST_CSTCCADDR_MISRADDR_S 16U
#define HWBIST_CSTCCADDR_MISRADDR_M 0xFFFF0000U // Current MISR ROM Address
#endif
@@ -0,0 +1,210 @@
//###########################################################################
//
// FILE: hw_i2c.h
//
// TITLE: Definitions for the I2C 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 HW_I2C_H
#define HW_I2C_H
//*************************************************************************************************
//
// The following are defines for the I2C register offsets
//
//*************************************************************************************************
#define I2C_O_OAR 0x0U // I2C Own address
#define I2C_O_IER 0x1U // I2C Interrupt Enable
#define I2C_O_STR 0x2U // I2C Status
#define I2C_O_CLKL 0x3U // I2C Clock low-time divider
#define I2C_O_CLKH 0x4U // I2C Clock high-time divider
#define I2C_O_CNT 0x5U // I2C Data count
#define I2C_O_DRR 0x6U // I2C Data receive
#define I2C_O_SAR 0x7U // I2C Slave address
#define I2C_O_DXR 0x8U // I2C Data Transmit
#define I2C_O_MDR 0x9U // I2C Mode
#define I2C_O_ISRC 0xAU // I2C Interrupt Source
#define I2C_O_EMDR 0xBU // I2C Extended Mode
#define I2C_O_PSC 0xCU // I2C Prescaler
#define I2C_O_FFTX 0x20U // I2C FIFO Transmit
#define I2C_O_FFRX 0x21U // I2C FIFO Receive
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2COAR register
//
//*************************************************************************************************
#define I2C_OAR_OAR_S 0U
#define I2C_OAR_OAR_M 0x3FFU // I2C Own address
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2CIER register
//
//*************************************************************************************************
#define I2C_IER_ARBL 0x1U // Arbitration-lost interrupt enable
#define I2C_IER_NACK 0x2U // No-acknowledgment interrupt enable
#define I2C_IER_ARDY 0x4U // Register-access-ready interrupt enable
#define I2C_IER_RRDY 0x8U // Receive-data-ready interrupt enable
#define I2C_IER_XRDY 0x10U // Transmit-data-ready interrupt enable
#define I2C_IER_SCD 0x20U // Stop condition detected interrupt enable
#define I2C_IER_AAS 0x40U // Addressed as slave interrupt enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2CSTR register
//
//*************************************************************************************************
#define I2C_STR_ARBL 0x1U // Arbitration-lost interrupt flag bit
#define I2C_STR_NACK 0x2U // No-acknowledgment interrupt flag bit.
#define I2C_STR_ARDY 0x4U // Register-access-ready interrupt flag bit
#define I2C_STR_RRDY 0x8U // Receive-data-ready interrupt flag bit.
#define I2C_STR_XRDY 0x10U // Transmit-data-ready interrupt flag bit.
#define I2C_STR_SCD 0x20U // Stop condition detected bit.
#define I2C_STR_BYTESENT 0x40U // Byte transmit over indication
#define I2C_STR_AD0 0x100U // Address 0 bits
#define I2C_STR_AAS 0x200U // Addressed-as-slave bit
#define I2C_STR_XSMT 0x400U // Transmit shift register empty bit.
#define I2C_STR_RSFULL 0x800U // Receive shift register full bit.
#define I2C_STR_BB 0x1000U // Bus busy bit.
#define I2C_STR_NACKSNT 0x2000U // NACK sent bit.
#define I2C_STR_SDIR 0x4000U // Slave direction bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2CDRR register
//
//*************************************************************************************************
#define I2C_DRR_DATA_S 0U
#define I2C_DRR_DATA_M 0xFFU // Receive data
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2CSAR register
//
//*************************************************************************************************
#define I2C_SAR_SAR_S 0U
#define I2C_SAR_SAR_M 0x3FFU // Slave Address
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2CDXR register
//
//*************************************************************************************************
#define I2C_DXR_DATA_S 0U
#define I2C_DXR_DATA_M 0xFFU // Transmit data
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2CMDR register
//
//*************************************************************************************************
#define I2C_MDR_BC_S 0U
#define I2C_MDR_BC_M 0x7U // Bit count bits.
#define I2C_MDR_FDF 0x8U // Free Data Format
#define I2C_MDR_STB 0x10U // START Byte Mode
#define I2C_MDR_IRS 0x20U // I2C Module Reset
#define I2C_MDR_DLB 0x40U // Digital Loopback Mode
#define I2C_MDR_RM 0x80U // Repeat Mode
#define I2C_MDR_XA 0x100U // Expanded Address Mode
#define I2C_MDR_TRX 0x200U // Transmitter Mode
#define I2C_MDR_MST 0x400U // Master Mode
#define I2C_MDR_STP 0x800U // STOP Condition
#define I2C_MDR_STT 0x2000U // START condition bit
#define I2C_MDR_FREE 0x4000U // Debug Action
#define I2C_MDR_NACKMOD 0x8000U // NACK mode bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2CISRC register
//
//*************************************************************************************************
#define I2C_ISRC_INTCODE_S 0U
#define I2C_ISRC_INTCODE_M 0x7U // Interrupt code bits.
#define I2C_ISRC_WRITE_ZEROS_S 8U
#define I2C_ISRC_WRITE_ZEROS_M 0xF00U // Always write all 0s to this field
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2CEMDR register
//
//*************************************************************************************************
#define I2C_EMDR_BC 0x1U // Backwards compatibility mode
#define I2C_EMDR_FCM 0x2U // Forward Compatibility for Tx behav in Type1
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2CPSC register
//
//*************************************************************************************************
#define I2C_PSC_IPSC_S 0U
#define I2C_PSC_IPSC_M 0xFFU // I2C Prescaler Divide Down
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2CFFTX register
//
//*************************************************************************************************
#define I2C_FFTX_TXFFIL_S 0U
#define I2C_FFTX_TXFFIL_M 0x1FU // Transmit FIFO Interrupt Level
#define I2C_FFTX_TXFFIENA 0x20U // Transmit FIFO Interrupt Enable
#define I2C_FFTX_TXFFINTCLR 0x40U // Transmit FIFO Interrupt Flag Clear
#define I2C_FFTX_TXFFINT 0x80U // Transmit FIFO Interrupt Flag
#define I2C_FFTX_TXFFST_S 8U
#define I2C_FFTX_TXFFST_M 0x1F00U // Transmit FIFO Status
#define I2C_FFTX_TXFFRST 0x2000U // Transmit FIFO Reset
#define I2C_FFTX_I2CFFEN 0x4000U // Transmit FIFO Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the I2CFFRX register
//
//*************************************************************************************************
#define I2C_FFRX_RXFFIL_S 0U
#define I2C_FFRX_RXFFIL_M 0x1FU // Receive FIFO Interrupt Level
#define I2C_FFRX_RXFFIENA 0x20U // Receive FIFO Interrupt Enable
#define I2C_FFRX_RXFFINTCLR 0x40U // Receive FIFO Interrupt Flag Clear
#define I2C_FFRX_RXFFINT 0x80U // Receive FIFO Interrupt Flag
#define I2C_FFRX_RXFFST_S 8U
#define I2C_FFRX_RXFFST_M 0x1F00U // Receive FIFO Status
#define I2C_FFRX_RXFFRST 0x2000U // Receive FIFO Reset
#endif
@@ -0,0 +1,94 @@
//###########################################################################
//
// FILE: hw_inputxbar.h
//
// TITLE: Definitions for the XBAR 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 HW_INPUTXBAR_H
#define HW_INPUTXBAR_H
//*************************************************************************************************
//
// The following are defines for the XBAR register offsets
//
//*************************************************************************************************
#define XBAR_O_INPUT1SELECT 0x0U // INPUT1 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT2SELECT 0x1U // INPUT2 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT3SELECT 0x2U // INPUT3 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT4SELECT 0x3U // INPUT4 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT5SELECT 0x4U // INPUT5 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT6SELECT 0x5U // INPUT6 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT7SELECT 0x6U // INPUT7 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT8SELECT 0x7U // INPUT8 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT9SELECT 0x8U // INPUT9 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT10SELECT 0x9U // INPUT10 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT11SELECT 0xAU // INPUT11 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT12SELECT 0xBU // INPUT12 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT13SELECT 0xCU // INPUT13 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT14SELECT 0xDU // INPUT14 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT15SELECT 0xEU // INPUT15 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUT16SELECT 0xFU // INPUT16 Input Select Register (GPIO0 to x)
#define XBAR_O_INPUTSELECTLOCK 0x1EU // Input Select Lock Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the INPUTSELECTLOCK register
//
//*************************************************************************************************
#define XBAR_INPUTSELECTLOCK_INPUT1SELECT 0x1U // Lock bit for INPUT1SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT2SELECT 0x2U // Lock bit for INPUT2SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT3SELECT 0x4U // Lock bit for INPUT3SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT4SELECT 0x8U // Lock bit for INPUT4SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT5SELECT 0x10U // Lock bit for INPUT5SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT6SELECT 0x20U // Lock bit for INPUT6SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT7SELECT 0x40U // Lock bit for INPUT7SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT8SELECT 0x80U // Lock bit for INPUT8SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT9SELECT 0x100U // Lock bit for INPUT9SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT10SELECT 0x200U // Lock bit for INPUT10SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT11SELECT 0x400U // Lock bit for INPUT11SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT12SELECT 0x800U // Lock bit for INPUT12SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT13SELECT 0x1000U // Lock bit for INPUT13SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT14SELECT 0x2000U // Lock bit for INPUT14SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT15SELECT 0x4000U // Lock bit for INPUT15SELECT Register
#define XBAR_INPUTSELECTLOCK_INPUT16SELECT 0x8000U // Lock bit for INPUT16SELECT Register
#endif
@@ -0,0 +1,260 @@
//###########################################################################
//
// FILE: hw_ints.h
//
// TITLE: Definitions of interrupt numbers for use with interrupt.c.
//
//###########################################################################
//
// 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 HW_INTS_H
#define HW_INTS_H
//*****************************************************************************
//
// PIE Interrupt Numbers
//
// 0x00FF = PIE Table Row #
// 0xFF00 = PIE Table Column #
// 0xFFFF0000 = PIE Vector ID
//
//*****************************************************************************
#define INT_TIMER1 0x000D0000U // CPU Timer 1 Interrupt
#define INT_TIMER2 0x000E0000U // CPU Timer 2 Interrupt
#define INT_DATALOG 0x000F0000U // Datalogging Interrupt
#define INT_RTOS 0x00100000U // RTOS Interrupt
#define INT_EMU 0x00110000U // Emulation Interrupt
#define INT_NMI 0x00120000U // Non-Maskable Interrupt
#define INT_ILLEGAL 0x00130000U // Illegal Operation Trap
#define INT_USER1 0x00140000U // User Defined Trap 1
#define INT_USER2 0x00150000U // User Defined Trap 2
#define INT_USER3 0x00160000U // User Defined Trap 3
#define INT_USER4 0x00170000U // User Defined Trap 4
#define INT_USER5 0x00180000U // User Defined Trap 5
#define INT_USER6 0x00190000U // User Defined Trap 6
#define INT_USER7 0x001A0000U // User Defined Trap 7
#define INT_USER8 0x001B0000U // User Defined Trap 8
#define INT_USER9 0x001C0000U // User Defined Trap 9
#define INT_USER10 0x001D0000U // User Defined Trap 10
#define INT_USER11 0x001E0000U // User Defined Trap 11
#define INT_USER12 0x001F0000U // User Defined Trap 12
#define INT_ADCA1 0x00200101U // 1.1 - ADCA Interrupt 1
#define INT_ADCB1 0x00210102U // 1.2 - ADCB Interrupt 1
#define INT_ADCC1 0x00220103U // 1.3 - ADCC Interrupt 1
#define INT_XINT1 0x00230104U // 1.4 - XINT1 Interrupt
#define INT_XINT2 0x00240105U // 1.5 - XINT2 Interrupt
#define INT_ADCD1 0x00250106U // 1.6 - ADCD Interrupt 1
#define INT_TIMER0 0x00260107U // 1.7 - Timer 0 Interrupt
#define INT_WAKE 0x00270108U // 1.8 - Standby and Halt Wakeup Interrupt
#define INT_EPWM1_TZ 0x00280201U // 2.1 - ePWM1 Trip Zone Interrupt
#define INT_EPWM2_TZ 0x00290202U // 2.2 - ePWM2 Trip Zone Interrupt
#define INT_EPWM3_TZ 0x002A0203U // 2.3 - ePWM3 Trip Zone Interrupt
#define INT_EPWM4_TZ 0x002B0204U // 2.4 - ePWM4 Trip Zone Interrupt
#define INT_EPWM5_TZ 0x002C0205U // 2.5 - ePWM5 Trip Zone Interrupt
#define INT_EPWM6_TZ 0x002D0206U // 2.6 - ePWM6 Trip Zone Interrupt
#define INT_EPWM7_TZ 0x002E0207U // 2.7 - ePWM7 Trip Zone Interrupt
#define INT_EPWM8_TZ 0x002F0208U // 2.8 - ePWM8 Trip Zone Interrupt
#define INT_EPWM1 0x00300301U // 3.1 - ePWM1 Interrupt
#define INT_EPWM2 0x00310302U // 3.2 - ePWM2 Interrupt
#define INT_EPWM3 0x00320303U // 3.3 - ePWM3 Interrupt
#define INT_EPWM4 0x00330304U // 3.4 - ePWM4 Interrupt
#define INT_EPWM5 0x00340305U // 3.5 - ePWM5 Interrupt
#define INT_EPWM6 0x00350306U // 3.6 - ePWM6 Interrupt
#define INT_EPWM7 0x00360307U // 3.7 - ePWM7 Interrupt
#define INT_EPWM8 0x00370308U // 3.8 - ePWM8 Interrupt
#define INT_ECAP1 0x00380401U // 4.1 - eCAP1 Interrupt
#define INT_ECAP2 0x00390402U // 4.2 - eCAP2 Interrupt
#define INT_ECAP3 0x003A0403U // 4.3 - eCAP3 Interrupt
#define INT_ECAP4 0x003B0404U // 4.4 - eCAP4 Interrupt
#define INT_ECAP5 0x003C0405U // 4.5 - eCAP5 Interrupt
#define INT_ECAP6 0x003D0406U // 4.6 - eCAP6 Interrupt
#define INT_ECAP7 0x003E0407U // 4.7 - eCAP7 Interrupt
#define INT_EQEP1 0x00400501U // 5.1 - eQEP1 Interrupt
#define INT_EQEP2 0x00410502U // 5.2 - eQEP2 Interrupt
#define INT_EQEP3 0x00420503U // 5.3 - eQEP3 Interrupt
#define INT_CLB1 0x00440505U // 5.5 - CLB1 (Reconfigurable Logic) Interrupt
#define INT_CLB2 0x00450506U // 5.6 - CLB2 (Reconfigurable Logic) Interrupt
#define INT_CLB3 0x00460507U // 5.7 - CLB3 (Reconfigurable Logic) Interrupt
#define INT_CLB4 0x00470508U // 5.8 - CLB4 (Reconfigurable Logic) Interrupt
#define INT_SPIA_RX 0x00480601U // 6.1 - SPIA Receive Interrupt
#define INT_SPIA_TX 0x00490602U // 6.2 - SPIA Transmit Interrupt
#define INT_SPIB_RX 0x004A0603U // 6.3 - SPIB Receive Interrupt
#define INT_SPIB_TX 0x004B0604U // 6.4 - SPIB Transmit Interrupt
#define INT_MCBSPA_RX 0x004C0605U // 6.5 - McBSPA Receive Interrupt
#define INT_MCBSPA_TX 0x004D0606U // 6.6 - McBSPA Transmit Interrupt
#define INT_MCBSPB_RX 0x004E0607U // 6.7 - McBSPB Receive Interrupt
#define INT_MCBSPB_TX 0x004F0608U // 6.8 - McBSPB Transmit Interrupt
#define INT_DMA_CH1 0x00500701U // 7.1 - DMA Channel 1 Interrupt
#define INT_DMA_CH2 0x00510702U // 7.2 - DMA Channel 2 Interrupt
#define INT_DMA_CH3 0x00520703U // 7.3 - DMA Channel 3 Interrupt
#define INT_DMA_CH4 0x00530704U // 7.4 - DMA Channel 4 Interrupt
#define INT_DMA_CH5 0x00540705U // 7.5 - DMA Channel 5 Interrupt
#define INT_DMA_CH6 0x00550706U // 7.6 - DMA Channel 6 Interrupt
#define INT_I2CA 0x00580801U // 8.1 - I2CA Interrupt 1
#define INT_I2CA_FIFO 0x00590802U // 8.2 - I2CA Interrupt 2
#define INT_I2CB 0x005A0803U // 8.3 - I2CB Interrupt 1
#define INT_I2CB_FIFO 0x005B0804U // 8.4 - I2CB Interrupt 2
#define INT_SCIC_RX 0x005C0805U // 8.5 - SCIC Receive Interrupt
#define INT_SCIC_TX 0x005D0806U // 8.6 - SCIC Transmit Interrupt
#define INT_SCID_RX 0x005E0807U // 8.7 - SCID Receive Interrupt
#define INT_SCID_TX 0x005F0808U // 8.8 - SCID Transmit Interrupt
#define INT_SCIA_RX 0x00600901U // 9.1 - SCIA Receive Interrupt
#define INT_SCIA_TX 0x00610902U // 9.2 - SCIA Transmit Interrupt
#define INT_SCIB_RX 0x00620903U // 9.3 - SCIB Receive Interrupt
#define INT_SCIB_TX 0x00630904U // 9.4 - SCIB Transmit Interrupt
#define INT_CANA0 0x00640905U // 9.5 - CANA Interrupt 0
#define INT_CANA1 0x00650906U // 9.6 - CANA Interrupt 1
#define INT_CANB0 0x00660907U // 9.7 - CANB Interrupt 0
#define INT_CANB1 0x00670908U // 9.8 - CANB Interrupt 1
#define INT_ADCA_EVT 0x00680A01U // 10.1 - ADCA Event Interrupt
#define INT_ADCA2 0x00690A02U // 10.2 - ADCA Interrupt 2
#define INT_ADCA3 0x006A0A03U // 10.3 - ADCA Interrupt 3
#define INT_ADCA4 0x006B0A04U // 10.4 - ADCA Interrupt 4
#define INT_ADCB_EVT 0x006C0A05U // 10.5 - ADCB Event Interrupt
#define INT_ADCB2 0x006D0A06U // 10.6 - ADCB Interrupt 2
#define INT_ADCB3 0x006E0A07U // 10.7 - ADCB Interrupt 3
#define INT_ADCB4 0x006F0A08U // 10.8 - ADCB Interrupt 4
#define INT_CLA1_1 0x00700B01U // 11.1 - CLA1 Interrupt 1
#define INT_CLA1_2 0x00710B02U // 11.2 - CLA1 Interrupt 2
#define INT_CLA1_3 0x00720B03U // 11.3 - CLA1 Interrupt 3
#define INT_CLA1_4 0x00730B04U // 11.4 - CLA1 Interrupt 4
#define INT_CLA1_5 0x00740B05U // 11.5 - CLA1 Interrupt 5
#define INT_CLA1_6 0x00750B06U // 11.6 - CLA1 Interrupt 6
#define INT_CLA1_7 0x00760B07U // 11.7 - CLA1 Interrupt 7
#define INT_CLA1_8 0x00770B08U // 11.8 - CLA1 Interrupt 8
#define INT_XINT3 0x00780C01U // 12.1 - XINT3 Interrupt
#define INT_XINT4 0x00790C02U // 12.2 - XINT4 Interrupt
#define INT_XINT5 0x007A0C03U // 12.3 - XINT5 Interrupt
#define INT_MPOST 0x007B0C04U // 12.4 - MPOST Interrupt
#define INT_FMC 0x007C0C05U // 12.5 - Flash Wrapper Operation Done Interrupt
#define INT_FPU_OFLOW 0x007E0C07U // 12.7 - FPU Overflow Interrupt
#define INT_FPU_UFLOW 0x007F0C08U // 12.8 - FPU Underflow Interrupt
#define INT_I2CA_HIGH 0x00800109U // 1.9 - I2CA Interrupt high priority
#define INT_SYS_ERR 0x0081010AU // 1.10 - System error interrupt
#define INT_ECATSYNC0 0x0082010BU // 1.11 - ETHERCAT SYNC0 interrupt
#define INT_ECAT 0x0083010CU // 1.12 - ETHERCAT main interrupt
#define INT_CIPC0 0x0084010DU // 1.13 - C28x CPU IPC interrupt 1
#define INT_CIPC1 0x0085010EU // 1.14 - C28x CPU IPC interrupt 2
#define INT_CIPC2 0x0086010FU // 1.15 - C28x CPU IPC interrupt 3
#define INT_CIPC3 0x00870110U // 1.16 - C28x CPU IPC interrupt 4
#define INT_EPWM9_TZ 0x00880209U // 2.9 - ePWM9 Trip Zone Interrupt
#define INT_EPWM10_TZ 0x0089020AU // 2.10 - ePWM10 Trip Zone Interrupt
#define INT_EPWM11_TZ 0x008A020BU // 2.11 - ePWM11 Trip Zone Interrupt
#define INT_EPWM12_TZ 0x008B020CU // 2.12 - ePWM12 Trip Zone Interrupt
#define INT_EPWM13_TZ 0x008C020DU // 2.13 - ePWM13 Trip Zone Interrupt
#define INT_EPWM14_TZ 0x008D020EU // 2.14 - ePWM14 Trip Zone Interrupt
#define INT_EPWM15_TZ 0x008E020FU // 2.15 - ePWM15 Trip Zone Interrupt
#define INT_EPWM16_TZ 0x008F0210U // 2.16 - ePWM16 Trip Zone Interrupt
#define INT_EPWM9 0x00900309U // 3.9 - ePWM9 Interrupt
#define INT_EPWM10 0x0091030AU // 3.10 - ePWM10 Interrupt
#define INT_EPWM11 0x0092030BU // 3.11 - ePWM11 Interrupt
#define INT_EPWM12 0x0093030CU // 3.12 - ePWM12 Interrupt
#define INT_EPWM13 0x0094030DU // 3.13 - ePWM13 Interrupt
#define INT_EPWM14 0x0095030EU // 3.14 - ePWM14 Interrupt
#define INT_EPWM15 0x0096030FU // 3.15 - ePWM15 Interrupt
#define INT_EPWM16 0x00970310U // 3.16 - ePWM16 Interrupt
#define INT_FSITXA1 0x00980409U // 4.9 - FSIA Transmit interrupt 1
#define INT_FSITXA2 0x0099040AU // 4.10 - FSIA Transmit interrupt 2
#define INT_FSITXB1 0x009A040BU // 4.11 - FSIB Transmit interrupt 1
#define INT_FSITXB2 0x009B040CU // 4.12 - FSIB Transmit interrupt 2
#define INT_FSIRXA1 0x009C040DU // 4.13 - FSIA Receive interrupt 1
#define INT_FSIRXA2 0x009D040EU // 4.14 - FSIA Receive interrupt 2
#define INT_FSIRXB1 0x009E040FU // 4.15 - FSIB Receive interrupt 1
#define INT_FSIRXB2 0x009F0410U // 4.16 - FSIB Receive interrupt 2
#define INT_SDFM1 0x00A00509U // 5.9 - Sigma Delta Filter Module1 Interrupt
#define INT_SDFM2 0x00A1050AU // 5.10 - Sigma Delta Filter Module2 Interrupt
#define INT_ECATRST 0x00A2050BU // 5.11 - ETHERCAT Resetout Interrupt
#define INT_ECATSYNC1 0x00A3050CU // 5.12 - ETHERCAT SYNC1 interrupt
#define INT_SDFM1DR1 0x00A4050DU // 5.13 - Sigma Delta Filter Module1 Filter 1 Interrupt
#define INT_SDFM1DR2 0x00A5050EU // 5.14 - Sigma Delta Filter Module1 Filter 2 Interrupt
#define INT_SDFM1DR3 0x00A6050FU // 5.15 - Sigma Delta Filter Module1 Filter 3 Interrupt
#define INT_SDFM1DR4 0x00A70510U // 5.16 - Sigma Delta Filter Module1 Filter 4 Interrupt
#define INT_SPIC_RX 0x00A80609U // 6.9 - SPIC Receive Interrupt
#define INT_SPIC_TX 0x00A9060AU // 6.10 - SPIC Transmit Interrupt
#define INT_SPID_RX 0x00AA060BU // 6.11 - SPID Receive Interrupt
#define INT_SPID_TX 0x00AB060CU // 6.12 - SPID Transmit Interrupt
#define INT_SDFM2DR1 0x00AC060DU // 6.13 - Sigma Delta Filter Module2 Filter 1 Interrupt
#define INT_SDFM2DR2 0x00AD060EU // 6.14 - Sigma Delta Filter Module2 Filter 2 Interrupt
#define INT_SDFM2DR3 0x00AE060FU // 6.15 - Sigma Delta Filter Module2 Filter 3 Interrupt
#define INT_SDFM2DR4 0x00AF0610U // 6.16 - Sigma Delta Filter Module2 Filter 4 Interrupt
#define INT_FSIRXC1 0x00B00709U // 7.9 - FSIC Receive interrupt 1
#define INT_FSIRXC2 0x00B1070AU // 7.10 - FSIC Receive interrupt 2
#define INT_FSIRXD1 0x00B2070BU // 7.11 - FSID Receive interrupt 1
#define INT_FSIRXD2 0x00B3070CU // 7.12 - FSID Receive interrupt 2
#define INT_FSIRXE1 0x00B4070DU // 7.13 - FSIE Receive interrupt 1
#define INT_FSIRXE2 0x00B5070EU // 7.14 - FSIE Receive interrupt 2
#define INT_FSIRXF1 0x00B6070FU // 7.15 - FSIF Receive interrupt 1
#define INT_FSIRXF2 0x00B70710U // 7.16 - FSIF Receive interrupt 2
#define INT_FSIRXG1 0x00B80809U // 8.9 - FSIG Receive interrupt 1
#define INT_FSIRXG2 0x00B9080AU // 8.10 - FSIG Receive interrupt 2
#define INT_FSIRXH1 0x00BA080BU // 8.11 - FSIH Receive interrupt 1
#define INT_FSIRXH2 0x00BB080CU // 8.12 - FSIH Receive interrupt 2
#define INT_CLB5 0x00BC080DU // 8.13 - CLB5 Interrupt
#define INT_CLB6 0x00BD080EU // 8.14 - CLB6 Interrupt
#define INT_CLB7 0x00BE080FU // 8.15 - CLB7 Interrupt
#define INT_CLB8 0x00BF0810U // 8.16 - CLB8 Interrupt
#define INT_MCANA_0 0x00C00909U // 9.9 - MCAN Sub-System Interrupt 0
#define INT_MCANA_1 0x00C1090AU // 9.10 - MCAN Sub-System Interrupt 1
#define INT_MCANA_ECC 0x00C2090BU // 9.11 - MCAN Sub-System ECC error Interrupt
#define INT_MCANA_WAKE 0x00C3090CU // 9.12 - MCAN Sub-System wakeup Interrupt
#define INT_PMBUSA 0x00C4090DU // 9.13 - PMBUSA Interrupt
#define INT_CM_STATUS 0x00C5090EU // 9.14 - CM Reset Status Interrupt
#define INT_USBA 0x00C6090FU // 9.15 - USBA Interrupt
#define INT_ADCC_EVT 0x00C80A09U // 10.9 - ADCC Event Interrupt
#define INT_ADCC2 0x00C90A0AU // 10.10 - ADCC Interrupt 2
#define INT_ADCC3 0x00CA0A0BU // 10.11 - ADCC Interrupt 3
#define INT_ADCC4 0x00CB0A0CU // 10.12 - ADCC Interrupt 4
#define INT_ADCD_EVT 0x00CC0A0DU // 10.13 - ADCD Event Interrupt
#define INT_ADCD2 0x00CD0A0EU // 10.14 - ADCD Interrupt 2
#define INT_ADCD3 0x00CE0A0FU // 10.15 - ADCD Interrupt 3
#define INT_ADCD4 0x00CF0A10U // 10.16 - ADCD Interrupt 4
#define INT_CMTOCPUXIPC0 0x00D00B09U // 11.9 - CM to CPU IPC Interrupt 0
#define INT_CMTOCPUXIPC1 0x00D10B0AU // 11.10 - CM to CPU IPC Interrupt 1
#define INT_CMTOCPUXIPC2 0x00D20B0BU // 11.11 - CM to CPU IPC Interrupt 2
#define INT_CMTOCPUXIPC3 0x00D30B0CU // 11.12 - CM to CPU IPC Interrupt 3
#define INT_CMTOCPUXIPC4 0x00D40B0DU // 11.13 - CM to CPU IPC Interrupt 4
#define INT_CMTOCPUXIPC5 0x00D50B0EU // 11.14 - CM to CPU IPC Interrupt 5
#define INT_CMTOCPUXIPC6 0x00D60B0FU // 11.15 - CM to CPU IPC Interrupt 6
#define INT_CMTOCPUXIPC7 0x00D70B10U // 11.16 - CM to CPU IPC Interrupt 7
#define INT_ECAP6_2 0x00D90C0AU // 12.10 - eCAP6 Interrupt 2
#define INT_ECAP7_2 0x00DA0C0BU // 12.11 - eCAP7 Interrupt 2
#define INT_CPUCRC 0x00DC0C0DU // 12.13 - CPU BGCRC module interrupt
#define INT_CLA1CRC 0x00DD0C0EU // 12.14 - CLA1 BGCRC module interrupt
#define INT_CLA_OVERFLOW 0x00DE0C0FU // 12.15 - CLA Overflow Interrupt
#define INT_CLA_UNDERFLOW 0x00DF0C10U // 12.16 - CLA Underflow Interrupt
#endif // HW_INTS_H
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,286 @@
//###########################################################################
//
// FILE: hw_mcbsp.h
//
// TITLE: Definitions for the MCBSP 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 HW_MCBSP_H
#define HW_MCBSP_H
//*************************************************************************************************
//
// The following are defines for the MCBSP register offsets
//
//*************************************************************************************************
#define MCBSP_O_DRR2 0x0U // Data receive register bits 31-16
#define MCBSP_O_DRR1 0x1U // Data receive register bits 15-0
#define MCBSP_O_DXR2 0x2U // Data transmit register bits 31-16
#define MCBSP_O_DXR1 0x3U // Data transmit register bits 15-0
#define MCBSP_O_SPCR2 0x4U // Serial port control register 2
#define MCBSP_O_SPCR1 0x5U // Serial port control register 1
#define MCBSP_O_RCR2 0x6U // Receive Control register 2
#define MCBSP_O_RCR1 0x7U // Receive Control register 1
#define MCBSP_O_XCR2 0x8U // Transmit Control register 2
#define MCBSP_O_XCR1 0x9U // Transmit Control register 1
#define MCBSP_O_SRGR2 0xAU // Sample rate generator register 2
#define MCBSP_O_SRGR1 0xBU // Sample rate generator register 1
#define MCBSP_O_MCR2 0xCU // Multi-channel control register 2
#define MCBSP_O_MCR1 0xDU // Multi-channel control register 1
#define MCBSP_O_RCERA 0xEU // Receive channel enable partition A
#define MCBSP_O_RCERB 0xFU // Receive channel enable partition B
#define MCBSP_O_XCERA 0x10U // Transmit channel enable partition A
#define MCBSP_O_XCERB 0x11U // Transmit channel enable partition B
#define MCBSP_O_PCR 0x12U // Pin Control register
#define MCBSP_O_RCERC 0x13U // Receive channel enable partition C
#define MCBSP_O_RCERD 0x14U // Receive channel enable partition D
#define MCBSP_O_XCERC 0x15U // Transmit channel enable partition C
#define MCBSP_O_XCERD 0x16U // Transmit channel enable partition D
#define MCBSP_O_RCERE 0x17U // Receive channel enable partition E
#define MCBSP_O_RCERF 0x18U // Receive channel enable partition F
#define MCBSP_O_XCERE 0x19U // Transmit channel enable partition E
#define MCBSP_O_XCERF 0x1AU // Transmit channel enable partition F
#define MCBSP_O_RCERG 0x1BU // Receive channel enable partition G
#define MCBSP_O_RCERH 0x1CU // Receive channel enable partition H
#define MCBSP_O_XCERG 0x1DU // Transmit channel enable partition G
#define MCBSP_O_XCERH 0x1EU // Transmit channel enable partition H
#define MCBSP_O_MFFINT 0x23U // Interrupt enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the DRR2 register
//
//*************************************************************************************************
#define MCBSP_DRR2_HWLB_S 0U
#define MCBSP_DRR2_HWLB_M 0xFFU // High word low byte
#define MCBSP_DRR2_HWHB_S 8U
#define MCBSP_DRR2_HWHB_M 0xFF00U // High word high byte
//*************************************************************************************************
//
// The following are defines for the bit fields in the DRR1 register
//
//*************************************************************************************************
#define MCBSP_DRR1_LWLB_S 0U
#define MCBSP_DRR1_LWLB_M 0xFFU // Low word low byte
#define MCBSP_DRR1_LWHB_S 8U
#define MCBSP_DRR1_LWHB_M 0xFF00U // Low word high byte
//*************************************************************************************************
//
// The following are defines for the bit fields in the DXR2 register
//
//*************************************************************************************************
#define MCBSP_DXR2_HWLB_S 0U
#define MCBSP_DXR2_HWLB_M 0xFFU // High word low byte
#define MCBSP_DXR2_HWHB_S 8U
#define MCBSP_DXR2_HWHB_M 0xFF00U // High word high byte
//*************************************************************************************************
//
// The following are defines for the bit fields in the DXR1 register
//
//*************************************************************************************************
#define MCBSP_DXR1_LWLB_S 0U
#define MCBSP_DXR1_LWLB_M 0xFFU // Low word low byte
#define MCBSP_DXR1_LWHB_S 8U
#define MCBSP_DXR1_LWHB_M 0xFF00U // Low word high byte
//*************************************************************************************************
//
// The following are defines for the bit fields in the SPCR2 register
//
//*************************************************************************************************
#define MCBSP_SPCR2_XRST 0x1U // Transmitter reset
#define MCBSP_SPCR2_XRDY 0x2U // Transmitter ready
#define MCBSP_SPCR2_XEMPTY 0x4U // Transmitter empty
#define MCBSP_SPCR2_XSYNCERR 0x8U // Transmit sync error INT flag
#define MCBSP_SPCR2_XINTM_S 4U
#define MCBSP_SPCR2_XINTM_M 0x30U // Transmit Interupt mode bits
#define MCBSP_SPCR2_GRST 0x40U // Sample rate generator reset
#define MCBSP_SPCR2_FRST 0x80U // Frame sync logic reset
#define MCBSP_SPCR2_SOFT 0x100U // SOFT bit
#define MCBSP_SPCR2_FREE 0x200U // FREE bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the SPCR1 register
//
//*************************************************************************************************
#define MCBSP_SPCR1_RRST 0x1U // Receiver reset
#define MCBSP_SPCR1_RRDY 0x2U // Receiver ready
#define MCBSP_SPCR1_RFULL 0x4U // Receiver full
#define MCBSP_SPCR1_RSYNCERR 0x8U // Receive sync error INT flag
#define MCBSP_SPCR1_RINTM_S 4U
#define MCBSP_SPCR1_RINTM_M 0x30U // Receive Interupt mode bits
#define MCBSP_SPCR1_DXENA 0x80U // DX delay enable
#define MCBSP_SPCR1_CLKSTP_S 11U
#define MCBSP_SPCR1_CLKSTP_M 0x1800U // Clock stop mode
#define MCBSP_SPCR1_RJUST_S 13U
#define MCBSP_SPCR1_RJUST_M 0x6000U // Rx sign extension and justification mode
#define MCBSP_SPCR1_DLB 0x8000U // Digital loopback
//*************************************************************************************************
//
// The following are defines for the bit fields in the RCR2 register
//
//*************************************************************************************************
#define MCBSP_RCR2_RDATDLY_S 0U
#define MCBSP_RCR2_RDATDLY_M 0x3U // Receive data delay
#define MCBSP_RCR2_RFIG 0x4U // Receive frame sync ignore
#define MCBSP_RCR2_RCOMPAND_S 3U
#define MCBSP_RCR2_RCOMPAND_M 0x18U // Receive Companding Mode selects
#define MCBSP_RCR2_RWDLEN2_S 5U
#define MCBSP_RCR2_RWDLEN2_M 0xE0U // Receive word length 2
#define MCBSP_RCR2_RFRLEN2_S 8U
#define MCBSP_RCR2_RFRLEN2_M 0x7F00U // Receive Frame length 2
#define MCBSP_RCR2_RPHASE 0x8000U // Receive Phase
//*************************************************************************************************
//
// The following are defines for the bit fields in the RCR1 register
//
//*************************************************************************************************
#define MCBSP_RCR1_RWDLEN1_S 5U
#define MCBSP_RCR1_RWDLEN1_M 0xE0U // Receive word length 1
#define MCBSP_RCR1_RFRLEN1_S 8U
#define MCBSP_RCR1_RFRLEN1_M 0x7F00U // Receive Frame length 1
//*************************************************************************************************
//
// The following are defines for the bit fields in the XCR2 register
//
//*************************************************************************************************
#define MCBSP_XCR2_XDATDLY_S 0U
#define MCBSP_XCR2_XDATDLY_M 0x3U // Transmit data delay
#define MCBSP_XCR2_XFIG 0x4U // Transmit frame sync ignore
#define MCBSP_XCR2_XCOMPAND_S 3U
#define MCBSP_XCR2_XCOMPAND_M 0x18U // Transmit Companding Mode selects
#define MCBSP_XCR2_XWDLEN2_S 5U
#define MCBSP_XCR2_XWDLEN2_M 0xE0U // Transmit word length 2
#define MCBSP_XCR2_XFRLEN2_S 8U
#define MCBSP_XCR2_XFRLEN2_M 0x7F00U // Transmit Frame length 2
#define MCBSP_XCR2_XPHASE 0x8000U // Transmit Phase
//*************************************************************************************************
//
// The following are defines for the bit fields in the XCR1 register
//
//*************************************************************************************************
#define MCBSP_XCR1_XWDLEN1_S 5U
#define MCBSP_XCR1_XWDLEN1_M 0xE0U // Transmit word length 1
#define MCBSP_XCR1_XFRLEN1_S 8U
#define MCBSP_XCR1_XFRLEN1_M 0x7F00U // Transmit Frame length 1
//*************************************************************************************************
//
// The following are defines for the bit fields in the SRGR2 register
//
//*************************************************************************************************
#define MCBSP_SRGR2_FPER_S 0U
#define MCBSP_SRGR2_FPER_M 0xFFFU // Frame-sync period
#define MCBSP_SRGR2_FSGM 0x1000U // Frame sync generator mode
#define MCBSP_SRGR2_CLKSM 0x2000U // Sample rate generator mode
#define MCBSP_SRGR2_GSYNC 0x8000U // CLKG sync
//*************************************************************************************************
//
// The following are defines for the bit fields in the SRGR1 register
//
//*************************************************************************************************
#define MCBSP_SRGR1_CLKGDV_S 0U
#define MCBSP_SRGR1_CLKGDV_M 0xFFU // CLKG divider
#define MCBSP_SRGR1_FWID_S 8U
#define MCBSP_SRGR1_FWID_M 0xFF00U // Frame width
//*************************************************************************************************
//
// The following are defines for the bit fields in the MCR2 register
//
//*************************************************************************************************
#define MCBSP_MCR2_XMCM_S 0U
#define MCBSP_MCR2_XMCM_M 0x3U // Transmit data delay
#define MCBSP_MCR2_XCBLK_S 2U
#define MCBSP_MCR2_XCBLK_M 0x1CU // Transmit frame sync ignore
#define MCBSP_MCR2_XPABLK_S 5U
#define MCBSP_MCR2_XPABLK_M 0x60U // Transmit Companding Mode selects
#define MCBSP_MCR2_XPBBLK_S 7U
#define MCBSP_MCR2_XPBBLK_M 0x180U // Transmit word length 2
#define MCBSP_MCR2_XMCME 0x200U // Transmit Frame length 2
//*************************************************************************************************
//
// The following are defines for the bit fields in the MCR1 register
//
//*************************************************************************************************
#define MCBSP_MCR1_RMCM 0x1U // Receive multichannel mode
#define MCBSP_MCR1_RCBLK_S 2U
#define MCBSP_MCR1_RCBLK_M 0x1CU // eceive current block
#define MCBSP_MCR1_RPABLK_S 5U
#define MCBSP_MCR1_RPABLK_M 0x60U // Receive partition A Block
#define MCBSP_MCR1_RPBBLK_S 7U
#define MCBSP_MCR1_RPBBLK_M 0x180U // Receive partition B Block
#define MCBSP_MCR1_RMCME 0x200U // Receive multi-channel enhance mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the PCR register
//
//*************************************************************************************************
#define MCBSP_PCR_CLKRP 0x1U // Receive Clock polarity
#define MCBSP_PCR_CLKXP 0x2U // Transmit clock polarity
#define MCBSP_PCR_FSRP 0x4U // Receive Frame synchronization polarity
#define MCBSP_PCR_FSXP 0x8U // Transmit Frame synchronization polarity
#define MCBSP_PCR_SCLKME 0x80U // Sample clock mode selection
#define MCBSP_PCR_CLKRM 0x100U // Receiver Clock Mode
#define MCBSP_PCR_CLKXM 0x200U // Transmit Clock Mode.
#define MCBSP_PCR_FSRM 0x400U // Receive Frame Synchronization Mode
#define MCBSP_PCR_FSXM 0x800U // Transmit Frame Synchronization Mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the MFFINT register
//
//*************************************************************************************************
#define MCBSP_MFFINT_XINT 0x1U // Enable for Receive Interrupt
#define MCBSP_MFFINT_RINT 0x4U // Enable for transmit Interrupt
#endif
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,298 @@
//###########################################################################
//
// FILE: hw_memmap.h
//
// TITLE: Macros defining the memory map of the C28x.
//
//###########################################################################
//
// 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 HW_MEMMAP_H
#define HW_MEMMAP_H
//*****************************************************************************
//
// The following are defines for the base address of the memories and
// peripherals.
//
//*****************************************************************************
#define M0_RAM_BASE 0x00000000U
#define M1_RAM_BASE 0x00000400U
#define ADCARESULT_BASE 0x00000B00U
#define ADCBRESULT_BASE 0x00000B20U
#define ADCCRESULT_BASE 0x00000B40U
#define ADCDRESULT_BASE 0x00000B60U
#define CPUTIMER0_BASE 0x00000C00U
#define CPUTIMER1_BASE 0x00000C08U
#define CPUTIMER2_BASE 0x00000C10U
#define PIECTRL_BASE 0x00000CE0U
#define PIEVECTTABLE_BASE 0x00000D00U
#define DMA_BASE 0x00001000U
#define DMA_CH1_BASE 0x00001020U
#define DMA_CH2_BASE 0x00001040U
#define DMA_CH3_BASE 0x00001060U
#define DMA_CH4_BASE 0x00001080U
#define DMA_CH5_BASE 0x000010A0U
#define DMA_CH6_BASE 0x000010C0U
#define CLA1_BASE 0x00001400U
#define CLATOCPU_RAM_BASE 0x00001480U
#define CPUTOCLA_RAM_BASE 0x00001500U
#define CLATODMA_RAM_BASE 0x00001680U
#define DMATOCLA_RAM_BASE 0x00001700U
#define CLB1_BASE 0x00003000U
#define CLB1_LOGICCFG_BASE 0x00003000U
#define CLB1_LOGICCTL_BASE 0x00003100U
#define CLB1_DATAEXCH_BASE 0x00003180U
#define CLB2_BASE 0x00003200U
#define CLB2_LOGICCFG_BASE 0x00003200U
#define CLB2_LOGICCTL_BASE 0x00003300U
#define CLB2_DATAEXCH_BASE 0x00003380U
#define CLB3_BASE 0x00003400U
#define CLB3_LOGICCFG_BASE 0x00003400U
#define CLB3_LOGICCTL_BASE 0x00003500U
#define CLB3_DATAEXCH_BASE 0x00003580U
#define CLB4_BASE 0x00003600U
#define CLB4_LOGICCFG_BASE 0x00003600U
#define CLB4_LOGICCTL_BASE 0x00003700U
#define CLB4_DATAEXCH_BASE 0x00003780U
#define CLB5_BASE 0x00003800U
#define CLB5_LOGICCFG_BASE 0x00003800U
#define CLB5_LOGICCTL_BASE 0x00003900U
#define CLB5_DATAEXCH_BASE 0x00003980U
#define CLB6_BASE 0x00003A00U
#define CLB6_LOGICCFG_BASE 0x00003A00U
#define CLB6_LOGICCTL_BASE 0x00003B00U
#define CLB6_DATAEXCH_BASE 0x00003B80U
#define CLB7_BASE 0x00003C00U
#define CLB7_LOGICCFG_BASE 0x00003C00U
#define CLB7_LOGICCTL_BASE 0x00003D00U
#define CLB7_DATAEXCH_BASE 0x00003D80U
#define CLB8_BASE 0x00003E00U
#define CLB8_LOGICCFG_BASE 0x00003E00U
#define CLB8_LOGICCTL_BASE 0x00003F00U
#define CLB8_DATAEXCH_BASE 0x00003F80U
#define EPWM1_BASE 0x00004000U
#define EPWM2_BASE 0x00004100U
#define EPWM3_BASE 0x00004200U
#define EPWM4_BASE 0x00004300U
#define EPWM5_BASE 0x00004400U
#define EPWM6_BASE 0x00004500U
#define EPWM7_BASE 0x00004600U
#define EPWM8_BASE 0x00004700U
#define EPWM9_BASE 0x00004800U
#define EPWM10_BASE 0x00004900U
#define EPWM11_BASE 0x00004A00U
#define EPWM12_BASE 0x00004B00U
#define EPWM13_BASE 0x00004C00U
#define EPWM14_BASE 0x00004D00U
#define EPWM15_BASE 0x00004E00U
#define EPWM16_BASE 0x00004F00U
#define EQEP1_BASE 0x00005100U
#define EQEP2_BASE 0x00005140U
#define EQEP3_BASE 0x00005180U
#define ECAP1_BASE 0x00005200U
#define ECAP2_BASE 0x00005240U
#define ECAP3_BASE 0x00005280U
#define ECAP4_BASE 0x000052C0U
#define ECAP5_BASE 0x00005300U
#define ECAP6_BASE 0x00005340U
#define HRCAP6_BASE 0x00005360U
#define ECAP7_BASE 0x00005380U
#define HRCAP7_BASE 0x000053A0U
#define DACA_BASE 0x00005C00U
#define DACB_BASE 0x00005C10U
#define DACC_BASE 0x00005C20U
#define CMPSS1_BASE 0x00005C80U
#define CMPSS2_BASE 0x00005CA0U
#define CMPSS3_BASE 0x00005CC0U
#define CMPSS4_BASE 0x00005CE0U
#define CMPSS5_BASE 0x00005D00U
#define CMPSS6_BASE 0x00005D20U
#define CMPSS7_BASE 0x00005D40U
#define CMPSS8_BASE 0x00005D60U
#define SDFM1_BASE 0x00005E00U
#define SDFM2_BASE 0x00005E80U
#define MCBSPA_BASE 0x00006000U
#define MCBSPB_BASE 0x00006040U
#define SPIA_BASE 0x00006100U
#define SPIB_BASE 0x00006110U
#define SPIC_BASE 0x00006120U
#define SPID_BASE 0x00006130U
#define BGCRC_CPU_BASE 0x00006340U
#define BGCRC_CLA1_BASE 0x00006380U
#define PMBUSA_BASE 0x00006400U
#define FSITXA_BASE 0x00006600U
#define FSIRXA_BASE 0x00006680U
#define FSITXB_BASE 0x00006700U
#define FSIRXB_BASE 0x00006780U
#define FSIRXC_BASE 0x00006880U
#define FSIRXD_BASE 0x00006980U
#define FSIRXE_BASE 0x00006A80U
#define FSIRXF_BASE 0x00006B80U
#define FSIRXG_BASE 0x00006C80U
#define FSIRXH_BASE 0x00006D80U
#define WD_BASE 0x00007000U
#define NMI_BASE 0x00007060U
#define XINT_BASE 0x00007070U
#define SCIA_BASE 0x00007200U
#define SCIB_BASE 0x00007210U
#define SCIC_BASE 0x00007220U
#define SCID_BASE 0x00007230U
#define I2CA_BASE 0x00007300U
#define I2CB_BASE 0x00007340U
#define ADCA_BASE 0x00007400U
#define ADCB_BASE 0x00007480U
#define ADCC_BASE 0x00007500U
#define ADCD_BASE 0x00007580U
#define INPUTXBAR_BASE 0x00007900U
#define XBAR_BASE 0x00007920U
#define SYNCSOC_BASE 0x00007940U
#define CLBINPUTXBAR_BASE 0x00007960U
#define DMACLASRCSEL_BASE 0x00007980U
#define EPWMXBAR_BASE 0x00007A00U
#define CLBXBAR_BASE 0x00007A40U
#define OUTPUTXBAR_BASE 0x00007A80U
#define CLBOUTPUTXBAR_BASE 0x00007BC0U
#define GPIOCTRL_BASE 0x00007C00U
#define GPIODATA_BASE 0x00007F00U
#define GPIODATAREAD_BASE 0x00007F80U
#define LS0_RAM_BASE 0x00008000U
#define LS1_RAM_BASE 0x00008800U
#define LS2_RAM_BASE 0x00009000U
#define LS3_RAM_BASE 0x00009800U
#define LS4_RAM_BASE 0x0000A000U
#define LS5_RAM_BASE 0x0000A800U
#define LS6_RAM_BASE 0x0000B000U
#define LS7_RAM_BASE 0x0000B800U
#define D0_RAM_BASE 0x0000C000U
#define D1_RAM_BASE 0x0000C800U
#define GS0_RAM_BASE 0x0000D000U
#define GS1_RAM_BASE 0x0000E000U
#define GS2_RAM_BASE 0x0000F000U
#define GS3_RAM_BASE 0x00010000U
#define GS4_RAM_BASE 0x00011000U
#define GS5_RAM_BASE 0x00012000U
#define GS6_RAM_BASE 0x00013000U
#define GS7_RAM_BASE 0x00014000U
#define GS8_RAM_BASE 0x00015000U
#define GS9_RAM_BASE 0x00016000U
#define GS10_RAM_BASE 0x00017000U
#define GS11_RAM_BASE 0x00018000U
#define GS12_RAM_BASE 0x00019000U
#define GS13_RAM_BASE 0x0001A000U
#define GS14_RAM_BASE 0x0001B000U
#define GS15_RAM_BASE 0x0001C000U
#define CMTOCPUXMSGRAM0_BASE 0x00038000U
#define CMTOCPUXMSGRAM1_BASE 0x00038400U
#define CPUXTOCMMSGRAM0_BASE 0x00039000U
#define CPUXTOCMMSGRAM1_BASE 0x00039400U
#define CPU1TOCPU2MSGRAM0_BASE 0x0003A000U
#define CPU1TOCPU2MSGRAM1_BASE 0x0003A400U
#define CPU2TOCPU1MSGRAM0_BASE 0x0003B000U
#define CPU2TOCPU1MSGRAM1_BASE 0x0003B400U
#define USBA_BASE 0x00040000U
#define EMIF1_BASE 0x00047000U
#define EMIF2_BASE 0x00047800U
#define CANA_BASE 0x00048000U
#define CANA_MSG_RAM_BASE 0x00049000U
#define CANB_BASE 0x0004A000U
#define CANB_MSG_RAM_BASE 0x0004B000U
#define ESC_SS_BASE 0x00057E00U
#define ESC_SS_CONFIG_BASE 0x00057F00U
#define MCANA_DRIVER_BASE 0x00058000U
#define MCANA_MSG_RAM_BASE 0x00058000U
#define MCANASS_BASE 0x0005C400U
#define MCANA_BASE 0x0005C600U
#define MCANA_ERROR_BASE 0x0005C800U
#define IPC_CPUXTOCPUX_BASE 0x0005CE00U
#define FLASHPUMPSEMAPHORE_BASE 0x0005CE24U
#define IPC_CPUXTOCM_BASE 0x0005CE40U
#define DEVCFG_BASE 0x0005D000U
#define CLKCFG_BASE 0x0005D200U
#define CPUSYS_BASE 0x0005D300U
#define SYSSTAT_BASE 0x0005D400U
#define PERIPHAC_BASE 0x0005D500U
#define PERIPHAC_BASE 0x0005D500U
#define ANALOGSUBSYS_BASE 0x0005D700U
#define CMCONF_BASE 0x0005DC00U
#define HWBIST_BASE 0x0005E000U
#define PBIST_BASE 0x0005E200U
#define DCC0_BASE 0x0005E700U
#define DCC1_BASE 0x0005E740U
#define DCC2_BASE 0x0005E780U
#define ERAD_GLOBAL_BASE 0x0005E800U
#define ERAD_HWBP1_BASE 0x0005E900U
#define ERAD_HWBP2_BASE 0x0005E908U
#define ERAD_HWBP3_BASE 0x0005E910U
#define ERAD_HWBP4_BASE 0x0005E918U
#define ERAD_HWBP5_BASE 0x0005E920U
#define ERAD_HWBP6_BASE 0x0005E928U
#define ERAD_HWBP7_BASE 0x0005E930U
#define ERAD_HWBP8_BASE 0x0005E938U
#define ERAD_COUNTER1_BASE 0x0005E980U
#define ERAD_COUNTER2_BASE 0x0005E990U
#define ERAD_COUNTER3_BASE 0x0005E9A0U
#define ERAD_COUNTER4_BASE 0x0005E9B0U
#define ERAD_CRC_GLOBAL_BASE 0x0005EA00U
#define ERAD_CRC1_BASE 0x0005EA10U
#define ERAD_CRC2_BASE 0x0005EA20U
#define ERAD_CRC3_BASE 0x0005EA30U
#define ERAD_CRC4_BASE 0x0005EA40U
#define ERAD_CRC5_BASE 0x0005EA50U
#define ERAD_CRC6_BASE 0x0005EA60U
#define ERAD_CRC7_BASE 0x0005EA70U
#define ERAD_CRC8_BASE 0x0005EA80U
#define DCSM_Z1_BASE 0x0005F000U
#define DCSM_Z2_BASE 0x0005F080U
#define DCSMCOMMON_BASE 0x0005F0C0U
#define MEMCFG_BASE 0x0005F400U
#define EMIF1CONFIG_BASE 0x0005F4C0U
#define EMIF2CONFIG_BASE 0x0005F4E0U
#define ACCESSPROTECTION_BASE 0x0005F500U
#define MEMORYERROR_BASE 0x0005F540U
#define ROMWAITSTATE_BASE 0x0005F580U
#define ROMPREFETCH_BASE 0x0005F588U
#define TESTERROR_BASE 0x0005F590U
#define FLASH0CTRL_BASE 0x0005F800U
#define FLASH0ECC_BASE 0x0005FB00U
#define UID_BASE 0x00070200U
#define CPUID_BASE 0x00070223U
#define DCSM_Z1OTP_BASE 0x00078000U
#define DCSM_Z2OTP_BASE 0x00078200U
#if defined(__TMS320C28XX_CLA2__)
#define CLA1_ONLY_BASE 0x00000C00U
#endif
#endif
@@ -0,0 +1,192 @@
//###########################################################################
//
// FILE: hw_nmi.h
//
// TITLE: Definitions for the NMI 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 HW_NMI_H
#define HW_NMI_H
//*************************************************************************************************
//
// The following are defines for the NMI register offsets
//
//*************************************************************************************************
#define NMI_O_CFG 0x0U // NMI Configuration Register
#define NMI_O_FLG 0x1U // NMI Flag Register (SYSRsn Clear)
#define NMI_O_FLGCLR 0x2U // NMI Flag Clear Register
#define NMI_O_FLGFRC 0x3U // NMI Flag Force Register
#define NMI_O_WDCNT 0x4U // NMI Watchdog Counter Register
#define NMI_O_WDPRD 0x5U // NMI Watchdog Period Register
#define NMI_O_SHDFLG 0x6U // NMI Shadow Flag Register
#define NMI_O_ERRORSTS 0x7U // Error pin status
#define NMI_O_ERRORSTSCLR 0x8U // ERRORSTS clear register
#define NMI_O_ERRORSTSFRC 0x9U // ERRORSTS force register
#define NMI_O_ERRORCTL 0xAU // Error pin control register
#define NMI_O_ERRORLOCK 0xBU // Lock register to Error pin registers.
//*************************************************************************************************
//
// The following are defines for the bit fields in the NMICFG register
//
//*************************************************************************************************
#define NMI_CFG_NMIE 0x1U // Global NMI Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the NMIFLG register
//
//*************************************************************************************************
#define NMI_FLG_NMIINT 0x1U // NMI Interrupt Flag
#define NMI_FLG_CLOCKFAIL 0x2U // Clock Fail Interrupt Flag
#define NMI_FLG_RAMUNCERR 0x4U // RAM Uncorrectable Error NMI Flag
#define NMI_FLG_FLUNCERR 0x8U // Flash Uncorrectable Error NMI Flag
#define NMI_FLG_CPU1HWBISTERR 0x10U // HW BIST Error NMI Flag
#define NMI_FLG_CPU2HWBISTERR 0x20U // HW BIST Error NMI Flag
#define NMI_FLG_PIEVECTERR 0x40U // PIE Vector Fetch Error Flag
#define NMI_FLG_ERADNMI 0x80U // ERAD Module NMI Flag
#define NMI_FLG_CLBNMI 0x100U // Configurable Logic Block NMI Flag
#define NMI_FLG_CPU2WDRSN 0x200U // CPU2 WDRSn Reset Indication Flag
#define NMI_FLG_CPU2NMIWDRSN 0x400U // CPU2 NMIWDRSn Reset Indication Flag
#define NMI_FLG_CMNMIWDRSN 0x1000U // CM NMI watch dog has timed out.
#define NMI_FLG_ECATNMIN 0x2000U // NMI from EtherCAT reset out
#define NMI_FLG_CRC_FAIL 0x4000U // CRC calculation failed.
#define NMI_FLG_MCAN_ERR 0x8000U // MCAN module generated an ECC error.
//*************************************************************************************************
//
// The following are defines for the bit fields in the NMIFLGCLR register
//
//*************************************************************************************************
#define NMI_FLGCLR_NMIINT 0x1U // NMIINT Flag Clear
#define NMI_FLGCLR_CLOCKFAIL 0x2U // CLOCKFAIL Flag Clear
#define NMI_FLGCLR_RAMUNCERR 0x4U // RAMUNCERR Flag Clear
#define NMI_FLGCLR_FLUNCERR 0x8U // FLUNCERR Flag Clear
#define NMI_FLGCLR_CPU1HWBISTERR 0x10U // CPU1HWBISTERR Flag Clear
#define NMI_FLGCLR_CPU2HWBISTERR 0x20U // CPU2HWBISTERR Flag Clear
#define NMI_FLGCLR_PIEVECTERR 0x40U // PIEVECTERR Flag Clear
#define NMI_FLGCLR_ERADNMI 0x80U // ERADNMI Flag Clear
#define NMI_FLGCLR_CLBNMI 0x100U // CLBNMI Flag Clear
#define NMI_FLGCLR_CPU2WDRSN 0x200U // CPU2WDRSn Flag Clear
#define NMI_FLGCLR_CPU2NMIWDRSN 0x400U // CPU2NMIWDRSn Flag Clear
#define NMI_FLGCLR_CMNMIWDRSN 0x1000U // DCDCOLF Flag Clear
#define NMI_FLGCLR_ECATNMIN 0x2000U // ECATNMIn flag clear
#define NMI_FLGCLR_CRC_FAIL 0x4000U // CRC_FAIL flag clear
#define NMI_FLGCLR_MCAN_ERR 0x8000U // MCAN_ERR flag clear
//*************************************************************************************************
//
// The following are defines for the bit fields in the NMIFLGFRC register
//
//*************************************************************************************************
#define NMI_FLGFRC_CLOCKFAIL 0x2U // CLOCKFAIL Flag Force
#define NMI_FLGFRC_RAMUNCERR 0x4U // RAMUNCERR Flag Force
#define NMI_FLGFRC_FLUNCERR 0x8U // FLUNCERR Flag Force
#define NMI_FLGFRC_CPU1HWBISTERR 0x10U // CPU1HWBISTERR Flag Force
#define NMI_FLGFRC_CPU2HWBISTERR 0x20U // CPU2HWBISTERR Flag Force
#define NMI_FLGFRC_PIEVECTERR 0x40U // PIEVECTERR Flag Force
#define NMI_FLGFRC_ERADNMI 0x80U // ERADNMI Flag Force
#define NMI_FLGFRC_CLBNMI 0x100U // CLBNMI Flag Force
#define NMI_FLGFRC_CPU2WDRSN 0x200U // CPU2WDRSn Flag Force
#define NMI_FLGFRC_CPU2NMIWDRSN 0x400U // CPU2NMIWDRSn Flag Force
#define NMI_FLGFRC_CMNMIWDRSN 0x1000U // DCDCOLF Flag Force
#define NMI_FLGFRC_ECATNMIN 0x2000U // ECATNMIn flag force
#define NMI_FLGFRC_CRC_FAIL 0x4000U // CRC_FAIL flag force
#define NMI_FLGFRC_MCAN_ERR 0x8000U // MCAN_ERR flag force
//*************************************************************************************************
//
// The following are defines for the bit fields in the NMISHDFLG register
//
//*************************************************************************************************
#define NMI_SHDFLG_CLOCKFAIL 0x2U // Shadow CLOCKFAIL Flag
#define NMI_SHDFLG_RAMUNCERR 0x4U // Shadow RAMUNCERR Flag
#define NMI_SHDFLG_FLUNCERR 0x8U // Shadow FLUNCERR Flag
#define NMI_SHDFLG_CPU1HWBISTERR 0x10U // Shadow CPU1HWBISTERR Flag
#define NMI_SHDFLG_CPU2HWBISTERR 0x20U // Shadow CPU2HWBISTERR Flag
#define NMI_SHDFLG_PIEVECTERR 0x40U // Shadow PIEVECTERR Flag
#define NMI_SHDFLG_ERADNMI 0x80U // Shadow ERADNMI Flag
#define NMI_SHDFLG_CLBNMI 0x100U // Shadow CLBNMI Flag
#define NMI_SHDFLG_CPU2WDRSN 0x200U // Shadow CPU2WDRSn Flag
#define NMI_SHDFLG_CPU2NMIWDRSN 0x400U // Shadow CPU2NMIWDRSn Flag
#define NMI_SHDFLG_CMNMIWDRSN 0x1000U // Shadow DCDCOLF Flag
#define NMI_SHDFLG_ECATNMIN 0x2000U // ECATNMIn flag
#define NMI_SHDFLG_CRC_FAIL 0x4000U // CRC_FAIL flag
#define NMI_SHDFLG_MCAN_ERR 0x8000U // MCAN_ERR flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERRORSTS register
//
//*************************************************************************************************
#define NMI_ERRORSTS_ERROR 0x1U // Error flag.
#define NMI_ERRORSTS_PINSTS 0x2U // Error pin status.
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERRORSTSCLR register
//
//*************************************************************************************************
#define NMI_ERRORSTSCLR_ERROR 0x1U // ERRORFLG.ERROR clear bit
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERRORSTSFRC register
//
//*************************************************************************************************
#define NMI_ERRORSTSFRC_ERROR 0x1U // ERRORSTS.ERROR pin force.
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERRORCTL register
//
//*************************************************************************************************
#define NMI_ERRORCTL_ERRORPOLSEL 0x1U // ERROR pin polarity select
//*************************************************************************************************
//
// The following are defines for the bit fields in the ERRORLOCK register
//
//*************************************************************************************************
#define NMI_ERRORLOCK_ERRORCTL 0x1U // ERRORCTL Lock bit
#endif
@@ -0,0 +1,63 @@
//###########################################################################
//
// FILE: hw_otp.h
//
// TITLE: Definitions for the OTP 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 HW_OTP_H
#define HW_OTP_H
//*************************************************************************************************
//
// The following are defines for the OTP register offsets
//
//*************************************************************************************************
#define OTP_O_UID_PSRAND0 0x0U // UID Psuedo-random 160 bit number
#define OTP_O_UID_PSRAND1 0x2U // UID Psuedo-random 160 bit number
#define OTP_O_UID_PSRAND2 0x4U // UID Psuedo-random 160 bit number
#define OTP_O_UID_PSRAND3 0x6U // UID Psuedo-random 160 bit number
#define OTP_O_UID_PSRAND4 0x8U // UID Psuedo-random 160 bit number
#define OTP_O_UID_PSRAND5 0xAU // UID Psuedo-random 160 bit number
#define OTP_O_UID_UNIQUE 0xCU // UID UID Unique 32 bit number
#define OTP_O_UID_CHECKSUM 0xEU // UID Checksum
#endif
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,636 @@
//###########################################################################
//
// FILE: hw_pie.h
//
// TITLE: Definitions for the PIE 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 HW_PIE_H
#define HW_PIE_H
//*************************************************************************************************
//
// The following are defines for the PIE register offsets
//
//*************************************************************************************************
#define PIE_O_CTRL 0x0U // ePIE Control Register
#define PIE_O_ACK 0x1U // Interrupt Acknowledge Register
#define PIE_O_IER1 0x2U // Interrupt Group 1 Enable Register
#define PIE_O_IFR1 0x3U // Interrupt Group 1 Flag Register
#define PIE_O_IER2 0x4U // Interrupt Group 2 Enable Register
#define PIE_O_IFR2 0x5U // Interrupt Group 2 Flag Register
#define PIE_O_IER3 0x6U // Interrupt Group 3 Enable Register
#define PIE_O_IFR3 0x7U // Interrupt Group 3 Flag Register
#define PIE_O_IER4 0x8U // Interrupt Group 4 Enable Register
#define PIE_O_IFR4 0x9U // Interrupt Group 4 Flag Register
#define PIE_O_IER5 0xAU // Interrupt Group 5 Enable Register
#define PIE_O_IFR5 0xBU // Interrupt Group 5 Flag Register
#define PIE_O_IER6 0xCU // Interrupt Group 6 Enable Register
#define PIE_O_IFR6 0xDU // Interrupt Group 6 Flag Register
#define PIE_O_IER7 0xEU // Interrupt Group 7 Enable Register
#define PIE_O_IFR7 0xFU // Interrupt Group 7 Flag Register
#define PIE_O_IER8 0x10U // Interrupt Group 8 Enable Register
#define PIE_O_IFR8 0x11U // Interrupt Group 8 Flag Register
#define PIE_O_IER9 0x12U // Interrupt Group 9 Enable Register
#define PIE_O_IFR9 0x13U // Interrupt Group 9 Flag Register
#define PIE_O_IER10 0x14U // Interrupt Group 10 Enable Register
#define PIE_O_IFR10 0x15U // Interrupt Group 10 Flag Register
#define PIE_O_IER11 0x16U // Interrupt Group 11 Enable Register
#define PIE_O_IFR11 0x17U // Interrupt Group 11 Flag Register
#define PIE_O_IER12 0x18U // Interrupt Group 12 Enable Register
#define PIE_O_IFR12 0x19U // Interrupt Group 12 Flag Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIECTRL register
//
//*************************************************************************************************
#define PIE_CTRL_ENPIE 0x1U // PIE Enable
#define PIE_CTRL_PIEVECT_S 1U
#define PIE_CTRL_PIEVECT_M 0xFFFEU // PIE Vector Address
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEACK register
//
//*************************************************************************************************
#define PIE_ACK_ACK1 0x1U // Acknowledge PIE Interrupt Group 1
#define PIE_ACK_ACK2 0x2U // Acknowledge PIE Interrupt Group 2
#define PIE_ACK_ACK3 0x4U // Acknowledge PIE Interrupt Group 3
#define PIE_ACK_ACK4 0x8U // Acknowledge PIE Interrupt Group 4
#define PIE_ACK_ACK5 0x10U // Acknowledge PIE Interrupt Group 5
#define PIE_ACK_ACK6 0x20U // Acknowledge PIE Interrupt Group 6
#define PIE_ACK_ACK7 0x40U // Acknowledge PIE Interrupt Group 7
#define PIE_ACK_ACK8 0x80U // Acknowledge PIE Interrupt Group 8
#define PIE_ACK_ACK9 0x100U // Acknowledge PIE Interrupt Group 9
#define PIE_ACK_ACK10 0x200U // Acknowledge PIE Interrupt Group 10
#define PIE_ACK_ACK11 0x400U // Acknowledge PIE Interrupt Group 11
#define PIE_ACK_ACK12 0x800U // Acknowledge PIE Interrupt Group 12
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER1 register
//
//*************************************************************************************************
#define PIE_IER1_INTX1 0x1U // Enable for Interrupt 1.1
#define PIE_IER1_INTX2 0x2U // Enable for Interrupt 1.2
#define PIE_IER1_INTX3 0x4U // Enable for Interrupt 1.3
#define PIE_IER1_INTX4 0x8U // Enable for Interrupt 1.4
#define PIE_IER1_INTX5 0x10U // Enable for Interrupt 1.5
#define PIE_IER1_INTX6 0x20U // Enable for Interrupt 1.6
#define PIE_IER1_INTX7 0x40U // Enable for Interrupt 1.7
#define PIE_IER1_INTX8 0x80U // Enable for Interrupt 1.8
#define PIE_IER1_INTX9 0x100U // Enable for Interrupt 1.9
#define PIE_IER1_INTX10 0x200U // Enable for Interrupt 1.10
#define PIE_IER1_INTX11 0x400U // Enable for Interrupt 1.11
#define PIE_IER1_INTX12 0x800U // Enable for Interrupt 1.12
#define PIE_IER1_INTX13 0x1000U // Enable for Interrupt 1.13
#define PIE_IER1_INTX14 0x2000U // Enable for Interrupt 1.14
#define PIE_IER1_INTX15 0x4000U // Enable for Interrupt 1.15
#define PIE_IER1_INTX16 0x8000U // Enable for Interrupt 1.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR1 register
//
//*************************************************************************************************
#define PIE_IFR1_INTX1 0x1U // Flag for Interrupt 1.1
#define PIE_IFR1_INTX2 0x2U // Flag for Interrupt 1.2
#define PIE_IFR1_INTX3 0x4U // Flag for Interrupt 1.3
#define PIE_IFR1_INTX4 0x8U // Flag for Interrupt 1.4
#define PIE_IFR1_INTX5 0x10U // Flag for Interrupt 1.5
#define PIE_IFR1_INTX6 0x20U // Flag for Interrupt 1.6
#define PIE_IFR1_INTX7 0x40U // Flag for Interrupt 1.7
#define PIE_IFR1_INTX8 0x80U // Flag for Interrupt 1.8
#define PIE_IFR1_INTX9 0x100U // Flag for Interrupt 1.9
#define PIE_IFR1_INTX10 0x200U // Flag for Interrupt 1.10
#define PIE_IFR1_INTX11 0x400U // Flag for Interrupt 1.11
#define PIE_IFR1_INTX12 0x800U // Flag for Interrupt 1.12
#define PIE_IFR1_INTX13 0x1000U // Flag for Interrupt 1.13
#define PIE_IFR1_INTX14 0x2000U // Flag for Interrupt 1.14
#define PIE_IFR1_INTX15 0x4000U // Flag for Interrupt 1.15
#define PIE_IFR1_INTX16 0x8000U // Flag for Interrupt 1.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER2 register
//
//*************************************************************************************************
#define PIE_IER2_INTX1 0x1U // Enable for Interrupt 2.1
#define PIE_IER2_INTX2 0x2U // Enable for Interrupt 2.2
#define PIE_IER2_INTX3 0x4U // Enable for Interrupt 2.3
#define PIE_IER2_INTX4 0x8U // Enable for Interrupt 2.4
#define PIE_IER2_INTX5 0x10U // Enable for Interrupt 2.5
#define PIE_IER2_INTX6 0x20U // Enable for Interrupt 2.6
#define PIE_IER2_INTX7 0x40U // Enable for Interrupt 2.7
#define PIE_IER2_INTX8 0x80U // Enable for Interrupt 2.8
#define PIE_IER2_INTX9 0x100U // Enable for Interrupt 2.9
#define PIE_IER2_INTX10 0x200U // Enable for Interrupt 2.10
#define PIE_IER2_INTX11 0x400U // Enable for Interrupt 2.11
#define PIE_IER2_INTX12 0x800U // Enable for Interrupt 2.12
#define PIE_IER2_INTX13 0x1000U // Enable for Interrupt 2.13
#define PIE_IER2_INTX14 0x2000U // Enable for Interrupt 2.14
#define PIE_IER2_INTX15 0x4000U // Enable for Interrupt 2.15
#define PIE_IER2_INTX16 0x8000U // Enable for Interrupt 2.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR2 register
//
//*************************************************************************************************
#define PIE_IFR2_INTX1 0x1U // Flag for Interrupt 2.1
#define PIE_IFR2_INTX2 0x2U // Flag for Interrupt 2.2
#define PIE_IFR2_INTX3 0x4U // Flag for Interrupt 2.3
#define PIE_IFR2_INTX4 0x8U // Flag for Interrupt 2.4
#define PIE_IFR2_INTX5 0x10U // Flag for Interrupt 2.5
#define PIE_IFR2_INTX6 0x20U // Flag for Interrupt 2.6
#define PIE_IFR2_INTX7 0x40U // Flag for Interrupt 2.7
#define PIE_IFR2_INTX8 0x80U // Flag for Interrupt 2.8
#define PIE_IFR2_INTX9 0x100U // Flag for Interrupt 2.9
#define PIE_IFR2_INTX10 0x200U // Flag for Interrupt 2.10
#define PIE_IFR2_INTX11 0x400U // Flag for Interrupt 2.11
#define PIE_IFR2_INTX12 0x800U // Flag for Interrupt 2.12
#define PIE_IFR2_INTX13 0x1000U // Flag for Interrupt 2.13
#define PIE_IFR2_INTX14 0x2000U // Flag for Interrupt 2.14
#define PIE_IFR2_INTX15 0x4000U // Flag for Interrupt 2.15
#define PIE_IFR2_INTX16 0x8000U // Flag for Interrupt 2.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER3 register
//
//*************************************************************************************************
#define PIE_IER3_INTX1 0x1U // Enable for Interrupt 3.1
#define PIE_IER3_INTX2 0x2U // Enable for Interrupt 3.2
#define PIE_IER3_INTX3 0x4U // Enable for Interrupt 3.3
#define PIE_IER3_INTX4 0x8U // Enable for Interrupt 3.4
#define PIE_IER3_INTX5 0x10U // Enable for Interrupt 3.5
#define PIE_IER3_INTX6 0x20U // Enable for Interrupt 3.6
#define PIE_IER3_INTX7 0x40U // Enable for Interrupt 3.7
#define PIE_IER3_INTX8 0x80U // Enable for Interrupt 3.8
#define PIE_IER3_INTX9 0x100U // Enable for Interrupt 3.9
#define PIE_IER3_INTX10 0x200U // Enable for Interrupt 3.10
#define PIE_IER3_INTX11 0x400U // Enable for Interrupt 3.11
#define PIE_IER3_INTX12 0x800U // Enable for Interrupt 3.12
#define PIE_IER3_INTX13 0x1000U // Enable for Interrupt 3.13
#define PIE_IER3_INTX14 0x2000U // Enable for Interrupt 3.14
#define PIE_IER3_INTX15 0x4000U // Enable for Interrupt 3.15
#define PIE_IER3_INTX16 0x8000U // Enable for Interrupt 3.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR3 register
//
//*************************************************************************************************
#define PIE_IFR3_INTX1 0x1U // Flag for Interrupt 3.1
#define PIE_IFR3_INTX2 0x2U // Flag for Interrupt 3.2
#define PIE_IFR3_INTX3 0x4U // Flag for Interrupt 3.3
#define PIE_IFR3_INTX4 0x8U // Flag for Interrupt 3.4
#define PIE_IFR3_INTX5 0x10U // Flag for Interrupt 3.5
#define PIE_IFR3_INTX6 0x20U // Flag for Interrupt 3.6
#define PIE_IFR3_INTX7 0x40U // Flag for Interrupt 3.7
#define PIE_IFR3_INTX8 0x80U // Flag for Interrupt 3.8
#define PIE_IFR3_INTX9 0x100U // Flag for Interrupt 3.9
#define PIE_IFR3_INTX10 0x200U // Flag for Interrupt 3.10
#define PIE_IFR3_INTX11 0x400U // Flag for Interrupt 3.11
#define PIE_IFR3_INTX12 0x800U // Flag for Interrupt 3.12
#define PIE_IFR3_INTX13 0x1000U // Flag for Interrupt 3.13
#define PIE_IFR3_INTX14 0x2000U // Flag for Interrupt 3.14
#define PIE_IFR3_INTX15 0x4000U // Flag for Interrupt 3.15
#define PIE_IFR3_INTX16 0x8000U // Flag for Interrupt 3.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER4 register
//
//*************************************************************************************************
#define PIE_IER4_INTX1 0x1U // Enable for Interrupt 4.1
#define PIE_IER4_INTX2 0x2U // Enable for Interrupt 4.2
#define PIE_IER4_INTX3 0x4U // Enable for Interrupt 4.3
#define PIE_IER4_INTX4 0x8U // Enable for Interrupt 4.4
#define PIE_IER4_INTX5 0x10U // Enable for Interrupt 4.5
#define PIE_IER4_INTX6 0x20U // Enable for Interrupt 4.6
#define PIE_IER4_INTX7 0x40U // Enable for Interrupt 4.7
#define PIE_IER4_INTX8 0x80U // Enable for Interrupt 4.8
#define PIE_IER4_INTX9 0x100U // Enable for Interrupt 4.9
#define PIE_IER4_INTX10 0x200U // Enable for Interrupt 4.10
#define PIE_IER4_INTX11 0x400U // Enable for Interrupt 4.11
#define PIE_IER4_INTX12 0x800U // Enable for Interrupt 4.12
#define PIE_IER4_INTX13 0x1000U // Enable for Interrupt 4.13
#define PIE_IER4_INTX14 0x2000U // Enable for Interrupt 4.14
#define PIE_IER4_INTX15 0x4000U // Enable for Interrupt 4.15
#define PIE_IER4_INTX16 0x8000U // Enable for Interrupt 4.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR4 register
//
//*************************************************************************************************
#define PIE_IFR4_INTX1 0x1U // Flag for Interrupt 4.1
#define PIE_IFR4_INTX2 0x2U // Flag for Interrupt 4.2
#define PIE_IFR4_INTX3 0x4U // Flag for Interrupt 4.3
#define PIE_IFR4_INTX4 0x8U // Flag for Interrupt 4.4
#define PIE_IFR4_INTX5 0x10U // Flag for Interrupt 4.5
#define PIE_IFR4_INTX6 0x20U // Flag for Interrupt 4.6
#define PIE_IFR4_INTX7 0x40U // Flag for Interrupt 4.7
#define PIE_IFR4_INTX8 0x80U // Flag for Interrupt 4.8
#define PIE_IFR4_INTX9 0x100U // Flag for Interrupt 4.9
#define PIE_IFR4_INTX10 0x200U // Flag for Interrupt 4.10
#define PIE_IFR4_INTX11 0x400U // Flag for Interrupt 4.11
#define PIE_IFR4_INTX12 0x800U // Flag for Interrupt 4.12
#define PIE_IFR4_INTX13 0x1000U // Flag for Interrupt 4.13
#define PIE_IFR4_INTX14 0x2000U // Flag for Interrupt 4.14
#define PIE_IFR4_INTX15 0x4000U // Flag for Interrupt 4.15
#define PIE_IFR4_INTX16 0x8000U // Flag for Interrupt 4.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER5 register
//
//*************************************************************************************************
#define PIE_IER5_INTX1 0x1U // Enable for Interrupt 5.1
#define PIE_IER5_INTX2 0x2U // Enable for Interrupt 5.2
#define PIE_IER5_INTX3 0x4U // Enable for Interrupt 5.3
#define PIE_IER5_INTX4 0x8U // Enable for Interrupt 5.4
#define PIE_IER5_INTX5 0x10U // Enable for Interrupt 5.5
#define PIE_IER5_INTX6 0x20U // Enable for Interrupt 5.6
#define PIE_IER5_INTX7 0x40U // Enable for Interrupt 5.7
#define PIE_IER5_INTX8 0x80U // Enable for Interrupt 5.8
#define PIE_IER5_INTX9 0x100U // Enable for Interrupt 5.9
#define PIE_IER5_INTX10 0x200U // Enable for Interrupt 5.10
#define PIE_IER5_INTX11 0x400U // Enable for Interrupt 5.11
#define PIE_IER5_INTX12 0x800U // Enable for Interrupt 5.12
#define PIE_IER5_INTX13 0x1000U // Enable for Interrupt 5.13
#define PIE_IER5_INTX14 0x2000U // Enable for Interrupt 5.14
#define PIE_IER5_INTX15 0x4000U // Enable for Interrupt 5.15
#define PIE_IER5_INTX16 0x8000U // Enable for Interrupt 5.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR5 register
//
//*************************************************************************************************
#define PIE_IFR5_INTX1 0x1U // Flag for Interrupt 5.1
#define PIE_IFR5_INTX2 0x2U // Flag for Interrupt 5.2
#define PIE_IFR5_INTX3 0x4U // Flag for Interrupt 5.3
#define PIE_IFR5_INTX4 0x8U // Flag for Interrupt 5.4
#define PIE_IFR5_INTX5 0x10U // Flag for Interrupt 5.5
#define PIE_IFR5_INTX6 0x20U // Flag for Interrupt 5.6
#define PIE_IFR5_INTX7 0x40U // Flag for Interrupt 5.7
#define PIE_IFR5_INTX8 0x80U // Flag for Interrupt 5.8
#define PIE_IFR5_INTX9 0x100U // Flag for Interrupt 5.9
#define PIE_IFR5_INTX10 0x200U // Flag for Interrupt 5.10
#define PIE_IFR5_INTX11 0x400U // Flag for Interrupt 5.11
#define PIE_IFR5_INTX12 0x800U // Flag for Interrupt 5.12
#define PIE_IFR5_INTX13 0x1000U // Flag for Interrupt 5.13
#define PIE_IFR5_INTX14 0x2000U // Flag for Interrupt 5.14
#define PIE_IFR5_INTX15 0x4000U // Flag for Interrupt 5.15
#define PIE_IFR5_INTX16 0x8000U // Flag for Interrupt 5.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER6 register
//
//*************************************************************************************************
#define PIE_IER6_INTX1 0x1U // Enable for Interrupt 6.1
#define PIE_IER6_INTX2 0x2U // Enable for Interrupt 6.2
#define PIE_IER6_INTX3 0x4U // Enable for Interrupt 6.3
#define PIE_IER6_INTX4 0x8U // Enable for Interrupt 6.4
#define PIE_IER6_INTX5 0x10U // Enable for Interrupt 6.5
#define PIE_IER6_INTX6 0x20U // Enable for Interrupt 6.6
#define PIE_IER6_INTX7 0x40U // Enable for Interrupt 6.7
#define PIE_IER6_INTX8 0x80U // Enable for Interrupt 6.8
#define PIE_IER6_INTX9 0x100U // Enable for Interrupt 6.9
#define PIE_IER6_INTX10 0x200U // Enable for Interrupt 6.10
#define PIE_IER6_INTX11 0x400U // Enable for Interrupt 6.11
#define PIE_IER6_INTX12 0x800U // Enable for Interrupt 6.12
#define PIE_IER6_INTX13 0x1000U // Enable for Interrupt 6.13
#define PIE_IER6_INTX14 0x2000U // Enable for Interrupt 6.14
#define PIE_IER6_INTX15 0x4000U // Enable for Interrupt 6.15
#define PIE_IER6_INTX16 0x8000U // Enable for Interrupt 6.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR6 register
//
//*************************************************************************************************
#define PIE_IFR6_INTX1 0x1U // Flag for Interrupt 6.1
#define PIE_IFR6_INTX2 0x2U // Flag for Interrupt 6.2
#define PIE_IFR6_INTX3 0x4U // Flag for Interrupt 6.3
#define PIE_IFR6_INTX4 0x8U // Flag for Interrupt 6.4
#define PIE_IFR6_INTX5 0x10U // Flag for Interrupt 6.5
#define PIE_IFR6_INTX6 0x20U // Flag for Interrupt 6.6
#define PIE_IFR6_INTX7 0x40U // Flag for Interrupt 6.7
#define PIE_IFR6_INTX8 0x80U // Flag for Interrupt 6.8
#define PIE_IFR6_INTX9 0x100U // Flag for Interrupt 6.9
#define PIE_IFR6_INTX10 0x200U // Flag for Interrupt 6.10
#define PIE_IFR6_INTX11 0x400U // Flag for Interrupt 6.11
#define PIE_IFR6_INTX12 0x800U // Flag for Interrupt 6.12
#define PIE_IFR6_INTX13 0x1000U // Flag for Interrupt 6.13
#define PIE_IFR6_INTX14 0x2000U // Flag for Interrupt 6.14
#define PIE_IFR6_INTX15 0x4000U // Flag for Interrupt 6.15
#define PIE_IFR6_INTX16 0x8000U // Flag for Interrupt 6.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER7 register
//
//*************************************************************************************************
#define PIE_IER7_INTX1 0x1U // Enable for Interrupt 7.1
#define PIE_IER7_INTX2 0x2U // Enable for Interrupt 7.2
#define PIE_IER7_INTX3 0x4U // Enable for Interrupt 7.3
#define PIE_IER7_INTX4 0x8U // Enable for Interrupt 7.4
#define PIE_IER7_INTX5 0x10U // Enable for Interrupt 7.5
#define PIE_IER7_INTX6 0x20U // Enable for Interrupt 7.6
#define PIE_IER7_INTX7 0x40U // Enable for Interrupt 7.7
#define PIE_IER7_INTX8 0x80U // Enable for Interrupt 7.8
#define PIE_IER7_INTX9 0x100U // Enable for Interrupt 7.9
#define PIE_IER7_INTX10 0x200U // Enable for Interrupt 7.10
#define PIE_IER7_INTX11 0x400U // Enable for Interrupt 7.11
#define PIE_IER7_INTX12 0x800U // Enable for Interrupt 7.12
#define PIE_IER7_INTX13 0x1000U // Enable for Interrupt 7.13
#define PIE_IER7_INTX14 0x2000U // Enable for Interrupt 7.14
#define PIE_IER7_INTX15 0x4000U // Enable for Interrupt 7.15
#define PIE_IER7_INTX16 0x8000U // Enable for Interrupt 7.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR7 register
//
//*************************************************************************************************
#define PIE_IFR7_INTX1 0x1U // Flag for Interrupt 7.1
#define PIE_IFR7_INTX2 0x2U // Flag for Interrupt 7.2
#define PIE_IFR7_INTX3 0x4U // Flag for Interrupt 7.3
#define PIE_IFR7_INTX4 0x8U // Flag for Interrupt 7.4
#define PIE_IFR7_INTX5 0x10U // Flag for Interrupt 7.5
#define PIE_IFR7_INTX6 0x20U // Flag for Interrupt 7.6
#define PIE_IFR7_INTX7 0x40U // Flag for Interrupt 7.7
#define PIE_IFR7_INTX8 0x80U // Flag for Interrupt 7.8
#define PIE_IFR7_INTX9 0x100U // Flag for Interrupt 7.9
#define PIE_IFR7_INTX10 0x200U // Flag for Interrupt 7.10
#define PIE_IFR7_INTX11 0x400U // Flag for Interrupt 7.11
#define PIE_IFR7_INTX12 0x800U // Flag for Interrupt 7.12
#define PIE_IFR7_INTX13 0x1000U // Flag for Interrupt 7.13
#define PIE_IFR7_INTX14 0x2000U // Flag for Interrupt 7.14
#define PIE_IFR7_INTX15 0x4000U // Flag for Interrupt 7.15
#define PIE_IFR7_INTX16 0x8000U // Flag for Interrupt 7.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER8 register
//
//*************************************************************************************************
#define PIE_IER8_INTX1 0x1U // Enable for Interrupt 8.1
#define PIE_IER8_INTX2 0x2U // Enable for Interrupt 8.2
#define PIE_IER8_INTX3 0x4U // Enable for Interrupt 8.3
#define PIE_IER8_INTX4 0x8U // Enable for Interrupt 8.4
#define PIE_IER8_INTX5 0x10U // Enable for Interrupt 8.5
#define PIE_IER8_INTX6 0x20U // Enable for Interrupt 8.6
#define PIE_IER8_INTX7 0x40U // Enable for Interrupt 8.7
#define PIE_IER8_INTX8 0x80U // Enable for Interrupt 8.8
#define PIE_IER8_INTX9 0x100U // Enable for Interrupt 8.9
#define PIE_IER8_INTX10 0x200U // Enable for Interrupt 8.10
#define PIE_IER8_INTX11 0x400U // Enable for Interrupt 8.11
#define PIE_IER8_INTX12 0x800U // Enable for Interrupt 8.12
#define PIE_IER8_INTX13 0x1000U // Enable for Interrupt 8.13
#define PIE_IER8_INTX14 0x2000U // Enable for Interrupt 8.14
#define PIE_IER8_INTX15 0x4000U // Enable for Interrupt 8.15
#define PIE_IER8_INTX16 0x8000U // Enable for Interrupt 8.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR8 register
//
//*************************************************************************************************
#define PIE_IFR8_INTX1 0x1U // Flag for Interrupt 8.1
#define PIE_IFR8_INTX2 0x2U // Flag for Interrupt 8.2
#define PIE_IFR8_INTX3 0x4U // Flag for Interrupt 8.3
#define PIE_IFR8_INTX4 0x8U // Flag for Interrupt 8.4
#define PIE_IFR8_INTX5 0x10U // Flag for Interrupt 8.5
#define PIE_IFR8_INTX6 0x20U // Flag for Interrupt 8.6
#define PIE_IFR8_INTX7 0x40U // Flag for Interrupt 8.7
#define PIE_IFR8_INTX8 0x80U // Flag for Interrupt 8.8
#define PIE_IFR8_INTX9 0x100U // Flag for Interrupt 8.9
#define PIE_IFR8_INTX10 0x200U // Flag for Interrupt 8.10
#define PIE_IFR8_INTX11 0x400U // Flag for Interrupt 8.11
#define PIE_IFR8_INTX12 0x800U // Flag for Interrupt 8.12
#define PIE_IFR8_INTX13 0x1000U // Flag for Interrupt 8.13
#define PIE_IFR8_INTX14 0x2000U // Flag for Interrupt 8.14
#define PIE_IFR8_INTX15 0x4000U // Flag for Interrupt 8.15
#define PIE_IFR8_INTX16 0x8000U // Flag for Interrupt 8.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER9 register
//
//*************************************************************************************************
#define PIE_IER9_INTX1 0x1U // Enable for Interrupt 9.1
#define PIE_IER9_INTX2 0x2U // Enable for Interrupt 9.2
#define PIE_IER9_INTX3 0x4U // Enable for Interrupt 9.3
#define PIE_IER9_INTX4 0x8U // Enable for Interrupt 9.4
#define PIE_IER9_INTX5 0x10U // Enable for Interrupt 9.5
#define PIE_IER9_INTX6 0x20U // Enable for Interrupt 9.6
#define PIE_IER9_INTX7 0x40U // Enable for Interrupt 9.7
#define PIE_IER9_INTX8 0x80U // Enable for Interrupt 9.8
#define PIE_IER9_INTX9 0x100U // Enable for Interrupt 9.9
#define PIE_IER9_INTX10 0x200U // Enable for Interrupt 9.10
#define PIE_IER9_INTX11 0x400U // Enable for Interrupt 9.11
#define PIE_IER9_INTX12 0x800U // Enable for Interrupt 9.12
#define PIE_IER9_INTX13 0x1000U // Enable for Interrupt 9.13
#define PIE_IER9_INTX14 0x2000U // Enable for Interrupt 9.14
#define PIE_IER9_INTX15 0x4000U // Enable for Interrupt 9.15
#define PIE_IER9_INTX16 0x8000U // Enable for Interrupt 9.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR9 register
//
//*************************************************************************************************
#define PIE_IFR9_INTX1 0x1U // Flag for Interrupt 9.1
#define PIE_IFR9_INTX2 0x2U // Flag for Interrupt 9.2
#define PIE_IFR9_INTX3 0x4U // Flag for Interrupt 9.3
#define PIE_IFR9_INTX4 0x8U // Flag for Interrupt 9.4
#define PIE_IFR9_INTX5 0x10U // Flag for Interrupt 9.5
#define PIE_IFR9_INTX6 0x20U // Flag for Interrupt 9.6
#define PIE_IFR9_INTX7 0x40U // Flag for Interrupt 9.7
#define PIE_IFR9_INTX8 0x80U // Flag for Interrupt 9.8
#define PIE_IFR9_INTX9 0x100U // Flag for Interrupt 9.9
#define PIE_IFR9_INTX10 0x200U // Flag for Interrupt 9.10
#define PIE_IFR9_INTX11 0x400U // Flag for Interrupt 9.11
#define PIE_IFR9_INTX12 0x800U // Flag for Interrupt 9.12
#define PIE_IFR9_INTX13 0x1000U // Flag for Interrupt 9.13
#define PIE_IFR9_INTX14 0x2000U // Flag for Interrupt 9.14
#define PIE_IFR9_INTX15 0x4000U // Flag for Interrupt 9.15
#define PIE_IFR9_INTX16 0x8000U // Flag for Interrupt 9.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER10 register
//
//*************************************************************************************************
#define PIE_IER10_INTX1 0x1U // Enable for Interrupt 10.1
#define PIE_IER10_INTX2 0x2U // Enable for Interrupt 10.2
#define PIE_IER10_INTX3 0x4U // Enable for Interrupt 10.3
#define PIE_IER10_INTX4 0x8U // Enable for Interrupt 10.4
#define PIE_IER10_INTX5 0x10U // Enable for Interrupt 10.5
#define PIE_IER10_INTX6 0x20U // Enable for Interrupt 10.6
#define PIE_IER10_INTX7 0x40U // Enable for Interrupt 10.7
#define PIE_IER10_INTX8 0x80U // Enable for Interrupt 10.8
#define PIE_IER10_INTX9 0x100U // Enable for Interrupt 10.9
#define PIE_IER10_INTX10 0x200U // Enable for Interrupt 10.10
#define PIE_IER10_INTX11 0x400U // Enable for Interrupt 10.11
#define PIE_IER10_INTX12 0x800U // Enable for Interrupt 10.12
#define PIE_IER10_INTX13 0x1000U // Enable for Interrupt 10.13
#define PIE_IER10_INTX14 0x2000U // Enable for Interrupt 10.14
#define PIE_IER10_INTX15 0x4000U // Enable for Interrupt 10.15
#define PIE_IER10_INTX16 0x8000U // Enable for Interrupt 10.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR10 register
//
//*************************************************************************************************
#define PIE_IFR10_INTX1 0x1U // Flag for Interrupt 10.1
#define PIE_IFR10_INTX2 0x2U // Flag for Interrupt 10.2
#define PIE_IFR10_INTX3 0x4U // Flag for Interrupt 10.3
#define PIE_IFR10_INTX4 0x8U // Flag for Interrupt 10.4
#define PIE_IFR10_INTX5 0x10U // Flag for Interrupt 10.5
#define PIE_IFR10_INTX6 0x20U // Flag for Interrupt 10.6
#define PIE_IFR10_INTX7 0x40U // Flag for Interrupt 10.7
#define PIE_IFR10_INTX8 0x80U // Flag for Interrupt 10.8
#define PIE_IFR10_INTX9 0x100U // Flag for Interrupt 10.9
#define PIE_IFR10_INTX10 0x200U // Flag for Interrupt 10.10
#define PIE_IFR10_INTX11 0x400U // Flag for Interrupt 10.11
#define PIE_IFR10_INTX12 0x800U // Flag for Interrupt 10.12
#define PIE_IFR10_INTX13 0x1000U // Flag for Interrupt 10.13
#define PIE_IFR10_INTX14 0x2000U // Flag for Interrupt 10.14
#define PIE_IFR10_INTX15 0x4000U // Flag for Interrupt 10.15
#define PIE_IFR10_INTX16 0x8000U // Flag for Interrupt 10.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER11 register
//
//*************************************************************************************************
#define PIE_IER11_INTX1 0x1U // Enable for Interrupt 11.1
#define PIE_IER11_INTX2 0x2U // Enable for Interrupt 11.2
#define PIE_IER11_INTX3 0x4U // Enable for Interrupt 11.3
#define PIE_IER11_INTX4 0x8U // Enable for Interrupt 11.4
#define PIE_IER11_INTX5 0x10U // Enable for Interrupt 11.5
#define PIE_IER11_INTX6 0x20U // Enable for Interrupt 11.6
#define PIE_IER11_INTX7 0x40U // Enable for Interrupt 11.7
#define PIE_IER11_INTX8 0x80U // Enable for Interrupt 11.8
#define PIE_IER11_INTX9 0x100U // Enable for Interrupt 11.9
#define PIE_IER11_INTX10 0x200U // Enable for Interrupt 11.10
#define PIE_IER11_INTX11 0x400U // Enable for Interrupt 11.11
#define PIE_IER11_INTX12 0x800U // Enable for Interrupt 11.12
#define PIE_IER11_INTX13 0x1000U // Enable for Interrupt 11.13
#define PIE_IER11_INTX14 0x2000U // Enable for Interrupt 11.14
#define PIE_IER11_INTX15 0x4000U // Enable for Interrupt 11.15
#define PIE_IER11_INTX16 0x8000U // Enable for Interrupt 11.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR11 register
//
//*************************************************************************************************
#define PIE_IFR11_INTX1 0x1U // Flag for Interrupt 11.1
#define PIE_IFR11_INTX2 0x2U // Flag for Interrupt 11.2
#define PIE_IFR11_INTX3 0x4U // Flag for Interrupt 11.3
#define PIE_IFR11_INTX4 0x8U // Flag for Interrupt 11.4
#define PIE_IFR11_INTX5 0x10U // Flag for Interrupt 11.5
#define PIE_IFR11_INTX6 0x20U // Flag for Interrupt 11.6
#define PIE_IFR11_INTX7 0x40U // Flag for Interrupt 11.7
#define PIE_IFR11_INTX8 0x80U // Flag for Interrupt 11.8
#define PIE_IFR11_INTX9 0x100U // Flag for Interrupt 11.9
#define PIE_IFR11_INTX10 0x200U // Flag for Interrupt 11.10
#define PIE_IFR11_INTX11 0x400U // Flag for Interrupt 11.11
#define PIE_IFR11_INTX12 0x800U // Flag for Interrupt 11.12
#define PIE_IFR11_INTX13 0x1000U // Flag for Interrupt 11.13
#define PIE_IFR11_INTX14 0x2000U // Flag for Interrupt 11.14
#define PIE_IFR11_INTX15 0x4000U // Flag for Interrupt 11.15
#define PIE_IFR11_INTX16 0x8000U // Flag for Interrupt 11.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIER12 register
//
//*************************************************************************************************
#define PIE_IER12_INTX1 0x1U // Enable for Interrupt 12.1
#define PIE_IER12_INTX2 0x2U // Enable for Interrupt 12.2
#define PIE_IER12_INTX3 0x4U // Enable for Interrupt 12.3
#define PIE_IER12_INTX4 0x8U // Enable for Interrupt 12.4
#define PIE_IER12_INTX5 0x10U // Enable for Interrupt 12.5
#define PIE_IER12_INTX6 0x20U // Enable for Interrupt 12.6
#define PIE_IER12_INTX7 0x40U // Enable for Interrupt 12.7
#define PIE_IER12_INTX8 0x80U // Enable for Interrupt 12.8
#define PIE_IER12_INTX9 0x100U // Enable for Interrupt 12.9
#define PIE_IER12_INTX10 0x200U // Enable for Interrupt 12.10
#define PIE_IER12_INTX11 0x400U // Enable for Interrupt 12.11
#define PIE_IER12_INTX12 0x800U // Enable for Interrupt 12.12
#define PIE_IER12_INTX13 0x1000U // Enable for Interrupt 12.13
#define PIE_IER12_INTX14 0x2000U // Enable for Interrupt 12.14
#define PIE_IER12_INTX15 0x4000U // Enable for Interrupt 12.15
#define PIE_IER12_INTX16 0x8000U // Enable for Interrupt 12.16
//*************************************************************************************************
//
// The following are defines for the bit fields in the PIEIFR12 register
//
//*************************************************************************************************
#define PIE_IFR12_INTX1 0x1U // Flag for Interrupt 12.1
#define PIE_IFR12_INTX2 0x2U // Flag for Interrupt 12.2
#define PIE_IFR12_INTX3 0x4U // Flag for Interrupt 12.3
#define PIE_IFR12_INTX4 0x8U // Flag for Interrupt 12.4
#define PIE_IFR12_INTX5 0x10U // Flag for Interrupt 12.5
#define PIE_IFR12_INTX6 0x20U // Flag for Interrupt 12.6
#define PIE_IFR12_INTX7 0x40U // Flag for Interrupt 12.7
#define PIE_IFR12_INTX8 0x80U // Flag for Interrupt 12.8
#define PIE_IFR12_INTX9 0x100U // Flag for Interrupt 12.9
#define PIE_IFR12_INTX10 0x200U // Flag for Interrupt 12.10
#define PIE_IFR12_INTX11 0x400U // Flag for Interrupt 12.11
#define PIE_IFR12_INTX12 0x800U // Flag for Interrupt 12.12
#define PIE_IFR12_INTX13 0x1000U // Flag for Interrupt 12.13
#define PIE_IFR12_INTX14 0x2000U // Flag for Interrupt 12.14
#define PIE_IFR12_INTX15 0x4000U // Flag for Interrupt 12.15
#define PIE_IFR12_INTX16 0x8000U // Flag for Interrupt 12.16
#endif
@@ -0,0 +1,260 @@
//###########################################################################
//
// FILE: hw_pmbus.h
//
// TITLE: Definitions for the PMBUS 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 HW_PMBUS_H
#define HW_PMBUS_H
//*************************************************************************************************
//
// The following are defines for the PMBUS register offsets
//
//*************************************************************************************************
#define PMBUS_O_PMBMC 0x0U // PMBUS Master Mode Control Register
#define PMBUS_O_PMBTXBUF 0x2U // PMBUS Transmit Buffer
#define PMBUS_O_PMBRXBUF 0x4U // PMBUS Receive buffer
#define PMBUS_O_PMBACK 0x6U // PMBUS Acknowledge Register
#define PMBUS_O_PMBSTS 0x8U // PMBUS Status Register
#define PMBUS_O_PMBINTM 0xAU // PMBUS Interrupt Mask Register
#define PMBUS_O_PMBSC 0xCU // PMBUS Slave Mode Configuration Register
#define PMBUS_O_PMBHSA 0xEU // PMBUS Hold Slave Address Register
#define PMBUS_O_PMBCTRL 0x10U // PMBUS Control Register
#define PMBUS_O_PMBTIMCTL 0x12U // PMBUS Timing Control Register
#define PMBUS_O_PMBTIMCLK 0x14U // PMBUS Clock Timing Register
#define PMBUS_O_PMBTIMSTSETUP 0x16U // PMBUS Start Setup Time Register
#define PMBUS_O_PMBTIMBIDLE 0x18U // PMBUS Bus Idle Time Register
#define PMBUS_O_PMBTIMLOWTIMOUT 0x1AU // PMBUS Clock Low Timeout Value Register
#define PMBUS_O_PMBTIMHIGHTIMOUT 0x1CU // PMBUS Clock High Timeout Value Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBMC register
//
//*************************************************************************************************
#define PMBUS_PMBMC_RW 0x1U // RnW bit of the Message
#define PMBUS_PMBMC_SLAVE_ADDR_S 1U
#define PMBUS_PMBMC_SLAVE_ADDR_M 0xFEU // Slave Address
#define PMBUS_PMBMC_BYTE_COUNT_S 8U
#define PMBUS_PMBMC_BYTE_COUNT_M 0xFF00U // Number of Bytes Transmitted
#define PMBUS_PMBMC_CMD_ENA 0x10000U // Master Command Code Enable
#define PMBUS_PMBMC_EXT_CMD 0x20000U // Master Extended Command Code Enable
#define PMBUS_PMBMC_PEC_ENA 0x40000U // Master PEC Processing Enable
#define PMBUS_PMBMC_GRP_CMD 0x80000U // Master Group Command Message Enable
#define PMBUS_PMBMC_PRC_CALL 0x100000U // Master Process Call Message Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBACK register
//
//*************************************************************************************************
#define PMBUS_PMBACK_ACK 0x1U // Allows firmware to ack/nack received data
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBSTS register
//
//*************************************************************************************************
#define PMBUS_PMBSTS_RD_BYTE_COUNT_S 0U
#define PMBUS_PMBSTS_RD_BYTE_COUNT_M 0x7U // Number of Data Bytes available in Receive
// Data Register
#define PMBUS_PMBSTS_DATA_READY 0x8U // Data Ready Flag
#define PMBUS_PMBSTS_DATA_REQUEST 0x10U // Data Request Flag
#define PMBUS_PMBSTS_EOM 0x20U // End of Message Indicator
#define PMBUS_PMBSTS_NACK 0x40U // Not Acknowledge Flag Status
#define PMBUS_PMBSTS_PEC_VALID 0x80U // PEC Valid Indicator
#define PMBUS_PMBSTS_CLK_LOW_TIMEOUT 0x100U // Clock Low Timeout Status
#define PMBUS_PMBSTS_CLK_HIGH_DETECTED 0x200U // Clock High Detection Status
#define PMBUS_PMBSTS_SLAVE_ADDR_READY 0x400U // Slave Address Ready
#define PMBUS_PMBSTS_RPT_START 0x800U // Repeated Start Flag
#define PMBUS_PMBSTS_UNIT_BUSY 0x1000U // PMBus Busy Indicator
#define PMBUS_PMBSTS_BUS_FREE 0x2000U // PMBus Free Indicator
#define PMBUS_PMBSTS_LOST_ARB 0x4000U // Lost Arbitration Flag
#define PMBUS_PMBSTS_MASTER 0x8000U // Master Indicator
#define PMBUS_PMBSTS_ALERT_EDGE 0x10000U // Alert Edge Detection Status
#define PMBUS_PMBSTS_CONTROL_EDGE 0x20000U // Control Edge Detection Status
#define PMBUS_PMBSTS_ALERT_RAW 0x40000U // Alert Pin Real Time Status
#define PMBUS_PMBSTS_CONTROL_RAW 0x80000U // Control Pin Real Time Status
#define PMBUS_PMBSTS_SDA_RAW 0x100000U // PMBus Data Pin Real Time Status
#define PMBUS_PMBSTS_SCL_RAW 0x200000U // PMBus Clock Pin Real Time Status
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBINTM register
//
//*************************************************************************************************
#define PMBUS_PMBINTM_BUS_FREE 0x1U // Bus Free Interrupt Mask
#define PMBUS_PMBINTM_BUS_LOW_TIMEOUT 0x2U // Clock Low Timeout Interrupt Mask
#define PMBUS_PMBINTM_DATA_READY 0x4U // Data Ready Interrupt Mask
#define PMBUS_PMBINTM_DATA_REQUEST 0x8U // Data Request Interrupt Mask
#define PMBUS_PMBINTM_SLAVE_ADDR_READY 0x10U // Slave Address Ready Interrupt Mask
#define PMBUS_PMBINTM_EOM 0x20U // End of Message Interrupt Mask
#define PMBUS_PMBINTM_ALERT 0x40U // Alert Detection Interrupt Mask
#define PMBUS_PMBINTM_CONTROL 0x80U // Control Detection Interrupt Mask
#define PMBUS_PMBINTM_LOST_ARB 0x100U // Lost Arbitration Interrupt Mask
#define PMBUS_PMBINTM_CLK_HIGH_DETECT 0x200U // Clock High Detection Interrupt Mask
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBSC register
//
//*************************************************************************************************
#define PMBUS_PMBSC_SLAVE_ADDR_S 0U
#define PMBUS_PMBSC_SLAVE_ADDR_M 0x7FU // Configures the current device address of the
// slave.
#define PMBUS_PMBSC_MAN_SLAVE_ACK 0x80U // Manual Slave Address Acknowledgement Mode
#define PMBUS_PMBSC_SLAVE_MASK_S 8U
#define PMBUS_PMBSC_SLAVE_MASK_M 0x7F00U // Slave address mask
#define PMBUS_PMBSC_PEC_ENA 0x8000U // PEC Processing Enable
#define PMBUS_PMBSC_TX_COUNT_S 16U
#define PMBUS_PMBSC_TX_COUNT_M 0x70000U // Number of valid bytes in Transmit Data
// Register
#define PMBUS_PMBSC_TX_PEC 0x80000U // send a PEC byte at end of message
#define PMBUS_PMBSC_MAN_CMD 0x100000U // Manual Command Acknowledgement Mode
#define PMBUS_PMBSC_RX_BYTE_ACK_CNT_S 21U
#define PMBUS_PMBSC_RX_BYTE_ACK_CNT_M 0x600000U // Number of data bytes to automatically
// acknowledge
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBHSA register
//
//*************************************************************************************************
#define PMBUS_PMBHSA_SLAVE_RW 0x1U // Stored R/W bit
#define PMBUS_PMBHSA_SLAVE_ADDR_S 1U
#define PMBUS_PMBHSA_SLAVE_ADDR_M 0xFEU // Stored device address
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBCTRL register
//
//*************************************************************************************************
#define PMBUS_PMBCTRL_RESET 0x1U // PMBus Interface Synchronous Reset
#define PMBUS_PMBCTRL_ALERT_EN 0x2U // Slave Alert Enable
#define PMBUS_PMBCTRL_BUS_LO_INT_EDGE 0x4U // Clock Low Timeout Interrupt Edge Select
#define PMBUS_PMBCTRL_FAST_MODE 0x8U // Fast Mode Enable
#define PMBUS_PMBCTRL_CNTL_INT_EDGE 0x20U // Control Interrupt Edge Select
#define PMBUS_PMBCTRL_ALERT_MODE 0x40U // Configures mode of Alert pin
#define PMBUS_PMBCTRL_ALERT_VALUE 0x80U // Configures output value of Alert pin in
// GPIO Mode
#define PMBUS_PMBCTRL_ALERT_DIR 0x100U // Configures direction of Alert pin in GPIO
// mode
#define PMBUS_PMBCTRL_CNTL_MODE 0x200U // Configures mode of Control pin
#define PMBUS_PMBCTRL_CNTL_VALUE 0x400U // Configures output value of Control pin in
// GPIO Mode
#define PMBUS_PMBCTRL_CNTL_DIR 0x800U // Configures direction of Control pin in
// GPIO mode
#define PMBUS_PMBCTRL_SDA_MODE 0x1000U // Configures mode of PMBus Data pin
#define PMBUS_PMBCTRL_SDA_VALUE 0x2000U // Configures output value of PMBus data pin
// in GPIO Mode
#define PMBUS_PMBCTRL_SDA_DIR 0x4000U // Configures direction of PMBus data pin in
// GPIO mode
#define PMBUS_PMBCTRL_SCL_MODE 0x8000U // Configures mode of PMBus Clock pin
#define PMBUS_PMBCTRL_SCL_VALUE 0x10000U // Configures output value of PMBus clock pin
// in GPIO Mode
#define PMBUS_PMBCTRL_SCL_DIR 0x20000U // Configures direction of PMBus clock pin in
// GPIO mode
#define PMBUS_PMBCTRL_IBIAS_A_EN 0x40000U // PMBus Current Source A Control
#define PMBUS_PMBCTRL_IBIAS_B_EN 0x80000U // PMBus Current Source B Control
#define PMBUS_PMBCTRL_CLK_LO_DIS 0x100000U // Clock Low Timeout Disable
#define PMBUS_PMBCTRL_SLAVE_EN 0x200000U // PMBus Slave Enable
#define PMBUS_PMBCTRL_MASTER_EN 0x400000U // PMBus Master Enable
#define PMBUS_PMBCTRL_CLKDIV_S 23U
#define PMBUS_PMBCTRL_CLKDIV_M 0xF800000U // PMBUS Clock Divide Value
#define PMBUS_PMBCTRL_I2CMODE 0x80000000U // Bit to enable I2C mode
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBTIMCTL register
//
//*************************************************************************************************
#define PMBUS_PMBTIMCTL_TIM_OVERRIDE 0x1U // Overide the default settings of the timing
// parameters.
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBTIMCLK register
//
//*************************************************************************************************
#define PMBUS_PMBTIMCLK_CLK_HIGH_LIMIT_S 0U
#define PMBUS_PMBTIMCLK_CLK_HIGH_LIMIT_M 0xFFU // Determines the PMBUS master clock high
// pulse width.
#define PMBUS_PMBTIMCLK_CLK_FREQ_S 16U
#define PMBUS_PMBTIMCLK_CLK_FREQ_M 0xFF0000U // Determines the PMBUS master clock
// frequency.
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBTIMSTSETUP register
//
//*************************************************************************************************
#define PMBUS_PMBTIMSTSETUP_TSU_STA_S 0U
#define PMBUS_PMBTIMSTSETUP_TSU_STA_M 0xFFU // Setup time, rise edge of PMBUS master clock to
// start edge.
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBTIMBIDLE register
//
//*************************************************************************************************
#define PMBUS_PMBTIMBIDLE_BUSIDLE_S 0U
#define PMBUS_PMBTIMBIDLE_BUSIDLE_M 0x3FFU // Determines the Bus Idle Limit
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBTIMLOWTIMOUT register
//
//*************************************************************************************************
#define PMBUS_PMBTIMLOWTIMOUT_CLKLOWTIMOUT_S 0U
#define PMBUS_PMBTIMLOWTIMOUT_CLKLOWTIMOUT_M 0xFFFFFU // Determines the clock low timeout value
//*************************************************************************************************
//
// The following are defines for the bit fields in the PMBTIMHIGHTIMOUT register
//
//*************************************************************************************************
#define PMBUS_PMBTIMHIGHTIMOUT_CLKHIGHTIMOUT_S 0U
#define PMBUS_PMBTIMHIGHTIMOUT_CLKHIGHTIMOUT_M 0x3FFU // Determines the clock high timeout
// value
#endif
@@ -0,0 +1,209 @@
//###########################################################################
//
// FILE: hw_sci.h
//
// TITLE: Definitions for the SCI 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 HW_SCI_H
#define HW_SCI_H
//*************************************************************************************************
//
// The following are defines for the SCI register offsets
//
//*************************************************************************************************
#define SCI_O_CCR 0x0U // Communications control register
#define SCI_O_CTL1 0x1U // Control register 1
#define SCI_O_HBAUD 0x2U // Baud rate (high) register
#define SCI_O_LBAUD 0x3U // Baud rate (low) register
#define SCI_O_CTL2 0x4U // Control register 2
#define SCI_O_RXST 0x5U // Receive status register
#define SCI_O_RXEMU 0x6U // Receive emulation buffer register
#define SCI_O_RXBUF 0x7U // Receive data buffer
#define SCI_O_TXBUF 0x9U // Transmit data buffer
#define SCI_O_FFTX 0xAU // FIFO transmit register
#define SCI_O_FFRX 0xBU // FIFO receive register
#define SCI_O_FFCT 0xCU // FIFO control register
#define SCI_O_PRI 0xFU // SCI priority control
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCICCR register
//
//*************************************************************************************************
#define SCI_CCR_SCICHAR_S 0U
#define SCI_CCR_SCICHAR_M 0x7U // Character length control
#define SCI_CCR_ADDRIDLE_MODE 0x8U // ADDR/IDLE Mode control
#define SCI_CCR_LOOPBKENA 0x10U // Loop Back enable
#define SCI_CCR_PARITYENA 0x20U // Parity enable
#define SCI_CCR_PARITY 0x40U // Even or Odd Parity
#define SCI_CCR_STOPBITS 0x80U // Number of Stop Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCICTL1 register
//
//*************************************************************************************************
#define SCI_CTL1_RXENA 0x1U // SCI receiver enable
#define SCI_CTL1_TXENA 0x2U // SCI transmitter enable
#define SCI_CTL1_SLEEP 0x4U // SCI sleep
#define SCI_CTL1_TXWAKE 0x8U // Transmitter wakeup method
#define SCI_CTL1_SWRESET 0x20U // Software reset
#define SCI_CTL1_RXERRINTENA 0x40U // Receive error interrupt enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCIHBAUD register
//
//*************************************************************************************************
#define SCI_HBAUD_BAUD_S 0U
#define SCI_HBAUD_BAUD_M 0xFFU // SCI 16-bit baud selection Registers SCIHBAUD
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCILBAUD register
//
//*************************************************************************************************
#define SCI_LBAUD_BAUD_S 0U
#define SCI_LBAUD_BAUD_M 0xFFU // SCI 16-bit baud selection Registers SCILBAUD
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCICTL2 register
//
//*************************************************************************************************
#define SCI_CTL2_TXINTENA 0x1U // Transmit __interrupt enable
#define SCI_CTL2_RXBKINTENA 0x2U // Receiver-buffer break enable
#define SCI_CTL2_TXEMPTY 0x40U // Transmitter empty flag
#define SCI_CTL2_TXRDY 0x80U // Transmitter ready flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCIRXST register
//
//*************************************************************************************************
#define SCI_RXST_RXWAKE 0x2U // Receiver wakeup detect flag
#define SCI_RXST_PE 0x4U // Parity error flag
#define SCI_RXST_OE 0x8U // Overrun error flag
#define SCI_RXST_FE 0x10U // Framing error flag
#define SCI_RXST_BRKDT 0x20U // Break-detect flag
#define SCI_RXST_RXRDY 0x40U // Receiver ready flag
#define SCI_RXST_RXERROR 0x80U // Receiver error flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCIRXEMU register
//
//*************************************************************************************************
#define SCI_RXEMU_ERXDT_S 0U
#define SCI_RXEMU_ERXDT_M 0xFFU // Receive emulation buffer data
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCIRXBUF register
//
//*************************************************************************************************
#define SCI_RXBUF_SAR_S 0U
#define SCI_RXBUF_SAR_M 0xFFU // Receive Character bits
#define SCI_RXBUF_SCIFFPE 0x4000U // Receiver error flag
#define SCI_RXBUF_SCIFFFE 0x8000U // Receiver error flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCITXBUF register
//
//*************************************************************************************************
#define SCI_TXBUF_TXDT_S 0U
#define SCI_TXBUF_TXDT_M 0xFFU // Transmit data buffer
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCIFFTX register
//
//*************************************************************************************************
#define SCI_FFTX_TXFFIL_S 0U
#define SCI_FFTX_TXFFIL_M 0x1FU // Interrupt level
#define SCI_FFTX_TXFFIENA 0x20U // Interrupt enable
#define SCI_FFTX_TXFFINTCLR 0x40U // Clear INT flag
#define SCI_FFTX_TXFFINT 0x80U // INT flag
#define SCI_FFTX_TXFFST_S 8U
#define SCI_FFTX_TXFFST_M 0x1F00U // FIFO status
#define SCI_FFTX_TXFIFORESET 0x2000U // FIFO reset
#define SCI_FFTX_SCIFFENA 0x4000U // Enhancement enable
#define SCI_FFTX_SCIRST 0x8000U // SCI reset rx/tx channels
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCIFFRX register
//
//*************************************************************************************************
#define SCI_FFRX_RXFFIL_S 0U
#define SCI_FFRX_RXFFIL_M 0x1FU // Interrupt level
#define SCI_FFRX_RXFFIENA 0x20U // Interrupt enable
#define SCI_FFRX_RXFFINTCLR 0x40U // Clear INT flag
#define SCI_FFRX_RXFFINT 0x80U // INT flag
#define SCI_FFRX_RXFFST_S 8U
#define SCI_FFRX_RXFFST_M 0x1F00U // FIFO status
#define SCI_FFRX_RXFIFORESET 0x2000U // FIFO reset
#define SCI_FFRX_RXFFOVRCLR 0x4000U // Clear overflow
#define SCI_FFRX_RXFFOVF 0x8000U // FIFO overflow
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCIFFCT register
//
//*************************************************************************************************
#define SCI_FFCT_FFTXDLY_S 0U
#define SCI_FFCT_FFTXDLY_M 0xFFU // FIFO transmit delay
#define SCI_FFCT_CDC 0x2000U // Auto baud mode enable
#define SCI_FFCT_ABDCLR 0x4000U // Auto baud clear
#define SCI_FFCT_ABD 0x8000U // Auto baud detect
//*************************************************************************************************
//
// The following are defines for the bit fields in the SCIPRI register
//
//*************************************************************************************************
#define SCI_PRI_FREESOFT_S 3U
#define SCI_PRI_FREESOFT_M 0x18U // Emulation modes
#endif
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,157 @@
//###########################################################################
//
// FILE: hw_spi.h
//
// TITLE: Definitions for the SPI 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 HW_SPI_H
#define HW_SPI_H
//*************************************************************************************************
//
// The following are defines for the SPI register offsets
//
//*************************************************************************************************
#define SPI_O_CCR 0x0U // SPI Configuration Control Register
#define SPI_O_CTL 0x1U // SPI Operation Control Register
#define SPI_O_STS 0x2U // SPI Status Register
#define SPI_O_BRR 0x4U // SPI Baud Rate Register
#define SPI_O_RXEMU 0x6U // SPI Emulation Buffer Register
#define SPI_O_RXBUF 0x7U // SPI Serial Input Buffer Register
#define SPI_O_TXBUF 0x8U // SPI Serial Output Buffer Register
#define SPI_O_DAT 0x9U // SPI Serial Data Register
#define SPI_O_FFTX 0xAU // SPI FIFO Transmit Register
#define SPI_O_FFRX 0xBU // SPI FIFO Receive Register
#define SPI_O_FFCT 0xCU // SPI FIFO Control Register
#define SPI_O_PRI 0xFU // SPI Priority Control Register
//*************************************************************************************************
//
// The following are defines for the bit fields in the SPICCR register
//
//*************************************************************************************************
#define SPI_CCR_SPICHAR_S 0U
#define SPI_CCR_SPICHAR_M 0xFU // Character Length Control
#define SPI_CCR_SPILBK 0x10U // SPI Loopback
#define SPI_CCR_HS_MODE 0x20U // High Speed mode control
#define SPI_CCR_CLKPOLARITY 0x40U // Shift Clock Polarity
#define SPI_CCR_SPISWRESET 0x80U // SPI Software Reset
//*************************************************************************************************
//
// The following are defines for the bit fields in the SPICTL register
//
//*************************************************************************************************
#define SPI_CTL_SPIINTENA 0x1U // SPI Interupt Enable
#define SPI_CTL_TALK 0x2U // Master/Slave Transmit Enable
#define SPI_CTL_MASTER_SLAVE 0x4U // SPI Network Mode Control
#define SPI_CTL_CLK_PHASE 0x8U // SPI Clock Phase
#define SPI_CTL_OVERRUNINTENA 0x10U // Overrun Interrupt Enable
//*************************************************************************************************
//
// The following are defines for the bit fields in the SPISTS register
//
//*************************************************************************************************
#define SPI_STS_BUFFULL_FLAG 0x20U // SPI Transmit Buffer Full Flag
#define SPI_STS_INT_FLAG 0x40U // SPI Interrupt Flag
#define SPI_STS_OVERRUN_FLAG 0x80U // SPI Receiver Overrun Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the SPIBRR register
//
//*************************************************************************************************
#define SPI_BRR_SPI_BIT_RATE_S 0U
#define SPI_BRR_SPI_BIT_RATE_M 0x7FU // SPI Bit Rate Control
//*************************************************************************************************
//
// The following are defines for the bit fields in the SPIFFTX register
//
//*************************************************************************************************
#define SPI_FFTX_TXFFIL_S 0U
#define SPI_FFTX_TXFFIL_M 0x1FU // TXFIFO Interrupt Level
#define SPI_FFTX_TXFFIENA 0x20U // TXFIFO Interrupt Enable
#define SPI_FFTX_TXFFINTCLR 0x40U // TXFIFO Interrupt Clear
#define SPI_FFTX_TXFFINT 0x80U // TXFIFO Interrupt Flag
#define SPI_FFTX_TXFFST_S 8U
#define SPI_FFTX_TXFFST_M 0x1F00U // Transmit FIFO Status
#define SPI_FFTX_TXFIFO 0x2000U // TXFIFO Reset
#define SPI_FFTX_SPIFFENA 0x4000U // FIFO Enhancements Enable
#define SPI_FFTX_SPIRST 0x8000U // SPI Reset
//*************************************************************************************************
//
// The following are defines for the bit fields in the SPIFFRX register
//
//*************************************************************************************************
#define SPI_FFRX_RXFFIL_S 0U
#define SPI_FFRX_RXFFIL_M 0x1FU // RXFIFO Interrupt Level
#define SPI_FFRX_RXFFIENA 0x20U // RXFIFO Interrupt Enable
#define SPI_FFRX_RXFFINTCLR 0x40U // RXFIFO Interupt Clear
#define SPI_FFRX_RXFFINT 0x80U // RXFIFO Interrupt Flag
#define SPI_FFRX_RXFFST_S 8U
#define SPI_FFRX_RXFFST_M 0x1F00U // Receive FIFO Status
#define SPI_FFRX_RXFIFORESET 0x2000U // RXFIFO Reset
#define SPI_FFRX_RXFFOVFCLR 0x4000U // Receive FIFO Overflow Clear
#define SPI_FFRX_RXFFOVF 0x8000U // Receive FIFO Overflow Flag
//*************************************************************************************************
//
// The following are defines for the bit fields in the SPIFFCT register
//
//*************************************************************************************************
#define SPI_FFCT_TXDLY_S 0U
#define SPI_FFCT_TXDLY_M 0xFFU // FIFO Transmit Delay Bits
//*************************************************************************************************
//
// The following are defines for the bit fields in the SPIPRI register
//
//*************************************************************************************************
#define SPI_PRI_TRIWIRE 0x1U // 3-wire mode select bit
#define SPI_PRI_STEINV 0x2U // SPISTE inversion bit
#define SPI_PRI_FREE 0x10U // Free emulation mode
#define SPI_PRI_SOFT 0x20U // Soft emulation mode
#endif
File diff suppressed because it is too large. Load diff
Loaded 100 of 14950 files, more files were not shown because too many files have changed in this diff. Show more