uartlite
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Xuartlite_intr_tapp_example

Functions

int UartLiteIntrExample (XUartLite *UartLiteInstPtr, UINTPTR BaseAddress)
 Performs a minimal test on the UartLite device and driver. More...
 
int main (void)
 Calls the UartLite interrupt example. More...
 

Device parameters

The following constants map to the XPAR parameters created in the xparameters.h file.

They are defined here so that all needed parameters can be changed in one place.

#define XUARTLITE_BASEADDRESS   XPAR_XUARTLITE_0_BASEADDR
 UartLite base address. More...
 

Buffer size

#define TEST_BUFFER_SIZE   100
 Length of the send buffer. More...
 

Shared example variables

The following variables are shared between non-interrupt processing and interrupt processing such that they must be global.

The counter determines when the entire buffer has been sent.

u8 SendBuffer [TEST_BUFFER_SIZE]
 Buffer for transmitting data. More...
 

Macro Definition Documentation

#define TEST_BUFFER_SIZE   100

Length of the send buffer.

#define XUARTLITE_BASEADDRESS   XPAR_XUARTLITE_0_BASEADDR

UartLite base address.

Referenced by main().

Function Documentation

int main ( void  )

Calls the UartLite interrupt example.

Returns
XST_SUCCESS if successful, else XST_FAILURE.

References UartLiteIntrExample(), and XUARTLITE_BASEADDRESS.

int UartLiteIntrExample ( XUartLite *  UartLiteInstPtr,
UINTPTR  BaseAddress 
)

Performs a minimal test on the UartLite device and driver.

This function is a design example that illustrates how to use the XUartLite component.

This function sends data through the UartLite.

This function uses the interrupt driver mode of the UartLite. The calls to the UartLite driver in the interrupt handlers, should only use the non-blocking calls.

Parameters
[in]UartLiteInstPtrPointer to the instance of UartLite driver.
[in]BaseAddressBase address of the device.
Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note
- In XSCT/classic flow, DeviceId is used to look up the device configuration.
  • This function contains an infinite loop such that if interrupts are not working it may never return.

Variable Documentation

u8 SendBuffer[TEST_BUFFER_SIZE]

Buffer for transmitting data.