?? rds_driver.mht
字號:
From: <由 Microsoft Internet Explorer 5 保存>
Subject: =?gb2312?B?utzT0Lzb1rW1xFJEU8f9tq+zzNDyus3P4LnY18rBzyAtIEVuYmlhJ3MgQmw=?=
=?gb2312?B?b2c=?=
Date: Fri, 29 Dec 2006 15:25:33 +0800
MIME-Version: 1.0
Content-Type: multipart/related;
type="text/html";
boundary="----=_NextPart_000_001B_01C72B5D.954F65F0"
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
This is a multi-part message in MIME format.
------=_NextPart_000_001B_01C72B5D.954F65F0
Content-Type: text/html;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.enbia.com/blog/article.asp?id=24
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" =
"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML =
xmlns=3D"http://www.w3.org/1999/xhtml"><HEAD><TITLE>=E5=BE=88=E6=9C=89=E4=
=BB=B7=E5=80=BC=E7=9A=84RDS=E9=A9=B1=E5=8A=A8=E7=A8=8B=E5=BA=8F=E5=92=8C=E7=
=9B=B8=E5=85=B3=E8=B5=84=E6=96=99 - Enbia's Blog</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8">
<META content=3Dfollow,index name=3Drobots><LINK=20
href=3D"http://www.enbia.com/blog/styles/mulog/styles.css" =
type=3Dtext/css=20
rel=3Dstylesheet><LINK title=3D"Enbia's Blog"=20
href=3D"http://www.Enbia.com/blog/feed.asp" type=3Dapplication/rss+xml=20
rel=3Dalternate>
<SCRIPT language=3Djavascript =
src=3D"http://www.enbia.com/blog/common.js"=20
type=3Dtext/javascript></SCRIPT>
<META content=3D"MSHTML 6.00.2900.2995" name=3DGENERATOR></HEAD>
<BODY><!-- Shadows -->
<DIV class=3Ds1>
<DIV class=3Ds2>
<DIV class=3Ds3>
<DIV class=3Ds4>
<DIV class=3Ds5>
<DIV class=3Ds6>
<DIV class=3Ds7>
<DIV class=3Ds8><!-- Shadows -->
<DIV id=3Dwrapper>
<DIV id=3DinnerWrapper>
<DIV id=3Dheader>
<DIV id=3DinnerHeader>
<DIV id=3DblogLogo><A href=3D"http://www.enbia.com/blog/"><IMG =
id=3D"enbia's blog"=20
alt=3D"enbia's blog"=20
src=3D"http://www.enbia.com/blog/styles/mulog/images/logo.gif"></A></DIV>=
<DIV class=3Dblog-desc>A place to share knowledge, joy, =
dream......</DIV>
<DIV id=3Dmenu>
<UL>
<LI><A href=3D"http://www.enbia.com/blog/default.asp">Index</A>=20
<LI><A =
href=3D"http://www.enbia.com/blog/default.asp?selected=3Dtrue">Selected=20
Content</A>=20
<LI><A href=3D"http://www.enbia.com/blog/gbook.asp">Guestbook</A>=20
<LI><A href=3D"javascript:showHideSidebar()">Toggle Sidebar</A>=20
<LI><A href=3D"javascript:showLogin()">Login</A> =
</LI></UL></DIV></DIV></DIV>
<DIV id=3DmainWrapper>
<DIV class=3Dcontent id=3Dcontent>
<DIV id=3DinnerContent>
<DIV class=3Darticle-top>
<DIV class=3Dprev-article><A =
title=3D=E6=97=A0=E7=BA=BF=E6=94=B6=E5=8F=91=E8=8A=AF=E7=89=87=E6=AF=94=E8=
=BE=83=E4=B8=8E=E9=80=89=E6=8B=A9=E2=80=94=E2=80=94CC1000=20
href=3D"http://www.enbia.com/blog/article.asp?id=3D23">=C2=AB =
=E6=97=A0=E7=BA=BF=E6=94=B6=E5=8F=91=E8=8A=AF=E7=89=87=E6=AF=94=E8=BE=83=E4=
=B8=8E...</A></DIV>
<DIV class=3Dnext-article><A title=3D"=E9=80=89=E6=8B=A9 LDO =
=E7=9A=84=E6=96=B9=E6=B3=95"=20
href=3D"http://www.enbia.com/blog/article.asp?id=3D25">=E9=80=89=E6=8B=A9=
LDO =E7=9A=84=E6=96=B9=E6=B3=95 =C2=BB</A></DIV>
<DIV class=3Dcategory-label><A=20
href=3D"http://www.enbia.com/blog/default.asp?cat=3D1">Category:=20
=E6=8A=80=E6=9C=AF=E8=AE=BA=E5=9D=9B</A></DIV></DIV>
<DIV class=3Dtextbox>
<DIV class=3Dtextbox-title>
<H4>=E5=BE=88=E6=9C=89=E4=BB=B7=E5=80=BC=E7=9A=84RDS=E9=A9=B1=E5=8A=A8=E7=
=A8=8B=E5=BA=8F=E5=92=8C=E7=9B=B8=E5=85=B3=E8=B5=84=E6=96=99</H4>
<DIV class=3Dtextbox-label>[ 2006-01-19 17:20:21 | Author: <A=20
href=3D"http://www.enbia.com/blog/user.asp?act=3Dview&id=3D1">Admin</=
A> ]=20
</DIV></DIV>
<DIV class=3Dtextbox-fontsize>Font Size: <A title=3D"Font Size: Large"=20
href=3D"javascript:setFontSize(14)">Large</A> | <A title=3D"Font Size: =
Medium"=20
href=3D"javascript:setFontSize(11)">Medium</A> | <A title=3D"Font Size: =
Small"=20
href=3D"javascript:setFontSize(9)">Small</A> </DIV>
<DIV class=3Dtextbox-content=20
id=3DtextboxContent>//---------------------------------------------------=
----------------------<BR>//=20
RDS Decoding<BR>// COPYRIGHT (C) 2003, Enbia Technology Inc.<BR>// =
Target:=20
8031<BR>// AUTHOR: STEVEN LUO<BR>//<BR>// Revision History:<BR>// =
2003/2/16 -=20
Original=20
Version<BR>//------------------------------------------------------------=
-------------<BR>#include=20
<reg51.h><BR>#include <types.h><BR>#include=20
<intrins.h><BR>#include <bin.h><BR><BR>//#define =
DEBUG<BR><BR>//=20
Gloables ------------------ //<BR>WORD=20
PICode; //<BR>BYTE=20
GroupType; //<BR>BYTE=20
PTY; //<BR>BOO=
L=20
bTP; // =
TP<BR>BOOL=20
bMS; // =
M/S<BR>BOOL=20
bTA; //=20
TA<BR><BR>BOOL bRDSOk =3D 0; // set =
when group=20
0 ready<BR>BOOL bTextOk =3D 0; // set =
when=20
group 2 ok, Text ready, need 16 groups<BR><BR>extern WORD=20
aRDS_Text[32]; // radio text <BR>extern WORD=20
aPS[4]; // Service name, 8 =
chars<BR><BR>//=20
Locals ------------------- //<BR><BR>static WORD =
aRDS_Block[4]; //=20
Groupe =3D 4 blocks<BR>static WORD rdsdata[2]; // =
byte 1,=20
byte=20
2<BR> &n=
bsp; //=20
0 0 0 0 0 0 c9 c8 c7 c6 c5 c4 c3 c2 c1 c0<BR>static WRD crc;<BR>static =
BYTE=20
pscnt;<BR>static BYTE textcnt;<BR>BYTE bytecnt;<BR><BR>#ifdef=20
DEBUG<BR> sbit PIN_RDS_DATA =3D P3^1; // using=20
89c51<BR> sbit PIN_TEST =3D=20
P3^7; <BR>#else<BR> sbit PIN_RDS_DATA =
=3D=20
P3^7; // using 89c2051<BR> sbit PIN_TEST =3D=20
P1^7;O <BR>#endif<BR><BR>//-----------------------=
--------------------------------------------------<BR>//=20
RDS=20
Callback<BR>//-----------------------------------------------------------=
--------------<BR>void=20
RDS_BLOCK_Auto_Update(void){ <BR>BYTE =
chr_addr;<BR>static BOOL bTextAB =3D 0;<BR><BR> PICode =3D=20
aRDS_Block[0];  =
;<BR> GroupType=20
=3D (aRDS_Block[1] >> 11) & =
0x1f; <BR> PTY =3D=20
(aRDS_Block[1] >> 5) &=20
0x1f; <BR><BR> switch=20
(GroupType){ &=
nbsp; <BR> case=20
0: // Group=20
0A <BR> &=
nbsp; case=20
1: // Group=20
0B <BR> &=
nbsp; bTP=20
=3D aRDS_Block[1] & 0x0400; // bit=20
10<BR> bTA =3D aRDS_Block[1] &=20
0x0010; // bit=20
4<BR> bMS =3D aRDS_Block[1] &=20
0x0008; // bit=20
3 <BR><BR> &nbs=
p; chr_addr=20
=3D aRDS_Block[1] & 0x03;<BR> if =
(chr_addr=20
=3D=3D 0) pscnt =3D 0; else pscnt =
++;<BR> if=20
(chr_addr =3D=3D pscnt) aPS[chr_addr] =3D aRDS_Block[3]; else bRDSOk =3D =
0;<BR> if (pscnt =3D=3D 3) bRDSOk =3D =
1;<BR> break;<BR><BR>  =
; case=20
4: // Group 2A<BR> // if =
TextAB=20
changed, should update<BR> if =
(bTextAB !=3D=20
(aRDS_Block[1] & 0x10)){ // Text AB : bit 5 =
in block=20
1<BR> bTextAB =3D =
(aRDS_Block[1]=20
& 0x10);<BR> textcnt =
=3D=20
0;<BR> }<BR><BR> &nbs=
p; chr_addr=20
=3D aRDS_Block[1] & =
0x0f;<BR><BR> if=20
(chr_addr =3D=3D 0) textcnt =3D 0; else textcnt=20
++;<BR> if (chr_addr =3D=3D textcnt)=20
{<BR> aRDS_Text[chr_addr] =
=3D=20
aRDS_Block[2]; aRDS_Text[chr_addr + 1] =3D aRDS_Block[3];=20
<BR> // if "0x0d" found, =
the text=20
finish.<BR> if=20
(((aRDS_Text[chr_addr] & 0x00ff) =3D=3D 0x000d) || =
((aRDS_Text[chr_addr] &=20
0xff00) =3D=3D 0x0d00) || ((aRDS_Text[chr_addr+1] & 0x00ff) =3D=3D =
0x000d)=20
|| ((aRDS_Text[chr_addr+1] & 0xff00) =3D=3D=20
0x0d00)){<BR> =
bTextOk=20
=3D 1; bytecnt=3Dtextcnt*2;textcnt =3D 0;=20
<BR> }<BR> =20
}<BR> else {=20
<BR> bTextOk =3D=20
0;<BR> }<BR> &n=
bsp; if=20
(textcnt >=3D 16) {bTextOk =3D 1; bytecnt=3Dtextcnt*2;textcnt =3D=20
0;}<BR> break; =
<BR><BR> case=20
5: // Group 2B <BR> // if =
TextAB=20
changed, should update<BR> if =
(bTextAB !=3D=20
(aRDS_Block[1] & 0x10)){ // Text AB : bit 5 =
in block=20
1<BR> bTextAB =3D =
(aRDS_Block[1]=20
& 0x10);<BR> textcnt =
=3D 0;=20
<BR> }<BR> &nbs=
p; <BR> chr_addr=20
=3D aRDS_Block[1] & 0x0f;<BR> if =
(chr_addr=20
=3D=3D 0) textcnt =3D 0; else textcnt =
++;<BR> if=20
(chr_addr =3D=3D textcnt)=20
{<BR> aRDS_Text[chr_addr] =
=3D=20
aRDS_Block[2]; <BR> // if =
"0x0d"=20
found, the text =
finish.<BR> if=20
(((aRDS_Text[chr_addr] & 0x00ff) =3D=3D 0x000d) || =
((aRDS_Text[chr_addr] &=20
0xff00) =3D=3D=20
0x0d00)){<BR> =
bTextOk=20
=3D 1; bytecnt=3Dtextcnt;textcnt =3D 0;=20
<BR> }<BR> &nbs=
p; =20
}<BR> else {=20
<BR> bTextOk =3D=20
0;<BR> }<BR> &n=
bsp; if=20
(textcnt >=3D 16) {bTextOk =3D 1;bytecnt=3Dtextcnt; textcnt =3D=20
0;}<BR> break; =
<BR><BR> default:=20
<BR> break; &nb=
sp; <BR> }  =
;<BR>}<BR><BR>//=20
--------------------------------------------------------------<BR>//=20
RDS_CRCCheck<BR>//=20
--------------------------------------------------------------<BR>void=20
RDS_CRCCheck(void){<BR>bit bCFlag;<BR>BYTE TempH,=20
TempL;<BR><BR> TempH =3D rdsdata[0] / =
0x100;<BR> TempL =3D=20
rdsdata[0] % 256;<BR><BR> //C9<BR> ACC =3D TempH =
&=20
0x7c;<BR> bCFlag =3D P;<BR> ACC =3D TempL &=20
0x3e;<BR> bCFlag ^=3D P;<BR> if(bCFlag)crc =3D=20
0x200;<BR><BR> //C8<BR> ACC =3D TempH &=20
0x3e;<BR> bCFlag =3D P;<BR> ACC =3D TempL &=20
0x1f;<BR> bCFlag ^=3D P;<BR> if(bCFlag) crc |=3D=20
0x100;<BR><BR> //C7<BR> ACC =3D TempH &=20
0x63;<BR> bCFlag =3D P;<BR> ACC =3D TempL &=20
0x31;<BR> bCFlag ^=3D P;<BR> if(bCFlag) crc |=3D=20
0x80;<BR><BR> //C6<BR> ACC =3D=20
TempH&0xcd;<BR> bCFlag =3D P;<BR> ACC =3D =
TempL &=20
0xa6;<BR> bCFlag ^=3D P;<BR> if(bCFlag)crc |=3D=20
0x40;<BR><BR> //C5<BR> ACC =3D TempH &=20
0xe6;<BR> bCFlag =3D P;<BR> ACC =3D TempL &=20
0xd3;<BR> bCFlag ^=3D P;<BR> if(bCFlag)crc |=3D=20
0x20;<BR><BR> //C4<BR> ACC =3D TempH &=20
0x8f;<BR> bCFlag =3D P;<BR> ACC =3D TempL &=20
0x57;<BR> bCFlag ^=3D P;<BR> if(bCFlag) crc |=3D=20
0x10;<BR><BR> //C3<BR> ACC =3D TempH &=20
0x3b;<BR> bCFlag =3D P;<BR> ACC =3D TempL &=20
0x95;<BR> bCFlag ^=3D P;<BR> if(bCFlag)crc |=3D=20
0x08;<BR><BR> //C2<BR> ACC =3D TempH &=20
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -