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 __sys_lnp_logical_h__
27
#define __sys_lnp_logical_h__
28
29
#ifdef __cplusplus
30
extern
"C"
{
31
#endif
32
33
#include "../lnp-logical.h"
34
35
#ifdef CONF_LNP
36
37
#ifndef CONF_HOST
38
#include <time.h>
39
#else
40
#define MSECS_TO_TICKS(a) (a)
41
#endif
42
44
//
45
// Definitions
46
//
48
49
#ifdef CONF_LNP_FAST
50
#define LNP_LOGICAL_BAUD_RATE B4800
51
#define LNP_LOGICAL_PARITY SMR_P_NONE
52
#define LNP_BYTE_TIME MSECS_TO_TICKS(3)
53
#else
54
#define LNP_LOGICAL_BAUD_RATE B2400
55
#define LNP_LOGICAL_PARITY SMR_P_ODD
56
#define LNP_BYTE_TIME MSECS_TO_TICKS(5)
57
#endif
58
59
#define LNP_BYTE_TIMEOUT (3*LNP_BYTE_TIME/2)
60
#define LNP_BYTE_SAFE (4*LNP_BYTE_TIME)
61
62
#define LNP_WAIT_TXOK (2*LNP_BYTE_TIMEOUT)
63
#define LNP_WAIT_COLL (4*LNP_BYTE_TIMEOUT)
64
65
66
#define TX_COLL (-1)
67
#define TX_IDLE ( 0)
68
#define TX_ACTIVE ( 1)
69
70
72
//
73
// Variables
74
//
76
77
extern
volatile
signed
char
tx_state
;
78
79
81
//
82
// Functions
83
//
85
87
//
88
extern
void
lnp_logical_init
(
void
);
89
90
92
//
93
extern
void
lnp_logical_shutdown
(
void
);
94
96
//
97
void
txend_handler
(
void
)
98
#ifdef RCX_COMPILER
99
__attribute__ ((rcx_interrupt))
100
#endif
101
;
102
103
#endif // CONF_LNP
104
105
#ifdef __cplusplus
106
}
107
#endif
108
109
#endif // __sys_lnp_logical_h__
110
txend_handler
void txend_handler(void)
Callback: end of transmission.
tx_state
volatile signed char tx_state
transmit status
lnp_logical_init
void lnp_logical_init(void)
Initialize the logical layer (IR port)
lnp_logical_shutdown
void lnp_logical_shutdown(void)
Shutdown the logical layer (IR port)
brickOS
is released under the
Mozilla Public License
.
Original code copyright 1998-2005 by the authors.
Generated for brickOS Kernel Developer by
1.8.16