亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? i2c.c

?? 基于 Luminary Micro 公司的 Cortex-M3 (ARM)內核使用之 uC/OS-II 作業系統,此例程是移植于 LM3S310 上的應用,于 Keil MDK 工程編譯,而 uC/O
?? C
?? 第 1 頁 / 共 2 頁
字號:
    //
    // Return either the interrupt status or the raw interrupt status as
    // requested.
    //
    if(bMasked)
    {
        return((HWREG(ulBase + I2C_MASTER_O_MIS)) ? true : false);
    }
    else
    {
        return((HWREG(ulBase + I2C_MASTER_O_RIS)) ? true : false);
    }
}

//*****************************************************************************
//
//! Gets the current I2C Slave interrupt status.
//!
//! \param ulBase base address of the I2C Slave module
//! \param bMasked is false if the raw interrupt status is requested and
//! true if the masked interrupt status is requested.
//!
//! This returns the interrupt status for the I2C Slave module.
//! Either the raw interrupt status or the status of interrupts that are
//! allowed to reflect to the processor can be returned.
//!
//! \return The current interrupt status, returned as \b true if active
//! or \b false if not active.
//
//*****************************************************************************
tBoolean
I2CSlaveIntStatus(unsigned long ulBase, tBoolean bMasked)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_SLAVE_BASE);

    //
    // Return either the interrupt status or the raw interrupt status as
    // requested.
    //
    if(bMasked)
    {
        return((HWREG(ulBase + I2C_SLAVE_O_MIS)) ? true : false);
    }
    else
    {
        return((HWREG(ulBase + I2C_SLAVE_O_RIS)) ? true : false);
    }
}

//*****************************************************************************
//
//! Clears I2C Master interrupt sources.
//!
//! \param ulBase base address of the I2C Master module
//!
//! The I2C Master interrupt source is cleared, so that it no longer asserts.
//! This must be done in the interrupt.handler to keep it from being called
//! again immediately upon exit.
//!
//! \return None.
//
//*****************************************************************************
void
I2CMasterIntClear(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_MASTER_BASE);

    //
    // Clear the I2C master interrupt source.
    //
    HWREG(ulBase + I2C_MASTER_O_MIS) = I2C_MASTER_MICR_IC;
}

//*****************************************************************************
//
//! Clears I2C Slave interrupt sources.
//!
//! \param ulBase base address of the I2C Slave module
//!
//! The I2C Slave interrupt source is cleared, so that it no longer asserts.
//! This must be done in the interrupt.handler to keep it from being called
//! again immediately upon exit.
//!
//! \return None.
//
//*****************************************************************************
void
I2CSlaveIntClear(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_SLAVE_BASE);

    //
    // Clear the I2C slave interrupt source.
    //
    HWREG(ulBase + I2C_SLAVE_O_SICR) = I2C_SLAVE_SICR_IC;
}

//*****************************************************************************
//
//! Sets the address that the I2C Master will place on the bus.
//!
//! \param ulBase base address of the I2C Master module
//! \param ucSlaveAddr 7-bit slave address
//! \param bReceive flag indicating the type of communication with the slave
//!
//! This function will set the address that the I2C Master will place on the
//! bus when initiating a transaction. When the parameter \e bReceive is set
//! to \b true, the address will indicate that the I2C Master is initiating
//! a read from the slave; otherwise the address will indicate that the I2C
//! Master is initiating a write to the slave.
//!
//! \return None.
//
//*****************************************************************************
void
I2CMasterSlaveAddrSet(unsigned long ulBase, unsigned char ucSlaveAddr,
                      tBoolean bReceive)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_MASTER_BASE);
    ASSERT(!(ucSlaveAddr & 0x80));

    //
    // Set the address of the slave with which the master will communicate.
    //
    HWREG(ulBase + I2C_MASTER_O_SA) = (ucSlaveAddr << 1) | bReceive;
}

//*****************************************************************************
//
//! Indicates whether or not the I2C Master is busy.
//!
//! \param ulBase base address of the I2C Master module
//!
//! This function returns an indication of whether or not the I2C Master is
//! busy transmitting or receiving data.
//!
//! \return Returns \b true if the I2C Master is busy; otherwise, returns
//! \b false.
//
//*****************************************************************************
tBoolean
I2CMasterBusy(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_MASTER_BASE);

    //
    // Return the busy status.
    //
    if(HWREG(ulBase + I2C_MASTER_O_CS) & I2C_MASTER_CS_BUSY)
    {
        return(true);
    }
    else
    {
        return(false);
    }
}

