1
0
mirror of https://github.com/DanielBroad/AVCSniffer synced 2025-06-06 15:36:15 +00:00

first commit

This commit is contained in:
Daniel Broad 2013-02-17 17:57:34 +00:00
commit 5763111ee3
29 changed files with 21335 additions and 0 deletions

View File

@ -0,0 +1,27 @@
ULTIBOARD DRILL REPORT
Design: AVCLAN Sniffer(AVCLAN Sniffer)
DRILL FILE SETTINGS
Excellon 2, Absolute, Inch, 2.5
DEFINITION COPPER LAYERS
Copper Top
Copper Bottom
--------------------------------------------------------------------
DRILLFILE LAMINATION
AVCLAN Sniffer(AVCLAN Sniffer) Copper Top-Copper Bottom.drl Copper Top .. Copper Bottom
TOOL SIZE COUNT
1 0.15748 1
2 0.02362 2
3 0.03500 83
4 0.03917 5
5 0.04667 3
6 0.03937 28
7 0.03333 1
8 0.11833 2

BIN
PCB/AVCLAN Sniffer.EWPrj Normal file

Binary file not shown.

1746
PCB/AVCLAN Sniffer.NT7 Normal file

File diff suppressed because it is too large Load Diff

231
PCB/AVCLAN Sniffer.cir Normal file
View File

@ -0,0 +1,231 @@
** AVCLAN Sniffer PAGE1 **
*
* Electronics Workbench
*
* This file was created by:
* Multisim to SPICE netlist routine
*
* Generated by: dbroad
* Friday, November 24 16:37:34, 2006
*
*
VDDVDD VDD 0 dc 5
VCCVCC VCC 0 dc 12
cC1 0 VCC 1.000e-005
cC7 0 VDD 2.200e-005
xU6 VCC VDD 0 LM2940T_5__VOLTAGE_REGULATOR__1
.SUBCKT LM2940T_5__VOLTAGE_REGULATOR__1 3 1 2
* Model Generated by MODPEX *
*Copyright(c) Symmetry Design Systems*
* All Rights Reserved *
* UNPUBLISHED LICENSED SOFTWARE *
* Contains Proprietary Information *
* Which is The Property of *
* SYMMETRY OR ITS LICENSORS *
*Commercial Use or Resale Restricted *
* by Symmetry License Agreement *
* Model generated on Sep 8, 97
* MODEL FORMAT: SPICE3
*Rev. Date: Dec. 20, 1994
*Positive Fixed Regulator
*External Node Designations
*node 1: VREG (OUTPUT)
*node 2: Ground (Common)
*node 3: Line Voltage
ECCX 131 2 135 2 1.0
VXX 133 2 DC 0
FSET6 2 135 VSENS2 1
FPP 3 2 VXX 1.0
R_YY 31 2 1e6
R_XX 15 2 1e8
R_ZZ 36 2 1e6
R_QQ 65 2 1e8
RXX 1 2 1e8
VSENS1 10 1 DC 0
ISET 2 15 DC 1e-3
DON1 15 16 DMOD1
VSENS2 16 19 DC 0
DON2 15 17 DMOD1
EON2 18 2 3 2 1
FYY 3 2 VSENS1 1
DON3 15 27 DMOD1
VDROP3 28 27 DC 2
EON3 28 2 3 2 4
ELINE 13 42 66 2 1
FSET2 2 36 VSENS2 1
DSC1 36 35 DMOD1
RCL1 36 37 10
DSC2 37 38 DMOD1
ESCCON 38 39 30 2 1
VSCCON 39 40 DC 0
FSC 19 2 VSCCON 1
FSET3 2 31 VSENS2 1
DOV1 31 32 DMOD1
EOV1 32 2 3 1 1
DOV2 31 33 DMOD1
ISET4 2 30 DC 1e-3
ELOAD 41 2 77 2 -1
ERIPPLE 42 41 72 2 1
EREF 12 13 19 2 1
E3 52 2 3 2 1
CBYPS 54 2 0.001
VORB 54 60 DC 0
RB 60 2 1e3
RBR 72 2 1000
CBS2 52 71 1
RSTEP 77 2 1
FRB 2 65 VORB 1
DRB2 65 67 DMOD1
VXRB 67 68 DC -1
EXRB 68 2 1 2 1
DRB1 65 66 DMOD1
RB1 66 2 1000
.MODEL DMOD1 D
*-- DMOD1 DEFAULT PARAMETERS
*IS=1e-14 RS=0 N=1 TT=0 CJO=0
*VJ=1 M=0.5 EG=1.11 XTI=3 FC=0.5
*KF=0 AF=1 BV=inf IBV=1e-3 TNOM=27
EXX 132 131 3 131 3.33333e-07
RST6 135 2 10000
RIQX 133 132 RQIX 333.333
.MODEL RQIX R TC1=-0.005
RSET 19 2 RSET 5000
.MODEL RSET R TC1=0 TC2=0
RS1 10 12 0.0368
VDROPX 18 17 -0.13
HSENSE1 35 2 VSENS1 5.26316
RISC 30 2 RISC 10000
.MODEL RISC R TC1=0
ROV 34 2 25800
VOV 33 34 5.2
EOV2 2 40 34 2 0.183599
FIQD 3 2 VSENS1 0
RY 52 54 985222
RA 72 73 9020.4
RYR 71 72 3.98007e+06
CRA 52 73 3.98975e-11
HSTEP 76 2 VSENS1 0.368
CSTEP 76 77 5.30516e-06
.ENDS lm2940t_5
** AVCLAN Sniffer PAGE2 **
*
* Electronics Workbench
*
* This file was created by:
* Multisim to SPICE netlist routine
*
* Generated by: dbroad
* Friday, November 24 16:37:34, 2006
*
*
cC14 0 50 2.2E-11
cC13 0 51 2.2E-11
xX1 51 50 CRYSTAL_HC-49/U_15MHZ__CRYSTAL__1
rR12 VDD 42 1.000e+004
cC12 9 0 1.0E-7
rR11 43 0 1.000e+003
rR10 37 41 1.000e+006
rR9 VDD 41 3.0k
rR8 0 37 1.000e+004
rR7 39 37 180
rR6 38 40 180
rR5 38 39 120
xU10_A 37 40 VDD 0 41 LM139A__COMPARATOR__1
.SUBCKT CRYSTAL_HC-49/U_15MHZ__CRYSTAL__1 1 2
* EWB Version 4 - CRYSTAL Model
* LS= 0.005 CS= 2.2e-014 RS= 10 CO= 5e-012
LS 1 3 0.005
CS 3 4 2.2e-014
RS 4 2 10
CO 1 2 5e-012
.ENDS
* LM139A VOLTAGE COMPARATOR "MACROMODEL" SUBCIRCUIT
* CREATED USING PARTS VERSION 4.03 ON 03/07/90 AT 14:17
* REV (N/A)
* CONNECTIONS: NON-INVERTING INPUT
* | INVERTING INPUT
* | | POSITIVE POWER SUPPLY
* | | | NEGATIVE POWER SUPPLY
* | | | | OPEN COLLECTOR OUTPUT
* | | | | |
.SUBCKT LM139A__COMPARATOR__1 1 2 3 4 5
*
F1 9 3 V1 1
IEE 3 7 DC 100.0E-6
VI1 21 1 DC .75
VI2 22 2 DC .75
Q1 9 21 7 QIN
Q2 8 22 7 QIN
Q3 9 8 4 QMO
Q4 8 8 4 QMI
.MODEL QIN PNP(IS=800.0E-18 BF=2.000E3)
.MODEL QMI NPN(IS=800.0E-18 BF=1002)
.MODEL QMO NPN(IS=800.0E-18 BF=1000 CJC=1E-15 TR=807.4E-9)
E1 10 4 9 4 1
V1 10 11 DC 0
Q5 5 11 4 QOC
.MODEL QOC NPN(IS=800.0E-18 BF=20.29E3 CJC=1E-15 TF=942.6E-12 TR=543.8E-9)
DP 4 3 DX
RP 3 4 46.3E3
.MODEL DX D(IS=800.0E-18)
.ENDS
** AVCLAN Sniffer PAGE3 **
*
* Electronics Workbench
*
* This file was created by:
* Multisim to SPICE netlist routine
*
* Generated by: dbroad
* Friday, November 24 16:37:34, 2006
*
*
cC5 55 0 1.000e-006
cC6 VDD 56 1.000e-006
cC3 53 54 1.000e-006
cC4 49 52 1.000e-006

Binary file not shown.

13
PCB/AVCLAN Sniffer.log Normal file
View File

