Codigo C driver
Por: fraviu • 5/6/2015 • Trabalho acadêmico • 19.873 Palavras (80 Páginas) • 181 Visualizações
#include "Controlador_IHM_objects.h"
#include "Controlador_IHM.h"
#include "Controlador_IHM_resources.h"
#include "built_in.h"
// Epson S1D13700 module connections
char S1D13700_Data_Port at PORTD;
sbit S1D13700_A0 at LATB4_bit;
sbit S1D13700_RD at LATC5_bit;
sbit S1D13700_WR at LATB5_bit;
sbit S1D13700_CS at LATE2_bit;
sbit S1D13700_RES at LATE3_bit;
char S1D13700_Data_Port_Direction at TRISD;
sbit S1D13700_A0_Direction at TRISB4_bit;
sbit S1D13700_RD_Direction at TRISC5_bit;
sbit S1D13700_WR_Direction at TRISB5_bit;
sbit S1D13700_CS_Direction at TRISE2_bit;
sbit S1D13700_RES_Direction at TRISE3_bit;
// End Epson S1D13700 module connections
// Touch Panel module connections
sbit DriveA at LATA2_bit;
sbit DriveB at LATA5_bit;
sbit DriveA_Direction at TRISA2_bit;
sbit DriveB_Direction at TRISA5_bit;
// End Touch Panel module connections
// Global variables
unsigned int Xcoord, Ycoord;
const ADC_THRESHOLD = 900;
char PenDown;
void *PressedObject;
int PressedObjectType;
unsigned int S1D13700_caption_length, S1D13700_caption_height;
unsigned int display_width, display_height;
int _object_count;
unsigned short object_pressed;
TLabel *local_label;
TLabel *exec_label;
int label_order;
TImage *local_image;
TImage *exec_image;
int image_order;
TBox *local_box;
TBox *exec_box;
int box_order;
TCheckBox *local_checkBox;
TCheckBox *exec_checkBox;
int checkBox_order;
static void InitializeTouchPanel() {
// Initialize EPSON S1D13700
S1D13700_Init(320, 240);
}
/////////////////////////
TScreen* CurrentScreen;
TScreen Screen1;
TImage Image1;
TImage * const code Screen1_Images[1]=
{
&Image1
};
TScreen Screen2;
TLabel Label24;
char Label24_Caption[5] = "Menu";
TLabel Label25;
char Label25_Caption[6] = "UG132";
TLabel Label27;
char Label27_Caption[3] = "27";
TLine Line8;
TLabel Label28;
char Label28_Caption[3] = "03";
TLine Line9;
TLabel Label29;
char Label29_Caption[5] = "2015";
TLabel Label30;
char Label30_Caption[3] = "00";
TLabel Label31;
char Label31_Caption[3] = "00";
TLabel Label32;
char Label32_Caption[2] = ":";
TLabel Label38;
char Label38_Caption[5] = "Sair";
TLabel Label37;
char Label37_Caption[5] = "Sair";
TLabel Label55;
char Label55_Caption[5] = "Menu";
TLabel Label56;
char Label56_Caption[7] = "Silen.";
TLabel Label57;
char Label57_Caption[7] = "Alarme";
TImage Image2;
TLabel * const code Screen2_Labels[13]=
{
&Label24,
&Label25,
&Label27,
&Label28,
&Label29,
&Label30,
&Label31,
...