IRQ trigger register
SDIO_CARD_FN1:TXIRQTHR[7:0]VAL is a register containing a value in bytes, which
states how many bytes must be present at the SDIO Tx FIFO in order to trigger the
SDIO host IRQ. This ensures that the FIFO has enough bytes to withstand any delays
that might occur. The trigger mechanism is armed before the SW attempts to write a
packet, dis-armed when the threshold configured on the IRQ trigger register is
crossed, and can be re-armed again when the SW writes to the trigger register again.
Logically, this trigger can be re-armed after a successful / unsuccessful
transaction, notified to the device by the host read acknowledgment.
The diagram below depicts the process
HW and SW needs to follow for Host read scenario:
- The SW wants to transmit a packet
N to the host. The packet length is known so first it needs to configure the IRQ
trigger threshold. SW uses the following reasoning to decide what the trigger
should be:
- If packet length >
SDIO block (max 128-byte) trigger is set to 128 Byte (entire block)
- If packet length <
SDIO block, SW sets packet length in bytes as the trigger value.
- SW now preparing for DMA
transfer, starts the DMA and bytes from the first block are copied from memory
to SDIO TX FIFO.
- Once the trigger threshold been reached, SDIO sets the Host IRQ line.
- Host writes to function #1
register in order to clear the IRQ SDIO_CARD_FN1.ICLR, such that the IRQ is
lowered. Please note, that until the next time IRQ trigger is armed, the
threshold value is being ignored by SDIO FIFO and crossing it shall result in no
action.
- The host issues command 53 to read the data in block/bytes mode.
- Blocks are being transferred to host on the Memory → DMA → SDIO TX FIFO → SDIO
PHY → Data lines path.
- Optional: SW can start writing
the next packet even before the previous one has been read. Host IRQ will not be
generated till #10 below.
- Whenever the host finished
reading the data, since the CC35xx is a device with mandatory read ack, it
writes a function #1 register in order to indicate Ack/Nack, which trigger IRQ
to SW. (If SDIO TX buffer is already above threshold due to #7 above, IRQ will
be generted)
- At this point in time, the IRQ trigger can be re-armed (If another packet is
pending).