@ -0,0 +1,13 @@
U13ATMEGA8DIP28-7mC61uF-POL ELKO5_5R2_5J3DSUB9MDB9SSC41uF-POL ELKO5_5R2_5R12 10kOhm_5% R0204R7_5J1HDR1X6HDR1X6U5MAX232EDIP16C1322pF
KERKO4X3R5AVCLANHDR1X2HDR1X2R1 10kOhm_5% R0204R7_5R7 180Ohm_5% R0204R7_5X1 HC-49/U_15MHz
QUARZ_HC49C1422pF
KERKO4X3R5R11
1.0kOhm_5% R0204R7_5C12100nF
KERKO5X4R5U11 PCA82C250DIP8R6 180Ohm_5% R0204R7_5PWRHDR1X2HDR1X2R5 120Ohm_5% R0204R7_5SET1HDR2X2HDR2X2C110uF-POL ELKO5R2_5U6 LM2940T-578XXHC722uF-POL ELKO5R2_5C31uF-POL ELKO5_5R2_5AVRPRG1
RIBBON_10VFKV10SNC51uF-POL ELKO5_5R2_5U1ELKO8R5ELKO5R5U122uF-POLELKO5R5U2ELKO10R5ELKO5R5U210uF-POLELKO5R5U13ATMEGA8DIP28-7mC61uF-POL ELKO5_5R2_5J3DSUB9MDB9SSC41uF-POL ELKO5_5R2_5R12 10kOhm_5% R0204R7_5U5MAX232EDIP16J1HDR1X6HDR1X6C1322pF
KERKO4X3R5AVCLANHDR1X2HDR1X2R1 10kOhm_5% R0204R7_5R7 180Ohm_5% R0204R7_5X1 HC-49/U_15MHz
QUARZ_HC49C1422pF
KERKO4X3R5R11
1.0kOhm_5% R0204R7_5C12100nF
KERKO5X4R5U11 PCA82C250DIP8R6 180Ohm_5% R0204R7_5SET1HDR2X2HDR2X2R5 120Ohm_5% R0204R7_5PWRHDR1X2HDR1X2C2 4.7uF-POLELKO5R5C1 4.7uF-POLELKO5R5U6 LM2940T-578XXHAVRPRG1
RIBBON_10VFKV10SNC31uF-POL ELKO5_5R2_5C51uF-POL ELKO5_5R2_5

BIN
PCB/AVCLAN Sniffer.ms8 Normal file

Binary file not shown.

BIN
PCB/AVCLAN Sniffer.zip Normal file

Binary file not shown.

View File

@ -0,0 +1,948 @@
G04 Generated by Ultiboard *
%FSLAX25Y25*%
%MOIN*%
%ADD10C,0.00004*%
%ADD12C,0.00394*%
%LNBoard Outline*%
%LPD*%
%FSLAX25Y25*%
%MOIN*%
G54D10*
X234000Y226000D02*
X598000Y226000D01*
X598000Y226000D02*
X598000Y406000D01*
X598000Y406000D02*
X234000Y406000D01*
X234000Y406000D02*
X234000Y226000D01*
X263874Y316000D02*
X263836Y316772D01*
X263836Y316772D02*
X263723Y317536D01*
X263723Y317536D02*
X263535Y318286D01*
X263535Y318286D02*
X263275Y319013D01*
X263275Y319013D02*
X262944Y319712D01*
X262944Y319712D02*
X262547Y320375D01*
X262547Y320375D02*
X262087Y320995D01*
X262087Y320995D02*
X261568Y321568D01*
X261568Y321568D02*
X260995Y322087D01*
X260995Y322087D02*
X260375Y322547D01*
X260375Y322547D02*
X259712Y322944D01*
X259712Y322944D02*
X259013Y323275D01*
X259013Y323275D02*
X258286Y323535D01*
X258286Y323535D02*
X257536Y323723D01*
X257536Y323723D02*
X256772Y323836D01*
X256772Y323836D02*
X256000Y323874D01*
X256000Y323874D02*
X255228Y323836D01*
X255228Y323836D02*
X254464Y323723D01*
X254464Y323723D02*
X253714Y323535D01*
X253714Y323535D02*
X252987Y323275D01*
X252987Y323275D02*
X252288Y322944D01*
X252288Y322944D02*
X251625Y322547D01*
X251625Y322547D02*
X251005Y322087D01*
X251005Y322087D02*
X250432Y321568D01*
X250432Y321568D02*
X249913Y320995D01*
X249913Y320995D02*
X249453Y320375D01*
X249453Y320375D02*
X249056Y319712D01*
X249056Y319712D02*
X248725Y319013D01*
X248725Y319013D02*
X248465Y318286D01*
X248465Y318286D02*
X248277Y317536D01*
X248277Y317536D02*
X248164Y316772D01*
X248164Y316772D02*
X248126Y316000D01*
X248126Y316000D02*
X248164Y315228D01*
X248164Y315228D02*
X248277Y314464D01*
X248277Y314464D02*
X248465Y313714D01*
X248465Y313714D02*
X248725Y312987D01*
X248725Y312987D02*
X249056Y312288D01*
X249056Y312288D02*
X249453Y311625D01*
X249453Y311625D02*
X249913Y311005D01*
X249913Y311005D02*
X250432Y310432D01*
X250432Y310432D02*
X251005Y309913D01*
X251005Y309913D02*
X251625Y309453D01*
X251625Y309453D02*
X252288Y309056D01*
X252288Y309056D02*
X252987Y308725D01*
X252987Y308725D02*
X253714Y308465D01*
X253714Y308465D02*
X254464Y308277D01*
X254464Y308277D02*
X255228Y308164D01*
X255228Y308164D02*
X256000Y308126D01*
X256000Y308126D02*
X256772Y308164D01*
X256772Y308164D02*
X257536Y308277D01*
X257536Y308277D02*
X258286Y308465D01*
X258286Y308465D02*
X259013Y308725D01*
X259013Y308725D02*
X259712Y309056D01*
X259712Y309056D02*
X260375Y309453D01*
X260375Y309453D02*
X260995Y309913D01*
X260995Y309913D02*
X261568Y310432D01*
X261568Y310432D02*
X262087Y311005D01*
X262087Y311005D02*
X262547Y311625D01*
X262547Y311625D02*
X262944Y312288D01*
X262944Y312288D02*
X263275Y312987D01*
X263275Y312987D02*
X263535Y313714D01*
X263535Y313714D02*
X263723Y314464D01*
X263723Y314464D02*
X263836Y315228D01*
X263836Y315228D02*
X263874Y316000D01*
G54D12*
X233000Y225000D02*
X233000Y243200D01*
X233000Y225000D02*
X269600Y225000D01*
X599000Y225000D02*
X562400Y225000D01*
X599000Y225000D02*
X599000Y243200D01*
X599000Y407000D02*
X599000Y388800D01*
X599000Y407000D02*
X562400Y407000D01*
X233000Y407000D02*
X269600Y407000D01*
X233000Y407000D02*
X233000Y388800D01*
X213315Y225000D02*
X173945Y225000D01*
X193630Y205315D02*
X193630Y244685D01*
X208394Y225000D02*
X208323Y226447D01*
X208323Y226447D02*
X208110Y227880D01*
X208110Y227880D02*
X207758Y229286D01*
X207758Y229286D02*
X207270Y230650D01*
X207270Y230650D02*
X206650Y231960D01*
X206650Y231960D02*
X205906Y233202D01*
X205906Y233202D02*
X205042Y234366D01*
X205042Y234366D02*
X204069Y235440D01*
X204069Y235440D02*
X202996Y236413D01*
X202996Y236413D02*
X201832Y237276D01*
X201832Y237276D02*
X200590Y238020D01*
X200590Y238020D02*
X199280Y238640D01*
X199280Y238640D02*
X197916Y239128D01*
X197916Y239128D02*
X196510Y239480D01*
X196510Y239480D02*
X195077Y239693D01*
X195077Y239693D02*
X193630Y239764D01*
X193630Y239764D02*
X192183Y239693D01*
X192183Y239693D02*
X190750Y239480D01*
X190750Y239480D02*
X189344Y239128D01*
X189344Y239128D02*
X187980Y238640D01*
X187980Y238640D02*
X186670Y238020D01*
X186670Y238020D02*
X185428Y237276D01*
X185428Y237276D02*
X184264Y236413D01*
X184264Y236413D02*
X183190Y235440D01*
X183190Y235440D02*
X182217Y234366D01*
X182217Y234366D02*
X181354Y233202D01*
X181354Y233202D02*
X180609Y231960D01*
X180609Y231960D02*
X179990Y230650D01*
X179990Y230650D02*
X179502Y229286D01*
X179502Y229286D02*
X179150Y227880D01*
X179150Y227880D02*
X178937Y226447D01*
X178937Y226447D02*
X178866Y225000D01*
X178866Y225000D02*
X178937Y223553D01*
X178937Y223553D02*
X179150Y222120D01*
X179150Y222120D02*
X179502Y220714D01*
X179502Y220714D02*
X179990Y219350D01*
X179990Y219350D02*
X180609Y218040D01*
X180609Y218040D02*
X181354Y216798D01*
X181354Y216798D02*
X182217Y215634D01*
X182217Y215634D02*
X183190Y214560D01*
X183190Y214560D02*
X184264Y213587D01*
X184264Y213587D02*
X185428Y212724D01*
X185428Y212724D02*
X186670Y211980D01*
X186670Y211980D02*
X187980Y211360D01*
X187980Y211360D02*
X189344Y210872D01*
X189344Y210872D02*
X190750Y210520D01*
X190750Y210520D02*
X192183Y210307D01*
X192183Y210307D02*
X193630Y210236D01*
X193630Y210236D02*
X195077Y210307D01*
X195077Y210307D02*
X196510Y210520D01*
X196510Y210520D02*
X197916Y210872D01*
X197916Y210872D02*
X199280Y211360D01*
X199280Y211360D02*
X200590Y211980D01*
X200590Y211980D02*
X201832Y212724D01*
X201832Y212724D02*
X202996Y213587D01*
X202996Y213587D02*
X204069Y214560D01*
X204069Y214560D02*
X205042Y215634D01*
X205042Y215634D02*
X205906Y216798D01*
X205906Y216798D02*
X206650Y218040D01*
X206650Y218040D02*
X207270Y219350D01*
X207270Y219350D02*
X207758Y220714D01*
X207758Y220714D02*
X208110Y222120D01*
X208110Y222120D02*
X208323Y223553D01*
X208323Y223553D02*
X208394Y225000D01*
X618685Y225000D02*
X658055Y225000D01*
X638370Y205315D02*
X638370Y244685D01*
X653134Y225000D02*
X653063Y226447D01*
X653063Y226447D02*
X652850Y227880D01*
X652850Y227880D02*
X652498Y229286D01*
X652498Y229286D02*
X652010Y230650D01*
X652010Y230650D02*
X651391Y231960D01*
X651391Y231960D02*
X650646Y233202D01*
X650646Y233202D02*
X649783Y234366D01*
X649783Y234366D02*
X648810Y235440D01*
X648810Y235440D02*
X647736Y236413D01*
X647736Y236413D02*
X646572Y237276D01*
X646572Y237276D02*
X645330Y238020D01*
X645330Y238020D02*
X644020Y238640D01*
X644020Y238640D02*
X642656Y239128D01*
X642656Y239128D02*
X641250Y239480D01*
X641250Y239480D02*
X639817Y239693D01*
X639817Y239693D02*
X638370Y239764D01*
X638370Y239764D02*
X636923Y239693D01*
X636923Y239693D02*
X635490Y239480D01*
X635490Y239480D02*
X634084Y239128D01*
X634084Y239128D02*
X632720Y238640D01*
X632720Y238640D02*
X631410Y238020D01*
X631410Y238020D02*
X630168Y237276D01*
X630168Y237276D02*
X629004Y236413D01*
X629004Y236413D02*
X627931Y235440D01*
X627931Y235440D02*
X626958Y234366D01*
X626958Y234366D02*
X626094Y233202D01*
X626094Y233202D02*
X625350Y231960D01*
X625350Y231960D02*
X624730Y230650D01*
X624730Y230650D02*
X624242Y229286D01*
X624242Y229286D02*
X623890Y227880D01*
X623890Y227880D02*
X623677Y226447D01*
X623677Y226447D02*
X623606Y225000D01*
X623606Y225000D02*
X623677Y223553D01*
X623677Y223553D02*
X623890Y222120D01*
X623890Y222120D02*
X624242Y220714D01*
X624242Y220714D02*
X624730Y219350D01*
X624730Y219350D02*
X625350Y218040D01*
X625350Y218040D02*
X626094Y216798D01*
X626094Y216798D02*
X626958Y215634D01*
X626958Y215634D02*
X627931Y214560D01*
X627931Y214560D02*
X629004Y213587D01*
X629004Y213587D02*
X630168Y212724D01*
X630168Y212724D02*
X631410Y211980D01*
X631410Y211980D02*
X632720Y211360D01*
X632720Y211360D02*
X634084Y210872D01*
X634084Y210872D02*
X635490Y210520D01*
X635490Y210520D02*
X636923Y210307D01*
X636923Y210307D02*
X638370Y210236D01*
X638370Y210236D02*
X639817Y210307D01*
X639817Y210307D02*
X641250Y210520D01*
X641250Y210520D02*
X642656Y210872D01*
X642656Y210872D02*
X644020Y211360D01*
X644020Y211360D02*
X645330Y211980D01*
X645330Y211980D02*
X646572Y212724D01*
X646572Y212724D02*
X647736Y213587D01*
X647736Y213587D02*
X648810Y214560D01*
X648810Y214560D02*
X649783Y215634D01*
X649783Y215634D02*
X650646Y216798D01*
X650646Y216798D02*
X651391Y218040D01*
X651391Y218040D02*
X652010Y219350D01*
X652010Y219350D02*
X652498Y220714D01*
X652498Y220714D02*
X652850Y222120D01*
X652850Y222120D02*
X653063Y223553D01*
X653063Y223553D02*
X653134Y225000D01*
X643291Y225000D02*
X643268Y225482D01*
X643268Y225482D02*
X643197Y225960D01*
X643197Y225960D02*
X643079Y226429D01*
X643079Y226429D02*
X642917Y226883D01*
X642917Y226883D02*
X642710Y227320D01*
X642710Y227320D02*
X642462Y227734D01*
X642462Y227734D02*
X642174Y228122D01*
X642174Y228122D02*
X641850Y228480D01*
X641850Y228480D02*
X641492Y228804D01*
X641492Y228804D02*
X641104Y229092D01*
X641104Y229092D02*
X640690Y229340D01*
X640690Y229340D02*
X640253Y229547D01*
X640253Y229547D02*
X639799Y229709D01*
X639799Y229709D02*
X639330Y229827D01*
X639330Y229827D02*
X638852Y229898D01*
X638852Y229898D02*
X638370Y229921D01*
X638370Y229921D02*
X637888Y229898D01*
X637888Y229898D02*
X637410Y229827D01*
X637410Y229827D02*
X636942Y229709D01*
X636942Y229709D02*
X636487Y229547D01*
X636487Y229547D02*
X636050Y229340D01*
X636050Y229340D02*
X635636Y229092D01*
X635636Y229092D02*
X635248Y228804D01*
X635248Y228804D02*
X634890Y228480D01*
X634890Y228480D02*
X634566Y228122D01*
X634566Y228122D02*
X634278Y227734D01*
X634278Y227734D02*
X634030Y227320D01*
X634030Y227320D02*
X633823Y226883D01*
X633823Y226883D02*
X633661Y226429D01*
X633661Y226429D02*
X633543Y225960D01*
X633543Y225960D02*
X633473Y225482D01*
X633473Y225482D02*
X633449Y225000D01*
X633449Y225000D02*
X633473Y224518D01*
X633473Y224518D02*
X633543Y224040D01*
X633543Y224040D02*
X633661Y223571D01*
X633661Y223571D02*
X633823Y223117D01*
X633823Y223117D02*
X634030Y222680D01*
X634030Y222680D02*
X634278Y222266D01*
X634278Y222266D02*
X634566Y221878D01*
X634566Y221878D02*
X634890Y221520D01*
X634890Y221520D02*
X635248Y221196D01*
X635248Y221196D02*
X635636Y220908D01*
X635636Y220908D02*
X636050Y220660D01*
X636050Y220660D02*
X636487Y220453D01*
X636487Y220453D02*
X636942Y220291D01*
X636942Y220291D02*
X637410Y220173D01*
X637410Y220173D02*
X637888Y220102D01*
X637888Y220102D02*
X638370Y220079D01*
X638370Y220079D02*
X638852Y220102D01*
X638852Y220102D02*
X639330Y220173D01*
X639330Y220173D02*
X639799Y220291D01*
X639799Y220291D02*
X640253Y220453D01*
X640253Y220453D02*
X640690Y220660D01*
X640690Y220660D02*
X641104Y220908D01*
X641104Y220908D02*
X641492Y221196D01*
X641492Y221196D02*
X641850Y221520D01*
X641850Y221520D02*
X642174Y221878D01*
X642174Y221878D02*
X642462Y222266D01*
X642462Y222266D02*
X642710Y222680D01*
X642710Y222680D02*
X642917Y223117D01*
X642917Y223117D02*
X643079Y223571D01*
X643079Y223571D02*
X643197Y224040D01*
X643197Y224040D02*
X643268Y224518D01*
X643268Y224518D02*
X643291Y225000D01*
X213315Y407000D02*
X173945Y407000D01*
X193630Y387315D02*
X193630Y426685D01*
X208394Y407000D02*
X208323Y408447D01*
X208323Y408447D02*
X208110Y409880D01*
X208110Y409880D02*
X207758Y411286D01*
X207758Y411286D02*
X207270Y412650D01*
X207270Y412650D02*
X206650Y413960D01*
X206650Y413960D02*
X205906Y415202D01*
X205906Y415202D02*
X205042Y416366D01*
X205042Y416366D02*
X204069Y417440D01*
X204069Y417440D02*
X202996Y418413D01*
X202996Y418413D02*
X201832Y419276D01*
X201832Y419276D02*
X200590Y420020D01*
X200590Y420020D02*
X199280Y420640D01*
X199280Y420640D02*
X197916Y421128D01*
X197916Y421128D02*
X196510Y421480D01*
X196510Y421480D02*
X195077Y421693D01*
X195077Y421693D02*
X193630Y421764D01*
X193630Y421764D02*
X192183Y421693D01*
X192183Y421693D02*
X190750Y421480D01*
X190750Y421480D02*
X189344Y421128D01*
X189344Y421128D02*
X187980Y420640D01*
X187980Y420640D02*
X186670Y420020D01*
X186670Y420020D02*
X185428Y419276D01*
X185428Y419276D02*
X184264Y418413D01*
X184264Y418413D02*
X183190Y417440D01*
X183190Y417440D02*
X182217Y416366D01*
X182217Y416366D02*
X181354Y415202D01*
X181354Y415202D02*
X180609Y413960D01*
X180609Y413960D02*
X179990Y412650D01*
X179990Y412650D02*
X179502Y411286D01*
X179502Y411286D02*
X179150Y409880D01*
X179150Y409880D02*
X178937Y408447D01*
X178937Y408447D02*
X178866Y407000D01*
X178866Y407000D02*
X178937Y405553D01*
X178937Y405553D02*
X179150Y404120D01*
X179150Y404120D02*
X179502Y402714D01*
X179502Y402714D02*
X179990Y401350D01*
X179990Y401350D02*
X180609Y400040D01*
X180609Y400040D02*
X181354Y398798D01*
X181354Y398798D02*
X182217Y397634D01*
X182217Y397634D02*
X183190Y396560D01*
X183190Y396560D02*
X184264Y395587D01*
X184264Y395587D02*
X185428Y394724D01*
X185428Y394724D02*
X186670Y393980D01*
X186670Y393980D02*
X187980Y393360D01*
X187980Y393360D02*
X189344Y392872D01*
X189344Y392872D02*
X190750Y392520D01*
X190750Y392520D02*
X192183Y392307D01*
X192183Y392307D02*
X193630Y392236D01*
X193630Y392236D02*
X195077Y392307D01*
X195077Y392307D02*
X196510Y392520D01*
X196510Y392520D02*
X197916Y392872D01*
X197916Y392872D02*
X199280Y393360D01*
X199280Y393360D02*
X200590Y393980D01*
X200590Y393980D02*
X201832Y394724D01*
X201832Y394724D02*
X202996Y395587D01*
X202996Y395587D02*
X204069Y396560D01*
X204069Y396560D02*
X205042Y397634D01*
X205042Y397634D02*
X205906Y398798D01*
X205906Y398798D02*
X206650Y400040D01*
X206650Y400040D02*
X207270Y401350D01*
X207270Y401350D02*
X207758Y402714D01*
X207758Y402714D02*
X208110Y404120D01*
X208110Y404120D02*
X208323Y405553D01*
X208323Y405553D02*
X208394Y407000D01*
X203472Y407000D02*
X203425Y407965D01*
X203425Y407965D02*
X203283Y408920D01*
X203283Y408920D02*
X203049Y409857D01*
X203049Y409857D02*
X202723Y410767D01*
X202723Y410767D02*
X202310Y411640D01*
X202310Y411640D02*
X201814Y412468D01*
X201814Y412468D02*
X201238Y413244D01*
X201238Y413244D02*
X200590Y413960D01*
X200590Y413960D02*
X199874Y414608D01*
X199874Y414608D02*
X199098Y415184D01*
X199098Y415184D02*
X198270Y415680D01*
X198270Y415680D02*
X197396Y416093D01*
X197396Y416093D02*
X196487Y416419D01*
X196487Y416419D02*
X195550Y416653D01*
X195550Y416653D02*
X194595Y416795D01*
X194595Y416795D02*
X193630Y416843D01*
X193630Y416843D02*
X192665Y416795D01*
X192665Y416795D02*
X191710Y416653D01*
X191710Y416653D02*
X190773Y416419D01*
X190773Y416419D02*
X189863Y416093D01*
X189863Y416093D02*
X188990Y415680D01*
X188990Y415680D02*
X188162Y415184D01*
X188162Y415184D02*
X187386Y414608D01*
X187386Y414608D02*
X186670Y413960D01*
X186670Y413960D02*
X186022Y413244D01*
X186022Y413244D02*
X185446Y412468D01*
X185446Y412468D02*
X184950Y411640D01*
X184950Y411640D02*
X184537Y410767D01*
X184537Y410767D02*
X184211Y409857D01*
X184211Y409857D02*
X183977Y408920D01*
X183977Y408920D02*
X183835Y407965D01*
X183835Y407965D02*
X183787Y407000D01*
X183787Y407000D02*
X183835Y406035D01*
X183835Y406035D02*
X183977Y405080D01*
X183977Y405080D02*
X184211Y404143D01*
X184211Y404143D02*
X184537Y403233D01*
X184537Y403233D02*
X184950Y402360D01*
X184950Y402360D02*
X185446Y401532D01*
X185446Y401532D02*
X186022Y400756D01*
X186022Y400756D02*
X186670Y400040D01*
X186670Y400040D02*
X187386Y399392D01*
X187386Y399392D02*
X188162Y398816D01*
X188162Y398816D02*
X188990Y398320D01*
X188990Y398320D02*
X189863Y397907D01*
X189863Y397907D02*
X190773Y397581D01*
X190773Y397581D02*
X191710Y397347D01*
X191710Y397347D02*
X192665Y397205D01*
X192665Y397205D02*
X193630Y397157D01*
X193630Y397157D02*
X194595Y397205D01*
X194595Y397205D02*
X195550Y397347D01*
X195550Y397347D02*
X196487Y397581D01*
X196487Y397581D02*
X197396Y397907D01*
X197396Y397907D02*
X198270Y398320D01*
X198270Y398320D02*
X199098Y398816D01*
X199098Y398816D02*
X199874Y399392D01*
X199874Y399392D02*
X200590Y400040D01*
X200590Y400040D02*
X201238Y400756D01*
X201238Y400756D02*
X201814Y401532D01*
X201814Y401532D02*
X202310Y402360D01*
X202310Y402360D02*
X202723Y403233D01*
X202723Y403233D02*
X203049Y404143D01*
X203049Y404143D02*
X203283Y405080D01*
X203283Y405080D02*
X203425Y406035D01*
X203425Y406035D02*
X203472Y407000D01*
X198551Y407000D02*
X198527Y407482D01*
X198527Y407482D02*
X198457Y407960D01*
X198457Y407960D02*
X198339Y408429D01*
X198339Y408429D02*
X198177Y408883D01*
X198177Y408883D02*
X197970Y409320D01*
X197970Y409320D02*
X197722Y409734D01*
X197722Y409734D02*
X197434Y410122D01*
X197434Y410122D02*
X197110Y410480D01*
X197110Y410480D02*
X196752Y410804D01*
X196752Y410804D02*
X196364Y411092D01*
X196364Y411092D02*
X195950Y411340D01*
X195950Y411340D02*
X195513Y411547D01*
X195513Y411547D02*
X195058Y411709D01*
X195058Y411709D02*
X194590Y411827D01*
X194590Y411827D02*
X194112Y411898D01*
X194112Y411898D02*
X193630Y411921D01*
X193630Y411921D02*
X193148Y411898D01*
X193148Y411898D02*
X192670Y411827D01*
X192670Y411827D02*
X192201Y411709D01*
X192201Y411709D02*
X191747Y411547D01*
X191747Y411547D02*
X191310Y411340D01*
X191310Y411340D02*
X190896Y411092D01*
X190896Y411092D02*
X190508Y410804D01*
X190508Y410804D02*
X190150Y410480D01*
X190150Y410480D02*
X189826Y410122D01*
X189826Y410122D02*
X189538Y409734D01*
X189538Y409734D02*
X189290Y409320D01*
X189290Y409320D02*
X189083Y408883D01*
X189083Y408883D02*
X188921Y408429D01*
X188921Y408429D02*
X188803Y407960D01*
X188803Y407960D02*
X188732Y407482D01*
X188732Y407482D02*
X188709Y407000D01*
X188709Y407000D02*
X188732Y406518D01*
X188732Y406518D02*
X188803Y406040D01*
X188803Y406040D02*
X188921Y405571D01*
X188921Y405571D02*
X189083Y405117D01*
X189083Y405117D02*
X189290Y404680D01*
X189290Y404680D02*
X189538Y404266D01*
X189538Y404266D02*
X189826Y403878D01*
X189826Y403878D02*
X190150Y403520D01*
X190150Y403520D02*
X190508Y403196D01*
X190508Y403196D02*
X190896Y402908D01*
X190896Y402908D02*
X191310Y402660D01*
X191310Y402660D02*
X191747Y402453D01*
X191747Y402453D02*
X192201Y402291D01*
X192201Y402291D02*
X192670Y402173D01*
X192670Y402173D02*
X193148Y402102D01*
X193148Y402102D02*
X193630Y402079D01*
X193630Y402079D02*
X194112Y402102D01*
X194112Y402102D02*
X194590Y402173D01*
X194590Y402173D02*
X195058Y402291D01*
X195058Y402291D02*
X195513Y402453D01*
X195513Y402453D02*
X195950Y402660D01*
X195950Y402660D02*
X196364Y402908D01*
X196364Y402908D02*
X196752Y403196D01*
X196752Y403196D02*
X197110Y403520D01*
X197110Y403520D02*
X197434Y403878D01*
X197434Y403878D02*
X197722Y404266D01*
X197722Y404266D02*
X197970Y404680D01*
X197970Y404680D02*
X198177Y405117D01*
X198177Y405117D02*
X198339Y405571D01*
X198339Y405571D02*
X198457Y406040D01*
X198457Y406040D02*
X198527Y406518D01*
X198527Y406518D02*
X198551Y407000D01*
M00*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,149 @@
M48
INCH,TZ
VER,1
FMAT,2
DETECT,ON
ATC,ON
T1C0.15748
T2C0.02362
T3C0.03500
T4C0.03917
T5C0.04667
T6C0.03937
T7C0.03333
T8C0.11833
%
T1
X2.56000Y3.16000
T2
X3.18125Y2.69375
X3.08125Y3.09375
T3
X5.21408Y3.63921
X5.11408
X4.98000Y3.28000
Y3.38000
X5.00000Y2.52000
X4.90000
X5.00000Y2.82000
X4.90000
Y2.72000
Y2.62000
X5.00000
Y2.72000
Y2.92000
X2.39310Y3.84980
X2.59310
X2.40000Y3.56000
X2.60000
X3.54000Y2.72000
X4.24000Y2.46000
Y2.56000
X4.34000
X3.16000Y2.54000
Y2.84000
X2.88000Y2.46000
X3.16000Y2.46000
X3.46000
X3.04000Y3.76000
Y3.66000
Y3.96000
Y3.86000
X2.74000Y3.76000
Y3.66000
Y3.96000
Y3.86000
X2.88000Y3.14000
Y3.34000
X2.74000Y3.48000
X3.04000
X3.48000Y3.20833
Y3.40000
X3.66000Y3.18000
Y3.38000
X3.48000Y2.92000
X3.18000
X3.66000Y2.66000
Y2.96000
X3.30000Y3.22000
Y3.42000
X4.72000Y3.22000
Y3.32000
Y3.62000
Y3.42000
Y3.52000
Y3.72000
Y3.92000
Y3.82000
X4.42000Y3.22000
Y3.52000
Y3.32000
Y3.42000
Y3.72000
Y3.62000
Y3.82000
Y3.92000
X4.20000Y3.44000
Y3.34000
Y3.64000
Y3.54000
Y3.74000
X4.54000Y2.82000
Y3.12000
X4.90000Y3.62000
Y3.52000
X5.66000Y3.40250
Y3.18417
Y3.29333
Y3.07500
X5.56000Y3.12917
Y3.45667
Y3.34750
Y3.23833
X5.16000Y3.26000
X5.26000
T4
X4.90000Y2.92000
X3.54000Y2.62000
X4.34000Y2.46000
X2.88000Y2.56000
X4.20000Y3.24000
T5
X2.56000Y2.44000
X2.46000
X2.66000
T6
X4.07559Y2.56000
X3.80000Y2.46000
X4.07559
X3.80000Y3.76000
Y3.66000
Y3.56000
Y3.46000
Y3.26000
Y3.36000
Y3.16000
Y2.96000
Y3.06000
Y2.86000
Y2.76000
Y2.66000
Y2.56000
X4.07559Y3.76000
Y3.16000
Y2.96000
Y3.06000
Y2.86000
Y2.66000
Y2.76000
Y3.46000
Y3.66000
Y3.56000
Y3.26000
Y3.36000
T7
X5.56000Y3.02000
T8
X5.61000Y3.73083
Y2.74667
M30

View File

@ -0,0 +1,27 @@
ULTIBOARD DRILL REPORT
Design: AVCLAN Sniffer(AVCLAN Sniffer)
DRILL FILE SETTINGS
Excellon 2, Absolute, Inch, 2.5
DEFINITION COPPER LAYERS
Copper Top
Copper Bottom
--------------------------------------------------------------------
DRILLFILE LAMINATION
AVCLAN Sniffer(AVCLAN Sniffer) Copper Top-Copper Bottom.drl Copper Top .. Copper Bottom
TOOL SIZE COUNT
1 0.15748 1
2 0.02362 3
3 0.03500 83
4 0.03917 5
5 0.04667 3
6 0.03937 28
7 0.03333 1
8 0.11833 2

1110
avclandrv.c Executable file

File diff suppressed because it is too large Load Diff

125
avclandrv.h Executable file
View File

@ -0,0 +1,125 @@
/*
Copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
This file is part of
TOYOTA AVC-Lan CD-Changer Emulator
*/
/*
Copyright (C) 2006 Daniel Broad <daniel@dorada.co.uk>.
-----------------------------------------------------------------------
this file is a part of the Lexus iPod Project
-----------------------------------------------------------------------
http://www.lexusipod.com
*/
#ifndef __AVCLANDRV_H
#define __AVCLANDRV_H
//------------------------------------------------------------------------------
#include "const.h"
u08 AVCLan_Read_Message();
void AVCLan_Send_Status();
void AVCLan_Init();
u08 AVCLan_Send_Changer_Status();
#define MAXMSGLEN 32//32
// MY AVCLAN ID
#define MY_ID_1 0x03
#define MY_ID_2 0x60
#define cmNull 0
#define cmStatus1 1
#define cmStatus2 2
#define cmStatus3 3
#define cmStatus4 4
#define cmPlayReq1 5
#define cmPlayReq2 6
#define cmPlayReq3 7
#define cmStopReq 8
#define cmStopReq2 9
#define cmPlayReq4 10
#define cmRegister 100
#define cmInit 101
#define cmCheck 102
#define cmPlayIt 103
#define cmInitv11 104
#define cmBeep 110
#define cmVolZero 111
#define cmDiscStatus 112
#define cmTrackDiscStatus 113
#define cmNoCart 114
#define cmCartStatus 115
typedef enum { stStop, stPlay, stFF, stRR } cd_modes;
cd_modes CD_Mode;
#define stNoDiscs 0x00
#define stAllDiscs 0x3f
#define stDisc6 0x32
#define stDisc5 0x16
#define stDisc4 0x08
#define stDisc3 0x04
#define stDisc2 0x02
#define stDisc1 0x01
u08 Changer_Mode;
u08 broadcast;
u08 master1;
u08 master2;
u08 slave1;
u08 slave2;
u08 message_len;
u08 message[MAXMSGLEN];
u08 data_control;
u08 data_len;
u08 data[MAXMSGLEN];
u08 AVCLan_SendData(u08 m1, u08 m2);
u08 AVCLan_SendAnswer();
u08 AVCLan_SendDataBroadcast();
u08 HexInc(u08 data);
u08 HexDec(u08 data);
u08 cd_Disc;
u08 cd_Track;
u08 cd_Time_Min;
u08 cd_Time_Sec;
u08 randomMode;
u08 repeatMode;
u08 masterDevice1;
u08 masterDevice2;
u08 maxDisc;
//------------------------------------------------------------------------------
u08 answerReq;
//------------------------------------------------------------------------------
#define eeprombase 0
#define EEPROM_MasterDevice1 (uint8_t*)eeprombase+0
#define EEPROM_MasterDevice2 (uint8_t*)eeprombase+1
#define EEPROM_AVCVersion (uint8_t*)eeprombase+2
#define EEPROM_UnknownCommand (uint8_t*)eeprombase+16
#endif

