2014年9月27日土曜日

Slave FIFOs メモ書き③

レジスタの設定についてのメモ。


「15.6.3 EPxCFG」について、


---------------

1:0 BUF[1:0] Buffering Type/Amount.

00 Quad
01 Invalid
10 Double
11 Triple

Note
The Valid bit is ignored
when buffer space is allocated by the EZ-USB
(for example, BUF[1:0] takes precedence over the Valid bit).

When you are not using all of the endpoints in the endpoint configuration,
disable the unused endpoints by writing a zero into the “valid” bit of
the corresponding EPxCFG register without disturbing the default state of the other bits in the register.

For example, if the endpoint configuration 11 (see 1.17 EZ-USB Endpoint Buffers on page 30), which uses only endpoints 2 and 8, must be
used, configure the endpoints as follows.
EP2CFG = 0xDB;
SYNCDELAY;
EP8CFG = 0x92;
SYNCDELAY;
EP4CFG &= 0x7F;
SYNCDELAY;
EP6CFG &=0x7F;
SYNCDELAY;

バッファスペースが EZ-USB によって割り当てられている時、
VALID(EPxCFGの 7Bit目の事)は無視されます。
(例えば、 BUF[1:0]  ( 今説明している、EPxCFGの 0番目と 1番目のビット ) は、
VALIDよりも優先されます。)

//要するに、512Byteのバッファ4つをEP2に割り当て、
//同様に、512Byteのバッファ4つをEP6に割り当てる時、
//合計のメモリ容量は4kByteまでしかないので、
//(EP2+EP4+EP6+EP8<=4kByte、4キロバイト以下でなければいけないので、)
//EP2とEP4を組み合わせて512kByte*4==2kByte確保する事になる。
//その時、EP4 の VALID は、BUF[1:0]が優先されるため無効となる。

全てのエンドポイントを使用しない場合は、
対応するEPxCFGレジスタのデフォルトの設定が悪さをしないように、
“valid” bitに0を書き込むことで、エンドポイントを無効にする。

例えば、
(1.17 EZ-USB Endpoint Buffers on page 30)の
「 the endpoint configuration 11 」の設定をしたい場合、
エンドポイント2と8は以下の様に設定される。
EP2CFG = 0xDB;
SYNCDELAY;
EP8CFG = 0x92;
SYNCDELAY;
EP4CFG &= 0x7F;
SYNCDELAY;
EP6CFG &=0x7F;
SYNCDELAY;





















---------------
---------------
---------------

0 件のコメント:

コメントを投稿