大红鹰dhy登录界面「网站首页」欢迎您 /get-tosun-lin-function-operation-process-in-3-minutes/ Fri, 09 Dec 2022 08:44:43 +0000 /?p=2091 鏈枃瀵艰 LIN 鏄 Local Interconnect Network 鐨勭缉鍐欙紝鏄熀浜 UART/SCI( […]

The post 3鍒嗛挓get鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼锛堟帹鑽愭敹钘忥級 first appeared on 涓婃捣鍚屾槦鏅鸿兘绉戞妧鏈夐檺鍏徃.

]]>

鏈枃瀵艰

LIN 鏄 Local Interconnect Network 鐨勭缉鍐欙紝鏄熀浜 UART/SCI(Universal Asynchronous Receiver-Transmitter / Serial Communication Interface锛岄€氱敤寮傛鏀跺彂鍣?涓茶閫氫俊鎺ュ彛)鐨勪綆鎴愭湰涓茶閫氫俊鍗忚銆傚彲鐢ㄤ簬姹借溅銆佸鐢点€佸姙鍏澶囩瓑澶氱棰嗗煙銆侟/p>

鏈枃涓昏閽堝鍚屾槦LIN涓汇€佷粠鑺傜偣浠跨湡鍔熻兘浠ュ強鍏朵粬鍔熻兘鐨勬搷浣滄祦绋嬪嚭涓€涓缁嗘暀绋嬨€侟/span>

涓€銆佸悓鏄烲IN涓昏妭鐐逛豢鐪熷姛鑳芥搷浣淈/h2>

1銆佺‖浠惰繛鎺ュ噯澶嘃/span>

浣跨敤鍚屾槦LIN纭欢浠跨湡涓昏妭鐐规ā寮忎笅锛岄渶瑕佸閮ㄧ數婧愪緵鐢碉紝涓轰簡淇濇寔LIN鎬荤嚎鐢靛钩淇″彿璺熻娴嬩欢涓€鑷达紝杩炴帴绀烘剰鍥惧涓嬶細

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

2銆乀SMaster杞欢鎿嶄綔娴佺▼

浠ヤ笅鎿嶄綔娴佺▼浠SMaster浠跨湡LIN涓昏妭鐐癸紝琚祴浠朵粠鑺傜偣涓篖ED鐏负绀轰緥銆侟/span>

2.1 瀵煎叆LDF鏂囦欢鏁版嵁搴掽/span>

閫氳繃鏁版嵁搴撴坊鍔燣ED鐏殑LDF鏂囦欢鍚庯紝鍙互鏌ョ湅鍒癓DF鏂囦欢閲岀殑銆愯妭鐐广€戝垎鍒湁銆恗aster銆戝拰銆怰GB_Slave銆? 骞跺寘鍚簡涓昏妭鐐硅皟搴﹁〃淇℃伅锛屾姤鏂囧拰淇″彿瀹氫箟锛欬/span>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

2.2 鍒涘缓LIN鍙戦€佺獥鍙o紝杩涜LIN涓昏妭鐐归厤缃?/span>

鍕鹃€夈€愪富鑺傜偣妯″紡銆戯紝鐒跺悗閫夋嫨杩愯璋冨害琛≧un_normal锛屽苟閫夋嫨浠跨湡銆恗aster涓昏妭鐐广€戯紝鍙互鐪嬪埌璋冨害琛ㄧ殑涓ゆ潯鎶ユ枃宸插嬀閫夈€傛鏃跺彲浠ャ€愰儴缃层€戣繍琛岃皟搴﹁〃銆侟/span>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

鈻层€愭敞鎰忋€戯細闇€瑕佹敞鎰忚皟搴﹁〃涓富浠庤妭鐐规姤鏂囩殑鍙戦€佹柟鍚戙€侟/p>

浠跨湡master涓昏妭鐐圭殑鎶ユ枃鏂瑰悜锛氥€愬彂銆慄/p>

浠庤妭鐐瑰搷搴旂殑鎶ユ枃鏂瑰悜涓猴細銆愭敹銆慄/p>

鍗筹細鎶ユ枃0x02涓轰富鑺傜偣鍙戦€佺粰RGB浠庤妭鐐圭殑鎺у埗鎶ユ枃锛屾墍浠ユ柟鍚戜负鍙戦€侊紝鑰屾姤鏂?x10涓轰粠鑺傜偣RGB缁欎富鑺傜偣鍙嶉淇℃伅鐢紝鎵€浠ユ柟鍚戜负鎺ユ敹銆侟/p>

