tkernel_2/include/device/serialio.h | bare source | permlink (0.02 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * T-Kernel 2.0 Software Package 4: * 5: * Copyright 2011 by Ken Sakamura. 6: * This software is distributed under the latest version of T-License 2.x. 7: *---------------------------------------------------------------------- 8: * 9: * Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17. 10: * Modified by TRON Forum(http://www.tron.org/) at 2015/06/01. 11: * 12: *---------------------------------------------------------------------- 13: */ 14: 15: /* 16: * serialio.h Low-level serial I/O driver definition 17: */ 18: 19: #ifndef __DEVICE_SERIALIO_H__ 20: #define __DEVICE_SERIALIO_H__ 21: 22: #include <basic.h> 23: #include <tk/typedef.h> 24: 25: #ifdef __cplusplus 26: extern "C" { 27: #endif 28: 29: /* 30: * "serial_ctl()" request code 31: */ 32: typedef enum { 33: RS_ABORT = 0, 34: RS_SUSPEND = -200, 35: RS_RESUME = -201, 36: RS_RCVBUFSZ = -202, 37: RS_LINECTL = -203, 38: RS_EXTFUNC = -9999 /* Unsupported */ 39: } SerialControlNo; 40: 41: /* Control line ON/OFF parameter */ 42: #define RSCTL_DTR 0x00000001 /* "DTR" signal */ 43: #define RSCTL_RTS 0x00000002 /* "RTS" signal */ 44: #define RSCTL_SET 0x00000000 /* Set the all signals */ 45: #define RSCTL_ON 0xc0000000 /* Turn ON the specified signal */ 46: #define RSCTL_OFF 0x80000000 /* Turn OFF the specified signal */ 47: 48: /* 49: * Definition for interface library automatic creation (mkiflib) 50: */ 51: /*** DEFINE_IFLIB 52: [INCLUDE FILE] 53: <device/serialio.h> 54: 55: [PREFIX] 56: SERIAL 57: ***/ 58: 59: /* [BEGIN SYSCALLS] */ 60: IMPORT ER serial_in(W port, B* buf, W len, W *alen, W tmout); 61: IMPORT ER serial_out(W port, B* buf, W len, W *alen, W tmout); 62: IMPORT ER serial_ctl(W port, W kind, UW *arg); 63: /* [END SYSCALLS] */ 64: 65: #ifdef __cplusplus 66: } 67: #endif 68: #endif /* __DEVICE_SERIALIO_H__ */