lnp-logical.h
Go to the documentation of this file.
1 
6 /*
7  * The contents of this file are subject to the Mozilla Public License
8  * Version 1.0 (the "License"); you may not use this file except in
9  * compliance with the License. You may obtain a copy of the License
10  * at http://www.mozilla.org/MPL/
11  *
12  * Software distributed under the License is distributed on an "AS IS"
13  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14  * the License for the specific language governing rights and
15  * limitations under the License.
16  *
17  * The Original Code is legOS code, released October 17, 1999.
18  *
19  * The Initial Developer of the Original Code is Markus L. Noga.
20  * Portions created by Markus L. Noga are Copyright (C) 1999
21  * Markus L. Noga. All Rights Reserved.
22  *
23  * Contributor(s): Markus L. Noga <markus@noga.de>
24  */
25 
26 #ifndef __lnp_logical_h__
27 #define __lnp_logical_h__
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include <config.h>
34 
35 #ifdef CONF_LNP
36 
37 #ifdef CONF_HOST
38 #include <stddef.h>
39 #else
40 #include <mem.h>
41 #include <sys/h8.h>
42 #endif
43 
45 //
46 // Functions
47 //
49 
50 #ifndef CONF_HOST
51 
62 extern inline void lnp_logical_range(int far) {
63  if(far)
64  *((char*)&PORT4) &=~1;
65  else
66  *((char*)&PORT4) |=1;
67 }
68 
70 
73 extern inline int lnp_logical_range_is_far(void) {
74  return !(*((char*)&PORT4)&1);
75 }
76 #endif
77 
79 
87 extern int lnp_logical_write(const void *buf,size_t len);
88 
90 
92 extern void lnp_logical_fflush(void);
93 
94 #endif // CONF_LNP
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif // __lnp_logical_h__
101 
Internal Interface: H8/3297 processor registers.
Interface: memory data types.
int lnp_logical_range_is_far(void)
Test the IR transmitter range setting.
Definition: lnp-logical.h:73
kernel configuration file
void lnp_logical_fflush(void)
Empty the IR receive buffer.
volatile unsigned char PORT4
port 4 I/O register
void lnp_logical_range(int far)
Set the IR transmitter range.
Definition: lnp-logical.h:62
int lnp_logical_write(const void *buf, size_t len)
Write buffer to IR port.

brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated on Sat Feb 14 2015 23:12:05 for brickOS Kernel Developer by doxygen 1.8.9.1