Clemens Valens / inc

Dependents:   SoundEngine

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers serial.h Source File

serial.h

00001 /*
00002  * @brief Serial port driver
00003  *
00004  * @note
00005  * Copyright (C) Elektor, 2014
00006  * All rights reserved.
00007  *
00008  * @par
00009  * This software is supplied "AS IS" without any warranties of any kind,
00010  * and Elektor and its licensor disclaim any and all warranties, express
00011  * or implied, including all implied warranties of merchantability,
00012  * fitness for a particular purpose and non-infringement of intellectual
00013  * property rights.  Elektor assumes no responsibility or liability for
00014  * the use of the software, conveys no license or rights under any patent,
00015  * copyright, mask work right, or any other intellectual property rights in
00016  * or to any products. Elektor reserves the right to make changes in the
00017  * software without notification. Elektor also makes no representation or
00018  * warranty that such application will be suitable for the specified use
00019  * without further testing or modification.
00020  *
00021  * @par
00022  * Permission to use, copy, modify, and distribute this software and its
00023  * documentation is hereby granted, under Elektor's and its licensor's
00024  * relevant copyrights in the software, without fee.  This copyright,
00025  * permission, and disclaimer notice must appear in all copies of this code.
00026  */
00027 
00028 #ifndef __SERIAL_H__
00029 #define __SERIAL_H__
00030 
00031 
00032 // Emulation of some Arduino Serial class methods.
00033 typedef struct
00034 {
00035     size_t (*write)(uint8_t value);
00036     int (*read)(void);
00037     void (*flush)(void);
00038     int (*available)(void);
00039     void (*begin)(uint32_t baudrate);
00040 }
00041 serial2_t;
00042 
00043 extern const serial2_t Serial;
00044 
00045 
00046 #endif // __SERIAL_H__