Exemplo n.º 1
0
void writeSerialPacket(int fd, FRGarminPacketRef outgoingPacket, int destroyPacket) {
	char outgoingByte;
	char checksum = 0;
	
	ssize_t bytesWritten = write(fd, &FR_DLE, 1);
	(void)bytesWritten;
	
	outgoingByte = outgoingPacket->typeID;
	writeDataByte(fd, outgoingByte, &checksum);
	
	outgoingByte = outgoingPacket->dataSize;
	writeDataByte(fd, outgoingByte, &checksum);
	
	size_t dataIdx;
	for (dataIdx = 0; dataIdx < outgoingPacket->dataSize; ++dataIdx) {
		outgoingByte = outgoingPacket->data[dataIdx];
		writeDataByte(fd, outgoingByte, &checksum);
	}
	
	checksum = -checksum; //checksum = ~checksum + 1;
	
	bytesWritten = write(fd, &checksum, 1);
	(void)bytesWritten;
	
	bytesWritten = write(fd, &FR_DLE, 1);
	(void)bytesWritten;
	
	bytesWritten = write(fd, &FR_ETX, 1);
	(void)bytesWritten;
	
	if (destroyPacket) FRGarminPacketDestroy(outgoingPacket);
}
Exemplo n.º 2
0
void writeChar( char charToWrite )
{
	//LCDSEND = charToWrite;
	//LCD_write_8( LCDSEND );
	//delayMilli();
	writeDataByte( charToWrite );

}
Exemplo n.º 3
0
//courtesy of C2C Steinmiller...
void scrollString(char *string1, char *string2) {
        unsigned int i = 0;

        char *count1 = string1, *count2 = string2;

        while (1) {
                cursorToLineOne();
                char *currentChar = count1;

                for (i = 0; i < 8; i++) {
                     writeDataByte(*currentChar);        //send data in the string to be written

                     currentChar++;

                     if (*currentChar == 0)
                           currentChar = string1;
                }
                count1++;

                if (*count1 == 0) {
                     count1 = string1;
                }

                cursorToLineTwo();
                char *currentChar2 = count2;
                for (i = 0; i < 8; i++) {
                      writeDataByte(*currentChar2);        //send data in the string to be written

                      currentChar2++;

                      if (*currentChar2 == 0)
                      currentChar2 = string2;
                }
                count2++;

                if (*count2 == 0) {
                    count2 = string2;
                }

                __delay_cycles(600000);

                LCDclear();
        }
}
Exemplo n.º 4
0
Arquivo: lcd.c Projeto: ntaormina/Lab4
void writeString(char string[]) {
    unsigned int length, count = 0;



    length = getStringLength(string);

    while(count < length) {
        writeDataByte(string[count]);
        count++;

    }
}
Exemplo n.º 5
0
char * scroll_help(char * beginning, char * current){
        if(*current == 0){
                current = beginning;
        }
        char * display = current;
        char position = 0;
        for (position = 0; position < 8; position++){
                writeDataByte(*display);
                display++;
                if(*display == 0){
                        display = beginning;
                }
        }
        return current + 1;
}
Exemplo n.º 6
0
Arquivo: LCD.c Projeto: JennaeN/LCD
//Unused function.
void scrollMessage(char *string, char *count) {
	unsigned int i = 0;
	char *currentChar = count;
	for (i = 0; i < 8; i++) {
		writeDataByte(*currentChar);	//send data in the string to be written

		currentChar++;

		if (*currentChar == 0)
			currentChar = string;
	}
	count++;

	if (*count == 0) {
		count = string;
	}

}
Exemplo n.º 7
0
void clearPlayer(unsigned char player)
{
	writeCommandByte(player);
	writeDataByte(' ');
}
Exemplo n.º 8
0
void printPlayer(unsigned char player)
{
	writeCommandByte(player);
	writeDataByte('*');
}
Exemplo n.º 9
0
void writeChar(char char2Write){
	writeDataByte(char2Write);
}
Exemplo n.º 10
0
void writeChar(char asciiChar) {
	writeCommandByte(0x06); //cursor increment
	writeDataByte(asciiChar);
}
Exemplo n.º 11
0
void writeChar(char asciiChar){
				writeDataByte(asciiChar);
}
Exemplo n.º 12
0
void printCharacter(char asciiChar){
        writeDataByte(asciiChar);
}