iic
Vitis Drivers API Documentation
xiic_repeated_start_example.c File Reference

Overview

This file consists of a interrupt mode design example to demonstrate the use of repeated start using the XIic driver.

The XIic_MasterSend() API is used to transmit the data and XIic_MasterRecv() API is used to receive the data.

The IIC devices that are present on the Xilinx boards donot support the repeated start option. These examples have been tested with an IIC device external to the boards.

This code assumes that no Operating System is being used.

Note

None.

MODIFICATION HISTORY:
Ver   Who  Date  Changes


1.00a mta 02/20/06 Created. 2.00a sdm 09/22/09 Updated to use the HAL APIs, replaced call to XIic_Initialize API with XIic_LookupConfig and XIic_CfgInitialize. Updated the example with a fix for CR539763 where XIic_Start was being called instead of XIic_Stop. Added code for setting up the StatusHandler callback. 3.4 ms 01/23/17 Added xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028. 3.10 gm 07/09/23 Added SDT support

 

Functions

int IicRepeatedStartExample (void)
 This function writes and reads the data to the IIC Slave. More...
 
int main (void)
 Main function to call the Repeated Start example. More...
 

Function Documentation

int IicRepeatedStartExample ( void  )

This function writes and reads the data to the IIC Slave.

Returns
XST_SUCCESS if successful else XST_FAILURE.
Note
None.

References XIic_Config::BaseAddress, XII_ADDR_TO_SEND_TYPE, XIic_CfgInitialize(), XIic_InterruptHandler(), XIic_LookupConfig(), XIic_SetAddress(), XIic_SetRecvHandler(), XIic_SetSendHandler(), and XIic_SetStatusHandler().

Referenced by main().

int main ( void  )

Main function to call the Repeated Start example.

Returns
XST_SUCCESS if successful else XST_FAILURE.
Note
None.

References IicRepeatedStartExample().