//*****************************************************************************
//
//! Indicates whether or not the I2C bus is busy.
//!
//! \param ulBase base address of the I2C Master module
//!
//! This function returns an indication of whether or not the I2C bus is
//! busy. This function can be used in a multi-master environment to
//! determine if another master is currently using the bus.
//!
//! \return Returns \b true if the I2C bus is busy; otherwise, returns
//! \b false.
//
//*****************************************************************************
tBoolean
I2CMasterBusBusy(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_MASTER_BASE);

    //
    // Return the bus busy status.
    //
    if(HWREG(ulBase + I2C_MASTER_O_CS) & I2C_MASTER_CS_BUS_BUSY)
    {
        return(true);
    }
    else
    {
        return(false);
    }
}

//*****************************************************************************
//
//! Controls the state of the I2C Master module.
//!
//! \param ulBase base address of the I2C Master module
//! \param ulCmd command to be issued to the I2C Master module
//!
//! This function is used to control the state of the Master module send and
//! receive operations. The parameter \e ucCmd can be one of the following
//! values:
//!
//! - I2C_MASTER_CMD_SINGLE_SEND
//! - I2C_MASTER_CMD_SINGLE_RECEIVE
//! - I2C_MASTER_CMD_BURST_SEND_START
//! - I2C_MASTER_CMD_BURST_SEND_CONT
//! - I2C_MASTER_CMD_BURST_SEND_FINISH
//! - I2C_MASTER_CMD_BURST_SEND_ERROR_STOP
//! - I2C_MASTER_CMD_BURST_RECEIVE_START
//! - I2C_MASTER_CMD_BURST_RECEIVE_CONT
//! - I2C_MASTER_CMD_BURST_RECEIVE_FINISH
//! - I2C_MASTER_CMD_BURST_RECEIVE_ERROR_STOP
//!
//! \return None.
//
//*****************************************************************************
void
I2CMasterControl(unsigned long ulBase, unsigned long ulCmd)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_MASTER_BASE);
    ASSERT((ulCmd == I2C_MASTER_CMD_SINGLE_SEND) ||
           (ulCmd == I2C_MASTER_CMD_SINGLE_RECEIVE) ||
           (ulCmd == I2C_MASTER_CMD_BURST_SEND_START) ||
           (ulCmd == I2C_MASTER_CMD_BURST_SEND_CONT) ||
           (ulCmd == I2C_MASTER_CMD_BURST_SEND_FINISH) ||
           (ulCmd == I2C_MASTER_CMD_BURST_SEND_ERROR_STOP) ||
           (ulCmd == I2C_MASTER_CMD_BURST_RECEIVE_START) ||
           (ulCmd == I2C_MASTER_CMD_BURST_RECEIVE_CONT) ||
           (ulCmd == I2C_MASTER_CMD_BURST_RECEIVE_FINISH) ||
           (ulCmd == I2C_MASTER_CMD_BURST_RECEIVE_ERROR_STOP));

    //
    // Send the command.
    //
    HWREG(ulBase + I2C_MASTER_O_CS) = ulCmd;
}

//*****************************************************************************
//
//! Gets the error status of the I2C Master module.
//!
//! \param ulBase base address of the I2C Master module
//!
//! This function is used to obtain the error status of the Master module
//! send and receive operations. It returns one of the following values:
//!
//! - I2C_MASTER_ERR_NONE
//! - I2C_MASTER_ERR_ADDR_ACK
//! - I2C_MASTER_ERR_DATA_ACK
//! - I2C_MASTER_ERR_ARB_LOST
//!
//! \return None.
//
//*****************************************************************************
unsigned long
I2CMasterErr(unsigned long ulBase)
{
    unsigned long ulErr;

    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_MASTER_BASE);

    //
    // Get the raw error state
    //
    ulErr = HWREG(ulBase + I2C_MASTER_O_CS);

    //
    // If the I2C master is busy, then all the other bit are invalid, and
    // don't have an error to report.
    //
    if(ulErr & I2C_MASTER_CS_BUSY)
    {
        return(I2C_MASTER_ERR_NONE);
    }

    //
    // Check for errors.
    //
    if(ulErr & I2C_MASTER_CS_ERROR)
    {
        return(ulErr & (I2C_MASTER_CS_ERR_MASK));
    }
    else
    {
        return(I2C_MASTER_ERR_NONE);
    }
}

//*****************************************************************************
//
//! Transmits a byte from the I2C Master.
//!
//! \param ulBase base address of the I2C Master module
//! \param ucData data to be transmitted from the I2C Master
//!
//! This function will place the supplied data into I2C Master Data Register.
//!
//! \return None.
//
//*****************************************************************************
void
I2CMasterDataPut(unsigned long ulBase, unsigned char ucData)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_MASTER_BASE);

    //
    // Write the byte.
    //
    HWREG(ulBase + I2C_MASTER_O_DR) = ucData;
}

