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

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

?? i2c.c

?? This is the free RTOS on PIC24.
?? C
?? 第 1 頁 / 共 2 頁
字號:
    {
        return((HWREG(ulBase + I2C_MASTER_O_MIS)) ? true : false);
    }
    else
    {
        return((HWREG(ulBase + I2C_MASTER_O_RIS)) ? true : false);
    }
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_slaveintstatus) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
    }
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_masterintclear) || defined(BUILD_ALL) || defined(DOXYGEN)
void
I2CMasterIntClear(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_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;
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_slaveintclear) || defined(BUILD_ALL) || defined(DOXYGEN)
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;
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_masterslaveaddrset) || defined(BUILD_ALL) || defined(DOXYGEN)
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;
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_masterbusy) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
    }
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_masterbusbusy) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
    }
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_mastercontrol) || defined(BUILD_ALL) || defined(DOXYGEN)
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;
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_mastererr) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
    }
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_masterdataput) || defined(BUILD_ALL) || defined(DOXYGEN)
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;
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_masterdataget) || defined(BUILD_ALL) || defined(DOXYGEN)
unsigned long
I2CMasterDataGet(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_MASTER_BASE);

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

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_slavestatus) || defined(BUILD_ALL) || defined(DOXYGEN)
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));
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_slavedataput) || defined(BUILD_ALL) || defined(DOXYGEN)
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;
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_slavedataget) || defined(BUILD_ALL) || defined(DOXYGEN)
unsigned long
I2CSlaveDataGet(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == I2C_SLAVE_BASE);

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

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美亚洲一区二区| 国产69精品久久99不卡| 欧美伦理影视网| 天天色综合天天| 国产欧美日韩一区二区三区在线观看| 欧美日本精品一区二区三区| 精品免费视频.| 久久午夜国产精品| 91精品福利在线一区二区三区| 国产无一区二区| 精品日韩在线观看| 欧美白人最猛性xxxxx69交| 亚洲综合久久av| 日韩经典一区二区| 日韩一区二区在线观看视频播放| 蜜桃91丨九色丨蝌蚪91桃色| 日韩欧美一级二级三级| 成人午夜精品在线| 亚洲女厕所小便bbb| 日韩一卡二卡三卡四卡| 国产精选一区二区三区| 中文字幕在线免费不卡| 欧美日韩国产高清一区| 国产精品一区二区三区99| 亚洲视频在线观看一区| 日本va欧美va精品发布| 在线观看视频一区二区欧美日韩| 日韩av中文在线观看| 久久精品亚洲精品国产欧美 | 国产喷白浆一区二区三区| 欧美挠脚心视频网站| 欧美一区二区日韩| 一区二区三区不卡视频 | 欧美性生活久久| 国产精品一区三区| 免费在线成人网| 久久国产精品99精品国产| 亚洲一区中文在线| 欧美日韩国产中文| 亚洲美女偷拍久久| 97久久超碰国产精品| 成人欧美一区二区三区| 精品国产一区二区三区忘忧草 | 午夜精品福利一区二区三区蜜桃| 日本成人在线一区| 国产成人午夜电影网| 91久久精品一区二区| 久久夜色精品一区| 久久电影网站中文字幕| 色综合天天综合网天天看片| 五月综合激情婷婷六月色窝| 欧美酷刑日本凌虐凌虐| 中文字幕一区二区三| 懂色av中文一区二区三区| 国产丝袜欧美中文另类| 亚洲国产精品一区二区www在线 | 91色.com| av在线一区二区| 久久只精品国产| 欧美日韩视频在线一区二区| 久久久91精品国产一区二区精品| 欧美曰成人黄网| 99re66热这里只有精品3直播| 亚洲激情校园春色| 色综合久久久久久久久久久| 怡红院av一区二区三区| 欧美日韩性生活| 精彩视频一区二区| 国产日产欧产精品推荐色| 99视频在线精品| 2023国产一二三区日本精品2022| 成人欧美一区二区三区白人| 欧美老女人在线| 老色鬼精品视频在线观看播放| 国产亚洲综合在线| 欧洲精品中文字幕| 国产在线观看免费一区| 亚洲高清视频在线| 国产精品天天摸av网| 欧美一区二区三区四区五区 | 久久久久久亚洲综合影院红桃| 亚洲一区二区欧美日韩| 91精品免费在线观看| 久久精品国产秦先生| 久久久噜噜噜久噜久久综合| 97久久超碰国产精品电影| 日韩一级片在线观看| 亚洲国产精品高清| 蜜桃视频免费观看一区| 欧美xxxxx牲另类人与| 亚洲激情综合网| 成人丝袜视频网| 欧美日韩国产电影| 美女久久久精品| 亚洲女人****多毛耸耸8| 欧美性受xxxx黑人xyx性爽| 美女任你摸久久| 亚洲在线视频免费观看| 国产亚洲精品久| 欧美一区二区视频在线观看2020| 99精品国产99久久久久久白柏| 午夜在线电影亚洲一区| 亚洲码国产岛国毛片在线| 久久夜色精品一区| 欧美成人精品二区三区99精品| 99久久综合精品| 不卡欧美aaaaa| 国产suv精品一区二区6| 国产一区二区三区视频在线播放| 亚洲国产一区二区三区青草影视| 一区二区三区欧美亚洲| 欧美老肥妇做.爰bbww| 亚洲综合免费观看高清完整版 | 狠狠久久亚洲欧美| 亚洲综合丁香婷婷六月香| 欧美一区二区三区爱爱| 日本午夜精品一区二区三区电影| 欧美v国产在线一区二区三区| 亚洲一区二区av电影| 国产日韩欧美a| 久久视频一区二区| 欧美裸体一区二区三区| 日韩国产精品久久| 亚洲午夜三级在线| 一区二区日韩电影| 亚洲一区二区三区四区在线观看| 国产精品免费网站在线观看| 久久久www免费人成精品| 久久久99精品免费观看| 国产女人水真多18毛片18精品视频 | 日韩 欧美一区二区三区| 日本aⅴ免费视频一区二区三区| 蜜臀91精品一区二区三区| 国产乱国产乱300精品| 91影视在线播放| 欧美一区二区三区婷婷月色| 日本一区二区三区久久久久久久久不 | 免费观看30秒视频久久| 国产一区激情在线| 欧美色精品在线视频| 精品国产百合女同互慰| 亚洲乱码国产乱码精品精98午夜 | 亚洲综合自拍偷拍| 九九精品一区二区| 欧美系列在线观看| 欧美激情一区二区三区四区 | 亚洲日韩欧美一区二区在线| 精品一区二区三区在线观看| 日本高清成人免费播放| 亚洲精品在线三区| 免费的成人av| 日本久久电影网| 国产精品妹子av| 国产电影一区在线| 精品国产免费视频| 日韩电影一区二区三区| 欧亚洲嫩模精品一区三区| 国产精品美女久久久久aⅴ国产馆| 精品综合免费视频观看| 日韩精品一区二区三区中文精品| 日韩精品国产精品| 欧美三级视频在线观看| 性欧美大战久久久久久久久| 欧美日韩免费一区二区三区 | 亚洲精品一区二区精华| 久久99精品久久久久久国产越南| 欧美一区二区三区四区五区 | 蜜桃在线一区二区三区| 欧美成人乱码一区二区三区| 久久精品国产免费看久久精品| 精品国产伦理网| 成人av综合在线| 亚洲精品成人悠悠色影视| 欧美日精品一区视频| 麻豆免费看一区二区三区| 国产视频在线观看一区二区三区 | 午夜久久久久久久久| 日韩亚洲欧美综合| av中文字幕一区| 男女男精品网站| 成人欧美一区二区三区| 6080日韩午夜伦伦午夜伦| 成人一区二区三区在线观看| 亚洲一区中文日韩| 日本一区二区综合亚洲| 欧美日本在线一区| 91在线无精精品入口| 久久久综合激的五月天| 99精品国产一区二区三区不卡| 三级欧美韩日大片在线看| 国产网红主播福利一区二区| 欧美日韩国产天堂| 99麻豆久久久国产精品免费优播| 免费观看一级欧美片| 亚洲大型综合色站| 一区二区三区四区精品在线视频 | 久久久久99精品国产片| 日韩欧美国产不卡| 亚洲二区视频在线| 久久人人爽爽爽人久久久|