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

📄 portb.h

📁 HID汽车大灯安定器,应用现在的安定器上,有多种保护功能
💻 H
字号:
#ifndef __PORTB_H
#define __PORTB_H

/* PIC18 PORTB library interface */

/* PORTB Config Bit Defines */
#define PORTB_CHANGE_INT_ON   0b11111111  /* PORTB interrupts on  */
#define PORTB_CHANGE_INT_OFF  0b01111111  /* PORTB interrupts off */
#define PORTB_PULLUPS_ON      0b11111110  /* PORTB pullups on     */
#define PORTB_PULLUPS_OFF     0b11111111  /* PORTB pullups off    */

#define RISING_EDGE_INT  0b11111111 /*Interrupt is set by a rising edge  */
#define FALLING_EDGE_INT 0b11111101 /*Interrupt is set by a falling edge */


/* PORTB Function Prototypes */
#define PARAM_SCLASS auto

/* OpenPORTB
 * Configure PORTB interrupts, resistors
 */
void OpenPORTB(PARAM_SCLASS unsigned char);

/* ClosePORTB
 * Disable PORTB interrupts, resistors
 */
#define ClosePORTB() INTCONbits.RBIE=0, DisablePullups()

/* EnablePullups
 * Enable PORTB resistors
 */
#define EnablePullups() INTCON2bits.RBPU=0

/* DisablePullups
 * Disable PORTB resistors
 */
#define DisablePullups() INTCON2bits.RBPU=1

/* OpenRB0INT
 * Enable RB0INT interrupts, falling edge/rising edge
 * PIC18Cxxx only
 */
void OpenRB0INT(PARAM_SCLASS unsigned char);

/* CloseRB0INT
 * Disable RB0INT interrupts, resistors
 * PIC18Cxxx only
 */
#define CloseRB0INT() INTCONbits.INT0IE=0

/* OpenRB1INT
 * Enable RB1INT interrupts, falling edge/rising edge
 * PIC18Cxxx only
 */
void OpenRB1INT(PARAM_SCLASS unsigned char);

/* CloseRB1INT
 * Disable RB1INT interrupts, resistors
 * PIC18Cxxx only
 */
#define CloseRB1INT() INTCON3bits.INT1IE=0

/* OpenRB2INT
 * Enable RB2INT interrupts, falling edge/rising edge
 * PIC18Cxxx only
 */
void OpenRB2INT(PARAM_SCLASS unsigned char);

/* CloseRB2INT
 * Disable RB2INT interrupts, resistors
 * PIC18Cxxx only
 */
#define CloseRB2INT() INTCON3bits.INT2IE=0

#endif

⌨️ 快捷键说明

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