ser_simple_avr.h File Reference

Simple serial I/O driver. More...

#include <appconfig.h>
#include <cfg/compiler.h>

Go to the source code of this file.


Defines

Parity settings for ser_setparity()
#define SER_PARITY_NONE   0
#define SER_PARITY_EVEN   2
#define SER_PARITY_ODD   3
Functions implemented as macros
#define ser_putchar(c, port)   _ser_putchar(c)
#define ser_getchar(port)   _ser_getchar()
#define ser_getchar_nowait(port)   _ser_getchar_nowait()
#define ser_print(port, s)   _ser_print(s)
#define ser_setbaudrate(port, y)   _ser_setbaudrate(y)
#define ser_setparity(port, par)   _ser_setparity(par)
#define ser_settimeouts(port, y, z)   _ser_settimeouts()
#define ser_purge(port)   _ser_purge()
#define ser_open(port)   _ser_open()
#define ser_getstatus(h)   0
#define ser_setstatus(h, x)   do {(void)(x);} while(0)

Functions

int _ser_putchar (int c)
 Send a character over the serial line.
int _ser_getchar (void)
 Get a character from the serial line.
int _ser_getchar_nowait (void)
 Get a character from the receiver buffer If the buffer is empty, ser_getchar_nowait() returns immediatly EOF.
int _ser_print (const char *s)
 Send a string.
void _ser_setbaudrate (unsigned long rate)
 Set the baudrate.
void _ser_purge (void)
 Dummy functions.
struct Serial_ser_open (void)
 Initialize serial.
void _ser_close (void)
 Clean up serial port, disabling the associated hardware.

Detailed Description

Simple serial I/O driver.

Version:
Id
ser_simple_avr.h 1227 2008-04-09 15:09:42Z batt
Author:
Bernardo Innocenti <bernie@develer.com>

Francesco Sacchi <batt@develer.com>

Definition in file ser_simple_avr.h.


Function Documentation

int _ser_getchar ( void   ) 

Get a character from the serial line.

If ther is no character in the buffer this function wait until one is received (no timeout).

Returns:
the character received.

Definition at line 109 of file ser_simple_avr.c.

int _ser_putchar ( int  c  ) 

Send a character over the serial line.

Returns:
the character sent.

Definition at line 82 of file ser_simple_avr.c.