00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __sys_lnp_logical_h__
00027 #define __sys_lnp_logical_h__
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033 #include "../lnp-logical.h"
00034
00035 #ifdef CONF_LNP
00036
00037 #ifndef CONF_HOST
00038 #include <time.h>
00039 #else
00040 #define MSECS_TO_TICKS(a) (a)
00041 #endif
00042
00044
00045
00046
00048
00049 #ifdef CONF_LNP_FAST
00050 #define LNP_LOGICAL_BAUD_RATE B4800
00051 #define LNP_LOGICAL_PARITY SMR_P_NONE
00052 #define LNP_BYTE_TIME MSECS_TO_TICKS(3)
00053 #else
00054 #define LNP_LOGICAL_BAUD_RATE B2400
00055 #define LNP_LOGICAL_PARITY SMR_P_ODD
00056 #define LNP_BYTE_TIME MSECS_TO_TICKS(5)
00057 #endif
00058
00059 #define LNP_BYTE_TIMEOUT (3*LNP_BYTE_TIME/2)
00060 #define LNP_BYTE_SAFE (4*LNP_BYTE_TIME)
00061
00062 #define LNP_WAIT_TXOK (2*LNP_BYTE_TIMEOUT)
00063 #define LNP_WAIT_COLL (4*LNP_BYTE_TIMEOUT)
00064
00065
00066 #define TX_COLL (-1)
00067 #define TX_IDLE ( 0)
00068 #define TX_ACTIVE ( 1)
00069
00070
00072
00073
00074
00076
00077 extern volatile signed char tx_state;
00078
00079
00081
00082
00083
00085
00087
00088 extern void lnp_logical_init(void);
00089
00090
00092
00093 extern void lnp_logical_shutdown(void);
00094
00096
00097 void txend_handler(void)
00098 #ifdef RCX_COMPILER
00099 __attribute__ ((rcx_interrupt))
00100 #endif
00101 ;
00102
00103 #endif // CONF_LNP
00104
00105 #ifdef __cplusplus
00106 }
00107 #endif
00108
00109 #endif // __sys_lnp_logical_h__
00110