re-enabling serial
[clinton/Smoothieware.git] / gcc4mbed / src / mbedsys.h
1 /* Copyright 2011 Adam Green (http://mbed.org/users/AdamGreen/)
2
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 */
15 /* Definition of _sys_*() functions and associated constants implemented in mbed/capi.ar */
16
17 #ifndef _MBEDSYS_H_
18 #define _MBEDSYS_H_
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24
25 /* Types used by functions implemented in mbed.ar */
26 typedef int FILEHANDLE;
27
28
29 /* File openmode values for mbed _sys_open() */
30 #define OPENMODE_R 0
31 #define OPENMODE_B 1
32 #define OPENMODE_PLUS 2
33 #define OPENMODE_W 4
34 #define OPENMODE_A 8
35
36
37 /* Functions implemented in mbed.ar */
38 FILEHANDLE _sys_open(const char* name, int openmode);
39 int _sys_close(FILEHANDLE fh);
40 int _sys_write(FILEHANDLE fh, const unsigned char* buf, unsigned len, int mode);
41 int _sys_read(FILEHANDLE fh, unsigned char* buf, unsigned len, int mode);
42 int _sys_seek(FILEHANDLE fh, long pos);
43 long _sys_flen(FILEHANDLE fh);
44 int _sys_istty(FILEHANDLE fh);
45
46 #ifdef __cplusplus
47 }
48 #endif
49
50 #endif /* _MBEDSYS_H_ */