2.3 LIN鎶ユ枃淇℃伅鐩戞祴

姝e父鎯呭喌涓嬶紝璋冨害琛ㄨ繍琛屽悗锛屽彲浠ュ湪LIN鎶ユ枃淇℃伅绐楀彛鏌ョ湅鍒颁袱鏉℃姤鏂囩殑鏁版嵁鍐呭锛岃〃鏄庝粠鑺傜偣涓庝富鑺傜偣姝e父閫氫俊骞跺弽棣堟暟鎹€侟/p>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

鈻查潪姝e父鎯呭喌锛氬鏋滃嚭鐜颁粠鑺傜偣鐨勬姤鏂囧搷搴旀暟鎹负绌猴紝鍙互鍒ゆ柇涓轰粠鑺傜偣鏃犲搷搴旓紝姝ゆ椂鍙互妫€娴婰IN鎬荤嚎杩炴帴鏄惁姝g‘鎴栬€匧IN浠庤妭鐐逛緵鐢垫槸鍚︽甯哥瓑锛屼笅鍥炬墍绀裹/span>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

2.4  淇敼LIN涓昏妭鐐规帶鍒舵姤鏂囧唴瀹更/p>

鍦ㄣ€怢IN鍙戦€佺獥鍙c€戦€夋嫨涓昏妭鐐规姤鏂囧0x02锛屽彲浠ョ洿鎺ヤ慨鏀筁IN淇″彿鐨勫師濮嬪€兼垨鑰呯墿鐞嗗€硷紝杩涜鎶ユ枃淇″彿璧嬪€笺€侟/p>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

閫氳繃淇敼RGB涓夌涓嶅悓棰滆壊鐨勪俊鍙锋暟鍊硷紝鍙互缁勫悎鍑烘潵鍚岀殑鐏厜鑹插僵锛屽涓嬪浘涓篟GB鐏殑鐐逛寒鎯呭喌锛屼緵鍙傝€冿細

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

3. 銆愮ず渚嬩竴銆慙IN璇婃柇鍔熻兘-鑷姩鍒嗛厤鍦板潃

閫氬父RGB鐐逛寒鍔熻兘娴嬭瘯鍓嶏紝闇€瑕佸厛瀵筊GB鐏繘琛岃嚜鍔ㄥ垎閰嶅湴鍧€锛岀劧鍚庢墠鑳借繘琛岀伅鍏夐鑹诧紝浜害娴嬭瘯锛岀増鏈彿璇诲彇绛夌瓑銆侟/p>

銆愯儗鏅€戯細鏍规嵁LIN鑷姩鍒嗛厤鍦板潃鐨勫崗璁紝闇€瑕佸崟娆″彂閫佸鏉?C璇婃柇鎶ユ枃杩涜鍦板潃鍒嗛厤锛岃€孴SMaster鏄彲浠ラ€氳繃銆怱ingle Frame銆戞ā寮忔潵瀹屾垚銆侟/p>

RGB鐏殑鑷姩鍒嗛厤鍦板潃鐨勬姤鏂囧涓嬶細

1.鍗曟鍙戦€侊細7F 06 B5 FF 7F 01 02 FF

2.鍗曟鍙戦€侊細7F 06 B5 FF 7F 02 02 01

3.鍗曟鍙戦€侊細7F 06 B5 FF 7F 03 02 FF

4.鍗曟鍙戦€侊細7F 06 B5 FF 7F 04 02 FF

銆愬疄鎿嶃€戯細鍦═SMaster杞欢鐨勩€怱ingle Frame銆戣繍琛岃瘖鏂寚浠わ紝鍒涘缓濂界浉搴旀姤鏂囧悗鍒嗗埆浠庝笂寰€涓嬶紝鍗曟鍙戦€佹姤鏂囪1銆?銆?銆?锛屽畬鎴怰GB鐨勮嚜鍔ㄥ垎閰嶅湴鍧€锛欬/p>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

4. 銆愮ず渚嬩簩銆戞彃鍏ユ姤鏂囧抚inject_lin_message鍑芥暟鐨勪娇鐢?/p>

