Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*!
- \file v_data_log.c
- \brief 4-х канальный логгер длЯ осциллографированиЯ в реальном времени TDataLog (см. TDataLog)
- \author Коллектив ООО НПФ Вектор
- \version v 2.01 18/09/2012
- */
- /** \addtogroup v_data_log */
- /*@{*/
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_Device.h
- //
- // TITLE: DSP28 Device Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 24 May 2002 | L.H. | Added generic BIT# #define statements
- // 0.58| 29 Jun 2002 | L.H. | Added define for CPU Clock Speed and
- // | | | microsecond delay calculation
- //###########################################################################
- //---------------------------------------------------------------------------
- // User To Select Target Device:
- //---------------------------------------------------------------------------
- // Used for calculating delays in micro-seconds:
- //
- //---------------------------------------------------------------------------
- // Common CPU Definitions:
- //
- extern cregister volatile unsigned int IFR;
- extern cregister volatile unsigned int IER;
- //---------------------------------------------------------------------------
- // For Portability, User Is Recommended To Use Following Data Type Size
- // Definitions For 16-bit and 32-Bit Signed/Unsigned Integers:
- //
- typedef int int16;
- typedef long int32;
- typedef unsigned int Uint16;
- typedef unsigned long Uint32;
- //---------------------------------------------------------------------------
- // Include All Peripheral Header Files:
- //
- extern "C" {
- extern void DSP28x_usDelay(unsigned long Count);
- //###########################################################################
- //
- // FILE: Example.h
- //
- // TITLE: Example program definition file
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | No change
- //###########################################################################
- /*---- shared global function prototypes -----------------------------------*/
- extern void InitAdc(void);
- extern void InitDevEmu(void);
- extern void InitDevice(void);
- extern void InitECan(void);
- extern void InitEv(void);
- extern void InitGpio(void);
- extern void InitMcbsp(void);
- extern void InitPieCtrl(void);
- extern void InitPieVectTable(void);
- extern void InitSci(void);
- extern void InitSpi(void);
- extern void InitSysCtrl(void);
- extern void InitXintf(void);
- extern void InitXIntrupt(void);
- // CAUTION
- // This function MUST be executed out of RAM. Executing it
- // out of OTP/Flash will yield unpredictable results
- extern void InitFlash(void);
- extern void KickDog(void);
- extern void DisableWD(void);
- // .c files.
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_SysCtrl.h
- //
- // TITLE: DSP28 Device System Control Register Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | No change
- // 0.59| 14 Oct 2002 | L.H. | Added bit definitions for the PLLCR Register,
- // | | | Low power mode LPMCR0 and LPMCR1 registers
- // | | | Added the WDINTS bit to the SCSR register
- //###########################################################################
- //---------------------------------------------------------------------------
- // System Control Individual Register Bit Definitions:
- //
- // High speed peripheral clock register bit definitions:
- struct HISPCP_BITS { // bits description
- Uint16 HSPCLK:3; // 2:0 Rate relative to SYSCLKOUT
- Uint16 rsvd1:13; // 15:3 reserved
- };
- union HISPCP_REG {
- Uint16 all;
- struct HISPCP_BITS bit;
- };
- // Low speed peripheral clock register bit definitions:
- struct LOSPCP_BITS { // bits description
- Uint16 LSPCLK:3; // 2:0 Rate relative to SYSCLKOUT
- Uint16 rsvd1:13; // 15:3 reserved
- };
- union LOSPCP_REG {
- Uint16 all;
- struct LOSPCP_BITS bit;
- };
- // Peripheral clock control register bit definitions:
- struct PCLKCR_BITS { // bits description
- Uint16 EVAENCLK:1; // 0 Enable high speed clk to EV-A
- Uint16 EVBENCLK:1; // 1 Enable high speed clk to EV-B
- Uint16 rsvd1:1; // 2
- Uint16 ADCENCLK:1; // 3 Enable high speed clk to ADC
- Uint16 rsvd2:4; // 7:4 reserved
- Uint16 SPIENCLK:1; // 8 Enable low speed clk to SPI
- Uint16 rsvd3:1; // 9 reserved
- Uint16 SCIENCLKA:1; // 10 Enable low speed clk to SCI-A
- Uint16 SCIENCLKB:1; // 11 Enable low speed clk to SCI-B
- Uint16 MCBSPENCLK:1; // 12 Enable low speed clk to McBSP
- Uint16 rsvd4:1; // 13 reserved
- Uint16 ECANENCLK:1; // 14 Enable system clk to eCAN
- };
- union PCLKCR_REG {
- Uint16 all;
- struct PCLKCR_BITS bit;
- };
- // System control and status register bit definitions:
- struct SCSR_BITS { // bits description
- Uint16 WDOVERRIDE:1; // 0 Allow watchdog disable
- Uint16 WDENINT:1; // 1 Enable/disable WD interrupt
- Uint16 WDINTS:1; // 2 WD interrupt status bit
- Uint16 rsvd1:13; // 15:3 reserved
- };
- union SCSR_REG {
- Uint16 all;
- struct SCSR_BITS bit;
- };
- // PLL control register bit definitions:
- struct PLLCR_BITS { // bits description
- Uint16 DIV:4; // 3:0 Set clock ratio for the PLL
- Uint16 rsvd1:12; // 15:4 reserved
- };
- union PLLCR_REG {
- Uint16 all;
- struct PLLCR_BITS bit;
- };
- // Low Power Mode 0 control register bit definitions:
- struct LPMCR0_BITS { // bits description
- Uint16 LPM:2; // 1:0 Set the low power mode
- Uint16 QUALSTDBY:6; // 7:2 Qualification
- Uint16 rsvd1:8; // 15:8 reserved
- };
- union LPMCR0_REG {
- Uint16 all;
- struct LPMCR0_BITS bit;
- };
- // Low Power Mode 1 control register bit definitions:
- struct LPMCR1_BITS { // bits description
- Uint16 XINT1:1; // 0
- Uint16 XNMI:1; // 1
- Uint16 WDINT:1; // 2
- Uint16 T1CTRIP:1; // 3
- Uint16 T2CTRIP:1; // 4
- Uint16 T3CTRIP:1; // 5
- Uint16 T4CTRIP:1; // 6
- Uint16 C1TRIP:1; // 7
- Uint16 C2TRIP:1; // 8
- Uint16 C3TRIP:1; // 9
- Uint16 C4TRIP:1; // 10
- Uint16 C5TRIP:1; // 11
- Uint16 C6TRIP:1; // 12
- Uint16 SCIRXA:1; // 13
- Uint16 SCIRXB:1; // 14
- Uint16 CANRX:1; // 15
- };
- union LPMCR1_REG {
- Uint16 all;
- struct LPMCR1_BITS bit;
- };
- //---------------------------------------------------------------------------
- // System Control Register File:
- //
- struct SYS_CTRL_REGS {
- Uint16 rsvd1[10]; // 0-9
- union HISPCP_REG HISPCP; // 10: High-speed peripheral clock pre-scaler
- union LOSPCP_REG LOSPCP; // 11: Low-speed peripheral clock pre-scaler
- union PCLKCR_REG PCLKCR; // 12: Peripheral clock control register
- Uint16 rsvd2; // 13
- union LPMCR0_REG LPMCR0; // 14: Low-power mode control register 0
- union LPMCR1_REG LPMCR1; // 15: Low-power mode control register 1
- Uint16 rsvd3; // 16
- union PLLCR_REG PLLCR; // 17: PLL control register
- union SCSR_REG SCSR; // 18: System control and status register
- Uint16 WDCNTR; // 19: WD counter register
- Uint16 rsvd4; // 20
- Uint16 WDKEY; // 21: WD reset key register
- Uint16 rsvd5[3]; // 22-24
- // No bit definitions are defined for WDCR because
- // the proper value must be written to the WDCHK field
- // whenever writing to this register.
- Uint16 WDCR; // 25: WD timer control register
- Uint16 rsvd6[6]; // 26-31
- };
- /* --------------------------------------------------- */
- /* CSM Registers */
- /* */
- /* ----------------------------------------------------*/
- /* CSM Status & Control register bit definitions */
- struct CSMSCR_BITS { // bit description
- Uint16 SECURE:1; // 0 Secure flag
- Uint16 rsvd1:14; // 14-1 reserved
- Uint16 FORCESEC:1; // 15 Force Secure control bit
- };
- /* Allow access to the bit fields or entire register */
- union CSMSCR_REG {
- Uint16 all;
- struct CSMSCR_BITS bit;
- };
- /* CSM Register File */
- struct CSM_REGS {
- Uint16 KEY0; // KEY reg bits 15-0
- Uint16 KEY1; // KEY reg bits 31-16
- Uint16 KEY2; // KEY reg bits 47-32
- Uint16 KEY3; // KEY reg bits 63-48
- Uint16 KEY4; // KEY reg bits 79-64
- Uint16 KEY5; // KEY reg bits 95-80
- Uint16 KEY6; // KEY reg bits 111-96
- Uint16 KEY7; // KEY reg bits 127-112
- Uint16 rsvd1; // reserved
- Uint16 rsvd2; // reserved
- Uint16 rsvd3; // reserved
- Uint16 rsvd4; // reserved
- Uint16 rsvd5; // reserved
- Uint16 rsvd6; // reserved
- Uint16 rsvd7; // reserved
- union CSMSCR_REG CSMSCR; // CSM Status & Control register
- };
- /* Password locations */
- struct CSM_PWL {
- Uint16 PSWD0; // PSWD bits 15-0
- Uint16 PSWD1; // PSWD bits 31-16
- Uint16 PSWD2; // PSWD bits 47-32
- Uint16 PSWD3; // PSWD bits 63-48
- Uint16 PSWD4; // PSWD bits 79-64
- Uint16 PSWD5; // PSWD bits 95-80
- Uint16 PSWD6; // PSWD bits 111-96
- Uint16 PSWD7; // PSWD bits 127-112
- };
- /* Flash Registers */
- /* Flash Option Register bit definitions */
- struct FOPT_BITS { // bit description
- Uint16 ENPIPE:1; // 0 Enable Pipeline Mode
- Uint16 rsvd:15; // 1-15 reserved
- };
- /* Allow access to the bit fields or entire register */
- union FOPT_REG {
- Uint16 all;
- struct FOPT_BITS bit;
- };
- /* Flash Power Modes Register bit definitions */
- struct FPWR_BITS { // bit description
- Uint16 PWR:2; // 0-1 Power Mode bits
- Uint16 rsvd:14; // 2-15 reserved
- };
- /* Allow access to the bit fields or entire register */
- union FPWR_REG {
- Uint16 all;
- struct FPWR_BITS bit;
- };
- /* Flash Status Register bit definitions */
- struct FSTATUS_BITS { // bit description
- Uint16 PWRS:2; // 0-1 Power Mode Status bits
- Uint16 STDBYWAITS:1; // 2 Bank/Pump Sleep to Standby Wait Counter Status bits
- Uint16 ACTIVEWAITS:1; // 3 Bank/Pump Standby to Active Wait Counter Status bits
- Uint16 rsvd1:4; // 4-7 reserved
- Uint16 V3STAT:1; // 8 VDD3V Status Latch bit
- Uint16 rsvd2:7; // 9-15 reserved
- };
- /* Allow access to the bit fields or entire register */
- union FSTATUS_REG {
- Uint16 all;
- struct FSTATUS_BITS bit;
- };
- /* Flash Sleep to Standby Wait Counter Register bit definitions */
- struct FSTDBYWAIT_BITS { // bit description
- Uint16 STDBYWAIT:8; // 0-7 Bank/Pump Sleep to Standby Wait Count bits
- Uint16 rsvd:8; // 8-15 reserved
- };
- /* Allow access to the bit fields or entire register */
- union FSTDBYWAIT_REG {
- Uint16 all;
- struct FSTDBYWAIT_BITS bit;
- };
- /* Flash Standby to Active Wait Counter Register bit definitions */
- struct FACTIVEWAIT_BITS { // bit description
- Uint16 ACTIVEWAIT:8; // 0-7 Bank/Pump Standby to Active Wait Count bits
- Uint16 rsvd:8; // 8-15 reserved
- };
- /* Allow access to the bit fields or entire register */
- union FACTIVEWAIT_REG {
- Uint16 all;
- struct FACTIVEWAIT_BITS bit;
- };
- /* Bank Read Access Wait State Register bit definitions */
- struct FBANKWAIT_BITS { // bit description
- Uint16 RANDWAIT:4; // 0-3 Flash Random Read Wait State bits
- Uint16 rsvd1:4; // 4-7 reserved
- Uint16 PAGEWAIT:4; // 8-11 Flash Paged Read Wait State bits
- Uint16 rsvd2:4; // 12-15 reserved
- };
- /* Allow access to the bit fields or entire register */
- union FBANKWAIT_REG {
- Uint16 all;
- struct FBANKWAIT_BITS bit;
- };
- /* OTP Read Access Wait State Register bit definitions */
- struct FOTPWAIT_BITS { // bit description
- Uint16 OPTWAIT:5; // 0-4 OTP Read Wait State bits
- Uint16 rsvd:11; // 5-15 reserved
- };
- /* Allow access to the bit fields or entire register */
- union FOTPWAIT_REG {
- Uint16 all;
- struct FOTPWAIT_BITS bit;
- };
- struct FLASH_REGS {
- union FOPT_REG FOPT; // Option Register
- Uint16 rsvd1; // reserved
- union FPWR_REG FPWR; // Power Modes Register
- union FSTATUS_REG FSTATUS; // Status Register
- union FSTDBYWAIT_REG FSTDBYWAIT; // Pump/Bank Sleep to Standby Wait State Register
- union FACTIVEWAIT_REG FACTIVEWAIT; // Pump/Bank Standby to Active Wait State Register
- union FBANKWAIT_REG FBANKWAIT; // Bank Read Access Wait State Register
- union FOTPWAIT_REG FOTPWAIT; // OTP Read Access Wait State Register
- };
- //---------------------------------------------------------------------------
- // System Control External References & Function Declarations:
- //
- extern volatile struct SYS_CTRL_REGS SysCtrlRegs;
- extern volatile struct CSM_REGS CsmRegs;
- extern volatile struct CSM_PWL CsmPwl;
- extern volatile struct FLASH_REGS FlashRegs;
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_DevEmu.h
- //
- // TITLE: DSP28 Device Emulation Register Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | No change
- //###########################################################################
- //---------------------------------------------------------------------------
- // Device Emulation Register Bit Definitions:
- //
- // Device Configuration Register Bit Definitions
- struct DEVICECNF_BITS { // bits description
- Uint16 rsvd1:3; // 2:0 reserved
- Uint16 VMAPS:1; // 3 VMAP Status
- Uint16 rsvd2:1; // 4 reserved
- Uint16 XRSn:1; // 5 XRSn Signal Status
- Uint16 rsvd3:10; // 15:6
- Uint16 rsvd4:3; // 18:6
- Uint16 ENPROT:1; // 19 Enable/Disable pipeline protection
- Uint16 rsvd5:12; // 31:20 reserved
- };
- union DEVICECNF_REG {
- Uint32 all;
- struct DEVICECNF_BITS bit;
- };
- // Device ID Register Bit Definitions
- struct DEVICEID_BITS { // bits description
- Uint16 PARTID:16; // 15:0 Part ID
- Uint16 REVID:16; // 31:16 Revision
- };
- union DEVICEID_REG {
- Uint32 all;
- struct DEVICEID_BITS bit;
- };
- struct DEV_EMU_REGS {
- union DEVICECNF_REG DEVICECNF;
- union DEVICEID_REG DEVICEID;
- Uint16 PROTSTART;
- Uint16 PROTRANGE;
- Uint16 rsvd[202];
- Uint16 M0RAMDFT;
- Uint16 M1RAMDFT;
- Uint16 L0RAMDFT;
- Uint16 L1RAMDFT;
- Uint16 H0RAMDFT;
- };
- //---------------------------------------------------------------------------
- // Device Emulation Register References & Function Declarations:
- //
- extern volatile struct DEV_EMU_REGS DevEmuRegs;
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_Xintf.h
- //
- // TITLE: DSP28 Device External Interface Register Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | No change
- //###########################################################################
- // XINTF timing register bit definitions:
- struct XTIMING_BITS { // bits description
- Uint16 XWRTRAIL:2; // 1:0 Write access trail timing
- Uint16 XWRACTIVE:3; // 4:2 Write access active timing
- Uint16 XWRLEAD:2; // 6:5 Write access lead timing
- Uint16 XRDTRAIL:2; // 8:7 Read access trail timing
- Uint16 XRDACTIVE:3; // 11:9 Read access active timing
- Uint16 XRDLEAD:2; // 13:12 Read access lead timing
- Uint16 USEREADY:1; // 14 Extend access using HW waitstates
- Uint16 READYMODE:1; // 15 Ready mode
- Uint16 XSIZE:2; // 17:16 XINTF bus width - must be written as 11b
- Uint16 rsvd1:4; // 21:18 reserved
- Uint16 X2TIMING:1; // 22 Double lead/active/trail timing
- Uint16 rsvd3:9; // 31:23 reserved
- };
- union XTIMING_REG {
- Uint32 all;
- struct XTIMING_BITS bit;
- };
- // XINTF control register bit definitions:
- struct XINTCNF2_BITS { // bits description
- Uint16 WRBUFF:2; // 1:0 Write buffer depth
- Uint16 CLKMODE:1; // 2 Ratio for XCLKOUT with respect to XTIMCLK
- Uint16 CLKOFF:1; // 3 Disable XCLKOUT
- Uint16 rsvd1:2; // 5:4 reserved
- Uint16 WLEVEL:2; // 7:6 Current level of the write buffer
- Uint16 MPNMC:1; // 8 Micro-processor/micro-computer mode
- Uint16 HOLD:1; // 9 Hold enable/disable
- Uint16 HOLDS:1; // 10 Current state of HOLDn input
- Uint16 HOLDAS:1; // 11 Current state of HOLDAn output
- Uint16 rsvd2:4; // 15:12 reserved
- Uint16 XTIMCLK:3; // 18:16 Ratio for XTIMCLK
- Uint16 rsvd3:13; // 31:19 reserved
- };
- union XINTCNF2_REG {
- Uint32 all;
- struct XINTCNF2_BITS bit;
- };
- // XINTF bank switching register bit definitions:
- struct XBANK_BITS { // bits description
- Uint16 BANK:2; // 2:0 Zone for which banking is enabled
- Uint16 BCYC:3; // 5:3 XTIMCLK cycles to add
- Uint16 rsvd:10; // 15:6 reserved
- };
- union XBANK_REG {
- Uint16 all;
- struct XBANK_BITS bit;
- };
- //---------------------------------------------------------------------------
- // XINTF Register File:
- //
- struct XINTF_REGS {
- union XTIMING_REG XTIMING0;
- union XTIMING_REG XTIMING1;
- union XTIMING_REG XTIMING2;
- Uint32 rsvd1[3];
- union XTIMING_REG XTIMING6;
- union XTIMING_REG XTIMING7;
- Uint32 rsvd2[2];
- union XINTCNF2_REG XINTCNF2;
- Uint32 rsvd3;
- union XBANK_REG XBANK;
- Uint16 rsvd4;
- Uint16 XREVISION;
- Uint16 rsvd5[5];
- };
- //---------------------------------------------------------------------------
- // XINTF External References & Function Declarations:
- //
- extern volatile struct XINTF_REGS XintfRegs;
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_CpuTimers.h
- //
- // TITLE: DSP28 CPU 32-bit Timers Register Definitions.
- //
- // NOTES: CpuTimer1 and CpuTimer2 are reserved for use with DSP BIOS and
- // other realtime operating systems.
- //
- // Do not use these two timers in your application if you ever plan
- // on integrating DSP-BIOS or another realtime OS.
- //
- // For this reason, the code to manipulate these two timers is
- // commented out and not used in these examples.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | No change
- //###########################################################################
- //---------------------------------------------------------------------------
- // CPU Timer Register Bit Definitions:
- //
- //
- // TCR: Control register bit definitions:
- struct TCR_BITS { // bits description
- Uint16 OUTSTS:1; // 0 Current state of TOUT
- Uint16 FORCE:1; // 1 Force TOUT
- Uint16 POL:1; // 2 Output polarity
- Uint16 TOG:1; // 3 Output toggle mode
- Uint16 TSS:1; // 4 Timer Start/Stop
- Uint16 TRB:1; // 5 Timer reload
- Uint16 FRCEN:1; // 6 Force enable
- Uint16 PWIDTH:3; // 9:7 BitTOUT output pulse width
- Uint16 SOFT:1; // 10 Emulation modes
- Uint16 FREE:1; // 11
- Uint16 rsvd:2; // 12:13 reserved
- Uint16 TIE:1; // 14 Output enable
- Uint16 TIF:1; // 15 Interrupt flag
- };
- union TCR_REG {
- Uint16 all;
- struct TCR_BITS bit;
- };
- // TPR: Pre-scale low bit definitions:
- struct TPR_BITS { // bits description
- Uint16 TDDR:8; // 7:0 Divide-down low
- Uint16 PSC:8; // 15:8 Prescale counter low
- };
- union TPR_REG {
- Uint16 all;
- struct TPR_BITS bit;
- };
- // TPRH: Pre-scale high bit definitions:
- struct TPRH_BITS { // bits description
- Uint16 TDDRH:8; // 7:0 Divide-down high
- Uint16 PSCH:8; // 15:8 Prescale counter high
- };
- union TPRH_REG {
- Uint16 all;
- struct TPRH_BITS bit;
- };
- // TIM, TIMH: Timer register definitions:
- struct TIM_REG {
- Uint16 LSW;
- Uint16 MSW;
- };
- union TIM_GROUP {
- Uint32 all;
- struct TIM_REG half;
- };
- // PRD, PRDH: Period register definitions:
- struct PRD_REG {
- Uint16 LSW;
- Uint16 MSW;
- };
- union PRD_GROUP {
- Uint32 all;
- struct PRD_REG half;
- };
- //---------------------------------------------------------------------------
- // CPU Timer Register File:
- //
- struct CPUTIMER_REGS {
- union TIM_GROUP TIM; // Timer counter register
- union PRD_GROUP PRD; // Period register
- union TCR_REG TCR; // Timer control register
- Uint16 rsvd1; // reserved
- union TPR_REG TPR; // Timer pre-scale low
- union TPRH_REG TPRH; // Timer pre-scale high
- };
- //---------------------------------------------------------------------------
- // CPU Timer Support Variables:
- //
- struct CPUTIMER_VARS {
- volatile struct CPUTIMER_REGS *RegsAddr;
- Uint32 InterruptCount;
- float CPUFreqInMHz;
- float PeriodInUSec;
- };
- //---------------------------------------------------------------------------
- // Function prototypes and external definitions:
- //
- void InitCpuTimers(void);
- void ConfigCpuTimer(struct CPUTIMER_VARS *Timer, float Freq, float Period);
- extern volatile struct CPUTIMER_REGS CpuTimer0Regs;
- extern struct CPUTIMER_VARS CpuTimer0;
- // CpuTimer 1 and CpuTimer2 are reserved for DSP BIOS & other RTOS
- //extern volatile struct CPUTIMER_REGS CpuTimer1Regs;
- extern volatile struct CPUTIMER_REGS CpuTimer2Regs;
- //extern struct CPUTIMER_VARS CpuTimer1;
- extern struct CPUTIMER_VARS CpuTimer2;
- //---------------------------------------------------------------------------
- // Usefull Timer Operations:
- //
- // Start Timer:
- // Stop Timer:
- // Reload Timer With period Value:
- // Read 32-Bit Timer Value:
- // Read 32-Bit Period Value:
- // CpuTimer 1 and CpuTimer2 are reserved for DSP BIOS & other RTOS
- // Do not use these two timers if you ever plan on integrating
- // DSP-BIOS or another realtime OS.
- //
- // For this reason, the code to manipulate these two timers is
- // commented out and not used in these examples.
- // Start Timer:
- //#define StartCpuTimer1() CpuTimer1Regs.TCR.bit.TSS = 0
- //#define StartCpuTimer2() CpuTimer2Regs.TCR.bit.TSS = 0
- // Stop Timer:
- //#define StopCpuTimer1() CpuTimer1Regs.TCR.bit.TSS = 1
- //#define StopCpuTimer2() CpuTimer2Regs.TCR.bit.TSS = 1
- // Reload Timer With period Value:
- //#define ReloadCpuTimer1() CpuTimer1Regs.TCR.bit.TRB = 1
- //#define ReloadCpuTimer2() CpuTimer2Regs.TCR.bit.TRB = 1
- // Read 32-Bit Timer Value:
- //#define ReadCpuTimer1Counter() CpuTimer1Regs.TIM.all
- //#define ReadCpuTimer2Counter() CpuTimer2Regs.TIM.all
- // Read 32-Bit Period Value:
- //#define ReadCpuTimer1Period() CpuTimer1Regs.PRD.all
- //#define ReadCpuTimer2Period() CpuTimer2Regs.PRD.all
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_PieCtrl.h
- //
- // TITLE: DSP28 Device PIE Control Register Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 18 Jun 2002 | L.H. | Changed PieCtrl to PieCtrlRegs
- //###########################################################################
- //---------------------------------------------------------------------------
- // PIE Control Register Bit Definitions:
- //
- // PIECTRL: Register bit definitions:
- struct PIECTRL_BITS { // bits description
- Uint16 ENPIE:1; // 0 Enable PIE block
- Uint16 PIEVECT:15; // 15:1 Fetched vector address
- };
- union PIECTRL_REG {
- Uint16 all;
- struct PIECTRL_BITS bit;
- };
- // PIEIER: Register bit definitions:
- struct PIEIER_BITS { // bits description
- Uint16 INTx1:1; // 0 INTx.1
- Uint16 INTx2:1; // 1 INTx.2
- Uint16 INTx3:1; // 2 INTx.3
- Uint16 INTx4:1; // 3 INTx.4
- Uint16 INTx5:1; // 4 INTx.5
- Uint16 INTx6:1; // 5 INTx.6
- Uint16 INTx7:1; // 6 INTx.7
- Uint16 INTx8:1; // 7 INTx.8
- Uint16 rsvd:8; // 15:8 reserved
- };
- union PIEIER_REG {
- Uint16 all;
- struct PIEIER_BITS bit;
- };
- // PIEIFR: Register bit definitions:
- struct PIEIFR_BITS { // bits description
- Uint16 INTx1:1; // 0 INTx.1
- Uint16 INTx2:1; // 1 INTx.2
- Uint16 INTx3:1; // 2 INTx.3
- Uint16 INTx4:1; // 3 INTx.4
- Uint16 INTx5:1; // 4 INTx.5
- Uint16 INTx6:1; // 5 INTx.6
- Uint16 INTx7:1; // 6 INTx.7
- Uint16 INTx8:1; // 7 INTx.8
- Uint16 rsvd:8; // 15:8 reserved
- };
- union PIEIFR_REG {
- Uint16 all;
- struct PIEIFR_BITS bit;
- };
- // PIEACK: Register bit definitions:
- struct PIEACK_BITS { // bits description
- Uint16 ACK1:1; // 0 Acknowledge PIE interrupt group 1
- Uint16 ACK2:1; // 1 Acknowledge PIE interrupt group 2
- Uint16 ACK3:1; // 2 Acknowledge PIE interrupt group 3
- Uint16 ACK4:1; // 3 Acknowledge PIE interrupt group 4
- Uint16 ACK5:1; // 4 Acknowledge PIE interrupt group 5
- Uint16 ACK6:1; // 5 Acknowledge PIE interrupt group 6
- Uint16 ACK7:1; // 6 Acknowledge PIE interrupt group 7
- Uint16 ACK8:1; // 7 Acknowledge PIE interrupt group 8
- Uint16 ACK9:1; // 8 Acknowledge PIE interrupt group 9
- Uint16 ACK10:1; // 9 Acknowledge PIE interrupt group 10
- Uint16 ACK11:1; // 10 Acknowledge PIE interrupt group 11
- Uint16 ACK12:1; // 11 Acknowledge PIE interrupt group 12
- Uint16 rsvd:4; // 15:12 reserved
- };
- union PIEACK_REG {
- Uint16 all;
- struct PIEACK_BITS bit;
- };
- //---------------------------------------------------------------------------
- // PIE Control Register File:
- //
- struct PIE_CTRL_REGS {
- union PIECTRL_REG PIECRTL; // PIE control register
- union PIEACK_REG PIEACK; // PIE acknowledge
- union PIEIER_REG PIEIER1; // PIE INT1 IER register
- union PIEIFR_REG PIEIFR1; // PIE INT1 IFR register
- union PIEIER_REG PIEIER2; // PIE INT2 IER register
- union PIEIFR_REG PIEIFR2; // PIE INT2 IFR register
- union PIEIER_REG PIEIER3; // PIE INT3 IER register
- union PIEIFR_REG PIEIFR3; // PIE INT3 IFR register
- union PIEIER_REG PIEIER4; // PIE INT4 IER register
- union PIEIFR_REG PIEIFR4; // PIE INT4 IFR register
- union PIEIER_REG PIEIER5; // PIE INT5 IER register
- union PIEIFR_REG PIEIFR5; // PIE INT5 IFR register
- union PIEIER_REG PIEIER6; // PIE INT6 IER register
- union PIEIFR_REG PIEIFR6; // PIE INT6 IFR register
- union PIEIER_REG PIEIER7; // PIE INT7 IER register
- union PIEIFR_REG PIEIFR7; // PIE INT7 IFR register
- union PIEIER_REG PIEIER8; // PIE INT8 IER register
- union PIEIFR_REG PIEIFR8; // PIE INT8 IFR register
- union PIEIER_REG PIEIER9; // PIE INT9 IER register
- union PIEIFR_REG PIEIFR9; // PIE INT9 IFR register
- union PIEIER_REG PIEIER10; // PIE INT10 IER register
- union PIEIFR_REG PIEIFR10; // PIE INT10 IFR register
- union PIEIER_REG PIEIER11; // PIE INT11 IER register
- union PIEIFR_REG PIEIFR11; // PIE INT11 IFR register
- union PIEIER_REG PIEIER12; // PIE INT12 IER register
- union PIEIFR_REG PIEIFR12; // PIE INT12 IFR register
- };
- //---------------------------------------------------------------------------
- // PIE Control Registers External References & Function Declarations:
- //
- extern volatile struct PIE_CTRL_REGS PieCtrlRegs;
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_PieVect.h
- //
- // TITLE: DSP28 Devices PIE Vector Table Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | No change
- //###########################################################################
- //---------------------------------------------------------------------------
- // PIE Interrupt Vector Table Definition:
- //
- // Create a user type called PINT (pointer to interrupt):
- typedef interrupt void(*PINT)(void);
- // Define Vector Table:
- struct PIE_VECT_TABLE {
- // Reset is never fetched from this table.
- // It will always be fetched from 0x3FFFC0 in either
- // boot ROM or XINTF Zone 7 depending on the state of
- // the XMP/MC input signal. On the F2810 it is always
- // fetched from boot ROM.
- PINT PIE1_RESERVED;
- PINT PIE2_RESERVED;
- PINT PIE3_RESERVED;
- PINT PIE4_RESERVED;
- PINT PIE5_RESERVED;
- PINT PIE6_RESERVED;
- PINT PIE7_RESERVED;
- PINT PIE8_RESERVED;
- PINT PIE9_RESERVED;
- PINT PIE10_RESERVED;
- PINT PIE11_RESERVED;
- PINT PIE12_RESERVED;
- PINT PIE13_RESERVED;
- // Non-Peripheral Interrupts:
- PINT XINT13; // XINT13
- PINT TINT2; // CPU-Timer2
- PINT DATALOG; // Datalogging interrupt
- PINT RTOSINT; // RTOS interrupt
- PINT EMUINT; // Emulation interrupt
- PINT XNMI; // Non-maskable interrupt
- PINT ILLEGAL; // Illegal operation TRAP
- PINT USER0; // User Defined trap 0
- PINT USER1; // User Defined trap 1
- PINT USER2; // User Defined trap 2
- PINT USER3; // User Defined trap 3
- PINT USER4; // User Defined trap 4
- PINT USER5; // User Defined trap 5
- PINT USER6; // User Defined trap 6
- PINT USER7; // User Defined trap 7
- PINT USER8; // User Defined trap 8
- PINT USER9; // User Defined trap 9
- PINT USER10; // User Defined trap 10
- PINT USER11; // User Defined trap 11
- // Group 1 PIE Peripheral Vectors:
- PINT PDPINTA; // EV-A
- PINT PDPINTB; // EV-B
- PINT rsvd1_3;
- PINT XINT1;
- PINT XINT2;
- PINT ADCINT; // ADC
- PINT TINT0; // Timer 0
- PINT WAKEINT; // WD
- // Group 2 PIE Peripheral Vectors:
- PINT CMP1INT; // EV-A
- PINT CMP2INT; // EV-A
- PINT CMP3INT; // EV-A
- PINT T1PINT; // EV-A
- PINT T1CINT; // EV-A
- PINT T1UFINT; // EV-A
- PINT T1OFINT; // EV-A
- PINT rsvd2_8;
- // Group 3 PIE Peripheral Vectors:
- PINT T2PINT; // EV-A
- PINT T2CINT; // EV-A
- PINT T2UFINT; // EV-A
- PINT T2OFINT; // EV-A
- PINT CAPINT1; // EV-A
- PINT CAPINT2; // EV-A
- PINT CAPINT3; // EV-A
- PINT rsvd3_8;
- // Group 4 PIE Peripheral Vectors:
- PINT CMP4INT; // EV-B
- PINT CMP5INT; // EV-B
- PINT CMP6INT; // EV-B
- PINT T3PINT; // EV-B
- PINT T3CINT; // EV-B
- PINT T3UFINT; // EV-B
- PINT T3OFINT; // EV-B
- PINT rsvd4_8;
- // Group 5 PIE Peripheral Vectors:
- PINT T4PINT; // EV-B
- PINT T4CINT; // EV-B
- PINT T4UFINT; // EV-B
- PINT T4OFINT; // EV-B
- PINT CAPINT4; // EV-B
- PINT CAPINT5; // EV-B
- PINT CAPINT6; // EV-B
- PINT rsvd5_8;
- // Group 6 PIE Peripheral Vectors:
- PINT SPIRXINTA; // SPI-A
- PINT SPITXINTA; // SPI-A
- PINT rsvd6_3;
- PINT rsvd6_4;
- PINT MRINTA; // McBSP-A
- PINT MXINTA; // McBSP-A
- PINT rsvd6_7;
- PINT rsvd6_8;
- // Group 7 PIE Peripheral Vectors:
- PINT rsvd7_1;
- PINT rsvd7_2;
- PINT rsvd7_3;
- PINT rsvd7_4;
- PINT rsvd7_5;
- PINT rsvd7_6;
- PINT rsvd7_7;
- PINT rsvd7_8;
- // Group 8 PIE Peripheral Vectors:
- PINT rsvd8_1;
- PINT rsvd8_2;
- PINT rsvd8_3;
- PINT rsvd8_4;
- PINT rsvd8_5;
- PINT rsvd8_6;
- PINT rsvd8_7;
- PINT rsvd8_8;
- // Group 9 PIE Peripheral Vectors:
- PINT RXAINT; // SCI-A
- PINT TXAINT; // SCI-A
- PINT RXBINT; // SCI-B
- PINT TXBINT; // SCI-B
- PINT ECAN0INTA; // eCAN
- PINT ECAN1INTA; // eCAN
- PINT rsvd9_7;
- PINT rsvd9_8;
- // Group 10 PIE Peripheral Vectors:
- PINT rsvd10_1;
- PINT rsvd10_2;
- PINT rsvd10_3;
- PINT rsvd10_4;
- PINT rsvd10_5;
- PINT rsvd10_6;
- PINT rsvd10_7;
- PINT rsvd10_8;
- // Group 11 PIE Peripheral Vectors:
- PINT rsvd11_1;
- PINT rsvd11_2;
- PINT rsvd11_3;
- PINT rsvd11_4;
- PINT rsvd11_5;
- PINT rsvd11_6;
- PINT rsvd11_7;
- PINT rsvd11_8;
- // Group 12 PIE Peripheral Vectors:
- PINT rsvd12_1;
- PINT rsvd12_2;
- PINT rsvd12_3;
- PINT rsvd12_4;
- PINT rsvd12_5;
- PINT rsvd12_6;
- PINT rsvd12_7;
- PINT rsvd12_8;
- };
- //---------------------------------------------------------------------------
- // PIE Interrupt Vector Table External References & Function Declarations:
- //
- extern struct PIE_VECT_TABLE PieVectTable;
- //===========================================================================
- // No more.
- //===========================================================================
- //###########################################################################
- //
- // FILE: DSP28_DefaultIsr.h
- //
- // TITLE: DSP28 Devices Default Interrupt Service Routines Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | No change
- //###########################################################################
- //---------------------------------------------------------------------------
- // Default Interrupt Service Routine Declarations:
- //
- // The following function prototypes are for the
- // default ISR routines used with the default PIE vector table.
- // This default vector table is found in the DSP28_PieVect.h
- // file.
- //
- // Non-Peripheral Interrupts:
- interrupt void INT13_ISR(void); // XINT13 or CPU-Timer 1
- interrupt void INT14_ISR(void); // CPU-Timer2
- interrupt void DATALOG_ISR(void); // Datalogging interrupt
- interrupt void RTOSINT_ISR(void); // RTOS interrupt
- interrupt void EMUINT_ISR(void); // Emulation interrupt
- interrupt void NMI_ISR(void); // Non-maskable interrupt
- interrupt void ILLEGAL_ISR(void); // Illegal operation TRAP
- interrupt void USER0_ISR(void); // User Defined trap 0
- interrupt void USER1_ISR(void); // User Defined trap 1
- interrupt void USER2_ISR(void); // User Defined trap 2
- interrupt void USER3_ISR(void); // User Defined trap 3
- interrupt void USER4_ISR(void); // User Defined trap 4
- interrupt void USER5_ISR(void); // User Defined trap 5
- interrupt void USER6_ISR(void); // User Defined trap 6
- interrupt void USER7_ISR(void); // User Defined trap 7
- interrupt void USER8_ISR(void); // User Defined trap 8
- interrupt void USER9_ISR(void); // User Defined trap 9
- interrupt void USER10_ISR(void); // User Defined trap 10
- interrupt void USER11_ISR(void); // User Defined trap 11
- // Group 1 PIE Interrupt Service Routines:
- interrupt void PDPINTA_ISR(void); // EV-A
- interrupt void PDPINTB_ISR(void); // EV-B
- interrupt void XINT1_ISR(void);
- interrupt void XINT2_ISR(void);
- interrupt void ADCINT_ISR(void); // ADC
- interrupt void TINT0_ISR(void); // Timer 0
- interrupt void WAKEINT_ISR(void); // WD
- // Group 2 PIE Interrupt Service Routines:
- interrupt void CMP1INT_ISR(void); // EV-A
- interrupt void CMP2INT_ISR(void); // EV-A
- interrupt void CMP3INT_ISR(void); // EV-A
- interrupt void T1PINT_ISR(void); // EV-A
- interrupt void T1CINT_ISR(void); // EV-A
- interrupt void T1UFINT_ISR(void); // EV-A
- interrupt void T1OFINT_ISR(void); // EV-A
- // Group 3 PIE Interrupt Service Routines:
- interrupt void T2PINT_ISR(void); // EV-A
- interrupt void T2CINT_ISR(void); // EV-A
- interrupt void T2UFINT_ISR(void); // EV-A
- interrupt void T2OFINT_ISR(void); // EV-A
- interrupt void CAPINT1_ISR(void); // EV-A
- interrupt void CAPINT2_ISR(void); // EV-A
- interrupt void CAPINT3_ISR(void); // EV-A
- // Group 4 PIE Interrupt Service Routines:
- interrupt void CMP4INT_ISR(void); // EV-B
- interrupt void CMP5INT_ISR(void); // EV-B
- interrupt void CMP6INT_ISR(void); // EV-B
- interrupt void T3PINT_ISR(void); // EV-B
- interrupt void T3CINT_ISR(void); // EV-B
- interrupt void T3UFINT_ISR(void); // EV-B
- interrupt void T3OFINT_ISR(void); // EV-B
- // Group 5 PIE Interrupt Service Routines:
- interrupt void T4PINT_ISR(void); // EV-B
- interrupt void T4CINT_ISR(void); // EV-B
- interrupt void T4UFINT_ISR(void); // EV-B
- interrupt void T4OFINT_ISR(void); // EV-B
- interrupt void CAPINT4_ISR(void); // EV-B
- interrupt void CAPINT5_ISR(void); // EV-B
- interrupt void CAPINT6_ISR(void); // EV-B
- // Group 6 PIE Interrupt Service Routines:
- interrupt void SPIRXINTA_ISR(void); // SPI
- interrupt void SPITXINTA_ISR(void); // SPI
- interrupt void MRINTA_ISR(void); // McBSP
- interrupt void MXINTA_ISR(void); // McBSP
- // Group 9 PIE Interrupt Service Routines:
- interrupt void SCIRXINTA_ISR(void); // SCI-A
- interrupt void SCITXINTA_ISR(void); // SCI-A
- interrupt void SCIRXINTB_ISR(void); // SCI-B
- interrupt void SCITXINTB_ISR(void); // SCI-B
- interrupt void ECAN0INTA_ISR(void); // eCAN
- interrupt void ECAN1INTA_ISR(void); // eCAN
- // Catch-all for Reserved Locations For testing purposes:
- interrupt void PIE_RESERVED(void); // Reserved for test
- interrupt void rsvd_ISR(void); // for test
- //
- // TMDX BETA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_SWPrioritizedIsrLevels.h
- //
- // TITLE: DSP28 Devices Software Prioritized Interrupt Service Routine
- // Level definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.1 | 30 Jan 2002 | A.T. | Original Release
- //###########################################################################
- //-------------------------------------------------------------------------------
- // Interrupt Enable Register Allocation For F2810/12 Devices:
- //-------------------------------------------------------------------------------
- // Interrupts can be enabled/disabled using the CPU interrupt enable register
- // (IER) and the PIE interrupt enable registers (PIIER1 to PIEIER12). The table
- // below lists the allocation of the various interrupts to these registers:
- //
- //-----------------------------------------------------------------------------------
- // CPU | PIEIER1 to PIEIER12 |
- // IER | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
- // =====|=========|=========|=========|=========|=========|=========|=======|=======|
- // INT1 |PDPINTA |PDPINTB | resvd | XINT1 | XINT2 |ADCINT | TINT0 |WAKEINT|
- // | (EV-A) | (EV-B) | | | | | | |
- // INT2 |CMP1INT |CMP2INT |CMP3INT |T1PINT |T1CINT |T1UFINT |T1OFINT| resvd |
- // | (EV-A) | (EV-A) |(EV-A) |(EV-A) |(EV-A) |(EV-A) |(EV-A) | |
- // INT3 |T2PINT |T2CINT |T2UFINT |T2OFINT |CAPINT1 |CAPINT2 |CAPINT3| resvd |
- // | (EV-A) | (EV-A) |(EV-A) |(EV-A) |(EV-A) |(EV-A) |(EV-A) | |
- // INT4 |CMP4INT |CMP5INT |CMP6INT |T3PINT |T3CINT |T3UFINT |T3OFINT| resvd |
- // | (EV-B) | (EV-B) |(EV-B) |(EV-B) |(EV-B) |(EV-B) |(EV-B) | |
- // INT5 |T4PINT |T4CINT |T4UFINT |T4OFINT |CAPINT4 |CAPINT5 |CAPINT6| resvd |
- // | (EV-B) | (EV-B) |(EV-B) |(EV-B) |(EV-B) |(EV-B) |(EV-B) | |
- // INT6 |SPIRXINTA|SPITXINTA| resvd | resvd | MRINTA | MXINTA | resvd | resvd |
- // | (SPI-A) | (SPI-A) | | |(McBSP-A)|(McBSP-A)| | |
- // INT7 | resvd | resvd | resvd | resvd | resvd | resvd | resvd | resvd |
- // INT8 | resvd | resvd | resvd | resvd | resvd | resvd | resvd | resvd |
- // INT9 |SCIRXINTA|SCITXINTA|SCIRXINTB|SCITXINTB|ECAN0INTA|ECAN1INTA| resvd | resvd |
- // | (SCI-A) | (SCI-A) |(SCI-B) |(SCI-B) |(ECAN-A) |(ECAN-A) | | |
- // INT10| resvd | resvd | resvd | resvd | resvd | resvd | resvd | resvd |
- // INT11| resvd | resvd | resvd | resvd | resvd | resvd | resvd | resvd |
- // INT12| resvd | resvd | resvd | resvd | resvd | resvd | resvd | resvd |
- //-------------------------------------------------------------------------------
- // INT13| INT13
- // INT14| INT14
- // INT15| DATALOG
- // INT16| RTOSINT
- //-------------------------------------------------------------------------------
- //
- //-------------------------------------------------------------------------------
- // Set "Global" Interrupt Priority Level (IER register):
- //-------------------------------------------------------------------------------
- // The user must set the appropriate priority level for each of the CPU
- // interrupts. This is termed as the "global" priority. The priority level
- // must be a number between 1 (highest) to 16 (lowest). A value of 0 must
- // be entered for reserved interrupts or interrupts that are not used. This
- // will also reduce code size by not including ISR's that are not used.
- //
- // Note: The priority levels below are used to calculate the IER register
- // interrupt masks MINT1 to MINT16.
- //
- //
- // Note: The priority levels shown here may not make sense in a
- // real application. This is for demonstration purposes only!!!
- //
- // The user should change these to values that make sense for
- // their application.
- //
- // 0 = not used
- // 1 = highest priority
- // ...
- // 16 = lowest priority
- //-------------------------------------------------------------------------------
- // Set "Group" Interrupt Priority Level (PIEIER1 to PIEIER12 registers):
- //-------------------------------------------------------------------------------
- // The user must set the appropriate priority level for each of the PIE
- // interrupts. This is termed as the "group" priority. The priority level
- // must be a number between 1 (highest) to 8 (lowest). A value of 0 must
- // be entered for reserved interrupts or interrupts that are not used. This
- // will also reduce code size by not including ISR's that are not used:
- //
- // Note: The priority levels below are used to calculate the following
- // PIEIER register interrupt masks:
- // MG11 to MG18
- // MG21 to MG28
- // MG31 to MG38
- // MG41 to MG48
- // MG51 to MG58
- // MG61 to MG68
- // MG71 to MG78
- // MG81 to MG88
- // MG91 to MG98
- // MG101 to MG108
- // MG111 to MG118
- // MG121 to MG128
- //
- // Note: The priority levels shown here may not make sense in a
- // real application. This is for demonstration purposes only!!!
- //
- // The user should change these to values that make sense for
- // their application.
- //
- // 0 = not used
- // 1 = highest priority
- // ...
- // 8 = lowest priority
- //
- // There should be no need to modify code below this line
- //-------------------------------------------------------------------------------
- // Automatically generate IER interrupt masks MINT1 to MINT16:
- //
- // Beginning of MINT1:
- // End Of MINT1.
- // Beginning of MINT2:
- // End Of MINT2.
- // Beginning of MINT3:
- // End Of MINT3.
- // Beginning of MINT4:
- // End Of MINT4.
- // Beginning of MINT5:
- // End Of MINT5.
- // Beginning of MINT6:
- // End Of MINT6.
- // Beginning of MINT7:
- // End Of MINT7.
- // Beginning of MINT8:
- // End Of MINT8.
- // Beginning of MINT9:
- // End Of MINT9.
- // Beginning of MINT10:
- // End Of MINT10.
- // Beginning of MINT11:
- // End Of MINT11.
- // Beginning of MINT12:
- // End Of MINT12.
- // Beginning of MINT13:
- // End Of MINT13.
- // Beginning of MINT14:
- // End Of MINT14.
- // Beginning of MINT15:
- // End Of MINT15.
- // Beginning of MINT16:
- // End Of MINT16.
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG11 to MG18:
- // Beginning of MG11:
- // End of MG11:
- // Beginning of MG12:
- // End of MG12:
- // Beginning of MG13:
- // End of MG13:
- // Beginning of MG14:
- // End of MG14:
- // Beginning of MG15:
- // End of MG15:
- // Beginning of MG16:
- // End of MG16:
- // Beginning of MG17:
- // End of MG17:
- // Beginning of MG18:
- // End of MG18:
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG21 to MG28:
- //
- // Beginning of MG21:
- // End of MG21:
- // Beginning of MG22:
- // End of MG22:
- // Beginning of MG23:
- // End of MG23:
- // Beginning of MG24:
- // End of MG24:
- // Beginning of MG25:
- // End of MG25:
- // Beginning of MG26:
- // End of MG26:
- // Beginning of MG27:
- // End of MG27:
- // Beginning of MG28:
- // End of MG28:
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG31 to MG38:
- //
- // Beginning of MG31:
- // End of MG31:
- // Beginning of MG32:
- // End of MG32:
- // Beginning of MG33:
- // End of MG33:
- // Beginning of MG34:
- // End of MG34:
- // Beginning of MG35:
- // End of MG35:
- // Beginning of MG36:
- // End of MG36:
- // Beginning of MG37:
- // End of MG37:
- // Beginning of MG38:
- // End of MG38:
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG41 to MG48:
- //
- // Beginning of MG41:
- // End of MG41:
- // Beginning of MG42:
- // End of MG42:
- // Beginning of MG43:
- // End of MG43:
- // Beginning of MG44:
- // End of MG44:
- // Beginning of MG45:
- // End of MG45:
- // Beginning of MG46:
- // End of MG46:
- // Beginning of MG47:
- // End of MG47:
- // Beginning of MG48:
- // End of MG48:
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG51 to MG58:
- //
- // Beginning of MG51:
- // End of MG51:
- // Beginning of MG52:
- // End of MG52:
- // Beginning of MG53:
- // End of MG53:
- // Beginning of MG54:
- // End of MG54:
- // Beginning of MG55:
- // End of MG55:
- // Beginning of MG56:
- // End of MG56:
- // Beginning of MG57:
- // End of MG57:
- // Beginning of MG58:
- // End of MG58:
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG61 to MG68:
- //
- // Beginning of MG61:
- // End of MG61:
- // Beginning of MG62:
- // End of MG62:
- // Beginning of MG63:
- // End of MG63:
- // Beginning of MG64:
- // End of MG64:
- // Beginning of MG65:
- // End of MG65:
- // Beginning of MG66:
- // End of MG66:
- // Beginning of MG67:
- // End of MG67:
- // Beginning of MG68:
- // End of MG68:
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG71 to MG78:
- //
- // Beginning of MG71:
- // End of MG71:
- // Beginning of MG72:
- // End of MG72:
- // Beginning of MG73:
- // End of MG73:
- // Beginning of MG74:
- // End of MG74:
- // Beginning of MG75:
- // End of MG75:
- // Beginning of MG76:
- // End of MG76:
- // Beginning of MG77:
- // End of MG77:
- // Beginning of MG78:
- // End of MG78:
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG81 to MG88:
- //
- // Beginning of MG81:
- // End of MG81:
- // Beginning of MG82:
- // End of MG82:
- // Beginning of MG83:
- // End of MG83:
- // Beginning of MG84:
- // End of MG84:
- // Beginning of MG85:
- // End of MG85:
- // Beginning of MG86:
- // End of MG86:
- // Beginning of MG87:
- // End of MG87:
- // Beginning of MG88:
- // End of MG88:
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG91 to MG98:
- //
- // Beginning of MG91:
- // End of MG91:
- // Beginning of MG92:
- // End of MG92:
- // Beginning of MG93:
- // End of MG93:
- // Beginning of MG94:
- // End of MG94:
- // Beginning of MG95:
- // End of MG95:
- // Beginning of MG96:
- // End of MG96:
- // Beginning of MG97:
- // End of MG97:
- // Beginning of MG98:
- // End of MG98:
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG101 to MG108:
- //
- // Beginning of MG101:
- // End of MG101:
- // Beginning of MG102:
- // End of MG102:
- // Beginning of MG103:
- // End of MG103:
- // Beginning of MG104:
- // End of MG104:
- // Beginning of MG105:
- // End of MG105:
- // Beginning of MG106:
- // End of MG106:
- // Beginning of MG107:
- // End of MG107:
- // Beginning of MG108:
- // End of MG108:
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG111 to MG118:
- //
- // Beginning of MG111:
- // End of MG111:
- // Beginning of MG112:
- // End of MG112:
- // Beginning of MG113:
- // End of MG113:
- // Beginning of MG114:
- // End of MG114:
- // Beginning of MG115:
- // End of MG115:
- // Beginning of MG116:
- // End of MG116:
- // Beginning of MG117:
- // End of MG117:
- // Beginning of MG118:
- // End of MG118:
- //-------------------------------------------------------------------------------
- // Automatically generate PIEIER1 interrupt masks MG121 to MG128:
- //
- // Beginning of MG121:
- // End of MG121:
- // Beginning of MG121:
- // End of MG122:
- // Beginning of MG123:
- // End of MG123:
- // Beginning of MG124:
- // End of MG124:
- // Beginning of MG125:
- // End of MG125:
- // Beginning of MG126:
- // End of MG126:
- // Beginning of MG127:
- // End of MG127:
- // Beginning of MG128:
- // End of MG128:
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_Spi.h
- //
- // TITLE: DSP28 Device SPI Register Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 28 Jun 2002 | L.H. | Removed spib register def.
- //###########################################################################
- //---------------------------------------------------------------------------
- // SPI Individual Register Bit Definitions:
- //
- // SPI FIFO Transmit register bit definitions:
- struct SPIFFTX_BITS { // bit description
- Uint16 TXFFIL:5; // 4:0 Interrupt level
- Uint16 TXFFIENA:1; // 5 Interrupt enable
- Uint16 TXFFINTINTCLR:1; // 6 Clear INT flag
- Uint16 TXFFINT:1; // 7 INT flag
- Uint16 TXFFST:5; // 12:8 FIFO status
- Uint16 TXFIFORESET:1; // 14 Enhancement enable
- Uint16 rsvd:1; // 15 reserved
- };
- union SPIFFTX_REG {
- Uint16 all;
- struct SPIFFTX_BITS bit;
- };
- //--------------------------------------------
- // SPI FIFO recieve register bit definitions:
- //
- //
- struct SPIFFRX_BITS { // bits description
- Uint16 RXFFIL:5; // 4:0 Interrupt level
- Uint16 RXFFIENA:1; // 5 Interrupt enable
- Uint16 RXFFINTCLR:1; // 6 Clear INT flag
- Uint16 RXFFINT:1; // 7 INT flag
- Uint16 RXFFST:5; // 12:8 FIFO status
- Uint16 RXFIFORESET:1; // 13 FIFO reset
- Uint16 RXFFOVFCLR:1; // 14 Clear overflow
- Uint16 RXFFOVF:1; // 15 FIFO overflow
- };
- union SPIFFRX_REG {
- Uint16 all;
- struct SPIFFRX_BITS bit;
- };
- //--------------------------------------------
- // SPI FIFO control register bit definitions:
- //
- //
- struct SPIFFCT_BITS { // bits description
- Uint16 TXDLY:8; // 7:0 FIFO transmit delay
- Uint16 rsvd:8; // 15:8 reserved
- };
- union SPIFFCT_REG {
- Uint16 all;
- struct SPIFFCT_BITS bit;
- };
- //---------------------------------------------
- // SPI configuration register bit definitions:
- //
- //
- struct SPICCR_BITS { // bits description
- Uint16 SPICHAR:4; // 3:0 Character length control
- Uint16 SPILBK:1; // 4 Loop-back enable/disable
- Uint16 rsvd1:1; // 5 reserved
- Uint16 CLKPOLARITY:1; // 6 Clock polarity
- Uint16 RESET:1; // 7 SPI SW Reset
- Uint16 rsvd2:8; // 15:8 reserved
- };
- union SPICCR_REG {
- Uint16 all;
- struct SPICCR_BITS bit;
- };
- //-------------------------------------------------
- // SPI operation control register bit definitions:
- //
- //
- struct SPICTL_BITS { // bits description
- Uint16 SPIINTENA:1; // 0 Interrupt enable
- Uint16 TALK:1; // 1 Master/Slave transmit enable
- Uint16 MASTER_SLAVE:1; // 2 Network control mode
- Uint16 CLK_PHASE:1; // 3 Clock phase select
- Uint16 OVERRUN:1; // 4 Overrun interrupt enable
- Uint16 rsvd:11; // 15:5 reserved
- };
- union SPICTL_REG {
- Uint16 all;
- struct SPICTL_BITS bit;
- };
- //--------------------------------------
- // SPI status register bit definitions:
- //
- //
- struct SPISTS_BITS { // bits description
- Uint16 rsvd1:5; // 4:0 reserved
- Uint16 BUFFULL_FLAG:1; // 5 SPI transmit buffer full flag
- Uint16 INT_FLAG:1; // 6 SPI interrupt flag
- Uint16 OVERRUN_FLAG:1; // 7 SPI reciever overrun flag
- Uint16 rsvd2:8; // 15:8 reserved
- };
- union SPISTS_REG {
- Uint16 all;
- struct SPISTS_BITS bit;
- };
- //------------------------------------------------
- // SPI priority control register bit definitions:
- //
- //
- struct SPIPRI_BITS { // bits description
- Uint16 rsvd1:4; // 3:0 reserved
- Uint16 FREE:1; // 4 Free emulation mode control
- Uint16 SOFT:1; // 5 Soft emulation mode control
- Uint16 PRIORITY:1; // 6 Interrupt priority select
- Uint16 rsvd2:9; // 15:7 reserved
- };
- union SPIPRI_REG {
- Uint16 all;
- struct SPIPRI_BITS bit;
- };
- //---------------------------------------------------------------------------
- // SPI Register File:
- //
- struct SPI_REGS {
- union SPICCR_REG SPICCR; // Configuration register
- union SPICTL_REG SPICTL; // Operation control register
- union SPISTS_REG SPISTS; // Status register
- Uint16 rsvd1; // reserved
- Uint16 SPIBRR; // Baud Rate
- Uint16 rsvd2; // reserved
- Uint16 SPIRXEMU; // Emulation buffer
- Uint16 SPIRXBUF; // Serial input buffer
- Uint16 SPITXBUF; // Serial output buffer
- Uint16 SPIDAT; // Serial data
- union SPIFFTX_REG SPIFFTX; // FIFO transmit register
- union SPIFFRX_REG SPIFFRX; // FIFO recieve register
- union SPIFFCT_REG SPIFFCT; // FIFO control register
- Uint16 rsvd3[2]; // reserved
- union SPIPRI_REG SPIPRI; // FIFO Priority control
- };
- //---------------------------------------------------------------------------
- // SPI External References & Function Declarations:
- //
- extern volatile struct SPI_REGS SpiaRegs;
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_Sci.h
- //
- // TITLE: DSP28 Device SCI Register Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | No change
- //###########################################################################
- //---------------------------------------------------------------------------
- // SCI Individual Register Bit Definitions
- //----------------------------------------------------------
- // SCICCR communication control register bit definitions:
- //
- struct SCICCR_BITS { // bit description
- Uint16 SCICHAR:3; // 2:0 Character length control
- Uint16 ADDRIDLE_MODE:1; // 3 ADDR/IDLE Mode control
- Uint16 LOOPBKENA:1; // 4 Loop Back enable
- Uint16 PARITYENA:1; // 5 Parity enable
- Uint16 PARITY:1; // 6 Even or Odd Parity
- Uint16 STOPBITS:1; // 7 Number of Stop Bits
- Uint16 rsvd1:8; // 15:8 reserved
- };
- union SCICCR_REG {
- Uint16 all;
- struct SCICCR_BITS bit;
- };
- //-------------------------------------------
- // SCICTL1 control register 1 bit definitions:
- //
- struct SCICTL1_BITS { // bit description
- Uint16 RXENA:1; // 0 SCI receiver enable
- Uint16 TXENA:1; // 1 SCI transmitter enable
- Uint16 SLEEP:1; // 2 SCI sleep
- Uint16 TXWAKE:1; // 3 Transmitter wakeup method
- Uint16 rsvd:1; // 4 reserved
- Uint16 SWRESET:1; // 5 Software reset
- Uint16 RXERRINTENA:1; // 6 Recieve interrupt enable
- Uint16 rsvd1:9; // 15:7 reserved
- };
- union SCICTL1_REG {
- Uint16 all;
- struct SCICTL1_BITS bit;
- };
- //---------------------------------------------
- // SCICTL2 control register 2 bit definitions:
- //
- struct SCICTL2_BITS { // bit description
- Uint16 TXINTENA:1; // 0 Transmit interrupt enable
- Uint16 RXBKINTENA:1; // 1 Receiver-buffer break enable
- Uint16 rsvd:4; // 5:2 reserved
- Uint16 TXEMPTY:1; // 6 Transmitter empty flag
- Uint16 TXRDY:1; // 7 Transmitter ready flag
- Uint16 rsvd1:8; // 15:8 reserved
- };
- union SCICTL2_REG {
- Uint16 all;
- struct SCICTL2_BITS bit;
- };
- //---------------------------------------------------
- // SCIRXST Receiver status register bit definitions:
- //
- struct SCIRXST_BITS { // bit description
- Uint16 rsvd:1; // 0 reserved
- Uint16 RXWAKE:1; // 1 Receiver wakeup detect flag
- Uint16 PE:1; // 2 Parity error flag
- Uint16 OE:1; // 3 Overrun error flag
- Uint16 FE:1; // 4 Framing error flag
- Uint16 BRKDT:1; // 5 Break-detect flag
- Uint16 RXRDY:1; // 6 Receiver ready flag
- Uint16 RXERR:1; // 7 Receiver error flag
- };
- union SCIRXST_REG {
- Uint16 all;
- struct SCIRXST_BITS bit;
- };
- //----------------------------------------------------
- // SCIRXBUF Receiver Data Buffer with FIFO bit definitions:
- //
- struct SCIRXBUF_BITS { // bits description
- Uint16 RXDT:8; // 7:0 Receive word
- Uint16 rsvd:6; // 13:8 reserved
- Uint16 SCIFFPE:1; // 14 SCI PE error in FIFO mode
- Uint16 SCIFFFE:1; // 15 SCI FE error in FIFO mode
- };
- union SCIRXBUF_REG {
- Uint16 all;
- struct SCIRXBUF_BITS bit;
- };
- //--------------------------------------------------
- // SCIPRI Priority control register bit definitions:
- //
- //
- struct SCIPRI_BITS { // bit description
- Uint16 rsvd:3; // 2:0 reserved
- Uint16 FREE:1; // 3 Free emulation suspend mode
- Uint16 SOFT:1; // 4 Soft emulation suspend mode
- Uint16 rsvd1:3; // 7:5 reserved
- };
- union SCIPRI_REG {
- Uint16 all;
- struct SCIPRI_BITS bit;
- };
- //-------------------------------------------------
- // SCI FIFO Transmit register bit definitions:
- //
- //
- struct SCIFFTX_BITS { // bit description
- Uint16 TXFFILIL:5; // 4:0 Interrupt level
- Uint16 TXFFIENA:1; // 5 Interrupt enable
- Uint16 TXINTCLR:1; // 6 Clear INT flag
- Uint16 TXFFINT:1; // 7 INT flag
- Uint16 TXFFST:5; // 12:8 FIFO status
- Uint16 TXFIFOXRESET:1; // 13 FIFO reset
- Uint16 SCIFFENA:1; // 14 Enhancement enable
- Uint16 resvd:1; // 15 reserved
- };
- union SCIFFTX_REG {
- Uint16 all;
- struct SCIFFTX_BITS bit;
- };
- //------------------------------------------------
- // SCI FIFO recieve register bit definitions:
- //
- //
- struct SCIFFRX_BITS { // bits description
- Uint16 RXFFIL:5; // 4:0 Interrupt level
- Uint16 RXFFIENA:1; // 5 Interrupt enable
- Uint16 RXFFINTCLR:1; // 6 Clear INT flag
- Uint16 RXFFINT:1; // 7 INT flag
- Uint16 RXFIFST:5; // 12:8 FIFO status
- Uint16 RXFIFORESET:1; // 13 FIFO reset
- Uint16 RXOVF_CLR:1; // 14 Clear overflow
- Uint16 RXFFOVF:1; // 15 FIFO overflow
- };
- union SCIFFRX_REG {
- Uint16 all;
- struct SCIFFRX_BITS bit;
- };
- // SCI FIFO control register bit definitions:
- struct SCIFFCT_BITS { // bits description
- Uint16 FFTXDLY:8; // 7:0 FIFO transmit delay
- Uint16 rsvd:5; // 12:8 reserved
- Uint16 CDC:1; // 13 Auto baud mode enable
- Uint16 ABDCLR:1; // 14 Auto baud clear
- Uint16 ABD:1; // 15 Auto baud detect
- };
- union SCIFFCT_REG {
- Uint16 all;
- struct SCIFFCT_BITS bit;
- };
- //---------------------------------------------------------------------------
- // SCI Register File:
- //
- struct SCI_REGS {
- union SCICCR_REG SCICCR; // Communications control register
- union SCICTL1_REG SCICTL1; // Control register 1
- Uint16 SCIHBAUD; // Baud rate (high) register
- Uint16 SCILBAUD; // Baud rate (low) register
- union SCICTL2_REG SCICTL2; // Control register 2
- union SCIRXST_REG SCIRXST; // Recieve status register
- Uint16 SCIRXEMU; // Recieve emulation buffer register
- union SCIRXBUF_REG SCIRXBUF; // Recieve data buffer
- Uint16 rsvd1; // reserved
- Uint16 SCITXBUF; // Transmit data buffer
- union SCIFFTX_REG SCIFFTX; // FIFO transmit register
- union SCIFFRX_REG SCIFFRX; // FIFO recieve register
- union SCIFFCT_REG SCIFFCT; // FIFO control register
- Uint16 rsvd2; // reserved
- Uint16 rsvd3; // reserved
- union SCIPRI_REG SCIPRI; // FIFO Priority control
- };
- //---------------------------------------------------------------------------
- // SCI External References & Function Declarations:
- //
- extern volatile struct SCI_REGS SciaRegs;
- extern volatile struct SCI_REGS ScibRegs;
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_Mcbsp.h
- //
- // TITLE: DSP28 Device McBSP Register Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | No change
- //###########################################################################
- //---------------------------------------------------------------------------
- // McBSP Individual Register Bit Definitions:
- //
- // McBSP DRR2 register bit definitions:
- struct DRR2_BITS { // bit description
- Uint16 HWLB:8; // 16:23 High word low byte
- Uint16 HWHB:8; // 24:31 High word high byte
- };
- union DRR2_REG {
- Uint16 all;
- struct DRR2_BITS bit;
- };
- // McBSP DRR1 register bit definitions:
- struct DRR1_BITS { // bit description
- Uint16 LWLB:8; // 16:23 Low word low byte
- Uint16 LWHB:8; // 24:31 low word high byte
- };
- union DRR1_REG {
- Uint16 all;
- struct DRR1_BITS bit;
- };
- // McBSP DXR2 register bit definitions:
- struct DXR2_BITS { // bit description
- Uint16 HWLB:8; // 16:23 High word low byte
- Uint16 HWHB:8; // 24:31 High word high byte
- };
- union DXR2_REG {
- Uint16 all;
- struct DXR2_BITS bit;
- };
- // McBSP DXR1 register bit definitions:
- struct DXR1_BITS { // bit description
- Uint16 LWLB:8; // 16:23 Low word low byte
- Uint16 LWHB:8; // 24:31 low word high byte
- };
- union DXR1_REG {
- Uint16 all;
- struct DXR1_BITS bit;
- };
- // SPCR2 control register bit definitions:
- struct SPCR2_BITS { // bit description
- Uint16 XRST:1; // 0 transmit reset
- Uint16 XRDY:1; // 1 transmit ready
- Uint16 XEMPTY:1; // 2 Transmit empty
- Uint16 XSYNCERR:1; // 3 Transmit syn errorINT flag
- Uint16 XINTM:2; // 5:4 Transmit interrupt types
- Uint16 GRST:1; // 6 CLKG reset
- Uint16 FRST:1; // 7 Frame sync reset
- Uint16 SOFT:1; // 8 SOFT bit
- Uint16 FREE:1; // 9 FREE bit
- Uint16 rsvd:6; // 15:10 reserved
- };
- union SPCR2_REG {
- Uint16 all;
- struct SPCR2_BITS bit;
- };
- // SPCR1 control register bit definitions:
- struct SPCR1_BITS { // bit description
- Uint16 RRST:1; // 0 Receive reset
- Uint16 RRDY:1; // 1 Receive ready
- Uint16 REMPTY:1; // 2 Receive empty
- Uint16 RSYNCERR:1; // 7 Receive syn errorINT flag
- Uint16 RINTM:2; // 5:4 Receive interrupt types
- Uint16 ABIS:1; // 6 ABIS mode select
- Uint16 DXENA:1; // 7 DX hi-z enable
- Uint16 rsvd:3; // 10:8 reserved
- Uint16 CLKSTP:2; // 12:11 CLKSTOP mode bit
- Uint16 RJUST:2; // 13:14 Right justified
- Uint16 DLB:1; // 15 Digital loop back reserved
- };
- union SPCR1_REG {
- Uint16 all;
- struct SPCR1_BITS bit;
- };
- // RCR2 control register bit definitions:
- struct RCR2_BITS { // bit description
- Uint16 RDATDLY:2; // 1:0 Receive data delay
- Uint16 RFIG:1; // 2 Receive frame sync ignore
- Uint16 RCOMPAND:2; // 4:3 Receive Companding Mode selects
- Uint16 RWDLEN2:3; // 7:5 Receive word length
- Uint16 RFRLEN2:7; // 14:8 Receive Frame sync
- Uint16 RPHASE:1; // 15 Receive Phase
- };
- union RCR2_REG {
- Uint16 all;
- struct RCR2_BITS bit;
- };
- // RCR1 control register bit definitions:
- struct RCR1_BITS { // bit description
- Uint16 rsvd1:5; // 4:0 reserved
- Uint16 RWDLEN1:3; // 7:5 Receive word length
- Uint16 RFRLEN1:7; // 14:8 Receive Frame sync
- Uint16 rsvd2:1; // 15 reserved
- };
- union RCR1_REG {
- Uint16 all;
- struct RCR1_BITS bit;
- };
- // XCR2 control register bit definitions:
- struct XCR2_BITS { // bit description
- Uint16 XDATDLY:2; // 1:0 Transmit data delay
- Uint16 XFIG:1; // 2 Transmit frame sync ignore
- Uint16 XCOMPAND:2; // 4:3 Transmit Companding Mode selects
- Uint16 XWDLEN2:3; // 7:5 Transmit word length
- Uint16 XFRLEN2:7; // 14:8 Transmit Frame sync
- Uint16 XPHASE:1; // 15 Transmit Phase
- };
- union XCR2_REG {
- Uint16 all;
- struct XCR2_BITS bit;
- };
- // XCR1 control register bit definitions:
- struct XCR1_BITS { // bit description
- Uint16 rsvd1:5; // 4:0 reserved
- Uint16 XWDLEN1:3; // 7:5 Transmit word length
- Uint16 XFRLEN1:7; // 14:8 Transmit Frame sync
- Uint16 rsvd2:1; // 15 reserved
- };
- union XCR1_REG {
- Uint16 all;
- struct XCR1_BITS bit;
- };
- // SRGR2 Sample rate generator control register bit definitions:
- struct SRGR2_BITS { // bit description
- Uint16 FPER:12; // 11:0 Frame period
- Uint16 FSGM:1; // 12 Frame sync generator mode
- Uint16 CLKSM:1; // 13 Sample rate generator mode
- Uint16 CLKSP:1; // 14 Reserved in this McBSP
- Uint16 GYSNC:1; // 15 CLKG sync
- };
- union SRGR2_REG {
- Uint16 all;
- struct SRGR2_BITS bit;
- };
- // SRGR1 control register bit definitions:
- struct SRGR1_BITS { // bit description
- Uint16 CLKGDV:8; // 7:0 CLKG divider
- Uint16 FWID:8; // 15:8 Frame width
- };
- union SRGR1_REG {
- Uint16 all;
- struct SRGR1_BITS bit;
- };
- // MCR2 Multichannel control register bit definitions:
- struct MCR2_BITS { // bit description
- Uint16 XMCM:2; // 1:0 Transmit multichannel mode
- Uint16 XCBLK:3; // 2:4 Transmit current block
- Uint16 XPABLK:2; // 5:6 Transmit partition A Block
- Uint16 XPBBLK:2; // 7:8 Transmit partition B Block
- Uint16 XMCME:1; // 9 Transmit multi-channel enhance mode
- Uint16 rsvd:6; // 15:10 reserved
- };
- union MCR2_REG {
- Uint16 all;
- struct MCR2_BITS bit;
- };
- // MCR1 Multichannel control register bit definitions:
- struct MCR1_BITS { // bit description
- Uint16 RMCM:1; // 0 Receive multichannel mode
- Uint16 rsvd:1; // 1 reserved
- Uint16 RCBLK:3; // 4:2 Receive current block
- Uint16 RPABLK:2; // 6:5 Receive partition A Block
- Uint16 RPBBLK:2; // 7:8 Receive partition B Block
- Uint16 RMCME:1; // 9 Receive multi-channel enhance mode
- Uint16 rsvd1:6; // 15:10 reserved
- };
- union MCR1_REG {
- Uint16 all;
- struct MCR1_BITS bit;
- };
- // RCERA control register bit definitions:
- struct RCERA_BITS { // bit description
- Uint16 RCEA0:1; // 0 Receive Channel enable bit
- Uint16 RCEA1:1; // 1 Receive Channel enable bit
- Uint16 RCEA2:1; // 2 Receive Channel enable bit
- Uint16 RCEA3:1; // 3 Receive Channel enable bit
- Uint16 RCEA4:1; // 4 Receive Channel enable bit
- Uint16 RCEA5:1; // 5 Receive Channel enable bit
- Uint16 RCEA6:1; // 6 Receive Channel enable bit
- Uint16 RCEA7:1; // 7 Receive Channel enable bit
- Uint16 RCEA8:1; // 8 Receive Channel enable bit
- Uint16 RCEA9:1; // 9 Receive Channel enable bit
- Uint16 RCEA10:1; // 10 Receive Channel enable bit
- Uint16 RCEA11:1; // 11 Receive Channel enable bit
- Uint16 RCEA12:1; // 12 Receive Channel enable bit
- Uint16 RCEA13:1; // 13 Receive Channel enable bit
- Uint16 RCEA14:1; // 14 Receive Channel enable bit
- Uint16 RCEA15:1; // 15 Receive Channel enable bit
- };
- union RCERA_REG {
- Uint16 all;
- struct RCERA_BITS bit;
- };
- // RCERB control register bit definitions:
- struct RCERB_BITS { // bit description
- Uint16 RCEB0:1; // 0 Receive Channel enable bit
- Uint16 RCEB1:1; // 1 Receive Channel enable bit
- Uint16 RCEB2:1; // 2 Receive Channel enable bit
- Uint16 RCEB3:1; // 3 Receive Channel enable bit
- Uint16 RCEB4:1; // 4 Receive Channel enable bit
- Uint16 RCEB5:1; // 5 Receive Channel enable bit
- Uint16 RCEB6:1; // 6 Receive Channel enable bit
- Uint16 RCEB7:1; // 7 Receive Channel enable bit
- Uint16 RCEB8:1; // 8 Receive Channel enable bit
- Uint16 RCEB9:1; // 9 Receive Channel enable bit
- Uint16 RCEB10:1; // 10 Receive Channel enable bit
- Uint16 RCEB11:1; // 11 Receive Channel enable bit
- Uint16 RCEB12:1; // 12 Receive Channel enable bit
- Uint16 RCEB13:1; // 13 Receive Channel enable bit
- Uint16 RCEB14:1; // 14 Receive Channel enable bit
- Uint16 RCEB15:1; // 15 Receive Channel enable bit
- };
- union RCERB_REG {
- Uint16 all;
- struct RCERB_BITS bit;
- };
- // XCERA control register bit definitions:
- struct XCERA_BITS { // bit description
- Uint16 XCEA0:1; // 0 Receive Channel enable bit
- Uint16 XCEA1:1; // 1 Receive Channel enable bit
- Uint16 XCEA2:1; // 2 Receive Channel enable bit
- Uint16 XCEA3:1; // 3 Receive Channel enable bit
- Uint16 XCEA4:1; // 4 Receive Channel enable bit
- Uint16 XCEA5:1; // 5 Receive Channel enable bit
- Uint16 XCEA6:1; // 6 Receive Channel enable bit
- Uint16 XCEA7:1; // 7 Receive Channel enable bit
- Uint16 XCEA8:1; // 8 Receive Channel enable bit
- Uint16 XCEA9:1; // 9 Receive Channel enable bit
- Uint16 XCEA10:1; // 10 Receive Channel enable bit
- Uint16 XCEA11:1; // 11 Receive Channel enable bit
- Uint16 XCEA12:1; // 12 Receive Channel enable bit
- Uint16 XCEA13:1; // 13 Receive Channel enable bit
- Uint16 XCEA14:1; // 14 Receive Channel enable bit
- Uint16 XCEA15:1; // 15 Receive Channel enable bit
- };
- union XCERA_REG {
- Uint16 all;
- struct XCERA_BITS bit;
- };
- // XCERB control register bit definitions:
- struct XCERB_BITS { // bit description
- Uint16 XCEB0:1; // 0 Receive Channel enable bit
- Uint16 XCEB1:1; // 1 Receive Channel enable bit
- Uint16 XCEB2:1; // 2 Receive Channel enable bit
- Uint16 XCEB3:1; // 3 Receive Channel enable bit
- Uint16 XCEB4:1; // 4 Receive Channel enable bit
- Uint16 XCEB5:1; // 5 Receive Channel enable bit
- Uint16 XCEB6:1; // 6 Receive Channel enable bit
- Uint16 XCEB7:1; // 7 Receive Channel enable bit
- Uint16 XCEB8:1; // 8 Receive Channel enable bit
- Uint16 XCEB9:1; // 9 Receive Channel enable bit
- Uint16 XCEB10:1; // 10 Receive Channel enable bit
- Uint16 XCEB11:1; // 11 Receive Channel enable bit
- Uint16 XCEB12:1; // 12 Receive Channel enable bit
- Uint16 XCEB13:1; // 13 Receive Channel enable bit
- Uint16 XCEB14:1; // 14 Receive Channel enable bit
- Uint16 XCEB15:1; // 15 Receive Channel enable bit
- };
- union XCERB_REG {
- Uint16 all;
- struct XCERB_BITS bit;
- };
- // PCR1 control register bit definitions:
- struct PCR1_BITS { // bit description
- Uint16 CLKRP:1; // 0 Receive Clock polarity
- Uint16 CLKXP:1; // 1 Transmit clock polarity
- Uint16 FSRP:1; // 2 Receive Frame synchronization polarity
- Uint16 FSXP:1; // 3 Transmit Frame synchronization polarity
- Uint16 DR_STAT:1; // 4 DR pin status - reserved for this McBSP
- Uint16 DX_STAT:1; // 5 DX pin status - reserved for this McBSP
- Uint16 CLKS_STAT:1; // 6 CLKS pin status - reserved for 28x -McBSP
- Uint16 SCLKME:1; // 7 Enhanced sample clock mode selection bit.
- Uint16 CLKRM:1; // 8 Receiver Clock Mode
- Uint16 CLKXM:1; // 9 Transmitter Clock Mode.
- Uint16 FSRM:1; // 10 Receive Frame Synchronization Mode
- Uint16 FSXM:1; // 11 Transmit Frame Synchronization Mode
- Uint16 RIOEN:1; // 12 General Purpose I/O Mode - reserved in this 28x-McBSP
- Uint16 XIOEN:1; // 13 General Purpose I/O Mode - reserved in this 28x-McBSP
- Uint16 IDEL_EN:1; // 14 reserved in this 28x-McBSP
- Uint16 rsvd:1 ; // 15 reserved
- };
- union PCR1_REG {
- Uint16 all;
- struct PCR1_BITS bit;
- };
- // RCERC control register bit definitions:
- struct RCERC_BITS { // bit description
- Uint16 RCEC0:1; // 0 Receive Channel enable bit
- Uint16 RCEC1:1; // 1 Receive Channel enable bit
- Uint16 RCEC2:1; // 2 Receive Channel enable bit
- Uint16 RCEC3:1; // 3 Receive Channel enable bit
- Uint16 RCEC4:1; // 4 Receive Channel enable bit
- Uint16 RCEC5:1; // 5 Receive Channel enable bit
- Uint16 RCEC6:1; // 6 Receive Channel enable bit
- Uint16 RCEC7:1; // 7 Receive Channel enable bit
- Uint16 RCEC8:1; // 8 Receive Channel enable bit
- Uint16 RCEC9:1; // 9 Receive Channel enable bit
- Uint16 RCEC10:1; // 10 Receive Channel enable bit
- Uint16 RCEC11:1; // 11 Receive Channel enable bit
- Uint16 RCEC12:1; // 12 Receive Channel enable bit
- Uint16 RCEC13:1; // 13 Receive Channel enable bit
- Uint16 RCEC14:1; // 14 Receive Channel enable bit
- Uint16 RCEC15:1; // 15 Receive Channel enable bit
- };
- union RCERC_REG {
- Uint16 all;
- struct RCERC_BITS bit;
- };
- // RCERD control register bit definitions:
- struct RCERD_BITS { // bit description
- Uint16 RCED0:1; // 0 Receive Channel enable bit
- Uint16 RCED1:1; // 1 Receive Channel enable bit
- Uint16 RCED2:1; // 2 Receive Channel enable bit
- Uint16 RCED3:1; // 3 Receive Channel enable bit
- Uint16 RCED4:1; // 4 Receive Channel enable bit
- Uint16 RCED5:1; // 5 Receive Channel enable bit
- Uint16 RCED6:1; // 6 Receive Channel enable bit
- Uint16 RCED7:1; // 7 Receive Channel enable bit
- Uint16 RCED8:1; // 8 Receive Channel enable bit
- Uint16 RCED9:1; // 9 Receive Channel enable bit
- Uint16 RCED10:1; // 10 Receive Channel enable bit
- Uint16 RCED11:1; // 11 Receive Channel enable bit
- Uint16 RCED12:1; // 12 Receive Channel enable bit
- Uint16 RCED13:1; // 13 Receive Channel enable bit
- Uint16 RCED14:1; // 14 Receive Channel enable bit
- Uint16 RCED15:1; // 15 Receive Channel enable bit
- };
- union RCERD_REG {
- Uint16 all;
- struct RCERD_BITS bit;
- };
- // XCERC control register bit definitions:
- struct XCERC_BITS { // bit description
- Uint16 XCEC0:1; // 0 Receive Channel enable bit
- Uint16 XCEC1:1; // 1 Receive Channel enable bit
- Uint16 XCEC2:1; // 2 Receive Channel enable bit
- Uint16 XCEC3:1; // 3 Receive Channel enable bit
- Uint16 XCEC4:1; // 4 Receive Channel enable bit
- Uint16 XCEC5:1; // 5 Receive Channel enable bit
- Uint16 XCEC6:1; // 6 Receive Channel enable bit
- Uint16 XCEC7:1; // 7 Receive Channel enable bit
- Uint16 XCEC8:1; // 8 Receive Channel enable bit
- Uint16 XCEC9:1; // 9 Receive Channel enable bit
- Uint16 XCEC10:1; // 10 Receive Channel enable bit
- Uint16 XCEC11:1; // 11 Receive Channel enable bit
- Uint16 XCEC12:1; // 12 Receive Channel enable bit
- Uint16 XCEC13:1; // 13 Receive Channel enable bit
- Uint16 XCEC14:1; // 14 Receive Channel enable bit
- Uint16 XCEC15:1; // 15 Receive Channel enable bit
- };
- union XCERC_REG {
- Uint16 all;
- struct XCERC_BITS bit;
- };
- // XCERD control register bit definitions:
- struct XCERD_BITS { // bit description
- Uint16 XCED0:1; // 0 Receive Channel enable bit
- Uint16 XCED1:1; // 1 Receive Channel enable bit
- Uint16 XCED2:1; // 2 Receive Channel enable bit
- Uint16 XCED3:1; // 3 Receive Channel enable bit
- Uint16 XCED4:1; // 4 Receive Channel enable bit
- Uint16 XCED5:1; // 5 Receive Channel enable bit
- Uint16 XCED6:1; // 6 Receive Channel enable bit
- Uint16 XCED7:1; // 7 Receive Channel enable bit
- Uint16 XCED8:1; // 8 Receive Channel enable bit
- Uint16 XCED9:1; // 9 Receive Channel enable bit
- Uint16 XCED10:1; // 10 Receive Channel enable bit
- Uint16 XCED11:1; // 11 Receive Channel enable bit
- Uint16 XCED12:1; // 12 Receive Channel enable bit
- Uint16 XCED13:1; // 13 Receive Channel enable bit
- Uint16 XCED14:1; // 14 Receive Channel enable bit
- Uint16 XCED15:1; // 15 Receive Channel enable bit
- };
- union XCERD_REG {
- Uint16 all;
- struct XCERD_BITS bit;
- };
- // RCERE control register bit definitions:
- struct RCERE_BITS { // bit description
- Uint16 RCEE0:1; // 0 Receive Channel enable bit
- Uint16 RCEE1:1; // 1 Receive Channel enable bit
- Uint16 RCEE2:1; // 2 Receive Channel enable bit
- Uint16 RCEE3:1; // 3 Receive Channel enable bit
- Uint16 RCEE4:1; // 4 Receive Channel enable bit
- Uint16 RCEE5:1; // 5 Receive Channel enable bit
- Uint16 RCEE6:1; // 6 Receive Channel enable bit
- Uint16 RCEE7:1; // 7 Receive Channel enable bit
- Uint16 RCEE8:1; // 8 Receive Channel enable bit
- Uint16 RCEE9:1; // 9 Receive Channel enable bit
- Uint16 RCEE10:1; // 10 Receive Channel enable bit
- Uint16 RCEE11:1; // 11 Receive Channel enable bit
- Uint16 RCEE12:1; // 12 Receive Channel enable bit
- Uint16 RCEE13:1; // 13 Receive Channel enable bit
- Uint16 RCEE14:1; // 14 Receive Channel enable bit
- Uint16 RCEE15:1; // 15 Receive Channel enable bit
- };
- union RCERE_REG {
- Uint16 all;
- struct RCERE_BITS bit;
- };
- // RCERF control register bit definitions:
- struct RCERF_BITS { // bit description
- Uint16 RCEF0:1; // 0 Receive Channel enable bit
- Uint16 RCEF1:1; // 1 Receive Channel enable bit
- Uint16 RCEF2:1; // 2 Receive Channel enable bit
- Uint16 RCEF3:1; // 3 Receive Channel enable bit
- Uint16 RCEF4:1; // 4 Receive Channel enable bit
- Uint16 RCEF5:1; // 5 Receive Channel enable bit
- Uint16 RCEF6:1; // 6 Receive Channel enable bit
- Uint16 RCEF7:1; // 7 Receive Channel enable bit
- Uint16 RCEF8:1; // 8 Receive Channel enable bit
- Uint16 RCEF9:1; // 9 Receive Channel enable bit
- Uint16 RCEF10:1; // 10 Receive Channel enable bit
- Uint16 RCEF11:1; // 11 Receive Channel enable bit
- Uint16 RCEF12:1; // 12 Receive Channel enable bit
- Uint16 RCEF13:1; // 13 Receive Channel enable bit
- Uint16 RCEF14:1; // 14 Receive Channel enable bit
- Uint16 RCEF15:1; // 15 Receive Channel enable bit
- };
- union RCERF_REG {
- Uint16 all;
- struct RCERF_BITS bit;
- };
- // XCERE control register bit definitions:
- struct XCERE_BITS { // bit description
- Uint16 XCEE0:1; // 0 Receive Channel enable bit
- Uint16 XCEE1:1; // 1 Receive Channel enable bit
- Uint16 XCEE2:1; // 2 Receive Channel enable bit
- Uint16 XCEE3:1; // 3 Receive Channel enable bit
- Uint16 XCEE4:1; // 4 Receive Channel enable bit
- Uint16 XCEE5:1; // 5 Receive Channel enable bit
- Uint16 XCEE6:1; // 6 Receive Channel enable bit
- Uint16 XCEE7:1; // 7 Receive Channel enable bit
- Uint16 XCEE8:1; // 8 Receive Channel enable bit
- Uint16 XCEE9:1; // 9 Receive Channel enable bit
- Uint16 XCEE10:1; // 10 Receive Channel enable bit
- Uint16 XCEE11:1; // 11 Receive Channel enable bit
- Uint16 XCEE12:1; // 12 Receive Channel enable bit
- Uint16 XCEE13:1; // 13 Receive Channel enable bit
- Uint16 XCEE14:1; // 14 Receive Channel enable bit
- Uint16 XCEE15:1; // 15 Receive Channel enable bit
- };
- union XCERE_REG {
- Uint16 all;
- struct XCERE_BITS bit;
- };
- // XCERF control register bit definitions:
- struct XCERF_BITS { // bit description
- Uint16 XCEF0:1; // 0 Receive Channel enable bit
- Uint16 XCEF1:1; // 1 Receive Channel enable bit
- Uint16 XCEF2:1; // 2 Receive Channel enable bit
- Uint16 XCEF3:1; // 3 Receive Channel enable bit
- Uint16 XCEF4:1; // 4 Receive Channel enable bit
- Uint16 XCEF5:1; // 5 Receive Channel enable bit
- Uint16 XCEF6:1; // 6 Receive Channel enable bit
- Uint16 XCEF7:1; // 7 Receive Channel enable bit
- Uint16 XCEF8:1; // 8 Receive Channel enable bit
- Uint16 XCEF9:1; // 9 Receive Channel enable bit
- Uint16 XCEF10:1; // 10 Receive Channel enable bit
- Uint16 XCEF11:1; // 11 Receive Channel enable bit
- Uint16 XCEF12:1; // 12 Receive Channel enable bit
- Uint16 XCEF13:1; // 13 Receive Channel enable bit
- Uint16 XCEF14:1; // 14 Receive Channel enable bit
- Uint16 XCEF15:1; // 15 Receive Channel enable bit
- };
- union XCERF_REG {
- Uint16 all;
- struct XCERF_BITS bit;
- };
- // RCERG control register bit definitions:
- struct RCERG_BITS { // bit description
- Uint16 RCEG0:1; // 0 Receive Channel enable bit
- Uint16 RCEG1:1; // 1 Receive Channel enable bit
- Uint16 RCEG2:1; // 2 Receive Channel enable bit
- Uint16 RCEG3:1; // 3 Receive Channel enable bit
- Uint16 RCEG4:1; // 4 Receive Channel enable bit
- Uint16 RCEG5:1; // 5 Receive Channel enable bit
- Uint16 RCEG6:1; // 6 Receive Channel enable bit
- Uint16 RCEG7:1; // 7 Receive Channel enable bit
- Uint16 RCEG8:1; // 8 Receive Channel enable bit
- Uint16 RCEG9:1; // 9 Receive Channel enable bit
- Uint16 RCEG10:1; // 10 Receive Channel enable bit
- Uint16 RCEG11:1; // 11 Receive Channel enable bit
- Uint16 RCEG12:1; // 12 Receive Channel enable bit
- Uint16 RCEG13:1; // 13 Receive Channel enable bit
- Uint16 RCEG14:1; // 14 Receive Channel enable bit
- Uint16 RCEG15:1; // 15 Receive Channel enable bit
- };
- union RCERG_REG {
- Uint16 all;
- struct RCERG_BITS bit;
- };
- // RCERH control register bit definitions:
- struct RCERH_BITS { // bit description
- Uint16 RCEH0:1; // 0 Receive Channel enable bit
- Uint16 RCEH1:1; // 1 Receive Channel enable bit
- Uint16 RCEH2:1; // 2 Receive Channel enable bit
- Uint16 RCEH3:1; // 3 Receive Channel enable bit
- Uint16 RCEH4:1; // 4 Receive Channel enable bit
- Uint16 RCEH5:1; // 5 Receive Channel enable bit
- Uint16 RCEH6:1; // 6 Receive Channel enable bit
- Uint16 RCEH7:1; // 7 Receive Channel enable bit
- Uint16 RCEH8:1; // 8 Receive Channel enable bit
- Uint16 RCEH9:1; // 9 Receive Channel enable bit
- Uint16 RCEH10:1; // 10 Receive Channel enable bit
- Uint16 RCEH11:1; // 11 Receive Channel enable bit
- Uint16 RCEH12:1; // 12 Receive Channel enable bit
- Uint16 RCEH13:1; // 13 Receive Channel enable bit
- Uint16 RCEH14:1; // 14 Receive Channel enable bit
- Uint16 RCEH15:1; // 15 Receive Channel enable bit
- };
- union RCERH_REG {
- Uint16 all;
- struct RCERH_BITS bit;
- };
- // XCERG control register bit definitions:
- struct XCERG_BITS { // bit description
- Uint16 XCEG0:1; // 0 Receive Channel enable bit
- Uint16 XCEG1:1; // 1 Receive Channel enable bit
- Uint16 XCEG2:1; // 2 Receive Channel enable bit
- Uint16 XCEG3:1; // 3 Receive Channel enable bit
- Uint16 XCEG4:1; // 4 Receive Channel enable bit
- Uint16 XCEG5:1; // 5 Receive Channel enable bit
- Uint16 XCEG6:1; // 6 Receive Channel enable bit
- Uint16 XCEG7:1; // 7 Receive Channel enable bit
- Uint16 XCEG8:1; // 8 Receive Channel enable bit
- Uint16 XCEG9:1; // 9 Receive Channel enable bit
- Uint16 XCEG10:1; // 10 Receive Channel enable bit
- Uint16 XCEG11:1; // 11 Receive Channel enable bit
- Uint16 XCEG12:1; // 12 Receive Channel enable bit
- Uint16 XCEG13:1; // 13 Receive Channel enable bit
- Uint16 XCEG14:1; // 14 Receive Channel enable bit
- Uint16 XCEG15:1; // 15 Receive Channel enable bit
- };
- union XCERG_REG {
- Uint16 all;
- struct XCERG_BITS bit;
- };
- // XCERH control register bit definitions:
- struct XCERH_BITS { // bit description
- Uint16 XCEH0:1; // 0 Receive Channel enable bit
- Uint16 XCEH1:1; // 1 Receive Channel enable bit
- Uint16 XCEH2:1; // 2 Receive Channel enable bit
- Uint16 XCEH3:1; // 3 Receive Channel enable bit
- Uint16 XCEH4:1; // 4 Receive Channel enable bit
- Uint16 XCEH5:1; // 5 Receive Channel enable bit
- Uint16 XCEH6:1; // 6 Receive Channel enable bit
- Uint16 XCEH7:1; // 7 Receive Channel enable bit
- Uint16 XCEH8:1; // 8 Receive Channel enable bit
- Uint16 XCEH9:1; // 9 Receive Channel enable bit
- Uint16 XCEH10:1; // 10 Receive Channel enable bit
- Uint16 XCEH11:1; // 11 Receive Channel enable bit
- Uint16 XCEH12:1; // 12 Receive Channel enable bit
- Uint16 XCEH13:1; // 13 Receive Channel enable bit
- Uint16 XCEH14:1; // 14 Receive Channel enable bit
- Uint16 XCEH15:1; // 15 Receive Channel enable bit
- };
- union XCERH_REG {
- Uint16 all;
- struct XCERH_BITS bit;
- };
- // McBSP FIFO Transmit register bit definitions:
- struct MFFTX_BITS { // bit description
- Uint16 IL:5; // 4:0 Interrupt level
- Uint16 TXFFIENA:1; // 5 Interrupt enable
- Uint16 INT_CLR:1; // 6 Clear INT flag
- Uint16 INT:1; // 7 INT flag
- Uint16 ST:5; // 12:8 FIFO status
- Uint16 XRESET:1; // 13 FIFO reset
- Uint16 MFFENA:1; // 14 Enhancement enable
- Uint16 rsvd:1; // 15 reserved
- };
- union MFFTX_REG {
- Uint16 all;
- struct MFFTX_BITS bit;
- };
- // McBSP FIFO recieve register bit definitions:
- struct MFFRX_BITS { // bits description
- Uint16 IL:5; // 4:0 Interrupt level
- Uint16 RXFFIENA:1; // 5 Interrupt enable
- Uint16 INT_CLR:1; // 6 Clear INT flag
- Uint16 INT:1; // 7 INT flag
- Uint16 ST:5; // 12:8 FIFO status
- Uint16 RRESET:1; // 13 FIFO reset
- Uint16 OVF_CLR:1; // 14 Clear overflow
- Uint16 OVF:1; // 15 FIFO overflow
- };
- union MFFRX_REG {
- Uint16 all;
- struct MFFRX_BITS bit;
- };
- // McBSP FIFO control register bit definitions:
- struct MFFCT_BITS { // bits description
- Uint16 TXDLY:8; // 7:0 FIFO transmit delay
- Uint16 rsvd:7; // 15:7 reserved
- Uint16 IACKM:1; // 15 is IACK mode enable bit
- };
- union MFFCT_REG {
- Uint16 all;
- struct MFFCT_BITS bit;
- };
- // McBSP FIFO INTERRUPT control register bit definitions:
- struct MFFINT_BITS { // bits description
- Uint16 XINT:1; // 0 XINT interrupt enable
- Uint16 XEVTA:1; // 1 XEVTA interrupt enable
- Uint16 RINT:1; // 2 RINT interrupt enable
- Uint16 REVTA:1; // 3 REVTA interrupt enable
- Uint16 rsvd:12; // 15:4 reserved
- };
- union MFFINT_REG {
- Uint16 all;
- struct MFFINT_BITS bit;
- };
- // McBSP FIFO INTERRUPT status register bit definitions:
- struct MFFST_BITS { // bits description
- Uint16 EOBX:1; // 0 EOBX flag
- Uint16 FSX:1; // 1 FSX flag
- Uint16 EOBR:1; // 2 EOBR flag
- Uint16 FSR:1; // 3 FSR flag
- Uint16 rsvd:12; // 15:4 reserved
- };
- union MFFST_REG {
- Uint16 all;
- struct MFFST_BITS bit;
- };
- //---------------------------------------------------------------------------
- // McBSP Register File:
- //
- struct MCBSP_REGS {
- union DRR2_REG DRR2; // 0, MCBSP Data receive register bits 31-16
- union DRR1_REG DRR1; // 1, MCBSP Data receive register bits 15-0
- union DXR2_REG DXR2; // 2, MCBSP Data transmit register bits 31-16
- union DXR1_REG DXR1; // 3, MCBSP Data transmit register bits 15-0
- union SPCR2_REG SPCR2; // 4, MCBSP control register bits 31-16
- union SPCR1_REG SPCR1; // 5, MCBSP control register bits 15-0
- union RCR2_REG RCR2; // 6, MCBSP receive control register bits 31-16
- union RCR1_REG RCR1; // 7, MCBSP receive control register bits 15-0
- union XCR2_REG XCR2; // 8, MCBSP transmit control register bits 31-16
- union XCR1_REG XCR1; // 9, MCBSP transmit control register bits 15-0
- union SRGR2_REG SRGR2; // 10, MCBSP sample rate gen register bits 31-16
- union SRGR1_REG SRGR1; // 11, MCBSP sample rate gen register bits 15-0
- union MCR2_REG MCR2; // 12, MCBSP multichannel register bits 31-16
- union MCR1_REG MCR1; // 13, MCBSP multichannel register bits 15-0
- union RCERA_REG RCERA; // 14, MCBSP Receive channel enable partition A
- union RCERB_REG RCERB; // 15, MCBSP Receive channel enable partition B
- union XCERA_REG XCERA; // 16, MCBSP Transmit channel enable partition A
- union XCERB_REG XCERB; // 17, MCBSP Transmit channel enable partition B
- union PCR1_REG PCR1; // 18, MCBSP Pin control register bits 15-0
- union RCERC_REG RCERC; // 19, MCBSP Receive channel enable partition C
- union RCERD_REG RCERD; // 20, MCBSP Receive channel enable partition D
- union XCERC_REG XCERC; // 21, MCBSP Transmit channel enable partition C
- union XCERD_REG XCERD; // 23, MCBSP Transmit channel enable partition D
- union RCERE_REG RCERE; // 24, MCBSP Receive channel enable partition E
- union RCERF_REG RCERF; // 25, MCBSP Receive channel enable partition F
- union XCERE_REG XCERE; // 26, MCBSP Transmit channel enable partition E
- union XCERF_REG XCERF; // 27, MCBSP Transmit channel enable partition F
- union RCERG_REG RCERG; // 28, MCBSP Receive channel enable partition G
- union RCERH_REG RCERH; // 29, MCBSP Receive channel enable partition H
- union XCERG_REG XCERG; // 30, MCBSP Transmit channel enable partition G
- union XCERH_REG XCERH; // 31, MCBSP Transmit channel enable partition H
- Uint16 rsvd1; // 32, reserved
- union MFFTX_REG MFFTX; // 33, MCBSP Transmit FIFO register bits
- union MFFRX_REG MFFRX; // 34, MCBSP Receive FIFO register bits
- union MFFCT_REG MFFCT; // 35, MCBSP FIFO control register bits
- union MFFINT_REG MFFINT; // 36, MCBSP Interrupt register bits
- union MFFST_REG MFFST; // 37, MCBSP Status register bits
- };
- //---------------------------------------------------------------------------
- // McBSP External References & Function Declarations:
- //
- extern volatile struct MCBSP_REGS McbspaRegs;
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_ECan.h
- //
- // TITLE: DSP28 Device eCAN Register Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | No change
- //###########################################################################
- /* --------------------------------------------------- */
- /* eCAN Control & Status Registers */
- /* ----------------------------------------------------*/
- /* eCAN Mailbox enable register (CANME) bit definitions */
- struct CANME_BITS { // bit description
- Uint16 ME0:1; // 0 Enable Mailbox 0
- Uint16 ME1:1; // 1 Enable Mailbox 1
- Uint16 ME2:1; // 2 Enable Mailbox 2
- Uint16 ME3:1; // 3 Enable Mailbox 3
- Uint16 ME4:1; // 4 Enable Mailbox 4
- Uint16 ME5:1; // 5 Enable Mailbox 5
- Uint16 ME6:1; // 6 Enable Mailbox 6
- Uint16 ME7:1; // 7 Enable Mailbox 7
- Uint16 ME8:1; // 8 Enable Mailbox 8
- Uint16 ME9:1; // 9 Enable Mailbox 9
- Uint16 ME10:1; // 10 Enable Mailbox 10
- Uint16 ME11:1; // 11 Enable Mailbox 11
- Uint16 ME12:1; // 12 Enable Mailbox 12
- Uint16 ME13:1; // 13 Enable Mailbox 13
- Uint16 ME14:1; // 14 Enable Mailbox 14
- Uint16 ME15:1; // 15 Enable Mailbox 15
- Uint16 ME16:1; // 16 Enable Mailbox 16
- Uint16 ME17:1; // 17 Enable Mailbox 17
- Uint16 ME18:1; // 18 Enable Mailbox 18
- Uint16 ME19:1; // 19 Enable Mailbox 19
- Uint16 ME20:1; // 20 Enable Mailbox 20
- Uint16 ME21:1; // 21 Enable Mailbox 21
- Uint16 ME22:1; // 22 Enable Mailbox 22
- Uint16 ME23:1; // 23 Enable Mailbox 23
- Uint16 ME24:1; // 24 Enable Mailbox 24
- Uint16 ME25:1; // 25 Enable Mailbox 25
- Uint16 ME26:1; // 26 Enable Mailbox 26
- Uint16 ME27:1; // 27 Enable Mailbox 27
- Uint16 ME28:1; // 28 Enable Mailbox 28
- Uint16 ME29:1; // 29 Enable Mailbox 29
- Uint16 ME30:1; // 30 Enable Mailbox 30
- Uint16 ME31:1; // 31 Enable Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANME_REG {
- Uint32 all;
- struct CANME_BITS bit;
- };
- /* eCAN Mailbox direction register (CANMD) bit definitions */
- struct CANMD_BITS { // bit description
- Uint16 MD0:1; // 0 0 -> Tx 1 -> Rx
- Uint16 MD1:1; // 1 0 -> Tx 1 -> Rx
- Uint16 MD2:1; // 2 0 -> Tx 1 -> Rx
- Uint16 MD3:1; // 3 0 -> Tx 1 -> Rx
- Uint16 MD4:1; // 4 0 -> Tx 1 -> Rx
- Uint16 MD5:1; // 5 0 -> Tx 1 -> Rx
- Uint16 MD6:1; // 6 0 -> Tx 1 -> Rx
- Uint16 MD7:1; // 7 0 -> Tx 1 -> Rx
- Uint16 MD8:1; // 8 0 -> Tx 1 -> Rx
- Uint16 MD9:1; // 9 0 -> Tx 1 -> Rx
- Uint16 MD10:1; // 10 0 -> Tx 1 -> Rx
- Uint16 MD11:1; // 11 0 -> Tx 1 -> Rx
- Uint16 MD12:1; // 12 0 -> Tx 1 -> Rx
- Uint16 MD13:1; // 13 0 -> Tx 1 -> Rx
- Uint16 MD14:1; // 14 0 -> Tx 1 -> Rx
- Uint16 MD15:1; // 15 0 -> Tx 1 -> Rx
- Uint16 MD16:1; // 16 0 -> Tx 1 -> Rx
- Uint16 MD17:1; // 17 0 -> Tx 1 -> Rx
- Uint16 MD18:1; // 18 0 -> Tx 1 -> Rx
- Uint16 MD19:1; // 19 0 -> Tx 1 -> Rx
- Uint16 MD20:1; // 20 0 -> Tx 1 -> Rx
- Uint16 MD21:1; // 21 0 -> Tx 1 -> Rx
- Uint16 MD22:1; // 22 0 -> Tx 1 -> Rx
- Uint16 MD23:1; // 23 0 -> Tx 1 -> Rx
- Uint16 MD24:1; // 24 0 -> Tx 1 -> Rx
- Uint16 MD25:1; // 25 0 -> Tx 1 -> Rx
- Uint16 MD26:1; // 26 0 -> Tx 1 -> Rx
- Uint16 MD27:1; // 27 0 -> Tx 1 -> Rx
- Uint16 MD28:1; // 28 0 -> Tx 1 -> Rx
- Uint16 MD29:1; // 29 0 -> Tx 1 -> Rx
- Uint16 MD30:1; // 30 0 -> Tx 1 -> Rx
- Uint16 MD31:1; // 31 0 -> Tx 1 -> Rx
- };
- /* Allow access to the bit fields or entire register */
- union CANMD_REG {
- Uint32 all;
- struct CANMD_BITS bit;
- };
- /* eCAN Transmit Request Set register (CANTRS) bit definitions */
- struct CANTRS_BITS { // bit description
- Uint16 TRS0:1; // 0 TRS for Mailbox 0
- Uint16 TRS1:1; // 1 TRS for Mailbox 1
- Uint16 TRS2:1; // 2 TRS for Mailbox 2
- Uint16 TRS3:1; // 3 TRS for Mailbox 3
- Uint16 TRS4:1; // 4 TRS for Mailbox 4
- Uint16 TRS5:1; // 5 TRS for Mailbox 5
- Uint16 TRS6:1; // 6 TRS for Mailbox 6
- Uint16 TRS7:1; // 7 TRS for Mailbox 7
- Uint16 TRS8:1; // 8 TRS for Mailbox 8
- Uint16 TRS9:1; // 9 TRS for Mailbox 9
- Uint16 TRS10:1; // 10 TRS for Mailbox 10
- Uint16 TRS11:1; // 11 TRS for Mailbox 11
- Uint16 TRS12:1; // 12 TRS for Mailbox 12
- Uint16 TRS13:1; // 13 TRS for Mailbox 13
- Uint16 TRS14:1; // 14 TRS for Mailbox 14
- Uint16 TRS15:1; // 15 TRS for Mailbox 15
- Uint16 TRS16:1; // 16 TRS for Mailbox 16
- Uint16 TRS17:1; // 17 TRS for Mailbox 17
- Uint16 TRS18:1; // 18 TRS for Mailbox 18
- Uint16 TRS19:1; // 19 TRS for Mailbox 19
- Uint16 TRS20:1; // 20 TRS for Mailbox 20
- Uint16 TRS21:1; // 21 TRS for Mailbox 21
- Uint16 TRS22:1; // 22 TRS for Mailbox 22
- Uint16 TRS23:1; // 23 TRS for Mailbox 23
- Uint16 TRS24:1; // 24 TRS for Mailbox 24
- Uint16 TRS25:1; // 25 TRS for Mailbox 25
- Uint16 TRS26:1; // 26 TRS for Mailbox 26
- Uint16 TRS27:1; // 27 TRS for Mailbox 27
- Uint16 TRS28:1; // 28 TRS for Mailbox 28
- Uint16 TRS29:1; // 29 TRS for Mailbox 29
- Uint16 TRS30:1; // 30 TRS for Mailbox 30
- Uint16 TRS31:1; // 31 TRS for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANTRS_REG {
- Uint32 all;
- struct CANTRS_BITS bit;
- };
- /* eCAN Transmit Request Reset register (CANTRR) bit definitions */
- struct CANTRR_BITS { // bit description
- Uint16 TRR0:1; // 0 TRR for Mailbox 0
- Uint16 TRR1:1; // 1 TRR for Mailbox 1
- Uint16 TRR2:1; // 2 TRR for Mailbox 2
- Uint16 TRR3:1; // 3 TRR for Mailbox 3
- Uint16 TRR4:1; // 4 TRR for Mailbox 4
- Uint16 TRR5:1; // 5 TRR for Mailbox 5
- Uint16 TRR6:1; // 6 TRR for Mailbox 6
- Uint16 TRR7:1; // 7 TRR for Mailbox 7
- Uint16 TRR8:1; // 8 TRR for Mailbox 8
- Uint16 TRR9:1; // 9 TRR for Mailbox 9
- Uint16 TRR10:1; // 10 TRR for Mailbox 10
- Uint16 TRR11:1; // 11 TRR for Mailbox 11
- Uint16 TRR12:1; // 12 TRR for Mailbox 12
- Uint16 TRR13:1; // 13 TRR for Mailbox 13
- Uint16 TRR14:1; // 14 TRR for Mailbox 14
- Uint16 TRR15:1; // 15 TRR for Mailbox 15
- Uint16 TRR16:1; // 16 TRR for Mailbox 16
- Uint16 TRR17:1; // 17 TRR for Mailbox 17
- Uint16 TRR18:1; // 18 TRR for Mailbox 18
- Uint16 TRR19:1; // 19 TRR for Mailbox 19
- Uint16 TRR20:1; // 20 TRR for Mailbox 20
- Uint16 TRR21:1; // 21 TRR for Mailbox 21
- Uint16 TRR22:1; // 22 TRR for Mailbox 22
- Uint16 TRR23:1; // 23 TRR for Mailbox 23
- Uint16 TRR24:1; // 24 TRR for Mailbox 24
- Uint16 TRR25:1; // 25 TRR for Mailbox 25
- Uint16 TRR26:1; // 26 TRR for Mailbox 26
- Uint16 TRR27:1; // 27 TRR for Mailbox 27
- Uint16 TRR28:1; // 28 TRR for Mailbox 28
- Uint16 TRR29:1; // 29 TRR for Mailbox 29
- Uint16 TRR30:1; // 30 TRR for Mailbox 30
- Uint16 TRR31:1; // 31 TRR for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANTRR_REG {
- Uint32 all;
- struct CANTRR_BITS bit;
- };
- /* eCAN Transmit Acknowledge register (CANTA) bit definitions */
- struct CANTA_BITS { // bit description
- Uint16 TA0:1; // 0 TA for Mailbox 0
- Uint16 TA1:1; // 1 TA for Mailbox 1
- Uint16 TA2:1; // 2 TA for Mailbox 2
- Uint16 TA3:1; // 3 TA for Mailbox 3
- Uint16 TA4:1; // 4 TA for Mailbox 4
- Uint16 TA5:1; // 5 TA for Mailbox 5
- Uint16 TA6:1; // 6 TA for Mailbox 6
- Uint16 TA7:1; // 7 TA for Mailbox 7
- Uint16 TA8:1; // 8 TA for Mailbox 8
- Uint16 TA9:1; // 9 TA for Mailbox 9
- Uint16 TA10:1; // 10 TA for Mailbox 10
- Uint16 TA11:1; // 11 TA for Mailbox 11
- Uint16 TA12:1; // 12 TA for Mailbox 12
- Uint16 TA13:1; // 13 TA for Mailbox 13
- Uint16 TA14:1; // 14 TA for Mailbox 14
- Uint16 TA15:1; // 15 TA for Mailbox 15
- Uint16 TA16:1; // 16 TA for Mailbox 16
- Uint16 TA17:1; // 17 TA for Mailbox 17
- Uint16 TA18:1; // 18 TA for Mailbox 18
- Uint16 TA19:1; // 19 TA for Mailbox 19
- Uint16 TA20:1; // 20 TA for Mailbox 20
- Uint16 TA21:1; // 21 TA for Mailbox 21
- Uint16 TA22:1; // 22 TA for Mailbox 22
- Uint16 TA23:1; // 23 TA for Mailbox 23
- Uint16 TA24:1; // 24 TA for Mailbox 24
- Uint16 TA25:1; // 25 TA for Mailbox 25
- Uint16 TA26:1; // 26 TA for Mailbox 26
- Uint16 TA27:1; // 27 TA for Mailbox 27
- Uint16 TA28:1; // 28 TA for Mailbox 28
- Uint16 TA29:1; // 29 TA for Mailbox 29
- Uint16 TA30:1; // 30 TA for Mailbox 30
- Uint16 TA31:1; // 31 TA for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANTA_REG {
- Uint32 all;
- struct CANTA_BITS bit;
- };
- /* eCAN Transmit Abort Acknowledge register (CANAA) bit definitions */
- struct CANAA_BITS { // bit description
- Uint16 AA0:1; // 0 AA for Mailbox 0
- Uint16 AA1:1; // 1 AA for Mailbox 1
- Uint16 AA2:1; // 2 AA for Mailbox 2
- Uint16 AA3:1; // 3 AA for Mailbox 3
- Uint16 AA4:1; // 4 AA for Mailbox 4
- Uint16 AA5:1; // 5 AA for Mailbox 5
- Uint16 AA6:1; // 6 AA for Mailbox 6
- Uint16 AA7:1; // 7 AA for Mailbox 7
- Uint16 AA8:1; // 8 AA for Mailbox 8
- Uint16 AA9:1; // 9 AA for Mailbox 9
- Uint16 AA10:1; // 10 AA for Mailbox 10
- Uint16 AA11:1; // 11 AA for Mailbox 11
- Uint16 AA12:1; // 12 AA for Mailbox 12
- Uint16 AA13:1; // 13 AA for Mailbox 13
- Uint16 AA14:1; // 14 AA for Mailbox 14
- Uint16 AA15:1; // 15 AA for Mailbox 15
- Uint16 AA16:1; // 16 AA for Mailbox 16
- Uint16 AA17:1; // 17 AA for Mailbox 17
- Uint16 AA18:1; // 18 AA for Mailbox 18
- Uint16 AA19:1; // 19 AA for Mailbox 19
- Uint16 AA20:1; // 20 AA for Mailbox 20
- Uint16 AA21:1; // 21 AA for Mailbox 21
- Uint16 AA22:1; // 22 AA for Mailbox 22
- Uint16 AA23:1; // 23 AA for Mailbox 23
- Uint16 AA24:1; // 24 AA for Mailbox 24
- Uint16 AA25:1; // 25 AA for Mailbox 25
- Uint16 AA26:1; // 26 AA for Mailbox 26
- Uint16 AA27:1; // 27 AA for Mailbox 27
- Uint16 AA28:1; // 28 AA for Mailbox 28
- Uint16 AA29:1; // 29 AA for Mailbox 29
- Uint16 AA30:1; // 30 AA for Mailbox 30
- Uint16 AA31:1; // 31 AA for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANAA_REG {
- Uint32 all;
- struct CANAA_BITS bit;
- };
- /* eCAN Received Message Pending register (CANRMP) bit definitions */
- struct CANRMP_BITS { // bit description
- Uint16 RMP0:1; // 0 RMP for Mailbox 0
- Uint16 RMP1:1; // 1 RMP for Mailbox 1
- Uint16 RMP2:1; // 2 RMP for Mailbox 2
- Uint16 RMP3:1; // 3 RMP for Mailbox 3
- Uint16 RMP4:1; // 4 RMP for Mailbox 4
- Uint16 RMP5:1; // 5 RMP for Mailbox 5
- Uint16 RMP6:1; // 6 RMP for Mailbox 6
- Uint16 RMP7:1; // 7 RMP for Mailbox 7
- Uint16 RMP8:1; // 8 RMP for Mailbox 8
- Uint16 RMP9:1; // 9 RMP for Mailbox 9
- Uint16 RMP10:1; // 10 RMP for Mailbox 10
- Uint16 RMP11:1; // 11 RMP for Mailbox 11
- Uint16 RMP12:1; // 12 RMP for Mailbox 12
- Uint16 RMP13:1; // 13 RMP for Mailbox 13
- Uint16 RMP14:1; // 14 RMP for Mailbox 14
- Uint16 RMP15:1; // 15 RMP for Mailbox 15
- Uint16 RMP16:1; // 16 RMP for Mailbox 16
- Uint16 RMP17:1; // 17 RMP for Mailbox 17
- Uint16 RMP18:1; // 18 RMP for Mailbox 18
- Uint16 RMP19:1; // 19 RMP for Mailbox 19
- Uint16 RMP20:1; // 20 RMP for Mailbox 20
- Uint16 RMP21:1; // 21 RMP for Mailbox 21
- Uint16 RMP22:1; // 22 RMP for Mailbox 22
- Uint16 RMP23:1; // 23 RMP for Mailbox 23
- Uint16 RMP24:1; // 24 RMP for Mailbox 24
- Uint16 RMP25:1; // 25 RMP for Mailbox 25
- Uint16 RMP26:1; // 26 RMP for Mailbox 26
- Uint16 RMP27:1; // 27 RMP for Mailbox 27
- Uint16 RMP28:1; // 28 RMP for Mailbox 28
- Uint16 RMP29:1; // 29 RMP for Mailbox 29
- Uint16 RMP30:1; // 30 RMP for Mailbox 30
- Uint16 RMP31:1; // 31 RMP for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANRMP_REG {
- Uint32 all;
- struct CANRMP_BITS bit;
- };
- /* eCAN Received Message Lost register (CANRML) bit definitions */
- struct CANRML_BITS { // bit description
- Uint16 RML0:1; // 0 RML for Mailbox 0
- Uint16 RML1:1; // 1 RML for Mailbox 1
- Uint16 RML2:1; // 2 RML for Mailbox 2
- Uint16 RML3:1; // 3 RML for Mailbox 3
- Uint16 RML4:1; // 4 RML for Mailbox 4
- Uint16 RML5:1; // 5 RML for Mailbox 5
- Uint16 RML6:1; // 6 RML for Mailbox 6
- Uint16 RML7:1; // 7 RML for Mailbox 7
- Uint16 RML8:1; // 8 RML for Mailbox 8
- Uint16 RML9:1; // 9 RML for Mailbox 9
- Uint16 RML10:1; // 10 RML for Mailbox 10
- Uint16 RML11:1; // 11 RML for Mailbox 11
- Uint16 RML12:1; // 12 RML for Mailbox 12
- Uint16 RML13:1; // 13 RML for Mailbox 13
- Uint16 RML14:1; // 14 RML for Mailbox 14
- Uint16 RML15:1; // 15 RML for Mailbox 15
- Uint16 RML16:1; // 16 RML for Mailbox 16
- Uint16 RML17:1; // 17 RML for Mailbox 17
- Uint16 RML18:1; // 18 RML for Mailbox 18
- Uint16 RML19:1; // 19 RML for Mailbox 19
- Uint16 RML20:1; // 20 RML for Mailbox 20
- Uint16 RML21:1; // 21 RML for Mailbox 21
- Uint16 RML22:1; // 22 RML for Mailbox 22
- Uint16 RML23:1; // 23 RML for Mailbox 23
- Uint16 RML24:1; // 24 RML for Mailbox 24
- Uint16 RML25:1; // 25 RML for Mailbox 25
- Uint16 RML26:1; // 26 RML for Mailbox 26
- Uint16 RML27:1; // 27 RML for Mailbox 27
- Uint16 RML28:1; // 28 RML for Mailbox 28
- Uint16 RML29:1; // 29 RML for Mailbox 29
- Uint16 RML30:1; // 30 RML for Mailbox 30
- Uint16 RML31:1; // 31 RML for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANRML_REG {
- Uint32 all;
- struct CANRML_BITS bit;
- };
- /* eCAN Remote Frame Pending register (CANRFP) bit definitions */
- struct CANRFP_BITS { // bit description
- Uint16 RFP0:1; // 0 RFP for Mailbox 0
- Uint16 RFP1:1; // 1 RFP for Mailbox 1
- Uint16 RFP2:1; // 2 RFP for Mailbox 2
- Uint16 RFP3:1; // 3 RFP for Mailbox 3
- Uint16 RFP4:1; // 4 RFP for Mailbox 4
- Uint16 RFP5:1; // 5 RFP for Mailbox 5
- Uint16 RFP6:1; // 6 RFP for Mailbox 6
- Uint16 RFP7:1; // 7 RFP for Mailbox 7
- Uint16 RFP8:1; // 8 RFP for Mailbox 8
- Uint16 RFP9:1; // 9 RFP for Mailbox 9
- Uint16 RFP10:1; // 10 RFP for Mailbox 10
- Uint16 RFP11:1; // 11 RFP for Mailbox 11
- Uint16 RFP12:1; // 12 RFP for Mailbox 12
- Uint16 RFP13:1; // 13 RFP for Mailbox 13
- Uint16 RFP14:1; // 14 RFP for Mailbox 14
- Uint16 RFP15:1; // 15 RFP for Mailbox 15
- Uint16 RFP16:1; // 16 RFP for Mailbox 16
- Uint16 RFP17:1; // 17 RFP for Mailbox 17
- Uint16 RFP18:1; // 18 RFP for Mailbox 18
- Uint16 RFP19:1; // 19 RFP for Mailbox 19
- Uint16 RFP20:1; // 20 RFP for Mailbox 20
- Uint16 RFP21:1; // 21 RFP for Mailbox 21
- Uint16 RFP22:1; // 22 RFP for Mailbox 22
- Uint16 RFP23:1; // 23 RFP for Mailbox 23
- Uint16 RFP24:1; // 24 RFP for Mailbox 24
- Uint16 RFP25:1; // 25 RFP for Mailbox 25
- Uint16 RFP26:1; // 26 RFP for Mailbox 26
- Uint16 RFP27:1; // 27 RFP for Mailbox 27
- Uint16 RFP28:1; // 28 RFP for Mailbox 28
- Uint16 RFP29:1; // 29 RFP for Mailbox 29
- Uint16 RFP30:1; // 30 RFP for Mailbox 30
- Uint16 RFP31:1; // 31 RFP for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANRFP_REG {
- Uint32 all;
- struct CANRFP_BITS bit;
- };
- /* eCAN Global Acceptance Mask register (CANGAM) bit definitions */
- struct CANGAM_BITS { // bits description
- Uint16 GAM150:16; // 15:0
- Uint16 GAM2816:13; // 28:16
- Uint16 rsvd:2; // 30:29
- Uint16 AMI:1; // 31 AMI bit
- };
- /* Allow access to the bit fields or entire register */
- union CANGAM_REG {
- Uint32 all;
- struct CANGAM_BITS bit;
- };
- /* eCAN Master Control register (CANMC) bit definitions */
- struct CANMC_BITS { // bits description
- Uint16 MBNR:5; // 4:0 MBX # for CDR bit
- Uint16 SRES:1; // 5 Soft reset
- Uint16 STM:1; // 6 Self-test mode
- Uint16 ABO:1; // 7 Auto bus-on
- Uint16 CDR:1; // 8 Change data request
- Uint16 WUBA:1; // 9 Wake-up on bus activity
- Uint16 DBO:1; // 10 Data-byte order
- Uint16 PDR:1; // 11 Power-down mode request
- Uint16 CCR:1; // 12 Change configuration request
- Uint16 SCM:1; // 13 SCC compatibility mode
- Uint16 LNTM:1; // 14 LNT MSB clear bit
- Uint16 LNTC:1; // 15 LNT clear bit thru mailbox 16
- Uint16 SUSP:1; // 16 SUSPEND free/soft bit
- Uint16 rsvd:15; // 31:17 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CANMC_REG {
- Uint32 all;
- struct CANMC_BITS bit;
- };
- /* eCAN Bit -timing configuration register (CANBTC) bit definitions */
- struct CANBTC_BITS { // bits description
- Uint16 TSEG2:3; // 2:0 TSEG2
- Uint16 TSEG1:4; // 6:3 TSEG1
- Uint16 SAM:1; // 7 Sample-point setting
- Uint16 SJW:2; // 9:8 Synchroniztion Jump Width
- Uint16 ERM:1; // 10 Edge resynchroniztion mode
- Uint16 rsvd1:5; // 15:11 reserved
- Uint16 BRP:8; // 23:16 Time quantum prescaler
- Uint16 rsvd2:8; // 31:24 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CANBTC_REG {
- Uint32 all;
- struct CANBTC_BITS bit;
- };
- /* eCAN Error & Status register (CANES) bit definitions */
- struct CANES_BITS { // bits description
- Uint16 TM:1; // 0 TM
- Uint16 RM:1; // 1 RM
- Uint16 rsvd1:1; // 2 reserved
- Uint16 PDA:1; // 3 Power-down acknowledge
- Uint16 CCE:1; // 4 Change Configuration Enable
- Uint16 SMA:1; // 5 Suspend Mode Acknowledge
- Uint16 rsvd2:10; // 15:6 reserved
- Uint16 EW:1; // 16 EW
- Uint16 EP:1; // 17 EP
- Uint16 BO:1; // 18 BO
- Uint16 ACKE:1; // 19 ACKE
- Uint16 SE:1; // 20 SE
- Uint16 CRCE:1; // 21 CRCE
- Uint16 SA1:1; // 22 SA1
- Uint16 BE:1; // 23 BE
- Uint16 FE:1; // 24 FE
- Uint16 rsvd3:7; // 31:25 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CANES_REG {
- Uint32 all;
- struct CANES_BITS bit;
- };
- /* eCAN Transmit Error Counter register (CANTEC) bit definitions */
- struct CANTEC_BITS { // bits description
- Uint16 TEC:8; // 7:0 TEC
- Uint16 rsvd1:8; // 15:8 reserved
- Uint16 rsvd2:16; // 31:16 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CANTEC_REG {
- Uint32 all;
- struct CANTEC_BITS bit;
- };
- /* eCAN Receive Error Counter register (CANREC) bit definitions */
- struct CANREC_BITS { // bits description
- Uint16 REC:8; // 7:0 REC
- Uint16 rsvd1:8; // 15:8 reserved
- Uint16 rsvd2:16; // 31:16 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CANREC_REG {
- Uint32 all;
- struct CANREC_BITS bit;
- };
- /* eCAN Global Interrupt Flag 0 (CANGIF0) bit definitions */
- struct CANGIF0_BITS { // bits description
- Uint16 MIV0:5; // 4:0 Mailbox Interrupt Vector
- Uint16 rsvd1:3; // 7:5 reserved
- Uint16 WLIF0:1; // 8 WLIF0
- Uint16 EPIF0:1; // 9 EPIF0
- Uint16 BOIF0:1; // 10 BOIF0
- Uint16 RMLIF0:1; // 11 RMLIF0
- Uint16 WUIF0:1; // 12 WUIF0
- Uint16 WDIF0:1; // 13 WDIF0
- Uint16 AAIF0:1; // 14 AAIF0
- Uint16 GMIF0:1; // 15 GMIF0
- Uint16 TCOIF0:1; // 16 TCOIF0
- Uint16 MAIF0:1; // 17 MAIF0
- Uint16 rsvd2:14; // 31:18 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CANGIF0_REG {
- Uint32 all;
- struct CANGIF0_BITS bit;
- };
- /* eCAN Global Interrupt Mask register (CANGIM) bit definitions */
- struct CANGIM_BITS { // bits description
- Uint16 I0EN:1; // 0 Interrupt 0 enable
- Uint16 I1EN:1; // 1 Interrupt 1 enable
- Uint16 SIL:1; // 2 System Interrupt Level
- Uint16 rsvd1:5; // 7:3 reserved
- Uint16 WLIM:1; // 8 WLIM
- Uint16 EPIM:1; // 9 EPIM
- Uint16 BOIM:1; // 10 BOIM
- Uint16 RMLIM:1; // 11 RMLIM
- Uint16 WUIM:1; // 12 WUIM
- Uint16 WDIM:1; // 13 WDIM
- Uint16 AAIM:1; // 14 AAIM
- Uint16 rsvd2:1; // 15 reserved
- Uint16 TCOIM:1; // 16 TCOIM
- Uint16 MAIM:1; // 17 MAIM
- Uint16 rsvd3:14; // 31:18 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CANGIM_REG {
- Uint32 all;
- struct CANGIM_BITS bit;
- };
- /* eCAN Global Interrupt Flag 1 (eCANGIF1) bit definitions */
- struct CANGIF1_BITS { // bits description
- Uint16 MIV1:5; // 4:0 Mailbox Interrupt Vector
- Uint16 rsvd1:3; // 7:5 reserved
- Uint16 WLIF1:1; // 8 WLIF1
- Uint16 EPIF1:1; // 9 EPIF1
- Uint16 BOIF1:1; // 11 BOIF1
- Uint16 RMLIF1:1; // 11 RMLIF1
- Uint16 WUIF1:1; // 12 WUIF1
- Uint16 WDIF1:1; // 13 WDIF1
- Uint16 AAIF1:1; // 14 AAIF1
- Uint16 GMIF1:1; // 15 GMIF1
- Uint16 TCOIF1:1; // 16 TCOIF1
- Uint16 MAIF1:1; // 17 MAIF1
- Uint16 rsvd2:14; // 31:18 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CANGIF1_REG {
- Uint32 all;
- struct CANGIF1_BITS bit;
- };
- /* eCAN Mailbox Interrupt Mask register (CANMIM) bit definitions */
- struct CANMIM_BITS { // bit description
- Uint16 MIM0:1; // 0 MIM for Mailbox 0
- Uint16 MIM1:1; // 1 MIM for Mailbox 1
- Uint16 MIM2:1; // 2 MIM for Mailbox 2
- Uint16 MIM3:1; // 3 MIM for Mailbox 3
- Uint16 MIM4:1; // 4 MIM for Mailbox 4
- Uint16 MIM5:1; // 5 MIM for Mailbox 5
- Uint16 MIM6:1; // 6 MIM for Mailbox 6
- Uint16 MIM7:1; // 7 MIM for Mailbox 7
- Uint16 MIM8:1; // 8 MIM for Mailbox 8
- Uint16 MIM9:1; // 9 MIM for Mailbox 9
- Uint16 MIM10:1; // 10 MIM for Mailbox 10
- Uint16 MIM11:1; // 11 MIM for Mailbox 11
- Uint16 MIM12:1; // 12 MIM for Mailbox 12
- Uint16 MIM13:1; // 13 MIM for Mailbox 13
- Uint16 MIM14:1; // 14 MIM for Mailbox 14
- Uint16 MIM15:1; // 15 MIM for Mailbox 15
- Uint16 MIM16:1; // 16 MIM for Mailbox 16
- Uint16 MIM17:1; // 17 MIM for Mailbox 17
- Uint16 MIM18:1; // 18 MIM for Mailbox 18
- Uint16 MIM19:1; // 19 MIM for Mailbox 19
- Uint16 MIM20:1; // 20 MIM for Mailbox 20
- Uint16 MIM21:1; // 21 MIM for Mailbox 21
- Uint16 MIM22:1; // 22 MIM for Mailbox 22
- Uint16 MIM23:1; // 23 MIM for Mailbox 23
- Uint16 MIM24:1; // 24 MIM for Mailbox 24
- Uint16 MIM25:1; // 25 MIM for Mailbox 25
- Uint16 MIM26:1; // 26 MIM for Mailbox 26
- Uint16 MIM27:1; // 27 MIM for Mailbox 27
- Uint16 MIM28:1; // 28 MIM for Mailbox 28
- Uint16 MIM29:1; // 29 MIM for Mailbox 29
- Uint16 MIM30:1; // 30 MIM for Mailbox 30
- Uint16 MIM31:1; // 31 MIM for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANMIM_REG {
- Uint32 all;
- struct CANMIM_BITS bit;
- };
- /* eCAN Mailbox Interrupt Level register (CANMIL) bit definitions */
- struct CANMIL_BITS { // bit description
- Uint16 MIL0:1; // 0 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL1:1; // 1 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL2:1; // 2 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL3:1; // 3 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL4:1; // 4 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL5:1; // 5 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL6:1; // 6 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL7:1; // 7 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL8:1; // 8 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL9:1; // 9 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL10:1; // 10 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL11:1; // 11 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL12:1; // 12 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL13:1; // 13 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL14:1; // 14 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL15:1; // 15 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL16:1; // 16 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL17:1; // 17 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL18:1; // 18 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL19:1; // 19 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL20:1; // 20 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL21:1; // 21 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL22:1; // 22 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL23:1; // 23 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL24:1; // 24 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL25:1; // 25 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL26:1; // 26 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL27:1; // 27 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL28:1; // 28 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL29:1; // 29 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL30:1; // 30 0 -> Int 9.5 1 -> Int 9.6
- Uint16 MIL31:1; // 31 0 -> Int 9.5 1 -> Int 9.6
- };
- /* Allow access to the bit fields or entire register */
- union CANMIL_REG {
- Uint32 all;
- struct CANMIL_BITS bit;
- };
- /* eCAN Overwrite Protection Control register (CANOPC) bit definitions */
- struct CANOPC_BITS { // bit description
- Uint16 OPC0:1; // 0 OPC for Mailbox 0
- Uint16 OPC1:1; // 1 OPC for Mailbox 1
- Uint16 OPC2:1; // 2 OPC for Mailbox 2
- Uint16 OPC3:1; // 3 OPC for Mailbox 3
- Uint16 OPC4:1; // 4 OPC for Mailbox 4
- Uint16 OPC5:1; // 5 OPC for Mailbox 5
- Uint16 OPC6:1; // 6 OPC for Mailbox 6
- Uint16 OPC7:1; // 7 OPC for Mailbox 7
- Uint16 OPC8:1; // 8 OPC for Mailbox 8
- Uint16 OPC9:1; // 9 OPC for Mailbox 9
- Uint16 OPC10:1; // 10 OPC for Mailbox 10
- Uint16 OPC11:1; // 11 OPC for Mailbox 11
- Uint16 OPC12:1; // 12 OPC for Mailbox 12
- Uint16 OPC13:1; // 13 OPC for Mailbox 13
- Uint16 OPC14:1; // 14 OPC for Mailbox 14
- Uint16 OPC15:1; // 15 OPC for Mailbox 15
- Uint16 OPC16:1; // 16 OPC for Mailbox 16
- Uint16 OPC17:1; // 17 OPC for Mailbox 17
- Uint16 OPC18:1; // 18 OPC for Mailbox 18
- Uint16 OPC19:1; // 19 OPC for Mailbox 19
- Uint16 OPC20:1; // 20 OPC for Mailbox 20
- Uint16 OPC21:1; // 21 OPC for Mailbox 21
- Uint16 OPC22:1; // 22 OPC for Mailbox 22
- Uint16 OPC23:1; // 23 OPC for Mailbox 23
- Uint16 OPC24:1; // 24 OPC for Mailbox 24
- Uint16 OPC25:1; // 25 OPC for Mailbox 25
- Uint16 OPC26:1; // 26 OPC for Mailbox 26
- Uint16 OPC27:1; // 27 OPC for Mailbox 27
- Uint16 OPC28:1; // 28 OPC for Mailbox 28
- Uint16 OPC29:1; // 29 OPC for Mailbox 29
- Uint16 OPC30:1; // 30 OPC for Mailbox 30
- Uint16 OPC31:1; // 31 OPC for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANOPC_REG {
- Uint32 all;
- struct CANOPC_BITS bit;
- };
- /* eCAN TX I/O Control Register (CANTIOC) bit definitions */
- struct CANTIOC_BITS { // bits description
- Uint16 TXIN:1; // 0 TXIN
- Uint16 TXOUT:1; // 1 TXOUT
- Uint16 TXDIR:1; // 2 TXDIR
- Uint16 TXFUNC:1; // 3 TXFUNC
- Uint16 rsvd1:12; // 15:4 reserved
- Uint16 rsvd2:16; // 31:16 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CANTIOC_REG {
- Uint32 all;
- struct CANTIOC_BITS bit;
- };
- /* eCAN RX I/O Control Register (CANRIOC) bit definitions */
- struct CANRIOC_BITS { // bits description
- Uint16 RXIN:1; // 0 RXIN
- Uint16 RXOUT:1; // 1 RXOUT
- Uint16 RXDIR:1; // 2 RXDIR
- Uint16 RXFUNC:1; // 3 RXFUNC
- Uint16 rsvd1:12; // 15:4 reserved
- Uint16 rsvd2:16; // 31:16 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CANRIOC_REG {
- Uint32 all;
- struct CANRIOC_BITS bit;
- };
- /* eCAN Local Network Timer register (CANLNT) bit definitions */
- struct CANLNT_BITS { // bit description
- Uint16 LNT0:1; // 0 LNT for Mailbox 0
- Uint16 LNT1:1; // 1 LNT for Mailbox 1
- Uint16 LNT2:1; // 2 LNT for Mailbox 2
- Uint16 LNT3:1; // 3 LNT for Mailbox 3
- Uint16 LNT4:1; // 4 LNT for Mailbox 4
- Uint16 LNT5:1; // 5 LNT for Mailbox 5
- Uint16 LNT6:1; // 6 LNT for Mailbox 6
- Uint16 LNT7:1; // 7 LNT for Mailbox 7
- Uint16 LNT8:1; // 8 LNT for Mailbox 8
- Uint16 LNT9:1; // 9 LNT for Mailbox 9
- Uint16 LNT10:1; // 10 LNT for Mailbox 10
- Uint16 LNT11:1; // 11 LNT for Mailbox 11
- Uint16 LNT12:1; // 12 LNT for Mailbox 12
- Uint16 LNT13:1; // 13 LNT for Mailbox 13
- Uint16 LNT14:1; // 14 LNT for Mailbox 14
- Uint16 LNT15:1; // 15 LNT for Mailbox 15
- Uint16 LNT16:1; // 16 LNT for Mailbox 16
- Uint16 LNT17:1; // 17 LNT for Mailbox 17
- Uint16 LNT18:1; // 18 LNT for Mailbox 18
- Uint16 LNT19:1; // 19 LNT for Mailbox 19
- Uint16 LNT20:1; // 20 LNT for Mailbox 20
- Uint16 LNT21:1; // 21 LNT for Mailbox 21
- Uint16 LNT22:1; // 22 LNT for Mailbox 22
- Uint16 LNT23:1; // 23 LNT for Mailbox 23
- Uint16 LNT24:1; // 24 LNT for Mailbox 24
- Uint16 LNT25:1; // 25 LNT for Mailbox 25
- Uint16 LNT26:1; // 26 LNT for Mailbox 26
- Uint16 LNT27:1; // 27 LNT for Mailbox 27
- Uint16 LNT28:1; // 28 LNT for Mailbox 28
- Uint16 LNT29:1; // 29 LNT for Mailbox 29
- Uint16 LNT30:1; // 30 LNT for Mailbox 30
- Uint16 LNT31:1; // 31 LNT for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANLNT_REG {
- Uint32 all;
- struct CANLNT_BITS bit;
- };
- /* eCAN Time-out Control register (CANTOC) bit definitions */
- struct CANTOC_BITS { // bit description
- Uint16 TOC0:1; // 0 TOC for Mailbox 0
- Uint16 TOC1:1; // 1 TOC for Mailbox 1
- Uint16 TOC2:1; // 2 TOC for Mailbox 2
- Uint16 TOC3:1; // 3 TOC for Mailbox 3
- Uint16 TOC4:1; // 4 TOC for Mailbox 4
- Uint16 TOC5:1; // 5 TOC for Mailbox 5
- Uint16 TOC6:1; // 6 TOC for Mailbox 6
- Uint16 TOC7:1; // 7 TOC for Mailbox 7
- Uint16 TOC8:1; // 8 TOC for Mailbox 8
- Uint16 TOC9:1; // 9 TOC for Mailbox 9
- Uint16 TOC10:1; // 10 TOC for Mailbox 10
- Uint16 TOC11:1; // 11 TOC for Mailbox 11
- Uint16 TOC12:1; // 12 TOC for Mailbox 12
- Uint16 TOC13:1; // 13 TOC for Mailbox 13
- Uint16 TOC14:1; // 14 TOC for Mailbox 14
- Uint16 TOC15:1; // 15 TOC for Mailbox 15
- Uint16 TOC16:1; // 16 TOC for Mailbox 16
- Uint16 TOC17:1; // 17 TOC for Mailbox 17
- Uint16 TOC18:1; // 18 TOC for Mailbox 18
- Uint16 TOC19:1; // 19 TOC for Mailbox 19
- Uint16 TOC20:1; // 20 TOC for Mailbox 20
- Uint16 TOC21:1; // 21 TOC for Mailbox 21
- Uint16 TOC22:1; // 22 TOC for Mailbox 22
- Uint16 TOC23:1; // 23 TOC for Mailbox 23
- Uint16 TOC24:1; // 24 TOC for Mailbox 24
- Uint16 TOC25:1; // 25 TOC for Mailbox 25
- Uint16 TOC26:1; // 26 TOC for Mailbox 26
- Uint16 TOC27:1; // 27 TOC for Mailbox 27
- Uint16 TOC28:1; // 28 TOC for Mailbox 28
- Uint16 TOC29:1; // 29 TOC for Mailbox 29
- Uint16 TOC30:1; // 30 TOC for Mailbox 30
- Uint16 TOC31:1; // 31 TOC for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANTOC_REG {
- Uint32 all;
- struct CANTOC_BITS bit;
- };
- /* eCAN Time-out Status register (CANTOS) bit definitions */
- struct CANTOS_BITS { // bit description
- Uint16 TOS0:1; // 0 TOS for Mailbox 0
- Uint16 TOS1:1; // 1 TOS for Mailbox 1
- Uint16 TOS2:1; // 2 TOS for Mailbox 2
- Uint16 TOS3:1; // 3 TOS for Mailbox 3
- Uint16 TOS4:1; // 4 TOS for Mailbox 4
- Uint16 TOS5:1; // 5 TOS for Mailbox 5
- Uint16 TOS6:1; // 6 TOS for Mailbox 6
- Uint16 TOS7:1; // 7 TOS for Mailbox 7
- Uint16 TOS8:1; // 8 TOS for Mailbox 8
- Uint16 TOS9:1; // 9 TOS for Mailbox 9
- Uint16 TOS10:1; // 10 TOS for Mailbox 10
- Uint16 TOS11:1; // 11 TOS for Mailbox 11
- Uint16 TOS12:1; // 12 TOS for Mailbox 12
- Uint16 TOS13:1; // 13 TOS for Mailbox 13
- Uint16 TOS14:1; // 14 TOS for Mailbox 14
- Uint16 TOS15:1; // 15 TOS for Mailbox 15
- Uint16 TOS16:1; // 16 TOS for Mailbox 16
- Uint16 TOS17:1; // 17 TOS for Mailbox 17
- Uint16 TOS18:1; // 18 TOS for Mailbox 18
- Uint16 TOS19:1; // 19 TOS for Mailbox 19
- Uint16 TOS20:1; // 20 TOS for Mailbox 20
- Uint16 TOS21:1; // 21 TOS for Mailbox 21
- Uint16 TOS22:1; // 22 TOS for Mailbox 22
- Uint16 TOS23:1; // 23 TOS for Mailbox 23
- Uint16 TOS24:1; // 24 TOS for Mailbox 24
- Uint16 TOS25:1; // 25 TOS for Mailbox 25
- Uint16 TOS26:1; // 26 TOS for Mailbox 26
- Uint16 TOS27:1; // 27 TOS for Mailbox 27
- Uint16 TOS28:1; // 28 TOS for Mailbox 28
- Uint16 TOS29:1; // 29 TOS for Mailbox 29
- Uint16 TOS30:1; // 30 TOS for Mailbox 30
- Uint16 TOS31:1; // 31 TOS for Mailbox 31
- };
- /* Allow access to the bit fields or entire register */
- union CANTOS_REG {
- Uint32 all;
- struct CANTOS_BITS bit;
- };
- /**************************************/
- /* eCAN Control & Status register file */
- /**************************************/
- struct ECAN_REGS {
- union CANME_REG CANME; // Mailbox Enable
- union CANMD_REG CANMD; // Mailbox Direction
- union CANTRS_REG CANTRS; // Transmit Request Set
- union CANTRR_REG CANTRR; // Transmit Request Reset
- union CANTA_REG CANTA; // Transmit Acknowledge
- union CANAA_REG CANAA; // Abort Acknowledge
- union CANRMP_REG CANRMP; // Received Message Pending
- union CANRML_REG CANRML; // Received Message Lost
- union CANRFP_REG CANRFP; // Remote Frame Pending
- union CANGAM_REG CANGAM; // Global Acceptance Mask
- union CANMC_REG CANMC; // Master Control
- union CANBTC_REG CANBTC; // Bit Timing
- union CANES_REG CANES; // Error Status
- union CANTEC_REG CANTEC; // Transmit Error Counter
- union CANREC_REG CANREC; // Receive Error Counter
- union CANGIF0_REG CANGIF0; // Global Interrupt Flag 0
- union CANGIM_REG CANGIM; // Global Interrupt Mask 0
- union CANGIF1_REG CANGIF1; // Global Interrupt Flag 1
- union CANMIM_REG CANMIM; // Mailbox Interrupt Mask
- union CANMIL_REG CANMIL; // Mailbox Interrupt Level
- union CANOPC_REG CANOPC; // Overwrite Protection Control
- union CANTIOC_REG CANTIOC; // TX I/O Control
- union CANRIOC_REG CANRIOC; // RX I/O Control
- union CANLNT_REG CANLNT; // Local Network Time
- union CANTOC_REG CANTOC; // Time-out Control
- union CANTOS_REG CANTOS; // Time-out Status
- };
- /* --------------------------------------------------- */
- /* eCAN Mailbox Registers */
- /* ----------------------------------------------------*/
- /* eCAN Message ID (MID) bit definitions */
- struct CANMID_BITS { // bits description
- Uint16 MSGID_L:16; // 0:15
- Uint16 MSGID_H:13; // 16:28
- Uint16 AAM:1; // 29
- Uint16 AME:1; // 30
- Uint16 IDE:1; // 31
- };
- /* Allow access to the bit fields or entire register */
- union CANMID_REG {
- Uint32 all;
- struct CANMID_BITS bit;
- };
- /* eCAN Master Control Field (MCF) bit definitions */
- struct CANMCF_BITS { // bits description
- Uint16 DLC:4; // 0:3
- Uint16 RTR:1; // 4
- Uint16 rsvd1:3; // 7:5 reserved
- Uint16 TPL:5; // 12:8
- Uint16 rsvd2:3; // 15:13 reserved
- Uint16 rsvd3:16; // 31:16 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CANMCF_REG {
- Uint32 all;
- struct CANMCF_BITS bit;
- };
- /* eCAN Message Data Register low (MDR_L) bit definitions */
- struct CANMDRL_BITS { // bits description
- Uint16 LOW_WORD:16; // 0:15
- Uint16 HI_WORD:16; // 31:16
- };
- /* Allow access to the bit fields or entire register */
- union CANMDRL_REG {
- Uint32 all;
- struct CANMDRL_BITS bit;
- };
- /* eCAN Message Data Register high (MDR_H) bit definitions */
- struct CANMDRH_BITS { // bits description
- Uint16 LOW_WORD:16; // 0:15
- Uint16 HI_WORD:16; // 31:16
- };
- /* Allow access to the bit fields or entire register */
- union CANMDRH_REG {
- Uint32 all;
- struct CANMDRH_BITS bit;
- };
- struct MBOX {
- union CANMID_REG MID;
- union CANMCF_REG MCF;
- union CANMDRL_REG MDRL;
- union CANMDRH_REG MDRH;
- };
- /**************************************/
- /* eCAN Mailboxes */
- /**************************************/
- struct ECAN_MBOXES {
- struct MBOX MBOX0;
- struct MBOX MBOX1;
- struct MBOX MBOX2;
- struct MBOX MBOX3;
- struct MBOX MBOX4;
- struct MBOX MBOX5;
- struct MBOX MBOX6;
- struct MBOX MBOX7;
- struct MBOX MBOX8;
- struct MBOX MBOX9;
- struct MBOX MBOX10;
- struct MBOX MBOX11;
- struct MBOX MBOX12;
- struct MBOX MBOX13;
- struct MBOX MBOX14;
- struct MBOX MBOX15;
- struct MBOX MBOX16;
- struct MBOX MBOX17;
- struct MBOX MBOX18;
- struct MBOX MBOX19;
- struct MBOX MBOX20;
- struct MBOX MBOX21;
- struct MBOX MBOX22;
- struct MBOX MBOX23;
- struct MBOX MBOX24;
- struct MBOX MBOX25;
- struct MBOX MBOX26;
- struct MBOX MBOX27;
- struct MBOX MBOX28;
- struct MBOX MBOX29;
- struct MBOX MBOX30;
- struct MBOX MBOX31;
- };
- /* eCAN Local Acceptance Mask (LAM) bit definitions */
- struct CANLAM_BITS { // bits description
- Uint16 LAM_L:16; // 0:15
- Uint16 LAM_H:13; // 16:28
- Uint16 rsvd1:2; // 29:30 reserved
- Uint16 LAMI:1; // 31
- };
- /* Allow access to the bit fields or entire register */
- union CANLAM_REG {
- Uint32 all;
- struct CANLAM_BITS bit;
- };
- /**************************************/
- /* eCAN Local Acceptance Masks */
- /**************************************/
- /* eCAN LAM File */
- struct LAM_REGS {
- union CANLAM_REG LAM0;
- union CANLAM_REG LAM1;
- union CANLAM_REG LAM2;
- union CANLAM_REG LAM3;
- union CANLAM_REG LAM4;
- union CANLAM_REG LAM5;
- union CANLAM_REG LAM6;
- union CANLAM_REG LAM7;
- union CANLAM_REG LAM8;
- union CANLAM_REG LAM9;
- union CANLAM_REG LAM10;
- union CANLAM_REG LAM11;
- union CANLAM_REG LAM12;
- union CANLAM_REG LAM13;
- union CANLAM_REG LAM14;
- union CANLAM_REG LAM15;
- union CANLAM_REG LAM16;
- union CANLAM_REG LAM17;
- union CANLAM_REG LAM18;
- union CANLAM_REG LAM19;
- union CANLAM_REG LAM20;
- union CANLAM_REG LAM21;
- union CANLAM_REG LAM22;
- union CANLAM_REG LAM23;
- union CANLAM_REG LAM24;
- union CANLAM_REG LAM25;
- union CANLAM_REG LAM26;
- union CANLAM_REG LAM27;
- union CANLAM_REG LAM28;
- union CANLAM_REG LAM29;
- union CANLAM_REG LAM30;
- union CANLAM_REG LAM31;
- };
- /* Mailbox MOTS File */
- struct MOTS {
- unsigned long MOTS0;
- unsigned long MOTS1;
- unsigned long MOTS2;
- unsigned long MOTS3;
- unsigned long MOTS4;
- unsigned long MOTS5;
- unsigned long MOTS6;
- unsigned long MOTS7;
- unsigned long MOTS8;
- unsigned long MOTS9;
- unsigned long MOTS10;
- unsigned long MOTS11;
- unsigned long MOTS12;
- unsigned long MOTS13;
- unsigned long MOTS14;
- unsigned long MOTS15;
- unsigned long MOTS16;
- unsigned long MOTS17;
- unsigned long MOTS18;
- unsigned long MOTS19;
- unsigned long MOTS20;
- unsigned long MOTS21;
- unsigned long MOTS22;
- unsigned long MOTS23;
- unsigned long MOTS24;
- unsigned long MOTS25;
- unsigned long MOTS26;
- unsigned long MOTS27;
- unsigned long MOTS28;
- unsigned long MOTS29;
- unsigned long MOTS30;
- unsigned long MOTS31;
- };
- /* Mailbox MOTO File */
- struct MOTO {
- unsigned long MOTO0;
- unsigned long MOTO1;
- unsigned long MOTO2;
- unsigned long MOTO3;
- unsigned long MOTO4;
- unsigned long MOTO5;
- unsigned long MOTO6;
- unsigned long MOTO7;
- unsigned long MOTO8;
- unsigned long MOTO9;
- unsigned long MOTO10;
- unsigned long MOTO11;
- unsigned long MOTO12;
- unsigned long MOTO13;
- unsigned long MOTO14;
- unsigned long MOTO15;
- unsigned long MOTO16;
- unsigned long MOTO17;
- unsigned long MOTO18;
- unsigned long MOTO19;
- unsigned long MOTO20;
- unsigned long MOTO21;
- unsigned long MOTO22;
- unsigned long MOTO23;
- unsigned long MOTO24;
- unsigned long MOTO25;
- unsigned long MOTO26;
- unsigned long MOTO27;
- unsigned long MOTO28;
- unsigned long MOTO29;
- unsigned long MOTO30;
- unsigned long MOTO31;
- };
- //---------------------------------------------------------------------------
- // eCAN External References & Function Declarations:
- //
- extern volatile struct ECAN_REGS ECanaRegs;
- extern volatile struct LAM_REGS ECanaLAMRegs;
- extern volatile struct ECAN_MBOXES ECanaMboxes;
- // eCAN control registers require read/write access using 32-bits. Thus we
- // will create a set of shadow registers for this example. These shadow
- // registers will be used to make sure the access is 32-bits and not 16.
- //сама структура определена в файле
- // co_Init.c в программе длЯ оперативного выделениЯ памЯти
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_Gpio.h
- //
- // TITLE: DSP28 General Purpose I/O Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 24 May 2002 | L.H. | Fixed typo's on GPIOG registers
- // 0.58| 29 Jun 2002 | L.H. | No change
- //###########################################################################
- //----------------------------------------------------
- // General purpose I/O (GPIO) Register Bit Definitions
- //----------------------------------------------------
- // GPIO A mux control register bit definitions */
- //
- //
- struct GPAMUX_BITS { // bits description
- Uint16 PWM1_GPIOA0:1; // 0
- Uint16 PWM2_GPIOA1:1; // 1
- Uint16 PWM3_GPIOA2:1; // 2
- Uint16 PWM4_GPIOA3:1; // 3
- Uint16 PWM5_GPIOA4:1; // 4
- Uint16 PWM6_GPIOA5:1; // 5
- Uint16 T1PWM_GPIOA6:1; // 6
- Uint16 T2PWM_GPIOA7:1; // 7
- Uint16 CAP1Q1_GPIOA8:1; // 8
- Uint16 CAP2Q2_GPIOA9:1; // 9
- Uint16 CAP3QI1_GPIOA10:1; // 10
- Uint16 TDIRA_GPIOA11:1; // 11
- Uint16 TCLKINA_GPIOA12:1; // 12
- Uint16 C1TRIP_GPIOA13:1; // 13
- Uint16 C2TRIP_GPIOA14:1; // 14
- Uint16 C3TRIP_GPIOA15:1; // 15
- };
- union GPAMUX_REG {
- Uint16 all;
- struct GPAMUX_BITS bit;
- };
- //---------------------------------------------------------------------------------------
- // GPIO A Direction control register bit definitions
- //
- //
- struct GPADIR_BITS { // bits description
- Uint16 GPIOA0:1; // 0
- Uint16 GPIOA1:1; // 1
- Uint16 GPIOA2:1; // 2
- Uint16 GPIOA3:1; // 3
- Uint16 GPIOA4:1; // 4
- Uint16 GPIOA5:1; // 5
- Uint16 GPIOA6:1; // 6
- Uint16 GPIOA7:1; // 7
- Uint16 GPIOA8:1; // 8
- Uint16 GPIOA9:1; // 9
- Uint16 GPIOA10:1; // 10
- Uint16 GPIOA11:1; // 11
- Uint16 GPIOA12:1; // 12
- Uint16 GPIOA13:1; // 13
- Uint16 GPIOA14:1; // 14
- Uint16 GPIOA15:1; // 15
- };
- union GPADIR_REG {
- Uint16 all;
- struct GPADIR_BITS bit;
- };
- //----------------------------------
- // GPA Qualregister bit definitions
- //
- //
- struct GPAQUAL_BITS { // bits description
- Uint16 QUALPRD:8; // 0:7 Qualification Sampling Period
- Uint16 rsvd1:8; // 15:8 reserved
- };
- union GPAQUAL_REG {
- Uint16 all;
- struct GPAQUAL_BITS BIT;
- };
- //---------------------------------------------------------------------------------------
- // GPIO A Data register bit definitions
- //
- //
- struct GPADAT_BITS { // bits description
- Uint16 GPIOA0:1; // 0
- Uint16 GPIOA1:1; // 1
- Uint16 GPIOA2:1; // 2
- Uint16 GPIOA3:1; // 3
- Uint16 GPIOA4:1; // 4
- Uint16 GPIOA5:1; // 5
- Uint16 GPIOA6:1; // 6
- Uint16 GPIOA7:1; // 7
- Uint16 GPIOA8:1; // 8
- Uint16 GPIOA9:1; // 9
- Uint16 GPIOA10:1; // 10
- Uint16 GPIOA11:1; // 11
- Uint16 GPIOA12:1; // 12
- Uint16 GPIOA13:1; // 13
- Uint16 GPIOA14:1; // 14
- Uint16 GPIOA15:1; // 15
- };
- union GPADAT_REG {
- Uint16 all;
- struct GPADAT_BITS bit;
- };
- //---------------------------------------------------------------------------------------
- // GPIO A Data set bit definitions
- //
- //
- struct GPASET_BITS { // bits description
- Uint16 GPIOA0:1; // 0
- Uint16 GPIOA1:1; // 1
- Uint16 GPIOA2:1; // 2
- Uint16 GPIOA3:1; // 3
- Uint16 GPIOA4:1; // 4
- Uint16 GPIOA5:1; // 5
- Uint16 GPIOA6:1; // 6
- Uint16 GPIOA7:1; // 7
- Uint16 GPIOA8:1; // 8
- Uint16 GPIOA9:1; // 9
- Uint16 GPIOA10:1; // 10
- Uint16 GPIOA11:1; // 11
- Uint16 GPIOA12:1; // 12
- Uint16 GPIOA13:1; // 13
- Uint16 GPIOA14:1; // 14
- Uint16 GPIOA15:1; // 15
- };
- union GPASET_REG {
- Uint16 all;
- struct GPASET_BITS bit;
- };
- //---------------------------------------------------------------------------------------
- // GPIO A Data clear register bit definitions
- //
- //
- struct GPACLEAR_BITS { // bits description
- Uint16 GPIOA0:1; // 0
- Uint16 GPIOA1:1; // 1
- Uint16 GPIOA2:1; // 2
- Uint16 GPIOA3:1; // 3
- Uint16 GPIOA4:1; // 4
- Uint16 GPIOA5:1; // 5
- Uint16 GPIOA6:1; // 6
- Uint16 GPIOA7:1; // 7
- Uint16 GPIOA8:1; // 8
- Uint16 GPIOA9:1; // 9
- Uint16 GPIOA10:1; // 10
- Uint16 GPIOA11:1; // 11
- Uint16 GPIOA12:1; // 12
- Uint16 GPIOA13:1; // 13
- Uint16 GPIOA14:1; // 14
- Uint16 GPIOA15:1; // 15
- };
- union GPACLEAR_REG {
- Uint16 all;
- struct GPACLEAR_BITS bit;
- };
- //---------------------------------------------------------------------------------------
- // GPIO A Data toggle register bit definitions
- //
- //
- struct GPATOGGLE_BITS { // bits description
- Uint16 GPIOA0:1; // 0
- Uint16 GPIOA1:1; // 1
- Uint16 GPIOA2:1; // 2
- Uint16 GPIOA3:1; // 3
- Uint16 GPIOA4:1; // 4
- Uint16 GPIOA5:1; // 5
- Uint16 GPIOA6:1; // 6
- Uint16 GPIOA7:1; // 7
- Uint16 GPIOA8:1; // 8
- Uint16 GPIOA9:1; // 9
- Uint16 GPIOA10:1; // 10
- Uint16 GPIOA11:1; // 11
- Uint16 GPIOA12:1; // 12
- Uint16 GPIOA13:1; // 13
- Uint16 GPIOA14:1; // 14
- Uint16 GPIOA15:1; // 15
- };
- union GPATOGGLE_REG {
- Uint16 all;
- struct GPATOGGLE_BITS bit;
- };
- //---------------------------------------------------------------------------------
- // GPIO B mux control register bit definitions
- //
- //
- struct GPBMUX_BITS { // bits description
- Uint16 PWM7_GPIOB0:1; // 0
- Uint16 PWM8_GPIOB1:1; // 1
- Uint16 PWM9_GPIOB2:1; // 2
- Uint16 PWM10_GPIOB3:1; // 3
- Uint16 PWM11_GPIOB4:1; // 4
- Uint16 PWM12_GPIOB5:1; // 5
- Uint16 T3PWM_GPIOB6:1; // 6
- Uint16 T4PWM_GPIOB7:1; // 7
- Uint16 CAP4Q1_GPIOB8:1; // 8
- Uint16 CAP5Q2_GPIOB9:1; // 9
- Uint16 CAP6QI2_GPIOB10:1; // 10
- Uint16 TDIRB_GPIOB11:1; // 11
- Uint16 TCLKINB_GPIOB12:1; // 12
- Uint16 C4TRIP_GPIOB13:1; // 13
- Uint16 C5TRIP_GPIOB14:1; // 14
- Uint16 C6TRIP_GPIOB15:1; // 15
- };
- union GPBMUX_REG {
- Uint16 all;
- struct GPBMUX_BITS bit;
- };
- //---------------------------------------------------------------------------------------
- // GPIO B Direction control register bit definitions
- //
- //
- struct GPBDIR_BITS { // bits description
- Uint16 GPIOB0:1; // 0
- Uint16 GPIOB1:1; // 1
- Uint16 GPIOB2:1; // 2
- Uint16 GPIOB3:1; // 3
- Uint16 GPIOB4:1; // 4
- Uint16 GPIOB5:1; // 5
- Uint16 GPIOB6:1; // 6
- Uint16 GPIOB7:1; // 7
- Uint16 GPIOB8:1; // 8
- Uint16 GPIOB9:1; // 9
- Uint16 GPIOB10:1; // 10
- Uint16 GPIOB11:1; // 11
- Uint16 GPIOB12:1; // 12
- Uint16 GPIOB13:1; // 13
- Uint16 GPIOB14:1; // 14
- Uint16 GPIOB15:1; // 15
- };
- union GPBDIR_REG {
- Uint16 all;
- struct GPBDIR_BITS bit;
- };
- //-----------------------------------
- // GPB Qualregister bit definitions
- //
- //
- struct GPBQUAL_BITS { // bits description
- Uint16 QUALPRD:8; // 0:7 Qualification Sampling Period
- Uint16 rsvd1:8; // 15:8 reserved
- };
- union GPBQUAL_REG {
- Uint16 all;
- struct GPBQUAL_BITS BIT;
- };
- //---------------------------------------------------------------------------------------
- // GPIO B data register bit definitions
- //
- //
- struct GPBDAT_BITS { // bits description
- Uint16 GPIOB0:1; // 0
- Uint16 GPIOB1:1; // 1
- Uint16 GPIOB2:1; // 2
- Uint16 GPIOB3:1; // 3
- Uint16 GPIOB4:1; // 4
- Uint16 GPIOB5:1; // 5
- Uint16 GPIOB6:1; // 6
- Uint16 GPIOB7:1; // 7
- Uint16 GPIOB8:1; // 8
- Uint16 GPIOB9:1; // 9
- Uint16 GPIOB10:1; // 10
- Uint16 GPIOB11:1; // 11
- Uint16 GPIOB12:1; // 12
- Uint16 GPIOB13:1; // 13
- Uint16 GPIOB14:1; // 14
- Uint16 GPIOB15:1; // 15
- };
- union GPBDAT_REG {
- Uint16 all;
- struct GPBDAT_BITS bit;
- };
- //---------------------------------------------------------------------------------------
- // GPIO B data set register bit definitions
- //
- //
- struct GPBSET_BITS { // bits description
- Uint16 GPIOB0:1; // 0
- Uint16 GPIOB1:1; // 1
- Uint16 GPIOB2:1; // 2
- Uint16 GPIOB3:1; // 3
- Uint16 GPIOB4:1; // 4
- Uint16 GPIOB5:1; // 5
- Uint16 GPIOB6:1; // 6
- Uint16 GPIOB7:1; // 7
- Uint16 GPIOB8:1; // 8
- Uint16 GPIOB9:1; // 9
- Uint16 GPIOB10:1; // 10
- Uint16 GPIOB11:1; // 11
- Uint16 GPIOB12:1; // 12
- Uint16 GPIOB13:1; // 13
- Uint16 GPIOB14:1; // 14
- Uint16 GPIOB15:1; // 15
- };
- union GPBSET_REG {
- Uint16 all;
- struct GPBSET_BITS bit;
- };
- //---------------------------------------------------------------------------------------
- // GPIO B data clear register bit definitions
- //
- //
- struct GPBCLEAR_BITS { // bits description
- Uint16 GPIOB0:1; // 0
- Uint16 GPIOB1:1; // 1
- Uint16 GPIOB2:1; // 2
- Uint16 GPIOB3:1; // 3
- Uint16 GPIOB4:1; // 4
- Uint16 GPIOB5:1; // 5
- Uint16 GPIOB6:1; // 6
- Uint16 GPIOB7:1; // 7
- Uint16 GPIOB8:1; // 8
- Uint16 GPIOB9:1; // 9
- Uint16 GPIOB10:1; // 10
- Uint16 GPIOB11:1; // 11
- Uint16 GPIOB12:1; // 12
- Uint16 GPIOB13:1; // 13
- Uint16 GPIOB14:1; // 14
- Uint16 GPIOB15:1; // 15
- };
- union GPBCLEAR_REG {
- Uint16 all;
- struct GPBCLEAR_BITS bit;
- };
- //---------------------------------------------------------------------------------------
- // GPIO B data toggle register bit definitions
- //
- //
- struct GPBTOGGLE_BITS { // bits description
- Uint16 GPIOB0:1; // 0
- Uint16 GPIOB1:1; // 1
- Uint16 GPIOB2:1; // 2
- Uint16 GPIOB3:1; // 3
- Uint16 GPIOB4:1; // 4
- Uint16 GPIOB5:1; // 5
- Uint16 GPIOB6:1; // 6
- Uint16 GPIOB7:1; // 7
- Uint16 GPIOB8:1; // 8
- Uint16 GPIOB9:1; // 9
- Uint16 GPIOB10:1; // 10
- Uint16 GPIOB11:1; // 11
- Uint16 GPIOB12:1; // 12
- Uint16 GPIOB13:1; // 13
- Uint16 GPIOB14:1; // 14
- Uint16 GPIOB15:1; // 15
- };
- union GPBTOGGLE_REG {
- Uint16 all;
- struct GPBTOGGLE_BITS bit;
- };
- //---------------------------------------------------------------------------------
- // GPIO D mux control register bit definitions
- //
- //
- struct GPDMUX_BITS { // bits description
- Uint16 T1CTRIP_PDPA_GPIOD0:1; // 0
- Uint16 T2CTRIP_SOCA_GPIOD1:1; // 1
- Uint16 rsvd1:3; // 4:2
- Uint16 T3CTRIP_PDPB_GPIOD5:1; // 5
- Uint16 T4CTRIP_SOCB_GPIOD6:1; // 6
- Uint16 rsvd2:9; // 15:7
- };
- union GPDMUX_REG {
- Uint16 all;
- struct GPDMUX_BITS bit;
- };
- //----------------------------------------------------
- // GPIO D Direction control register bit definitions
- //
- //
- struct GPDDIR_BITS { // bits description
- Uint16 GPIOD0:1; // 0
- Uint16 GPIOD1:1; // 1
- Uint16 rsvd1:3; // 4:2
- Uint16 GPIOD5:1; // 5
- Uint16 GPIOD6:1; // 6
- Uint16 rsvd2:9; // 15:7
- };
- union GPDDIR_REG {
- Uint16 all;
- struct GPDDIR_BITS bit;
- };
- //----------------------------------------------------
- // GPIO D data register bit definitions
- //
- //
- struct GPDDAT_BITS { // bits description
- Uint16 GPIOD0:1; // 0
- Uint16 GPIOD1:1; // 1
- Uint16 rsvd1:3; // 4:2
- Uint16 GPIOD5:1; // 5
- Uint16 GPIOD6:1; // 6
- Uint16 rsvd2:9; // 15:7
- };
- union GPDDAT_REG {
- Uint16 all;
- struct GPDDAT_BITS bit;
- };
- //----------------------------------------------------
- // GPIO D data set register bit definitions
- //
- //
- struct GPDSET_BITS { // bits description
- Uint16 GPIOD0:1; // 0
- Uint16 GPIOD1:1; // 1
- Uint16 rsvd1:3; // 4:2
- Uint16 GPIOD5:1; // 5
- Uint16 GPIOD6:1; // 6
- Uint16 rsvd2:9; // 15:7
- };
- union GPDSET_REG {
- Uint16 all;
- struct GPDSET_BITS bit;
- };
- //----------------------------------------------------
- // GPIO D data clear register bit definitions
- //
- //
- struct GPDCLEAR_BITS { // bits description
- Uint16 GPIOD0:1; // 0
- Uint16 GPIOD1:1; // 1
- Uint16 rsvd1:3; // 4:2
- Uint16 GPIOD5:1; // 5
- Uint16 GPIOD6:1; // 6
- Uint16 rsvd2:9; // 15:7
- };
- union GPDCLEAR_REG {
- Uint16 all;
- struct GPDCLEAR_BITS bit;
- };
- //----------------------------------------------------
- // GPIO D data toggle register bit definitions
- //
- //
- struct GPDTOGGLE_BITS { // bits description
- Uint16 GPIOD0:1; // 0
- Uint16 GPIOD1:1; // 1
- Uint16 rsvd1:3; // 4:2
- Uint16 GPIOD5:1; // 5
- Uint16 GPIOD6:1; // 6
- Uint16 rsvd2:9; // 15:7
- };
- union GPDTOGGLE_REG {
- Uint16 all;
- struct GPDTOGGLE_BITS bit;
- };
- //----------------------------------
- // GPIOD Qualregister bit definitions
- //
- //
- struct GPDQUAL_BITS { // bits description
- Uint16 QUALPRD:8; // 0:7 Qualification Sampling Period
- Uint16 rsvd1:8; // 15:8 reserved
- };
- union GPDQUAL_REG {
- Uint16 all;
- struct GPDQUAL_BITS BIT;
- };
- //---------------------------------------------
- // GPIO E mux control register bit definitions
- //
- //
- struct GPEMUX_BITS { // bits description
- Uint16 XINT1_XBIO_GPIOE0:1; // 0
- Uint16 XINT2_ADCSOC_GPIOE1:1; // 1
- Uint16 XNMI_XINT13_GPIOE2:1; // 2
- Uint16 rsvd1:12; // 15:3
- };
- union GPEMUX_REG {
- Uint16 all;
- struct GPEMUX_BITS bit;
- };
- //---------------------------------------------------
- // GPIO E Direction control register bit definitions
- //
- //
- struct GPEDIR_BITS { // bits description
- Uint16 GPIOE0:1; // 0
- Uint16 GPIOE1:1; // 1
- Uint16 GPIOE2:1; // 2
- Uint16 rsvd1:12; // 15:3
- };
- union GPEDIR_REG {
- Uint16 all;
- struct GPEDIR_BITS bit;
- };
- //---------------------------------------------------
- // GPIO E data register bit definitions
- //
- //
- struct GPEDAT_BITS { // bits description
- Uint16 GPIOE0:1; // 0
- Uint16 GPIOE1:1; // 1
- Uint16 GPIOE2:1; // 2
- Uint16 rsvd1:12; // 15:3
- };
- union GPEDAT_REG {
- Uint16 all;
- struct GPEDAT_BITS bit;
- };
- //---------------------------------------------------
- // GPIO E data set register bit definitions
- //
- //
- struct GPESET_BITS { // bits description
- Uint16 GPIOE0:1; // 0
- Uint16 GPIOE1:1; // 1
- Uint16 GPIOE2:1; // 2
- Uint16 rsvd1:12; // 15:3
- };
- union GPESET_REG {
- Uint16 all;
- struct GPESET_BITS bit;
- };
- //---------------------------------------------------
- // GPIO E data clear register bit definitions
- //
- //
- struct GPECLEAR_BITS { // bits description
- Uint16 GPIOE0:1; // 0
- Uint16 GPIOE1:1; // 1
- Uint16 GPIOE2:1; // 2
- Uint16 rsvd1:12; // 15:3
- };
- union GPECLEAR_REG {
- Uint16 all;
- struct GPECLEAR_BITS bit;
- };
- //---------------------------------------------------
- // GPIO E data toggle register bit definitions
- //
- //
- struct GPETOGGLE_BITS { // bits description
- Uint16 GPIOE0:1; // 0
- Uint16 GPIOE1:1; // 1
- Uint16 GPIOE2:1; // 2
- Uint16 rsvd1:12; // 15:3
- };
- union GPETOGGLE_REG {
- Uint16 all;
- struct GPETOGGLE_BITS bit;
- };
- //-----------------------------------
- // GPIOE Qualregister bit definitions
- //
- //
- struct GPEQUAL_BITS { // bits description
- Uint16 QUALPRD:8; // 0:7 Qualification Sampling Period
- Uint16 rsvd1:8; // 15:8 reserved
- };
- union GPEQUAL_REG {
- Uint16 all;
- struct GPEQUAL_BITS BIT;
- };
- //----------------------------------------------
- // GPIO F mux control register bit definitions
- //
- //
- struct GPFMUX_BITS { // bits description
- Uint16 SPISIMOA_GPIOF0:1; // 0
- Uint16 SPISOMIA_GPIOF1:1; // 1
- Uint16 SPICLKA_GPIOF2:1; // 2
- Uint16 SPISTEA_GPIOF3:1; // 3
- Uint16 SCITXDA_GPIOF4:1; // 4
- Uint16 SCIRXDA_GPIOF5:1; // 5
- Uint16 CANTXA_GPIOF6:1; // 6
- Uint16 CANRXA_GPIOF7:1; // 7
- Uint16 MCLKXA_GPIOF8:1; // 8
- Uint16 MCLKRA_GPIOF9:1; // 9
- Uint16 MFSXA_GPIOF10:1; // 10
- Uint16 MFSRA_GPIOF11:1; // 11
- Uint16 MDXA_GPIOF12:1; // 12
- Uint16 MDRA_GPIOF13:1; // 13
- Uint16 XF_GPIOF14:1; // 14
- Uint16 spare_GPIOF15:1; // 15
- };
- /* Allow access to the bit fields or entire register */
- union GPFMUX_REG {
- Uint16 all;
- struct GPFMUX_BITS bit;
- };
- //---------------------------------------------------
- // GPIO F Direction control register bit definitions
- //
- //
- struct GPFDIR_BITS { // bits description
- Uint16 GPIOF0:1; // 0
- Uint16 GPIOF1:1; // 1
- Uint16 GPIOF2:1; // 2
- Uint16 GPIOF3:1; // 3
- Uint16 GPIOF4:1; // 4
- Uint16 GPIOF5:1; // 5
- Uint16 GPIOF6:1; // 6
- Uint16 GPIOF7:1; // 7
- Uint16 GPIOF8:1; // 8
- Uint16 GPIOF9:1; // 9
- Uint16 GPIOF10:1; // 10
- Uint16 GPIOF11:1; // 11
- Uint16 GPIOF12:1; // 12
- Uint16 GPIOF13:1; // 13
- Uint16 GPIOF14:1; // 14
- Uint16 GPIOF15:1; // 15
- };
- union GPFDIR_REG {
- Uint16 all;
- struct GPFDIR_BITS bit;
- };
- //---------------------------------------------------
- // GPIO F data register bit definitions
- //
- //
- struct GPFDAT_BITS { // bits description
- Uint16 GPIOF0:1; // 0
- Uint16 GPIOF1:1; // 1
- Uint16 GPIOF2:1; // 2
- Uint16 GPIOF3:1; // 3
- Uint16 GPIOF4:1; // 4
- Uint16 GPIOF5:1; // 5
- Uint16 GPIOF6:1; // 6
- Uint16 GPIOF7:1; // 7
- Uint16 GPIOF8:1; // 8
- Uint16 GPIOF9:1; // 9
- Uint16 GPIOF10:1; // 10
- Uint16 GPIOF11:1; // 11
- Uint16 GPIOF12:1; // 12
- Uint16 GPIOF13:1; // 13
- Uint16 GPIOF14:1; // 14
- Uint16 GPIOF15:1; // 15
- };
- union GPFDAT_REG {
- Uint16 all;
- struct GPFDAT_BITS bit;
- };
- //---------------------------------------------------
- // GPIO F data set register bit definitions
- //
- //
- struct GPFSET_BITS { // bits description
- Uint16 GPIOF0:1; // 0
- Uint16 GPIOF1:1; // 1
- Uint16 GPIOF2:1; // 2
- Uint16 GPIOF3:1; // 3
- Uint16 GPIOF4:1; // 4
- Uint16 GPIOF5:1; // 5
- Uint16 GPIOF6:1; // 6
- Uint16 GPIOF7:1; // 7
- Uint16 GPIOF8:1; // 8
- Uint16 GPIOF9:1; // 9
- Uint16 GPIOF10:1; // 10
- Uint16 GPIOF11:1; // 11
- Uint16 GPIOF12:1; // 12
- Uint16 GPIOF13:1; // 13
- Uint16 GPIOF14:1; // 14
- Uint16 GPIOF15:1; // 15
- };
- union GPFSET_REG {
- Uint16 all;
- struct GPFSET_BITS bit;
- };
- //---------------------------------------------------
- // GPIO F data clear register bit definitions
- //
- //
- struct GPFCLEAR_BITS { // bits description
- Uint16 GPIOF0:1; // 0
- Uint16 GPIOF1:1; // 1
- Uint16 GPIOF2:1; // 2
- Uint16 GPIOF3:1; // 3
- Uint16 GPIOF4:1; // 4
- Uint16 GPIOF5:1; // 5
- Uint16 GPIOF6:1; // 6
- Uint16 GPIOF7:1; // 7
- Uint16 GPIOF8:1; // 8
- Uint16 GPIOF9:1; // 9
- Uint16 GPIOF10:1; // 10
- Uint16 GPIOF11:1; // 11
- Uint16 GPIOF12:1; // 12
- Uint16 GPIOF13:1; // 13
- Uint16 GPIOF14:1; // 14
- Uint16 GPIOF15:1; // 15
- };
- union GPFCLEAR_REG {
- Uint16 all;
- struct GPFCLEAR_BITS bit;
- };
- //---------------------------------------------------
- // GPIO F data toggle register bit definitions
- //
- //
- struct GPFTOGGLE_BITS { // bits description
- Uint16 GPIOF0:1; // 0
- Uint16 GPIOF1:1; // 1
- Uint16 GPIOF2:1; // 2
- Uint16 GPIOF3:1; // 3
- Uint16 GPIOF4:1; // 4
- Uint16 GPIOF5:1; // 5
- Uint16 GPIOF6:1; // 6
- Uint16 GPIOF7:1; // 7
- Uint16 GPIOF8:1; // 8
- Uint16 GPIOF9:1; // 9
- Uint16 GPIOF10:1; // 10
- Uint16 GPIOF11:1; // 11
- Uint16 GPIOF12:1; // 12
- Uint16 GPIOF13:1; // 13
- Uint16 GPIOF14:1; // 14
- Uint16 GPIOF15:1; // 15
- };
- union GPFTOGGLE_REG {
- Uint16 all;
- struct GPFTOGGLE_BITS bit;
- };
- //----------------------------------------------
- // GPIO G mux control register bit definitions
- //
- //
- struct GPGMUX_BITS { // bits description
- Uint16 rsvd1:4; // 3:0
- Uint16 SCITXDB_GPIOG4:1; // 4
- Uint16 SCIRXDB_GPIOG5:1; // 5
- Uint16 rsvd2:10; // 15:6
- };
- /* Allow access to the bit fields or entire register */
- union GPGMUX_REG {
- Uint16 all;
- struct GPGMUX_BITS bit;
- };
- //---------------------------------------------------
- // GPIO G Direction control register bit definitions
- //
- //
- struct GPGDIR_BITS { // bits description
- Uint16 rsvd1:4; // 3:0
- Uint16 GPIOG4:1; // 4
- Uint16 GPIOG5:1; // 5
- Uint16 rsvd2:10; // 15:6
- };
- union GPGDIR_REG {
- Uint16 all;
- struct GPGDIR_BITS bit;
- };
- //---------------------------------------------------
- // GPIO G data register bit definitions
- //
- //
- struct GPGDAT_BITS { // bits description
- Uint16 rsvd1:4; // 3:0
- Uint16 GPIOG4:1; // 4
- Uint16 GPIOG5:1; // 5
- Uint16 rsvd2:10; // 15:6
- };
- union GPGDAT_REG {
- Uint16 all;
- struct GPGDAT_BITS bit;
- };
- //---------------------------------------------------
- // GPIO G data set register bit definitions
- //
- //
- struct GPGSET_BITS { // bits description
- Uint16 rsvd1:4; // 3:0
- Uint16 GPIOG4:1; // 4
- Uint16 GPIOG5:1; // 5
- Uint16 rsvd2:10; // 15:6
- };
- union GPGSET_REG {
- Uint16 all;
- struct GPGSET_BITS bit;
- };
- //---------------------------------------------------
- // GPIO G data clear register bit definitions
- //
- //
- struct GPGCLEAR_BITS { // bits description
- Uint16 rsvd1:4; // 3:0
- Uint16 GPIOG4:1; // 4
- Uint16 GPIOG5:1; // 5
- Uint16 rsvd2:10; // 15:6
- };
- union GPGCLEAR_REG {
- Uint16 all;
- struct GPGCLEAR_BITS bit;
- };
- //---------------------------------------------------
- // GPIO G data toggle register bit definitions
- //
- //
- struct GPGTOGGLE_BITS { // bits description
- Uint16 rsvd1:4; // 3:0
- Uint16 GPIOG4:1; // 4
- Uint16 GPIOG5:1; // 5
- Uint16 rsvd2:10; // 15:6
- };
- union GPGTOGGLE_REG {
- Uint16 all;
- struct GPGTOGGLE_BITS bit;
- };
- struct GPIO_MUX_REGS {
- union GPAMUX_REG GPAMUX;
- union GPADIR_REG GPADIR;
- union GPAQUAL_REG GPAQUAL;
- Uint16 rsvd1;
- union GPBMUX_REG GPBMUX;
- union GPBDIR_REG GPBDIR;
- union GPBQUAL_REG GPBQUAL;
- Uint16 rsvd2[5];
- union GPDMUX_REG GPDMUX;
- union GPDDIR_REG GPDDIR;
- union GPDQUAL_REG GPDQUAL;
- Uint16 rsvd3;
- union GPEMUX_REG GPEMUX;
- union GPEDIR_REG GPEDIR;
- union GPEQUAL_REG GPEQUAL;
- Uint16 rsvd4;
- union GPFMUX_REG GPFMUX;
- union GPFDIR_REG GPFDIR;
- Uint16 rsvd5[2];
- union GPGMUX_REG GPGMUX;
- union GPGDIR_REG GPGDIR;
- Uint16 rsvd6[6];
- };
- struct GPIO_DATA_REGS {
- union GPADAT_REG GPADAT;
- union GPASET_REG GPASET;
- union GPACLEAR_REG GPACLEAR;
- union GPATOGGLE_REG GPATOGGLE;
- union GPBDAT_REG GPBDAT;
- union GPBSET_REG GPBSET;
- union GPBCLEAR_REG GPBCLEAR;
- union GPBTOGGLE_REG GPBTOGGLE;
- Uint16 rsvd1[4];
- union GPDDAT_REG GPDDAT;
- union GPDSET_REG GPDSET;
- union GPDCLEAR_REG GPDCLEAR;
- union GPDTOGGLE_REG GPDTOGGLE;
- union GPEDAT_REG GPEDAT;
- union GPESET_REG GPESET;
- union GPECLEAR_REG GPECLEAR;
- union GPETOGGLE_REG GPETOGGLE;
- union GPFDAT_REG GPFDAT;
- union GPFSET_REG GPFSET;
- union GPFCLEAR_REG GPFCLEAR;
- union GPFTOGGLE_REG GPFTOGGLE;
- union GPGDAT_REG GPGDAT;
- union GPGSET_REG GPGSET;
- union GPGCLEAR_REG GPGCLEAR;
- union GPGTOGGLE_REG GPGTOGGLE;
- Uint16 rsvd2[4];
- };
- //---------------------------------------------------------------------------
- // GPI/O External References & Function Declarations:
- //
- extern volatile struct GPIO_MUX_REGS GpioMuxRegs;
- extern volatile struct GPIO_DATA_REGS GpioDataRegs;
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_Ev.h
- //
- // TITLE: DSP28 Device Event Manager Register Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 17 May 2002 | L.H. | Removed extra reserved word in EVA EVB reg file
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | Fixed missing bits in GPTCONA
- //###########################################################################
- /* --------------------------------------------------- */
- /* F2810/12 Event Manager (EV) GP Timer Registers */
- /* */
- /* ----------------------------------------------------*/
- /* Overall Timer Control Register */
- struct GPTCONA_BITS {
- Uint16 T1PIN:2; // 1:0 Polarity of GP timer 1 compare
- Uint16 T2PIN:2; // 3:2 Polarity of GP timer 2 compare
- Uint16 T1CMPOE:1; // 4 Timer1 compare output
- Uint16 T2CMPOE:1; // 5 Timer2 compare output
- Uint16 TCOMPOE:1; // 6 Compare output enable
- Uint16 T1TOADC:2; // 8:7 Start ADC with timer 1 event
- Uint16 T2TOADC:2; // 10:9 Start ADC with timer 2 event
- Uint16 rsvd2:2; // 12:11 reserved
- Uint16 T1STAT:1; // 13 GP Timer 1 status (read only)
- Uint16 T2STAT:1; // 14 GP Timer 2 status (read only)
- Uint16 rsvd:1; // 15 reserved
- };
- /* Allow access to the bit fields or entire register */
- union GPTCONA_REG {
- Uint16 all;
- struct GPTCONA_BITS bit;
- };
- struct GPTCONB_BITS {
- Uint16 T3PIN:2; // 1:0 Polarity of GP timer 3 compare
- Uint16 T4PIN:2; // 3:2 Polarity of GP timer 4 compare
- Uint16 T3CMPOE:1; // 4 Timer3 compare output
- Uint16 T4CMPOE:1; // 5 Timer4 compare output
- Uint16 TCOMPOE:1; // 6 Compare output enable
- Uint16 T3TOADC:2; // 8:7 Start ADC with timer 3 event
- Uint16 T4TOADC:2; // 10:9 Start ADC with timer 4 event
- Uint16 T1CTRIP:1; // 11 Timer1 trip enable
- Uint16 T2CTRIP:1; // 12 Timer2 trip enable
- Uint16 T3STAT:1; // 13 GP Timer 3 status (read only)
- Uint16 T4STAT:1; // 14 GP Timer 4 status (read only)
- Uint16 rsvd2:1; // 15 reserved
- };
- /* Allow access to the bit fields or entire register */
- union GPTCONB_REG {
- Uint16 all;
- struct GPTCONB_BITS bit;
- };
- /* Timer Control Register bit defintions */
- struct TCONA_BITS {
- Uint16 SET1PR:1; // 0 Period register select
- Uint16 TECMPR:1; // 1 Timer compare enable
- Uint16 TCLD10:2; // 3:2 Timer copare register reload
- Uint16 TCLKS10:2; // 5:4 Clock source select
- Uint16 TENABLE:1; // 6 Timer enable
- Uint16 T2SWT1:1; // 7 Start GP timer 2 with GP timer 1's enable
- Uint16 TPS:3; // 10:8 Input clock prescaler
- Uint16 TMODE:2; // 12:11 Count mode selection
- Uint16 rsvd:1; // 13 reserved
- Uint16 FREE:1; // 14 Free emulation control
- Uint16 SOFT:1; // 15 Soft emulation control
- };
- /* Allow access to the bit fields or entire register */
- union TCONA_REG {
- Uint16 all;
- struct TCONA_BITS bit;
- };
- struct TCONB_BITS {
- Uint16 SET3PR:1; // 0 Period register select
- Uint16 TECMPR:1; // 1 Timer compare enable
- Uint16 TCLD10:2; // 3:2 Timer copare register reload
- Uint16 TCLKS10:2; // 5:4 Clock source select
- Uint16 TENABLE:1; // 6 Timer enable
- Uint16 T4SWT3:1; // 7 Start GP timer 2 with GP timer 1's enable
- Uint16 TPS:3; // 10:8 Input clock prescaler
- Uint16 TMODE:2; // 12:11 Count mode selection
- Uint16 rsvd:1; // 13 reserved
- Uint16 FREE:1; // 14 Free emulation control
- Uint16 SOFT:1; // 15 Soft emulation control
- };
- /* Allow access to the bit fields or entire register */
- union TCONB_REG {
- Uint16 all;
- struct TCONB_BITS bit;
- };
- struct EXTCONA_BITS {
- Uint16 INDCOE:1; // 0 Independant compare output
- Uint16 QEPIQEL:1; // 1 QEP/CAP3 Index Qual Mode
- Uint16 QEPIE:1; // 2 QEP index enable
- Uint16 EVSOCE:1; // 3 Ev start of conversion output enable
- Uint16 rsvd:12; // 15:4 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EXTCONA_REG {
- Uint16 all;
- struct EXTCONA_BITS bit;
- };
- struct EXTCONB_BITS {
- Uint16 INDCOE:1; // 0 Independant compare output
- Uint16 QEPIQEL:1; // 1 QEP/CAP3 Index Qual Mode
- Uint16 QEPIE:1; // 2 QEP index enable
- Uint16 EVSOCE:1; // 3 Ev start of conversion output enable
- Uint16 rsvd:12; // 15:4 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EXTCONB_REG {
- Uint16 all;
- struct EXTCONA_BITS bit;
- };
- /* Compare Control Register */
- struct COMCONA_BITS {
- Uint16 rsvd:8; // 7:0 reserved
- Uint16 PDPINTASTATUS:1;// 8 Current status of the PDPINTA pin
- Uint16 FCOMPOE:1; // 9 Compare output enable
- Uint16 ACTRLD:2; // 11:10 Action control register reload
- Uint16 SVENABLE:1; // 12 Space vector PWM Mode enable
- Uint16 CLD:2; // 14:13 Compare register reload condition
- Uint16 CENABLE:1; // 15 Compare enable
- };
- /* Allow access to the bit fields or entire register */
- union COMCONA_REG {
- Uint16 all;
- struct COMCONA_BITS bit;
- };
- struct COMCONB_BITS {
- Uint16 rsvd:8; // 7:0 reserved
- Uint16 PDPINTBSTATUS:1;// 8 Current status of the PDPINTB pin
- Uint16 FCOMPOE:1; // 9 Compare output enable
- Uint16 ACTRLD:2; // 11:10 Action control register reload
- Uint16 SVENABLE:1; // 12 Space vector PWM Mode enable
- Uint16 CLD:2; // 14:13 Compare register reload condition
- Uint16 CENABLE:1; // 15 Compare enable
- };
- /* Allow access to the bit fields or entire register */
- union COMCONB_REG {
- Uint16 all;
- struct COMCONB_BITS bit;
- };
- /* Compare Action Control Register bit definitions */
- struct ACTRA_BITS {
- Uint16 CMP1ACT:2; // 1:0 Action on compare output pin 1 CMP1
- Uint16 CMP2ACT:2; // 3:2 Action on compare output pin 2 CMP2
- Uint16 CMP3ACT:2; // 5:4 Action on compare output pin 3 CMP3
- Uint16 CMP4ACT:2; // 7:6 Action on compare output pin 4 CMP4
- Uint16 CMP5ACT:2; // 9:8 Action on compare output pin 5 CMP5
- Uint16 CMP6ACT:2; // 11:10 Action on compare output pin 6 CMP6
- Uint16 D:3; // 14:12 Basic vector bits
- Uint16 SVRDIR:1; // 15 Space vecor PWM rotation dir
- };
- /* Allow access to the bit fields or entire register */
- union ACTRA_REG {
- Uint16 all;
- struct ACTRA_BITS bit;
- };
- struct ACTRB_BITS {
- Uint16 CMP7ACT:2; // 1:0 Action on compare output pin 7 CMP7
- Uint16 CMP8ACT:2; // 3:2 Action on compare output pin 8 CMP8
- Uint16 CMP9ACT:2; // 5:4 Action on compare output pin 9 CMP9
- Uint16 CMP10ACT:2; // 7:6 Action on compare output pin 10 CMP10
- Uint16 CMP11ACT:2; // 9:8 Action on compare output pin 11 CMP11
- Uint16 CMP12ACT:2; // 11:10 Action on compare output pin 12 CMP12
- Uint16 D:3; // 14:12 Basic vector bits
- Uint16 SVRDIR:1; // 15 Space vecor PWM rotation dir
- };
- /* Allow access to the bit fields or entire register */
- union ACTRB_REG {
- Uint16 all;
- struct ACTRB_BITS bit;
- };
- /* Dead-Band Timer Control register bit definitions */
- struct DBTCON_BITS {
- Uint16 rsvd1:2; // 1:0 reserved
- Uint16 DBTPS:3; // 4:2 Dead-Band timer prescaler
- Uint16 EDBT1:1; // 5 Dead-Band timer 1 enable
- Uint16 EDBT2:1; // 6 Dead-Band timer 2 enable
- Uint16 EDBT3:1; // 7 Dead-Band timer 3 enable
- Uint16 DBT:4; // 11:8 Dead-Band timer period
- Uint16 rsvd2:4; // 15:12 reserved
- };
- /* Allow access to the bit fields or entire register */
- union DBTCON_REG {
- Uint16 all;
- struct DBTCON_BITS bit;
- };
- /* Capture Control register bit definitions */
- struct CAPCONA_BITS {
- Uint16 rsvd1:2; // 1:0 reserved
- Uint16 CAP3EDGE:2; // 3:2 Edge Detection for Unit 3
- Uint16 CAP2EDGE:2; // 5:4 Edge Detection for Unit 2
- Uint16 CAP1EDGE:2; // 7:6 Edge Detection for Unit 1
- Uint16 CAP3TOADC:1; // 8 Unit 3 starts the ADC
- Uint16 CAP12TSEL:1; // 9 GP Timer selection for Units 1 and 2
- Uint16 CAP3TSEL:1; // 10 GP Timer selection for Unit 3
- Uint16 rsvd2:1; // 11 reserved
- Uint16 CAP3EN:1; // 12 Capture Unit 3 control
- Uint16 CAPQEPN:2; // 14:13 Capture Unit 1 and 2 control
- Uint16 CAPRES:1; // 15 Capture reset (always reads 0)
- };
- /* Allow access to the bit fields or entire register */
- union CAPCONA_REG {
- Uint16 all;
- struct CAPCONA_BITS bit;
- };
- /* Control register bit definitions */
- struct CAPCONB_BITS {
- Uint16 rsvd1:2; // 1:0 reserved
- Uint16 CAP6EDGE:2; // 3:2 Edge Detection for Unit 6
- Uint16 CAP5EDGE:2; // 5:4 Edge Detection for Unit 5
- Uint16 CAP4EDGE:2; // 7:6 Edge Detection for Unit 4
- Uint16 CAP6TOADC:1; // 8 Unit 6 starts the ADC
- Uint16 CAP45TSEL:1; // 9 GP Timer selection for Units 4 and 5
- Uint16 CAP6TSEL:1; // 10 GP Timer selection for Unit 6
- Uint16 rsvd2:1; // 11 reserved
- Uint16 CAP6EN:1; // 12 Capture Unit 6 control
- Uint16 CAPQEPN:2; // 14:13 Capture Unit 4 and 5 control
- Uint16 CAPRES:1; // 15 Capture reset (always reads 0)
- };
- /* Allow access to the bit fields or entire register */
- union CAPCONB_REG {
- Uint16 all;
- struct CAPCONB_BITS bit;
- };
- /* Capture FIFO Status Register bit definitions */
- struct CAPFIFOA_BITS {
- Uint16 rsvd1:8; // 7:0 reserved
- Uint16 CAP1FIFO:2; // 9:8 CAP1 FIFO status
- Uint16 CAP2FIFO:2; // 11:10 CAP2 FIFO status
- Uint16 CAP3FIFO:2; // 13:12 CAP2 FIFO status
- Uint16 rsvd2:2; // 15:14 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CAPFIFOA_REG {
- Uint16 all;
- struct CAPFIFOA_BITS bit;
- };
- /* Capture FIFO Status Register bit definitions */
- struct CAPFIFOB_BITS {
- Uint16 rsvd1:8; // 7:0 reserved
- Uint16 CAP4FIFO:2; // 9:8 CAP4 FIFO status
- Uint16 CAP5FIFO:2; // 11:10 CAP5 FIFO status
- Uint16 CAP6FIFO:2; // 13:12 CAP6 FIFO status
- Uint16 rsvd2:2; // 15:14 reserved
- };
- /* Allow access to the bit fields or entire register */
- union CAPFIFOB_REG {
- Uint16 all;
- struct CAPFIFOB_BITS bit;
- };
- /* Interrupt Mask Register bit definitions */
- struct EVAIMRA_BITS {
- Uint16 PDPINTA:1; // 0 Enable PDPINTA
- Uint16 CMP1INT:1; // 1 Enable
- Uint16 CMP2INT:1; // 2 Enable
- Uint16 CMP3INT:1; // 3 Enable
- Uint16 rsvd1:3; // 6:4 reserved
- Uint16 T1PINT:1; // 7 Enable
- Uint16 T1CINT:1; // 8 Enable
- Uint16 T1UFINT:1; // 9 Enable
- Uint16 T1OFINT:1; // 10 Enable
- Uint16 rsvd2:5; // 15:11 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVAIMRA_REG {
- Uint16 all;
- struct EVAIMRA_BITS bit;
- };
- /* Interrupt Mask Register bit definitions */
- struct EVBIMRA_BITS {
- Uint16 PDPINTB:1; // 0 Enable PDPINTB
- Uint16 CMP4INT:1; // 1 Enable
- Uint16 CMP5INT:1; // 2 Enable
- Uint16 CMP6INT:1; // 3 Enable
- Uint16 rsvd1:3; // 6:4 reserved
- Uint16 T3PINT:1; // 7 Enable
- Uint16 T3CINT:1; // 8 Enable
- Uint16 T3UFINT:1; // 9 Enable
- Uint16 T3OFINT:1; // 10 Enable
- Uint16 rsvd2:5; // 15:11 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVBIMRA_REG {
- Uint16 all;
- struct EVBIMRA_BITS bit;
- };
- struct EVAIMRB_BITS {
- Uint16 T2PINT:1; // 0 Enable
- Uint16 T2CINT:1; // 1 Enable
- Uint16 T2UFINT:1; // 2 Enable
- Uint16 T2OFINT:1; // 3 Enable
- Uint16 rsvd1:12; // 15:4 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVAIMRB_REG {
- Uint16 all;
- struct EVAIMRB_BITS bit;
- };
- struct EVBIMRB_BITS {
- Uint16 T4PINT:1; // 0 Enable
- Uint16 T4CINT:1; // 1 Enable
- Uint16 T4UFINT:1; // 2 Enable
- Uint16 T4OFINT:1; // 3 Enable
- Uint16 rsvd1:12; // 15:4 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVBIMRB_REG {
- Uint16 all;
- struct EVBIMRB_BITS bit;
- };
- struct EVAIMRC_BITS {
- Uint16 CAP1INT:1; // 0 Enable
- Uint16 CAP2INT:1; // 1 Enable
- Uint16 CAP3INT:1; // 2 Enable
- Uint16 rsvd1:13; // 15:3 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVAIMRC_REG {
- Uint16 all;
- struct EVAIMRC_BITS bit;
- };
- struct EVBIMRC_BITS {
- Uint16 CAP4INT:1; // 0 Enable
- Uint16 CAP5INT:1; // 1 Enable
- Uint16 CAP6INT:1; // 2 Enable
- Uint16 rsvd1:13; // 15:3 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVBIMRC_REG {
- Uint16 all;
- struct EVBIMRC_BITS bit;
- };
- /* Interrupt Flag Register bit definitions */
- struct EVAIFRA_BITS {
- Uint16 PDPINTA:1; // 0 Flag PDPINTA
- Uint16 CMP1INT:1; // 1 Flag
- Uint16 CMP2INT:1; // 2 Flag
- Uint16 CMP3INT:1; // 3 Flag
- Uint16 rsvd1:3; // 6:4 reserved
- Uint16 T1PINT:1; // 7 Flag
- Uint16 T1CINT:1; // 8 Flag
- Uint16 T1UFINT:1; // 9 Flag
- Uint16 T1OFINT:1; // 10 Flag
- Uint16 rsvd2:5; // 15:11 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVAIFRA_REG {
- Uint16 all;
- struct EVAIMRA_BITS bit;
- };
- /* Interrupt Mask Register bit definitions */
- struct EVBIFRA_BITS {
- Uint16 PDPINTB:1; // 0 Flag PDPINTB
- Uint16 CMP4INT:1; // 1 Flag
- Uint16 CMP5INT:1; // 2 Flag
- Uint16 CMP6INT:1; // 3 Flag
- Uint16 rsvd1:3; // 6:4 reserved
- Uint16 T3PINT:1; // 7 Flag
- Uint16 T3CINT:1; // 8 Flag
- Uint16 T3UFINT:1; // 9 Flag
- Uint16 T3OFINT:1; // 10 Flag
- Uint16 rsvd2:5; // 15:11 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVBIFRA_REG {
- Uint16 all;
- struct EVBIFRA_BITS bit;
- };
- struct EVAIFRB_BITS {
- Uint16 T2PINT:1; // 0 Flag
- Uint16 T2CINT:1; // 1 Flag
- Uint16 T2UFINT:1; // 2 Flag
- Uint16 T2OFINT:1; // 3 Flag
- Uint16 rsvd1:12; // 15:4 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVAIFRB_REG {
- Uint16 all;
- struct EVAIFRB_BITS bit;
- };
- struct EVBIFRB_BITS {
- Uint16 T4PINT:1; // 0 Flag
- Uint16 T4CINT:1; // 1 Flag
- Uint16 T4UFINT:1; // 2 Flag
- Uint16 T4OFINT:1; // 3 Flag
- Uint16 rsvd1:12; // 15:4 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVBIFRB_REG {
- Uint16 all;
- struct EVBIFRB_BITS bit;
- };
- struct EVAIFRC_BITS {
- Uint16 CAP1INT:1; // 0 Flag
- Uint16 CAP2INT:1; // 1 Flag
- Uint16 CAP3INT:1; // 2 Flag
- Uint16 rsvd1:13; // 15:3 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVAIFRC_REG {
- Uint16 all;
- struct EVAIFRC_BITS bit;
- };
- struct EVBIFRC_BITS {
- Uint16 CAP4INT:1; // 0 Flag
- Uint16 CAP5INT:1; // 1 Flag
- Uint16 CAP6INT:1; // 2 Flag
- Uint16 rsvd1:13; // 15:3 reserved
- };
- /* Allow access to the bit fields or entire register */
- union EVBIFRC_REG {
- Uint16 all;
- struct EVBIFRC_BITS bit;
- };
- /* EVA Register File */
- struct EVA_REGS {
- union GPTCONA_REG GPTCONA; //0x7400
- Uint16 T1CNT; //0x7401
- Uint16 T1CMPR; //0x7402
- Uint16 T1PR; //0x7403
- union TCONA_REG T1CON; //0x7404
- Uint16 T2CNT; //0x7405
- Uint16 T2CMPR; //0x7406
- Uint16 T2PR; //0x7407
- union TCONA_REG T2CON; //0x7408
- union EXTCONA_REG EXTCON; //0x7409
- Uint16 rsvd1[7]; //0x740A-10
- union COMCONA_REG COMCONA; //0x7411
- Uint16 rsvd2; //0x7412
- union ACTRA_REG ACTRA; //0x7413
- Uint16 rsvd3; //0x7414
- union DBTCON_REG DBTCONA; //0x7415
- Uint16 rsvd4; //0x7416
- Uint16 CMPR1; //0x7417
- Uint16 CMPR2; //0x7418
- Uint16 CMPR3; //0x7419
- Uint16 rsvd5[6]; //0x741A-F
- union CAPCONA_REG CAPCON; //0x7420
- Uint16 rsvd6; //0x7421
- union CAPFIFOA_REG CAPFIFO; //0x7422
- Uint16 CAP1FIFO; //0x7423
- Uint16 CAP2FIFO; //0x7424
- Uint16 CAP3FIFO; //0x7425
- Uint16 rsvd7; //0x7426
- Uint16 CAP1FBOT; //0x7427
- Uint16 CAP2FBOT; //0x7428
- Uint16 CAP3FBOT; //0x7429
- Uint16 rsvd8[2]; //0x742A-B
- union EVAIMRA_REG EVAIMRA; //0x742C
- union EVAIMRB_REG EVAIMRB; //0x742D
- union EVAIMRC_REG EVAIMRC; //0x742E
- union EVAIFRA_REG EVAIFRA; //0x742F
- union EVAIFRB_REG EVAIFRB; //0x7430
- union EVAIFRC_REG EVAIFRC; //0x7431
- };
- /* EVB Register File */
- struct EVB_REGS {
- union GPTCONB_REG GPTCONB; //0x7500
- Uint16 T3CNT; //0x7501
- Uint16 T3CMPR; //0x7502
- Uint16 T3PR; //0x7503
- union TCONB_REG T3CON; //0x7504
- Uint16 T4CNT; //0x7505
- Uint16 T4CMPR; //0x7506
- Uint16 T4PR; //0x7507
- union TCONB_REG T4CON; //0x7508
- union EXTCONB_REG EXTCONB; //0x7509
- Uint16 rsvd1[7]; //0x750A-10
- union COMCONB_REG COMCONB; //0x7511
- Uint16 rsvd2; //0x7512
- union ACTRB_REG ACTRB; //0x7513
- Uint16 rsvd3; //0x7514
- union DBTCON_REG DBTCONB; //0x7515
- Uint16 rsvd4; //0x7516
- Uint16 CMPR4; //0x7517
- Uint16 CMPR5; //0x7518
- Uint16 CMPR6; //0x7519
- Uint16 rsvd5[6]; //0x751A-F
- union CAPCONB_REG CAPCONB; //0x7520
- Uint16 rsvd6; //0x7521
- union CAPFIFOB_REG CAPFIFOB; //0x7522
- Uint16 CAP4FIFO; //0x7523
- Uint16 CAP5FIFO; //0x7524
- Uint16 CAP6FIFO; //0x7525
- Uint16 rsvd7; //0x7526
- Uint16 CAP4FBOT; //0x7527
- Uint16 CAP5FBOT; //0x7528
- Uint16 CAP6FBOT; //0x7529
- Uint16 rsvd8[2]; //0x752A-B
- union EVBIMRA_REG EVBIMRA; //0x752C
- union EVBIMRB_REG EVBIMRB; //0x752D
- union EVBIMRC_REG EVBIMRC; //0x752E
- union EVBIFRA_REG EVBIFRA; //0x752F
- union EVBIFRB_REG EVBIFRB; //0x7530
- union EVBIFRC_REG EVBIFRC; //0x7531
- };
- //---------------------------------------------------------------------------
- // Function prototypes and external definitions:
- //
- extern volatile struct EVA_REGS EvaRegs;
- extern volatile struct EVB_REGS EvbRegs;
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_Adc.h
- //
- // TITLE: DSP28 Device ADC Register Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | Updated register names to match the datasheet
- //###########################################################################
- //---------------------------------------------------------------------------
- // ADC Individual Register Bit Definitions:
- struct ADCTRL1_BITS { // bits description
- Uint16 rsvd1:4; // 3:0 reserved
- Uint16 SEQ_CASC:1; // 4 Cascaded sequencer mode
- Uint16 rsvd2:1; // 5 reserved
- Uint16 CONT_RUN:1; // 6 Continuous run
- Uint16 CPS:1; // 7 ADC core clock prescaler
- Uint16 ACQ_PS:4; // 11:8 Acquisition window size
- Uint16 SUSMOD:2; // 13:12 Emulation suspend mode
- Uint16 RESET:1; // 14 ADC reset
- Uint16 rsvd3:1; // 15 reserved
- };
- union ADCTRL1_REG {
- Uint16 all;
- struct ADCTRL1_BITS bit;
- };
- struct ADCTRL2_BITS { // bits description
- Uint16 EVB_SOC_SEQ2:1; // 0 Event manager B SOC mask for SEQ2
- Uint16 rsvd1:1; // 1 reserved
- Uint16 INT_MOD_SEQ2:1; // 2 SEQ2 Interrupt mode
- Uint16 INT_ENA_SEQ2:1; // 3 SEQ2 Interrupt enable
- Uint16 rsvd2:1; // 4 reserved
- Uint16 SOC_SEQ2:1; // 5 Start of conversion for SEQ2
- Uint16 RST_SEQ2:1; // 6 Reset SEQ2
- Uint16 EXT_SOC_SEQ1:1; // 7 External start of conversion for SEQ1
- Uint16 EVA_SOC_SEQ1:1; // 8 Event manager A SOC mask for SEQ1
- Uint16 rsvd3:1; // 9 reserved
- Uint16 INT_MOD_SEQ1:1; // 10 SEQ1 Interrupt mode
- Uint16 INT_ENA_SEQ1:1; // 11 SEQ1 Interrupt enable
- Uint16 rsvd4:1; // 12 reserved
- Uint16 SOC_SEQ1:1; // 13 Start of conversion trigger for SEQ1
- Uint16 RST_SEQ1:1; // 14 Restart sequencer 1
- Uint16 EVB_SOC_SEQ:1; // 15 EVB SOC enable
- };
- union ADCTRL2_REG {
- Uint16 all;
- struct ADCTRL2_BITS bit;
- };
- struct ADCCASEQSR_BITS { // bits description
- Uint16 SEQ1_STATE:4; // 3:0 SEQ1 state
- Uint16 SEQ2_STATE:3; // 6:2 SEQ2 state
- Uint16 rsvd1:1; // 7 resverved
- Uint16 SEQ_CNTR:4; // 11:8 Sequencing counter status
- Uint16 rsvd2:4; // 15:12 reserved
- };
- union ADCCASEQSR_REG {
- Uint16 all;
- struct ADCCASEQSR_BITS bit;
- };
- struct ADCMAXCONV_BITS {
- Uint16 MAX_CONV:7; // 6:0 Max number of conversions
- Uint16 rsvd1:9; // 15:7 reserved
- };
- union ADCMAXCONV_REG {
- Uint16 all;
- struct ADCMAXCONV_BITS bit;
- };
- struct ADCCHSELSEQ1_BITS {
- Uint16 CONV00:4;
- Uint16 CONV01:4;
- Uint16 CONV02:4;
- Uint16 CONV03:4;
- };
- union ADCCHSELSEQ1_REG{
- Uint16 all;
- struct ADCCHSELSEQ1_BITS bit;
- };
- struct ADCCHSELSEQ2_BITS {
- Uint16 CONV04:4;
- Uint16 CONV05:4;
- Uint16 CONV06:4;
- Uint16 CONV07:4;
- };
- union ADCCHSELSEQ2_REG{
- Uint16 all;
- struct ADCCHSELSEQ2_BITS bit;
- };
- struct ADCCHSELSEQ3_BITS {
- Uint16 CONV08:4;
- Uint16 CONV09:4;
- Uint16 CONV10:4;
- Uint16 CONV11:4;
- };
- union ADCCHSELSEQ3_REG{
- Uint16 all;
- struct ADCCHSELSEQ3_BITS bit;
- };
- struct ADCCHSELSEQ4_BITS {
- Uint16 CONV12:4;
- Uint16 CONV13:4;
- Uint16 CONV14:4;
- Uint16 CONV15:4;
- };
- union ADCCHSELSEQ4_REG {
- Uint16 all;
- struct ADCCHSELSEQ4_BITS bit;
- };
- struct ADCTRL3_BITS {
- Uint16 SMODE_SEL:1; // 0 Sampling mode select
- Uint16 ADCCLKPS:4; // 4:1 ADC core clock divider
- Uint16 ADCPWDN:1; // 5 ADC powerdown
- Uint16 ADCBGRFDN:2; // 7:6 ADC bandgap/ref power down
- Uint16 rsvd1:8; // 15:8 reserved
- };
- union ADCTRL3_REG {
- Uint16 all;
- struct ADCTRL3_BITS bit;
- };
- struct ADCST_BITS {
- Uint16 INT_SEQ1:1; // 0 SEQ1 Interrupt flag
- Uint16 INT_SEQ2:1; // 1 SEQ2 Interrupt flag
- Uint16 SEQ1_BSY:1; // 2 SEQ1 busy status
- Uint16 SEQ2_BSY:1; // 3 SEQ2 busy status
- Uint16 INT_SEQ1_CLR:1; // 4 SEQ1 Interrupt clear
- Uint16 INT_SEQ2_CLR:1; // 5 SEQ2 Interrupt clear
- Uint16 EOS_BUF1:1; // 6 End of sequence buffer1
- Uint16 EOS_BUF2:1; // 7 End of sequence buffer2
- Uint16 rsvd1:8; // 15:8
- };
- union ADCST_REG {
- Uint16 all;
- struct ADCST_BITS bit;
- };
- struct ADC_REGS {
- union ADCTRL1_REG ADCTRL1; // ADC Control 1
- union ADCTRL2_REG ADCTRL2; // ADC Control 2
- union ADCMAXCONV_REG ADCMAXCONV; // Max conversions
- union ADCCHSELSEQ1_REG ADCCHSELSEQ1; // Channel select sequencing control
- union ADCCHSELSEQ2_REG ADCCHSELSEQ2;
- union ADCCHSELSEQ3_REG ADCCHSELSEQ3;
- union ADCCHSELSEQ4_REG ADCCHSELSEQ4;
- union ADCCASEQSR_REG ADCASEQSR; // Autosequence status register
- Uint16 ADCRESULT0; // Conversion Result Buffer 0 - 15
- Uint16 ADCRESULT1;
- Uint16 ADCRESULT2;
- Uint16 ADCRESULT3;
- Uint16 ADCRESULT4;
- Uint16 ADCRESULT5;
- Uint16 ADCRESULT6;
- Uint16 ADCRESULT7;
- Uint16 ADCRESULT8;
- Uint16 ADCRESULT9;
- Uint16 ADCRESULT10;
- Uint16 ADCRESULT11;
- Uint16 ADCRESULT12;
- Uint16 ADCRESULT13;
- Uint16 ADCRESULT14;
- Uint16 ADCRESULT15;
- union ADCTRL3_REG ADCTRL3; // ADC Contrl 3
- union ADCST_REG ADCST; // ADC Status Register
- };
- //---------------------------------------------------------------------------
- // ADC External References & Function Declarations:
- //
- extern volatile struct ADC_REGS AdcRegs;
- //===========================================================================
- // No more.
- //===========================================================================
- //
- // TMDX ALPHA RELEASE
- // Intended for product evaluation purposes
- //
- //###########################################################################
- //
- // FILE: DSP28_XIntrupt.h
- //
- // TITLE: DSP28 Device External Interrupt Register Definitions.
- //
- //###########################################################################
- //
- // Ver | dd mmm yyyy | Who | Description of changes
- // =====|=============|======|===============================================
- // 0.55| 06 May 2002 | L.H. | EzDSP Alpha Release
- // 0.56| 20 May 2002 | L.H. | No change
- // 0.57| 27 May 2002 | L.H. | No change
- // 0.58| 29 Jun 2002 | L.H. | No change
- //###########################################################################
- //---------------------------------------------------------------------------
- struct XINTCR_BITS {
- Uint16 ENABLE:1; // 0 enable/disable
- Uint16 rsvd1:1; // 1 reserved
- Uint16 POLARITY:1; // 2 pos/neg triggered
- Uint16 rsvd2:12; // 15:3 reserved
- };
- union XINTCR_REG {
- Uint16 all;
- struct XINTCR_BITS bit;
- };
- struct XNMICR_BITS {
- Uint16 ENABLE:1; // 0 enable/disable
- Uint16 SELECT:1; // 1 Timer 1 or XNMI connected to INT13
- Uint16 POLARITY:1; // 2 pos/neg triggered
- Uint16 rsvd2:12; // 15:3 reserved
- };
- union XNMICR_REG {
- Uint16 all;
- struct XNMICR_BITS bit;
- };
- //---------------------------------------------------------------------------
- // External Interrupt Register File:
- //
- struct XINTRUPT_REGS {
- union XINTCR_REG XINT1CR;
- union XINTCR_REG XINT2CR;
- Uint16 rsvd1[5];
- union XNMICR_REG XNMICR;
- Uint16 XINT1CTR;
- Uint16 XINT2CTR;
- Uint16 rsvd[5];
- Uint16 XNMICTR;
- };
- //---------------------------------------------------------------------------
- // External Interrupt References & Function Declarations:
- //
- extern volatile struct XINTRUPT_REGS XIntruptRegs;
- //===========================================================================
- // No more.
- //===========================================================================
- //---------------------------------------------------------------------------
- // Define Device Init Function Prototype:
- //
- }
- //===========================================================================
- // No more.
- //===========================================================================
- /*!
- \file co_ODvars.h
- \brief ОбъЯвлЯет некоторые служебные структуры длЯ драйвера CANOpen
- \author Aliamkin Dmitriy I
- \version v 1.19 04/05/2012
- @{
- */
- extern "C"
- {
- //#include "DSP.h"
- //#include "CANOpen_drv.h"
- //#include "V_eFIFO.h"
- //****************************************************************************************************************************************
- //! Начальный адрес длЯ сохранениЯ в SPI памЯти словарЯ 1-го CAN
- //! Начальный адрес длЯ сохранениЯ в SPI памЯти словарЯ 2-го CAN
- //!здесь указываетсЯ количество "замеппированных" объектов длЯ каждого PDO
- // !!!данные параметры должны быть выставлены в соответствии с количеством объектов
- //"замэппированных" в словаре объектов
- //!Конфигурирование полей SDO
- struct SDOcommSpecifier
- {
- Uint16 s :1; //!< 0 - если s=1, то размер передаваемых данных известен и указан
- Uint16 e :1; //!< 1 - expedited или нет
- Uint16 n :2; //!< 3:2 - количество байт данных не содержащих данных
- Uint16 X :1; //!< 4 - reserved
- Uint16 cs :3; //!< 7:5 - SDO команда
- Uint16 reserved :8; //
- };
- //! Нулевой байт мейл-бокса
- union MBOXByte0
- {
- struct SDOcommSpecifier SDO_Spicifier;
- Uint16 byte0;
- };
- //! Байты мейл-бокса, используемого длЯ альтернативной CAN свЯзи (ZigBee, USB)
- typedef struct
- {
- union MBOXByte0 MByte0;
- Uint16 byte1;
- Uint16 byte2;
- Uint16 byte3;
- Uint16 byte4;
- Uint16 byte5;
- Uint16 byte6;
- Uint16 byte7;
- Uint16 senderNodeID;
- } Z_MBytes;
- ///сообщение в виде полей SDO
- struct SDOmsg
- {
- Uint32 s :1; //!< 0 - если s=1, то размер передаваемых данных известен и указан
- Uint32 e :1; //!< 1 - expedited или нет
- Uint32 n :2; //!< 3:2 - количество байт данных не содержащих данных
- Uint32 X :1; //!< 4 - reserved
- Uint32 cs :3; //!< 7:5 - SDO команда
- Uint32 index :16;
- Uint32 subindex :8;
- Uint32 data :32;
- };
- //сообщение в виде байтов
- struct MBOX_bytes
- {
- Uint16 byte0 :8;
- Uint16 byte1 :8;
- Uint16 byte2 :8;
- Uint16 byte3 :8;
- Uint16 byte4 :8;
- Uint16 byte5 :8;
- Uint16 byte6 :8;
- Uint16 byte7 :8;
- };
- //сообщение в виде слов
- struct MBOX_words
- {
- Uint16 word0;
- Uint16 word1;
- Uint16 word2;
- Uint16 word3;
- };
- //сообщение в виде MDRL, MDRH
- struct MBOX_Uint32
- {
- Uint32 MDRL;
- Uint32 MDRH;
- };
- //все представлениЯ накладываем друг на друга
- union MBOX_data
- {
- struct MBOX_Uint32 u32;
- struct MBOX_words u16;
- struct MBOX_bytes u8;
- struct SDOmsg SDO;
- };
- typedef volatile union MBOX_data TMBOX_data;
- struct MID_bits
- {
- Uint32 rsvd1 :18; //пока не используем
- Uint32 senderNodeID :7; //номер узла
- Uint32 rsvd2 :7; //пока не используем
- };
- union MID_data
- {
- Uint32 all;
- struct MID_bits bit;
- };
- // мейл-бокс
- struct MData
- {
- union MBOX_data data;
- union MID_data MID;
- };
- //! Сборник данных всех мейл-боксов
- struct CO_MBOXDATA
- {
- struct MData MBOX_0;
- struct MData MBOX_1;
- struct MData MBOX_2;
- struct MData MBOX_3;
- struct MData MBOX_4;
- struct MData MBOX_5;
- struct MData MBOX_6;
- struct MData MBOX_7;
- struct MData MBOX_8;
- struct MData MBOX_9;
- struct MData MBOX_10;
- struct MData MBOX_11;
- struct MData MBOX_12;
- struct MData MBOX_13;
- struct MData MBOX_14;
- struct MData MBOX_15;
- struct MData MBOX_16;
- struct MData MBOX_17;
- struct MData MBOX_18;
- struct MData MBOX_19;
- struct MData MBOX_20;
- struct MData MBOX_21;
- struct MData MBOX_22;
- struct MData MBOX_23;
- struct MData MBOX_24;
- struct MData MBOX_25;
- struct MData MBOX_26;
- struct MData MBOX_27;
- struct MData MBOX_28;
- struct MData MBOX_29;
- struct MData MBOX_30;
- struct MData MBOX_31;
- };
- typedef volatile struct CO_MBOXDATA TCo_MboxData;
- //****************************************************************************************************************************************
- //структуры модулЯ блочной передачи
- //внутримодульные дефайны
- struct S_BT_FIFO
- {
- Uint16 busy_flag; //флаг занЯтости ФИФО, показывает количество инстанций, использующих ФИФО в данный момент
- Uint16 size;
- Uint16 number_of_msgs;
- Uint16 read_ptr;
- Uint16 write_ptr;
- TMBOX_data msg_array[8];
- Uint16 (*read)(volatile struct S_BT_FIFO*, TMBOX_data*);
- Uint16 (*write)(volatile struct S_BT_FIFO*, TMBOX_data*);
- Uint16 (*clear)(volatile struct S_BT_FIFO*);
- };
- typedef volatile struct S_BT_FIFO T_BT_FIFO;
- Uint16 BT_FIFO_Read(T_BT_FIFO*, TMBOX_data*);
- Uint16 BT_FIFO_Write(T_BT_FIFO*, TMBOX_data*);
- Uint16 BT_FIFO_Clear(T_BT_FIFO* p);
- struct SBlockTransfer
- {
- Uint16 state; //СостоЯние.
- Uint16 state_shadow; //Теневое состоЯние.
- Uint16 state_prev; //Предыдущее состоЯние (на один такт)
- Uint16 E; //Флаг первого вхождениЯ.
- Uint32 state_time; //времЯ нахождениЯ в текущем состоЯнии, в мс.
- Uint16 RX_block_size; //размер принимаемого блока (определЯетсЯ пользователем перед приемом)
- Uint16 TX_block_size; //размер отправлЯемого блока (определЯетсЯ пользователем перед отправкой)
- Uint16 firstTXmsg; //флаг, показывающий, что 1-е сообщение блока еще не отправлЯлось.
- Uint16* RX_dest_ptr;
- Uint16* TX_source_ptr;
- int RX_index;
- int TX_index;
- T_BT_FIFO RXmsgFIFO;
- T_BT_FIFO TXmsgFIFO;
- Uint16 blockCRC;
- Uint16 rx_status; //обратнаЯ свЯзь длЯ внешней программы использующей блочную передачу
- Uint16 tx_status; //
- Uint32 timeout;
- };
- typedef volatile struct SBlockTransfer TBlockTransfer;
- //! Стандартные переменные словарЯ CANOpen
- //! Все перечисленные переменные должны быть добавлены в словаре CANOpen.
- //!Так как CAN'а у контроллера два, то длЯ каждого словарЯ должны быть свои объекты,
- //!чтобы иметь возможность настроить CANOpen по-разному. Поэтому делаетсЯ два экземплЯра этой структуры,
- //!если это требуетсЯ.
- struct SCo_OdVars
- {
- Uint32 co_deviceType; //1000.0
- Uint16 co_errorRegister; //1001.0 Регистр ошибки
- Uint32 co_deviceState; //1002.0
- Uint32 co_emcyCOBID; //1014.0
- Uint32 co_CHBT; //1016.1 Consumer heartbeat time
- Uint32 co_PHBT; //1017.0 Producer heartbeat time
- Uint32 co_vendorID; //1018.1
- Uint32 co_productCode; //1018.2
- Uint32 co_revisionNumber; //1018.3
- Uint32 co_serialNumber; //1018.4
- Uint32 co_csrxCOBID; //1200.1
- Uint32 co_sctxCOBID; //1200.2
- Uint32 co_cstxCOBID; //1280.1
- Uint32 co_scrxCOBID; //1280.2
- Uint16 co_ssNODEID; //1280.3
- Uint32 co_RPDO1COBID; //1400.1
- Uint16 co_transType; //1400.2 , 1401.2 , 1402.2 , 1403.2
- Uint32 co_RPDO2COBID; //1401.1
- Uint32 co_RPDO3COBID; //1402.1
- Uint32 co_RPDO4COBID; //1403.1
- //2007_03_14
- Uint32 co_RPDO5COBID; //1404.1 rwp
- Uint32 co_RPDO6COBID; //1405.1 rwp
- Uint32 co_RPDO7COBID; //1406.1 rwp
- Uint32 co_RPDO8COBID; //1407.1 rwp
- //
- Uint32 co_RPDO1_1Mapping; //1600.1
- Uint32 co_RPDO1_2Mapping; //1600.2
- Uint32 co_RPDO1_3Mapping; //1600.3
- Uint32 co_RPDO1_4Mapping; //1600.4
- Uint32 co_RPDO2_1Mapping; //1601.1
- Uint32 co_RPDO2_2Mapping; //1601.2
- Uint32 co_RPDO2_3Mapping; //1601.3
- Uint32 co_RPDO2_4Mapping; //1601.4
- Uint32 co_RPDO3_1Mapping; //1602.1
- Uint32 co_RPDO3_2Mapping; //1602.2
- Uint32 co_RPDO3_3Mapping; //1602.3
- Uint32 co_RPDO3_4Mapping; //1602.4
- Uint32 co_RPDO4_1Mapping; //1603.1
- Uint32 co_RPDO4_2Mapping; //1603.2
- Uint32 co_RPDO4_3Mapping; //1603.3
- Uint32 co_RPDO4_4Mapping; //1603.4
- //2007_03_14
- Uint32 co_RPDO5_1Mapping; //1604.1 rwp
- Uint32 co_RPDO5_2Mapping; //1604.2 rwp
- Uint32 co_RPDO5_3Mapping; //1604.3 rwp
- Uint32 co_RPDO5_4Mapping; //1604.4 rwp
- Uint32 co_RPDO6_1Mapping; //1605.1 rwp
- Uint32 co_RPDO6_2Mapping; //1605.2 rwp
- Uint32 co_RPDO6_3Mapping; //1605.3 rwp
- Uint32 co_RPDO6_4Mapping; //1605.4 rwp
- Uint32 co_RPDO7_1Mapping; //1606.1 rwp
- Uint32 co_RPDO7_2Mapping; //1606.2 rwp
- Uint32 co_RPDO7_3Mapping; //1606.3 rwp
- Uint32 co_RPDO7_4Mapping; //1606.4 rwp
- Uint32 co_RPDO8_1Mapping; //1607.1 rwp
- Uint32 co_RPDO8_2Mapping; //1607.2 rwp
- Uint32 co_RPDO8_3Mapping; //1607.3 rwp
- Uint32 co_RPDO8_4Mapping; //1607.4 rwp
- //
- Uint32 co_TPDO1COBID; //1800.1
- Uint16 co_TPDO1ITime; //1800.3 rw
- Uint16 co_compatEntry; //1800.4 rw
- Uint16 co_TPDO1EventTimer; //1800.5 rw
- Uint32 co_TPDO2COBID; //1801.1
- Uint16 co_TPDO2ITime; //1801.3 rw
- Uint16 co_TPDO2EventTimer; //1800.5 rw
- Uint32 co_TPDO3COBID; //1802.1
- Uint16 co_TPDO3ITime; //1802.3 rw
- Uint16 co_TPDO3EventTimer; //1800.5 rw
- Uint32 co_TPDO4COBID; //1803.1
- Uint16 co_TPDO4ITime; //1803.3 rw
- Uint16 co_TPDO4EventTimer; //1800.5 rw
- //2007_03_14
- Uint32 co_TPDO5COBID; //1804.1 r
- Uint16 co_TPDO5ITime; //1804.3 rw
- Uint16 co_TPDO5EventTimer; //1804.5 rw
- Uint32 co_TPDO6COBID; //1805.1 r
- Uint16 co_TPDO6ITime; //1805.3 rw
- Uint16 co_TPDO6EventTimer; //1805.5 rw
- Uint32 co_TPDO7COBID; //1806.1 r
- Uint16 co_TPDO7ITime; //1806.3 rw
- Uint16 co_TPDO7EventTimer; //1806.5 rw
- Uint32 co_TPDO8COBID; //1807.1 r
- Uint16 co_TPDO8ITime; //1807.3 rw
- Uint16 co_TPDO8EventTimer; //1807.5 rw
- //
- Uint32 co_TPDO1_1Mapping; //1A00.1
- Uint32 co_TPDO1_2Mapping; //1A00.2
- Uint32 co_TPDO1_3Mapping; //1A00.3
- Uint32 co_TPDO1_4Mapping; //1A00.4
- Uint32 co_TPDO2_1Mapping; //1A01.1
- Uint32 co_TPDO2_2Mapping; //1A01.2
- Uint32 co_TPDO2_3Mapping; //1A01.3
- Uint32 co_TPDO2_4Mapping; //1A01.4
- Uint32 co_TPDO3_1Mapping; //1A02.1
- Uint32 co_TPDO3_2Mapping; //1A02.2
- Uint32 co_TPDO3_3Mapping; //1A02.3
- Uint32 co_TPDO3_4Mapping; //1A02.4
- Uint32 co_TPDO4_1Mapping; //1A03.1
- Uint32 co_TPDO4_2Mapping; //1A03.2
- Uint32 co_TPDO4_3Mapping; //1A03.3
- Uint32 co_TPDO4_4Mapping; //1A03.4
- //2007_03_14
- Uint32 co_TPDO5_1Mapping; //1A04.1 rwp
- Uint32 co_TPDO5_2Mapping; //1A04.2 rwp
- Uint32 co_TPDO5_3Mapping; //1A04.3 rwp
- Uint32 co_TPDO5_4Mapping; //1A04.4 rwp
- Uint32 co_TPDO6_1Mapping; //1A05.1 rwp
- Uint32 co_TPDO6_2Mapping; //1A05.2 rwp
- Uint32 co_TPDO6_3Mapping; //1A05.3 rwp
- Uint32 co_TPDO6_4Mapping; //1A05.4 rwp
- Uint32 co_TPDO7_1Mapping; //1A06.1 rwp
- Uint32 co_TPDO7_2Mapping; //1A06.2 rwp
- Uint32 co_TPDO7_3Mapping; //1A06.3 rwp
- Uint32 co_TPDO7_4Mapping; //1A06.4 rwp
- Uint32 co_TPDO8_1Mapping; //1A07.1 rwp
- Uint32 co_TPDO8_2Mapping; //1A07.2 rwp
- Uint32 co_TPDO8_3Mapping; //1A07.3 rwp
- Uint32 co_TPDO8_4Mapping; //1A07.4 rwp
- //
- Uint16 co_nodeID; //2000.0 номер данного узла
- Uint16 co_bitRate; //2001.0
- Uint16 co_specialData1; //2003.1
- Uint16 co_specialData2; //2003.2
- Uint16 co_specialData3; //2003.3
- Uint16 co_specialData4; //2003.4
- Uint32 co_secretCode; //2004.0
- Uint16 co_protectBit; //2005.0 - ?
- Uint32 co_devicePresentFlag0;
- Uint32 co_devicePresentFlag1;
- Uint32 co_devicePresentFlag2;
- Uint32 co_devicePresentFlag3;
- Uint32 co_deviceGlobalPresent0;
- Uint32 co_deviceGlobalPresent1;
- Uint32 co_deviceGlobalPresent2;
- Uint32 co_deviceGlobalPresent3;
- Uint32 co_heartbeatFlag0; //2010.1 Флаги heartbeat с 0 по 31-е устройство
- Uint32 co_heartbeatFlag1; //2010.2 Флаги heartbeat с 32 по 63-е устройство
- Uint32 co_heartbeatFlag2; //2010.3 Флаги heartbeat с 64 по 95-е устройство
- Uint32 co_heartbeatFlag3; //2010.4 Флаги heartbeat с 96 по 127-е устройство
- Uint32 co_heartbeatMask0; //2011.1 Маски heartbeat с 0 по 31-е устройство (0110b)
- Uint32 co_heartbeatMask1; //2011.2 Маски heartbeat с 32 по 63-е устройство
- Uint32 co_heartbeatMask2; //2011.3 Маски heartbeat с 64 по 95-е устройство
- Uint32 co_heartbeatMask3; //2011.4 Маски heartbeat с 96 по 127-е устройство
- Uint16 co_heartbeatAutoStart; //2012.0 Параметр, определЯющий возможен ли автозапуск сети
- Uint16 co_heartbeatAutoRecovery; //2014.0 Параметр, определЯющий возможен ли перезапуск системы из состоЯниЯ STOPPED
- Uint16 co_nodeState; //2015.0 состоЯние данного узла - вначале BOOTUP
- Uint16 co_emergencyErrorCode; //2016.0 Код аварии
- Uint32 co_deviceErrorState; //2017.0 Статусный регистр ошибок производителЯ
- Uint16 co_ODCommand; //2080.1
- Uint16 co_currentODIndex; //2080.2
- Uint16 co_currentODSubIndex; //2080.3
- Uint16 co_currentODEText; //2080.4
- Uint16 co_currentODEFormat; //2080.5
- Uint16 co_currentODEMin; //2080.6
- Uint16 co_currentODEMax; //2080.7
- Uint16 co_currentODEDefault; //2080.8
- Uint16 co_currentODEMinLow; //2080.9
- Uint16 co_currentODEMaxLow; //2080.10
- Uint16 co_currentODEDefaultLow; //2080.11
- Uint16 co_currentODEAddrHigh; //2080.12
- Uint16 co_currentODEAddrLow;
- Uint16 co_currentODEType;
- Uint16 co_odIndexSize;
- Uint32 co_defaultIndex1; //2082.1 rw
- Uint32 co_defaultIndex2; //2082.2 rw
- Uint16 co_maskElement01; //2083.1,2 rw
- Uint16 co_maskElement23; //2083.3,4 rw
- Uint16 co_maskElement45; //2083.5,6 rw
- Uint16 co_maskElement67; //2083.7,8 rw
- Uint16 co_maskElement89; //2083.9,A rw
- Uint16 co_maskElementAB; //2083.B,C rw
- Uint16 co_maskElementCD; //2083.D,E rw
- Uint16 co_maskElementEF; //2083.F,10 rw
- Uint16 co_profileAccessMask; //2081.0 rw
- Uint16 co_scaleNum0; //2100.1
- Uint16 co_scaleNum0Format; //2100.2
- Uint16 co_scaleNum1; //2101.1
- Uint16 co_scaleNum1Format; //2101.2
- Uint16 co_scaleNum2; //2102.1
- Uint16 co_scaleNum2Format; //2102.2
- Uint16 co_scaleNum3; //2103.1
- Uint16 co_scaleNum3Format; //2103.2
- Uint16 co_scaleNum4; //2104.1
- Uint16 co_scaleNum4Format; //2104.2
- Uint16 co_scaleNum5; //2105.1
- Uint16 co_scaleNum5Format; //2105.2
- Uint16 co_scaleNum6; //2106.1
- Uint16 co_scaleNum6Format; //2106.2
- Uint16 co_scaleNum7; //2107.1
- Uint16 co_scaleNum7Format; //2107.2
- Uint16 co_scaleNum8; //2108.1
- Uint16 co_scaleNum8Format; //2108.2
- Uint16 co_scaleNum9; //2109.1
- Uint16 co_scaleNum9Format; //2109.2
- Uint16 co_scaleNumA; //210A.1
- Uint16 co_scaleNumAFormat; //210A.2
- Uint16 co_scaleNumB; //210B.1
- Uint16 co_scaleNumBFormat; //210B.2
- Uint16 co_scaleNumC; //210C.1
- Uint16 co_scaleNumCFormat; //210C.2
- Uint16 co_scaleNumD; //210D.1
- Uint16 co_scaleNumDFormat; //210D.2
- Uint16 co_scaleNumE; //210E.1
- Uint16 co_scaleNumEFormat; //210E.2
- Uint16 co_scaleNumF; //210F.1
- Uint16 co_scaleNumFFormat; //210F.2
- Uint16 co_scaleNum10; //2110.1
- Uint16 co_scaleNum10Format; //2110.2
- Uint16 co_scaleNum11; //2111.1
- Uint16 co_scaleNum11Format; //2111.2
- Uint16 co_scaleNum12; //2112.1
- Uint16 co_scaleNum12Format; //2112.2
- Uint16 co_scaleNum13; //2113.1
- Uint16 co_scaleNum13Format; //2113.2
- Uint16 co_scaleNum14; //2114.1
- Uint16 co_scaleNum14Format; //2114.2
- Uint16 co_scaleNum15; //2115.1
- Uint16 co_scaleNum15Format; //2115.2
- Uint16 co_scaleNum16; //2116.1
- Uint16 co_scaleNum16Format; //2116.2
- Uint16 co_scaleNum17; //2117.1
- Uint16 co_scaleNum17Format; //2117.2
- Uint16 co_scaleNum18; //2118.1
- Uint16 co_scaleNum18Format; //2118.2
- Uint16 co_scaleNum19; //2119.1
- Uint16 co_scaleNum19Format; //2119.2
- Uint16 co_scaleNum1A; //211A.1
- Uint16 co_scaleNum1AFormat; //211A.2
- Uint16 co_scaleNum1B; //211B.1
- Uint16 co_scaleNum1BFormat; //211B.2
- Uint16 co_scaleNum1C; //211C.1
- Uint16 co_scaleNum1CFormat; //211C.2
- Uint16 co_scaleNum1D; //211D.1
- Uint16 co_scaleNum1DFormat; //211D.2
- Uint16 co_scaleNum1E; //211E.1
- Uint16 co_scaleNum1EFormat; //211E.2
- Uint16 co_scaleNum1F; //211F.1
- Uint16 co_scaleNum1FFormat; //211F.2
- Uint16 co_blockTransferCommand; //2700
- //Указатели
- Uint16 *co_currentWordODTbl1; //данные указатели ипользуютсЯ длЯ работы интерпретатора
- Uint16 *co_currentWordODTbl2; //команд в прерывании ШИМ (длЯ обработки быстрых команд)
- Uint16 co_currentAccessMask; //маска доступа индекса на который указывает co_currentWordODTbl1
- Uint16 *co_shadow_currentWordODTbl1; //данные указатели ипользуютсЯ длЯ работы интерпретатора
- Uint16 *co_shadow_currentWordODTbl2; //команд в фоновой программе (длЯ обработки медленных команд)
- Uint16 *co_SDOcurrentWordODTbl1;
- Uint16 *co_SDOcurrentWordODTbl2;
- //ZBee
- Uint16 *Z_co_SDOcurrentWordODTbl1;
- Uint16 *Z_co_SDOcurrentWordODTbl2;
- Uint16 *co_PDOcurrentWordODTbl1;
- Uint16 *co_PDOcurrentWordODTbl2;
- Uint16 *co_PDOMAPcurrentWordODTbl1;
- Uint16 *co_PDOMAPcurrentWordODTbl2;
- Uint16 *co_endODTbl1; //указывает на последний элемент индекс в таблице ODTbl1
- TCo_MboxData co_MboxesData;
- Uint32 co_MailboxMDRL;
- Uint32 co_MailboxMDRH;
- Uint32 co_MailboxMID;
- Uint32 co_flagBackUp0; //
- Uint32 co_flagBackUp1; // предыдущие состоЯниЯ флагов
- Uint32 co_flagBackUp2; //
- Uint32 co_flagBackUp3; //
- Uint32 co_backupEEC; // Предыдущее состоЯние кода аварии
- Uint32 co_backupER; // Предыдущее состоЯние регистра ошибки
- Uint32 co_backupDES; // Предыдущее состоЯние статусного регистра ошибок производителЯ
- Uint32 co_consHBTimeCounter; // изначально должен быть равен co_CHBT
- Uint32 co_prodHBTimeCounter; // изначально должен быть равен co_PHBT
- Uint32 co_emcyNewState; // СостоЯние в которое перешел узел после ошибки
- Uint32 co_msDevisor; // делитель частоты длЯ получениЯ 1мс - используетсЯ длЯ отправки Heartbeat
- Uint16 co_shadow_currentODIndex;
- Uint16 co_shadow_currentODSubIndex;
- Uint16 co_shadow_currentODEText;
- Uint16 co_shadow_currentODEFormat;
- Uint16 co_shadow_currentODEMin;
- Uint16 co_shadow_currentODEMax;
- Uint16 co_shadow_currentODEDefault;
- Uint16 co_shadow_currentODEMinLow;
- Uint16 co_shadow_currentODEMaxLow;
- Uint16 co_shadow_currentODEDefaultLow;
- Uint16 co_shadow_currentODEAddrLow;
- Uint16 co_shadow_currentODEAddrHigh;
- Uint16 co_shadow_currentODEType;
- //переменные необходимые длЯ работы SDO служб
- Uint16 co_SDOrequestIndex;
- Uint16 co_SDOrequestSubIndex;
- Uint16 co_SDOrequestData;
- Uint16 co_SDOrequestDataH;
- Uint16 co_SDOrequestStatus;
- Uint16 co_SDOrequestFlag;
- Uint16 requestR;
- Uint16 requestW;
- Uint16 co_SDOSuspendedSend;
- //временнаЯ переменнаЯ защиты секретных параметров от несанкционированного доступа
- Uint16 co_secretProtectBit;
- //переменные необходимые длЯ работы PDO служб
- Uint16 co_PDOMappingFlags; //RRRR RRRR TTTT TTTT - "T" - TPDO;- "R" - RPDO
- Uint16 co_PDO1Devisor; // делитель длЯ получениЯ заданной скорости передачи PDO1
- Uint16 co_PDO2Devisor;
- Uint16 co_PDO3Devisor;
- Uint16 co_PDO4Devisor;
- Uint16 co_PDO5Devisor;
- Uint16 co_PDO6Devisor;
- Uint16 co_PDO7Devisor;
- Uint16 co_PDO8Devisor;
- //
- Uint16 co_NumOfNextPDO;
- Uint16 co_PDOTransmitFlags; //0000 0000 TTTT TTTT
- Uint16 co_PDOTransmitEna; //0000 0000 TTTT TTTT
- Uint16 co_PDOReceiveEna; //0000 0000 RRRR RRRR
- Uint16 co_my_PDO1TransmitFlags;
- Uint16 co_my_PDO2TransmitFlags;
- Uint16 co_my_PDO3TransmitFlags;
- Uint16 co_my_PDO4TransmitFlags;
- Uint16 co_my_PDO5TransmitFlags;
- Uint16 co_my_PDO6TransmitFlags;
- Uint16 co_my_PDO7TransmitFlags;
- Uint16 co_my_PDO8TransmitFlags;
- Uint32 co_RPDO1_addr[4];
- Uint32 co_RPDO2_addr[4];
- Uint32 co_RPDO3_addr[4];
- Uint32 co_RPDO4_addr[4];
- //2007_03_14
- Uint32 co_RPDO5_addr[4];
- Uint32 co_RPDO6_addr[4];
- Uint32 co_RPDO7_addr[4];
- Uint32 co_RPDO8_addr[4];
- //
- Uint16 co_RPDO1_startBit[4];
- Uint16 co_RPDO2_startBit[4];
- Uint16 co_RPDO3_startBit[4];
- Uint16 co_RPDO4_startBit[4];
- //2007_03_14
- Uint16 co_RPDO5_startBit[4];
- Uint16 co_RPDO6_startBit[4];
- Uint16 co_RPDO7_startBit[4];
- Uint16 co_RPDO8_startBit[4];
- //
- Uint16 co_RPDO1_numOfBits[4];
- Uint16 co_RPDO2_numOfBits[4];
- Uint16 co_RPDO3_numOfBits[4];
- Uint16 co_RPDO4_numOfBits[4];
- //2007_03_14
- Uint16 co_RPDO5_numOfBits[4];
- Uint16 co_RPDO6_numOfBits[4];
- Uint16 co_RPDO7_numOfBits[4];
- Uint16 co_RPDO8_numOfBits[4];
- //
- Uint32 co_TPDO1_addr[4];
- Uint32 co_TPDO2_addr[4];
- Uint32 co_TPDO3_addr[4];
- Uint32 co_TPDO4_addr[4];
- //2007_03_14
- Uint32 co_TPDO5_addr[4];
- Uint32 co_TPDO6_addr[4];
- Uint32 co_TPDO7_addr[4];
- Uint32 co_TPDO8_addr[4];
- //
- Uint16 co_TPDO1_startBit[4];
- Uint16 co_TPDO2_startBit[4];
- Uint16 co_TPDO3_startBit[4];
- Uint16 co_TPDO4_startBit[4];
- //2007_03_14
- Uint16 co_TPDO5_startBit[4];
- Uint16 co_TPDO6_startBit[4];
- Uint16 co_TPDO7_startBit[4];
- Uint16 co_TPDO8_startBit[4];
- //
- Uint16 co_TPDO1_numOfBits[4];
- Uint16 co_TPDO2_numOfBits[4];
- Uint16 co_TPDO3_numOfBits[4];
- Uint16 co_TPDO4_numOfBits[4];
- //2007_03_14
- Uint16 co_TPDO5_numOfBits[4];
- Uint16 co_TPDO6_numOfBits[4];
- Uint16 co_TPDO7_numOfBits[4];
- Uint16 co_TPDO8_numOfBits[4];
- //
- Uint16 load_params_from_SPI;
- Uint16 ParamRestorationError;
- Uint16 co_requestCANInit;
- Uint32 ISRDroppingCounter;
- //данные из coodedit-а
- //Uint16 co_numOfInd;
- int16* OD_TBL1;
- Uint16* OD_TBL2;
- int32* OD_TBL3;
- Uint16* TYPE_DEF_TABLE;
- int32* OD_CALLBACK_TBL;
- Uint16 co_SPIrange1rw;
- Uint16 co_SPIrange1rwCRC;
- Uint16 co_SPIrange1rwp;
- Uint16 co_SPIrange1rwpCRC;
- Uint16 co_SPIrange1rwps;
- Uint16 co_SPIrange1rwpsCRC;
- Uint16 co_SPIrange2rw;
- Uint16 co_SPIrange2rwCRC;
- Uint16 co_SPIrange2rwp;
- Uint16 co_SPIrange2rwpCRC;
- Uint16 co_SPIrange2rwps;
- Uint16 co_SPIrange2rwpsCRC;
- Uint16 co_SPIrange3rw;
- Uint16 co_SPIrange3rwCRC;
- Uint16 co_SPIrange3rwp;
- Uint16 co_SPIrange3rwpCRC;
- Uint16 co_SPIrange3rwps;
- Uint16 co_SPIrange3rwpsCRC;
- Uint16 co_SPIrange4rw;
- Uint16 co_SPIrange4rwCRC;
- Uint16 co_SPIrange4rwp;
- Uint16 co_SPIrange4rwpCRC;
- Uint16 co_SPIrange4rwps;
- Uint16 co_SPIrange4rwpsCRC;
- Uint16 co_SPIrange5rw;
- Uint16 co_SPIrange5rwCRC;
- Uint16 co_SPIrange5rwp;
- Uint16 co_SPIrange5rwpCRC;
- Uint16 co_SPIrange5rwps;
- Uint16 co_SPIrange5rwpsCRC;
- Uint16 co_first1000;
- Uint16 co_first2000;
- Uint16 co_first3000;
- Uint16 co_first4000;
- Uint16 co_first5000;
- //указатели длЯ работы с регистрами и функциЯми, привЯзанными к аппаратной части
- volatile struct ECAN_REGS* ECanRegs;
- volatile struct ECAN_MBOXES* ECanMboxes;
- volatile struct LAM_REGS* ECanLAMRegs;
- void (*GpioInit)();
- void (*CANINTDisable)();
- void (*CANINTEnable)();
- // #ifdef CAN_BLOCK_TRANSFER_ENABLE
- TBlockTransfer* BT; //указатель делаем чтоб легко инициализировать структуру TBlockTransfer
- // #endif
- };
- typedef volatile struct SCo_OdVars TCo_OdVars;
- extern TCo_OdVars co1_vars;
- extern TCo_OdVars co2_vars;
- extern TBlockTransfer CANaBlockTransfer;
- extern TBlockTransfer CANbBlockTransfer;
- //***************************************************************************************************************************************************
- }
- /*@}*/
- /*!
- \file v_data_log.h
- \brief 4-х канальный логгер длЯ осциллографированиЯ в реальном времени (см. TDataLog)
- \author Коллектив ООО НПФ Вектор
- \version v 1.0 21/02/2010
- \defgroup v_data_log Цифровой осциллограф (см. TDataLog)
- @{
- */
- extern "C"
- {
- //! change "int" to "long" or "float" according to variable type
- typedef int16 type_data;
- //! Размер массивов длЯ осциллографированиЯ.
- //!Если нужно менЯть, то это делать надо не только тут - слишком много завЯзано на это число
- //!Переделать сложно, так как на это число завЯзка косвеннаЯ: например, длЯ ускорениЯ работы
- //!применЯютсЯ такие конструкции: p->Wcounter&=0xFF; Где FF - маска (символизирует 256 точек)
- /*! \class TDataLog
- \brief 4-х канальный логгер длЯ осциллографированиЯ в реальном времени
- Класс \a TDataLog, основанный на структуре SDataLog, позволЯет записывать выбранные 4 переменных в массивы
- из 255 точек с заданной дискретизацией по времени. Кроме того, имеет
- свЯзь с драйвером CANOpen длЯ автоматизации указаниЯ этих переменных: можно
- "зарЯдить" в даталоггер любой существующий элемент словарЯ.*/
- //! см. TDataLog
- struct SDataLog
- {
- type_data buff[(256*4)]; //4 массива для отснятых осциллограмм, слепленные в один большой
- type_data *dlog_iptr1; //!< указатели на переменные для записи (например. ток фазы A, скорость и т.д.)
- type_data *dlog_iptr2; //!< Input: Second input pointer (Q15)
- type_data *dlog_iptr3;
- type_data *dlog_iptr4;
- int dlog_cntr_max; //!< Parameter: Maximum number of samples
- Uint16 Wcounter; //!< Счетчик по массиву длЯ записи
- Uint16 Rcounter; //!< Счетчик по массиву длЯ чтениЯ
- type_data* dl_buffer1_adr; //!< Указатели на массивы, где лежат отснятые осциллограммы
- type_data* dl_buffer2_adr; //!< Parameter: Buffer starting address 2
- type_data* dl_buffer3_adr;
- type_data* dl_buffer4_adr;
- type_data upload_buff[256]; //массив для отправки осциллограммы в юникон. Сюда копируется осциллограмма из одного из четырех массивов buff со смещением, чтобы начало осциллограммы было в начале массива.
- type_data* dl_upload_buffer_adr; //указатель на массив для отправки.
- Uint32 trig_shift; //сдвиг первой точки после срабатывания триггера. Используется, чтобы задать, сколько точек предыстории сохранять.
- Uint16 trig_shift_int; //то же, переведенное в точки
- Uint16 first_point_written; //первая точка, относящаяся к записываемой осциллограмме с учетом длины предыстории и точки срабатывания триггера
- Uint16 prehistory_length; //длина записанной предыстории (если даталоггер переинициализировался кнопкой "обновить", она обнуляется)
- Uint16 valid_points_num; //счетчик валидных точек предыстории, записанных после переинициализации кнопкой "обновить" в юниконе
- /*! Режимов работы четыре:\n
- 0 - стоп\n
- 1 - однократнаЯ запись\n
- 2 - запись по кругу без остановки\n
- 3 - однократнаЯ запись одной переменной во все 4 массива последовательно, длЯ получениЯ длинной осциллограммы.\n
- Устанавливать переменную надо только вызовом функции set_mode! */
- Uint16 mode_reset; //!< задаетсЯ режим работы
- Uint16 mode_reset_prev; //!< предыдущий режим работы
- int E; // флаг энтри
- /*! "control" имеет 32 разрЯда. Первые 8 бит первого слова отведем под флаги, второе слово под установку разреживаниЯ.\n
- 7 6 5 4 3 2 1 0\n
- | x | x | x | x | x | x | x | x |\n
- | | | | первые 4 бита - какие из 4х переменых интересуют (какие сдреса обновлЯть, какие данные записывать)\n
- | | 2 бита - желаемый режим даталоггера. Ноль, один, два.\n
- | бит "данные готовы" - устанавливаетсЯ контроллером\n
- резерв */
- long control; //!< управление даталоггером через внешние программы
- unsigned int WriteDelimiter; //!<делитель данных при записи
- unsigned int WriteDelimiterCounter; //!<Счетчик длЯ делителЯ
- long ind_subind1; //!<записываетсЯ индекс и подындекс длЯ словарЯ
- long ind_subind2;
- long ind_subind3;
- long ind_subind4;
- unsigned long next_value_var; //!<через эту переменную выдвигаютсЯ записанные значениЯ при считывании
- Uint16 StartBits;
- int buff_num; //!<номер массива, из которого идет выдвижение значений в next_value_var
- Uint16 OneShotOperation; //!<флаг синхронизации осциллографа только по первому событию (переход в 1 возможен только из 2)
- void (*update)(volatile struct SDataLog *); //!<Pointer to update function
- void (*set_mode)(Uint16 mode_reset,volatile struct SDataLog *); //!<Pointer to set_mode function
- void (*background_analizer)(volatile struct SDataLog *); //!<Pointer to background_analizer function
- } ;
- typedef volatile struct SDataLog TDataLog;
- //! Инициализатор по-умолчанию длЯ данного класса
- //! \memberof TDataLog
- void data_log_update(TDataLog *);
- //! \memberof TDataLog
- void dlog_set_mode(Uint16 mode_reset,TDataLog *);
- //! \memberof TDataLog
- void dlog_background_analizer(TDataLog *);
- }
- /*@}*/
- extern Uint16 * co_getAddr(TCo_OdVars* ppc, Uint32 ind_subind);
- //! Фоновый обработчик.
- /*! работает в фоне. Нужно длЯ установки адресов переменных через CAN.
- если нет CAN, можно записать нужные адреса вручную в TDataLog.dlog_iptr */
- //! \memberof TDataLog
- void dlog_background_analizer(TDataLog *p) {
- //перевод длины предыстории из % в точки
- p->trig_shift_int = (p->trig_shift&0xFFFFFF)>>16; //делаем количество точек
- if (p->trig_shift_int > 255) //ограничим
- p->trig_shift_int = 255;
- TCo_OdVars *pco_vars = &co1_vars; //с каким словарем работать. От какого CAN
- unsigned char mode;
- //если не стоит хоть один из первых шести бит control,
- //то ничего анализировать и делать не надо
- if (!(p->control & 0x3F))
- return;
- //В любом случае перед всеми изменениЯми
- //тормозим даталоггер. Иначе он может начать записывать данные по прерыванию,
- //пока тут, в фоне, идет, скажем, запись адресов.
- //И тогда в лучшем случае будет каша из данных, в худшем - останов контроллера
- //при обращении по неправильному адресу.
- p->mode_reset = 0;
- p->valid_points_num = 0; //т.к. даталоггер останавливался (mode = 0), то предыстория неактуальна, т.к.
- //1) за время стопа даталоггера между записанной предысторией и новыми данными будет разрыв по времени и
- //2) выбранные записываемые переменные вообще могли смениться и предыстория останется от старых, а новые данные - от новых
- //спрашиваем адреса у драйвера CAN_OPEN
- if (p->control & 1)
- if (!(p->dlog_iptr1 = (type_data*) co_getAddr(pco_vars, p->ind_subind1))) //если адрес=0
- p->dlog_iptr1 = (type_data*) &p->ind_subind1; //пусть указывает на ind_subind
- if (p->control & 2)
- if (!(p->dlog_iptr2 = (type_data*) co_getAddr(pco_vars, p->ind_subind2)))
- p->dlog_iptr2 = (type_data*) &p->ind_subind2;
- if (p->control & 4)
- if (!(p->dlog_iptr3 = (type_data*) co_getAddr(pco_vars, p->ind_subind3)))
- p->dlog_iptr3 = (type_data*) &p->ind_subind3;
- if (p->control & 8)
- if (!(p->dlog_iptr4 = (type_data*) co_getAddr(pco_vars, p->ind_subind4)))
- p->dlog_iptr4 = (type_data*) &p->ind_subind4;
- p->WriteDelimiter = (p->control >> 16) & 0xFF; //прореживание. ОграничиваетсЯ 8ю битами
- mode = (p->control >> 4) & 3; //режим - 2 бита
- p->control = 0; //все обработали, обнулЯем, чтобы при след. вызове не начать обрабатывать снова
- dlog_set_mode(mode, p); //длЯ установки режима вызываетсЯ спец. функциЯ. НапрЯмую нельзЯ
- }
- //! функциЯ длЯ установки mode_reset.
- //! предполагаетсЯ длЯ управлениЯ логгером из других модулей
- //! проверЯет mode_reset на валидность и обнулЯет счетчики
- //! \memberof TDataLog
- #pragma CODE_SECTION("secureRamFuncs")
- void dlog_set_mode(Uint16 mode_reset, TDataLog *p) {
- if (mode_reset > 3)
- return;
- //в 1 переводим только если текущий режим 2, чтоб синхронизироватьсЯ
- //по первому событию (очень полезно когда событий много)
- if (p->OneShotOperation == 1) {
- if ((mode_reset == 1)) {
- if (p->mode_reset == 2)
- p->mode_reset = mode_reset;
- else
- return;
- }
- } else
- p->mode_reset = mode_reset;
- //при смене режима в любом случае сбрасываем флаг "данные готовы"
- p->control = ~((~p->control) | 64);
- p->WriteDelimiterCounter = 0;
- }
- //! Записывает очередные точки в массивы осциллограммы.
- //!Должна вызыватьсЯ с заданной дискретизацией и занимаетсЯ записью массивов,
- //! т.е. непосредственно осциллографированием. Умеет записывать данные
- //! в массивы по-разному в зависимости от выбранного режима работы осциллографа
- //! \memberof TDataLog
- #pragma CODE_SECTION("secureRamFuncs")
- void data_log_update(TDataLog *p) {
- //везде испоьзуетсЯ p-> , а не p* - так быстрее
- //прореживание данных. Если не достигли уставки WriteDelimiter, выходим
- //WriteDelimiter=1 - не делим
- //WriteDelimiter=2 - берем каждую вторую
- if ((p->WriteDelimiterCounter++ + 1) < p->WriteDelimiter)
- return;
- else
- p->WriteDelimiterCounter = 0;
- if (p->mode_reset != p->mode_reset_prev) p->E=1;
- else p->E=0;
- p->mode_reset_prev = p->mode_reset;
- switch (p->mode_reset) {
- case 0: {
- p->Wcounter = 0;
- return;
- }
- case 1: //однократнаЯ запись - дошли до конца и стоп (режим 0)
- {
- //При входе в режим получаем точку срабатывания триггера (это текущий Wcounter, с которым мы сюда зашли) и рассчитываем первую точку, относящуюся к данной осце (исходя из текущей точки и заданной длины предыстории)
- if (p->E==1)
- {
- p->prehistory_length = p->valid_points_num; //длина предыстории равна количеству валидных точек
- if (p->prehistory_length > p->trig_shift_int) //если предыстория длиннее заданного, ограничим
- p->prehistory_length = p->trig_shift_int;
- p->first_point_written = (p->Wcounter - p->prehistory_length + 1) & 0xFE; //& 0xFE, чтобы получить четное число не более 254. Начальная точка осциллограммы должна быть четной т.к. копируем в массив для буферной
- //передачи попарно. +1 - чтобы предыстория получилась на 1 точку короче, а не длиннеее (мало ли что там в этой лишней точке лежит...).
- }
- p->Wcounter &= 0xFF; //защита - если вдруг в counter не валидное значение
- p->dl_buffer1_adr[p->Wcounter] = *p->dlog_iptr1;
- p->dl_buffer2_adr[p->Wcounter] = *p->dlog_iptr2;
- p->dl_buffer3_adr[p->Wcounter] = *p->dlog_iptr3;
- p->dl_buffer4_adr[p->Wcounter] = *p->dlog_iptr4;
- p->Wcounter++;
- p->Wcounter &= 0xFF; //если прошли 256 точек, обнулитсЯ
- //if (p->Wcounter == 0) //если ноль,
- if (p->Wcounter == p->first_point_written) //если дошли до последней записываемой точки
- {
- p->mode_reset = 0; //режим СТОП
- p->control|=64; //флаг "данные готовы"
- }
- return;
- }
- case 2: //записываем лог по кругу
- {
- p->valid_points_num++; //считаем количество записанных валидных точек предыстории
- if (p->valid_points_num > 256) //ограничиваем
- p->valid_points_num = 256;
- p->Wcounter &= 0xFF; //защита - если вдруг в counter не валидное значение
- p->dl_buffer1_adr[p->Wcounter] = *p->dlog_iptr1;
- p->dl_buffer2_adr[p->Wcounter] = *p->dlog_iptr2;
- p->dl_buffer3_adr[p->Wcounter] = *p->dlog_iptr3;
- p->dl_buffer4_adr[p->Wcounter] = *p->dlog_iptr4;
- p->Wcounter++;
- p->Wcounter &= 0xFF; //если прошли 256 точек, обнулитсЯ
- return;
- }
- case 3: //режим однократной записи 1024 точек
- {
- //с учетом того, что буферы в памЯти расположены последовательно,
- //записываем в первый, "заезжаЯ" на остальные три
- p->dl_buffer1_adr[p->Wcounter] = *p->dlog_iptr1;
- p->Wcounter++;
- if (p->Wcounter >= 1024) //если дошли до конца
- {
- p->mode_reset = 0; //режим СТОП
- p->control|=64; //флаг "данные готовы"
- }
- return;
- }
- }
- }
- /*@}*/
Advertisement
Add Comment
Please, Sign In to add comment