• R/O
  • HTTP
  • SSH
  • HTTPS

MiMicSDK: 提交

MiMicSDK


Commit MetaInfo

修訂8e9e65f68fcb88a4e378f44ce6524aa484904f99 (tree)
時間2014-07-20 21:11:44
作者nyatla <nyatla@4719...>
Commiternyatla

Log Message

dispose関数の追加
AnalogOutのバグ修正
関数名短縮
コメント修正

git-svn-id: http://svn.osdn.jp/svnroot/mimic/trunk@385 47198e57-cb75-475f-84c4-a814cd6f29e0

Change Summary

差異

--- a/misc/mbedJS/mbddJS.API/mbedJS/MiMicCore.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/MiMicCore.js
@@ -13,7 +13,7 @@ var MiMicJS={};
1313 * MiMicJsAPIのバージョン文字列。
1414 * @name MiMicJS#VERSION
1515 */
16- NS.VERSION="MiMicJsAPI/2.0.2";
16+ NS.VERSION="MiMicJsAPI/2.0.3";
1717 /**
1818 * 配列要素、又は値がすべてInt値でない場合に例外を起こします。
1919 * @name MiMicJS.assertInt
@@ -391,7 +391,7 @@ var MiMicJS={};
391391 var NS=MiMicJS;
392392 /**
393393 * 引数が1個のパターン。
394- * @name MiMicJS.MiMicException.2
394+ * @name MiMicJS.MiMicException:2
395395 * @function
396396 * @param {object} e
397397 * eのクラスにより、動作が異なる。
@@ -417,7 +417,7 @@ var MiMicJS={};
417417 * @constructor
418418 * @name MiMicJS.MiMicException
419419 * @param ...
420- * 詳細は、MiMicException.nを参照。
420+ * 詳細は、MiMicException:nを参照。
421421 */
422422 NS.MiMicException=function MiMicException(/*...*/)
423423 {
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.AnalogIn.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.AnalogIn.js
@@ -185,7 +185,17 @@ CLASS.prototype=
185185 }catch(e){
186186 throw new MI.MiMicException(e);
187187 }
188- }
188+ },
189+ /**
190+ * MCUに生成されているオブジェクトを破棄します。
191+ * @name mbedJS.AnalogIn#dispose
192+ * @function
193+ */
194+ dispose:function AnalogIn_dispose()
195+ {
196+ return this._mcu._dispose.apply(this,arguments);
197+ }
198+
189199 }
190200 NS.AnalogIn=CLASS;
191201 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.AnalogOut.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.AnalogOut.js
@@ -183,7 +183,7 @@ CLASS.prototype=
183183 MI._assertYield.call(_t);
184184 _t._lc=CLASS.write;
185185 MI.assertInt(i_value);
186- return _t._mcu.rpc(_t.RPC_NS+":write_fx",_t._oid+","+i_value,
186+ return _t._mcu.rpc(_t.RPC_NS+":write_u16",_t._oid+","+i_value,
187187 function(j){
188188 if(cb){cb();}
189189 if(_t._gen){_t._gen.next();}
@@ -224,7 +224,17 @@ CLASS.prototype=
224224 }catch(e){
225225 throw new MI.MiMicException(e);
226226 }
227+ },
228+ /**
229+ * MCUに生成されているオブジェクトを破棄します。
230+ * @name mbedJS.AnalogOut#dispose
231+ * @function
232+ */
233+ dispose:function AnalogOut_dispose()
234+ {
235+ return this._mcu._dispose.apply(this,arguments);
227236 }
237+
228238 }
229239 NS.AnalogOut=CLASS;
230240 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.BusIn.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.BusIn.js
@@ -198,7 +198,17 @@ CLASS.prototype=
198198 }catch(e){
199199 throw new MI.MiMicException(e);
200200 }
201- }
201+ },
202+ /**
203+ * MCUに生成されているオブジェクトを破棄します。
204+ * @name mbedJS.BusIn#dispose
205+ * @function
206+ */
207+ dispose:function BusIn_dispose()
208+ {
209+ return this._mcu._dispose.apply(this,arguments);
210+ }
211+
202212 }
203213 NS.BusIn=CLASS;
204214 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.BusInOut.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.BusInOut.js
@@ -309,7 +309,17 @@ CLASS.prototype=
309309 }catch(e){
310310 throw new MI.MiMicException(e);
311311 }
312- }
312+ },
313+ /**
314+ * MCUに生成されているオブジェクトを破棄します。
315+ * @name mbedJS.BusInOut#dispose
316+ * @function
317+ */
318+ dispose:function BusInOut_dispose()
319+ {
320+ return this._mcu._dispose.apply(this,arguments);
321+ }
322+
313323 }
314324 NS.BusInOut=CLASS;
315325 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.BusOut.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.BusOut.js
@@ -199,7 +199,17 @@ CLASS.prototype=
199199 }catch(e){
200200 throw new MI.MiMicException(e);
201201 }
202+ },
203+ /**
204+ * MCUに生成されているオブジェクトを破棄します。
205+ * @name mbedJS.BusOut#dispose
206+ * @function
207+ */
208+ dispose:function BusOut_dispose()
209+ {
210+ return this._mcu._dispose.apply(this,arguments);
202211 }
212+
203213 }
204214 NS.BusOut=CLASS;
205215 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.DigitalIn.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.DigitalIn.js
@@ -186,7 +186,16 @@ CLASS.prototype=
186186 }catch(e){
187187 throw new MI.MiMicException(e);
188188 }
189- }
189+ },
190+ /**
191+ * MCUに生成されているオブジェクトを破棄します。
192+ * @name mbedJS.DigitalIn#dispose
193+ * @function
194+ */
195+ dispose:function DigitalIn_dispose()
196+ {
197+ return this._mcu._dispose.apply(this,arguments);
198+ }
190199 }
191200 NS.DigitalIn=CLASS;
192201 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.DigitalOut.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.DigitalOut.js
@@ -211,7 +211,17 @@ CLASS.prototype=
211211 }catch(e){
212212 throw new MI.MiMicException(e);
213213 }
214+ },
215+ /**
216+ * MCUに生成されているオブジェクトを破棄します。
217+ * @name mbedJS.DigitalOut#dispose
218+ * @function
219+ */
220+ dispose:function DigitalOut_dispose()
221+ {
222+ return this._mcu._dispose.apply(this,arguments);
214223 }
224+
215225 }
216226 NS.DigitalOut=CLASS;
217227 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.I2C.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.I2C.js
@@ -204,7 +204,7 @@ CLASS.prototype=
204204 },
205205 /**
206206 * 引数が3個の場合
207- * @name mbedJS.I2C#read.1
207+ * @name mbedJS.I2C#read:1
208208 * @function
209209 * @param {int} address
210210 * 8ビットのI2CSlaveアドレスです。
@@ -225,7 +225,7 @@ CLASS.prototype=
225225 */
226226 /**
227227 * 引数が1個の場合
228- * @name mbedJS.I2C#read.2
228+ * @name mbedJS.I2C#read:2
229229 * @function
230230 * @param {int} ack
231231 * indicates if the byte is to be acknowledged (1 = acknowledge)
@@ -241,7 +241,7 @@ CLASS.prototype=
241241 * @name mbedJS.I2C#read
242242 * @function
243243 * @param ...
244- * 詳細はmbedJS.I2C#read.Nを参照してください。
244+ * 詳細はmbedJS.I2C#read:Nを参照してください。
245245 */
246246 read:function I2C_read(/*...*/)
247247 {
@@ -271,7 +271,7 @@ CLASS.prototype=
271271 },
272272 /**
273273 * 引数が3個の場合
274- * @name mbedJS.I2C#write.1
274+ * @name mbedJS.I2C#write:1
275275 * @function
276276 * @param {int} address
277277 * 8ビットのI2CSlaveアドレスです。
@@ -287,7 +287,7 @@ CLASS.prototype=
287287 */
288288 /**
289289 * 引数が1個の場合
290- * @name mbedJS.I2C#write.2
290+ * @name mbedJS.I2C#write:2
291291 * @function
292292 * @param {int} data
293293 * 送信データを指定します。
@@ -303,7 +303,7 @@ CLASS.prototype=
303303 * @name mbedJS.I2C#write
304304 * @function
305305 * @param ...
306- * 詳細はmbedJS.I2C#write.Nを参照してください。
306+ * 詳細はmbedJS.I2C#write:Nを参照してください。
307307 */
308308 write:function I2C_write(/*...*/)
309309 {
@@ -385,7 +385,17 @@ CLASS.prototype=
385385 }catch(e){
386386 throw new MI.MiMicException(e);
387387 }
388- }
388+ },
389+ /**
390+ * MCUに生成されているオブジェクトを破棄します。
391+ * @name mbedJS.I2C#dispose
392+ * @function
393+ */
394+ dispose:function I2C_dispose()
395+ {
396+ return this._mcu._dispose.apply(this,arguments);
397+ }
398+
389399 }
390400 NS.I2C=CLASS;
391401 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.I2CSlave.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.I2CSlave.js
@@ -156,17 +156,17 @@ var CLASS=function I2CSlave(i_mcu,i_params,i_handler)
156156 throw new MI.MiMicException(e);
157157 }
158158 }
159-CLASS.prototype=
160-{
159+/**
160+ * mbedJS.Serial#receiveの戻り値の種類です。
161+ * NoData,ReadAddressed,WriteGeneral,WriteAddressedがあります。
162+ * @name mbedJS.I2CSlave#RxStatus
163+ */
164+CLASS.RxStatus={
165+ NoData:0,ReadAddressed:1,WriteGeneral:2,WriteAddressed:3
166+}
167+CLASS.prototype={
161168 /** @private */
162169 RPC_NS:"mbedJS:I2CSlave",
163- /**
164- * mbedJS.Serial#receiveの戻り値の種類です。
165- * NoData,ReadAddressed,WriteGeneral,WriteAddressedがあります。
166- * @name mbedJS.I2CSlave#RxStatus
167- */
168- RxStatus:{
169- NoData:0,ReadAddressed:1,WriteGeneral:2,WriteAddressed:3},
170170 /** @private 最後にコールしたAPIです。*/
171171 _lc:null,
172172 /** @private Generatorモードの場合にGeneratorオブジェクトを保持します。*/
@@ -253,7 +253,7 @@ CLASS.prototype=
253253 },
254254 /**
255255 * 引数が2個の場合
256- * @name mbedJS.I2CSlave#read.1
256+ * @name mbedJS.I2CSlave#read:1
257257 * @function
258258 * @param {int} length
259259 * 読み出すデータの長さです。256未満の値を指定してください。
@@ -269,7 +269,7 @@ CLASS.prototype=
269269 */
270270 /**
271271 * 引数が0個の場合
272- * @name mbedJS.I2CSlave#read.2
272+ * @name mbedJS.I2CSlave#read:2
273273 * @function
274274 * @return {int}
275275 * Callbackモードの時はRPCメソッドのインデクスを返します。
@@ -283,7 +283,7 @@ CLASS.prototype=
283283 * @name mbedJS.I2CSlave#read
284284 * @function
285285 * @param ...
286- * 詳細はmbedJS.I2CSlave#read.Nを参照してください。
286+ * 詳細はmbedJS.I2CSlave#read:Nを参照してください。
287287 */
288288 read:function I2CSlave_read(/*...*/)
289289 {
@@ -340,8 +340,8 @@ CLASS.prototype=
340340 }
341341 },
342342 /**
343- * 引数が3個の場合
344- * @name mbedJS.I2CSlave#write.1
343+ * 引数が1個(byte array)の場合
344+ * @name mbedJS.I2CSlave#write:1
345345 * @function
346346 * @param {byte[]} data
347347 * 送信するデータを格納したバイト配列です。
@@ -351,8 +351,8 @@ CLASS.prototype=
351351 * Generatorモードの時は成功/失敗フラグを返します。ACK:0(成功),NACK:それ以外です。
352352 */
353353 /**
354- * 引数が1個の場合
355- * @name mbedJS.I2CSlave#write.2
354+ * 引数が1個(int)の場合
355+ * @name mbedJS.I2CSlave#write:2
356356 * @function
357357 * @param {int} data
358358 * 送信データを指定します。
@@ -368,7 +368,7 @@ CLASS.prototype=
368368 * @name mbedJS.I2CSlave#write
369369 * @function
370370 * @param ...
371- * 詳細はmbedJS.I2CSlave#write.Nを参照してください。
371+ * 詳細はmbedJS.I2CSlave#write:Nを参照してください。
372372 */
373373 write:function I2CSlave_write(/*...*/)
374374 {
@@ -421,7 +421,17 @@ CLASS.prototype=
421421 }catch(e){
422422 throw new MI.MiMicException(e);
423423 }
424- }
424+ },
425+ /**
426+ * MCUに生成されているオブジェクトを破棄します。
427+ * @name mbedJS.I2CSlave#dispose
428+ * @function
429+ */
430+ dispose:function IC2Slave_dispose()
431+ {
432+ return this._mcu._dispose.apply(this,arguments);
433+ }
434+
425435 }
426436 NS.I2CSlave=CLASS;
427437 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.Mcu.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.Mcu.js
@@ -151,7 +151,7 @@ CLASS.prototype=
151151 * @function
152152 */
153153 close:function MCU_close(){
154- if(this._gen && this._lc){throw new MI.MiMicException(MI.Error.NG_YIELD_NOT_COMPLETED);}
154+ MI._assertYield.call(this);
155155 this._lc=CLASS.close;
156156 this._rpc.close();
157157 },
@@ -201,17 +201,18 @@ CLASS.prototype=
201201 getInfo:function(){
202202 try{
203203 var _t=this;
204- if(this._gen && this._lc){throw new MI.MiMicException(MI.Error.NG_YIELD_NOT_COMPLETED);}
204+ MI._assertYield.call(_t);
205+ var cb=MI._getCb(arguments,_t._event.onGetInfo);
205206 _t._lc=CLASS.getInfo;
206207 return _t.rpc(_t.RPC_NS+":getInfo","",
207- function (j)
208- {
209- var r=j.result;
210- var v={version:r[0],platform:r[1],mcu:{name:r[3],eth:r[2]},memory:{free:r[4]}};
211- if(_t._event.onGetInfo){_t._event.onGetInfo(v);}
212- if(_t._gen){_t._gen.next(v);}
213- _t._lc=null;
214- }
208+ function (j)
209+ {
210+ var r=j.result;
211+ var v={version:r[0],platform:r[1],mcu:{name:r[3],eth:r[2]},memory:{free:r[4]}};
212+ if(cb){cb(v);}
213+ if(_t._gen){_t._gen.next(v);}
214+ _t._lc=null;
215+ }
215216 );
216217 }catch(e){
217218 throw new MI.MiMicException(e);
@@ -230,21 +231,47 @@ CLASS.prototype=
230231 disposeObject:function(i_oid){
231232 try{
232233 var _t=this;
233- if(this._gen && this._lc){throw new MI.MiMicException(MI.Error.NG_YIELD_NOT_COMPLETED);}
234+ MI._assertYield.call(_t);
235+ var cb=MI._getCb(arguments,_t._event.onDisposeObject);
234236 _t._lc=CLASS.disposeObject;
235237 return _t.rpc(_t.RPC_NS+":disposeObject",i_oid,
236- function (j)
237- {
238- var v=j.result[0]?true:false;
239- if(_t._event.onDisposeObject){_t._event.onDisposeObject(v);}
240- if(_t._gen){_t._gen.next(v);}
241- _t._lc=null;
242- }
238+ function (j)
239+ {
240+ var v=j.result[0]?true:false;
241+ if(cb){cb(v);}
242+ if(_t._gen){_t._gen.next(v);}
243+ _t._lc=null;
244+ }
245+ );
246+ }catch(e){
247+ throw new MI.MiMicException(e);
248+ }
249+ },
250+ /**
251+ * 内部関数です.
252+ * ペリフェラルクラスから_dispose.apply(this,arguments)でコールしてください。
253+ * @private
254+ */
255+ _dispose:function(){
256+ try{
257+ var _t=this;
258+ MI._assertYield.call(_t);
259+ var cb=MI._getCb(arguments,_t._event.onDispose);
260+ _t._lc=_t.dispose;//CLASS.disposeが使えないんでIDに関数そのものを使う
261+ return _t._mcu.rpc(_t._mcu.RPC_NS+":disposeObject",_t._oid,
262+ function (j)
263+ {
264+ var v=j.result[0]?true:false;
265+ if(cb){cb(v);}
266+ if(_t._gen){_t._gen.next(v);}
267+ _t._lc=null;
268+ }
243269 );
244270 }catch(e){
245271 throw new MI.MiMicException(e);
246272 }
247273 }
274+
248275 }
249276 NS.Mcu=CLASS;
250277 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.PortIn.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.PortIn.js
@@ -169,7 +169,16 @@ CLASS.prototype=
169169 }catch(e){
170170 throw new MI.MiMicException(e);
171171 }
172- }
172+ },
173+ /**
174+ * MCUに生成されているオブジェクトを破棄します。
175+ * @name mbedJS.PortIn#dispose
176+ * @function
177+ */
178+ dispose:function PortIn_dispose()
179+ {
180+ return this._mcu._dispose.apply(this,arguments);
181+ }
173182 }
174183 NS.PortIn=CLASS;
175184 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.PortOut.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.PortOut.js
@@ -202,6 +202,15 @@ CLASS.prototype=
202202 }catch(e){
203203 throw new MI.MiMicException(e);
204204 }
205+ },
206+ /**
207+ * MCUに生成されているオブジェクトを破棄します。
208+ * @name mbedJS.PortOut#dispose
209+ * @function
210+ */
211+ dispose:function PortOut_dispose()
212+ {
213+ return this._mcu._dispose.apply(this,arguments);
205214 }
206215 }
207216 NS.PortOut=CLASS;
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.PwmOut.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.PwmOut.js
@@ -276,7 +276,7 @@ CLASS.prototype=
276276 MI._assertYield.call(_t);
277277 _t._lc=CLASS.period_ms;
278278 MI.assertInt(i_value);
279- return _t._mcu.rpc(_t.RPC_NS+":period_ms",_t._oid+","+Math.round(i_value),
279+ return _t._mcu.rpc(_t.RPC_NS+":period_ms",_t._oid+","+i_value,
280280 function(j){
281281 if(cb){cb();}
282282 if(_t._gen){_t._gen.next();}
@@ -306,7 +306,7 @@ CLASS.prototype=
306306 MI._assertYield.call(_t);
307307 _t._lc=CLASS.period_us;
308308 MI.assertInt(i_value);
309- return _t._mcu.rpc(_t.RPC_NS+":period_us",_t._oid+","+Math.round(i_value),
309+ return _t._mcu.rpc(_t.RPC_NS+":period_us",_t._oid+","+i_value,
310310 function(j){
311311 if(cb){cb();}
312312 if(_t._gen){_t._gen.next();}
@@ -365,7 +365,7 @@ CLASS.prototype=
365365 MI._assertYield.call(_t);
366366 _t._lc=CLASS.pulsewidth_ms;
367367 MI.assertInt(i_value);
368- return _t._mcu.rpc(_t.RPC_NS+":pulsewidth_ms",_t._oid+","+Math.round(i_value),
368+ return _t._mcu.rpc(_t.RPC_NS+":pulsewidth_ms",_t._oid+","+i_value,
369369 function(j){
370370 if(cb){cb();}
371371 if(_t._gen){_t._gen.next();}
@@ -395,7 +395,7 @@ CLASS.prototype=
395395 MI._assertYield.call(_t);
396396 _t._lc=CLASS.pulsewidth_us;
397397 MI.assertInt(i_value);
398- return _t._mcu.rpc(_t.RPC_NS+":pulsewidth_us",_t._oid+","+Math.round(i_value),
398+ return _t._mcu.rpc(_t.RPC_NS+":pulsewidth_us",_t._oid+","+i_value,
399399 function(j){
400400 if(cb){cb();}
401401 if(_t._gen){_t._gen.next();}
@@ -405,7 +405,16 @@ CLASS.prototype=
405405 }catch(e){
406406 throw new MI.MiMicException(e);
407407 }
408- }
408+ },
409+ /**
410+ * MCUに生成されているオブジェクトを破棄します。
411+ * @name mbedJS.PwmOut#dispose
412+ * @function
413+ */
414+ dispose:function PwmOut_dispose()
415+ {
416+ return this._mcu._dispose.apply(this,arguments);
417+ }
409418 }
410419 NS.PwmOut=CLASS;
411420 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.SPI.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.SPI.js
@@ -134,7 +134,7 @@ CLASS.prototype=
134134 }
135135 },
136136 /**
137- * ピンに値を出力します。
137+ * SPI Slaveに値を書き込み、戻り値を返します。
138138 * 関数の完了時にonWriteイベントが発生します。
139139 * Generatorモードの時は、yieldと併用して完了を待機できます。
140140 * @name mbedJS.SPI#write
@@ -164,7 +164,7 @@ CLASS.prototype=
164164 }
165165 },
166166 /**
167- * ピンに値を出力します。
167+ * frequencyに値を設定します。
168168 * 関数の完了時にonFrequencyイベントが発生します。
169169 * Generatorモードの時は、yieldと併用して完了を待機できます。
170170 * @name mbedJS.SPI#frequency
@@ -194,8 +194,8 @@ CLASS.prototype=
194194 }
195195 },
196196 /**
197- * ピンに値を出力します。
198- * 関数の完了時にonFrequencyイベントが発生します。
197+ * formatに値を設定します。
198+ * 関数の完了時にonFormatイベントが発生します。
199199 * Generatorモードの時は、yieldと併用して完了を待機できます。
200200 * @name mbedJS.SPI#format
201201 * @function
@@ -224,6 +224,15 @@ CLASS.prototype=
224224 }catch(e){
225225 throw new MI.MiMicException(e);
226226 }
227+ },
228+ /**
229+ * MCUに生成されているオブジェクトを破棄します。
230+ * @name mbedJS.SPI#dispose
231+ * @function
232+ */
233+ dispose:function SPI_dispose()
234+ {
235+ return this._mcu._dispose.apply(this,arguments);
227236 }
228237 }
229238 NS.SPI=CLASS;
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.SPISlave.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.SPISlave.js
@@ -151,7 +151,7 @@ CLASS.prototype=
151151 },
152152
153153 /**
154- * ピンに値を出力します。
154+ * frequencyに値を設定します。
155155 * 関数の完了時にonFrequencyイベントが発生します。
156156 * Generatorモードの時は、yieldと併用して完了を待機できます。
157157 * @name mbedJS.SPISlave#frequency
@@ -180,8 +180,8 @@ CLASS.prototype=
180180 }
181181 },
182182 /**
183- * ピンに値を出力します。
184- * 関数の完了時にonFrequencyイベントが発生します。
183+ * formatに値を設定します。
184+ * 関数の完了時にonFormatイベントが発生します。
185185 * Generatorモードの時は、yieldと併用して完了を待機できます。
186186 * @name mbedJS.SPISlave#format
187187 * @function
@@ -211,7 +211,7 @@ CLASS.prototype=
211211 }
212212 },
213213 /**
214- * ピンから値を読み込みます。
214+ * 転送メモリから値を読み込みます。
215215 * 関数の完了時にonReadイベントが発生します。
216216 * Generatorモードの時は、yieldと併用して完了を待機できます。
217217 * @name mbedJS.SPISlave#read
@@ -241,7 +241,7 @@ CLASS.prototype=
241241 }
242242 },
243243 /**
244- * ピンから値を読み込みます。
244+ * データが到着しているかを返します。
245245 * 関数の完了時にonReadイベントが発生します。
246246 * Generatorモードの時は、yieldと併用して完了を待機できます。
247247 * @name mbedJS.SPISlave#receive
@@ -271,7 +271,7 @@ CLASS.prototype=
271271 }
272272 },
273273 /**
274- * ピンモードを設定します。
274+ * 転送バッファに次に送信するメッセージをセットします。
275275 * 関数の完了時にonReplyイベントが発生します。
276276 * Generatorモードの時は、yieldと併用して完了を待機できます。
277277 * @name mbedJS.SPISlave#reply
@@ -299,6 +299,15 @@ CLASS.prototype=
299299 }catch(e){
300300 throw new MI.MiMicException(e);
301301 }
302+ },
303+ /**
304+ * MCUに生成されているオブジェクトを破棄します。
305+ * @name mbedJS.SPISlave#dispose
306+ * @function
307+ */
308+ dispose:function SPISlave_dispose()
309+ {
310+ return this._mcu._dispose.apply(this,arguments);
302311 }
303312 }
304313 NS.SPISlave=CLASS;
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.Serial.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.Serial.js
@@ -168,19 +168,18 @@ var CLASS=function Serial(i_mcu,i_params,i_handler)
168168 throw new MI.MiMicException(e);
169169 }
170170 }
171-CLASS.prototype=
172-{
171+/**
172+ * mbedJS.Serial#format関数に指定する値の種類です。
173+ * None,Odd,Even,Forced1,Forced0があります。
174+ * @name mbedJS.Serial#Parity
175+ * @field
176+ */
177+CLASS.Parity={
178+ None:0,Odd:1,Even:2,Forced1:3,Forced0:4
179+}
180+CLASS.prototype={
173181 /** @private */
174182 RPC_NS:"mbedJS:Serial",
175- /**
176- * mbedJS.Serial#format関数に指定する値の種類です。
177- * None,Odd,Even,Forced1,Forced0があります。
178- * @name mbedJS.Serial#Parity
179- * @field
180- */
181- Parity:{
182- None:0,Odd:1,Even:2,Forced1:3,Forced0:4
183- },
184183 /** @private 最後にコールしたAPIです。*/
185184 _lc:null,
186185 /** @private Generatorモードの場合にGeneratorオブジェクトを保持します。*/
@@ -219,14 +218,14 @@ CLASS.prototype=
219218 * @return {int}
220219 * Callbackモードの時はRPCメソッドのインデクスを返します。
221220 */
222- format:function SerialIn_format(i_bits,i_parity,i_stop_bits)
221+ format:function Serial_format(i_bits,i_parity,i_stop_bits)
223222 {
224223 try{
225224 var _t=this;
226225 MI._assertYield.call(_t);
227226 var cb=MI._getCb(arguments,_t._event.onFormat);
228227 _t._lc=CLASS.format;
229- var p=[MI.isUndefined(i_bits,8),MI.isUndefined(i_parity,_t.Parity.None),MI.isUndefined(i_stop_bits,1)];
228+ var p=[MI.isUndefined(i_bits,8),MI.isUndefined(i_parity,CLASS.Parity.None),MI.isUndefined(i_stop_bits,1)];
230229 MI.assertInt(p);
231230 return _t._mcu.rpc(_t.RPC_NS+":format",_t._oid+","+p[0]+","+p[1]+","+p[2],
232231 function (j)
@@ -488,7 +487,16 @@ CLASS.prototype=
488487 }catch(e){
489488 throw new MI.MiMicException(e);
490489 }
491- }
490+ },
491+ /**
492+ * MCUに生成されているオブジェクトを破棄します。
493+ * @name mbedJS.Serial#dispose
494+ * @function
495+ */
496+ dispose:function Serial_dispose()
497+ {
498+ return this._mcu._dispose.apply(this,arguments);
499+ }
492500 }
493501 NS.Serial=CLASS;
494502 }());
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/mbedJS/mbed.types.js
+++ b/misc/mbedJS/mbddJS.API/mbedJS/mbed.types.js
@@ -23,7 +23,7 @@ var NS=mbedJS;
2323 NS.PinName=function(){
2424 var B;
2525 var D={};
26- // LPC Pin Names P0_0からP4_32
26+ // LPC Pin Names P0_0からP5_31
2727 B=0x00010000;
2828 for(var i=0;i<=5;i++){
2929 for(var i2=0;i2<=31;i2++){
@@ -75,11 +75,12 @@ NS.PinMode={
7575 PullDown: 0x00010001,
7676 PullNone: 0x00010002,
7777 OpenDrain: 0x00010003,
78- PullDefault:0x00010004};
78+ PullDefault:0x00010004
79+};
7980 /**
8081 * ポート識別子です。
8182 * mbedSDKのポート名と同一です。<br/>
82- * (Port0 - Port4)
83+ * (Port0 - Port5)
8384 * @name mbedJS.PortName
8485 */
8586 NS.PortName={
@@ -87,7 +88,9 @@ NS.PortName={
8788 Port1: 0x00010001,
8889 Port2: 0x00010002,
8990 Port3: 0x00010003,
90- Port4: 0x00010004};
91+ Port4: 0x00010004,
92+ Port4: 0x00010005
93+};
9194
9295
9396 }());
\ No newline at end of file
Show on old repository browser