ascii.c File Reference

#include "config.h"
#include "ascii.h"

Include dependency graph for ascii.c:

Go to the source code of this file.

Functions

U8 ascii_to_bin (U8 c)
 This function returns the binary value of an ascii digit.
U8 bin_to_ascii (U8 c)
 This function returns the ascii value of a quartet.


Function Documentation

U8 ascii_to_bin ( U8  c  ) 

This function returns the binary value of an ascii digit.

Parameters:
none 
Returns:
none
/

Definition at line 32 of file ascii.c.

00033 {
00034   if (c>='a') return(c-('a'-0x0A));
00035   if (c>='A') return(c-('A'-0x0A));
00036   return(c-'0');
00037 }

U8 bin_to_ascii ( U8  c  ) 

This function returns the ascii value of a quartet.

Parameters:
none 
Returns:
none
/

Definition at line 47 of file ascii.c.

00048 {
00049   if (c>=0x0A) return (c+('A'-0x0A));
00050   return (c+'0');
00051 }


Generated on Wed Oct 22 16:03:25 2008 for AVR496 : Atmel BLDC control on ATAVRMC301 with ATtiny861 by  doxygen 1.5.7.1