⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dsp281x_gpio.h

📁 基于矢量控制的永磁同步交流伺服电机控制系统 可以用的源程序
💻 H
📖 第 1 页 / 共 2 页
字号:
//###########################################################################
//
// FILE:   DSP281x_Gpio.h
//
// TITLE:  DSP281x General Purpose I/O Definitions.
//
//###########################################################################
//
//  Ver | dd mmm yyyy | Who  | Description of changes
// =====|=============|======|===============================================
//  1.00| 11 Sep 2003 | L.H. | Changes since previous version (v.58 Alpha)
//      |             |      | Corrected union definitions that had BIT instead
//      |             |      | of bit
//###########################################################################

#ifndef DSP281x_GPIO_H
#define DSP281x_GPIO_H


#ifdef __cplusplus
extern "C" {
#endif


//----------------------------------------------------
// 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 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -