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

📄 config.h

📁 AVRmega28L的串口发送数据程序
💻 H
字号:
#ifndef _CONFIG_H_
#define _CONFIG_H_

#include "iom128v.h"
#include <macros.h>


// Common data types
typedef unsigned char		     BOOL;

typedef unsigned char		     BYTE;
typedef unsigned short		     WORD;
typedef unsigned long		     DWORD;
typedef unsigned long long	     QWORD;

typedef unsigned char		     UINT8;
typedef unsigned short		     UINT16;
typedef unsigned long		     UINT32;
typedef unsigned long long	     UINT64;

typedef signed char			     INT8;
typedef signed short		     INT16;
typedef signed long			     INT32;
typedef signed long long	     INT64;
////////////////////////////////////////////////////////////
 //定义口,直接可对口的每一位来操作
/* Port G */
#define PGI	(*(PPORT)0x63)
#define PGD	(*(PPORT)0x64)
#define PGO	(*(PPORT)0x65)

/* Port F */
#define PFI	(*(PPORT)0x20)
#define PFD	(*(PPORT)0x61)
#define PFO	(*(PPORT)0x62)

/* Port E */
#define PEI	(*(PPORT)0x21)
#define PED	(*(PPORT)0x22)
#define PEO	(*(PPORT)0x23)

/* Port D */
#define PDI	(*(PPORT)0x30)
#define PDD	(*(PPORT)0x31)
#define PDO	(*(PPORT)0x32)

/* Port C */
#define PCI	(*(PPORT)0x33)
#define PCD	(*(PPORT)0x34)
#define PCO	(*(PPORT)0x35)

/* Port B */
#define PBI	(*(PPORT)0x36)
#define PBD	(*(PPORT)0x37)
#define PBO	(*(PPORT)0x38)

/* Port A */
#define PAI	(*(PPORT)0x39)
#define PAD	(*(PPORT)0x3A)
#define PAO	(*(PPORT)0x3B)


// Define the ON/OFF symbol 
  #define ON       1
  #define OFF      0
  // Define YES/NO symbol
  #define YES      1
  #define NO       0
  #define TRUE     1
  #define FALSE    0 
typedef struct __port  //定义口,好直接对BIT进行操作
{
 int B0:1 ;
 int B1:1 ;
 int B2:1 ;
 int B3:1 ;
 int B4:1 ;
 int B5:1 ;
 int B6:1 ;
 int B7:1 ;
} PORT, *PPORT;


void init_devices(void);
void led_response (int t);
//void led_on_off(BYTE led_flag);
void delay(int t);
void SPI_MasterInit(void);
void SPI_MasterTransmit(char cData);
#endif

⌨️ 快捷键说明

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