From: nyatla Date: Fri, 25 Nov 2011 03:21:21 +0000 (+0000) Subject: memoryにwrite32を追加 X-Git-Tag: SVN-final~228 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=88185f9c28cdb7bbf6c03fcddddd7f98a094cac3;p=mimic%2FMiMicSDK.git memoryにwrite32を追加 git-svn-id: http://svn.osdn.jp/svnroot/mimic/trunk@108 47198e57-cb75-475f-84c4-a814cd6f29e0 --- diff --git a/misc/MiMicVM/api.js/LPCXPresso1769.All-mini.js b/misc/MiMicVM/api.js/LPCXPresso1769.All-mini.js index a2ca016..a4c6b40 100644 --- a/misc/MiMicVM/api.js/LPCXPresso1769.All-mini.js +++ b/misc/MiMicVM/api.js/LPCXPresso1769.All-mini.js @@ -1 +1 @@ -var LPCXpresso1769;(function(){var g=MiMicLib.isUndef;var a={_EE:function(n){return{NG:[n|0,"Unknown exception in LPCXpresso1769"],INVALID_ARG:[n|1,"Invalid argument"],INVALID_PIN:[n|2,"Invalid pin"],INVALID_CFG:[n|3,"Invalid configulation"],VM_RUNTIME:[n|4,"MVM runtime error"],}}(MiMicError.NG[0]|MiMicError.MID_MiMic|MiMicError.CAID_LPCXPresso1769),_BCF:{setBit:function m(p,r,o,q,n){try{n.push(p);n.push(~(r<=0}};a.I2c=function c(){throw new MiMicException("Not imprement.")};a.Dma=function k(){throw new MiMicException("Not imprement.")};a.Uart=function f(){throw new MiMicException("Not imprement.")};a.Usb=function e(){throw new MiMicException("Not imprement.")};LPCXpresso1769=a}());(function(){var f=LPCXpresso1769;var p=f._BCF;var a=f._EE;var e=MiMicLib.isUndef;function b(t){try{var v="";for(var s=0;s>4)&4095)}return v}catch(w){throw new MiMicException(w)}}};a.AdcPin=function f(r,s,u){try{this._aport=new a.AdcPort(r,[s],u)}catch(t){throw new MiMicException(t)}};a.AdcPin.prototype={_aport:null,getValue:function g(){try{return this._aport.getValues()[0]}catch(r){throw new MiMicException(r)}},setOpt:function h(s){try{this._aport.setOpt(s)}catch(r){throw new MiMicException(r)}}}}());(function(){var g=LPCXpresso1769;var o=g._BCF;var a=g._EE;var f=MiMicLib.isUndef;var m=MiMicLib.cloneAssoc;g.Gpio=function q(s,u){try{this._mcu=s;s.registerPhl(this,"GPIO")}catch(t){throw new MiMicException(t)}};g.Gpio.prototype={_FIO_DIR:[537509888,537509920,537509952,537509984,537510016],_FIO_PIN:[537509908,537509940,537509972,537510004,537510036],_FIO_SET:[537509912,537509944,537509976,537510008,537510040],_FIO_CLR:[537509916,537509948,537509980,537510012,537510044],_FIO_MASK:[537509904,537509936,537509968,537510000,537510032],_mcu:null,BCF_getValues:function k(t,u,s){try{s.push(this._FIO_PIN[t],this._FIO_MASK[t],~u);return"EA00EA01EA02DF0201DB0300EE03"}catch(v){throw new MiMicException(v)}},BCF_setValues:function h(u,v,t,s){try{s.push(this._FIO_PIN[u],this._FIO_MASK[u],~v,t);return"EA00EA01EA02EA03DF0201DF0300"}catch(w){throw new MiMicException(w)}},BCF_setDirs:function e(t,u,v,s){try{return o.setBit(this._FIO_DIR[t],u,u*v,0,s)}catch(w){throw new MiMicException(w)}},getPin:function p(s,u){try{return new g.GpioPin(this,s,u)}catch(t){throw new MiMicException(t)}},getPort:function r(s,u){try{return new g.GpioPort(this,s,u)}catch(t){throw new MiMicException(t)}}};function j(v){try{var t=g.completePinFunctionName(v,"GPIO");var s=t.substring(4).split(".");var u={port:parseInt(s[0]),bit:parseInt(s[1]),pin_sel:g.getPinSelByFunctionName(v,t)};if(!isNaN(u.port)&&!isNaN(u.bit)){return u}throw new MiMicException(a.INVALID_CFG,"The pin has not GPIO fuction.")}catch(w){throw new MiMicException(w)}}g.GpioPort=function n(v,s,y){try{this._gpio=v;this._pins=new Array();for(var u=0;u>y)&1);w|=(s<=0;x--){var s=((t>>this._pins[x].bit)&1);u=(u<<1)|s}return u}catch(y){throw new MiMicException(y)}},outPatt:function i(w){try{var B=new Array();var y="";for(var s=0;s>u)&1);z|=(A<=0}};a.I2c=function c(){throw new MiMicException("Not imprement.")};a.Dma=function k(){throw new MiMicException("Not imprement.")};a.Uart=function f(){throw new MiMicException("Not imprement.")};a.Usb=function e(){throw new MiMicException("Not imprement.")};LPCXpresso1769=a}());(function(){var f=LPCXpresso1769;var p=f._BCF;var a=f._EE;var e=MiMicLib.isUndef;function b(t){try{var v="";for(var s=0;s0){d(p);var j=arguments[1].length;for(var m=0;m>4)&4095)}return v}catch(w){throw new MiMicException(w)}}};a.AdcPin=function f(r,s,u){try{this._aport=new a.AdcPort(r,[s],u)}catch(t){throw new MiMicException(t)}};a.AdcPin.prototype={_aport:null,getValue:function g(){try{return this._aport.getValues()[0]}catch(r){throw new MiMicException(r)}},setOpt:function h(s){try{this._aport.setOpt(s)}catch(r){throw new MiMicException(r)}}}}());(function(){var g=LPCXpresso1769;var o=g._BCF;var a=g._EE;var f=MiMicLib.isUndef;var m=MiMicLib.cloneAssoc;g.Gpio=function q(s,u){try{this._mcu=s;s.registerPhl(this,"GPIO")}catch(t){throw new MiMicException(t)}};g.Gpio.prototype={_FIO_DIR:[537509888,537509920,537509952,537509984,537510016],_FIO_PIN:[537509908,537509940,537509972,537510004,537510036],_FIO_SET:[537509912,537509944,537509976,537510008,537510040],_FIO_CLR:[537509916,537509948,537509980,537510012,537510044],_FIO_MASK:[537509904,537509936,537509968,537510000,537510032],_mcu:null,BCF_getValues:function k(t,u,s){try{s.push(this._FIO_PIN[t],this._FIO_MASK[t],~u);return"EA00EA01EA02DF0201DB0300EE03"}catch(v){throw new MiMicException(v)}},BCF_setValues:function h(u,v,t,s){try{s.push(this._FIO_PIN[u],this._FIO_MASK[u],~v,t);return"EA00EA01EA02EA03DF0201DF0300"}catch(w){throw new MiMicException(w)}},BCF_setDirs:function e(t,u,v,s){try{return o.setBit(this._FIO_DIR[t],u,u*v,0,s)}catch(w){throw new MiMicException(w)}},getPin:function p(s,u){try{return new g.GpioPin(this,s,u)}catch(t){throw new MiMicException(t)}},getPort:function r(s,u){try{return new g.GpioPort(this,s,u)}catch(t){throw new MiMicException(t)}}};function j(v){try{var t=g.completePinFunctionName(v,"GPIO");var s=t.substring(4).split(".");var u={port:parseInt(s[0]),bit:parseInt(s[1]),pin_sel:g.getPinSelByFunctionName(v,t)};if(!isNaN(u.port)&&!isNaN(u.bit)){return u}throw new MiMicException(a.INVALID_CFG,"The pin has not GPIO fuction.")}catch(w){throw new MiMicException(w)}}g.GpioPort=function n(v,s,y){try{this._gpio=v;this._pins=new Array();for(var u=0;u>y)&1);w|=(s<=0;x--){var s=((t>>this._pins[x].bit)&1);u=(u<<1)|s}return u}catch(y){throw new MiMicException(y)}},outPatt:function i(w){try{var B=new Array();var y="";for(var s=0;s>u)&1);z|=(A<0){ + //read32(i_offset:int,i_value:array) + checkAlign(offset); + var l=arguments[1].length; + for(var i=0;i0){ + //read32(i_offset:int,i_value:array) + checkAlign(offset); + var l=arguments[1].length; + for(var i=0;i + + + + + + +

Memory read/write

+
+ This program is sample program for reading/writing the memory(0x20080000). Please edit IP address of this program before test. +
+ diff --git a/misc/MiMicVM/api.js/demo/pwm_port.html b/misc/MiMicVM/api.js/demo/pwm_port.html new file mode 100644 index 0000000..ee69745 --- /dev/null +++ b/misc/MiMicVM/api.js/demo/pwm_port.html @@ -0,0 +1,32 @@ + + + + + + + +

MiMic PWM sample

+
+This sample controls two PWM pins (P2[0],P2[1]) at 100Hz. +
-
+MiMic Copyright (C) 2011 nyatla.jp All Rights Reserved.
+http://nyatla.jp/mimic/wp + + \ No newline at end of file