//*****************************************************************************
//
//! Receives a byte that has been sent to the I2C Master.
//!
//! \param ulBase base address of the I2C Master module
//!
//! This function reads a byte of data from the I2C Master Data Register.
//!
//! \return Returns the byte received from by the I2C Master, cast as an
//! unsigned long.
//
//*****************************************************************************
unsigned long
I2CMasterDataGet(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_MASTER_BASE);

    //
    // Read a byte.
    //
    return(HWREG(ulBase + I2C_MASTER_O_DR));
}

//*****************************************************************************
//
//! Gets the I2C Slave module status
//!
//! \param ulBase base address of the I2C Slave module
//!
//! This function will return the action requested from a master, if any. The
//! possible values returned are:
//!
//! - I2C_SLAVE_ACT_NONE
//! - I2C_SLAVE_ACT_RREQ
//! - I2C_SLAVE_ACT_TREQ
//!
//! where I2C_SLAVE_ACT_NONE means that no action has been requested of the
//! I2C Slave module, I2C_SLAVE_ACT_RREQ means that an I2C master has sent
//! data to the I2C Slave module, and I2C_SLAVE_ACT_TREQ means that an I2C
//! master has requested that the I2C Slave module send data.
//!
//! \return None.
//
//*****************************************************************************
unsigned long
I2CSlaveStatus(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_SLAVE_BASE);

    //
    // Return the slave status.
    //
    return(HWREG(ulBase + I2C_SLAVE_O_CSR));
}

//*****************************************************************************
//
//! Transmits a byte from the I2C Slave.
//!
//! \param ulBase base address of the I2C Slave module
//! \param ucData data to be transmitted from the I2C Slave
//!
//! This function will place the supplied data into I2C Slave Data Register.
//!
//! \return None.
//
//*****************************************************************************
void
I2CSlaveDataPut(unsigned long ulBase, unsigned char ucData)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_SLAVE_BASE);

    //
    // Write the byte.
    //
    HWREG(ulBase + I2C_SLAVE_O_DR) = ucData;
}

//*****************************************************************************
//
//! Receives a byte that has been sent to the I2C Slave.
//!
//! \param ulBase base address of the I2C Slave module
//!
//! This function reads a byte of data from the I2C Slave Data Register.
//!
//! \return Returns the byte received from by the I2C Slave, cast as an
//! unsigned long.
//
//*****************************************************************************
unsigned long
I2CSlaveDataGet(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_SLAVE_BASE);

    //
    // Read a byte.
    //
    return(HWREG(ulBase + I2C_SLAVE_O_DR));
}

