SERIAL.H File Reference

Description : prototypes of the functions used by serial.c. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int serial_close (int file_descriptor)
 Closes the device associated with file_descriptor.
char serial_getchar (void)
 Reads the next byte.
void serial_init (void)
 Initializes the device.
int serial_kbhit (void)
 Do we have receive a character.
int serial_open (const char *path, unsigned flags, int file_descriptor)
 Opens the device and prepares it for input / output.
void serial_putchar (char c)
 Writes a character to the device.
void serial_puts (const char *string)
 Writes a string to the device.
int serial_read (char *buffer, unsigned count)
 Read the number of charactes specified by count to the buffer from the device.
int serial_write (int file_descriptor, const char *buffer, unsigned count)
 Writes the number of characters specified by count from the buffer to the device or file.


Detailed Description

Description : prototypes of the functions used by serial.c.

Definition in file SERIAL.H.


Function Documentation

int serial_close ( int  file_descriptor  ) 

Closes the device associated with file_descriptor.

Parameters:
[in] file_descriptor : Is the stream number assigned by the low-level routines.
Returns:
0 : If successful.

-1 : If fails.

Definition at line 121 of file SERIAL.C.

char serial_getchar ( void   ) 

Reads the next byte.

Returns:
Returns the next byte.

Definition at line 224 of file SERIAL.C.

References IS_URX_BUF_EMPTY, and RXBUF.

Referenced by PT_THREAD().

Here is the caller graph for this function:

void serial_init ( void   ) 

Initializes the device.

Definition at line 79 of file SERIAL.C.

References BAUD_115200.

Referenced by init(), and serial_open().

Here is the caller graph for this function:

int serial_kbhit ( void   ) 

Do we have receive a character.

Returns:
0 : No.

# : Yes.

Definition at line 240 of file SERIAL.C.

References IS_URX_BUF_EMPTY.

Referenced by PT_THREAD().

Here is the caller graph for this function:

int serial_open ( const char *  path,
unsigned  flags,
int  file_descriptor 
)

Opens the device and prepares it for input / output.

Parameters:
[in] path : Filename of the file to be opened, including path information.
[in] flags : Attributes that specify how the device is manipulated.
[in] file_descriptor : Is the stream number assigned by the low-level routines.
Returns:
-1 : If fails.

! -1 : If successful.

Definition at line 104 of file SERIAL.C.

References serial_init().

Here is the call graph for this function:

void serial_putchar ( char  c  ) 

Writes a character to the device.

Parameters:
[in] c : Specifies the byte to be written.

Definition at line 189 of file SERIAL.C.

References IS_UTX_BUF_READY, and TXBUF.

Referenced by build_req(), display_hexa(), display_number(), init(), PT_THREAD(), and serial_puts().

Here is the caller graph for this function:

void serial_puts ( const char *  string  ) 

Writes a string to the device.

Parameters:
[in] string : Points to a string to be written.

Definition at line 205 of file SERIAL.C.

References serial_putchar().

Referenced by build_req(), display_info(), init(), main(), PT_THREAD(), serveur_reprog(), switch_interrupt(), and vt100_init().

Here is the call graph for this function:

Here is the caller graph for this function:

int serial_read ( char *  buffer,
unsigned  count 
)

Read the number of charactes specified by count to the buffer from the device.

Parameters:
[in] file_descriptor : Is the stream number assigned by the low-level routines.
[out] buffer : Is the location of the buffer where the read characters are placed.
[in] count : Is the number of characters to read from the device.
Returns:
-1 : If fails.

0 : If EOF was encountered before the read was complete.

# : Number of characters read in every other instance.

Definition at line 140 of file SERIAL.C.

References IS_URX_BUF_EMPTY, and RXBUF.

Referenced by main().

Here is the caller graph for this function:

int serial_write ( int  file_descriptor,
const char *  buffer,
unsigned  count 
)

Writes the number of characters specified by count from the buffer to the device or file.

Parameters:
[in] file_descriptor : Is the stream number assigned by the low-level routines.
[in] buffer : Is the location of the buffer where the write characters are placed.
[in] count : Is the number of characters to write to the device.
Returns:
-1 : If fails.

# : Number of characters written if successful.

Definition at line 168 of file SERIAL.C.

References IS_UTX_BUF_READY, and TXBUF.


Generated on Wed Jun 3 12:06:04 2009 for PowWow v1.0 by  doxygen 1.5.6