145
com232.c Executable file
View File

@ -0,0 +1,145 @@
/*
Copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------
this file is a part of the TOYOTA Corolla MP3 Player Project
-----------------------------------------------------------------------
http://www.softservice.com.pl/corolla/avc
*/
#include <avr/io.h>
#include <avr/signal.h>
#include "com232.h"
#include "delay.h"
//#include "buffer.h"
//static cBuffer uartTxBuffer;
//#define UART_TX_BUFFER_SIZE 0x0080
//static char uartTxData[UART_TX_BUFFER_SIZE];
//------------------------------------------------------------------------------
void RS232_Init(void)
{
// RS232_RxCharBegin = RS232_RxCharEnd = 0;
// enable RxD/TxD and interrupts
//bufferInit(&uartTxBuffer, uartTxData, UART_TX_BUFFER_SIZE);
outb(UCSRB, UART_FLAGS);
#ifdef MONITOR
{
outb(UBRRH, (u08)(UART_BAUD_SELECT>>8)); // set baud rate
outb(UBRRL, (u08)UART_BAUD_SELECT);
}
#else
{
outb(UBRRH, (u08)(UART_BAUD_SELECT_IPOD>>8)); // set baud rate
outb(UBRRL, (u08)UART_BAUD_SELECT_IPOD);
}
#endif
}
SIGNAL(SIG_UART_RECV)
{
u08 USARTstatus = UCSRA;
while ((USARTstatus & (1<<RXC)))
{
USARTstatus = UCSRA;
}
}
//------------------------------------------------------------------------------
void RS232_ActallySendByte(u08 Data)
{
while ((inb(UCSRA) & _BV(UDRE)) != _BV(UDRE)); // wait for UART to become available
outb(UDR, Data); // send character
};
void RS232_SendByte(u08 Data)
{
RS232_ActallySendByte(Data);
}
//------------------------------------------------------------------------------
void RS232_Print(u08* pBuf)
{
register u08 c;
while ((c = *pBuf++))
{
if (c == '\n')
{
RS232_SendByte('\r');
};
RS232_SendByte(c);
delay1(20);
}
}
//------------------------------------------------------------------------------
void RS232_PrintHex4(u08 Data)
{
u08 Character = Data & 0x0f;
Character += '0';
if (Character > '9')
Character += 'A' - '0' - 10;
RS232_SendByte(Character);
}
//------------------------------------------------------------------------------
void RS232_PrintHex8(u08 Data)
{
RS232_PrintHex4(Data >> 4);
RS232_PrintHex4(Data);
}
//------------------------------------------------------------------------------
void RS232_PrintDec(u08 Data)
{
if (Data>99) {
RS232_SendByte('*');
return;
}
if (Data<10) {
RS232_SendByte('0'+Data);
return;
}
u08 c;
u16 v,v1;
v = Data;
v1 = v/10;
c = '0' + (v-v1*10);
RS232_SendByte('0'+v1);
RS232_SendByte(c);
}
//------------------------------------------------------------------------------
void RS232_PrintDec2(u08 Data)
{
if (Data<10) RS232_SendByte('0');
RS232_PrintDec(Data);
}
//------------------------------------------------------------------------------
void RS232_SendStuff()
{
if ((inb(UCSRA) & _BV(UDRE)) != _BV(UDRE)) return;
//u08 Data;
//Data = bufferGetFromFront(&uartTxBuffer);
//if (Data)
//RS232_ActallySendByte(Data);
}

61
com232.h Executable file
View File

