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

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

?? i2c.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 3 頁
字號:
//! 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 | I2C_MCS_ARBLST))
    {
        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一区二区三区免费野_久草精品视频
国产婷婷一区二区| 日本不卡视频在线观看| 性久久久久久久久| 韩国av一区二区三区在线观看| 成人午夜电影小说| 日韩精品一区二区三区swag| 亚洲美女淫视频| 国产精品18久久久久久久网站| 欧美日韩一区二区三区四区五区| 久久亚洲精品国产精品紫薇| 亚洲一区影音先锋| 99热这里都是精品| 国产午夜亚洲精品羞羞网站| 久久精品国产一区二区三区免费看| 色综合色狠狠天天综合色| 久久精品夜色噜噜亚洲a∨| 日本欧美在线观看| 日本道免费精品一区二区三区| 日本一区二区三级电影在线观看 | 国产精品538一区二区在线| 欧美乱妇15p| 亚洲一区在线电影| 欧美在线|欧美| 亚洲激情一二三区| 欧美亚洲免费在线一区| 亚洲欧美偷拍卡通变态| 99国产精品久久久久久久久久久| 久久九九影视网| 国产在线国偷精品产拍免费yy| 7777精品伊人久久久大香线蕉经典版下载 | 国产伦理精品不卡| 欧美不卡激情三级在线观看| 日韩av电影一区| 日韩区在线观看| 卡一卡二国产精品| 精品欧美久久久| 九色|91porny| 国产日本亚洲高清| 成人毛片视频在线观看| 国产女人18毛片水真多成人如厕 | 色婷婷av一区二区三区软件 | 狂野欧美性猛交blacked| 欧美一区欧美二区| 亚洲国产精品尤物yw在线观看| 欧美在线播放高清精品| 午夜av区久久| 亚洲精品一区在线观看| 国产精品亚洲一区二区三区妖精| 国产日韩v精品一区二区| 成人黄色网址在线观看| 一区二区三区四区蜜桃| 欧美一区国产二区| 色综合天天综合| 伊人色综合久久天天| 欧美日韩一区小说| 激情综合色播五月| 国产欧美日韩另类一区| 91麻豆免费观看| 日本在线不卡视频一二三区| 亚洲精品一区二区三区福利 | 国内一区二区在线| 国产精品久久久久久福利一牛影视| 91天堂素人约啪| 日韩精品一级中文字幕精品视频免费观看 | 国产欧美一区二区三区沐欲 | 成人app下载| 亚洲一区二区三区免费视频| 91精品欧美一区二区三区综合在| 国产自产视频一区二区三区| 亚洲欧洲综合另类在线| 日韩一区二区麻豆国产| k8久久久一区二区三区| 日韩电影在线观看一区| 中文字幕不卡的av| 欧美日韩黄色一区二区| 粉嫩嫩av羞羞动漫久久久| 亚洲自拍偷拍九九九| 国产日韩综合av| 欧美男人的天堂一二区| 福利电影一区二区三区| 日本视频免费一区| 亚洲色图.com| 精品噜噜噜噜久久久久久久久试看| 99精品欧美一区二区蜜桃免费| 美日韩一级片在线观看| 亚洲一级二级在线| 中文字幕不卡的av| 亚洲精品一区二区三区影院| 欧美日韩久久一区二区| 99久久免费精品高清特色大片| 久久99精品久久久久久国产越南 | 中文字幕乱码日本亚洲一区二区| 欧美日韩亚洲另类| 91年精品国产| 国产激情一区二区三区桃花岛亚洲| 午夜视频在线观看一区二区 | 色素色在线综合| 国产激情一区二区三区| 麻豆免费看一区二区三区| 亚洲国产综合视频在线观看| 1024成人网| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 欧美日本一区二区在线观看| av一区二区不卡| 国产专区综合网| 免费欧美在线视频| 日韩av一级电影| 日韩专区一卡二卡| 亚洲v精品v日韩v欧美v专区| 亚洲人成在线播放网站岛国| 国产精品久久免费看| 欧美激情一区在线观看| 国产亚洲一本大道中文在线| 精品乱码亚洲一区二区不卡| 精品三级av在线| 欧美mv日韩mv国产网站app| 日韩久久精品一区| 欧美一区二区视频在线观看| 91麻豆精品国产91久久久久久久久 | 久久精品水蜜桃av综合天堂| 精品av综合导航| 久久你懂得1024| 国产农村妇女精品| 国产精品久久久久久福利一牛影视| 欧美国产丝袜视频| 国产精品成人午夜| 中文字幕一区二区三区在线播放| 国产精品国产三级国产三级人妇| 亚洲欧美综合网| 一区二区三区**美女毛片| 亚洲一区二区三区影院| 秋霞电影一区二区| 久久电影国产免费久久电影| 国产精品一二一区| eeuss鲁片一区二区三区| 日本道色综合久久| 欧美一区二区不卡视频| 久久久噜噜噜久久中文字幕色伊伊| 国产女主播在线一区二区| 亚洲色图在线看| 日韩有码一区二区三区| 精品一区二区日韩| av在线一区二区| 91精品国产高清一区二区三区 | 99久久er热在这里只有精品15| 91久久久免费一区二区| 欧美精品日韩一本| 久久午夜国产精品| 一区二区日韩av| 美女视频免费一区| av电影天堂一区二区在线| 欧美性色综合网| 久久免费视频色| 亚洲自拍偷拍网站| 国产乱码精品1区2区3区| 日本道免费精品一区二区三区| 欧美一级日韩一级| 亚洲欧美一区二区三区久本道91 | 色88888久久久久久影院按摩| 7777精品伊人久久久大香线蕉的 | 精品一区二区免费视频| 91蜜桃在线观看| 欧美v国产在线一区二区三区| 国产精品理论片| 蜜臀av一级做a爰片久久| 成年人午夜久久久| 精品日韩av一区二区| 一区二区三区电影在线播| 国产精品中文字幕日韩精品 | 日韩经典一区二区| 成人av电影在线观看| 日韩一区二区三区电影在线观看 | 亚洲私人影院在线观看| 久久精品国产一区二区| 在线免费观看不卡av| 国产偷国产偷精品高清尤物| 日本不卡免费在线视频| 91成人在线观看喷潮| 国产精品午夜在线| 国产美女一区二区三区| 91麻豆精品国产91久久久| 亚洲三级在线播放| 丁香五精品蜜臀久久久久99网站 | 成人欧美一区二区三区| 国产精品一区二区三区99| 欧美一级久久久| 亚洲1区2区3区4区| 欧美视频在线观看一区| 一区二区三区四区在线播放| 成人性生交大合| 久久精品视频网| 国产一区二区0| 久久久久久免费网| 国产一区二区三区香蕉| 欧美va在线播放| 久久国产麻豆精品| 久久亚洲一区二区三区四区| 蜜臀久久久久久久| 日韩欧美亚洲一区二区| 蜜臀av性久久久久蜜臀aⅴ流畅 |