Main Page | Data Structures | File List | Data Fields | Globals

ATAVRBFLY_FILES/BCD.c File Reference


Detailed Description

Atmel Corporation

Revision
1.2
Date
Wednesday, January 26, 2005 10:43:44 UTC

Definition in file BCD.c.

Go to the source code of this file.

Functions

char CHAR2BCD2 (char input)
unsigned int CHAR2BCD3 (char input)


Function Documentation

char CHAR2BCD2 char  input  ) 
 

Definition at line 37 of file BCD.c.

References input.

Referenced by SetContrast().

00038 { 00039 char high = 0; 00040 00041 00042 while (input >= 10) // Count tens 00043 { 00044 high++; 00045 input -= 10; 00046 } 00047 00048 return (high << 4) | input; // Add ones and return answer 00049 }

unsigned int CHAR2BCD3 char  input  ) 
 

Definition at line 65 of file BCD.c.

References input.

00066 { 00067 int high = 0; 00068 00069 while (input >= 100) // Count hundreds 00070 { 00071 high++; 00072 input -= 100; 00073 } 00074 00075 high <<= 4; 00076 00077 while (input >= 10) // Count tens 00078 { 00079 high++; 00080 input -= 10; 00081 } 00082 00083 return (high << 4) | input; // Add ones and return answer 00084 }


Generated on Tue Nov 1 16:21:39 2005 for AVR323 Interfacing GSM modems by doxygen 1.3.7