//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一区二区视频| 久久久91精品国产一区二区精品| 成人av动漫在线| 久久99精品国产.久久久久久| 日韩黄色在线观看| 免费成人美女在线观看.| 久久av老司机精品网站导航| 国产美女精品人人做人人爽| 国产成人亚洲综合a∨婷婷图片 | 免费观看一级欧美片| 日韩影院精彩在线| 精品系列免费在线观看| 国产精品一二三区在线| 不卡av在线网| 欧美亚洲禁片免费| 欧美一区二区三区免费| 精品黑人一区二区三区久久 | 亚洲天堂2014| 亚洲国产一区在线观看| 精品中文字幕一区二区| 成人性生交大片免费看视频在线| 色综合天天综合网天天看片| 久久精品理论片| 久久久久久久综合色一本| 91黄色免费观看| 成人av资源网站| 日韩欧美亚洲一区二区| 午夜av区久久| 91精品久久久久久久99蜜桃| 一区二区三区欧美久久| 91丝袜高跟美女视频| 国产精品视频在线看| 亚洲精品自拍动漫在线| 成人精品国产一区二区4080| 精品av久久707| 激情成人午夜视频| 日韩精品一区二区在线| 美女国产一区二区| 日韩一区二区三区精品视频| 男男成人高潮片免费网站| 在线综合亚洲欧美在线视频| 首页综合国产亚洲丝袜| 日韩一区二区免费在线电影| 精品在线一区二区三区| 久久综合精品国产一区二区三区| 国产在线不卡视频| 欧美极品少妇xxxxⅹ高跟鞋| www.爱久久.com| 一区二区高清免费观看影视大全| 欧美亚洲图片小说| 蜜桃传媒麻豆第一区在线观看| 日韩精品一区二区三区蜜臀| 国产激情视频一区二区在线观看 | 亚洲柠檬福利资源导航| 成人性生交大片免费| 亚洲视频在线观看三级| 欧美日韩在线观看一区二区 | 久久影院电视剧免费观看| 韩国女主播一区二区三区| 欧美高清在线精品一区| 一本久久综合亚洲鲁鲁五月天| 亚洲综合丝袜美腿| 欧美成人三级在线| 91浏览器打开| 日韩电影在线看| 国产精品午夜在线| 欧美理论电影在线| 成人一区二区三区中文字幕| 亚洲一级在线观看| 国产亚洲1区2区3区| 欧美日韩一区三区四区| 国产高清精品在线| 亚洲成av人**亚洲成av**| 国产日产欧美一区二区三区| 日本黄色一区二区| 国产真实乱对白精彩久久| 一区二区三区 在线观看视频| 欧美一级电影网站| 欧洲色大大久久| 国产精品一区二区无线| 亚洲国产成人porn| 欧美韩国一区二区| 日韩一二三区视频| 91电影在线观看| av资源站一区| 国产乱子伦视频一区二区三区 | 国产欧美精品一区二区色综合 | 午夜久久福利影院| 亚洲人一二三区| 久久久一区二区三区| 日韩丝袜美女视频| 欧美日韩中文字幕一区二区| 成人h动漫精品| 国产精品99久久久| 黑人巨大精品欧美黑白配亚洲| 亚洲第四色夜色| 一区二区三区日韩欧美精品| 国产精品网站在线播放| 久久综合国产精品| 日韩欧美高清dvd碟片| 欧美精品第1页| 欧美日韩国产天堂| 欧美丝袜自拍制服另类| 91黄色小视频| 在线视频综合导航| 日本久久一区二区三区| 色婷婷精品久久二区二区蜜臂av| av不卡一区二区三区| 国产成a人无v码亚洲福利| 国产成人在线视频网址| 国产成人av福利| 高清在线不卡av| 岛国av在线一区| 成人av在线网站| 91视频免费看| 色嗨嗨av一区二区三区| 欧洲精品一区二区| 欧美日韩免费高清一区色橹橹 | 欧美男男青年gay1069videost| 在线观看av一区| 欧美日韩免费观看一区二区三区| 欧美熟乱第一页| 欧美高清视频www夜色资源网| 欧美高清一级片在线| 欧美一区二区视频在线观看2020 | 91精品国产91热久久久做人人| 欧美日韩综合色| 欧美一区二区在线视频| 日韩欧美精品三级| 国产蜜臀av在线一区二区三区| 国产精品免费视频网站| 一区二区免费视频| 奇米精品一区二区三区在线观看一| 久久99久久99| 99免费精品视频| 欧美伦理电影网| 久久久美女艺术照精彩视频福利播放| 国产女同性恋一区二区| 一区二区在线免费观看| 人人精品人人爱| 成人国产免费视频| 欧美视频在线播放| 久久综合给合久久狠狠狠97色69| 中文字幕一区二区三区av| 亚洲成人av免费| 久久成人免费日本黄色| 99re成人在线| 日韩一区二区视频| 亚洲欧洲在线观看av| 蜜桃一区二区三区四区| 99精品黄色片免费大全| 91麻豆精品国产无毒不卡在线观看| 久久久久久久一区| 亚洲午夜精品在线| 国产不卡在线播放| 欧美一区午夜精品| 国产精品久久三| 久久99精品久久久| 91福利小视频| 国产精品天天摸av网| 免费观看在线综合| 欧美天堂一区二区三区| 中文字幕av不卡| 久久国产夜色精品鲁鲁99| 91福利国产成人精品照片| 国产女人18水真多18精品一级做| 亚洲成人免费观看| 99精品欧美一区二区蜜桃免费| 26uuu国产电影一区二区| 午夜精品爽啪视频| 色综合天天综合狠狠| 久久久久久久综合色一本| 日韩福利电影在线| 色综合久久久久| 国产欧美日韩久久| 国产一区二区三区蝌蚪| 欧美高清精品3d| 亚洲人xxxx| 波多野结衣在线aⅴ中文字幕不卡| 日韩欧美一区二区视频| 图片区日韩欧美亚洲| 91精彩视频在线| 亚洲精品成人少妇| 懂色av一区二区在线播放| 久久综合久久鬼色| 精品中文av资源站在线观看| 欧美一级理论性理论a| 亚洲国产精品久久久久秋霞影院 | 精品理论电影在线| 天天影视涩香欲综合网| 欧美天堂一区二区三区| 亚洲色图19p| 97久久超碰国产精品电影| 中文字幕av一区 二区| 国产成人av电影在线观看| 国产视频一区在线观看| 国产美女久久久久| 欧美激情一区不卡| av不卡在线观看| 亚洲精品一二三四区|