-
大小: 10KB文件類型: .rar金幣: 2下載: 2 次發布日期: 2021-06-25
- 語言: 其他
- 標簽: driver??DW_apb_i2c??
資源簡介
dw i2c master control driver!

代碼片段和文件信息
/*?--------------------------------------------------------------------
**?
**?Synopsys?DesignWare?DW_apb_i2c?Software?Driver?Kit?and
**?documentation?(hereinafter?“Software“)?is?an?Unsupported
**?proprietary?work?of?Synopsys?Inc.?unless?otherwise?expressly
**?agreed?to?in?writing?between?Synopsys?and?you.
**?
**?The?Software?IS?NOT?an?item?of?Licensed?Software?or?Licensed
**?Product?under?any?End?User?Software?License?Agreement?or?Agreement
**?for?Licensed?Product?with?Synopsys?or?any?supplement?thereto.?You
**?are?permitted?to?use?and?redistribute?this?Software?in?source?and
**?binary?forms?with?or?without?modification?provided?that
**?redistributions?of?source?code?must?retain?this?notice.?You?may?not
**?view?use?disclose?copy?or?distribute?this?file?or?any?information
**?contained?herein?except?pursuant?to?this?license?grant?from?Synopsys.
**?If?you?do?not?agree?with?this?notice?including?the?disclaimer
**?below?then?you?are?not?authorized?to?use?the?Software.
**?
**?THIS?SOFTWARE?IS?BEING?DISTRIBUTED?BY?SYNOPSYS?SOLELY?ON?AN?“AS?IS“
**?BASIS?AND?ANY?EXPRESS?OR?IMPLIED?WARRANTIES?INCLUDING?BUT?NOT
**?LIMITED?TO?THE?IMPLIED?WARRANTIES?OF?MERCHANTABILITY?AND?FITNESS
**?FOR?A?PARTICULAR?PURPOSE?ARE?HEREBY?DISCLAIMED.?IN?NO?EVENT?SHALL
**?SYNOPSYS?BE?LIABLE?FOR?ANY?DIRECT?INDIRECT?INCIDENTAL?SPECIAL
**?EXEMPLARY?OR?CONSEQUENTIAL?DAMAGES?(INCLUDING?BUT?NOT?LIMITED?TO
**?PROCUREMENT?OF?SUBSTITUTE?GOODS?OR?SERVICES;?LOSS?OF?USE?DATA?OR
**?PROFITS;?OR?BUSINESS?INTERRUPTION)?HOWEVER?CAUSED?AND?ON?ANY?THEORY
**?OF?LIABILITY?WHETHER?IN?CONTRACT?STRICT?LIABILITY?OR?TORT
**?(INCLUDING?NEGLIGENCE?OR?OTHERWISE)?ARISING?IN?ANY?WAY?OUT?OF?THE
**?USE?OF?THIS?SOFTWARE?EVEN?IF?ADVISED?OF?THE?POSSIBILITY?OF?SUCH
**?DAMAGE.
**?
**?--------------------------------------------------------------------
*/
#include?“DW_common.h“??????????//?common?header?for?all?drivers
#include?“DW_apb_i2c_public.h“??//?DW_apb_i2c?public?header
#include?“DW_apb_i2c_private.h“?//?DW_apb_i2c?private?header
//?This?definition?is?used?by?the?assetion?macros?to?determine?the
//?current?file?name.??It?is?defined?in?the?DW_common_dbc.h?header.
DW_DEFINE_THIS_FILE;
/**********************************************************************/
int?dw_i2c_init(struct?dw_device?*dev)
{
????int?retval;
????I2C_COMMON_REQUIREMENTS(dev);
????//?disable?device
????retval?=?dw_i2c_disable(dev);
????//?if?device?is?not?busy?(i.e.?it?is?now?disabled)
????if(retval?==?0)?{
????????//?disable?all?interrupts
????????dw_i2c_maskIrq(dev?I2c_irq_all);
????????dw_i2c_clearIrq(dev?I2c_irq_all);
????????//?reset?instance?variables
????????dw_i2c_resetInstance(dev);
????????//?autoConfigure?component?parameters?if?possible
????????retval?=?dw_i2c_autoCompParams(dev);
????}
????return?retval;
}
/**********************************************************************/
void?dw_i2c_enable(struct?dw_device?*dev)
{
????uint32_t?reg;
????struct?dw_i2c_portmap?*portmap;
????I2C_COMMON_REQ
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????92193??2017-01-13?10:08??DW_apb_i2c.c
-----------?---------??----------?-----??----
????????????????92193????????????????????1
評論
共有 條評論