@ -0,0 +1,61 @@
/*
Copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------
this file is a part of the TOYOTA Corolla MP3 Player Project
-----------------------------------------------------------------------
http://www.softservice.com.pl/corolla/avc
*/
#ifndef __COM232_H
#define __COM232_H
//------------------------------------------------------------------------------
#include "const.h"
#include "buffer.h"
//------------------------------------------------------------------------------
#define UART_CPU F_CPU
#define UART_BAUD_RATE_IPOD 19200
#define UART_BAUD_SELECT_IPOD 47//((UART_CPU / (UART_BAUD_RATE_IPOD * 16L)) - 1)
#define UART_BAUD_RATE 115200
#define UART_BAUD_SELECT ((UART_CPU / (UART_BAUD_RATE * 16L)) - 1)
#define UART_FLAGS2 (_BV(RXCIE) | _BV(RXEN) | _BV(TXEN))
#define UART_FLAGS (_BV(TXEN))
//------------------------------------------------------------------------------
void RS232_Init(void);
extern void RS232_SendByte(u08 Data);
extern void RS232_Print(u08* pBuf);
extern void RS232_PrintHex4(u08 Data);
extern void RS232_PrintHex8(u08 Data);
extern void RS232_PrintDec(u08 Data);
extern void RS232_PrintDec2(u08 Data);
extern void RS232_ClearInBuffer();
void RS232_SendStuff();
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#endif

65
const.h Executable file
View File

@ -0,0 +1,65 @@
/*
Copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
This file is part of
TOYOTA AVC-Lan CD-Changer Emulator
*/
#ifndef __CONTS_H
#define __CONST_H
#define SNIFFER
#define MONITOR
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define u08 unsigned char
#define u16 unsigned short
#define u32 unsigned int
//------------------------------------------------------------------------------
#define DATAOUT_DDR DDRD
#define DATAOUT_PORT PORTD
#define DATAOUT_PIN PIND
#define DATAOUT 5
#define INPUT_IS_SET (inb(ACSR)&_BV(ACO))
#define INPUT_IS_CLEAR (!(inb(ACSR)&_BV(ACO)))
// status event every 1 sec
#define TI1_H (((u16)-(F_CPU / 1024)) >> 8)
#define TI1_L (((u16)-(F_CPU / 1024)) & 0xff )
#define STOPEvent cli(); //cbi(TIMSK, TOIE1); cbi(UCSRB, RXCIE);
#define STARTEvent sei(); //sbi(TIMSK, TOIE1); sbi(UCSRB, RXCIE);
u08 AuxInput;
volatile u08 Event;
#define EV_NOTHING 0
#define EV_DISPLAY 1
#define EV_STATUS 4
#define versionMajor 1
#define versionMinor 0
void SwitchInputs();
//------------------------------------------------------------------------------
#endif

60
delay.c Executable file
View File

@ -0,0 +1,60 @@
/*
Precise Delay Functions
V 0.5, Martin Thomas, 9/2004
In the original Code from Peter Dannegger a timer-interrupt
driven "timebase" has been used for precise One-Wire-Delays.
My loop-approach is less elegant but may be more usable
as library-function. Since it's not "timer-dependent"
See also delay.h.
Inspired by the avr-libc's loop-code
*/
#include <avr/io.h>
#include <avr/io.h>
//#include <avr/timer.h>
#include <inttypes.h>
#include "delay.h"
void delayloop32(uint32_t loops)
{
__asm__ volatile ( "cp %A0,__zero_reg__ \n\t" \
"cpc %B0,__zero_reg__ \n\t" \
"cpc %C0,__zero_reg__ \n\t" \
"cpc %D0,__zero_reg__ \n\t" \
"breq L_Exit_%= \n\t" \
"L_LOOP_%=: \n\t" \
"subi %A0,1 \n\t" \
"sbci %B0,0 \n\t" \
"sbci %C0,0 \n\t" \
"sbci %D0,0 \n\t" \
"brne L_LOOP_%= \n\t" \
"L_Exit_%=: \n\t" \
: "=w" (loops) \
: "0" (loops) \
); \
return;
}
//------------------------------------------------------------------------------
#define COUNT_FOR_1US 2
void delay1(u16 count)
{
count *= (COUNT_FOR_1US);
while (count-- != 0);
}
//------------------------------------------------------------------------------
//void delay1us(volatile u08 delay, u08 count)
//{
// timer0_source(CK);
//while (count-- !=0)
//{
//timer0_start();
//while (inb(TCNT0) < delay);
//
//}
//}
//------------------------------------------------------------------------------

40
delay.h Executable file
View File

@ -0,0 +1,40 @@
#ifndef _delay_h_
#define _delay_h_
#include <inttypes.h>
#include <avr/io.h>
#include "const.h"
/* delay function for microsec
4 cpu cycles per loop + 1 cycles(?) overhead
when a constant is passed. */
static inline void delayloop16(uint16_t count)
{
asm volatile ( "cp %A0,__zero_reg__ \n\t" \
"cpc %B0,__zero_reg__ \n\t" \
"breq L_Exit_%= \n\t" \
"L_LOOP_%=: \n\t" \
"sbiw %0,1 \n\t" \
"brne L_LOOP_%= \n\t" \
"L_Exit_%=: \n\t" \
: "=w" (count)
: "0" (count)
);
}
// delayloop16(x) eats 4 cycles per x
#define DELAY_US_CONV(us) ((uint16_t)(((((us)*1000L)/(1000000000/F_CPU))-1)/4))
#define delay_us(us) delayloop16(DELAY_US_CONV(us))
/* delay function for millisec
(6 cycles per x + 20(?) overhead) */
void delayloop32( uint32_t l); // not inline
#define DELAY_MS_CONV(ms) ( (uint32_t) (ms*(F_CPU/6000L)) )
#define delay_ms(ms) delayloop32(DELAY_MS_CONV(ms))
void delay1us(volatile u08 delay, u08 count);
void delay1(u16 count);
#endif

598
ipod.c Executable file
View File

