system.h File Reference

Go to the source code of this file.

Data Structures

struct  FILE_ENTRY

Functions

void F_SystemStringCopy (U8 *DestiString, U8 *SourceString)
U32 F_SystemAscii2HexU32 (U8 *pString)
U8 F_SystemAscii2HexU8 (U8 Data)
U8 F_SystemlibHex2AsciiCharGet (U8 Data)
U32 F_SystemlibAscii2HexNumberGet (U8 *pString)


Function Documentation

U32 F_SystemAscii2HexU32 ( U8 *  pString  ) 

Definition at line 26 of file system.c.

00026                                      {
00027     U32 i,j;
00028 
00029     i=0;
00030     while(*pString!=0){
00031         j=(U32)F_SystemAscii2HexU8(*pString);
00032         i=i*16+j;
00033         pString++;
00034     }
00035     return i;
00036 }

U8 F_SystemAscii2HexU8 ( U8  Data  ) 

Definition at line 37 of file system.c.

00037                                {
00038 
00039     if((Data>='0')&&(Data<='9')) Data=Data-'0';
00040     else if((Data>='a')&&(Data<='f')) Data=Data-'a'+10;
00041     else if((Data>='A')&&(Data<='F')) Data=Data-'A'+10;
00042     return Data;
00043 }

U32 F_SystemlibAscii2HexNumberGet ( U8 *  pString  ) 

Definition at line 44 of file system.c.

00044                                               {
00045     U8 i,j;
00046     U32 k;
00047     U8 *pData;
00048 
00049     if(pString==(U8 *)0) return 0; // null string pointer
00050     pData=pString;
00051     for(i=0;i<9;i++) if(*pData++==0) break;
00052     if((i==0)||(i==9)) return 0; // string too large
00053     k=0;
00054     if(i==8){
00055         j=*pString++;
00056         if((j>='0')&&(j<='9')) j=j-'0';
00057         else if((j>='a')&&(j<='f')) j=j-'a'+10;
00058         else if((j>='A')&&(j<='F')) j=j-'A'+10;
00059         else return 0; // invalid char
00060         k+=(U32)j<<28;
00061         i--; 
00062     } 
00063     if(i==7){
00064         j=*pString++;
00065         if((j>='0')&&(j<='9')) j=j-'0';
00066         else if((j>='a')&&(j<='f')) j=j-'a'+10;
00067         else if((j>='A')&&(j<='F')) j=j-'A'+10;
00068         else return 0; // invalid char
00069         k+=(U32)j<<24; 
00070         i--;
00071     } 
00072     if(i==6){
00073         j=*pString++;
00074         if((j>='0')&&(j<='9')) j=j-'0';
00075         else if((j>='a')&&(j<='f')) j=j-'a'+10;
00076         else if((j>='A')&&(j<='F')) j=j-'A'+10;
00077         else return 0; // invalid char
00078         k+=(U32)j<<20; 
00079         i--;
00080     } 
00081     if(i==5){
00082         j=*pString++;
00083         if((j>='0')&&(j<='9')) j=j-'0';
00084         else if((j>='a')&&(j<='f')) j=j-'a'+10;
00085         else if((j>='A')&&(j<='F')) j=j-'A'+10;
00086         else return 0; // invalid char
00087         k+=(U32)j<<16; 
00088         i--;
00089     } 
00090     if(i==4){
00091         j=*pString++;
00092         if((j>='0')&&(j<='9')) j=j-'0';
00093         else if((j>='a')&&(j<='f')) j=j-'a'+10;
00094         else if((j>='A')&&(j<='F')) j=j-'A'+10;
00095         else return 0; // invalid char
00096         k+=(U32)j<<12; 
00097         i--;
00098     } 
00099     if(i==3){
00100         j=*pString++;
00101         if((j>='0')&&(j<='9')) j=j-'0';
00102         else if((j>='a')&&(j<='f')) j=j-'a'+10;
00103         else if((j>='A')&&(j<='F')) j=j-'A'+10;
00104         else return 0; // invalid char
00105         k+=(U32)j<<8; 
00106         i--;
00107     } 
00108     if(i==2){
00109         j=*pString++;
00110         if((j>='0')&&(j<='9')) j=j-'0';
00111         else if((j>='a')&&(j<='f')) j=j-'a'+10;
00112         else if((j>='A')&&(j<='F')) j=j-'A'+10;
00113         else return 0; // invalid char
00114         k+=(U32)j<<4; 
00115         i--;
00116     } 
00117     if(i==1){
00118         j=*pString++;
00119         if((j>='0')&&(j<='9')) j=j-'0';
00120         else if((j>='a')&&(j<='f')) j=j-'a'+10;
00121         else if((j>='A')&&(j<='F')) j=j-'A'+10;
00122         else return 0; // invalid char
00123         k+=(U32)j; 
00124     } 
00125     return k;
00126 }

U8 F_SystemlibHex2AsciiCharGet ( U8  Data  ) 

Definition at line 127 of file system.c.

00127                                        {
00128     if((Data>=0)&&(Data<=9)) Data+=0x30;
00129     else if((Data>=10)&&(Data<=15)) Data+=55;
00130     else Data=0;
00131     return Data;
00132 }

void F_SystemStringCopy ( U8 *  DestiString,
U8 *  SourceString 
)

Definition at line 11 of file system.c.

00011                                                          {
00012     U8 i;
00013 
00014     i=0;
00015     while(*SourceString!=0){
00016         *DestiString=*SourceString;
00017         DestiString++;
00018         SourceString++;
00019         i++;
00020         if(i>=99){
00021             *DestiString=0;
00022             break;
00023         }
00024     }
00025 }


Generated on Sun Jul 19 00:50:40 2009 for PROGRAMER FOR PIC18F87J10 USING LPT PORT by  doxygen 1.5.9