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

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

?? i2c.c

?? 基于TI公司Cortex-M3的uart超級通信開發
?? C
?? 第 1 頁 / 共 3 頁
字號:
//! being immediately reentered (since NVIC still sees the interrupt source
//! asserted).
//!
//! \return None.
//
//*****************************************************************************
void
I2CSlaveIntClearEx(unsigned long ulBase, unsigned long ulIntFlags)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == I2C0_SLAVE_BASE) || (ulBase == I2C1_SLAVE_BASE));

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

//*****************************************************************************
//
//! Sets the address that the I2C Master will place on the bus.
//!
//! \param ulBase is the 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 \e bReceive parameter 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_O_MSA) = (ucSlaveAddr << 1) | bReceive;
}

//*****************************************************************************
//
//! Indicates whether or not the I2C Master is busy.
//!
//! \param ulBase is the 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_O_MCS) & I2C_MCS_BUSY)
    {
        return(true);
    }
    else
    {
        return(false);
    }
}

//*****************************************************************************
//
//! Indicates whether or not the I2C bus is busy.
//!
//! \param ulBase is the 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_O_MCS) & I2C_MCS_BUSBSY)
    {
        return(true);
    }
    else
    {
        return(false);
    }
}

//*****************************************************************************
//
//! Controls the state of the I2C Master module.
//!
//! \param ulBase is the 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 \e ucCmd parameter can be one of the following
//! values:
//!
//! - \b I2C_MASTER_CMD_SINGLE_SEND
//! - \b I2C_MASTER_CMD_SINGLE_RECEIVE
//! - \b I2C_MASTER_CMD_BURST_SEND_START
//! - \b I2C_MASTER_CMD_BURST_SEND_CONT
//! - \b I2C_MASTER_CMD_BURST_SEND_FINISH
//! - \b I2C_MASTER_CMD_BURST_SEND_ERROR_STOP
//! - \b I2C_MASTER_CMD_BURST_RECEIVE_START
//! - \b I2C_MASTER_CMD_BURST_RECEIVE_CONT
//! - \b I2C_MASTER_CMD_BURST_RECEIVE_FINISH
//! - \b 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_O_MCS) = ulCmd;
}

//*****************************************************************************
//
//! Gets the error status of the I2C Master module.
//!
//! \param ulBase is the base address of the I2C Master module.
//!
//! This function is used to obtain the error status of the Master module send
//! and receive operations.
//!
//! \return Returns the error status, as one of \b I2C_MASTER_ERR_NONE,
//! \b I2C_MASTER_ERR_ADDR_ACK, \b I2C_MASTER_ERR_DATA_ACK, or
//! \b I2C_MASTER_ERR_ARB_LOST.
//
//*****************************************************************************
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_O_MCS);

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

    //
    // Check for errors.
    //
    if(ulErr & I2C_MCS_ERROR)
    {
        return(ulErr & (I2C_MCS_ARBLST | I2C_MCS_DATACK | I2C_MCS_ADRACK));
    }
    else
    {
        return(I2C_MASTER_ERR_NONE);
    }
}

//*****************************************************************************
//
//! Transmits a byte from the I2C Master.
//!
//! \param ulBase is the 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_O_MDR) = ucData;
}

//*****************************************************************************
//
//! Receives a byte that has been sent to the I2C Master.
//!
//! \param ulBase is the 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_O_MDR));
}

//*****************************************************************************
//
//! Gets the I2C Slave module status
//!
//! \param ulBase is the base address of the I2C Slave module.
//!
//! This function will return the action requested from a master, if any.
//! Possible values are:
//!
//! - \b I2C_SLAVE_ACT_NONE
//! - \b I2C_SLAVE_ACT_RREQ
//! - \b I2C_SLAVE_ACT_TREQ
//! - \b I2C_SLAVE_ACT_RREQ_FBR
//!
//! \return Returns \b I2C_SLAVE_ACT_NONE to indicate that no action has been
//! requested of the I2C Slave module, \b I2C_SLAVE_ACT_RREQ to indicate that
//! an I2C master has sent data to the I2C Slave module, \b I2C_SLAVE_ACT_TREQ
//! to indicate that an I2C master has requested that the I2C Slave module send
//! data, and \b I2C_SLAVE_ACT_RREQ_FBR to indicate that an I2C master has sent
//! data to the I2C slave and the first byte following the slave's own address
//! has been received.
//
//*****************************************************************************
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_O_SCSR));
}

//*****************************************************************************
//
//! Transmits a byte from the I2C Slave.
//!
//! \param ulBase is the 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_O_SDR) = ucData;
}