@ -0,0 +1,598 @@
/*
Copyright (C) 2006 Daniel Broad <daniel@dorada.co.uk>.
-----------------------------------------------------------------------
this file is a part of the Lexus iPod Project
-----------------------------------------------------------------------
http://www.lexusipod.com
*/
#include "com232.h"
#include "ipod.h"
#include "avclandrv.h"
#include "inputoutput.h"
#include "delay.h"
#include <avr/io.h>
#include <avr/pgmspace.h>
//lingo commands Len
const u08 cmLingo[] PROGMEM = {0x03, 0x00, 0x01, 0x04};
const u08 cmPlayPause[] PROGMEM = {0x04, 0x04, 0x00, 0x29, 0x01};
const u08 cmstop[] PROGMEM = {0x04, 0x04, 0x00, 0x29, 0x02};
const u08 cmPollingOn[] PROGMEM = {0x04, 0x04, 0x00, 0x26, 0x01};
const u08 cmSkipTrackF[]PROGMEM = {0x04, 0x04, 0x00, 0x29, 0x03};
const u08 cmSkipTrackR[]PROGMEM = {0x04, 0x04, 0x00, 0x29, 0x04};
const u08 cmFF[] PROGMEM = {0x04, 0x04, 0x00, 0x29, 0x05};
const u08 cmRR[] PROGMEM = {0x04, 0x04, 0x00, 0x29, 0x06};
const u08 cmResume[] PROGMEM = {0x04, 0x04, 0x00, 0x29, 0x07};
const u08 cmPlaylistPos[] PROGMEM = {0x03, 0x04, 0x00, 0x1E};
const u08 cmExecSwitch[] PROGMEM = {0x07, 0x04, 0x00, 0x28,0x00,0x00,0x00,0x01};
const u08 cmPlaylistCount[] PROGMEM = {0x04, 0x04, 0x00, 0x18, 0x01};
const u08 cmGetShuffle[] PROGMEM = {0x03, 0x04, 0x00, 0x2C};
const u08 cmGetRepeat[] PROGMEM = {0x03, 0x04, 0x00, 0x2F};
const u08 cmGetTimeStatus[] PROGMEM = {0x03, 0x04, 0x00, 0x1C};
u08 cmShuffle[] = {0x04, 0x04, 0x00, 0x2E, 0x00};
u08 cmRepeat[] = {0x04, 0x04, 0x00, 0x31, 0x00};
u08 cmPlaylistSwitch[] = {0x08, 0x04, 0x00, 0x17, 0x01, 0x00,0x00,0x00,0x00};
//lingo replies
#define rpNumplaylists 0x19
#define rpTimeStatusInfo 0x1D
#define rpPlaylistPosition 0x1F
#define rpSongTime 0x27
#define rpACK 0x01
#define rpTimeStatus 0x1D
#define rpShuffleStatus 0x2D
#define rpRepeatMode 0x30
//------------------------------------------------------------------------------
void AddBuffer(u08 tmp)
{
if (RxCharEnd<15) {
RxBuffer[RxCharEnd] = tmp; // Store received character
};
RxCharEnd++;
}
//------------------------------------------------------------------------------
void ClearInBuffer()
{
u08 i;
for (i=0;i<15;i++)
{
RxBuffer[i] = 0x00;
};
RxCharEnd=0;
}
//------------------------------------------------------------------------------
#ifndef MONITOR
void RS232_LINGO(u08* pBuf)
{
// output a lingo message
register u08 c;
u08 i = 1;
while (i<=pBuf[0])
{
c = pBuf[i];
RS232_SendByte(c);
i++;
}
}
#endif
//------------------------------------------------------------------------------
#ifdef MONITOR
void RS232_LINGO_TEST(u08* pBuf)
{
// test output a lingo message to pc on rs232
register u08 c;
u08 i = 1;
while (i<=pBuf[0])
{
c = pBuf[i];
RS232_PrintHex8(c);
i++;
}
RS232_SendByte('\r');
RS232_SendByte('\n');
}
#endif
//------------------------------------------------------------------------------
#ifndef MONITOR
void RS232_LINGO_P(u08* pBuf)
{
// output a lingo message
register u08 c;
u08 i = 1;
u08 length = pgm_read_byte(pBuf);
while (i<=length)
{
c = pgm_read_byte(pBuf+i);
RS232_SendByte(c);
i++;
}
}
#endif
//------------------------------------------------------------------------------
#ifdef MONITOR
void RS232_LINGO_TEST_P(u08* pBuf)
{
// test output a lingo message to pc on rs232
register u08 c;
u08 i = 1;
u08 length = pgm_read_byte(pBuf);
while (i<=length)
{
c = pgm_read_byte(pBuf+i);
RS232_PrintHex8(c);
i++;
}
RS232_SendByte('\r');
RS232_SendByte('\n');
}
#endif
//------------------------------------------------------------------------------
void iPod_Poll()
{
// check to see if we have an ipod message waiting to be processed
if (RXState == RX_FINISHED)
iPod_ProcessResponse();
// check if iPod connected, set lingo mode
if (IPOD_IS_CONNECTED!=iPodConnected)
{
iPodConnected = IPOD_IS_CONNECTED;
if (iPodConnected)
{
delay_ms(50);
iPod(cmdLingo);
delay_ms(50);
iPodEvent = evPlaylistCount;
RXState = WAITING_FOR_FF;
iPodMode = stStop;
AuxInput = 1;
SwitchInputs();
}
else
{
// switchinputs knows its not connected so will switch to aux2
SwitchInputs();
}
};
// if we need to sync car play/pause state to ipod
if ((CD_Mode != iPodMode) & (AuxInput == 0))
{
switch (CD_Mode) {
case stStop:
case stPlay:
if ((iPodMode == stFF) | (iPodMode == stRR))
iPod(cmdResume);
else
iPod(cmdPlay);
break;
case stFF:
iPod(cmdFF);
break;
case stRR:
iPod(cmdRR);
break;
default:
break;
};
iPodMode = CD_Mode;
};
// other input, iPod should be stop
if (AuxInput == 1)
if (iPodMode != stStop)
{
if (iPodConnected) iPod(cmdPlay);
iPodMode = stStop;
iPodEvent = evTimeStatus;
}
// do iPod events
if (iPodConnected)
{
#ifdef MONITOR
if (iPodEvent != evNone)
{
RS232_Print("iPod Event:");
RS232_PrintHex8(iPodEvent);
RS232_Print("\r\n");
};
#endif
switch (iPodEvent) {
case evPlaylistPosition:
iPod(cmdPlayListPosition);
iPodEvent = evNone;
break;
case evPlayListOne:
iPod(cmdPlayListOne);
iPodEvent = evPlaylistPosition;
iPodPlaylist = 1;
iPodMode = stPlay;
break;
case evPlaylistCount:
iPod(cmdNumPlaylists);
iPodEvent = evPlaylistPosition;
break;
case evTimeStatus:
iPod(cmdTimeStatus);
iPodEvent = evPlaylistPosition;
default:
if (randomMode != iPodShuffle)
{
iPod(cmdShuffle);
iPodShuffle = randomMode;
} else {
if (repeatMode != iPodRepeat)
{
iPod(cmdRepeat);
iPodRepeat = repeatMode;
};
};
#ifndef MONITOR
if ((maxDisc == 0))
iPodEvent = evPlaylistCount;
#endif
break;
};
}
// if RX error reset comms.
if (RXState == RX_ERROR) {
ClearInBuffer();
RXState = WAITING_FOR_FF;
UCSRB = UART_RXENABLE; //enable receiver
};
}
//------------------------------------------------------------------------------
void iPod_Data(u08 tmp) {
#ifdef MONITOR
{
RS232_PrintHex8(tmp);
RS232_Print("-");
RS232_PrintHex8(RXState);
RS232_Print("\n");
};
#endif
switch (RXState)
{
case WAITING_FOR_FF:
if( tmp == 0xFF )
RXState = WAITING_FOR_55;
break;
case WAITING_FOR_55:
if( tmp == 0x55 )
RXState = WAITING_FOR_LENGTH;
else
{
if (tmp == 0xFF)
RXState = WAITING_FOR_55;
else
RXState = RX_ERROR;
}
break;
case WAITING_FOR_LENGTH:
if (tmp > 15)
{
RXState = RX_ERROR;
break;
}
CheckSum = tmp;
Length = tmp;
BytesToGo = tmp;
RXState = GETTING_MESSAGE;
break;
case GETTING_MESSAGE:
CheckSum += tmp;
AddBuffer(tmp);
if( !--BytesToGo )
RXState = WAITING_FOR_CHECKSUM;
break;
case WAITING_FOR_CHECKSUM:
CheckSum = ( CheckSum ^ 0xff ) + 1;
if (tmp == CheckSum)
{
RXState = RX_FINISHED;
UCSRB = UART_RXDISABLE; //disable receiver
}
else
{
RXState = RX_ERROR;
}
break;
case RX_FINISHED:
break;
case RX_ERROR:
UCSRB = UART_RXDISABLE; //disable receiver
break;
default:
#ifdef MONITOR
RS232_Print("Error\n");
#endif
RXState = RX_ERROR;
}
}
//------------------------------------------------------------------------------
void iPod_ProcessResponse()
{ // 04 00 XX ......
uint32_t temp = 0;
#ifdef MONITOR
RS232_PrintHex8(RxBuffer[2]);
RS232_SendByte('\r');
RS232_SendByte('\n');
#endif
switch (RxBuffer[2]) {
case rpACK:
break;
case rpNumplaylists:
temp = RxBuffer[5];
temp = temp << 8;
temp = RxBuffer[6];
temp = temp + 1;
maxDisc = temp;
if (maxDisc > 99) maxDisc = 99;
Event |= EV_DISPLAY;
break;
case rpSongTime:
if (RxBuffer[4] == 0xFF)
{
// We are not playing
iPodEvent = evTimeStatus;
}
else
{
iPod_SetTime(RxBuffer[4], RxBuffer[5], RxBuffer[6], RxBuffer[7]);
}
break;
case rpPlaylistPosition:
if (RxBuffer[3] == 0xFF)
{
// We are not playing?
iPodEvent = evTimeStatus;
}
else
{
temp = RxBuffer[4];
temp = temp << 8;
temp += RxBuffer[5];
temp = temp << 8;
temp += RxBuffer[6];
temp++;
temp = temp % 100;
if (AuxInput == 0)
cd_Track = BCDu08(temp);
}
iPodTrack = BCDu08(temp);
break;
case rpTimeStatus:
iPod_SetTime(RxBuffer[7], RxBuffer[8], RxBuffer[9], RxBuffer[10]);
switch (RxBuffer[11])
{
case 0x00:
iPodEvent = evPlayListOne;
break;
case 0x01:
iPodMode = stPlay;
break;
case 0x02:
iPodMode = stStop;
break;
};
break;
case rpShuffleStatus:
iPodShuffle = RxBuffer[3];
break;
case rpRepeatMode:
iPodRepeat = RxBuffer[3];
break;
default:
break;
}
// reset ready to go again
ClearInBuffer();
RXState = WAITING_FOR_FF;
UCSRB = UART_RXENABLE; //enable receiver
}
//------------------------------------------------------------------------------
void iPod_SendCommand(u08* command, u08 progmem)
{
u08 CheckSum = 0;
u08 length;
u08 i;
if (progmem)
length = pgm_read_byte(command);
else
length = command[0];
u08 begin[] = {0x03,0xFF,0x55,0x00};
u08 checksum[] = {0x01, 0xFF};
begin[3] = length;
// calc checksum
for (i=0;i<=length;i++)
{
if (progmem)
CheckSum += pgm_read_byte(command+i);
else
CheckSum += command[i];
};
CheckSum = ( CheckSum ^ 0xff ) + 1;
checksum[1] = CheckSum;
#ifdef MONITOR
{
RS232_LINGO_TEST((u08*) begin);
if (progmem)
RS232_LINGO_TEST_P(command);
else
RS232_LINGO_TEST(command);
RS232_LINGO_TEST((u08*) checksum);
}
#else
{
RS232_LINGO((u08*) begin);
if (progmem)
RS232_LINGO_P(command);
else
RS232_LINGO(command);
RS232_LINGO((u08*) checksum);
}
#endif
}
//------------------------------------------------------------------------------
void iPod(u08 command)
{
#ifdef MONITOR
{
RS232_Print("iPod:");
RS232_PrintHex8(command);
RS232_Print("\r\n");
}
#endif
switch (command) {
case cmdLingo:
iPod_SendCommand((u08*) cmLingo,1);
delay_ms(100);
iPod_SendCommand((u08*) cmPollingOn,1);
delay_ms(100);
iPod_SendCommand((u08*) cmPlaylistCount,1);
break;
case cmdPlay:
iPod_SendCommand((u08*) cmPlayPause,1);
iPodEvent = evTimeStatus;
break;
case cmdStop:
break;
case cmdNumPlaylists:
iPod_SendCommand((u08*) cmPlaylistCount,1);
break;
case cmdPlaylist:
if (cd_Disc < maxDisc)
{
cmPlaylistSwitch[8] = cd_Disc-1;
iPod_SendCommand((u08*) cmPlaylistSwitch,0);
iPod_SendCommand((u08*) cmExecSwitch,1);
iPodPlaylist = cd_Disc;
};
iPodEvent = evPlaylistCount;
break;
case cmdNextTrack:
iPod_SendCommand((u08*) cmSkipTrackF,1);
iPodEvent = evPlaylistPosition;
break;
case cmdPrevTrack:
iPod_SendCommand((u08*) cmSkipTrackR,1);
iPodEvent = evPlaylistPosition;
break;
case cmdNextPlaylist:
break;
case cmdPrevPlaylist:
break;
case cmdFF:
iPod_SendCommand((u08*) cmFF,1);
break;
case cmdRR:
iPod_SendCommand((u08*) cmRR,1);
break;
case cmdPlayListPosition:
iPod_SendCommand((u08*) cmPlaylistPos,1);
break;
case cmdPlayListOne:
cmPlaylistSwitch[8] = 0x00;
iPod_SendCommand((u08*) cmPlaylistSwitch,0);
iPod_SendCommand((u08*) cmExecSwitch,1);
cd_Disc = 1;
iPodPlaylist = cd_Disc;
break;
case cmdShuffle:
cmShuffle[4] = randomMode;
iPod_SendCommand((u08*) cmShuffle,0);
break;
case cmdRepeat:
cmRepeat[4] = repeatMode;
iPod_SendCommand((u08*) cmRepeat,0);
break;
case cmdResume:
iPod_SendCommand((u08*) cmResume,1);
break;
case cmdTimeStatus:
iPod_SendCommand((u08*) cmGetTimeStatus,1);
break;
case cmdGetShuffle:
iPod_SendCommand((u08*) cmGetShuffle,1);
break;
case cmdGetRepeat:
iPod_SendCommand((u08*) cmGetRepeat,1);
break;
default:
break;
}
}
u08 BCDu08 (u08 inbyte)
{
u08 units = (inbyte % 10);
u08 tens = ((inbyte) / 10);
return (tens * 16) + units;
}
void iPod_Error()
{
RXState = RX_ERROR;
}
void iPod_Init()
{
RXState = WAITING_FOR_FF;
UCSRB = UART_RXENABLE; //enable receiver
iPodPlaylist = 1;
iPodTrack = 1;
//iPodConnected = 99;
}
void iPod_SetTime(u08 b1, u08 b2, u08 b3, u08 b4)
{
uint32_t temp = 0;
if (AuxInput == 1) return;
temp = b1;
temp = temp << 8;
temp = b2;
temp = temp << 8;
temp += b3;
temp = temp << 8;
temp += b4;
temp = temp / (uint32_t) 1000;
cd_Time_Min = BCDu08((temp / (uint32_t)60) % (uint32_t)100);
iPodMin = cd_Time_Min;
if (cd_Time_Sec != BCDu08(temp % (uint32_t)60))
{
cd_Time_Sec = BCDu08(temp % (uint32_t)60);
iPodEvent = evPlaylistPosition;
iPodSec = cd_Time_Sec;
Event |= EV_STATUS;
iPodMode = stPlay;
};
};

