Exemplo n.º 1
0
void YADA_64 (U16 X,U16 Y,U16 Color)
{
    send_word(0xaa64);
    send_xy(X,Y);
    send_word(Color);
    send_end();
}
Exemplo n.º 2
0
/* add --> wk */
 void YADA_E4()  // 触摸屏校准
 {
   send_word(0xaaE4);
   send_word(0x55aa);
   send_word(0x5aa5);
   send_end();
 }
Exemplo n.º 3
0
void send_area(U16 xs,U16 ys,U16 xe,U16 ye)
{
    send_word(xs);
    send_word(ys);
    send_word(xe);
    send_word(ye);
}
Exemplo n.º 4
0
void YADA_9D (U16 ID,U16 XS,U16 YS,U16 XE,U16 YE,U16 X,U16 Y)
{
    send_word(0xaa9D);
    send_word(ID);
    send_area(XS,YS,XE,YE);
    send_xy(X,Y);
    send_end();
}
Exemplo n.º 5
0
void YADA_C108 (U16 Addr,U8 Parameter_N)
{
    send_byte(0xAA);
    send_word(0xC108);
    send_word(Addr);
    send_byte(Parameter_N);
    send_end();
}
Exemplo n.º 6
0
void YADA_C110 (U16 Addr,U8 Frame_Number)
{
    send_byte(0xAA);
    send_word(0xC110);
    send_word(Addr);
    send_byte(Frame_Number);
    send_end();
}
Exemplo n.º 7
0
void YADA_76 (U16 X,U8 X_Dis,U16 *P,U8 Size)
{
    send_word(0xaa76);
    send_word(X);
    send_byte(X_Dis);
    send_U16str(P,Size);
    send_end();
}
Exemplo n.º 8
0
void YADA_90_ORDER (U32 Addr,U8 *P,U8 Size)
{
    send_xy(0xaa90,0x55aa);
    send_word(0x5aa5);
    send_word(Addr/65536);
    send_word(Addr%65536);
    send_U8str(P,Size);
    send_end();
}
Exemplo n.º 9
0
void YADA_9BFF (U8 RTC_Mode,U8 Text_Mode,U16 Color,U16 X,U16 Y)
{
    send_word(0xaa9B);
    send_byte(0xFF);
    send_byte(RTC_Mode);
    send_byte(Text_Mode);
    send_word(Color);
    send_xy(X,Y);
    send_end();
}
Exemplo n.º 10
0
 /* 使用暂存缓冲区的数据点高速无闪烁连线(示波器) */