//*****************************************************************************
//
//! Receives a byte that has been sent to the I2C Slave.
//!
//! \param ulBase is the 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_O_SDR));
}

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久99久久免费精品蜜臀| 国产一区在线视频| 亚洲主播在线观看| 亚洲欧美在线视频| 欧美日韩精品综合在线| 成人性生交大片免费看视频在线 | 国产一区二区三区电影在线观看| 久久女同性恋中文字幕| 在线播放日韩导航| 日本视频中文字幕一区二区三区| 亚洲激情五月婷婷| 一区二区理论电影在线观看| 亚洲在线视频免费观看| 午夜av区久久| 麻豆精品视频在线观看免费| 精品制服美女久久| 久久超级碰视频| 国产电影一区二区三区| 成人aaaa免费全部观看| 色综合中文字幕国产| 在线观看亚洲专区| 4438成人网| 精品国产99国产精品| 亚洲国产经典视频| 一区二区欧美国产| 免费成人性网站| 高清不卡一区二区在线| 97久久久精品综合88久久| 在线免费观看成人短视频| 91麻豆精品国产自产在线 | 日韩精品一区二区三区视频播放 | 日本韩国精品在线| 欧美日韩大陆一区二区| 久久久蜜桃精品| 亚洲欧美日韩中文播放 | 午夜视频在线观看一区| 蜜桃视频在线一区| 成人自拍视频在线| 欧美喷潮久久久xxxxx| 久久亚洲综合色一区二区三区 | 久久国产精品99久久人人澡| 丁香一区二区三区| 欧美视频三区在线播放| 欧美精品一区二区三区在线播放| 中文字幕一区在线| 婷婷久久综合九色综合伊人色| 精品一区二区综合| 色诱亚洲精品久久久久久| 日韩亚洲欧美综合| 亚洲欧美综合另类在线卡通| 美日韩一区二区| 91亚洲国产成人精品一区二三 | 国产免费观看久久| 午夜精品福利一区二区三区av| 国产一区二区主播在线| 欧美午夜寂寞影院| 久久久www成人免费毛片麻豆| 一级日本不卡的影视| 国产精品一区二区黑丝| 欧美美女视频在线观看| 国产精品久久久久天堂| 九九**精品视频免费播放| 97se狠狠狠综合亚洲狠狠| 日韩精品中午字幕| 亚洲国产另类精品专区| 国产91丝袜在线18| 日韩亚洲欧美一区| 亚洲国产精品久久人人爱蜜臀| 国产91精品入口| 日韩精品一区二区三区四区| 亚洲影视在线观看| 成人国产精品视频| 欧美精品一区二区三区高清aⅴ | a美女胸又www黄视频久久| 日韩视频不卡中文| 亚洲国产婷婷综合在线精品| 91在线视频网址| 国产欧美精品一区二区三区四区| 免费观看一级欧美片| 欧美三级日韩三级国产三级| 国产精品久久久久一区| 国产成人免费在线视频| 欧美精品一区二区在线观看| 秋霞电影网一区二区| 欧美日韩精品三区| 亚洲激情图片qvod| 一本久久精品一区二区| 国产精品成人网| 成人黄动漫网站免费app| 国产欧美日韩在线| 风间由美一区二区av101| 欧美成人女星排名| 精品一区二区三区的国产在线播放| 欧美视频在线观看一区二区| 一区二区理论电影在线观看| 91黄色免费版| 亚洲国产精品久久久久秋霞影院| 在线视频你懂得一区二区三区| 中文字幕永久在线不卡| 91亚洲永久精品| 一区二区三区视频在线看| 97se亚洲国产综合自在线| 亚洲丝袜美腿综合| 色网站国产精品| 亚洲一区二区综合| 欧美精品777| 婷婷开心激情综合| 日韩一级免费一区| 久久草av在线| 国产日韩欧美精品在线| 成人动漫一区二区在线| 国产精品美女久久久久久| 99re66热这里只有精品3直播| 亚洲免费三区一区二区| 欧美性高清videossexo| 天堂久久久久va久久久久| 欧美男生操女生| 久久精品国产色蜜蜜麻豆| 久久精品亚洲国产奇米99| 成人蜜臀av电影| 亚洲国产欧美在线| 精品少妇一区二区三区免费观看| 国产伦精品一区二区三区免费迷 | 色中色一区二区| 午夜成人在线视频| 欧美xxxxx牲另类人与| 国产乱人伦精品一区二区在线观看| 日本一区免费视频| 色视频欧美一区二区三区| 香蕉成人伊视频在线观看| 日韩精品在线一区| 国产电影精品久久禁18| 亚洲理论在线观看| 在线不卡一区二区| 国产成人免费在线| 一级女性全黄久久生活片免费| 日韩亚洲国产中文字幕欧美| 国产成人av电影| 亚洲一区二区三区视频在线播放| 日韩一区二区免费高清| 国产成人无遮挡在线视频| 亚洲欧美日韩中文字幕一区二区三区| 欧美日韩精品综合在线| 国产麻豆午夜三级精品| 夜夜亚洲天天久久| 亚洲精品一区二区三区四区高清 | 国产欧美日韩在线看| 一本久久综合亚洲鲁鲁五月天| 日韩av一区二| 国产精品久久久久影院老司| 欧美精品在线一区二区三区| 国产一区在线精品| 亚洲风情在线资源站| 久久久久国产免费免费| 欧美色网站导航| 国产91色综合久久免费分享| 午夜精品一区二区三区免费视频| 国产日韩欧美麻豆| 91精品国产手机| 9i在线看片成人免费| 日韩电影在线观看一区| 亚洲欧洲色图综合| 精品捆绑美女sm三区| 欧洲一区在线电影| 成人国产在线观看| 久久精品免费观看| 亚洲国产三级在线| 中文欧美字幕免费| 3d成人h动漫网站入口| 99精品国产99久久久久久白柏| 免费观看一级欧美片| 一区二区三区四区不卡视频| 国产免费成人在线视频| 日韩区在线观看| 欧美日韩精品一区二区在线播放 | 国产欧美日韩三区| 欧美一区二区三区视频免费播放| 一本色道久久综合精品竹菊| 懂色av中文字幕一区二区三区| 美女视频黄a大片欧美| 亚洲黄色小视频| 中文字幕亚洲综合久久菠萝蜜| 精品国产髙清在线看国产毛片| 欧美日韩国产一级二级| 日本高清成人免费播放| 99精品国产91久久久久久 | 2023国产精华国产精品| 欧美性猛片xxxx免费看久爱| 91性感美女视频| 成人国产精品免费观看动漫| 国产精品一线二线三线精华| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲国产精品久久一线不卡| 一区二区三区在线视频免费 | 成人av免费在线播放| 大陆成人av片| 国产宾馆实践打屁股91| 国产一区二区成人久久免费影院| 韩国女主播成人在线| 激情五月播播久久久精品|