1
ipod_avc.aps Executable file

File diff suppressed because one or more lines are too long

136
ipod_avc.c Executable file
View File

@ -0,0 +1,136 @@
/*
Copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
This file is part of
iPod interface for TOYOTA AVC-Lan CD-Changer Emulator
v1.0
(C) 2006 SLONIU
http://www.softservice.com.pl/corolla/avc
marcin@softservice.com.pl
---------------------------------------------------------------------------
*/
//------------------------------------------------------------------------------
#include <avr/io.h>
#include <avr/signal.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include "delay.h"
#include "const.h"
#include "avclandrv.h"
#include "com232.h"
#include "timer.h"
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void PIN_Setup();
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int main()
{
PIN_Setup();
//delay_ms(100);
AVCLan_Init();
#ifndef SNIFFER
iPod_Init();
#endif
#ifdef MONITOR
RS232_Print("********************** RESET *********************\n");
#endif
while (1) {
if (INPUT_IS_SET) { // if message from some device on AVCLan begin
AVCLan_Read_Message();
// check command from HU
if (answerReq != 0) AVCLan_SendAnswer();
}
#ifndef SNIFFER
// HandleEvent
if (Event & EV_STATUS)
{
Event &= ~EV_STATUS;
if (CD_Mode!=stStop) {
AVCLan_Send_Status();
};
}
if (Event & EV_DISPLAY)
{
Event &= ~EV_DISPLAY;
AVCLan_Send_Changer_Status();
}
#endif
RS232_SendStuff();
} // end while(1)
}
//------------------------------------------------------------------------------
void PIN_Setup()
{
outb(GIMSK, 0); // disable external interupts
outb(MCUCR, 0);
outb(TIMSK, (_BV(TOIE1))); // Enable timer1 interrupt
set_sleep_mode(SLEEP_MODE_IDLE);
//cbi(DDRD, 6);
//cbi(PORTD, 6);
// Timer 1
outb(TCCR1A, 0);
outb(TCCR1B, (_BV(CS12)) | (_BV(CS10))); // Prescaler /1024
outb(TCNT1H, TI1_H); // Load counter value hi
outb(TCNT1L, TI1_L); // Load counter value lo
RS232_Init();
Event = EV_NOTHING;
cli();
AuxInput=1;
#ifndef SNIFFER
SwitchInputs();
#endif
}
//------------------------------------------------------------------------------
SIGNAL(SIG_OVERFLOW1) // Timer1 overflow every 1Sec
{
outb(TCNT1H, TI1_H); // reload timer1
outb(TCNT1L, TI1_L);
if ((CD_Mode!=stStop)) {
Event |= EV_STATUS;
}
}
SIGNAL(SIG_COMPARATOR)
{
//do nothing we're now awake!
};
//------------------------------------------------------------------------------

60
sniffit.c Executable file
View File

@ -0,0 +1,60 @@
#include "sniffit.h"
#include "com232.h"
#include "avclandrv.h"
#include "const.h"
#include "avr\io.h"
//------------------------------------------------------------------------------
void ShowInMessage()
{
if (message_len==0) return;
//if ((broadcast==1) & ((slave1!=MY_ID_1) | (slave2!=MY_ID_2))) return;
RS232_PrintHex4(master1);
RS232_PrintHex8(master2);
RS232_Print(" (");
if (broadcast==0) RS232_Print("bro) ");
else RS232_Print("dir) ");
RS232_PrintHex4(slave1);
RS232_PrintHex8(slave2);
RS232_Print("| ") ;
RS232_PrintHex8(message_len);
u08 i;
for (i=0;i<message_len;i++) {
RS232_Print(" ");
RS232_PrintHex8(message[i]);
}
RS232_Print("\n");
}
//------------------------------------------------------------------------------
void ShowOutMessage(int broadcast)
{
u08 i;
RS232_PrintHex4(MY_ID_1);
RS232_PrintHex8(MY_ID_2);
RS232_Print(" (");
if (broadcast==0) {
RS232_Print("bro) ");
RS232_PrintHex4(0x01);
RS232_PrintHex8(0xFF); }
else {
RS232_Print("dir) ");
RS232_PrintHex4(masterDevice1);
RS232_PrintHex8(masterDevice2);
};
RS232_Print("| ") ;
RS232_PrintHex8(data_len);
RS232_Print(" ");
for (i=0; i<data_len; i++) {
RS232_PrintHex8(data[i]);
RS232_SendByte(' ');
}
RS232_Print("\n");
}
//------------------------------------------------------------------------------

9
sniffit.h Executable file
View File

@ -0,0 +1,9 @@
#ifndef __SNIFFIT_H
#define __SNIFFIT_H
//------------------------------------------------------------------------------
void ShowInMessage();
void ShowOutMessage(int broadcast);
//------------------------------------------------------------------------------
#endif

75
timer.h Executable file
View File

@ -0,0 +1,75 @@
/* Copyright (c) 2002, Marek Michalkiewicz
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. */
/* $Id: timer.h,v 1.4.2.2 2004/02/15 20:28:09 joerg_wunsch Exp $ */
/* Copied locally to my project - DJB 30/11/06 */
#ifndef _AVR_TIMER_H_
#define _AVR_TIMER_H_
#include <avr/io.h>
#if defined(__AVR_ATmega128__) || defined(__AVR_ATmega64__)
# warning "This file is known to be incorrect for your MCU type"
#endif
#ifdef __cplusplus
extern "C" {
#endif
enum {
STOP = 0,
CK = 1,
CK8 = 2,
CK64 = 3,
CK256 = 4,
CK1024 = 5,
T0_FALLING_EDGE = 6,
T0_RISING_EDGE = 7
};
static __inline__ void timer0_source (unsigned int src)
{
TCCR0 = src;
}
/*
* NB: this is completely bogus.
*/
static __inline__ void timer0_stop (void)
{
TCNT0 = 0;
}
static __inline__ void timer0_start (void)
{
TCNT0 = 1;
}
#ifdef __cplusplus
}
#endif
#endif /* _AVR_TIMER_H_ */