Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Handling a Wireless Device ISR

NetDev_ISR_Handler() is the device interrupt handler. In general, the device interrupt handler must perform the following functions:

...

  1. Determine which type of interrupt event occurred by switching on the ISR type argument. The ISR handler should not access the SPI bus for reading an interrupt status register.

...

  1. If a receive event has occurred, the driver must post the interface number to the

...

  1. µC/TCP-IP Receive task by calling NetOS_IF_RxTaskSignal() for each new frame received (management or packet).

...

  1. If a transmit complete event has occurred and it is specified in the ISR type argument, the driver must perform the following items for each transmitted packet.

    ...

      • Post the address of the data area that has completed transmission to the transmit buffer de-allocation task by calling NetOS_IF_TxDeallocTaskPost() with the pointer to the data area that has completed transmission.

    ...

      • Call NetOS_Dev_TxRdySignal() with the interface number that has just completed transmission.

    ...

    1. Interrupt flags on the wireless device should not be cleared.

    ...

    1. CPU’s integrated interrupt controllers should be cleared from within the network

    ...

    1. device’s BSP-level ISR after NetDev_WiFi_ISR_Handler() returns.

    Additionally, it is highly recommended that device driver ISR handlers be kept as short as possible to reduce the amount of interrupt latency in the system.

    ...

    Warning

    If the wireless module support transmit complete event, but reading an interrupt status register is required to know it, the receive task must be signaled and in NetDev_Rx() should return a management frame which will be passed to NetDev_MgmtDemux() and then you can perform the transmit complete operations.