void YADA_C104 (U16 Addr1,U16 X,U16 Y,U16 Line_Number,U8 Dis_X,U16 Color1,U16 Addr0,U16 Color0)
{
    send_byte(0xAA);
    send_word(0xC104);
    send_xy(Addr1,X);
    send_xy(Y,Line_Number);
    send_byte(0x01);//自动固定写01
    send_byte(Dis_X);
    send_word(Color1);
    send_xy(Addr0,Color0);
    send_end();
}
Exemplo n.º 11
0
void YADA_C103 (U16 Addr,U16 X,U16 Y,U16 Line_Number,U8 D_X,U8 Dis_X,U8 K_y,U16 Color)
{
    send_byte(0xAA);
    send_word(0xC103);
    send_xy(Addr,X);
    send_xy(Y,Line_Number);
    send_byte(D_X);
    send_byte(Dis_X);
    send_byte(K_y);
    send_word(Color);
    send_end();
}
Exemplo n.º 12
0
void YADA_C106 (U16 Addr,U16 X,U16 Y,U16 Line_Number,U8 D_X,U8 Dis_X,U8 M_y,U8 D_y,U16 Color,U16 Ymin,U16 Ymax)
{
    send_byte(0xAA);
    send_word(0xC106);
    send_xy(Addr,X);
    send_xy(Y,Line_Number);
    send_byte(D_X);
    send_byte(Dis_X);
    send_byte(M_y);
    send_byte(D_y);
    send_word(Color);
    send_xy(Ymin,Ymax);
    send_end();
}
Exemplo n.º 13
0
void YADA_C10700 (U16 Addr,U16 X_Len,U16 Y_Len)
{
    send_xy(0xAAC1,0X0700);
    send_xy(Addr,X_Len);
    send_word(Y_Len);
    send_end();
}
Exemplo n.º 14
0
void YADA_41 (U8 D_X,U8 D_Y)
{
    send_word(0xaa41);
    send_byte(D_X);
    send_byte(D_Y);
    send_end();
}
Exemplo n.º 15
0
void YADA_C102 (U16 Addr,U16 Line_Number)
{
    send_byte(0xAA);
    send_word(0xC102);
    send_xy(Addr,Line_Number);
    send_end();
}
Exemplo n.º 16
0
void YADA_C101 (U16 Addr,U16 Pixel_Number)
{
    send_byte(0xAA);
    send_word(0xC101);
    send_xy(Addr,Pixel_Number);
    send_end();
}
Exemplo n.º 17
0
void YADA_90_RANDOM (U16 Addr,U8 *P,U8 Size)
{
    send_area(0xAA90,0x55aa,0x5aa5,0x01de);
    send_word(Addr);
    send_U8str(P,Size);
    send_end();
}
Exemplo n.º 18
0
void YADA_57 (ARC *P,U8 Size)
{
    send_word(0xaa57);
    if(Size==0)
    {
        U16 i=sizeof(P);
        U16 j;
        for(j=0; j<i; j++)
        {
            send_byte(P->style);
            send_xy(P->X_0,P->Y_0);
            send_byte(P->R_0);
            P++;
        }
    }
    else
    {
        U16 k;
        for(k=0; k<Size; k++)
        {
            send_byte(P->style);
            send_xy(P->X_0,P->Y_0);
            send_byte(P->R_0);
            P++;
        }
    }
    send_end();
}
Exemplo n.º 19
0
void YADA_78 (U16 X,U16 Y,U8 *P,U8 Size)
{
    send_word(0xaa78);
    send_xy(X,Y);
    send_U8str(P,Size);
    send_end();
}
Exemplo n.º 20
0
void YADA_74 (U16 X,U16 YS,U16 YE,U16 BC,U16 *P,U8 Size)
{
    send_word(0xAA74);
    send_area(X,YS,YE,BC);
    send_U16str(P,Size);
    send_end();
}
Exemplo n.º 21
0
void sendLeaderboard(int socket_id)
{
	int i, j, count = 0;
	userpw_t* usersPlayed[10];
	pthread_mutex_lock(&leaderboardLock);
	for (i = 0; i < NUMBER_OF_USERS; i++)
	{
		if (*(userHolder[i]->gamesPlayed) > 0)
		{
			usersPlayed[count] = userHolder[i];
			count++;
		}
	}
	pthread_mutex_unlock(&leaderboardLock);
	send_number(socket_id, count);
	bubble_sort(usersPlayed, count);
	for (j = 0; j < count; j++)
	{		
		int gamesWon = (*(usersPlayed[j]->gamesPlayed));
		int gamesPlayed  = (*(usersPlayed[j]->gamesWon));
		char* username  = usersPlayed[j]->username;
		int username_length = strlen(username);
		send_number(socket_id, username_length);
		send_word(socket_id, username);
		send_number(socket_id, gamesWon);
		send_number(socket_id, gamesPlayed);
	}
}
Exemplo n.º 22
0
int			run_address(void)
{
	unsigned int	i = 0;

	if (set_debug_mode() != 0)
		goto error_run;

	for (i = 0; gr_run_cmd[i].address != 0xDEADDEAD; ++i) {
		if (gr_run_cmd[i].value == 0x42424242)
			config.word = config.run_address;
		else if (gr_run_cmd[i].value == 0x42424242 + 4)
			config.word = config.run_address + 4;
		else
			config.word = gr_run_cmd[i].value;
		config.memory_address = gr_run_cmd[i].address;
		if (send_word() != 0)
			goto error_run;
	}

	return (0);

 error_run:
	fprintf(stderr,
		"Unable to run at address %08x.\n",
		config.memory_address);
	return (errno);
}
Exemplo n.º 23
0
void YADA_75 (U16 X,U16 Y,U8 H_Max,U8 *P,U8 Size)
{
    send_word(0xaa75);
    send_xy(X,Y);
    send_byte(H_Max);
    send_U8str(P,Size);
    send_end();
}
Exemplo n.º 24
0
void YADA_44 (U8 EN,U16 X,U16 Y,U8 Width,U8 Height)
{
    send_word(0xaa44);
    send_byte(EN);
    send_xy(X,Y);
    send_byte(Width);
    send_byte(Height);
    send_end();
}
Exemplo n.º 25
0
void YADA_E0 (U8 TFT_ID,U8 Bode_Set,U8 Para1)
{
    send_xy(0xaae0,0x55aa);
    send_word(0x5aa5);
    send_byte(TFT_ID);
    send_byte(Bode_Set);
    send_byte(Para1);
    send_end();
}
Exemplo n.º 26
0
void YADA_5F(U8 PWM_T)
{
    send_word(0xaa5F);
    if(PWM_T!=0xFF)
    {
        send_byte(PWM_T);
    }
    send_end();
}
Exemplo n.º 27
0
//Sends all words in the dictionary that can be formed by the given set of letters, then switches to the next
//set of letters.
void loop_through_dictionary( char* letters ) {
  int x;
  for( x = 0; x < NUM_WORDS; x++ ) {
    if( composed_of( dictionary[x], letters ) && strlen( dictionary[x]) < 6 ) {
      send_word( dictionary[x] );
    }
  }
  sleep( 1 );
  send_key( XKeysymToKeycode( display, XK_Control_L ) , 1);
}
Exemplo n.º 28
0
void YADA_98 (U16 X,U16 Y,U8 Lib_ID,U8 C_Mode,U8 C_Dots,U16 FrontC,U16 BackC,U8 *P,U8 Size)
{
    send_word(0xAA98);
    send_xy(X,Y);
    send_byte(Lib_ID);
    send_byte(C_Mode);
    send_byte(C_Dots);
    send_xy(FrontC,BackC);
    send_U8str(P,Size);
    send_end();
}
Exemplo n.º 29
0
void send_U16str(U16 *q,U8 size)  //串口发送一串数据 (U16)size为0则发送整个字符串
{
    U8 i=size;
    if(i==0)
    {
        while(*q!='\0')
        {
            send_word(*q);
            q++;
        }
    }
    else
    {
        while(i)
        {
            send_word(*q);
            q++;
            i--;
        }
    }
}
Exemplo n.º 30
0
void YADA_E7(U8 YY,U8 MM,U8 DD,U8 HH,U8 M,U8 SS)
{
    send_xy(0xaae7,0x55aa);
    send_word(0x5aa5);
    send_byte(YY);
    send_byte(MM);
    send_byte(DD);
    send_byte(HH);
    send_byte(M);
    send_byte(SS);
    send_end();
}