embedded:HWAPI.H
/*
   GD Control V1.0
   This contains HW-related definitions
 
*/
 
#include <REG52.H>
#ifndef _PORT_H
#define _PORT_H
 
#define TRUE 1
#define FALSE 0
#define UP 1
#define DOWN 0
 
/* Garagedoor control HW-connections and defines
   we use only port P1 for sensor and control purposes */
 
#define SENSOR_PORT P1     
 
#define DOOR_CLOSED_MASK (0x04) /* Sensor is connected to third "bit" */
#define DOOR_OPENED_MASK (0x08)    /* Sensor is connected to fourth "bit" */
#define BUTTON_MASK (0x10)     /* Button detector is connected to fifth "bit" */
 
#define MOTOR_ON 1
#define MOTOR_OFF 0
sbit MOTOR_CONTROL=P1^0; /* Port P1 pin0 controls Motor 
                            value ON motor runs */
sbit DIRECTION_CONTROL=P1^1; /* This controls Motor rotation direction */
 
#endif
 
/*------------------------------------------------------------------*-
  ---- END OF FILE -------------------------------------------------
-*------------------------------------------------------------------*/
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License