星期五, 一月 16, 2009

C语言中#include 用法

#include "<"filename.h">"用于系统头文件
#include "filename.h"用于用户头文件

星期二, 一月 13, 2009

笔记本电脑桌



































































也许你早就有了一台笔记本电脑,不过在家里你是怎么使用它的呢?是放在书桌上挺直腰板在用,还是将它放在双腿上使用的?抑或是放在茶几上猫着腰用?如果你还在这样使用笔记本电脑,那你一定也体会到“其中的痛苦”了吧。笔记本电脑桌不仅有支撑笔记本电脑的功能,而且它改变了用户使用笔记本的习惯和使用环境。









































星期一, 一月 12, 2009

SNS将进入白热化竞争阶段

SNS,全称Social Networking Services,即社会性网络服务,专指旨在帮助人们建立社会性网络的互联网应用服务。
  1967年哈佛大学心理学教授Stanley Milgram(1934~1984)创立了六度分割理论,简单地说:“你和任何一个陌生人之间所间隔的人不会超过六个,也就是说,最多通过六个人你就能够认识任何一个陌生人。”按照六度分隔理论,每个个体的社交圈都不断放大,最后成为一个大型网络。这是社会性网络(Social Networking)的早期理解。后来有人根据这种理论,创立了面向社会性网络的互联网服务,通过“熟人的熟人”来进行网络社交拓展,比如ArtComb,FriendsterWallop,adoreme 等。
  但“熟人的熟人”,只是社交拓展的一种方式,而并非社交拓展的全部。因此,现在一般所谓的SNS,则其含义已经远不止“熟人的熟人”这个层面。比如根据相同话题进行凝聚(如贴吧)、根据学习经历进行凝聚(如Facebook)、根据周末出游的相同地点进行凝聚等,都被纳入“SNS”的范畴。
  SNS源自英文缩写
  在互联网领域有SNS三层含义:服务 Social Network Service,软件 Social Network Software,网站 Social Network Site。Social Network Service中文直译为社会性网络服务或社会化网络服务,意译为社交网络服务。中文的网络含义包括硬件、软件、服务及网站应用,加上四字构成的词组更符合中国人的构词习惯,因此人们习惯上用社交网络来代指SNS(包括Social Network Service的三层含义),用社交软件代指Social Network Software,用社交网站代指Social Network Site。SNS专指旨在帮助人们建立社会性网络的互联网应用服务。


2008年最火的互联网应用不是博客、不是视频,甚至不是每天在制造大量真金白银的网游,而是社交网站SNS。2008年下半年,成功“借鉴”Facebook模式的开心网异军突起,以病毒式的扩张速度让业界不少人大跌眼镜。与千橡开心网的域名之争更是吸引了舆论的眼球。种种迹象都向我们表明,随着国内SNS的竞争升级,2009年,必定会有一批SNS运营商淡出我们的视线,而有一批具备相当实力的非SNS运营商通过并购或者独立运营的方式加入战团。
首先,大批网游企业将大规模的介入社区网站的建设。如巨人巨资收购51.com,久游网提出通过整合性质的基础社区进行发展,无不让我们惊觉网游社区化的大势所趋。而社区的互动对于发展并巩固新用户和提高老用户黏着度方面,效果很好。
其次,新浪、搜狐、腾讯, 雅虎等大型网站开始关注SNS领域,并有所动作。尤其是各大门户的博客频道将成为融合SNS业务的“试验田”。博客曾一度迎合了网民的宣泄和表达需要,弥补了公共话语的不足,但热度渐退,09年仍将保持降温趋势。如何更有效地导入社区网站的互动性来增强凝聚力,是门户们需要考虑的问题。 中国雅虎推出的以生活服务基础的“雅虎关系”,该平台以SNS为核心应用,旨在通过嫁接雅虎邮箱、整合口啤点评、打造雅虎口碑生活服务底层平台,打造一个以口碑服务为核心应用的社会化网络生活平台和社会化服务平台。
再次,电信运营商将进一步介入社区网站建设。2008年年中,中移动即已开始建设基于互联网与手机双重平台开发的Web2.0模式SNS社区网站“139社区”。对于电信运营商来说,SNS网站能够吸引足够多的用户,制造和提高人气,增加社区黏度和忠诚度,并通过分析已有社区网民行为,挖掘出新的网络模式。因此,3G发牌后进入移动互联网时代的电信运营商在2009年均有可能在此方面加大投入力度。
最后,手机厂商也将开始追逐社区网站。诺基亚收购了德国的社区网站PLAZES,打算从移动社区网络入手整合相关服务,随后成立移动广告联盟,其意图无非是开启快速增长的移动广告市场。巨头的做法极易被同业拷贝。
社区网站无疑将是2009年的一大亮点,如当年的博客和视频一样。但它也如同后两者一样存在令人尴尬的现实问题。单纯的抄袭和模仿可以持续多久?对于模式单一的SNS,用户的热情能持续多久?SNS的盈利模式在哪里?国内是否能出现如Facebook一样在2009年迈过盈利大关的SNS巨头?

星期五, 一月 09, 2009

如何在网上找英文版的电子书或资料?

在Google英文中分别搜索如下关键字:
archive
archive online
book online
ebook
free ebook
ebook download
free library
online library
online story
online novel
等等类似的关键字。

下面是我认为比较好的几个英文书网站:
http://www.freeebooks.info/
http://www.archive.org/index.php
http://www.magickeys.com/books/

read enligh fiction online 英文在线小说

英文小说 english fiction or novel
http://www.readbookonline.net/fictionNovel/

英文小故事 english short story
http://www.readbookonline.net/shortStory/

英文剧本 english Drama
http://www.readbookonline.net/plays/

孩子夜里磨牙怎么办?

能导致孩子晚上磨牙的因素很多,但并不复杂,以下四种原因比较常见,父母可以根据孩子的情况进行判断,然后采取一些行之有效的防治措施。
原因一:有可能是孩子的身体里有寄生虫。有的孩子有蛲虫病,每当睡觉后蛲虫常爬到肛门口产卵,这样就会让孩子觉得肛门瘙痒难以入睡,夜磨牙的现象也就随之发生。但比较常见的是孩子肚子里有了蛔虫,它在小肠内掠夺各种营养物质,分泌毒素,上下乱窜,极不安宁,刺激肠管使蠕动加快,引起消化不良、肚脐周围隐痛,这样会使孩子在睡眠中神经兴奋性不稳定而引起磨牙。佝偻病也是孩子夜磨牙的重要原因之一。对策:重要的是对症下药。如果孩子肚子里有蛔虫或蛲虫,应及时驱虫。患有佝偻病的孩子则应用维生素D及钙剂及时治疗,同时让孩子进行适量日光浴来增加钙质的吸收。

原因二:心理原因。孩子遇到一些心理问题,如父母离异、家庭不和,因学习不好受父母老师的训斥,或睡觉前看有惊险镜头的电视,都会造成焦虑、压抑、烦躁不安、过度紧张等不良情绪,甚至使心灵受到创伤,因而导致夜间磨牙现象的发生。对策:心病还需心药医,面对这种情况,父母要给孩子创造一个舒适和谐、欢乐轻松的家庭环境,消除给孩子造成压力的各种不良心理因素,必要的时候要带孩子去进行心理治疗。还可以让孩子在睡前服用镇静药物,从而降低或消除神经系统的兴奋性,减少或防止夜磨牙的发生。

原因三:牙颁的原因。如果孩子牙齿发育不好,上下牙接触时有的牙尖过高,咬合面不平,因此造成的高点或障碍点,也会引起孩子夜间磨牙。对策:如果是这种原因,父母应尽快带孩子去就医,请口腔科医生对之进行调合治疗,通过磨除牙齿高点或障碍点从而减轻或消除夜磨牙。也可在医生的指导下让孩子在睡前戴上牙垫,这样也可以抑制孩子夜间磨牙。牙垫是一种用硬塑胶板制成的垫子,厚约2毫米,佩带的时候将均匀地覆盖住下颌及全牙列,戴上后可阻断牙颌干扰对磨牙的触发。牙垫首先可以起到保护牙齿的作用,坚持戴半年则可消除夜磨牙。

原因四:孩子的饮食出现了问题,有挑食、偏食等不良习惯或者消化功能紊乱,也可能造成夜磨牙。前者会使得孩子缺乏钙和维生素;而后者则会因为晚餐吃得太多,胃肠不得不加班消化食物,这两者都会引起孩子面部咀嚼肌的自动工作,使孩子夜间磨牙。对策:父母可通过合理调配膳食来改变孩子饮食上的不良状况,注意粗细粮、荤素菜搭配,以防止孩子营养不良,还要帮助孩子改变不科学的饮食习惯,如偏食、挑食、晚餐过饱等。

26个英语字母发音音标





26个英文字母及发音音标如下:
A a [ei] B b [bi:] C c [si:]
D d [di:] E e [i:] F f [ef]
G g [d3i:] H h [eit∫] I i [ai]
J j [d3ei] K k [kei] L l [el]
M m [em] N n [en] O o [əu]
P p [pi:] Q q [kju:] R r [ɑ:]
S s [es] T t [ti:] U u [ju:]
V v [vi:] W w [′d∧blju:] X x [eks]
Y y [wai] Z z [zi:][zed]

以上我们可以看出,英语字母中有一些含有共同的元音音素.如:
1)含元音音素[ei]
字母: Aa Hh Jj Kk
音标: [ei] [eit∫] [d3ei] [kei]

2) 含元音音素[i:]
字母: Bb Cc Dd Ee Gg Pp Tt Vv
音标: [bi:] [si:] [di:] [i:] [d3i:] [pi:] [ti:] [vi:]

3) 含元音音素[e]
字母: Ff Ll Mm Nn Ss Xx Zz
音标: [ef] [el] [em] [en] [es] [eks] [zed]

4) 含元音音素[ju:]
字母: Uu Qq Ww
音标: [ju:] [kju:] [`d∧blju:]

5) 含元音音素[ai]
字母: Ii Yy
音标: [ai] [wai]


星期四, 一月 08, 2009

怎样正确使用标准水银柱血压计

步 骤
  1.静坐休息15分钟以上。测前30分钟不吸烟,不饮浓茶。
  2.至少测量两次,间隔1~2分钟,如两次测量结果相差较大,应再次测量。
  3.采用标准袖带(12~13cm宽,35cm长),当病人上臂较粗或较细时,应分别采用较大或较小的袖带,儿童应采用较小的袖带。
  4.无论病人采取何种体位,上臂的袖带均应与心脏齐平。
  5.第一次打气可将水银柱打到180~200毫米汞柱,慢慢放气,当听到搏动音出现,即为收缩压;再往下放,当完全听不到搏动音为舒张压。
  6.第一次测量,应测两边手臂,两臂血压差不应>10毫米汞柱,一般按较高侧手臂以便固定测量。
  7.对老人、糖尿病人当卧立位改变时出现症状,如:头晕、眼花等,应测量由平卧10~20分钟后测定卧位到立位7分钟和5分钟的血压。

注意点
  ●天冷时,不能怕麻烦,不愿意脱衣,卷起多层衣袖,造成袖带下缘低于肘横纹,造成测量的血压偏低。
  ●必须与肘橫纹内侧用手指摸到肱动脉搏动处,再将听诊器放在此处测压。
  ●放气不能过快,否则会造成6~8毫米汞柱的误差。
●注意水银柱开关:测量前要打开,测量后要将水银柱侧过来,放到零点,再关闭;否则会引起水银外漏。水银有毒,并且由于水银减少而造成测压不准。
●用后轻轻关闭,防止玻璃柱压碎。

高血压

高血压饮食注意事项:

1、高血压饮食限制钠盐的摄入
饮食应以清淡为宜,少吃咸食,吃盐过多,会使血管硬化和血压升高,每天吃盐应以5克以下为宜。  

2、高血压饮食少吃甜食
甜食含糖量高,可在体内转化成脂肪,容易促进 动脉硬化。  

3、高血压饮食少吃动物脂肪
动物含胆固醇量高,可加速动脉硬化。如肝、脑、心等应少吃。  

4、高血压戒烟少酒
有烟酒嗜好的高血压患者,会因烟酒过多引心肌梗塞,脑中风。  

5、高血压饮食宜多食钾食物
钾在体内能缓冲纳的食物有:黄豆、小豆、番茄、西葫芦、芹菜、鲜蘑菇及各种绿叶蔬菜;水果有橘子、苹果、香蕉、梨、猕猴桃、柿子、菠萝、核桃、西瓜等。  

6、高血压饮食宜多吃含优质蛋白和维生素的食物。如鱼、牛奶、瘦肉、鸡蛋、豆类及豆制品。  

7、高血压饮食宜食钙食物
美国医学专家认为,高血压患者每天坚持食入高钙食物,能使2/3左右的人受到明显的降压效果。含钙的食物很多,如奶制品、豆制品、芝麻酱、虾皮、海带、骨头汤、黑木耳、核桃、沙丁鱼、鸡蛋等均含钙丰富。
高血压症状:高血压的症状因人而异。早期可能无症状或症状不明显,仅仅会在劳累、精神紧张、情绪波动后发生血压升高,并在休息后恢复正常。随着病程延长,血压明显的持续升高,逐渐会出现各种症状。此时被称为缓进型高血压病。
  缓进型高血压病常见的临床症状有头痛、头晕、注意力不集中、记忆力减退、肢体麻木、夜尿增多、心悸、胸闷、乏力等。部分症状不是由高血压直接引起的,而是高级神经功能失调所致。头晕和头痛是高血压最多见的脑部症状,大部分患者表现为持续性沉闷不适感,经常头晕可妨碍思考,降低工作效率,注意力不集中,记忆力下降,尤以近期记忆力减退为甚。长期的高血压导致脑供血不足,也是引起头晕的原因之一。有些长期血压增高的患者对较高血压已适应,当服降压药将血压降至正常时,也会因脑血管调节的不适应产生头晕。当血压降得太低,有时也会感到头晕,这与脑供血不足有关。头痛可表现为持续性纯痛或搏动性胀痛,甚至有时引起恶心、呕吐,多因血压突然升高使头部血管反射性强烈收缩所致,疼痛的部位可在两侧太阳穴或后脑。
  出现胸闷心悸意味着患者的心脏受到了高血压的影响,血压长期升高会致使左心室扩张或者心肌肥厚,这都导致心脏的负担加重,进而发生心肌缺血和心律失常,患者就会感到胸闷心悸。
  另外由于脑神经功能紊乱,可出现烦躁、心悸、失眠、易激动等症状;全身小动脉痉挛以及肢体肌肉供血不足,可导致肢体麻木,颈背肌肉紧张、酸痛;原来鼻中隔部位血管存在缺陷的患者易发生鼻出血。
  当血压突然升高到一定程度时甚至会出现剧烈头痛、呕吐、心悸、眩晕等症状,严重时会发生神志不清、抽搐。这就属于急进型高血压和高血压危重症,多会在短期内发生严重的心、脑、肾等器官的损害和病变,如中风、心梗、肾衰等。
  因此,一旦出现上述症状时,必须尽早检查治疗,以防止靶器官损害以及预防高血压危象或高血压脑病的发生。有不少高血压病患者不论是在早期或已有严重高血压,都无自觉症状,直至发生中风或因患其他疾病测血压时才发现就太晚了。所以进行定期体格检查以早期诊断治疗高血压对维护身体健康是必不可少的。
  此外,症状与血压升高的水平并无一致的关系。高血压病患者不能以症状的轻重来估计血压的高低和决定降压药物的服用剂量
高血压并发症:高血压是以体循环动脉压增高为主要表现的临床综合征,是最常见的心管疾病。可分为原发性及继发性两大类。 在绝大多数患者中,高血压的病因不明,称之为原发性高血压,占总高血压患者的95 %以上;在不足5%患者中, 血压升高是某些疾病的一种临床表现本身有明确而独立的病因,称为继发性高血压。近年来,尽管人们对高血压的研究或认识已有很大提高,相应的诊断或治疗方法也不断进步,但它迄今仍是心血管疾病死亡的主要原因之一 。 高血压病病人的主观症状和血压增高的程度并无明显关系,约半数病人无明显症状,只是在体格检查或因其他疾病就医检测血压才发现有高血压,少数病人则在出现心、脑、肾等器官的并发症时才明确高血压病的诊断。  高血压病病人常见临床表现有头痛,多发生在后脑部,尤易发生在睡眠时,还可有头晕、头胀、颈部扳住感、耳鸣、眼花、健忘、注意力不集中,失眠、烦闷、乏力、四肢麻木、心悸等。随着病情的长期发展,血压明显而持续升高,则可出现脑、心、肾、眼底等器质情损害和功能障碍,并出现相应的临床症状,如并发脑血管病时,轻者眩晕,失语,口角歪斜等(但可在数分钟至数天内逐渐恢复)重者突然肢体偏瘫,口角歪斜,呕吐、大便失禁,昏迷。心脏受累则可导致心功能不全,出现心悸,脑闷,活动后气急,甚至夜间阵发性呼吸困难。  肾脏受累时,可有蛋白尿,血尿,多尿,夜尿等。
高血压居高不下的原因:血压居高不下会对心、脑、肾等器官产生严重损害,导致一系列并发症,如心力衰竭、脑卒中、肾功能不全等。因此,长期而有效地控制血压对病人的预后至关重要。但在治疗过程中,我们发现不少高血压病人反映:吃了不少药,血压也控制不理想,不是降不下来,就是忽高忽低。这是怎么回事呢?
  原因一:白大衣效应。有些人一见到医生就紧张,血压也随之升高,甚至服用降压药后,也无济于事,医生一量血压就高。这部分"患者"在家里自测血压是正常的,24小时动态监测血压也在正常范围内。这种高血压在医学上被称为:"白大衣高血压",显然这是一种伪高血压。 对策:通过心理疏导,消除精神紧张。因不是真正的高血压故无需药物治疗。
原因二:忽视非药物治疗。现已知道,高血压除与遗传有关外,与不良的生活方式也有很大关系。精神紧张、食盐过多、吸烟酗酒、缺乏运动、身体超重等因素均可导致血压升高,并使降压药物的疗效降低。
  对策:改善生活方式,也即我们常说的"非药物疗法",包括合理膳食、适量运动,戒烟限酒、心理平衡。具体饮食方面,应该低盐(每日不超过5~6克)、低脂肪、适当增加钾与钙的摄入,运动项目最好选择有氧代谢运动(如快步走、慢跑、游泳、骑自行车等),但不宜做剧烈运动。
  原因三:药物使用不当。其中包括:药物用量不足、剂量偏小;单一药物疗效不佳时,未采取联合用药;不了解药物代谢的半衰期,服用间隔过长;服药依从性差,经常漏服或未坚持长期治疗;其他药物的拮抗作用,比如拟交感神经药中的麻黄素,非甾体类消炎药消炎痛、布洛芬等,避孕药、糖皮质激素等本身都有升压作用,若与降压药联用,将会使后者的疗效大打折扣。
  对策:遵循个体化用药原则,从小剂量的单一药物开始,逐渐加量,如果效果仍不理想,考虑不同种类的降压药联合应用。提倡使用长效制剂,注意药物的合理配伍。
  原因四:肾损害对高血压治疗的影响。研究证实,长期高血压可致肾小动脉硬化,使肾脏血流减少而受损;肾损害反过来又能加重高血压,形成恶性循环,给降压治疗带来困难。
  对策:调整改善肾功能,选择对肾脏有保护作用的降压药物,如血管紧张素转换酶抑制剂洛汀新等,同时可配合使用利尿剂双氢克尿噻等,以减轻水钠潴留。需要强调的是,对高血压的治疗一定要从早期开始并持之以恒,惟有如此,才能最大限度地减少高血压对靶器官的损害。
  原因五:继发性高血压未针对病因治疗。继发性高血压约占全部高血压病人的5%,发病年龄较轻,均由某些特定的病因引起,常见的有两大类,即肾性高血压由急慢性肾炎、肾囊肿、肾动脉狭窄等引起,内分泌性高血压由嗜铬细胞瘤、原发性醛固酮增多症、皮质醇增多症、甲亢等引起。继发性高血压往往血压长期居高不下,药物治疗很难奏效。 对策:明确病因并彻底祛除(包括手术治疗),血压即可恢复正常。当然,有些因病变特殊,其原发病无法根治,血压亦难以控制。
  原因六:药品本身质量有问题:如过期、变质及假冒伪劣药品,病人服用了非但起不到治疗作用,反而还会引起不良反应。
  对策:提高自我保护意识,看病要去正规医院,彻底杜绝假冒伪劣药品,当然还要靠行政执法部门及全社会的共同努力。

对中国雅虎发展方向的一点个人看法

自从几年前阿里巴巴收购中国雅虎后,中国雅虎的方向一直摇摆不定,从搜索到门户,从门户到社区,去年开发了一个产品,称为“站长天下”,我觉得该产品很好,有点类似Blogger的思路,全球60多亿人,每个人都可以在internet上发表自己的看法,记录自己在工作,生活和学习中的灵感和收获并分享知识,是互联网未来的发展方向,并且该产品还可以紧密联系阿里巴巴集团的阿里妈妈,支付宝,淘客,企业建站等产品。可惜现在中国雅虎又开发了一个产品“雅虎关系”,而把“站长天下”贬为三线产品,且有最终取缔“站长天下”的趋势。我很为中国雅虎的折腾感到可惜,总是变来变去,用户有被耍猴的感觉,说实话,如果不是中国雅虎的邮箱有很大的用户群,中国雅虎不会有这么大的流量。

Google AdSense 帐户申请失败

我昨天申请Google AdSense帐户,得到Google公司的电子邮件自动回复,内容如下:
xxx:您好!

非常感谢您对 Google AdSense 感兴趣。在审核您的申请后,我们的专家发现它不
符合我们的计划标准。因此,我们无法批准您参与此计划。

我们相信我们所制定的政策有助于确保发布商和广告客户的 Google 广告的效果。
我们会对所有的发布商进行审核,并且保留拒绝任一申请的权利。随着我们的发
展,我们也许能够将此计划扩大,以接受更多的网页内容更为丰富多彩的网站发布
商。

请注意,我们也许无法回答有关我们决策的具体原因的查询。非常感谢您的理解。

衷心感谢,

Google AdSense 小组敬上


我不知道我的申请由于什么原因被拒绝,真的想知道其中的缘由。有没有谁可以帮我找找原因?

星期三, 一月 07, 2009

基于单片机的红外遥控信号自学习及还原新方法

1概述
随着远程教育体系的不断发展和日趋完善,多媒体教学手段在各级各类学校都得到了广泛应用。近年来,我们在进行多媒体教学系统的开发和研制过程中,经常遇到多种用于教学中的红外遥控设备,如:数字投影机、DVD、VCD、录像机、电视机等,由于各种设备都自带遥控器,而且不同的设备所遵循的红外遥控规程也不尽相同,操纵这些设备得使用多种遥控器,给使用者带来了诸多不便。我们采用集中控制各设备的方式如图(1)所示解决了该问题。集中控制各设备的方法是首先对各设备的红外遥控信号进行识别并存储(自学习),然后在需要时进行还原。图(1)中由PC或集中控制器发送设备号及控制命令号至红外遥控信号自学习及还原电路,再由自学习及还原电路恢复对应的红外遥控信号,并发射出去控制指定的红外遥控设备动作。

2红外遥控信号的自学习及还原

2.1红外遥控信号编码、发射原理
通常,红外遥控器是将遥控信号(二进制脉冲码)调制在38KHz的载波上,经缓冲放大后送至红外发光二极管,转化为红外信号发射出去的。二进制脉冲码的形式有多种,其中最为常用的是PWM码(脉冲宽度调制码)和PPM码(脉冲位置调制码)。前者以宽脉冲表示1,窄脉冲表示0,如图(2)所示。后者脉冲宽度一样,但是码位的宽度不一样,码位宽的代表1,码位窄的代表0。
遥控编码脉冲信号(以PPM码为例)通常由引导码、系统码、系统反码、功能码、功能反码等信号组成,引导码也叫起始码,由宽度为9ms的高电平和宽度为4.5ms的低电平组成(不同的遥控系统在高低电平的宽度上有一定区别),用来标志遥控编码脉冲信号的开始。系统码也叫识别码,它用来指示遥控系统的种类,以区别其它遥控系统,防止各遥控系统的误动作。功能码也叫指令码,它代表了相应的控制功能,接收机中的微控制器可根据功能码的数值去完成各种功能操作。系统反码与功能反码分别是系统码与功能码的反码,反码的加入是为了能在接收端校对传输过程中是否产生差错。为了提高抗干扰性能和降低电源消耗,将上述的遥控编码脉冲对频率为38KHz(周期为26.3us)的载波信号进行脉幅调制(PAM),再经缓冲放大后送到红外发光管,将遥控信号发射出去。

2.2红外遥控信号自学习及还原的硬件实现
根据遥控信号编码和发射过程,遥控信号的识别——即解码过程应是去除38KHz载波信号后识别出二进制脉冲码中的0和1。由MCS—51系列单片机AT89C51、一体化红外接收头、存储器、还原调制与红外发光管驱动电路组成.。
一体化红外接收头采用SIEMENS SFH 506-38,它负责红外遥控信号的解调。将调制在38kHz上的红外脉冲信号解调并反向后再输入到AT89C51的INT0(P3.2)引脚,由单片机进行高电平与低电平宽度的测量。
图中使用具有I2C总线接口的E2PROM 芯片24C32作为存储器,其容量为4KB,
用来保存识别出来的遥控信号的高电平与低电平宽度数据。通常遥控信号的二进制脉冲码长为32位,每位由一个高电平与一个低电平组成,应保存的信号宽度数据为64个,再加上引导码2个数据,共计66个数据,每个数据用一个字节来表示,一个遥控信号命令就需要66个字节来保存。考虑到不同的遥控系统有一定的区别,有些遥控信号命令长度较长,所以存储空间应适当留有余量。在实际应用中,可根据红外遥控设备的数量及每个设备的遥控命令数量等具体情况来决定E2PROM 芯片的容量和型号。
遥控信号的还原和发射是通过P0口(如图中为P0.1)输出二进制脉冲码(高电平与低电平的维持时间为识别时保存的一组宽度数据)与38KHz调制脉冲相与,即P0口输出高电平允许38KHz调制脉冲通过,P0口输出低电平关断38KHz调制脉冲。调制后的信号经驱动后通过红外发光管,发射红外遥控信号去控制红外遥控设备。图中LED发光管用来指示红外遥控信号,同时用来指示自学习中的各状态。
P2口连结一组按钮,按钮的数量与需要集中控制的红外遥控设备数量相同,用来控制单片机进入或退出自学习状态,按钮号即为设备号。
单片机同时通过串行口连接上位机PC或集中控制器接收控制命令,上位机或集中控制器通过RS—485总线与单片机通信,从而实现了红外遥控设备的远程控制。

2.3 软件设计
单片机上电复位后,首先对其内部定时器、串行口进行初始化,并允许串行口中断。然后监测P2口,当进入自学习状态(P2口有一引脚输入为低电平并维持1S以上)时,采用定时器定时、软件计数的方法,测量INT0引脚上输入脉冲的高、低电平的宽度。INT0引脚平时为高电平,当接收到红外遥控信号时,由于一体化红外接收头的反向作用,INT0引脚下跳至低电平,此为引导码。将测得的高低电平的宽度保存在存储器中,并将每次测得的低电平的宽度与引导码低电平宽度比较,若相等则表示一遥控命令码识别、存储(自学习)结束。再次监测P2口该引脚,若为低电平并维持1S以上,则退出自学习状态。否则,进一步自学习下一红外遥控命令码。
串行口中断服务程序主要是根据接收到的设备号及命令号查表得到一组事先存储的高、低电平宽度数据,然后在P0口还原出红外遥控信号去控制红外遥控设备按指定的命令动作,即红外遥控信号的还原。

3结束语
我们用上述红外遥控信号的自学习及还原方法,成功地实现了新科VCD、DVD、金正DVD、松下系列录像机以及多种型号数字投影机、彩色电视机遥控信号的自学习和还原,从而在多媒体远程教学系统中实现了可红外遥控设备的远程控制。

AT89C2051 Clock Alarm System

This project uses the Atmel AT89C2051 Microcontroller with the Dallas DS1307 64 X 8 Serial Real Time Clock IC to build a Battery Backed Alarm Clock.

THE DS1307

The DS1307 is a Serial Timekeeping Chip that will count seconds, minutes, hours, date of the month, month, day of the week, and year with leap year compensation. It has 56 bytes of nonvolatile RAM for data storage, 2-wire serial interface, a programmable square wave output, and automatic power fail detect and switch circuitry. The DS1307 requires the use of a 32.768 KHz quartz crystal with a load capacitance of 12.5pF for the internal clock oscillator circuitry. An external 3 volt battery is used to maintain the internal RAM data.

THE ATMEL AT89C2051 MICROCONTROLLER

The AT89C2051 is an 8-Bit Microcontroller with 2Kbytes Flash Program Memory. I prefer using this micro due to its quick programming and ease of use.

NOTES ON OPERATION

Four normally open pushbutton switches are used for user input to set the time/date and alarm time. The following illustrates the functions of each pushbutton switch.

P3.0 switch #1 will increment the time/date etc..
P3.1 switch #2 will decrement the time/date etc..
P3.2 switch #3 acts as the ENTER key, push this switch when you are finished with each setting.
P1.2 switch #5 puts the clock into set, or display alarm time mode.

Alway press the ENTER key when you finish each setting to move to the next setting. You can use the ENTER key to move to each individual area of the display until you get to the function you wish to set. Operation of the alarm is handled by the DS1307 pin-7 SQW/OUT. This pin is a programmable square wave output.

The SQW/OUT pin is programmed to output a 1Hz square wave and pulse the alarm buzzer at a rate of 1 beep per second for the alarm. This pin may be programmed to output different frequencies of 1Hz, 4KHz, 8KHz and 32KHz. using these higher frequencies however would result in a steady tone for the alarm buzzer, instead of the intermittent beep like most alarm clocks.

You can refer to the schematic to see how the 2N2222 NPN Transistor is setup to drive the alarm buzzer. Make sure to use an alarm buzzer with an internal resistance sufficient to keep from over loading the transistor.

ALARM OPERATION

The code that comes with this project will sound the alarm buzzer for 1 minute, then turn the alarm off. You can easily modify this routine to leave the alarm on for any length of time. The time and alarm settings you set are stored inside the DS1307 nonvolatile RAM area and will remain unless you remove all power from the circuit, including the external battery backup.

The DS1307 has an internal power sense circuit that will automatically switch to the external battery power supply when it detects a power failure. I have included the complete data sheets for the DS1307 and the Atmel AT89C2051 in the file clock.zip to help you with this project.

The code for this project will also require that you use a 16 X 2 LCD, unless you modify it to use another. The LCD is operated in 4-Bit Mode because of limited I/O using the AT89C2051 Microcontroller. You can use any 8051 derivative Microcontroller for this project that you would like, the code should be compatible with any 8051 variant. You may want to modify the pin assignments for whatever I/O you will have available. Any 8051 type micro with 13 available I/O pins will work just fine.

PARTS LIST

1 Atmel AT89C2051 Microcontroller, or any 8051 variant with 13 available I/O pins.
1 DS1307 Serial Real Time Clock I.C., Dallas Semiconductors 1-800-336-6933.
1 32.768KHz Quartz Crystal, 12.5pF Load Capacitance, Digi-Key part #SE3203-ND $1.35 each
1 11.0592MHz crystal for the microcontroller
1 3 Volt Battery, for the battery backup circuit.
1 16 X 2 LCD

VC++ 的串口通讯

在VC++中有两种方法可以进行串口通讯。一种是利用Microsoft公司提供的ActiveX控件 Microsoft Communications Control。另一种是直接用VC++访问串口。下面将简述这两种方法。

  一、Microsoft Communications Control

  Microsoft公司在WINDOWS中提供了一个串口通讯控件,用它,我们可以很简单的利用串口进行通讯。在使用它之前,应将控件加在应用程序的对话框上。然后再用ClassWizard 生成相应的对象。现在我们可以使用它了。

  该控件有很多自己的属性,你可以通过它的属性窗口来设置,也可以用程序设置。我推荐用程序设置,这样更灵活。

   SetCommPort:指定使用的串口。

   GetCommPort:得到当前使用的串口。

   SetSettings:指定串口的参数。一般设为默认参数"9600,N,8,1"。这样方便与其他串口进行通讯。

   GetSettings:取得串口参数。

   SetPortOpen:打开或关闭串口,当一个程序打开串口时,另外的程序将无法使用该串口。

   GetPortOpen:取得串口状态。

   GetInBufferCount:输入缓冲区中接受到的字符数。

   SetInPutLen:一次读取输入缓冲区的字符数。设置为0时,程序将读取缓冲区的全部字符。

   GetInPut:读取输入缓冲区。

   GetOutBufferCount:输出缓冲区中待发送的字符数。

   SetOutPut:写入输出缓冲区。

  一般而言,使用上述函数和属性就可以进行串口通讯了。以下是一个范例。

#define MESSAGELENGTH 100

class CMyDialog : public CDialog
{
protected:
VARIANT InBuffer;
VARIANT OutBuffer;
CMSComm m_Com;
public:
......
}

BOOL CMyDiaLog::OnInitDialog()
{
CDialog::OnInitDialog();
m_Com.SetCommPort(1);
if (!m_Com.GetPortOpen()) {
m_Com.SetSettings("57600,N,8,1");
m_Com.SetPortOpen(true);
m_Com.SetInBufferCount(0);
SetTimer(1,10,NULL);
InBuffer.bstrVal=new unsigned short[MESSAGELENGTH];
OutBuffer.bstrVal=new unsigned short[MESSAGELENGTH];
OutBuffer.vt=VT_BSTR;
}
return true;
}

void CMyDiaLog::OnTimer(UINT nIDEvent)
{
if (m_Com.GetInBufferCount()>=MESSAGELENGTH) {
InBuffer=m_Com.GetInput();
// handle the InBuffer.
// Fill the OutBuffer.
m_Com.SetOutput(OutBuffer);
}
CDialog::OnTimer(nIDEvent);
}




  用该控件传输的数据是UNICODE格式。关于UNICODE和ANSI的关系和转换请参看MSDN。

  关于该控件的其他详细资料请查看MSDN关于COMM CONTROL部分。

二、直接用VC++访问串口。

  在VC++中,串口和磁盘文件可以统一的方式来简单读写。这两者几乎没有什么不同,只是在WINDOWS 9X下磁盘文件只能做同步访问,而串口只能做异步访问。

  CreateFile:用指定的方式打开指定的串口。通常的方式为

  m_hCom = CreateFile( "COM1", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL );

  m_hCom为文件句柄。GENERIC_READ | GENERIC_WRITE指定可以对串口进行读写操作。第三个参数0表示串口为独占打开。OPEN_EXISTING表示当指定串口不存在时,程序将返回失败。 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED则表示文件属性。当打开串口时,必须指定 FILE_FLAG_OVERLAPPED,它表示文件或设备不会维护访问指针,则在读写时,必须使用OVERLAPPED 结构指定访问的文件偏移量。

   ReadFile:读取串口数据。

   WriteFile:向串口写数据。

   CloseHandle:关闭串口。

  COMMTIMEOUTS:COMMTIMEOUTS主要用于串口超时参数设置。COMMTIMEOUTS结构如下:

typedef struct _COMMTIMEOUTS {
DWORD ReadIntervalTimeout;
DWORD ReadTotalTimeoutMultiplier;
DWORD ReadTotalTimeoutConstant;
DWORD WriteTotalTimeoutMultiplier;
DWORD WriteTotalTimeoutConstant;
} COMMTIMEOUTS,*LPCOMMTIMEOUTS;


  ReadIntervalTimeout:两字符之间最大的延时,当读取串口数据时,一旦两个字符传输的时间差超过该时间,读取函数将返回现有的数据。设置为0表示该参数不起作用。

  ReadTotalTimeoutMultiplier:读取每字符间的超时。

  ReadTotalTimeoutConstant:一次读取串口数据的固定超时。所以在一次读取串口的操作中,其超时为ReadTotalTimeoutMultiplier乘以读取的字节数再加上 ReadTotalTimeoutConstant。将ReadIntervalTimeout设置为MAXDWORD,并将ReadTotalTimeoutMultiplier 和ReadTotalTimeoutConstant设置为0,表示读取操作将立即返回存放在输入缓冲区的字符。

  WriteTotalTimeoutMultiplier:写入每字符间的超时。

  WriteTotalTimeoutConstant:一次写入串口数据的固定超时。所以在一次写入串口的操作中,其超时为WriteTotalTimeoutMultiplier乘以写入的字节数再加上 WriteTotalTimeoutConstant。

  SetCommTimeouts函数可以设置某设备句柄的超时参数,要得到某设备句柄的超时参数可以用GetCommTimeouts函数。

  DCB:DCB结构主要用于串口参数设置。该结构太庞大,这里就不一一讲述了,有兴趣者可查看MSDN关于DCB的描述。其中下面两个是比较重要的属性。

  BaudRate:串口的通讯速度。一般设置为9600。

  ByteSize:字节位数。一般设置为8。

  DCB结构可以用SetCommState函数来设置,并可以用GetCommState来得到现有串口的属性。

  SetupComm:设置串口输入、输出缓冲区。

  OVERLAPPED:保存串口异步通讯的信息。具体结构如下:

typedef struct _OVERLAPPED {
DWORD Internal;
DWORD InternalHigh;
DWORD Offset;
DWORD OffsetHigh;
HANDLE hEvent;
} OVERLAPPED;


  Internal,InternalHigh是保留给系统使用的,用户不需要设置。

  Offset,OffsetHigh是读写串口的偏移量,一般设置OffsetHigh为NULL,可以支持2GB数据。

  hEvent读写事件,因为串口是异步通讯,操作可能被其他进程堵塞,程序可以通过检查该时间来得知是否读写完毕。事件将在读写完成后,自动设置为有效。

  通过以上这些函数和结构,我们就可以通过串口进行通讯了,现在我们具体看下面的实例:

BOOL CSerial::Open( int nPort, int nBaud )
{
if( m_bOpened ) return( TRUE );

char szPort[15];
DCB dcb;

wsprintf( szPort, "COM%d", nPort );
m_hComDev = CreateFile( szPort, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL );
if( m_hComDev == NULL ) return( FALSE );

memset( &m_OverlappedRead, 0, sizeof( OVERLAPPED ) );
memset( &m_OverlappedWrite, 0, sizeof( OVERLAPPED ) );

COMMTIMEOUTS CommTimeOuts;
CommTimeOuts.ReadIntervalTimeout = 0xFFFFFFFF;
CommTimeOuts.ReadTotalTimeoutMultiplier = 0;
CommTimeOuts.ReadTotalTimeoutConstant = 0;
CommTimeOuts.WriteTotalTimeoutMultiplier = 0;
CommTimeOuts.WriteTotalTimeoutConstant = 5000;
SetCommTimeouts( m_hComDev, &CommTimeOuts );

m_OverlappedRead.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
m_OverlappedWrite.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );

dcb.DCBlength = sizeof( DCB );
GetCommState( m_hComDev, &dcb );
dcb.BaudRate = nBaud;
dcb.ByteSize = 8;
if( !SetCommState( m_hComDev, &dcb ) ||
!SetupComm( m_hComDev, 10000, 10000 ) ||
m_OverlappedRead.hEvent == NULL ||
m_OverlappedWrite.hEvent == NULL ){
DWORD dwError = GetLastError();
if( m_OverlappedRead.hEvent != NULL ) CloseHandle( m_OverlappedRead.hEvent );
if( m_OverlappedWrite.hEvent != NULL ) CloseHandle( m_OverlappedWrite.hEvent );
CloseHandle( m_hComDev );
return FALSE;
}

m_bOpened = TRUE;

return m_bOpened;

}

int CSerial::InBufferCount( void )
{

if( !m_bOpened || m_hComDev == NULL ) return( 0 );

DWORD dwErrorFlags;
COMSTAT ComStat;

ClearCommError( m_hIDComDev, &dwErrorFlags, &ComStat );

return (int)ComStat.cbInQue;

}

DWORD CSerial::ReadData( void *buffer, DWORD dwBytesRead)
{

if( !m_bOpened || m_hComDev == NULL ) return 0;

BOOL bReadStatus;
DWORD dwErrorFlags;
COMSTAT ComStat;

ClearCommError( m_hComDev, &dwErrorFlags, &ComStat );
if( !ComStat.cbInQue ) return 0;

dwBytesRead = min(dwBytesRead,(DWORD) ComStat.cbInQue);

bReadStatus = ReadFile( m_hComDev, buffer, dwBytesRead, &dwBytesRead, &m_OverlappedRead );
if( !bReadStatus ){
if( GetLastError() == ERROR_IO_PENDING ){
WaitForSingleObject( m_OverlappedRead.hEvent, 2000 );
return dwBytesRead;
}
return 0;
}

return dwBytesRead;

}

DWORD CSerial::SendData( const char *buffer, DWORD dwBytesWritten)
{

if( !m_bOpened || m_hComDev == NULL ) return( 0 );

BOOL bWriteStat;

bWriteStat = WriteFile( m_hComDev, buffer, dwBytesWritten, &dwBytesWritten, &m_OverlappedWrite );
if( !bWriteStat){
if ( GetLastError() == ERROR_IO_PENDING ) {
WaitForSingleObject( m_OverlappedWrite.hEvent, 1000 );
return dwBytesWritten;
}
return 0;
}
return dwBytesWritten;

}

  上述函数基本实现串口的打开,读写操作。

学习型遥控器

最近在给一个客户做学习型遥控器的方案,大部分品牌的彩电都可以控制,但有几个品牌学习状态不稳定,始终没有找到原因,后来静下心来仔细测了一下,发现它们的载波不同,我用的是38KHz载波,但这个学习状态不稳定的遥控器它的载波是40KHz,原来如此,载波改过来后就OK了。

空调遥控器均为38K载波,85%的其它家电为38K或40K载波。

空调遥控器不同于其它家电遥控器(如彩电),空调遥控器发出的编码包含当前状态的多种信息,而彩电发出的代码是一键一码,所以必需把所有可能的情况保存下来,但需要太多的存储空间。

三种万用遥控器的比较分析

下面分析家用电器红外线遥控器一般原理的基础上,探讨了多合一遥控器的三种实现方式,比较三者各自的优缺点,重点介绍了最新开发出的代码型遥控器的工作原理与产品应用前景。

一,多合一遥控器的出现
二,红外遥控器的工作原理
三,万用遥控器(固定码遥控器)
四,学习型遥控器
五,代码型遥控器
六,代码型遥控器应用前景

一、 多合一遥控器的出现

电视机、录像机、卫星接收机、机顶盒、VCD/DVD、LD/CD及组合音响等设备的不断普及,而这些家用电器无一例外的具备遥控功能。能同时控制多种遥控型设备的遥控器,称之为多合一遥控器(ALL-ON-ONE)。最早出现这类产品的遥控器就是通常所说的万用(能)遥控器(URC,Universal Remote Control),实际上,它并不能做到“万能”,更为准确地应称作为固定码万用遥控器(Preprogrammed URC)。随后,学习型遥控器(Recordable URC)又出现了。但学习型遥控器存在着操作学习过程繁琐,不十分可靠等缺点。考虑到上述两种多合一遥控器的缺点而从一个全新的角度开发出的新一代代码型遥控器(Code-based URC)便应运而生。

万用遥控器为什么不能做到万用?学习型遥控器可以不断学习为什么还不能让人满意?代码型遥控器又有哪些特点和优点?这就是本文需要探讨的问题,而要搞清楚这些问题,首先必须了解红外遥控器的工作原理。

二 、红外遥控器

遥控器其核心元器件就是编码芯片,将需要实现的操作指令例如选台、快进等事先编码,设备接收后解码再控制有关部件执行相应的动作。显然,接收电路及CPU也是与遥控器的编码一起配套设计的。编码是通过载波输出的,即所有的脉冲信号均调制在载波上,载波频率通常为38K。载波是电信号去驱动红外发光二极管,将电信号变成光信号发射出去,这就是红外光,波长范围在840nm到960nm之间。在接收端,需要反过来通过光电二极管将红外线光信号转成电信号,经放大、整形、解调等步骤,最后还原成原来的脉冲编码信号,完成遥控指令的传递,这是一个十分复杂的过程。

红外线发射管通常的发射角度为30-45度之间,角度大距离就短,反之亦然。遥控器在光轴上的遥控距离可以大于8.5米,与光轴成30度(水平方向)或15度(垂直方向)上大于6.5米,在一些具体的应用中会充分考虑应用目标,在距离角度之间需要找到某种平衡。

要实现多合一遥控器,涉及到如下几个主要问题:

# 遥控器发出的编码信号驱动红外线发射管,必须发出波长范围在940nm左右的的红外光线,因为红外线接收器的接收二极管主要对这部分红外光信号敏感,如果波长范围不在此列,显然无法达到控制之目的。不过,几乎所有的红外家电遥控器都遵循这一标准。正因为有这一物理基础,多合一遥控器才有可能做成。

# 遥控器发出一串编码信号只需要持续数十ms的时间,大多数是十多ms或一百多ms重复一次,一串编码也就包括十位左右到数十位二进制编码,换言之,每一位二进制编码的持续时间或者说位长不过2ms左右,频率只有500kz这个量级,要发射更远的距离必需通过载波,将这些信号调制到数十khz,用得最多的是38khz,大多数普通遥控器的载波频率是所用的陶瓷振荡器的振荡频率的1/12,最常用的陶瓷振荡器是455khz规格,故最常用的载波也就是455khz/12=37.9khz,简称38k载波。此外还有480khz(40k)、440khz(37k)、432khz(36k)等规格,也有200k左右的载波,用于高速编码。红外线接收器是一体化的组件,为了更有针对性地接收所需要的编码,就设计成以载波为中心频率的带通滤波器,只容许指定载波的信号通过。显然这是多合一遥控器应该满足的第二个物理条件。不过,家用电器多用38k,很多红外线接收器也能很好地接收频率相近的40k或36k的遥控编码。

# 一个设备受控,除了满足上面提到的两个基本物理条件外,最重要的变化多种多样的当然应该是遥控器发出一串二进制编码信号了,这也是不同的遥控器不能相互通用的主要原因。由于市场上出现成百上千的编码方式并存,并没有一个统一的国际标准,只有各芯片厂商事实上的标准,这也是模拟并替换各种原厂遥控器最大的难点。随着技术的不断发展,很多公司开发家电设备的遥控子系统时还不采用通用的编码芯片,而是用通用的单片机随心所欲地自编一些编码,这就使通用遥控的问题更加复杂化了。

# 采用同样的编码芯片,也不意味着可以通用,因为还有客户码。客户码设计的最初本意就是为了不同的设备可以相互区分互不干扰。最初芯片厂商会从全局考虑给不同的家电厂商安排不同的客户码以规范市场,例如录像机和电视机就用不同的设备码,给甲厂分配的设备码和乙厂分配的设备码就区分在不同的范围内。

# 采用同样的编码芯片、同样的客户码下,也不能意味着一定可以通用,因为对命令码的分配与使用上,仍然是没有固定的模式可以遵循,遥控器编码芯片简单的支持数十种命令码,多的上千种,但遥控器往往只有数十个键,甚至只有几个键,如何从中选取这数十个键,这些键如何分配使用,不同的系统设计师都自搞一套,这样一来事情就更复杂化了。

下面以三菱公司推广的M50462遥控编码芯片为例,具体说明红外线遥控的基本工作原理。

需要说明的是,介绍工作原理的目的是为了便于理解后面将要介绍的三种多合一遥控器实现方式的差别,与此无关的一些细节就给予忽略。例如关于0和1的编码有移频键控FSK、双相编码和脉距编码等多个系列,但对多合一遥控器的实现没有明显的影响,就不另做介绍。

图一 是遥控编码芯片的应用例子
图二 每一位的编码方式(以480khz为例)
图三 一个完整的帧编码三 万用遥控器(固定码遥控器)
在介绍M50462编码原理的时候可以看到该芯片可以直接支持8x8=64个键, 三菱公司选了其中的部分键定义其功能,形成推荐的标准码表,见表一。万用遥控器就是以此为根据开发设计的。同一种编码芯片M50462,选择不同的客户码(最多4种),选取64键中的32键(假设遥控器做成32键盘,这种选法其方式之多就十分惊人了,也就是64选32的排列问题),还有可能选不同规格的陶瓷振荡器不在此讨论。这些因素考虑进入,就形成了该芯片的一种具体的应用,用一张简单的码表就可以概况。

三菱推荐相应遥控的接收处理系统即三菱M50436-560SP,此外还有东芝TMP47C433AN被选为国内优选线路,松下MN15245SAY系统在国内亦有相当的市场,形成了三种流行的红外线遥控系统。早期很多生产厂商直接引进技术生产电视机。这样一来,采用同一核心技术的电视机其遥控器就基本确定下来了,遥控器可以通用或基本通用。但问题随之而来,家用电器以不再限于电视机和录像机等传统设备,VCD/DVD之类的数字设备大量上市,遥控处理技术不再局限于为数不多的几家大厂商,变成众多的厂商自定规范。而固定码万用遥控器是收集各厂产品的码表写到不可再更改的芯片中去,以后的新产品就无法支持了。这样一来,更加发现所谓的万用遥控器并不能“万用”。

四、 学习型遥控器

学习型遥控器实际含义是记录各种不同类型的遥控器的编码波形,而对一些编码细节不予理会,需要配置较大容量的存储器给予支持,而且这些存储器的内容是可以随时在“学习”中改写的,这样一来通用性大大提高,很快成为多合一遥控器市场的主流产品。

但是,学习型遥控器也存在这明显的缺点:一是学习过程中就只能记录其中的一次按键,在使用过程中发出的码也就始终是一种编码,有些编码芯片按一次键其中的某一位会反复跳变,称之为反转码,学习型遥控器就会出现操作混乱。学习型遥控器面临的另一个问题是帧的重复及部分重复的问题。学习型遥控器面临的第三个困难就是它每次学习的波型含有不可避免的偶然性,很可能某一次学习的波形正好偏离中值很多,但学习型遥控器仍然会忠实地保持这一较大的偏离,控制的效果就可想而知了。

五、 代码型遥控器

针对万用型遥控器和学习型遥控器的不足,一种采用设备码和命令码统一各种遥控编码的代码型遥控方案应运而生。

设计需考虑的问题是如何“同化”不同遥控器发射信号之间的差异。遥控编码方式涉及很多方面,首先是数字0和1的表示(调宽还是调相,脉宽和占空比);其次是帧结构(引导码和结束码,客户码和命令码长度及发送方式);再次是帧间结构(仅发一次还是反复多次,多帧交替发送,帧间间隔变化);最后是载波频率,以38Khz居多,也有40Khz甚至200khz等特殊载波。

设计相应电路和软件时对上述诸多因素加以分析、归纳,将编码特点用一串二进制位表示出来形成设备码,对应于一个具体的遥控器。同一个设备码下也就是同一个遥控器不同的按键则用命令码来表示。代码型遥控器用软件的方式对这些统一的编码进行解释,驱动一个个命令码按指定设备码格式加以“封装”,形成所需要的遥控信号,达到控制家电的目的。

还是以前面的M50462编码芯片为例,其帧结构、0或1编码方式等归结为某种遥控器所有按键的共性部分,即设备码0x030a375c,任何按键信息归结为16位的命令码(不同于帧间的命令码,而是有更广的含义,指遥控编码按键的个性部分),例如按FC和I7相连的键,该芯片用于三菱公司的推荐的电视机遥控中,这个编码0x32用来表示静音,16位的命令码就是0xea4c,这个0xea4c在这里实际上包含了8位客户码0xea和8位命令码0x4c(对应0x32),只不过认为在前发送的是高位而已,按键的命令码为展成二进制就是1110 1010 0100 1100,正好是一个完整的帧编码。这样一来,设备码和命令码就包含了该编码芯片一次完整的发码过程,可以忠实地再现原有的波形,达到控制之目的。

代码型遥控器的编码芯片采用高性能的单片机,配合高精度的石英晶体,振荡频率为数Mhz,大大高于455khz,石英晶体的稳定度在10ppm级别即百万分之十左右,更是学习型遥控器望尘莫及的。

代码型遥控器具有极大的控制灵活性,功能强大,使用方便。一般而言,适合相对单纯的批量使用用户,例如一间酒店,数百套客房,每间客房的电视机、上网的机顶盒都是一样的,厂家或中间商可以十分方便地批量编程定制,而且一经设定,数据不会丢失,长期使用。当然,代码型遥控器编程定制需要专门的知识和设备,对用户有一定的限制,除了酒店之类的实例外,面向家用的组合视听设备,例如家用电脑、电视机、家用投影、DVD、激光视盘等,来自不同的厂家的产品快速集成为一体,由厂家或中间商完成客户化工作,给最终的客户一个整体解决方案,就十分合适了。对有些小批量定制的产品增加遥控器时,代码型遥控器可以轻松替代市面上任何一种普通型遥控器。代码型遥控技术将任何一款遥控器的任何一次编码发送归结为32位的设备码加16位的命令码,仅仅6个字节,同一种遥控器设备码相同,这样一来描述一个32键的遥控器只需要4+32*2=68字节,自然是十分节省存储空间,方便数据交换,而且容易阅读和传播,甚至可以将各种代码放到Internet实现资源共享。

代码型遥控器不仅设备码和命令码具有广泛的通用性,可以控制实现几乎有所的红外线遥控设备,更为重要的是,代码型遥控器采用了外接EEPROM存储器(24C02)的方式,可以随时方便地更换其中的代码,便于快速定制。

图五 代码型遥控器的一种电路板,有两块IC

当然,要定制代码需要专用的设备,这是一个不便之处。完成代码型遥控器的定制即客户化工作需要读码器和编程器,最好也有家电控制器来模拟控制测试,将这三样设备集中起来就形成一种称之为UIR48的设备,UIR表示universal infrared remote control, 48表示代码型遥控器采用6个字节48bits的编码技术,其中包括32bits的设备码和16bits的命令码。

该设备见下图六所示,其中USB接口符合USB1.1标准,与PC机相连,另一端引出三种装置,有一个红外线接收器,运行PC机的软件后用来读取各种不同类型的原始遥控器的编码,有一红外线发射器,读到编码后运行相应的软件通过该设备“重构再现”刚才读到的编码,看能否替代原始遥控器的相应按键控制对应的设备,再有一个端子就是编程端子了,直接插到代码型遥控器的后座在线编程,就像手机的编程一样。读到合适的代码验证设备受控后在线写入代码型遥控器,这就是整个编程定制的过程。

图七代码型遥控器用于酒店客房控制电视机和机顶盒的例子

七、代码型遥控器应用前景

代码型遥控器所用的技术在家电自动控制方面可以发挥优势作用,将其编码芯片由按键扫描输入方式改为UART串行接口输入方式,当任何一个设备或系统需要对各种不同类型的红外线遥控设备实施控制的时候,只需要内置这种带UART接口的代码型红外控制芯片即可轻松达到目的。例如前面提到的要控制采用M50462芯片遥控器对应的电视机静音,这里指用程序控制,就可以用其他控制系统、计算机甚至Internet传输遥控代码(设备码和命令码,多路控制时还需要一个通道号或者说地址号)。实现的方法其实很简单,只需要通过UART输入4字节的设备码和2字节的命令码即可,多设备控制时增加1字节的通道号。各种遥控设备的差异性二次开发的用户不必要考虑。

红外遥控器能够控制的距离

发射红外线去控制相应的受控装置时,其控制的距离与发射功率成正比。常见的红外发光二极管,其功率分为小功率(1mw~10mw),中功率(20mw~50mw)和大功率(50mw~100mw以上)三大类。

另外为了增加发射功率,就要尽量减小脉冲占空比,即压缩脉冲的宽度。一些彩电红外遥控器,其脉冲占空比为1/4 ~1/3.

C++学习建议

1.不要被VC、BCB、BC、MC、TC等词汇所迷惑——他们都是集成开发环境,而我们要学的是一门语言;

2.不要放过任何一个看上去很简单的小编程问题——他们往往并不那么简单,或者可以引伸出很多知识点;

3.会用Visual C++,并不说明你会C++;

4.看Visual C++的书,是学不了C++语言的;

5.浮躁的人容易说:XX语言不行了,应该学YY;——是你自己不行了吧!?

6.浮躁的人容易问:我到底该学什么;——别问,学就对了;

7.浮躁的人容易问:XX有钱途吗;——建议你去抢银行;

8.把时髦的技术挂在嘴边,还不如把过时的技术记在心里;

9.学习编程最好的方法之一就是阅读源代码;

10.和别人一起讨论有意义的C++知识点,而不是争吵XX行不行或者YY与ZZ哪个好;

11.学习编程的秘诀是:编程,编程,再编程;

12.C++语言和C++的集成开发环境要同时学习和掌握;

13.保存好你写过的所有的程序——那是你最好的积累之一;

14.请不要做浮躁的人;

15.请热爱C++!

单片机控制板的设计原则

需要遵循的原则如下:  

(1) 在元器件的布局方面,应该把相互有关的元件尽量放得靠近一些,例如,时钟发生器、晶振、CPU的时钟输入端都易产生噪声,在放置的时候应把它们靠近些。对于那些易产生噪声的器件、小电流电路、大电流电路开关电路等,应尽量使其远离单片机的逻辑控制电路和存储电路(ROM、RAM),如果可能的话,可以将这些电路另外制成电路板,这样有利于抗干扰,提高电路工作的可靠性。

  (2) 尽量在关键元件,如ROM、RAM等芯片旁边安装去耦电容。实际上,印制电路板走线、引脚连线和接线等都可能含有较大的电感效应。大的电感可能会在Vcc走线上引起严重的开关噪声尖峰。防止Vcc走线上开关噪声尖峰的唯一方法,是在VCC与电源地之间安放一个0.1uF的电子去耦电容。如果电路板上使用的是表面贴装元件,可以用片状电容直接紧靠着元件,在Vcc引脚上固定。最好是使用瓷片电容,这是因为这种电容具有较低的静电损耗(ESL)和高频阻抗,另外这种电容温度和时间上的介质稳定性也很不错。尽量不要使用钽电容,因为在高频下它的阻抗较高。

在安放去耦电容时需要注意以下几点: 

·在印制电路板的电源输入端跨接100uF左右的电解电容,如果体积允许的话,电容量大一些则更好。 

·原则上每个集成电路芯片的旁边都需要放置一个0.01uF的瓷片电容,如果电路板的空隙太小而放置不下时,可以每10个芯片左右放置一个1~10的钽电容。 

· 对于抗干扰能力弱、关断时电流变化大的元件和RAM、ROM等存储元件,应该在电源线(Vcc)和地线之间接入去耦电容。

·电容的引线不要太长,特别是高频旁路电容不能带引线。

(3) 在单片机控制系统中,地线的种类有很多,有系统地、屏蔽地、逻辑地、模拟地等,地线是否布局合理,将决定电路板的抗干扰能力。在设计地线和接地点的时候,应该考虑以下问题: 

·逻辑地和模拟地要分开布线,不能合用,将它们各自的地线分别与相应的电源地线相连。在设计时,模拟地线应尽量加粗,而且尽量加大引出端的接地面积。一般来讲,对于输入输出的模拟信号,与单片机电路之间最好通过光耦进行隔离。 

·在设计逻辑电路的印制电路版时,其地线应构成闭环形式,提高电路的抗干扰能力。 

·地线应尽量的粗。如果地线很细的话,则地线电阻将会较大,造成接地电位随电流的变化而变化,致使信号电平不稳,导致电路的抗干扰能力下降。在布线空间允许的情况下,要保证主要地线的宽度至少在2~3mm以上,元件引脚上的接地线应该在1.5mm左右。 

·要注意接地点的选择。当电路板上信号频率低于1MHz时,由于布线和元件之间的电磁感应影响很小,而接地电路形成的环流对干扰的影响较大,所以要采用一点接地,使其形成回路。当电路板上信号频率高于10MHz时,由于布线的电感效应明显,地线阻抗变得很大,此时接地电路形成的环流就不再是主要的问题了。所以应采用多点接地,尽量降低地线阻抗。 

·电源线的布置除了要根据电流的大小尽量加粗走线宽度外,在布线时还应使电源线、地线的走线方向与数据线的走线方身一致在布线工作的最后,用地线将电路板的底层没有走线的地方铺满,这些方法都有助于增强电路的抗干扰能力。 

·数据线的宽度应尽可能地宽,以减小阻抗。数据线的宽度至少不小于0.3mm(12mil),如果采用0.46~0.5mm(18mil~20mil)则更为理想。

·由于电路板的一个过孔会带来大约10pF的电容效应,这对于高频电路,将会引入太多的干扰,所以在布线的时候,应尽可能地减少过孔的数量。再有,过多的过孔也会造成电路板的机械强度降低。

SED1335的时序

LCM驱动IC SED1335有两种工作模式,一个是6800,一个是8080。时序是不一样的。

8080时序在读时RD最后确认,写时WR最后确认,片选E要先RD/WR就绪,

6800时序相反,片选E最后确认,RD/WR要先E就绪.

如何驱动TFT LCD

理论和实践往往只有一步之遥。明白了不一定就能搞定。总结前面的理论,现在给出如何具体去驱动一个LCD屏,当我们能够在屏上打印一个象素,那我们就彻底控制了整个屏幕了。

LCD最本质就是电压驱动液晶是否显示,加上时序就可以驱动一副画面了。因此最简单的应该是模拟LCD。

1. 模拟TFT LCD

这是一个模拟TFT LCD的结构图。LCD的面板上只有source 和gate driver,其他的信号都从FPC引出来了。

R1,G1,B1是模拟电压数据信号线,当在一定的时序下,通过改变数据线上的电压值就可以显示不同的颜色了。由于模拟量是连续的,所以显示的颜色应该是无穷级的。

其他的许多就是控制和时钟线了。

道理上说,只要我们能够构造出合适的时序,并在时序的不同出改变电压就可以时序LCD的驱动。为了完成下图的功能,就目前的各种方案中,我们作出比较:

使用单片机

典型的是51系列,不管我们使用的是多快的51,对于显存超过64K显然是无法完成。51单片机控制高速DA,并产生10MHz以上的时钟,还要严格控制各个信号线的延迟,这点也无非做到。

使用ARM,DSP等等

由于这类CPU在对IO引脚的控制是用软件顺序完成,很多并发操作无发实现。处理能力强不代表时序发生能力强!

使用可编程逻辑器件

使用CPLD或FPGA等完成LCD驱动正是物有所值。这类芯片在时序控制上有着无可比拟的优势。并发、精确延时都不成问题。CPLD仍然是数字设备,驱动LCD时DA必不可少。CPLD+DA+SDRAM是LCD驱动板的理想模型。

2. 数字TFT LCD

现在大家用的最多的也就是这一类LCD,有其在嵌入式领域。当ARM内置了LCD控制器以后,使用数字式TFT LCD变得非常简单。

TFT LCD产生很简单,无非就是在上述的模拟LCD基础上把DA内置到面板里面了。这种LCD的面板里面有三大部件:source driver、gate driver、DA。由于DA的引入,这类LCD的颜色数目就固定了。因为受DA位数的影响,目前多是24位以下。

驱动方案和模拟LCD一样,无非在驱动板上没有了高速DA。虽然驱动板上的DA省掉了,这类LCD屏的价格肯定要搞些(毕竟包含DA在里面)。

3. Timing controller

不能不提的时序发生器!在第一副图中,我们看到时序信号是非常多的。在常用的视频格式中时序只有HSYN(水平扫描),VSYN(垂直扫描),CLK(数据时钟)三种时序信号。使用timing controller芯片就可以完成转换了。通常对于LCD屏,这类芯片都是专用的。
为了开发的方便,TFT LCD的生产商再次把timing controller集成到了面板里面。这样的数字TFT LCD就是现在大家用的。

LCD面板内部包括4部分:source driver、gate driver、DA和timing controller。这样成本就是最大的了。然而使用却是最方便的。

如果你要开发驱动板也相对容易了很多,构造的时序没有那么多了,DA也不用了。

内码转换技术

一、基本概念
1.GB码
全称是GB2312-80《信息交换用汉字编码字符集 基本集》,1980年发布,是中文信息处理的国家标准,在大陆及海外使用简体中文的地区(如新加坡等)是强制使用的唯一中文编码。P-Windows3.2和苹果OS就是以GB2312为基本汉字编码, Windows 95/98则以GBK为基本汉字编码、但兼容支持GB2312。GB码共收录6763个简体汉字、682个符号,其中汉字部分:一级字3755,以拼音排序,二级字3008,以偏旁排序。该标准的制定和应用为规范、推动中文信息化进程起了很大作用。1990年又制定了繁体字的编码标准GB12345-90《信息交换用汉字编码字符集 第一辅助集》,目的在于规范必须使用繁体字的各种场合,以及古籍整理等。该标准共收录6866个汉字(比GB2312多103个字,其它厂商的字库大多不包括这些字),纯繁体的字大概有2200余个。(2312集与12345集不是相交的。一个是简体,一个是繁体)
2.BIG5编码
是目前台湾、香港地区普遍使用的一种繁体汉字的编码标准,包括440个符号,一级汉字5401个、二级汉字7652个,共计13060个汉字。Big-5 是一个双字节编码方案,其第一字节的值在 16 进制的 A0~FE 之间,第二字节在 40~7E 和 A1~FE 之间。因此,其第一字节的最高位是 1,第二字节的最高位则可能是 1,也可能是 0。
3.GBK编码(Chinese Internal Code Specification)
GBK编码(俗称大字符集)是中国大陆制订的、等同于UCS的新的中文编码扩展国家标准。GBK工作小组于1995年10月,同年12月完成GBK规范。该编码标准兼容GB2312,共收录汉字21003个、符号883个,并提供1894个造字码位,简、繁体字融于一库。Windows95/98简体中文版的字库表层编码就采用的是GBK,通过GBK与UCS之间一一对应的码表与底层字库联系。其第一字节的值在 16 进制的 81~FE 之间,第二字节在 40~FE,除去xx7F一线。
4.Unicode编码(Universal Multiple Octet Coded Character Set)
国际标准组织于1984年4月成立ISO/IEC JTC1/SC2/WG2工作组,针对各国文字、符号进行统一性编码。1991年美国跨国公司成立Unicode Consortium,并于1991年10月与WG2达成协议,采用同一编码字集。目前Unicode是采用16位编码体系,其字符集内容与ISO10646的BMP(Basic Multilingual Plane)相同。Unicode于1992年6月通过DIS(Draf International Standard),目前版本V2.0于1996公布,内容包含符号6811个,汉字20902个,韩文拼音11172个,造字区6400个,保留20249个,共计65534个。
二、一些注解
在此解释一下我们常见的一些汉字内码转换工具:
1、 最常见的是GB2Big5和Big52GB转换工具。这里的GB指是GB2312集。
2、 GBK简体兼容GB2312字符集及其编码。不规范理解为GB就是GBK简体。
3、 繁体不等同于Big5,在GBK集中也有繁体,GB12345集也有繁体。但这三者的汉字编码方式不同。Windows95/98/NT/2000(简体中)中使用的都是GBK字符集;繁体版使用的是Big5字符集,在简体版中无法正常显示Big5字符,繁体版无法显示GB字符。
4、 在IE中,进入Big5码网站(如:台湾网站),如果安装有Big5字符集支持,IE会将Big5网页转换成GBK繁体显示,没有则是乱码。IE以GBK繁体显示时,在网页中输入的汉字应当是GBK繁体,以Big5码显示时(乱码),要输入Big5码字符(输入乱码? 先输入GBK简体----GB码,再使用小工具将其转换成Big5,拷贝,粘贴即可)。
5、 常见的小工具中,可将Big5转换成GBK繁体的不多,可将GBK简体繁体相互转换的也不多。其原因是,他们是将GB2312字符集与Big5字符集建立了对应关系。

三、内码转换原理及方法
内码转换:就是在不同字符集之间建立一种对应关系。
以GBK2Big5(简繁体都可)
如:让字,在GBK中编码是C8C3。如果我们将GBK码表中的字符变成Big5码格式,则C8C3位上的应该是攍och 让攠字的Big5码字符攠琵攠(琵字不是GBK中的琵,而是攠让攠字的Big5码汉字在GBK环境中显示结果)。这样我们读出要转换的文字,在GBK(已经转换成Big5格式)码表中找到它的位置,取出该位置上的字符,将原字符替换即可。

读写字符不是问题。关键是如何在码表文件中对该汉字进行定位和如何将纯GBK码表转换成Big5格式表示的GBK码表。
问题一、对汉字进行定位。
GBK 代码表(按代码顺序排列) 81-87 88-8F 90-97 98-9F A0-A7 A8-AF B0-B7 B8-BF
C0-C7 C8-CF D0-D7 D8-DF E0-E7 E8-EF F0-F7 F8-FE
81 0 1 2 3 4 5 6 7 8 9 A B C D E F
4 丂 丄 丅 丆 丏 丒 丗 丟 丠 両 丣 並 丩 丮 丯 丱
5 丳 丵 丷 丼 乀 乁 乂 乄 乆 乊 乑 乕 乗 乚 乛 乢
6 乣 乤 乥 乧 乨 乪 乫 乬 乭 乮 乯 乲 乴 乵 乶 乷
7 乸 乹 乺 乻 乼 乽 乿 亀 亁 亂 亃 亄 亅 亇 亊  
8 亐 亖 亗 亙 亜 亝 亞 亣 亪 亯 亰 亱 亴 亶 亷 亸
9 亹 亼 亽 亾 仈 仌 仏 仐 仒 仚 仛 仜 仠 仢 仦 仧
A 仩 仭 仮 仯 仱 仴 仸 仹 仺 仼 仾 伀 伂 伃 伄 伅
B 伆 伇 伈 伋 伌 伒 伓 伔 伕 伖 伜 伝 伡 伣 伨 伩
C 伬 伭 伮 伱 伳 伵 伷 伹 伻 伾 伿 佀 佁 佂 佄 佅
D 佇 佈 佉 佊 佋 佌 佒 佔 佖 佡 佢 佦 佨 佪 佫 佭
E 佮 佱 佲 併 佷 佸 佹 佺 佽 侀 侁 侂 侅 來 侇 侊
F 侌 侎 侐 侒 侓 侕 侖 侘 侙 侚 侜 侞 侟 価 侢  


以上是按代码顺序排列GBK码表,共126个区,每区190个汉字。汉字位置的计算如下:
posit = (ch1 - 129) * 190 + (ch2 - 64) - (ch2/128);(第n 个汉字)
posit = posit * 2; (第n个字节)
第一个问题就算搞定。

问题二、将GBK码表用Big5来表示。
我们可以利用现有的工具,如东方快车3000,将GBK码表转换成Big5的格式。但实际中有问题,因为GBK较Big5的汉字要多,那么在GBK中有的字符,而Big5中没有的字符在转换中可能被删除,那上面后码表定位就不能用了。而且实际上几乎无法定位。不过我在网上找到了一个以Big5表示的GBK码表的文本(可能是官方的),字符一个不缺。
这个问题也搞定了。


同样我们可以进行
Big52GBKT(繁体),Big52GBKS(简体),GBKS2GBKT,GBKT2GBKS,GBK2BIG5的转化。这里给出Big5码表格式,和定位算法:
BIG-5 代码表 A0-A7 A8-AF B0-B7 B8-BF C0-C7 C8-CF
D0-D7 D8-DF E0-E7 E8-EF F0-F7 F8-FE
(已被转化成
GBK)B0 0 1 2 3 4 5 6 7 8 9 A B C D E F
4 虔 蚊 蚪 蚓 蚤 蚩 蚌 蚣 蚜 衰 衷 袁 袂 衽 衹 記
5 訐 討 訌 訕 訊 託 訓 訖 訏 訑 豈 豺 豹 財 貢 起
6 躬 軒 軔 軏 辱 送 逆 迷 退 迺 迴 逃 追 逅 迸 邕
7 郡 郝 郢 酒 配 酌 釘 針 釗 釜 釙 閃 院 陣 陡  
A   陛 陝 除 陘 陞 隻 飢 馬 骨 高 鬥 鬲 鬼 乾 偺
B 偽 停 假 偃 偌 做 偉 健 偶 偎 偕 偵 側 偷 偏 倏
C 偯 偭 兜 冕 凰 剪 副 勒 務 勘 動 匐 匏 匙 匿 區
D 匾 參 曼 商 啪 啦 啄 啞 啡 啃 啊 唱 啖 問 啕 唯
E 啤 唸 售 啜 唬 啣 唳 啁 啗 圈 國 圉 域 堅 堊 堆
F 埠 埤 基 堂 堵 執 培 夠 奢 娶 婁 婉 婦 婪 婀  



定位方法:
if ((ch2 >= 64)&&(ch2 <= 126))
{
posit = (ch1 - 160) * 157 + (ch2 - 64);
posit = posit * 2 - 1;
}
else if ((ch2 >= 161)&&(ch2 <= 254))
{
posit = (ch1 - 160) * 157 + 62 + (ch2 - 160);
posit = posit * 2 - 1;
}

在这里给出GBK2Big5的C++Builder的程序:

fGBK2Big5 = fopen("pureGBK2Big5byOrder.txt", "rb");

unsigned long i,posit;//把gb码转换为gbkT
unsigned char ch1,ch2;
String sContext;
char chr;

sContext = Memo1->Lines->Text;
i=1;
while(i < sContext.Length())
{
ch1 = sContext[i];
ch2 = sContext[i+1];

if ((ch1 >= 129)&&(ch1 <= 254))
{
if (((ch2 >= 64)&&(ch2 < 127)) ||((ch2 > 127)&&(ch2 <= 254)))
{
posit = (ch1 - 129) * 190 + (ch2 - 64) - (ch2/128);
posit = posit * 2;
if ((posit > 23940*2) || (posit < 0))
{
i++;
continue;
}
fseek(fGBK2Big5, posit - ftell(fGBK2Big5), 1);
fread((void *)(&chr), sizeof(char), 1, fGBK2Big5);
sContext[i] = chr;
fread((void *)(&chr), sizeof(char), 1, fGBK2Big5);
sContext[i+1] = chr;
i +=2;
}
else
{
i++;
}
}
else
{
i++;
}
}

Memo1->Lines->Text=sContext;

汉字编码表示与显示

一、汉字的编码
1981年5月,我国国家标准总局颁布了《信息交换用汉字编码字符集》(GB2312-80),简称国家标准汉字编码,也叫国标码。国标码共收进标准字符7445个。其中一级汉字3755个,二级汉字3008个,共计6763个汉字。 由于汉字的字符多,一个字节即8位二进制代码不足以表示所有的常用汉字。同时为了不与西文的ASCII码混淆,汉字国标码的每个汉字或符号都使用2个字节(16位二进制)代码来表示。 西文字符采用一个字节表示,即ASCII码,一般只用七位来表示128个字符,而把最高位用作奇偶校验(或者不用)。
国标码介绍:在GB2312-80代码表中,纵向分为0~93,共94行;横向也是0~93,共94列。行与列分别用b7b6b5b4b3b2b1七 位二进制码表示,第一字节表示行,第二字节表示列。其值从0100001到1111110(十六进制为21-7E)。这正是ASCII码的可打印字符的编 码范围。国标码是将第一字节和第二字节连写而得。由于二进太长,一般用十六进制表示。
区位码介绍:在国标GB2312-80中,国标码除了用双七位二进制表示外,还可以表示成区位码的形式。即在国标代码表中,将行号称为区号,列号称为位号,分别有94个区和94个位。区号和位号用十进制表示,不足两位前面补0。这样每个汉字或符号都可用4位十进制表示。区位码因此可以用来作输入码。是汉字输入的基本编码方法之一。
机内码介绍:在计算机中双字节汉字与单字节西文字符混合使用、处理,汉字编码的各个字节若不予以特别标识,就会与单字节的ASCII码混淆不清;为此,将标识汉字的两个字节编码的最高位置为1,这种最高位为1的双字节汉字编码就是中国大陆普遍采用的汉字机内码,简称内码,是计算机内部存储、处理汉字所使用的代码。
内码、国标码、区位码三者的关系是:
高字节内码=高字节国标码+80H=区码+20H+80H=区码+0A0H=区码+160
低字节内码=低字节国标码+80H=位码+20H+80H=位码+0A0H=位码+160
繁体汉字在一些地区和领域仍在使用,国家又制定出相应的繁体汉字字符集,国家标准代号是GB12345-90“信息交换用汉字编码字符集——辅助集”,包含了717个图形符号和6866个繁体汉字。BIG5是我国台湾地区计算机系统中使用的汉字编码字符集,包含了420个图形符号和13070个繁体汉字(不用简体字)。

二、汉字的字模库
汉字的输出主要是指汉字字形的输出。输出的方式主要是显示和打印两种。汉字输出时,用一个点阵来表示一个汉字。点阵的每个点位只有两种状态:有点或无点。若用二进制代码来表示即为该位取值为1 表示有点,取值为0表示无点。汉字的输出原理与西文的输出原理是相同的。不同的是汉字笔划较多,要能很好地表示一个汉字,起码需要16×16点阵才行。如果要求字型逼真美观,点阵的点数还要增加。如用24×24、32×32、48×48等,因此汉字的存储空间比西文要大很多,需要用大量的存储空间来存放字模。
描述一个汉字点阵信息的二进制代码串称为汉字的“字模”。所有汉字和各种符号的点阵信息就组成汉字的“字模库”(简称字库)。字模的表示顺序为:先从左到右,再从上到下。也就是先画第一行左上方的8个点,再是右上方的8个点,然后是第二行左边8个点,右边8个点,以此类推。

三、汉字的显示原理
1. 从键盘输入的汉字经过键盘管理模块,变换成机内码。
2. 然后经字模检索程序,查到机内码对应的点阵信息在字模库的地址。
3. 从字库中检索出该汉字点阵信息。
4. 利用显示驱动程序将这些信息送到显示卡的显示缓冲存储器中。
5. 显示器的控制器把点阵信息整屏顺次读出,并使每一个二进制位与屏幕的一个点位相对应,就可以将汉字字形在屏幕上显示出来。

四、用区位码获取汉字的点阵信息
以16×16的点阵汉字库文件为例。一个汉字用了256个点共32个字节表示。汉字共分94区,每个区有94位汉字。机内码用两个字节表示,第一个字节存储区号(qh),为了和ASCII码相区别,范围从十六进制的A1H开始(小于80H地为ASCII码字符),对应区码的第一区;第二个字节是位号(wh),范围也从A1H开始,对应某区中的第一个位码。这样,将汉字机内码减去A0A0H就得到该汉字的区位码。
从而可以得到汉字在字库中的具体位置:
location=(94*(qh-1) + wh-1) * 一个汉字字模占用的字节数

对于16×16的点阵汉字库,汉字在字库中的具体位置的计算公式就是:(94*(qh-1)+wh-1)*32。例如,“房”的机内码为十六进制的B7BF,则其区位码是B7BFH-A0A0H=171FH,转化为十进制就是2331,在汉字库中的位置就是32*[94*(23-1)+(31-1)]=67136字节以后的32个字节为“房”的显示点阵。

MT1389 Vendor.h Introduction

Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 1 of 31
© 2005 MediaTek Inc.
The information contained in this document can not be modified without notice
Release Date: 2005/07/31
Revision: 1.0
Vendor.h introduction
MediaTek Proprietary Document
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 1 of 31
© 2005 MediaTek Inc.
The information contained in this document can not be modified without notice
Revision History
Change Log
Revision Date Author Change Log
1.0 2005/07/31 Leon Lin Initial
Reviewer’s Comments
Date Reviewer Comments
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 1 of 31
© 2005 MediaTek Inc.
The information contained in this document can not be modified without notice
Table of contents
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 1 of 31
© 2005 MediaTek Inc.
The information contained in this document can not be modified without notice
1. Introduction .
This document is one introduction of vendor.h. The main purpose is to new
colleagues can understand and use our FW as quickly ad possible.
2. Decomposition Description .
2.01. Select chip version
#define MT1389
//#define MT1389_REV_C
//#define MT1389_REV_D
//#define MT1389_REV_E
//#define MT1389_REV_HD
Only open one of them, the others must be closed while open the one of them.
Different chip version will have different firmware options.
This includes
PLAYER_2_CHANNEL à 2 channels player configuration
NO_DTS_DECODE à disable DTS decoding
DDISC_FTYPE_WMA_SUPPORT à enable WMA support
HDCD_EN à enable HDCD support
SUPPORT_DVD_AUDIO à enable DVD_Audio support
(1) PSCAN_FORCE_TV_AUDIO: let it enter auto model
(2) SETUP_NO_PSCAN_CTRL: PSCAN invalid in setup model
(3) PSCAN_SIMPLE_MENU: in PSCAN auto or video
(4) KARAOKE_SCORING_TEST: Karaoke scoring test
(5) VIN_USE_PORT_B: GPIO pins as input for port B
2.02. HDMI related definition
(1) SUPPORT_HDMI: support HDMI.
(2) HDMI_FULL_MENU:
(3) HDMI_SOFTWARE_COMPARE: support software compare, to support more sinks, can
up to 21.
(4) HDMI_DVI_BY_MENU: if define HDMI_FULL_MENU, can define it to divide the full menu.
2.03. USB and DRM related definition
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 1 of 31
© 2005 MediaTek Inc.
The information contained in this document can not be modified without notice
(1) SUPPORT_USB: support USB, can only use in 1389B and 1389HD.
(2) SUPPORT_MCR: support Card direct to our IC.1389B can support MS,SD Card.1389HD
can support MS,SD,CF,MMC,XD card.
(3) USB_DO_NOT_USE_GPIO: the VBUS line can not use our IC GPIO pin to control it.
(4) SUPPORT_GPS: support GPS.
(5) USB_EXT_CLK: using external clock.
(6) USB_EXT_CLK_LARGE_BOARD: using external clock on large PCB board.
(7) SUPPORT_USB_COPY: support writing a file in USB.
(8) SUPPORT_DRM: support DRM, can have DIVX attestation.
2.04. Firmware upgrade from disc
To enable disk firmware upgrade, please enable this option
#define DISC_UPDATE_CODE
And specify the upgrade disc volume ID and filename
#define VOLUME_ID 'M', 'E', 'D', 'I', 'A', 'T', 'E', 'K', '\0'
#define UPDATE_FILE 'M', 'T', 'K', '.', 'B', 'I', 'N', '\0'
To disable volume ID check, you can define like this:
#define VOLUME_ID ‘\0’
Note the used flash, if you use 8-bit flash, should define
#define FLASH_8BIT eg: the flash type is 400,040,080 is 8-bit flash
If you use flash type is 16-bit flash, should define
#define FLASH_16BIT_SWAP
or
#define FLASH_16BIT_NO_SWAP
eg: the flash type is 800,160 is 16-bit flash. And when the flash D15 is connect with A0,is
support 8bit mode and swap, you should select “FLASH_16BIT_NO_SWAP”,and if the flash
D15 is not connect with A0, it support 16bit mode, and we should select
“FALSH_16BIT_SWAP”. In our System, our can not support”FLASH_16BIT_NO_SWAP” up
to now.
Others:
(1) UPG_FINISH_TRAY_OUT: force the tray out after UPG finish
(2) UPG_VFG_STATUS: no another define
(3) UPDATE_KEEP_CPPM_KEY :default is replace ,CPPM_KEY is for dvd_audio
(4) FLASH_USE_POLLING: Two Schemes , default is Toggling Mode
(5) FLASH_USE_RESET: Use Reset Command, XBYTE[0x5555] = 0xf0
(6) FLASH_CHECK_DQ5:Use DQ5 Mode checkout
(7) FLASH_LOOP_CNT :Flash Erase&Write Loop Counter
(8) FLASH_BYTE_RETRY: Write Flash retry 3 times
2.05 ser password file
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 1 of 31
© 2005 MediaTek Inc.
The information contained in this document can not be modified without notice
#define LOAD_USR_PWD_FILE
could load a file into share memory SI_PWD_STRING_GRP_0 and
SI_PWD_STRING_GRP_1.The max file length is 64 bytes and the filename is defined as
PWD_FILENAME.
2.06 I/O port definition & board components related setting
(1)
#define DRAM_2M 0x200000
#define DRAM_4M 0x400000
#define DRAM_8M 0x800000
#define DRAM_16M 0x1000000
(2)
#define DRAM_SZ DRAM_8M: define DRAM size select, select bass on your platform
(3)
#define DRAM_CASCADE: no DRAM burst mode. Only define when use 4M DRAM in
1389C,89D and 89E
(4) DRAM_1B1M16X2 4MB :1 bank , two chips DRAM
(5)DRAM_4B1M16X1 8MB: 4 bank, one chip DRAM
(6)DRAM_16BIT_ONLY: Test 16Bit or 32Bit
(7)DRAM_REFRESH_PERIOD 0x20: DRAM refresh period
(8)DRAM_RAMPC 0x96: 12mA DRAM driving strength, clock invert
(9)DRAM_RAMPC 0x16: 12mA DRAM driving strength
(10)DRAM_RAMPC 0x9A: 4mA DRAM driving strength
(11)DRAM_CL3T: DRAM&HOST delay 3T, default 2T
2.07 Disc support configuration options
Open the disc define which you want to support, otherwise close it.
(1) DVD-Video: always on
(2) CDI: SUPPORT_CDI
(3) DTS_CD: SUPPORT_DTS_CD
(4) DACD: SUPPORT_DACD
(5) VCD 1.0/1.1: SUPPORT_VCD_1X
(6) VCD 2.0: SUPPORT_VCD_20
(7) VCD 3.0: SUPPORT_VCD_30
(8) SVCD: SUPPORT_SVCD
(9) CVD: SUPPORT_CVD
(10) PCD: SUPPORT_PCD (support Kodak PCD,the JPEG support must be on)
(11) SUPPORT_CD_TEXT: support CD-Text reading
(12) DVD_VR_SUPPORT: support DVD-VR and dual mono switch.
(13) miniDVD: MINI_DVD_SUPPORT
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 1 of 31
© 2005 MediaTek Inc.
The information contained in this document can not be modified without notice
(14) SUPPORT_DATA_DISC: support the data disc
Data disc file type support
(a) MP1/2: DDISC_FTYPE_MPEGA_SUPPORT
(b) MP3: DDISC_FTYPE_MP3_SUPPORT
(c) WMA: DDISC_FTYPE_WMA_SUPPORT
(d) JPEG: DDISC_FTYPE_JPEG_SUPPORT
(e) MPEG: DDISC_FTYPE_MPG_SUPPORT
2.08. EEPROM related option and I2C EEPROM configuration
(1) I2C_EEPROM: define I2C format E2PROM ,to enable I2C EEPROM support, If this
option is not enabled, all the setup menu configurations are loaded from default value.
(2) EEPROM_INIT_RETRY 0: disable init_retry timeout
(3) EEPROM_RUN_RETRY 0: disable run_retry timeout
(4) DISC_UPG_RESET_DEFAULT: Force EERPOM load default value after disc firmware
upgrade
(5) DISC_UPG_RESET_KEEP_REGION: Keep region code after disc UPG and Reset
Default Value
(6) EEPROM_SLOW_ACK_POLLING: Slowly detect ACK Polling
(7)define _24C02_: To configure the I2C EEPROM size, available types are _24C01_,
_24C02_, _24C04_, _24C08_, _24C16_.
2.09. Audio DAC setting
(1)MTK_6CH_ADAC, #undef _WM8756_:
Only 89E &89HD DAC define. If Use internal DAC, open the two define, or you use the
external DAC, close the two define.
(2)DSP_AUTO_MUTE: mask it temperally, open it until DSP complete auto mute function.
(3)INIT_ADAC, BOTH_INT_EXT_ADAC:
Only 89D DAC define.
Use internal ADAC only, Open INT_ADAC, close BOTH_INT_EXT_ADAC
Use external ADAC only, Close both INT_ADAC and BOTH_INT_EXT_ADAC
Use internal and external ADAC, Close INT_ADAC and open BOTH_INT_EXT_ADAC
Others:
(1) AC3_DITHER_MUTE: Avoid the resolution error in AC3 bit stream,
vWriteDspSharedDInfo(D_MUTE_THRESHOLD, 0x18 or ox00) in InitAdspGeneral(void).
(2) AC3_BASS_OVERFLOW_DETECT: For 1379 bass overflow detection of AC3, Change
wFlag value-->vWriteDspSharedWInfo (W_PROCMOD, wFlag) in vInitAdspGeneral(void)
(3) DAC_AUTO_MUTE: Enable auto-mute function when use CS4391 audio DAC-->
fgI2CByteWrite (0x10, 0x0, 0x80) in ADACInit (void)
(4) DAC_DEEMPH: Change wFlag value-->vWriteDspSharedBInfo(B_DACBIT, bFlag) in
vInitAdspGeneral(void),enable external Audio DAC de-emphasis
(5) DAC_EXTPIN_MUTE: Disable auto-mute function to use mute pin when use CS4360--
>fgI2CByteWrite (0x10, 0x01, 0x00) in ADACInit, Enable Mute Control Normal when use
CS4228-->fgI2CByteWrite (0x10, 0x05, 0x40) in ADACInit
(6) AUDIO_256FS: setup external master clock,change times sampling clock
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 1 of 31
© 2005 MediaTek Inc.
The information contained in this document can not be modified without notice
(7) ADSP_USE_APLL: ADSP clock use APLL
(8) ADSP_APLL_RATIO: APLL clock divided by x
(9) AUDIO_DATA_18BIT: Audio DAC bit resolution
(10) _NPADAC_: define no programming ADAC
(11) AUDIO_DATA_LTJ: Audio data format
(12) _INTACLK_: use MT1389 audio clock
(13) AUDIO_POLARITY_NINV: Use even stages, setup Audio DAC Configuration
(14) AUDIO_LR_INV: Inverse the channel (L->R, R->L), analog circuit
(15)POWERDOWN_AUDIOOUT_CLK: Still AudioClk output in the PowerDown Mode
(16)USE_1379_MUTE: USE ASData3 as mute function
(17)USE_1369_MUTE: USE AMUTE--P31 as mute function
(18)USE_IOA20_MUTE: USE 1379 IOA20 as mute function
(19)define LOW_MUTE: mute use low voltage
2.10. TV encoder setting
(1) MACROVISION_CERTIFICATION: This function is when playing the macrovision
signals,if to the Non-Support_Macrovision TV_Encoder, will turn off the DAC to turn off video,
else turn on the video. Only for non-support-macrovision chip
(2) NO_SUPPORT_MACROVISION: YesàNo support the macrovision signal, only use for
video quality testing
(3) CVBS2_OUTPUT_ON_G: Only use when 89D, bass the new schematic, for the CVBS2
will be out from G, Must open it when 89D.
(4)SV_TVE_DIRECT:
89D----------- CVBS1, S-Video, CVBS2
Others-------- CVBS, S-Video, Off, used for direct drive
(5)SV_TVE_YCBCR: CVBS, YCBCR or CVBS, S, YCBCR
(6)SV_TVE_RGB: CVBS, RGB or CVBS, S, RGB
(7)SV_TVE_VGA: Off, Off, VGA, force P-Scan on
(8)SV_TVE_SCART: SCART
(9)COMPONENT_ON_S_OFF: When Component is turned on, turn off S-video
Others:
(1) NO_PEDESTAL_OFFSET: No 7.5IRE
(2) NTSC_ADJUST_H: Adjust the NTSC main video horizontal position
(3) NTSC_ADJUST_V: Adjust the NTSC main video vertical position
(4) PAL_ADJUST_H: Adjust the PAL main video horizontal position
(5) PAL_ADJUST_V: Adjust the PAL main video vertical position
These 4 Parameters is used to adjust TV Main Video Position, value from (-10 ~ 10)
(6)OSD_NTSC_ADJUST_H: 2 pixel base Adjust the NTSC OSD horizontal position
(7)OSD_NTSC_ADJUST_V: 1 pixel base Adjust the NTSC OSD vertical position
(8)OSD_PAL_ADJUST_H: 2 pixel base Adjust the PAL OSD horizontal position
(9)OSD_PAL_ADJUST_V: 1 pixel base Adjust the PAL OSD vertical position
(10)ENCODER_MASTER: Enable MT1369 to master mode
(11)TVE_YCDELAY_ON: yc signal delay:
(12)TVE_REDGE_ON: Rise Edge toggle: a. yes->turn off video, no->turn on video with
macrovision title b. Only for non-support-macrovision chip
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 1 of 31
© 2005 MediaTek Inc.
The information contained in this document can not be modified without notice
(14)VDO_CFG_NO SV_HI_IMP_FLT_FRONT:High-Impedance Mode filter in front of the
transistor gets the better performance than in back.
(15)VDO_CFG_NO SV_HI_IMP_FLT_BACK
(16)VDO_CFG_NO SV_LO_IMP: Low-Impedance Mode
(17)P_DEVICE_DEBUG: I2C peripheral debug
2.11. Playback behavior setup
(1)TRICK_MODE_USE_PLAY: in trick mode, the trick mode key as PLAY key.
(2) PLAY_PAUSE_TRICK_PLAY: in trick mode, PLAY/PAUSE key is used as PLAY key
(3) PAUSE_NO_TRICK: in pause state, the trick mode key is not allowed
(4) PROGRAM_NO_REPEAT: repeat key is not allowed for PROGRAM mode
(5) RANDOM_SHUFFLE_NO_REPEAT: repeat key is not allowed for RANDOM/SHUFFLE
mode.
(6) USR_CTRL_CANCEL_REPEAT: cancel repeat mode when enter user control mode
(PROGRAM/RANDOM/SHUFFLE)
(7) STOP_RESUME_CANCEL_REPEAT: cancel repeat mode when enter STOP_RESUME
state
(8) DIGIT_CANCEL_REPEAT: user select digit key or time search will cannel repeat mode.
(9) REVERSE_END_RESTART_PLAY: restart playing instead of continue trick mode
reverse
(10) KEEP_TRICK_AFTER_SEARCH: keep the trick mode after search
(11) FF_2X_PLAY_AUDIO: let DSP play at 2X speed instead of mute
(12) BM_CLR_REARRANGE: when one bookmark is cleared, rearrange others.
(13) DVD_TITLE_SHUFFLE: use title to do shuffle, instead of program.
(14) FFSCAN_NO_STILL: forward scan no vobu still, no cell still
(15) BAN_STEP_WHEN_PAUSE_BLOCK: If Pause is blocked, prohibit Step
(16) FF_2X4X_NOSP: fast forward 2X/4X, the sub-picture will be disabled
(17) TITLE_PLAY_RESET_ASTN: reset ASTN after a Title_Play()
(18) TITLE_PLAY_RESET_SPSTN: reset SPSTN after a Title_Play()
(19) TIME_SRCH_WITHIN_A_B: time search to C < A then C = A; to C > B then ignore time
search
(20) PAUSE_MODE_SWITCH: switch among auto, frame and video pause mode
(21) PAUSE_MODE_SWITCH: set pause mode switch
2.12. Player system configuration
(1) REGION_NO: select region number, from 1~6
(2) PLAYER_POWERDOWN: enable power down mode
(a) PLAYER_ACON_STANDBY: let system enter power down mode when player power
is first on
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 1 of 31
© 2005 MediaTek Inc.
The information contained in this document can not be modified without notice
(b) POWERDOWN_KEY_SCAN: set players into standby state.
(c) POWERDOWN_HOLD_RESET: hold the external peripheral reset pin when system
in power down mode
(3) PLAYER_IDLE: enable idle mode
(a) IDLE_FORCE_SRV_STOP: force servo stop when system enter idle mode
(b) PLAYER_IDLE_SPEED_DOWN: let system enter a low running speed mode in
idle mode to save power consumption
(c) PLAYER_AUTO_PWR_DOWN: enable player auto power down feature, the
auto power down timer is defined as AUTO_PWR_DOWN_TIMEOUT.
(d) AUTO_PWR_DOWN_TIMEOUT: 1 tick is 5 seconds.
(4) PLAYER_STOP_SRV_STOP: force servo stop when player enter fully stop mode
(5) CDDA_SPEED_DOWN: let system enter low clock mode when play CDDA to save power
consumption. Note this option will make several features, like equalizer, spectrum, key shift,
etc, not available.
(6) POWERDOWN_HOLD_RESET: forbid to reset system when in power down mode
2.13. Video related setting note this setting could be override by setup menu
setting
(1) PSCAN_DEFAULT_VIDEO_MODE: this setting could be override by setup menu
setting
(a) SV_PSCAN_HR: PSCAN High-resolution
(b) SV_PSCAN_NF: PSCAN Non-flicker(Smooth)
(2) PSCAN_MOTION_THD_LOW: these three threshold be Low
(3) PSCAN_MOTION_THD_MID: these three threshold be Mid
(4) PSCAN_MOTION_THD_HIGH: these three threshold be High
(5)PSCAN_MODE_SWITCH_THD: mode change sensitivity smaller: mode change more
sensitive larger: mode change need longer time This is the interface for tuning pscan motion
adaptive in 1379 A, B , our chip only support frame-base motion adaptive pscan .the
interface includes following shareinfo
#define SI_PSCAN_MOTION_THD_LOW wSIItemPos(SI_PSCAN_PARM, 1)
#define SI_PSCAN_MOTION_THD_MID wSIItemPos(SI_PSCAN_PARM, 2)
#define SI_PSCAN_MOTION_THD_HIGH wSIItemPos(SI_PSCAN_PARM, 3)
#define SI_PSCAN_SWITCH_THD wSIItemPos(SI_PSCAN_PARM, 4)
basically, when video is motion scene, we use BOB mode to de-interlace, when video is still,
we use weave mode to de-interlace, the default value is set as standard release. If you shift
these values up, more scene will be detected as still, use weave. If you shift these values
down, more scene will be detected as motion, use BOB the switch threshold is how many
frame can the scene change, larger->detect longer time, small->detect short time.
2.14. Video related setting
Vendor.h Introduction
(1)SETUP_MENU_VID_CTRL: setup menu video control.
(2)RESET_VDO_TRAY_OUT: reset video setting when tray out, this option is for testing.
(3)POWER_ON_RESET_VDO: reset video setting when power on, this option is for testing.
(4)ENABLE_ZOOM_USER_MODE: enable zoom.
(5)SIMPLE_ZOOM_MODE: for old zoom mode, only zoom big.
(6) VBI_OFF: Disable CGMS, WSS and APS VBI signal, NTSC: line 20; PAL: line 23
(7) VBI_CGMS_OFF: only disable CGMS VBI signal.
(8) VBI_WSS_OFF: only disable WSS VBI signal
2.15. Video/OSD start offset
(1) There are 4 parameters used to adjust TV main video position. The setting may be different for
different TV encoder. The setting value range is from –10 to +10.
(a) NTSC_ADJUST_H: 2 pixel base
(b) NTSC_ADJUST_V: 1 pixel base
(c) PAL_ADJUST_H: 2 pixel base
(d) PAL_ADJUST_H: 1 pixel base
(2) There are also 2 parameters to adjust OSD display start position. The setting value is from -10 to
10.
(a) OSD_NTSC_ADJUST_H: 2 pixel base
(b) OSD_PAL_ADJUST_H: 2 pixel base
2.16. Audio related setting
(1)DSP_AUTO_MUTE: enable DSP auto mute when init.
(2)HDCD_FILTER: enable HDCD filter, must be defined while certification.
(3)HDCD_AUTO_LEVEL: when play HDCD and CD, audio signal value halve
(4)SIMULTANEOUS_DOWNMIX_OUTPUT: use ASDATA3 output downmix audio signal
(5)SIMULTANEOUS_DOWNMIX_OUTPUT_LTRT: Output is LT/RT, else is LO/RO
(6)SUPPORT_VOLUME_ADJUST: support volume adjust +,-, mute or not
(7)MUTE_KEY_MUTE_SPDIF: mute the SPDIF output when mute is enabled by mute key
(8)VOL_ZERO_AS_MUTE: when decrease volume to level 0, set it as mute function
(9)SPDIF_PCM_CH_SELECT: choice SPDIF channel is LR or LS_RS or C_LFE or CH78
(10) SPDIF_PCM_FORCE_DOWNMIX: when set SPDIF in PCM output mode, force audio output in
downmix mode
(11) MUTE_NO_VOL_KEY: block volume up/down key when mute is enabled
(12) DISC_IDENT_AUTO_MUTE_OFF: cancel mute mode when disc is identified
(13) SPDIF_MODE_CHANGE_MUTE: add additional mute time when switch SPDIF output mode
(14) AUDIO_STREAM_CHANGE_MUTE: when user switching the audio stream, add additional mute
time (15) USE_EXTERNAL_KARAOKE: use external echo IC to implement karaoke mode
(16) SPDIF_NO_MPEG_OUT: disable MPEG audio RAW data output function and use PCM mode
instead
(10) PLAYER_KARAOKE: use internal audio DSP to implement karaoke function
(11) PLAYER_SURROUND: support virtual surround function
(12) DOLBY_PROLOGIC2: support DOLBY_PROLOGIC2 function
(13) DOLBY_PROLOGIC: support DOLBY_PROLOGIC function
(14) SPDIF_FORCE_MPEG_OUT: enable MPEG audio RAW mode data output function
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 12 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(15) PL2_CAR_AUDIO: change stpmenu-->PRO LOGIC2 SETUP
(16) KARA_FORCE_SPDIF_PCM: force SPDIF output in PCM mode when karaoke mode is on
(17) VOCAL_ASSIST_STREAM_CHANGE: enable the DVD vocal assist function which is implement
by audio stream switching
(18) AC3_KARA_MODE: enable AC3 karaoke mode
(19) AC3_KARA_MIC_ON_VOCAL: use vocal for mic on.
(20) define AC3_KARA_MIC_OFF_BOTH: both vocal //when 2 ch both vocals will exist in L/R vocal
//when 5 ch both vocals will exist in L/R vocal.
(21) AC3_KARA_MELODY:hasn't been used in program
(22) KARAOKE_SIMPLE_ECHO: use simple echo adjustment mode instead full
(23) KARAOKE_MIC_THRESHOLD: set the microphone input threshold level fo vocal assist
switching level
(24) KARAOKE_MIC_REC: Support mic record
(25) MIC_AUTOMUTE: enable MIC auto mute
(26) VOCAL_ASSIST_MIC_CNT: change time enable _rAudioCtrl.sVocal.fgMicActive = FALSE
(27) VCD_VA_MIC_OFF_STEREO: use stereo as default rTmp.Union.Bit.LRMix = FALSE
(28) MIC_DOWNSAMPLE_RATIO: choice MIC sample ratio, 0 for 44K, 1 for 22K, 2 for 11K
(29) KARAOKE_MIC_REC:4M bytes can not support mic record
(30) MIC_AUTOMUTE: When mic record on, do not use mic auto mute
(31) KARAOKE_SCORING: define this to enable karaoke scoring
(32) MIC_TH_DEFAULT: MIC Threshold default value
(33) MANUAL_MIC_ON_OFF: no microphone detect pin
(34) DSP_STOP_NO_NOTIFY: notify _rAudioCtrl.sFlag.fgDspStop
(35) NO_POST_DRC_ON_OFF: disable post DRC
(36) PLAY_AUDIO_CLIP:
(37) SPDIF_PCM_FREQ_SELECT: select PCM out frequency
(38) PCM_FREQ_CHANGE_MUTE: enable mute when change PCM out frequency
(39) PLAY_NO_PCM_FREQ_SELECT: disable PCM out frequency
(40) PROLOGIC_NO_KEY_SHIFT: don't support plus and minus tone when use PROLOGIC
(41) DTS_NO_KEY_SHIFT: don't support plus and minus tone when play DTS format disc
(42) CH_EQ_NO_SUPER_EQ: force value of BASS_SW_POS to EV_OFF and //force value of
AUD_BASS_BOOST_CTRL to ADSP_OFF
(43) DVD_AUDIO_NO_KEY_SHIFT: don't support plus and minus tone when play DVD_Audio disc
(44) BASS_TO_SUB: Bass Management method select.
(45) AUD_EN_MIXED_MONO: enable audio mixed mono
(46) PLAYER_KARAOKE: use internal audio DSP to implement karaoke function
(b) KARA_FORCE_SPDIF_PCM: force SPDIF output in PCM mode when karaoke mode is on
(c) VOCAL_ASSIST_STREAM_CHANGE: enable the DVD vocal assist function which is
implement by audio stream switching
(d) AC3_KARA_MODE: enable AC3 karaoke mode support
(e) KARAOKE_SIMPLE_ECHO: use simple echo adjustment mode instead full echo adjusting
functions
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 13 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(f) KARAOKE_MIC_THRESHOLD: set the microphone input threshold level for vocal assist
switching level
(g) MIC_AUTOMUTE
(h) VOCAL_ASSIST_MIC_CNT
(47) SUPPORT_DDEX:
2.17. Spectrum related setting
(1) SPTM_SUPPORT: no 2_channel to enable spectrum display, please define the option.
(2) SPTM_EN_BAR_TYPE: spectrum bar and spectrum grid, enable bar spectrum.
(3) SPTM_BAR_NOISE: add velocity on bar type spectrum.
(3) SPTM_GRID_NOISE: add velocity on bar type spectrum.
(4) USE_LARGE_SPTM, USE_MED_SPTM, and USE_SMALL_SPTM: There are three types
spectrum available,
(5)SPTM_DATA_OUT: out spectrum data to 8032.
(6)SPTM_TOTAL_LINE: spectrum line amount total.
(7) SPTM_LINE_HEIGHT: spectrum height.
(8) SPTM_LINE_WIDTH: spectrum width.
(9) SPTM_LINE_SPACE: spectrum line space.
2.18. Auto play options
(1) DVD_AUTO_PLAY: enable DVD auto play
(2) VCD_AUTO_PLAY: enable VCD auto play
(3) CDDA_AUTO_PLAY: enable CDDA auto play
(4) ISO_AUTO_PLAY: enable ISO auto play, play the first file, regardless of the file type
(5) USE_8032_AUTO_PLAY: support disc auto play
(6) AUTO_LONGEST_TT_PLAY: set this to auto play the longest title
(7) LONG_TT_OPTION_MAX_PT: set this to use title with max PttNs as the longest title, otherwise
use title with longest time instead
2.19. Last memory options
(1) VCD_LAST_MEM: enable VCD last memory play function
(2) DVD_LAST_MEM: enable DVD last memory play function
(3) CDDA_LAST_MEM: enable CDDA last memory play function
(4) ISO_LAST_MEM: enable ISO last memory play function
(5) MEMORY_SUPPORT: enable memory key support, note memory key and last memory use the
same mechanism and should the last memory flag should not be turn on when memory key is used.
(6) SHARED_LASTMEM_SLOT: support last memory slot
(7) EEPROM_LASTMEM_EJECT_WR_BACK: support eeprom slot last memory write back
(8) EEPROM_CHK_LASTMEM_CHKSUM: add eeprom place for last memory slot
(9) EN_DISC_ID_CHK: enable disc ID check
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 14 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(9) DVD_DISC_ID_CHK: check _rOsdStateCtx.bDiscInitFlag == DISC_INIT_CHECKED before find
play disc type
(10) VCD_DISC_ID_CHK
(11) CDDA_DISC_ID_CHK
(12) ISO_DISC_ID_CHK
(13) PCD_DISC_ID_CHK
2.20. Miscellaneous options of DVD
(1) TITLE_PLAY_IGNORE_UOP_BLOCK: this option is set to TRUE, the navigation engine do not
check UOP block for UOP_TITLE_PLAY
(2) DVD_STOP_PLAY_NO_FP: when user press PLAY key in fully stop mode, we will go to play title
1 chapter directly and do not play from the DVD first play domain.
(3) DVD_IGNORE_BTN_NO_CMD: when this option is set to TRUE, and the DVD menu button
contains no navigation command, we just ignore the button select UOP and do not return UOP_FAIL.
(4) MENU_TITLE_KEY_RESUME: take the TITLE key as RESUME key function in DVD menu
(5) DVD_FORCE_CHG_ANGLE: force to change angle when play DVD.
(6) VIDEO_PAUSE_SHOW_1FLD: when the option is set, it always shows one field replace two field.
(7) DVD_NO_VID_NO_STEP: when there only still picture exists, this option will prohibit the STEP
key function.
(8) DVD_MENU_NO_ZOOM: force the ZOOM mode off in DVD menu (hi-light exist)
(9) DVD_SHOW_MSG_FIRST: when this option is set, we show NEXT/PREVIOUS OSD first then
send the UOP to increase the user key operation response time.
(10) DVD_SHOW_MENU_TIME: when this option is set, we will show time mark in DVD menu.
(11) DVD_MENU_OSD_TIME_ZERO: when option DVD_SHOW_MENU_TIME is enabled, set this
option will always show time mark as 0 in DVD menu domain.
(12) TREAT_PS_LB_AS_THE_SAME: when this option is set, in 16:9 video, if user selects an unexisted
TV Display mode (PS/LB), system will switch to the other if exists.
(13)VIDEO_PAUSE_SHOW_1FLD: if this option is set, it will output only one field when the video is
paused or enter step mode
(14) VIDEO_PN_NO_FRM_YC: if this option is set, it will output only one field when PAL to NTSC or
NTSC to PAL conversion is used.
(15) VIDEO_SHOW_DYNAMIC_BITRATE: if this option is set, we will calculate video bit rate
dynamically instead of using the bit rate value encoded in the bit-stream
(16) VIDEO_LOGO_KEEP_TVSYS: if this option is set, we will use the same TV System to show
LOGO as previous playing video
(17) VIDEO_SPEED_CONTROL: if this option is set, the new 2X, 4X speed control mechanism will
be enabled
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 15 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(18) SP_N2P_NO_SCALE: when this option is set, the LINK_PREV_CELL command will check the
existence of previous PG, and then link to last cell of previous PG if exists.
(19)ENABLE_LNKPRVC_CHK_PRV_PG: some system config determined in compile time
(20) USR_CTRL_NO_MENU_TITLE_KEY: block the TITLE key and MENU key when user control
mode is enabled.
(21) DVD_NO_PTT_PLAY_UOP_BLOCK: if this option is enabled, we do not check PTT search
block flag for chapter search mode.
(22) DVD_STOP_NO_MENU_CALL: prohibit TITLE key and MENU key when PBC state is stop.
(23) DVD_NO_REPEAT_ALL: remove DVD repeat all title mode in repeat key
(24) DVD_DGST_SHOW_MSG_ONLY: when this option is enabled, we will only show DIGEST
message on VFD, not show current digest item info on VFD.
(25) DVD_CHAP_3_DIGITS: enable 3 digits mode for DVD chapter display and input.
(26)DVD_IN_MENU_BLOCK_MENU_CALL: we this option is set to TRUE, the Menu key can call
when the menu UOP block.
(27) DVD_SP_UNKNOWN_LCD_MSG: when DVD sub-picture LCD code is not in built-in message
table, you can select OSD_MSG_NULL, OSD_MSG_SP_OTHERS, or OSD_MSG_UNKNOWN for
OSD display.
(28)DVD_AUDIO_INFO_NO_CHNL: DVD AUDIO INFO NO OSD msg.
(29) DVDAUD_HIDE_HGR: In some DVD-Audio discs, the last group is marked as a hidden group If
the user wants to play the last group by Group_Play(),the player should ask user for the password,
which is recorded SI_HIDDEN_PASSWD0/SI_HIDDEN_PASSWD1. If DVDAUD_HIDE_HGR is
defined, RISC considers the hidden group as hidden. If it is not defined, RISC treats the hidden
group like a normal group. Note that if SI_HIDDEN_PASSWD0/SI_HIDDEN_PASSWD1 are both
0,the last group is not a hidden group. To follow DVD-Audio spec, we should treat it as hidden.
(30)DVDAUD_PREV_DLIST_CYCLE: In some tracks, there are so-calledASVs(Audio Still
Videos),which are also called a PAGES or DLISTs. ASV has 2 basic presentation modes: Sequential
and Browsable. If it's browsable, the user is supposed to be able to control which page he/she wants
to watch by remote controller. There're two standard UOPs for this control: UOP_NEXT_DLIST and
UOP_PREV_DLIST .According to the spec, if the player receives UOP_NEXT_DLIST at the last Dlist,
it should display the 1st Dlist. If the player receives UOP_PREV_DLIST at the first Dlist, it should
ignore this UOP. However, some customer may want UOP_PREV_DLIST tojump to the last Dlist in
this case. If DVDAUD_PREV_DLIST_CYCLE is defined, it will cycle to the last Dlist. If not, it will
follow spec.
(31) DVD_STOP_NO_RESET_PTL: if this option is set, the navigation engine do not reset temp
parental setting when PBC state enter stop mode
(32) DVD_STOP_NO_RESET_ASTN: if this option is set, the navigation engine do not reset ASTN
setting when PBC state enter stop mode.
(33)DVD_STOP_NO_RESET_SPSTN: if this option is set, the navigation engine do not reset SPSTN
setting when PBC state enter stop mode.
(34)DVD_STOP_NO_RESET_AGLN: One modes of sysconfigDVD.
(35)DVD_REVERSE_END_RESTART_PLAY: restart playing instead of continue trick mode reverse
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 16 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(36)DVD_KEEP_TRICK_AFTER_SEARCH: keep the trick mode after search
(37)DVD_FORWARD_END_RESTART_PLAY: restart playing instead of continue trick mode forward
(38)DVD_FF_2X_PLAY_AUDIO: let DSP play at 2X speed instead of mute
(39)DVD_SKIP_KEEP_A: keep a point when doing next pg search
(40)DVD_STILL_NO_TRICK: in still menu, trick mode is prohibited.
(41)DVD_FAST_ALLOW_NO_VIDEO: in fast mode, allow jumping to a VOBU without video
(42)DVD_FORCE_CHG_ANGLE: allow user to change angle even in non-angle-block cell
(43)DVD_FAST_SL_AGL_CHG: seamless angle change doesn't block UOP
(44) DVD_AST_FOLLOW_USR: warning: turning this on violates the spec
(45)DVD_SPST_FOLLOW_USR: warning: turning this on violates the spec
(46)DVD_LOCK_INI_LCD: allow INI_LCD to be changed only in Initial Access
2.21. Miscellaneous options of VCD
(1) VCD_PBC_ON_PLAY: when user use PBC key switch to PBC on, let player start auto PBC play
(2) VCD_PLAY_PBC_ON: when user enter stop mode and the PBC is switched to off not by PBC
key (i.e. by SHUFFLE key), we will auto switch to PBC on and play when PLAY key is pressed.
(3) VCD_KEEP_FF, VCD_KEEP_FR, VCD_KEEP_SF: enable this option to keep FF/FR/SF state
when crossing tracks
(4) VCD_FORCE_PBC_ON_OFF: when user press the PBC key when disc is playing, we will switch
to PBC off from PBC on directly, continue current track playing. If the PBC is off, we will stop current
play track and switch it to PBC on then play the disc from PBC menu.
(5) VCD_FF2X_NO_MUTE: when user enters ff, not allow mute-state.
(6) VCD_SEARCH_KEEP_FF: when user enters search, allow use ff.
(7) VCD_SEARCH_KEEP_FR: when user enters search, allow use fr
(8) VCD_SEARCH_KEEP_SF: when user enters search, allow use sf
(9) VCD_SEARCH_KEEP_PAUSE: when user enters search, allow use PAUSE_STATE
(10) VCD_REPAB_KEEP_FF: when user enters repeat A_B, allow use FF-state.
(11) VCD_REPAB_KEEP_SF: when user enter repeat A_B, will allow use SF-state.
(12) VCD_FAKE_PBC: if PBC table is wrong, go to simulate PBC on.
(13) VCD_STRICT_MEM_CHK: if PBC state of last memory slot is not equal to current PBC state,
discard last memory play
(14) SETUP_MENU_PBC_CTRL: enable setup menu PBC control item
(15) VCD_DEFAULT_PBC_OFF: the PBC-state’s default value is PBC_OFF
(16) VCD_MENU_NO_ZOOM_IN: disable zoom in mode in PBC menu
(17) VCD_MENU_NO_ZOOM_OUT: disable zoom out mode in PBC menu
(18) VCD_MENU_NO_ZOOM: in PBC menu, not allow zoom-state.
(19) SVCD_4AST: add two additional and not available audio streams for SVCD disks
(20) VCD_USE_BOOKMARK_PBC: when this option is set, we will use the bookmark item’s PBC
state when the item is recalled. Otherwise, current PBC state will be kept.
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 17 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(21) VCD_NOT_KEEP_FF_IN_TRK_0: if this option is set, we do not keep FF state when go to track
0 even when VCD_KEEP_FF is set.
(22) CVD_4AST: assume CVD disc contains multiple audio streams.
(23) VCD_DGST_SHOW_MSG_ONLY: when this option is enabled, we will only show DIGEST
message on VFD, not show current digest item info on VFD.
(24) VCD_VFD_SHOW_HOUR: when this option is set, we will show 1:30:00 instead 90:00 on VFD.
(25) VCD_VFD_TRACK0_SHOW_TIME: when this option is, we will show play time for track 0.
(26) VCD_PSR_ERR_SKIP_LV 0: the range of this constant is from 0 to 10. Bigger value means
higher skip rate.
2.22. Miscellaneous options of CDDA
(1) CDDA_FF_KEEP_TRICK: if it is set, FF state will be held until end of the disk; if not, track FF
state will turn to PLAY when reach next track
(2) CDDA_FR_KEEP_TRICK : if it is set ,FF state will be held until beginning of the disk; if not, track
FF state will turn to PLAY when reach next track
(3) CDDA_AUTO_DISPLAY: when this option is set, we will turn on OSD display automatically after
CDDA auto play.
(4) NO_CDG_SUPPORT: support CDG format disk
(5) CDDA_NO_DISPLAY_OFF: define this option will remove the display off mode for CDDA
(6) CDDA_AUTO_DISPLAY: when this option is set, we will turn on OSD display automatically after
CDDA auto play
(7) HDCD_EN: enable HDCD support
(8) SHOW_CD_STREAM_TYPE: when HDCD is enabled
(9) CDDA_RTIME_FROM_ATIME: if this option is set, we will calculate relative time from absolute
time. This could fix the time stamp show problem if the disc's relative time is not reliable.
(10) CDDA_FAST_LOWER_VOL: this option allow decreasing the audio volume level in fast forward
mode
(11) CDDA_LOWER_LVL: the value of decreasing the audio volume in fast forward mode.
(12) CDG_START_X: CDG sub picture Start X
(13) CDG_START_Y: CDG sub picture Start Y
(14) CDG_M_WIDTH: CDG sub picture width
(15) CDG_M_H_PAL: CDG sub picture show mode PAL
(16) CDG_M_H_NTSC: CDG sub picture show mode NTSC
(17) SHOW_CD_JACKET: show jacket switch
(18) SHOW_CD_TEXT: show text switch
(19) SUPPORT_CD_TEXT: support text switch
2.23. Miscellaneous options of SACD
(1) SUPPORT_SACD: support SACD
(2) SACD_PCM_OUTPUT: if not define, SACD will output DSD data to DAC
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 18 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(3) SACD_PCM_88K, SACD_PCM_176K: SACD PCM output frequency, please note when output is
176k, most of the post processing can not be open.
(4) SACD_INFO_LIKE_CDDA: SACD info behavior like CDDA or not.
2.24. Miscellaneous options of PCD and JPEG
(1) JPEG_SHOW_DEC_STATUS: show OSD message when a JPEG image is under decoding
(2) JPEG_SEL_AUTOSLIDE: enable auto slide show when a JPEG picture is selected
(3) JPEG_SHOW_THUMBNAIL_IDX: if this is turned on, the index of the picture selected in this
page will be shown on OSD, else the index of the picture selected in the total play list will be shown.
(4) JPEG_DIGEST_BK_USE_LOGO: add this option to save space, whether use logo when show
jpeg digest background.
(5) JPEG_BG_FOR_DIGEST_MENU: to customize background of JPEG digest display
(6) JPEG_BG_COLOR_Y, JPEG_BG_COLOR_CB, JPEG_BG_COLOR_CR: three ponderance Y.
Cb. Cr to define the background color
(7) JPEG_SLIDESHOW_INTERVAL: define the time interval to proceed to the next picture in slide
show mode
(8) JPEG_TRANSITION_SPEED: define the wiping speed of JPG transition effect, form 0 to 255, 0
fastest, 255 slowest.
(9) JPEG_AUTO_SLIDE_AFTER_ROTATE: if this is set, the auto slide show mode will be able after
a picture is rotated, else will be disabled.
(10) JPEG_TIME_TO_SLIDE: the time between rotate and slide show
(11) JPEG_DDISC_DIGEST_ENABLE: enable JPG digest display mode for data disc
(12) JPEG_PROGRESS_SHOW_ENABLE: enable the progressing display effect for progressive
JPEG images
(13) JPEG_DGST_SHOW_NO: show the index of the picture selected on VFD in JPG digest mode
(14) JPEG_DIGEST_4x3: if this is set, 12 (4x3) pictures will be shown as one page in JPEG digest
else it will be shown 3x3 pictures
(15) DIGEST_X_DIM_NUMS: the number of picture in one X row
(16) DIGEST_Y_DIM_NUMS: the number of picture in one Y row
(17) DIGEST_H_GAP_DIV_4: the gap of each picture in X row
(18) DIGEST_V_GAP_NTSC_DIV_5: the gap of each picture in X row
(19) DIGEST_WIDTH_DIV_4: the picture width in digest mode
(20) DIGEST_HEIGHT_DIV_5: the picture height in digest mode
(21) JPG_MAX_PROGRESS_PIC_SIZ: if set > 0 maximum progressive jpg picture size (width x
height) to (n*100000) else n=0 turn off
(22) JPG_ADAPTIVE_PAN_STEP:
(23) JPG_H_PAN_STEP_NUM:
(24) JPG_V_PAN_STEP_NUM:
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 19 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
2.25. Miscellaneous options of MPEG4
(1) AVI_FSCAN_MODE, AVI_RSCAN_MODE: for high-speed scan mode, there have four mode
(a) SV_AVISCAN_DELAY 0: good accuracy with delay
(b) SV_AVISCAN_QUICK 1: quick and inaccurate, with no delay
(c) SV_AVISCAN_ACCURATE 2: good accuracy, no delay, only FWD SCAN
(d) SV_AVISCAN_DELAY_INDIS 3: delay indiscriminately, no accuracy
(2) AVI_FF_JMP_SPEED: mpeg4 scan speed
(3) AV_PLAY_MPG: support MPG
(4) AV_PLAY_AVI: support AVI
(5) AV_PLAY_OGG: support OGG
(6) AV_PLAY_A_LNLY_FILE:
(7) AVI_FAST_BM: fast but inaccurate bookmark and stop-resume
(8) AVI_FAST_TIME_PLAY: fast but inaccurate time search
(9) FITLONG_TV_SQ_PXL:
(10) AV_CFG_KEEP_ZOOM: keep zoom scale after file change
(11) AV_PLAY_UNSUP_A:
(12) AV_PLAY_UNSUP_V:
(13) AV_PLAY_UNSUP_FPS:
(14) AVI_ILLILV_A_FST_MODE:
(15) AVI_DELAY_INDIS_BASE:
2.26. Miscellaneous options of data disc
(1) DDISC_PB_SINGLE_ENABLED: the playback mode "SIGNAL" is not allowed if this option is not
set.
(2) DDISC_DEF_PLAYBACK_MODE: init the playback mode
(3) SV_REPEAT_NONE: the default playback mode when the system just booted.
(4) DDISC_READ_DISC_RETRY: set retry time for read disk
(5) DDISC_ENB_CONC_AV_MODE: config data disc playback mode properties
(6) DDISC_ENB_CDFS: enable CDFS
(7) DDISC_ENB_MIXED_TYPE_MODE: enable the mixed type mode
(8) DDISC_FTYPE_MP3_SUPPORT: Data disc file type MP3 support
(9) DDISC_FTYPE_MPEGA_SUPPORT: Data disc file type MPEGA support
(10) DDISC_FTYPE_AAC_SUPPORT: support AAC file type
(11) DDISC_FTYPE_JPEG_SUPPORT: support jpeg file type
(12) DDISC_FTYPE_MPG_SUPPORT: support MPG file type
(13) DDISC_FTYPE_WMA_SUPPORT: support WMA file type
(14) DDISC_FTYPE_MLP_SUPPORT: support MLP file type
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 20 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(15) DDISC_FTYPE_WAV_SUPPORT: support WAV file type
(16) DDISC_FTYPE_MP3PRO_SUPPORT: support MP3PRO file type
(17) DDISC_FTYPE_MAP_SUPPORT: support MAP file type
(18) DDISC_FTYPE_CDDA_SUPPORT: support CDDA file type
(17) DDISC_FTYPE_ASF_SUPPORT: support ASF file type
2.27. Certification related definition
(1)HDCD_AUTO_LEVEL: we will have -6 dB gain on CDDA/HDCD output.
(2)SHOW_CD_STREAM_TYPE: when HDCD is enabled
(3)DVD_IGNORE_BTN_NO_CMD: when this option is set to TRUE, and the DVD menu button
contains no navigation command, we just ignore the button select UOP and do not return UOP_FAIL.
(4)DVD_NEXT_STYLE: enter next style
(5)DVD_PREV_STYLE: reback the prev style
(6)DVD_GOTOP_OFFSET: can reback the last style in some limit time
(7)DVD_CHG_AST_OPT3 this option is the third option of audio stream change UOP
(a) SV_UOP_FORCE: set to this style the audio stream change will always be successful,
even between AC3 and DTS streams. Note this option does not complete the DVD certification
requirement.
(b) SV_UOP_BLOCK: we will always check the UOP block before switching audio
stream. If the UOP is blocked, the navigation engine will return UOP fail.
(8)DVD_SHOW_MSG_FIRST: when this option is set, we show NEXT/PREVIOUS OSD first then
send the UOP to increase the user key operation response time.
(9)DVD_NO_PTT_PLAY_UOP_BLOCK: if this option is enabled, we do not check PTT search block
flag for chapter search mode.
(10)TITLE_PLAY_IGNORE_UOP_BLOCK: we this option is set to TRUE, the navigation engine do
not check UOP block for UOP_TITLE_PLAY
(11)TREAT_PS_LB_AS_THE_SAME: when this option is set, in 16:9 video, if user selects an unexisted
TV Display mode (PS/LB), system will switch to the other if exists. (12)DVD_NEXT_STYLE
SV_NEXT_NORMAL
(13)DVD_NEXT_STYLE SV_DVD_NEXT_TITLE DVD_NEXT_STYLE (SV_DVD_NEXTCHAP_FST
+SV_NEXT_POST)
(14)DVD_PREV_STYLE SV_PREV_ONLY
DVD_PREV_STYLE (SV_DVD_PREV_TITLE + SV_DVD_PREV_CHAP + SV_PREV_GOTOP)
(15)DVD_GOTOP_OFFSET 2 //0
(a) SV_PREV_ONLY: when this option is set, do not perform GOTOP.
(b) SV_DVD_PREV_TITLE: when this option is set, go to previous title if in first chapter of
current title.
(c) SV_DVD_PREV_CHAP: when this option is set, if current PG is the first PG of a PGC,the
first priority is to jump to previous chapter, rather than go to the first PG of previous PGCN.
(d) SV_PREV_GOTOP: when this option is set, if the player has played this PG for a while,
jump to the beginning of this PG instead of going to previous PG. The threshold is
specified in BYTE2.
(e) DVD_GOTOP_OFFSET: 2 VOBUs
(16)DVD_CHG_AST_OPT3 SV_UOP_BLOCK
(a) SV_UOP_FORCE: set to this style the audio stream change will always be successful,
even between AC3 and DTS streams. Note this option does not comply the DVD certification
requirement.
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 21 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(b) SV_UOP_BLOCK: we will always check the UOP block before switching audio stream. If
the UOP is blocked, the navigation engine will return UOP fail.
(17)TITLE_PLAY_IGNORE_UOP_BLOCK (FALSE)
(18)CHECK_TV_ASPECT_SET
2.28. Miscellaneous options of file system menu
(1) FSMENU_STYLE_1: The menu with the alternative style.
(2) FSMENU_WITH_BUTTONS: We present the items on file menu with buttons if this option is set.
Otherwise, we present all the items with highlight only.
(3) FSMENU_DISABLE_PREV_WHEN_SHUFFLE: The playback mode "SHUFFLE" is disabled
during searching the previous item if this option is set.
(4) FSMENU_DEF_OPMODE: The default operation mode of file menu when the system just booted.
(5) FSMENU_DISABLE_OPMODE_SWITCH: The operation mode of file menu is disabled if this
option is set.
(6) FSMENU_SYNC_SELECTED_AND_HILIT: We force to sync the selected item with the one on
highlight now. It means that the hovering item can't be moved when an item is on highlight (played).
(7) FSMENU_PARENT_DIR_MSG_IDX: The index indicates the message used to present the
parent directory on menu.
(8) FSMENU_HLITEM_TEXT_COLOR: Which color we use to present the text on a selected button.
(9) FSMENU_DENY_PLAYING_ITEM_SELECTION: We don't allow the select the playing if the
option is set.
(10) FS_ENABLE_NEXT_PREV_WHEN_SINGLE: We will change to next item when we press
"NEXT" or "PREV" even it is under playback mode "SINGLE" if this option is set.
(11) FSMENU_INFO_PANEL: A WB area to show information
(12) ISO_PAUSE_STEP_NO_STEP: if set it, there is no step function when play ISO file.
(13)FSMENU_WITH_FILE_INFO:
2.29. Audio file option
(1) AFILE_TRICK_MODE_STILL:
(2) ENABLE_ID3 : enable ID3
2.30. OSD display option
(1) MT1389_OSD: only define after 1389 only.
(2) FONT_NO_BORDER: this option will let the OSD font boarder color as background color
(3) NUI_OSD_STYLE: use NUI OSD style.
(4) OSD_SLIDER_SUPPORT: support slider in setup menu.
(5) OSD_TRANSPARENT_BG: support transparent background
(6) KEEP_REMAIN_TYPE_SHOW: define this option will let the time remain type kept on the screen
is the display mode is not off
(7) KEEP_PLAY_INFO_SHOW: define this option will let the play info (title/chapter/track) be kept on
the screen after display time mode switched if the display mode is not off
(8) DISPLAY_SHOW_INFO_FIRST: this is an exclusive option of KEEP_PLAY_INFO_SHOW. When
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 22 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
this option is defined, the first DISPLAY key pressed will show current display mode message first.
Before the message is timeout, the second DISPLAY key input is used to switch display mode really.
(9) TIME_INFO_SAME_LINE: if this option is set, we will let time mark and play info show at the
same line
(10) USR_PBC_NO_TOTAL_TIME: when user control mode, like shuffle mode, is turned on, we will
disable the total elapsed/remain time display mode if this option is set.
(11) SHOW_ERROR_TYPE_MSG: if the user operation is failed, show icon only or show help
message also
(12) NO_DISC_STOP_CLEAR: this is only for demo purpose. When press STOP key in no disc state,
clear OSD and show logo only.
(13) MULTI_LANG: support Multi-Language, open it when you use multi-language OSD .
2.31. DVD next/previous style
(1) DVD_NEXT_STYLE:
(a) SV_DVD_NEXT_POST: when this option is set, UOP blocking is ignored.
(b) SV_DVD_NEXT_TITLE: when this option is set, it’ll jump to next title.
(c) SV_DVD_NEXT_POST: when this option is set, post command is executed.
(2) DVD_PREV_STYLE:
(a) SV_PREV_ONLY: when this option is set, PREVIOUS key will go to previous item directly.
(b) SV_DVD_PREV_TITLE: when this option is set, go to previous title if in first chapter of
current title.
(c) SV_DVD_PREV_CHAP: when this option is set, if current PG is the first PG of a PGC, the
first priority is to jump to previous chapter, rather than go to the first PG of previous PGCN.
(d) SV_PREV_GOTOP: when set DVD_PREV_STYLE as this style, PREVIOUIS key will go to
current item start if current item time is greater than DVD_GOTOP_OFFSET (in seconds). Otherwise,
jump to the previous item.
(3) DVD_FIRST_ITEM_PREV_STOP: when in program mode and repeat mode is not set, press the
PREVIOUS key in the first item of the list will stop the playback.
(4) DVD_LAST_ITEM_NEXT_STOP: when in program mode and repeat mode is not set, press the
NEXT key in the last item of the will stop the playback.
(5) DVD_SHUFFLE_NO_PREV: if this option is set, the PREVIOUS key in shuffle mode is prohibited
2.32. VCD next/previous style
(1) VCD_PBC_NEXT_STYLE:
(a) SV_VCD_NEXT_NORMAL: if NEXT fails, ignore the UOP and return UOP_FAIL
(b) SV_VCD_NEXT_RETURN: if NEXT fails, call RETURN
(c) SV_VCD_NEXT_STOP: if NEXT fails, go to STOP state.
(2) VCD_PBC_PREV_STYLE:
(a) SV_VCD_PREV_NORMAL: if PREVIOUS fails, ignore the UOP and return UOP_FAIL
(b) SV_VCD_PREV_RETURN: if PREVIOUS fails, call RETURN.
(c) SV_VCD_PREV_STOP: if PREVIOUS fails, go to STOP state.
(3) VCD_PREV_STYLE: this is used to define the PREVIOUS key style of VCD
(a) SV_PREV_ONLY: when set VCD_PREV_STYLE as this style, PREVIOUS key will go to
previous item directly
(b) SV_PREV_GOTOP: when set VCD_PREV_STYLE as this style, PREVIOUIS key will go to
current item start if current item time is not greater than VCD_GOTOP_OFFSET (in seconds).
(4) VCD_FIRST_TRACK_PREV_STOP: when this option is set, and in PBC off sequential play mode,
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 23 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
press the PREVIOUS key in the first track will go to stop mode directly.
(5) VCD_LAST_TRACK_NEXT_STOP: when this option is set, and in PBC off sequential play mode,
press the NEXT key in the last track will go to stop mode directly.
(6) VCD_SHUFFLE_NO_PREV: if this option is set, the PREVIOUS key in shuffle mode is prohibited.
Note current version doesn’t support PREVIOUS in shuffle mode when playing VCD.
(7) PBC_ON_NUM_SEL_TRK: when this option is set, the number key input in PBC play list state
will go to select track mode directly
2.33. CDDA next/previous style
(1)CDDA_PREV_STYLE: set the style to SV_PREV_ONLY or V_PREV_GOTOP.
(2) SV_PREV_ONLY: when set CDDA_PREV_STYLE as this style, REVIOUS key will go to previous
item directly
(3) SV_PREV_GOTOP: when set CDDA_PREV_STYLE as this style, REVIOUIS key will go to
current item start if current item time is not greater than CDDA_GOTOP_OFFSET (in seconds).
(4) CDDA_GOTOP_OFFSET: set the time which effect SV_PREV_GOTOP
(5) CDDA_FIRST_TRACK_PREV_STOP: when this option is set, and in equally play mode, press
the NEXT key in the last track will go to stop mode directly
(6) CDDA_LAST_TRACK_NEXT_STOP:DDA_LAST_TRACK_NEXT_STOP when this option is set,
and in sequential play mode, press the NEXT key in the last track will go to stop mode directly
(7) CDDA_SHUFFLE_NO_PREV: if this option is set, the PREVIOUS key in shuffle mode is
prohibited
2.34. Stop mode options
(1) STOP_RESUME_STYLE: there are two stop-resume styles are supported.
(a) STOP_RESUME_TWO_KEYS: when set STOP_RESUME_STYLE as this style, there are
only one stop state and use RESUME key to resume playback and PLAY key to play from the start of
the disc.
(b) STOP_RESUME_TWO_STOP: when set STOP_RESUME_STYLE as this style, there are
two stop states. When press first stop key in the normal playback state, it will go to stop-resume state.
Press PLAY key at this time will resume playback. When press second stop key in the stop-resume
state, it will enter fully stop state, and press PLAY key in this state will play from the start of the disc.
(2) DVD/VCD/ISO/CDDA_STOP_LOGO/ISO: when enter the stop mode from playback state, you
can select which logo will be shown on the screen. Different disc types could have different logo.
(a) SV_LOGO_JACKET: this is only for DVD, if the Jacket is not available, the normal logo will
shown.
(b) SV_LOGO_FLASH: set to this type will show the logo in the FLASH.
(c) SV_LOGO_COLOR: set to this type will let the screen show a single color. The color could
be customized or you can use predefined color, such as LOGO_BLACK, LOGO_BLUE, and etc.
(3) SUPPORT_CAPTURE_LOGO: Support capture LOGO function
(4) DVD_LOGO_COLOR 0: let the screen show a single color [0, 1, 2].
(8) CAP_LOGO_SZ: define capture logo size
2.35. DVD audio/sub-title/angle change option
(1) DVD_USER_STREAM_CHANGE: there are three stream changing methods available
(a) DVD_STREAM_CHANGE_DIRECT: when set to this style, press the AUDIO/SUBTITLE
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 24 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
key will switch to next available stream number directly.
(b) DVD_STREAM_CHANGE_INFO: when set to this option, press the AUDIO/SUBTITLE key
first time will show current stream information directly. Press the key before the OSD disappeared will
switch to next available stream number.
(c) DVD_STREAM_CHANGE_SELECT: this style is the same with
DVD_STREAM_CHANGE_INFO, but user could use number key to select preferred stream number
directly.
(d) DVD_UOP_BLOCK_NO_STREAM_INFO: if the DVD_USER_STREAM_CHANGE is set
to DVD_STREAM_CHANGE_INFO or DVD_STREAM_CHANGE_SELECT style, we will check if the
UOP is blocked before current stream information shown. If the UOP is blocked, we will show invalid
operation message and the user operation will be failed.
(2) DVD_ANGLE_CHANGE_SELECT: when this option is set, user will be allowed to use number
key to select angle number directly, or the ANGLE key will switch to next available angle number
directly.
(3) DVD_CHG_AST_OPT2: this option is the second option of audio stream change UOP
(UOP_CHANGE_ASTN) actually.
(a) SV_AUDIO_MASTER: this is the default style, and this will let the audio switching more
smoothly.
(b) SV_VIDEO_MASTER: this mode is not used.
(4) DVD_CHG_AST_OPT3 this option is the third option of audio stream change UOP
(a) SV_UOP_FORCE: set to this style the audio stream change will always be successful, even
between AC3 and DTS streams. Note this option does not comply the DVD certification requirement.
(b) SV_UOP_BLOCK: we will always check the UOP block before switching audio stream. If
the UOP is blocked, the navigation engine will return UOP fail.
2.36. Trick mode customization
(1) DVD: default we have 5 modes (Normal/2X/4X/8X/16X) for fast forward/reverse mode and 5
modes (Normal////) for slow forward/reverse mode. For the fast playback, the first mode is trivial. The
second/third modes are done by video decoding process. The fourth and larger modes could be
customized. For the slow playback, the first mode is also trivial. The other modes will repeat the
picture n times for mode n.
(a) DVD_FAST_MAX: the max modes for fast forward/reverse. Default we have 5 modes.
(b) DVD_SLOW_MAX: the max modes for slow forward/reverse. Default we have 5 modes.
(c) pbDVDFastSpeedTbl: this is the fast skip VOBU numbers array which must contain items
as many as the number DVD_FAST_MAX. The first 3 modes could not be customized and the value
must be set to 0. The other elements all could be adjusted. Default we skip 2 VOBUS for 8X and 4
VOBUS for 16X.
(d) pbDVDFastDispTbl: this is OSD display number for each fast mode. Note the first item is
also not used.
(e) pbDVDSlowDispTbl: this is OSD display number for each slow mode. Note the first item is
also not used.
(2) VCD: for VCD we also have the same mechanism with DVD, and the skip number is changed
from VOBU to seconds.
(3) MP3/WMA: for MP3 and WMA, the trick mode is fixed and could not be customization in the
current implementation.
(4) CDDA:
(a) CDDA_FAST_MAX: the max modes for fast forward/reverse. Default we have 5 modes.
(b) pbCDDAFastSpeedTbl: this is not used in current code
(c) pbCDDAFastDispTbl: this is the displayed speed OSD for each mode
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 25 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
2.37. User control option
(1) PLAYER_PROGRAM: define this option will enable the program function module for
DVD/VCD/CDDA.
(2) PLAYER_BOOKMARK define this option will enable the bookmark function module for
DVD/VCD/CDDA.
(3) PLAYER_DIGEST: define this function will enable the digest function for DVD/VCD/MPS.
(4) PLAYER_FLMENU: new file system menu
(5) PLAYER_VRMT: support VRMT function
(6) PLAYER_GOTO: support GOTO function
(7) PLAYER_ZOOMIN_INDICATOR: support zoom function
(8) STPMN_HEAD_GRAY: add for nui, gray header bitmap when unselected.
(9) PROG_NO_STOP_RESUME: if the option is set, press STOP will enter to fully stop state directly.
(10) PLAYER_SCAN: change input state when play DVD-audio
(11) STOP_CANCEL_USR_CTRL: when this option is set, the user control mode
(program/shuffle/random) will be cancelled when PBC state switch to stop state.
(12) SINGLE_STOP_KEEP_USR_CTRL: the user control mode will be enabled when PBC state
switch to stop state
2.38. VFD display related configuration
(1) VFD_SUPPORT: support VFD, the driver IC of VFD is 16311 or 16312.
(2) PANEL_LED: support led show.
(3) LCD_HT1621: support LCD, the driver IC of LCD is HT1621.
(4) VFD_SHOW_PBC_PLAY: when this option is set, we will show PBC PLAY on VFD, instead show
time mark.
(5)VFD_SHOW_CVD_AS_VCD: when this option is set, we will show VCD icon on the VFD for CVD,
else we will show CVD icon, if we have the icon.
(6)PLAYER_IO_KEY: when this option is set, support IO key key-press.
(7)PLAYER_IO_LED: when this option is set, support IO LED.
(8) VFD_KEYSCAN_LOOP_CNT: in power down mode, how long will detect the key scan.
(9) VFD_MAX_UPDATE_CNT: VFD can update how many changed position per timer interrupt.
(10) DISC_STYLE: from 0 to 4.
(a) 0: diagonal light, clockwise
(b) 1: diagonal light, counter clockwise.
(c) 2: only one dark, others light, clockwise
(d) 3: only one dark, others light, counter clockwise
(e) 4: diagonal dark, others light, clockwise
(11)VFD_SHOW_ERR: if your system internal test, you can see error on VFD.
(12)PANEL_VFD_LED: turn on this option to support VFD control IC's LED port
(13)VFD_TEMP_TEXT: turn on this option to support VFD-temp text.
(14)DVD_MENU_SHOW_VFD_CIRCLE: the default setting do not turn on the VFD wheel when we
in the DVD menu domain. Enable this option will let the wheel on in the domain.
(15)VCD_MENU_SHOW_VFD_CIRCLE: the default setting do not turn on the VFD wheel when we
in the VCD menu domain. Enable this option will let the wheel on in the domain.
(16)VFD_NO_DIRECT_TEXT: VFD does not support direct text.
(17)VFD_INIT_STATE_FLASHING: support VFD init state VFD flashing.
(18)VFD_STANDBY_LED: if you use VFD control IC's LED port to set power on/standby indicator,
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 26 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
you could turn on this option to support this function.
(19)VFD_HDCD_LED: if you use VFD control IC's LED port to set HDCD decoding indicator, you
could turn on this option to support this function.
(20)VFD_DATA_H: use the field “vfd\vfd_data.h”
(21)VFD_DATA_C: use the field “vfd\vfd_data.c”
(22)VFD_KEY_C: use the field “vfd\vfdkey.c”
(23)RISC_1K_SQUARE_WAVE: turn RISC_1K_SQUARE_WAVE on will ask RISC to generate 1K
HZ square wave in P3.5.
2.39. Password
(1) PASSWORD_LEN: this option will set the DVD parental level change passwords, it could be 4, 5,
or 6 digits.
(2) NO_DEFAULT_PASSWORD: if this option is set, we will reset the parental password to an invalid
value, so the user do not need to look up the factory default password setting when he or she first
using the player.
(3) _pbSuperPass[ ]: this the universal password for parental level in case the user forget his
password setting.
(4) _pbFactoryPass[ ]: this is the factory default password. Note this is only useful when the option
NO_DEFAULT_PASSWORD is not defined.
(5) GOTO_VTSTT_DOM_ONLY: allow entering Goto in VTSTT_DOM only
(6) GOTO_IN_TRACK_ONLY: allow entering Goto in track only
(7) NO_SCROLL_OVER: define this to disable scrolling over behavilor, such as setup menu, goto
menu.
(3)GOTO_VCD_SEGMENT: define this to enable VCD's segment search
(4) GOTO_STATUS_NO_TTCH: define this to show displayed time type and bitrate number
(5) GOTO_SEPARATE_KEY IR_XXX: define this to use another key for entering Goto
2.40. Setup menu configuration
(1) SETUP_NO_BORDER: draw border for WB_SETUP_ITEM & WB_SETUP_MSG
(2) SETUP_MENU_OPTION_SELECT_RETAIN_OPTION: Retain in option area when option is
selected.
(3) SETUP_HEAD_BITMAP: in setup menu, the bitmap of head has three types: BITMAP_DEF,
BITMAP_JYC, BITMAP_JYC2
(4) NO_REGION_CODE: do not show region code
(5) NO_INT_VER: do not show internal version number
(6) SHOW_MARK: show right arrow between item & option
(7) SIMPLE_MENU: simpler menu for 2 channels model
(8) USE_TYPE_2: type 1 menu is flat style, type 2 menu is button style
(9) SETUP_NO_AGL_MARK: in setup menu, has no angle mark.
(10) SUPPORT_TRUECOLOR: support true color.
(11) SETUP_MENU_TRUECOLOR: setup menu white board use true color
(12) WB_ALLOC_MIN:
(13) ENABLE_USER_LANG_CODE: let user can input language code
(14) ALL_WB_USE_TRUECOLOR: all of white boards use true color
(15) STP_VDO_Q_MENU: setup menu has video quality menu.
(16) SET_VSURR_IN_SPKCFG: put virtual surround related setting item in speak configuration page
(17) RESET_CLOSE_SETUP_MENU: if defined, after user press reset, the setup menu will closed.
(18) SIMPLE_USE_MULTI_MENU: in 2 channels version, user can select flat style or button style
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 27 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
setup menu.
(19) SCART_SELECTION: enable SCART output select items in setup menu
(20) SET_PTL_NEED_PWD: if defined, when user want to set parental level, he/she need input
password first.
(21) PWD_ON_NO_SET_PTL: if defined, if password switch is on, user can’t set parental level.
(22) SETUP_ENABLE_TEST_TONE: enable test tone item in setup menu
(23) SETUP_ENABLE_DIALOG_GAIN: enable dialog gain item in setup menu.
(24) DOWNMIX_NO_SUBWOFFER: in downmix state, has no subwoofer.
(25) SPDIF_ON_NO_TEST_TONE: when option SETUP_ENABLE_TEST_TONE and this option
both are set, we will not allow user select test tone when SPDIF output mode is enabled.
(26) SUBWOOFER_TEST_TONE: when option SETUP_ENABLE_TEST_TONE and this option art
set, we will allow user select test tone when subwoofer output mode is enable.
(27) MENU_ITEM_PIC_MODE: enable picture mode.
(28) SETUP_PAUSE_PLAY: when this option is set, enter in setup menu, the disc will pause, exit
setup menu, the disc will play continue.
(29) PLAY_NO_CHG_TV_FMT: when disc playback (include digest), user can’t change TV format.
(30) SETUP_CIRCULAR_ITEM: if defined, when user go to the last item (option), press next, it will
go to the first item (option).
(31)SIMPLE_AUDIO_SETUP_MENU: show simple audio item in setup menu when define simple
menu.
(32) SIMPLE_SPDIF_CTRL: show simple spdif ctrl item in setup menu.
(33) CHNL_DELAY_USE_TIME: channel delay use time display (0ms ~ 15ms)
(34) SPDIF_PCM_CH_SELECT: in PCM of SPDIF, the channel can select.
(35) SHOW_SPK: if defined, the TRIM_PAGE will show 5 speakers.
(36) PLAYER_TRIM: enable Trim page in setup menu/audio page and related function.
(37) PLAYER_SEQ: enable Super Equalizer page in setup menu/audio page and related function.
(38) PLAYER_ADV_EQ: enable Advanced Equalizer page in setup menu/audio page and related
function.
(39) PLAYER_MIC_EQ: enable Microphone Equalizer page in setup menu/audio page and related
function.
(40) PLAYER_3D_GAIN: enable Gain page in setup menu/audio/3D page and related function.
2.41. Setup Menu Default Option
(1) TV_SYSTEM_DEFAULT SV_PAL: the default value of TV system is SV_PAL
(2) OSD_LANG_DEFAULT EV_OSD_CHINESE: the default value of OSD language is
EV_OSD_CHINESE.
(3) AUDIO_LCD_DEFAULT EV_CHINESE: the default value of Audio LCD is EV_CHINESE
(4) SP_LCD_DEFAULT EV_CHINESE: the default value of subtitle is EV_CHINESE
(5) MENU_LCD_DEFAULT EV_CHINESE: the default value of Menu Lcd is EV_CHINESE
(6) REGION_DEFAULT EV_CHINA: the default value of region code is EV_CHINA.
(7) ASPECT_DEFAULT SV_4_3_PS: the default value of aspect is SV_4_3_PS.
(8) TV_SYSTEM_DEFAULT SV_NTSC: the default value of TV system is SV_NTSC.
(9) OSD_LANG_DEFAULT EV_OSD_ENGLISH: the default value of osd language is
EV_OSD_ENGLISH
(10) AUDIO_LCD_DEFAULT EV_ENGLISH: the default value of audio LCD is EV_ENGLSIH
(11) SP_LCD_DEFAULT EV_OTHER: the default value of subtitle is EV_OTHER.
(12) SP_LCD_DEFAULT EV_LANG_OFF: the default value of subtitle is EV_LANG_OFF.
(13) MENU_LCD_DEFAULT EV_ENGLISH: the default value of menu LCD is EV_ENGLISH
(14) REGION_DEFAULT EV_USA: the default value of region code is EV_USA.
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 28 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(15) ASPECT_DEFAULT SV_4_3_PS: the default value of aspect is SV_4_3_PS
(16) GLOBAL_SPDIF_DEFAULT EV_PCM: the default value of SPDIF is EV_PCM
(17) SPEAKER_SET_DEFAULT EV_DOWN_OFF: the default value of speaker set is
EV_DOWN_OFF
(18) CNTR_SPK_DEFAULT EV_LARGE: the default value of center speaker is EV_LARGE
(19) REAR_SPK_DEFAULT EV_LARGE: the default value of rear speaker is EV_LARGE
(20) POST_DRC_DEFAULT EV_POST_DRC_OFF: the default value of post dynamic is EV_POST
DRC_OFF.
(21) GLOBAL_SPDIF_DEFAULT EV_RAW: the default value of SPDIF is EV_RAW
(22) SPEAKER_SET_DEFAULT EV_DOWN_LORO: the default value of speaker set is
EV_DOWN_LORO
(23) CNTR_SPK_DEFAULT EV_SMALL: the default value of center speaker is EV_SMALL
(24) REAR_SPK_DEFAULT EV_SMALL: the default value of rear speaker is EV_SAMLL.
(25) POST_DRC_DEFAULT EV_POST_DRC_AUTO: the default value of post dynamic is
EV_POST_DRC_AUTO
2.42. Screen saver configuration
(1) Select screen saver type: there are two types provided, SS_BMP and SS_RECT. SS_BMP is for
bitmap type and SS_RECT is for rectangle type screen saver. Note that rectangle type is no use any
more.
(2) SS_USE_ONE_BMP: use one bitmap or animation bitmaps (two bitmaps)
(3) SCR_SAVER_TIMEOUT: this constant configures the screen saver timeout count, 1 tick for 5
seconds. Default is 3 minutes.
(4) MOVE_PER_STATE: move speed, bigger for higher speed
(5) SS_START_X/Y: start location X/Y
(6) SS_BMP_WIDTH/HEIGHT: bitmap width and bitmap height in pixel
(7) SS_NO_LIGHT_COL: no use lighter color
(8) SCR_SAVER_TIMEOUT: this constant configures the screen saver timeout count, 1 tick for 5
seconds. Default is 3 minutes.
(9)SS_NO_LIGHT_COL: no use lighter color.
(10)SS_FADE_INOUT: use fade in / fade out screen saver.
2.43. Remote controller setup
(1) PLAYER_NO_IR: if no remote control, define it
(2) IR_USE_HW: if this option is set, we will use the hardware assisted circuit to detect IR input
sequence. The default setting is on to reduce the IR interrupt input frequency.
(3) IR_USE_REPEAT: turn on this option to enable IR repeat code support. Both hardware and
software method support this function.
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 29 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(4) IR_CHECK_DATA_CODE_INV: if this option is set, we will check if the data code inverse
coincides with the data code. This will increase IR interrupt processing time and reduce the possible
error for the IR receiving.
(5) IR_STRICT_TIMING: if this option is set, we will use a strict time margin to check the IR
sequence's timing. This will reduce the possible error for IR receiving and the sensitivity of IR will be
reduced also if the IR emitter timing is biased.
(6) MTK_REMOTE: select the built-in remote controller mapping table.
(7) SF_SR_SAME_KEY: if the option is set, we will switch to slow reverse mode when press slow
forward key in the max slow forward mode.
(8) IR_SUPPORT_SHIFT_KEY: if this option is set, we will support the key combination
of SHIFT and other keys.
(9) ISO_SELECT_USE_ADD10_KEY: for the ISO file number selection, you could press digital
number key 2, 5, 6, to select file number 256. If you want the style to be compatible with the other
input mode, you could set this option on.
(10) STOP_RESUME_STYLE: set stop style
(11) STOP_RESUME_TWO_KEYS: when set STOP_RESUME_STYLE as this style, there are only
one stop state and use RESUME key to resume playback and PLAY key to play from the start of the
disc.
(12) STOP_RESUME_TWO_STOP: when set STOP_RESUME_STYLE as this style, there are two
stop states. When press first stop key in the normal playback state, it will go to stop-resume state.
Press PLAY key at this time will resume playback. When press second stop key in the stop-resume
state, it will enter fully stop state, and press PLAY key in this state will play from the start of the disc.
(13) CDDA_NO_STOP_RESUME: define this option will remove stop-resume state for CDDA. Press
the STOP key in playback mode will enter full stop mode directly.
(14) USE_NUM0_AS_NUM10: if this option is set, and user press number key 0 directly in the
number input state, we will set the input number as 10 and finish the number input sate.
(15) NO_ADD10_KEY: if your remote controller does not have +10 key, please set this option. All the
number input will be sequentially input as TV set.
(16) PN_IP_SAME_KEY: PAL and NTSC use one key
(17) USE_TEMP_DIGEST_KEY: the switch of IR_DIGEST
(18) ADD10_SHOW_10: OSD show add 10 flag
(19) USE_TEMP_SR_KEY: the switch of IR_SR
(20) USE_TEMP_CLEAR_KEY: the switch of IR_CLEAR
(21) PTT_TRK_SEARCH_CONFIRM: for DVD PTT and VCD Track search
(22) SHUFFLE_RANDOM_SAME_KEY: SHUFFLE and RANDOM use same key switch
(23) ZOOM_IN_OUT_SAME_KEY: if this option is set, we will switch to zoom out mode from the
zoom in 4X mode for the ZOOM IN key.
(24) ISO_TIMEOUT_SELECT: if this option is set, we will use current input number to select file
automatically when the OSD display is timeout.
(25) NUM_KEY_SEARCH for DVD/VCD: if this option is set, press number key in the normal play
mode will auto switch to chapter search for DVD and track search for VCD.
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 30 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(26) NUM_KEY_DIRECT_SEARCH: if this option is set, the first input number key will pass to
number input state as current select number. If this option is not set, this first number is used to
activate the search state only.
(27) NUM_KEY_SEARCH: for DVD/VCD: if this option is set, press number key in the normal play
mode will auto switch to chapter search for DVD and track search for VCD.
(28) NUM_KEY_DIRECT_SEARCH: if this option is set, the first input number key will pass to
number input state as current select number. If this option is not set, this first number is used to
activate the search state only.
(29) NUM_KEY_DIRECT_SEARCH_CHECK_RANGE: if this state is set, we will check if the current
press number key is in the valid range. If it is not, we will not process the number key.
(30) ONE_PTT_NO_SEARCH: DVD: if this option is set, we will prohibit the search mode when the
current played title has one chapter only.
(31) ONE_TRACK_NO_SEARCH: if this option is set, we will prohibit the search mode for the VCD
only has one track only.
(32) DIGIT_CANCEL_REPEAT: if this option is set, user use digit button to select or use the time
search function will cancel repeat mode
(33) ZOOM_NO_SLOW_STEP: if this option is set, we will not allow user use SLOW key and STEP
when the ZOOM mode is on.
2.44. Tray control define area
(1) SLOT_IN: if you use slot in tray, please define it.
(2) THOMSON_TRAY: if you use Thomson tray, please define it.
(3) TOP_LOADER: please define this option to support top open cover loader
(4) MT1389HD_NO_SERVO: 1389HD, if no servo, please define it.
(5) ENABLE_TRAY_PWM: Tray Power function control, the value is 0 or 1.0 is not eject control, 1
has eject control.
(6) TRAY_IN_OUT_DELAY: add some delay time when touch/leave limit S/W.
(7) TRAY_OPEN_LEVEL1, TRAY_OPEN_TIME1, TRAY_OPEN_LEVEL2, TRAY_OPEN_TIME2,
TRAY_OPEN_LEVEL3: for the tray open over use time
(8) TRAY_CLOSE_LEVEL1, TRAY_ CLOSE _TIME1, TRAY_ CLOSE _LEVEL2, TRAY_ CLOSE
_TIME2, TRAY_ CLOSE _LEVEL3: for the tray close over use time
(4) LIMIT_TRAY_ERR: when the tray is jammed, we will try to do open when tray is closing, and try
to do close when tray is opening. If you want to limit the retry times, you could enable this option and
set the constant MAX_TRAY_ERR_CNT as you want.
(10) MAX_TRAY_ERR_CNT: the tray errors retry count.
2.45. Servo related setting
Vendor.h Introduction
MediaTek Confidential Revision 1.0 – 2004-11-1 Page: 31 of 31
© 2005 MediaTek Inc.
The information contained in this document can be modified without notice
(1) SRV_DATA_READ_TIMEOUT: this constant is used to configure the max timeout value for the
single data sector reading. Current setting is 2 seconds and this is dependant on the loader
performance.
(2) SRV_ERROR_RETRY: servo errors retry count.
(3) SRV_SHOW_ERROR_COUNTER: if this option is enabled, we could display current servo error
counter on the OSD.
(4) DVD_ARBUF_DEFAULT: this constant is used to set the audio muting time during audio stream
switching. This setting depends on the loader’s seek performance and its scale is 90000256×n
seconds.
(5) MINI_DVD_8X_SPEED: if support MINI_DVD, the servo reads it as 8x speed.
2.46. Define Vendor DEBUG ATAPI CMD
(1) DRS232_DEBUG: must define it, that with it we can read the data value by mtktool.
2.47. Certification related definition
(1) DVD_CERTIFICATION: it will define some DVD certification, and is same like define in DVD
Miscellaneous. This function is convenient to user to define some values that we should change
always.
2.48. Include file
Only define some files we use.