鏈変竴涓父瑙佺殑浣跨敤鍦烘櫙锛屽綋浠跨湡涓昏妭鐐规鍦ㄨ繍琛岃皟搴﹁〃鏃讹紝鍦ㄤ笉鍋滄杩愯璋冨害琛ㄧ殑鎯呭喌涓嬶紝鎻掑叆涓€甯у叾浠栫殑LIN鎶ユ枃甯э紝姣斿0x3C 鎶ユ枃锛岃繖涓姛鑳藉彲浠ラ€氳繃inject_lin_message鍑芥暟鏉ュ疄鐜般€侟/p>

鍒涘缓涓€涓柊鐨凜鑴氭湰缂栬緫鍣紝閫夋嫨銆愭寜閿簨浠躲€戯紝姣斿鍒涘缓鎸夐敭鈥滱鈥濇墽琛屾彃鍏ユ姤鏂囥€侟/p>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

绀轰緥浠g爜濡備笅锛欬/p>

TLIN f0 = {0,0×0,0x1,8,0x3C,0x0,0,0,{0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};

com.inject_lin_message(&f0);

app.wait(10, “”);


鐒跺悗缂栬瘧杩愯C鑴氭湰锛屽湪宸茶繍琛岄儴缃茶皟搴﹁〃鐨勬儏鍐典笅锛屾寜涓嬧€淎鈥濋敭锛屽湪LIN鎶ユ枃娑堟伅鍙互瑙傚療鍒?C鎶ユ枃鍙戦€併€侟/p>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

銆怲SMaster杞欢灏忔妧宸?蹇€熺敓鎴怢IN鎶ユ枃鐨凜浠g爜銆戯細鍙互鍦ㄨ皟搴﹁〃閲屾柊鍒涘缓涓€鏉IN鎶ユ枃锛屽彸閿鍒朵负C鑴氭湰锛屽氨鍙互鎶婃姤鏂囩殑C浠g爜蹇€熷鍒跺埌鑴氭湰涓€侟/p>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼
鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

浜屻€佸悓鏄烲IN浠庤妭鐐?鐩戝惉鑺傜偣鍔熻兘鎿嶄綔

1. 纭欢杩炴帴鍑嗗

浠跨湡浠庤妭鐐癸紝鍙互涓嶉渶瑕佺粰鍚屾槦LIN鍗′緵鐢点€侟/p>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

2. 浠跨湡浠庤妭鐐瑰彂閫佸搷搴旀姤鏂嘃/p>

褰撳悓鏄烲IN鍗′豢鐪熶负浠庤妭鐐规椂锛孍CU涓昏妭鐐归渶瑕佸彂閫佽皟搴﹁〃鐨勬姤澶碒eader锛屼粠鑺傜偣鍝嶅簲鎶ユ枃鎵嶄細姝e父鍙戝嚭銆侟/p>

鏈枃浠SMaster 鐨凩IN閫氶亾1浠跨湡涓昏妭鐐硅繍琛岃皟搴﹁〃锛孡IN閫氶亾2浠跨湡浠庤妭鐐瑰搷搴旀姤鏂?x10(Tech_Info_RGB_Slave) 銆侟/p>

棣栧厛锛孡IN閫氶亾1浠跨湡涓昏妭鐐硅繍琛岃皟搴﹁〃锛屽叾涓粠鑺傜偣鍝嶅簲鎶ユ枃鐨刪eader鏂瑰悜涓恒€愭敹銆戯細

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

閮ㄧ讲杩愯涔嬪悗锛屽彲浠ョ湅鍒癓IN浠庤妭鐐规姤鏂囨姤澶村凡鍙戝嚭锛屾暟鎹负绌猴細

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

鐒跺悗锛 LIN閫氶亾2浠跨湡浠庤妭鐐瑰彂閫佸搷搴旀姤鏂?x10(Tech_Info_RGB_Slave)锛屾柟鍚戜负銆愬彂銆戯紝淇敼鏁版嵁鍐呭锛欬/p>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

2鐐瑰嚮銆愰儴缃层€戯紝鍙互浠嶭IN鎶ユ枃淇℃伅閲岃瀵熷埌浠庤妭鐐规姤鏂?x10鎴愬姛鍙戝嚭鍝嶅簲鎶ユ枃锛屼富鑺傜偣鍚屾牱鎺ユ敹鎴愬姛銆侟/p>

鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼

The post 3鍒嗛挓get鍚屾槦LIN鍔熻兘鎿嶄綔娴佺▼锛堟帹鑽愭敹钘忥級 first appeared on 涓婃捣鍚屾槦鏅鸿兘绉戞妧鏈夐檺鍏徃.

]]>