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

📄 doorlock.h

📁 freescale最新的16位单片机
💻 H
字号:
/******************************************************************************		
*                                                                                   
*       Copyright (C) 2006 Freescale Semiconductor, Inc.                            
*       All Rights Reserved								              				
*														              				
* Filename:     Door Lock ADC.h                										
*														              				
* Functions:    includes compiler predefines for the Master Node			      	
*												                            		
* Description:																		
*																					
* Notes:							
*																					
******************************************************************************/
#ifndef _DOORLOCK_
#define _DOORLOCK_
/*****************************************************************************/
/*												Pin definitions																		 */
/*****************************************************************************/
#define DOORLock2_Input1  PORTE_PE7 
#define DOORLock2_Input2  PORTE_PE6 
#define DOORLock2_Enable  PTT_PTT1
#define DOORLock2_Disable         PT0AD1_PT0AD112 /*PIN20*/

#define DOORLock1_Input2  PTT_PTT7 
#define DOORLock1_Input1  PTT_PTT6 
#define DOORLock1_Enable  PTT_PTT5
#define DOORLock1_Disable         PT1AD1_PT1AD18  /*PIN8*/

/*****************************************************************************/
/*                   DEFINITIONS FOR COTROL                                  */
/*****************************************************************************/
#define LOCK_1  1
#define LOCK_2  2
#define OPEN    1
#define CLOSE   0
#define ENABLE  1
#define DISABLE 0
#define TRUE    1
#define FALSE		0
#define CRITICALVALUE 350				 // strongly depends on used doorlock mechanism

/*reset both H-Bridges*/
#define RESET_HBRIDGE() DOORLock1_Disable = ENABLE; \
                        DOORLock1_Enable  = DISABLE;\
                        DOORLock2_Disable = ENABLE;\
                        DOORLock2_Enable  = DISABLE;

/*DoorLock nr. 1 CLOSE*/
#define DOOR1_CLOSE() DOORLock1_Disable = DISABLE;\
                      DOORLock1_Enable = ENABLE;\
                      DOORLock1_Input1 = CLOSE;\
                      DOORLock1_Input2 = OPEN;
/*DoorLock nr. 2 CLOSE*/
#define DOOR2_CLOSE() DOORLock2_Disable = DISABLE;\
                      DOORLock2_Enable = ENABLE;\
                      DOORLock2_Input1 = CLOSE;\
                      DOORLock2_Input2 = OPEN;
                      
/*DoorLock nr. 1 OPEN*/
#define DOOR1_OPEN() DOORLock1_Disable = DISABLE;\
                      DOORLock1_Enable = ENABLE;\
                      DOORLock1_Input1 = OPEN;\
                      DOORLock1_Input2 = CLOSE;
/*DoorLock nr. 2 OPEN*/
#define DOOR2_OPEN() DOORLock2_Disable = DISABLE;\
                      DOORLock2_Enable = ENABLE;\
                      DOORLock2_Input1 = OPEN;\
                      DOORLock2_Input2 = CLOSE;

/*disable both outputs*/ 
#define DISABLE_OUPUTS()  DOORLock1_Input1 = CLOSE;\
                          DOORLock1_Input2 = CLOSE;\
                          DOORLock2_Input1 = CLOSE;\
                          DOORLock2_Input2 = CLOSE;


/*****************************************************************************/
/*                       USER ACCESIBLE FUNCTIONS                            */
/*****************************************************************************/
char DoorOverCurent (void);
char DoorClose(void);
char DoorOpen(void);
void FollowMasterDoorLock(void);
/*********************** EXTERN FUNCTIONS ************************************/
extern void Delay100Us(void); /* delay time depends on BUS frequency */
#endif

⌨️ 快捷键说明

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