Помощь - Поиск - Пользователи - Календарь
Полная версия этой страницы: LPC2368, ethernet
Форум разработчиков электроники ELECTRONIX.ru > Микроконтроллеры (MCs) > ARM
arttech
Подскажите пожалуйста назначение индексов с такими названиями: TxProduceIndex, TxConsumeIndex (RxProduceIndex, RxConsumeIndex).

Согласно документации никак не могу понять, что есть что...

"Two registers, TxConsumeIndex and TxProduceIndex, define the descriptor locations that
will be used next by hardware and software. Both register act as counters starting at 0 and
wrapping when they reach the value of TxDescriptorNumber. The TxProduceIndex
contains the index of the next descriptor that is going to be filled by the software driver.

The TxConsumeIndex contains the index of the next descriptor going to be transmitted by
the hardware.
When TxProduceIndex == TxConsumeIndex, the transmit buffer is empty.
When TxProduceIndex == TxConsumeIndex -1 (taking wraparound into account), the
transmit buffer is full and the software driver cannot add new descriptors until the
hardware has transmitted one or more frames to free up descriptors."

Вроде как оба индекса указывают на следующий дескриптор в процессе работы. И далее по тексту не понятно как тогда может получиться вот такое TxProduceIndex == TxConsumeIndex -1...
Dron_Gus
Это head и tail кольцевого буфера.
When TxProduceIndex == TxConsumeIndex -1 (taking wraparound into account). Это с учетом все того же кольца. Т.е. когда голова наезжает на хвост... Выражение условное, т.к. надо учитывать взаимное расположение головы и хвоста.
arttech
Цитата(Dron_Gus @ Oct 27 2007, 14:13) *
Это head и tail кольцевого буфера.
When TxProduceIndex == TxConsumeIndex -1 (taking wraparound into account). Это с учетом все того же кольца. Т.е. когда голова наезжает на хвост... Выражение условное, т.к. надо учитывать взаимное расположение головы и хвоста.

Спасибо, теперь всё стало на свои места smile.gif
Для просмотра полной версии этой страницы, пожалуйста, пройдите по ссылке.
Invision Power Board © 2001-2025 Invision Power Services, Inc.