2014-06-24 16:45:01 +05:30
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html;charset=iso-8859-1" >
< title >
2014-08-21 15:30:26 +05:30
Xilinx Driver iicps v2_2: xiicps.c File Reference
2014-06-24 16:45:01 +05:30
< / title >
2014-08-21 15:30:26 +05:30
< link href = "doxygen_kalyanidocs/doc/css/driver_api_doxygen.css" rel = "stylesheet" type = "text/css" >
2014-06-24 16:45:01 +05:30
< / head >
< h3 class = "PageHeader" > Xilinx Processor IP Library< / h3 >
< hl > Software Drivers< / hl >
< hr class = "whs1" >
2014-08-21 15:30:26 +05:30
<!-- Generated by Doxygen 1.6.1 -->
< div class = "navigation" id = "top" >
< div class = "tabs" >
< ul >
< li > < a href = "index.html" > < span > Main Page< / span > < / a > < / li >
< li > < a href = "annotated.html" > < span > Classes< / span > < / a > < / li >
< li class = "current" > < a href = "files.html" > < span > Files< / span > < / a > < / li >
< / ul >
< / div >
< div class = "tabs" >
< ul >
< li > < a href = "files.html" > < span > File List< / span > < / a > < / li >
< li > < a href = "globals.html" > < span > File Members< / span > < / a > < / li >
< / ul >
< / div >
< / div >
< div class = "contents" >
< h1 > xiicps.c File Reference< / h1 > < code > #include " < a class = "el" href = "xiicps_8h.html" > xiicps.h< / a > " < / code > < br / >
< table border = "0" cellpadding = "0" cellspacing = "0" >
< tr > < td colspan = "2" > < h2 > Functions< / h2 > < / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > int < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xiicps_8c.html#aa925e62e4e098c186667903ddc3d892f" > XIicPs_CfgInitialize< / a > (< a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > *InstancePtr, < a class = "el" href = "struct_x_iic_ps___config.html" > XIicPs_Config< / a > *ConfigPtr, u32 EffectiveAddr)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > int < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xiicps_8c.html#a0312ad44be4b3b1ff180b8ed5914b3d8" > XIicPs_BusIsBusy< / a > (< a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > *InstancePtr)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > void < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xiicps_8c.html#a3eaa694ecd774beca05bf79c1f9df6c0" > XIicPs_Abort< / a > (< a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > *InstancePtr)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > void < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xiicps_8c.html#a1169a92eb8594d6f038816b5740916f7" > XIicPs_Reset< / a > (< a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > *InstancePtr)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > int < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xiicps_8c.html#a6bf043d1f4ee43a6491cae17d69d6aab" > TransmitFifoFill< / a > (< a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > *InstancePtr)< / td > < / tr >
< / table >
< hr / > < a name = "_details" > < / a > < h2 > Detailed Description< / h2 >
< p > Contains implementation of required functions for the < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > driver. See < a class = "el" href = "xiicps_8h.html" > xiicps.h< / a > for detailed description of the device and driver.< / p >
< pre > MODIFICATION HISTORY:< / pre > < pre > Ver Who Date Changes
2014-06-24 16:45:01 +05:30
----- ------ -------- --------------------------------------------
1.00a drg/jz 01/30/10 First release
1.00a sdm 09/21/11 Updated the InstancePtr-> Options in the
XIicPs_CfgInitialize by calling XIicPs_GetOptions.
2.1 hk 04/25/14 Explicitly reset CR and clear FIFO in Abort function
and state the same in the comments. CR# 784254.
2014-08-21 15:30:26 +05:30
Fix for CR# 761060 - provision for repeated start.< / pre > < pre > < / pre > < hr / > < h2 > Function Documentation< / h2 >
< a class = "anchor" id = "a6bf043d1f4ee43a6491cae17d69d6aab" > < / a > <!-- doxytag: member="xiicps.c::TransmitFifoFill" ref="a6bf043d1f4ee43a6491cae17d69d6aab" args="(XIicPs *InstancePtr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:30:26 +05:30
< td class = "memname" > int TransmitFifoFill < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > < / td >
< td > ) < / td >
< td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:30:26 +05:30
< / div >
< div class = "memdoc" >
< p > Put more data into the transmit FIFO, number of bytes is ether expected number of bytes for this transfer or available space in FIFO, which ever is less.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is a pointer to the < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > instance.< / td > < / tr >
< / table >
2014-08-21 15:30:26 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:30:26 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > Number of bytes left for this instance.< / dd > < / dl >
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > This is function is shared by master and slave. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "a3eaa694ecd774beca05bf79c1f9df6c0" > < / a > <!-- doxytag: member="xiicps.c::XIicPs_Abort" ref="a3eaa694ecd774beca05bf79c1f9df6c0" args="(XIicPs *InstancePtr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:30:26 +05:30
< td class = "memname" > void XIicPs_Abort < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > < / td >
< td > ) < / td >
< td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:30:26 +05:30
< / div >
< div class = "memdoc" >
< p > Aborts a transfer in progress by resetting the FIFOs. The byte counts are cleared.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is a pointer to the < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > instance.< / td > < / tr >
< / table >
2014-08-21 15:30:26 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:30:26 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > None.< / dd > < / dl >
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > None. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "a0312ad44be4b3b1ff180b8ed5914b3d8" > < / a > <!-- doxytag: member="xiicps.c::XIicPs_BusIsBusy" ref="a0312ad44be4b3b1ff180b8ed5914b3d8" args="(XIicPs *InstancePtr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:30:26 +05:30
< td class = "memname" > int XIicPs_BusIsBusy < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > < / td >
< td > ) < / td >
< td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:30:26 +05:30
< / div >
< div class = "memdoc" >
< p > Check whether the I2C bus is busy< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is a pointer to the < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > instance.< / td > < / tr >
< / table >
2014-08-21 15:30:26 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:30:26 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > < ul >
< li > TRUE if the bus is busy.< / li >
< li > FALSE if the bus is not busy.< / li >
< / ul >
2014-06-24 16:45:01 +05:30
< / dd > < / dl >
2014-08-21 15:30:26 +05:30
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > None. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "aa925e62e4e098c186667903ddc3d892f" > < / a > <!-- doxytag: member="xiicps.c::XIicPs_CfgInitialize" ref="aa925e62e4e098c186667903ddc3d892f" args="(XIicPs *InstancePtr, XIicPs_Config *ConfigPtr, u32 EffectiveAddr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:30:26 +05:30
< td class = "memname" > int XIicPs_CfgInitialize < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:30:26 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_iic_ps___config.html" > XIicPs_Config< / a > * < / td >
< td class = "paramname" > < em > ConfigPtr< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:30:26 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > u32 < / td >
< td class = "paramname" > < em > EffectiveAddr< / em > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:30:26 +05:30
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:30:26 +05:30
< / div >
< div class = "memdoc" >
< p > Initializes a specific < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > instance such that the driver is ready to use.< / p >
< p > The state of the device after initialization is:< / p >
< ul >
< li > Device is disabled< / li >
< li > Slave mode< / li >
< / ul >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is a pointer to the < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > instance. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > ConfigPtr< / em > < / td > < td > is a reference to a structure containing information about a specific IIC device. This function initializes an InstancePtr object for a specific device specified by the contents of Config. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > EffectiveAddr< / em > < / td > < td > is the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, use ConfigPtr-> BaseAddress for this parameter, passing the physical address instead.< / td > < / tr >
< / table >
2014-08-21 15:30:26 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:30:26 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > The return value is XST_SUCCESS if successful.< / dd > < / dl >
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > None. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "a1169a92eb8594d6f038816b5740916f7" > < / a > <!-- doxytag: member="xiicps.c::XIicPs_Reset" ref="a1169a92eb8594d6f038816b5740916f7" args="(XIicPs *InstancePtr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:30:26 +05:30
< td class = "memname" > void XIicPs_Reset < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > < / td >
< td > ) < / td >
< td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:30:26 +05:30
< / div >
< div class = "memdoc" >
< p > Resets the IIC device. Reset must only be called after the driver has been initialized. The configuration of the device after reset is the same as its configuration after initialization. Any data transfer that is in progress is aborted.< / p >
< p > The upper layer software is responsible for re-configuring (if necessary) and reenabling interrupts for the IIC device after the reset.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is a pointer to the < a class = "el" href = "struct_x_iic_ps.html" > XIicPs< / a > instance.< / td > < / tr >
< / table >
2014-08-21 15:30:26 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:30:26 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > None.< / dd > < / dl >
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > None. < / dd > < / dl >
< / div >
< / div >
< / div >
< p class = "Copyright" >
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.
< / p >
< / body >
< / html >