### Xilinx Processor IP Library

<hl>Software Drivers</hl>

Main Page | Data Structures | File List | Data Fields | Globals

# xemaclite_intr.c File Reference

## Detailed Description

Functions in this file are for the interrupt driven processing functionality. See xemaclite.h for a detailed description of the driver.

     MODIFICATION HISTORY:

     Ver   Who  Date     Changes
     ----- ---- -------- --------------------------------------------------------
     1.01a ecm  03/31/04 First release
     1.11a mta  03/21/07 Updated to new coding style
     2.01a ktn  07/20/09 Modified the XEmacLite_EnableInterrupts and
                         XEmacLite_DisableInterrupts functions to enable/disable
                         the interrupt in the Ping buffer as this is used to enable
                         the interrupts for both Ping and Pong Buffers.
                         The interrupt enable bit in the Pong buffer is not used by
                         the HW.

## Functions

int | XEmacLite_EnableInterrupts (XEmacLite *InstancePtr)
void | XEmacLite_DisableInterrupts (XEmacLite *InstancePtr)
void | XEmacLite_InterruptHandler (void *InstancePtr)
void | XEmacLite_SetRecvHandler (XEmacLite *InstancePtr, void *CallBackRef, XEmacLite_Handler FuncPtr)
void | XEmacLite_SetSendHandler (XEmacLite *InstancePtr, void *CallBackRef, XEmacLite_Handler FuncPtr)

## Function Documentation

void XEmacLite_DisableInterrupts | ( | XEmacLite * | InstancePtr | ) |

Disables the interrupts from the device (the higher layer software is responsible for disabling interrupts at the interrupt controller).

To start using the device again, _EnableInterrupts must be called.

Parameters:

  | InstancePtr | is a pointer to the XEmacLite instance .

Returns:
  None.

Note:
  None.

int XEmacLite_EnableInterrupts | ( | XEmacLite * | InstancePtr | ) |

Enable the EmacLite Interrupts.

This function must be called before other functions to send or receive data in interrupt driven mode. The user should have connected the interrupt handler of the driver to an interrupt source such as an interrupt controller or the processor interrupt prior to this function being called.

Parameters:

  | InstancePtr | is a pointer to the XEmacLite instance.

Returns:
  - XST_SUCCESS if the device interrupts were enabled successfully.
  - XST_NO_CALLBACK if the callbacks were not set.

Note:
  None.

void XEmacLite_InterruptHandler | ( | void * | InstancePtr | ) |

Interrupt handler for the EmacLite driver. It performs the following processing:

- Get the interrupt status from the registers to determine the source of the interrupt.
- Call the appropriate handler based on the source of the interrupt.

Parameters:

  | InstancePtr | contains a pointer to the EmacLite device instance for the interrupt.

Returns:
  None.

Note:
  None.

void XEmacLite_SetRecvHandler | ( | XEmacLite * | InstancePtr,
|  | void * | CallBackRef,
|  | XEmacLite_Handler | FuncPtr
| ) |

Sets the callback function for handling received frames in interrupt mode. The upper layer software should call this function during initialization. The callback is called when a frame is received. The callback function should communicate the data to a thread such that the processing is not performed in an interrupt context.

The callback is invoked by the driver within interrupt context, so it needs to do its job quickly. If there are other potentially slow operations within the callback, these should be done at task-level.

Parameters:

  | InstancePtr | is a pointer to the XEmacLite instance..
  | CallBackRef | is a reference pointer to be passed back to the application in the callback. This helps the application correlate the callback to a particular driver.
  | FuncPtr | is the pointer to the callback function.

Returns:
  None.

Note:
  None.

void XEmacLite_SetSendHandler | ( | XEmacLite * | InstancePtr,
|  | void * | CallBackRef,
|  | XEmacLite_Handler | FuncPtr
| ) |

Sets the callback function for handling transmitted frames in interrupt mode. The upper layer software should call this function during initialization. The callback is called when a frame is transmitted. The callback function should communicate the data to a thread such that the processing is not performed in an interrupt context.

The callback is invoked by the driver within interrupt context, so it needs to do its job quickly. If there are other potentially slow operations within the callback, these should be done at task-level.

Parameters:

  | InstancePtr | is a pointer to the XEmacLite instance.
  | CallBackRef | is a reference pointer to be passed back to the application in the callback. This helps the application correlate the callback to a particular driver.
  | FuncPtr | is the pointer to the callback function.

Returns:
  None.

Note:
  None.

Copyright © 1995-2009 Xilinx, Inc. All rights reserved.