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

📄 st7lib_config.h

📁 st7单片机关于I2C总线设计的源程序,使用ST7单片机的很有用
💻 H
字号:
/******************************************************************************
COPYRIGHT 2002 STMicroelectronics
Source File Name : st7lib_config.h  
Group            : IPSW,CMG - IPDF
Author           : MCD Application Team
Date First Issued: 04/03/2002
********************************Documentation**********************************
General Purpose - This file is used to select the device and the communication 
				  mode.
********************************Revision History*******************************
_______________________________________________________________________________
Date :04/03/2002                  Release:1.0 		       		 
******************************************************************************/
#ifndef	ST7LIB_CONFIG_H
#define	ST7LIB_CONFIG_H

/**************************** User customizable Part *************************/
/*---------------------------Select the Target device------------------------*/
#include "st72f521_periph.h"                 /* Include as per target device */
/* #include "st7superlite_periph.h"                                             */
/* #include "st7flite0_periph.h"                                             */
/* #include "st72f62_periph.h"                                               */
/* #include "st72f63b_periph.h"                                              */
/* #include "st72f65_periph.h"                                               */
/* #include "st72f561_periph.h"                                              */
/* #include "st72f264_periph.h"                                              */
/* #include "st7flite1_periph.h"                                             */
/* #include "st7flite2_periph.h"                                             */
/* #include "st7flite3_periph.h"                                             */
/* #include "st7dali_periph.h"                                               */

#endif 

/*---------------------------------Define Fcpu-------------------------------*/
#define Fcpu ((unsigned long) 8000000)   
#define Fosc2 ((unsigned long) 8000000)   

/*---------------------Select the SCI mode of communication------------------*/
#define SCI_POLLING_TX                         /* Polling mode transmission */                   
//#define SCI_POLLING_RX                         /* Polling mode reception */                    
// #define INTRPTDRV_WITHOUTBUF_TX                                           
                        /* Interrupt driven without buffer transmission mode */       
 #define INTRPTDRV_WITHOUTBUF_RX                                           
                           /* Interrupt driven without buffer reception mode */ 

/*---------------Selection of Slave mode transmission configuration ---------*/
#define SPI_SLAVE_CONFIG  

/*---------------------Select the SPI mode of communication------------------*/
#define SPI_POLLING_TX                          /* Polling mode transmission */                   
/* #define SPI_POLLING_RX           */             /* Polling mode reception */
/* #define SPI_ITDRV_WITHOUTBUF_TX                                           */
                        /* Interrupt driven without buffer transmission mode */       
#define SPI_ITDRV_WITHOUTBUF_RX		
                           /* Interrupt driven without buffer reception mode */
                           
/*---------------------Select the I2C mode of communication------------------*/
#define I2C_POLLING_TX                          /* Polling mode transmission */                   
#define I2C_POLLING_RX                             /* Polling mode reception */                    
//#define I2C_ITDRV_WITHOUTBUF_TX 
                        /* Interrupt driven without buffer transmission mode */       
//#define I2C_ITDRV_WITHOUTBUF_RX		
                           /* Interrupt driven without buffer reception mode */

          
/*--------------Selection of PORT C INTERRUPT CONFIGURATION in ST72F264------*/ 
/* Include the correct configuration only & change corresponding option byte
    settings in the MCU CONFIGURATION */
                /* This value configures PORT C as external interrupt EI1 */
#define EXTIT_VALUE 1       /* This is the default configuration */

         /* This configures PORT C as external interrupt EI0 */    
/* #define EXTIT_VALUE 0   */
                                                      
/******************************** End of User Part ***************************/

/*-----------------------------Compiler Selection----------------------------*/     
#if(defined __HIWARE__ || defined __MWERKS__)
#define _HIWARE_ 
#else
#ifdef __CSMC__
#define _COSMIC_
#else
#error "Unsupported Compiler!"                 /* Compiler defines not found */
#endif /* __CSMC__ */
#endif /* __HIWARE__ */

/*****************************Non User Part***********************************/
#if defined (ST72F521_periph_H)
 #include"st72f521_reg.h"
#else
 #if defined (ST72F62_periph_H)
  #include"st72f62_reg.h"  
 #else
  #if defined (ST7fLITE0_periph_H)
   #include"st7flite0_reg.h"  
  #else
   #if defined (ST7SUPERLITE_periph_H)
   #include"st7superlite_reg.h"       
  #else
#if defined (ST72F63_periph_H)
    #include"st72f63_reg.h"    
   #else
    #if defined (ST72F65_periph_H)
     #include"st72f65_reg.h"
    #else
	 #if defined (ST72F561_periph_H)
      #include"st72f561_reg.h"
     #else
      #if defined (ST72F264_periph_H)
       #include"st72f264_reg.h"
      #else 
       #if defined (ST7FLITE1_periph_H)
        #include"st7flite1_reg.h"
       #else
        #if defined (ST7FLITE2_periph_H)
         #include"st7flite2_reg.h"
        #else 
         #if defined (ST7FLITE3_periph_H)
          #include"st7flite3_reg.h"
         #else         
          #if defined (ST7DALI_periph_H)
           #include"st7dali_reg.h"
              #else                                 /* Cascade the #if defined for all devices */
             #error	"No Valid ST7 MCU Configuration"
            #endif	
           #endif
          #endif
         #endif
        #endif   
       #endif
      #endif
     #endif
    #endif
   #endif
  #endif
 #endif
	     
/*----------------------------Enumerated data type---------------------------*/
#ifndef enum_type
#define enum_type
#undef TRUE
#undef FALSE
typedef enum {
	FALSE	=(unsigned char) 0x00,			
	TRUE   = !(FALSE)                
        }BOOL; 
#endif /* enum_type */

/*---------------------Macros for Assembly instructions----------------------*/   
#ifdef _HIWARE_
#define EnableInterrupts {asm RIM;}
#define DisableInterrupts {asm SIM;}
#define Nop   {asm nop;}
#define WaitforInterrupt {asm wfi;}
#endif /* _HIWARE_ */

#ifdef _COSMIC_
#define EnableInterrupts {_asm ("RIM");}  
#define DisableInterrupts {_asm ("SIM");} 
#define Nop {_asm ("nop");} 
#define WaitforInterrupt {_asm ("wfi");} 
#endif /* _COSMIC_ */

/******************************** End of Non-user Part ***********************/
	
/**** (c) 2002   STMicroelectronics *************************** END OF FILE **/

⌨️ 快捷键说明

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