00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00015
00016
00017
#ifndef _LLC_H
00018
#define _LLC_H
00019
00020
00022 #define OTTO_PACKET_PULSES_MAX 102
00023
00024
00026 struct otto_llc_pulse
00027 {
00028 unsigned int bus:4;
00029 unsigned int unused:3;
00030 unsigned int polarity:1;
00031 unsigned int length:24;
00032 };
00033
00035 enum otto_llc_symbol
00036 {
00037
OTTO_LLC_SYM_UNKNOWN = 0,
00038
OTTO_LLC_SYM_ZERO,
00039
OTTO_LLC_SYM_ONE,
00040
OTTO_LLC_SYM_SOF,
00041
OTTO_LLC_SYM_EOD,
00042
OTTO_LLC_SYM_EOF,
00043
OTTO_LLC_SYM_BRK,
00044
OTTO_LLC_SYM_NB0,
00045
OTTO_LLC_SYM_NB1,
00046
OTTO_LLC_SYM_IFS,
00047 };
00048
00049
00051 struct otto_llc_timing
00052 {
00053 int min;
00054 int nom;
00055 int max;
00056 };
00057
00058
00063 struct otto_llc_format
00064 {
00065 char *
name;
00066 char *
desc;
00067
enum otto_llc_symbol (*decode_symbol) (
struct otto_llc_pulse );
00068 int (*encode_symbol) (
struct otto_llc_pulse *,
enum otto_llc_symbol,
struct otto_llc_pulse, enum
otto_llc_symbol);
00069 };
00070
00071
00074
int
00075
otto_llc_set_busenable(
00076
unsigned int busmask
00077 );
00078
00081
int
00082
otto_llc_get_busenable(
00083
unsigned int *busmask
00084 );
00085
00088
int
00089
otto_llc_set_pulse(
00090
enum otto_llc_symbol
id,
00091
struct otto_llc_pulse pulse
00092 );
00093
00096
int
00097
otto_llc_get_pulse(
00098
enum otto_llc_symbol
id,
00099
struct otto_llc_pulse *pulse
00100 );
00101
00104
int
00105
otto_llc_decode(
00106
union otto_packet *pkt,
00107
struct otto_llc_pulse pulses[],
00108
int npulses
00109 );
00110
00113
int
00114
otto_llc_encode(
00115
union otto_packet *pkt,
00116
struct otto_llc_pulse pulses[],
00117
int *npulses
00118 );
00119
00120
00121
#endif