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

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

?? i2c.c

?? lm3s6916上keil編譯的"hello world"程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
    //
    ASSERT((ulBase == I2C0_MASTER_BASE) || (ulBase == I2C1_MASTER_BASE));

    //
    // 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 == I2C0_SLAVE_BASE) || (ulBase == I2C1_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 == I2C0_MASTER_BASE) || (ulBase == I2C1_MASTER_BASE));

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

    //
    // Workaround for I2C master interrupt clear errata for rev B Stellaris
    // devices.  For later devices, this write is ignored and therefore
    // harmless (other than the slight performance hit).
    //
    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 == I2C0_SLAVE_BASE) || (ulBase == I2C1_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 == I2C0_MASTER_BASE) || (ulBase == I2C1_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 == I2C0_MASTER_BASE) || (ulBase == I2C1_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 == I2C0_MASTER_BASE) || (ulBase == I2C1_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 == I2C0_MASTER_BASE) || (ulBase == I2C1_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 == I2C0_MASTER_BASE) || (ulBase == I2C1_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 == I2C0_MASTER_BASE) || (ulBase == I2C1_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 == I2C0_MASTER_BASE) || (ulBase == I2C1_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 == I2C0_SLAVE_BASE) || (ulBase == I2C1_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 == I2C0_SLAVE_BASE) || (ulBase == I2C1_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 == I2C0_SLAVE_BASE) || (ulBase == I2C1_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一区二区三区免费野_久草精品视频
国产精品成人免费在线| 欧美一区二区三区免费大片| 国产精品天干天干在观线| 国内外成人在线视频| 国产欧美久久久精品影院| 成人影视亚洲图片在线| 国产精品色哟哟| 日本高清视频一区二区| 日日夜夜精品免费视频| 精品国产凹凸成av人网站| 丁香天五香天堂综合| 国产精品久久夜| 欧美日韩国产精品自在自线| 日本vs亚洲vs韩国一区三区二区| 欧美大片日本大片免费观看| 成人性生交大片免费看中文| 亚洲欧洲国产专区| 欧美日韩一区二区三区在线| 国产一区二区三区黄视频| 亚洲同性同志一二三专区| 精品1区2区3区| 韩国v欧美v亚洲v日本v| 亚洲男人天堂一区| 欧美一级国产精品| 成人在线综合网| 日韩高清在线电影| 国产欧美一区二区三区网站| 在线视频国内一区二区| 极品少妇xxxx精品少妇| 亚洲精品视频在线观看网站| 精品区一区二区| 91日韩精品一区| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲特黄一级片| 精品久久一二三区| 欧美在线播放高清精品| 国产一区二区不卡| 亚洲a一区二区| 亚洲欧洲日韩女同| 精品人伦一区二区色婷婷| 色婷婷久久99综合精品jk白丝| 另类调教123区| 亚洲高清免费观看| 中文字幕亚洲成人| xnxx国产精品| 欧美日韩mp4| 99精品视频在线播放观看| 久久99国产精品尤物| 五月婷婷综合在线| 国产精品久久久久7777按摩 | 欧美a一区二区| 亚洲精品水蜜桃| 日本一区二区三区在线观看| 日韩一区二区三区在线观看| 欧美中文字幕一区二区三区亚洲| 成人午夜大片免费观看| 韩国女主播一区| 美女精品自拍一二三四| 亚洲午夜免费电影| 亚洲视频综合在线| 国产精品高潮呻吟| 精品日本一线二线三线不卡| 56国语精品自产拍在线观看| 91国产成人在线| 91浏览器在线视频| 99久久精品国产一区二区三区 | 欧美一级xxx| 欧美久久久久久久久| 欧美私人免费视频| 在线观看日韩国产| 色婷婷av一区二区三区大白胸| 成人精品在线视频观看| 国产91清纯白嫩初高中在线观看| 国产一区二区日韩精品| 国产在线视频一区二区三区| 老司机免费视频一区二区三区| 奇米一区二区三区av| 蜜臀精品一区二区三区在线观看 | 人人精品人人爱| 蓝色福利精品导航| 久久精品国产久精国产| 蜜桃av一区二区三区电影| 日韩激情中文字幕| 蜜臀精品一区二区三区在线观看 | 欧美日韩视频第一区| 欧美性猛片aaaaaaa做受| 欧美撒尿777hd撒尿| 欧美精品亚洲一区二区在线播放| 欧美精品久久一区| 精品黑人一区二区三区久久| 国产三级久久久| 国产精品久久久久影院| 日韩理论片在线| 亚洲成av人影院在线观看网| 青青草成人在线观看| 国模冰冰炮一区二区| 成人福利在线看| 欧美性生活一区| 日韩欧美一级二级三级久久久| 日韩三级免费观看| 久久久欧美精品sm网站| 亚洲欧洲精品一区二区精品久久久| 亚洲另类春色校园小说| 秋霞午夜av一区二区三区| 国产成人一区二区精品非洲| 91天堂素人约啪| 欧美一区二区三区四区高清| 国产日韩欧美在线一区| 亚洲三级视频在线观看| 偷偷要91色婷婷| 成人性生交大片| 欧美欧美午夜aⅴ在线观看| 久久综合久久鬼色中文字| 亚洲视频精选在线| 美女一区二区三区在线观看| 国产成人免费视频网站高清观看视频| 99久久精品国产导航| 日韩欧美中文字幕制服| 亚洲女性喷水在线观看一区| 日本不卡高清视频| av亚洲精华国产精华精| 91精品国产入口| 中文字幕在线一区二区三区| 欧美96一区二区免费视频| 粉嫩在线一区二区三区视频| 欧美日本一道本在线视频| 久久精品在线观看| 视频一区中文字幕| 91首页免费视频| 久久亚洲一区二区三区四区| 亚洲高清一区二区三区| 丁香婷婷综合色啪| 欧美大胆人体bbbb| 亚洲男同性视频| 成人免费看视频| 日韩美一区二区三区| 一区二区三区蜜桃| 国产福利精品一区二区| 欧美一级高清大全免费观看| 亚洲在线视频网站| 成人国产免费视频| 久久久精品黄色| 久久国产福利国产秒拍| 欧美亚洲国产一区二区三区 | 99国产精品久久久久| 精品国产免费一区二区三区四区| 亚洲一区成人在线| 91麻豆免费视频| 国产精品传媒视频| 国产福利一区二区三区| 精品毛片乱码1区2区3区| 首页国产丝袜综合| 欧美在线观看一区二区| 亚洲欧美一区二区三区国产精品 | 成人精品视频一区二区三区| 精品精品国产高清a毛片牛牛 | 亚洲黄网站在线观看| jizz一区二区| 国产精品久久看| 91在线视频官网| 国产精品久久综合| www.亚洲精品| 成人免费一区二区三区视频 | 美女免费视频一区二区| 91麻豆精品国产91久久久久久久久| 亚洲欧美一区二区不卡| 91看片淫黄大片一级| 国产精品久久福利| caoporn国产精品| 亚洲婷婷综合久久一本伊一区| 北岛玲一区二区三区四区| 国产精品久久午夜| 色婷婷激情综合| 亚洲国产精品久久不卡毛片| 欧美日韩成人在线一区| 日韩成人一区二区| 久久午夜羞羞影院免费观看| 久久99精品国产91久久来源| 26uuu成人网一区二区三区| 国产一区二区三区四区五区美女| 国产午夜一区二区三区| www.亚洲人| 亚洲国产日日夜夜| 欧美精品成人一区二区三区四区| 日韩成人免费在线| 久久精品亚洲乱码伦伦中文| av不卡在线观看| 亚洲成人资源网| 欧美变态凌虐bdsm| 成人avav在线| 午夜激情综合网| 欧美精品一区二区三区视频| 成人免费三级在线| 亚洲免费观看在线视频| 欧美日韩激情一区| 国产麻豆精品一区二区| 国产精品国产三级国产| 欧美日本一区二区三区四区| 国产一区二区剧情av在线| 中文字幕中文字幕一区|