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

📄 evbconfig.h

📁 * "Copyright (c) 2006 Robert B. Reese ("AUTHOR")" * All rights reserved. * (R. Reese, reese@ece.
💻 H
字号:
/*
  V0.1 Initial Release   10/July/2006  RBR

*/
#ifndef EVBCONFIG_H
#define EVBCONFIG_H


#if defined(MCC18)

//These definitions are for a PIC18F4620, 

//the PICDEMZ board has a 4620 on it, so we know its registers.
//setup equivalents for HITECH
#include "mcc_pic18F4620.h"

//other macros
#define NOP()               Nop()#define CLRWDT()            ClrWdt()#define RESET()             Reset()#define SLEEP()             Sleep()#define TBLWTPREINC()       _asm tblwtpreinc _endasm#define TBLRDPOSTINC()      _asm tblrdpostinc _endasm
#endif

#define DISABLE_WDT()       (SWDTEN = 0)#define ENABLE_WDT()        (SWDTEN = 1)
#define FOSC 16000000    //internal clock frequency

#define SW_CONFIG()\
{\
  TRISB5 = 1;\
  TRISB4 = 1;\
  RBPU = 0;\
}

//on the PICDEMZ, because the LEDs are connected to RA0, RA1
//then all of the A/D ports have to be configured as digital
#define LED_CONFIG()\
{\
  TRISA0 = 0;\
  TRISA1 = 0;\
  ADCON1 = 0x0f;\
}                    
      
#define SW1_INPUT_VALUE()          RB5
#define SW2_INPUT_VALUE()          RB4


#define LED_OFF 0
#define LED_ON  1

#define LED1   LATA0
#define LED2   LATA1

#define LED1_OFF()  LED1=LED_OFF
#define LED1_ON()   LED1=LED_ON
#define LED2_OFF()  LED2=LED_OFF
#define LED2_ON()   LED2=LED_ON

#define LED1_STATE() (LED1 == LED_ON)
#define LED2_STATE() (LED2 == LED_ON)










#endif



⌨️ 快捷键说明

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