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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? can.c

?? iar 安裝使用的方法。其中包括一些工程模板
?? C
?? 第 1 頁 / 共 5 頁
字號:
    //
    // Disable the CAN interrupt.
    //
    IntDisable(ulIntNumber);
}

//*****************************************************************************
//
//! Enables individual CAN controller interrupt sources.
//!
//! \param ulBase is the base address of the CAN controller.
//! \param ulIntFlags is the bit mask of the interrupt sources to be enabled.
//!
//! Enables specific interrupt sources of the CAN controller.  Only enabled
//! sources will cause a processor interrupt.
//!
//! The \e ulIntFlags parameter is the logical OR of any of the following:
//!
//! - \b CAN_INT_ERROR - a controller error condition has occurred
//! - \b CAN_INT_STATUS - a message transfer has completed, or a bus error has
//! been detected
//! - \b CAN_INT_MASTER - allow CAN controller to generate interrupts
//!
//! In order to generate any interrupts, \b CAN_INT_MASTER must be enabled.
//! Further, for any particular transaction from a message object to generate
//! an interrupt, that message object must have interrupts enabled (see
//! CANMessageSet()).  \b CAN_INT_ERROR will generate an interrupt if the
//! controller enters the ``bus off'' condition, or if the error counters reach
//! a limit.  \b CAN_INT_STATUS will generate an interrupt under quite a few
//! status conditions and may provide more interrupts than the application
//! needs to handle.  When an interrupt occurs, use CANIntStatus() to determine
//! the cause.
//!
//! \return None.
//
//*****************************************************************************
void
CANIntEnable(unsigned long ulBase, unsigned long ulIntFlags)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == CAN0_BASE) ||
           (ulBase == CAN1_BASE) ||
           (ulBase == CAN2_BASE));
    ASSERT((ulIntFlags & ~(CAN_CTL_EIE | CAN_CTL_SIE | CAN_CTL_IE)) == 0);

    //
    // Enable the specified interrupts.
    //
    CANRegWrite(ulBase + CAN_O_CTL,
                CANRegRead(ulBase + CAN_O_CTL) | ulIntFlags);
}

//*****************************************************************************
//
//! Disables individual CAN controller interrupt sources.
//!
//! \param ulBase is the base address of the CAN controller.
//! \param ulIntFlags is the bit mask of the interrupt sources to be disabled.
//!
//! Disables the specified CAN controller interrupt sources.  Only enabled
//! interrupt sources can cause a processor interrupt.
//!
//! The \e ulIntFlags parameter has the same definition as in the
//! CANIntEnable() function.
//!
//! \return None.
//
//*****************************************************************************
void
CANIntDisable(unsigned long ulBase, unsigned long ulIntFlags)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == CAN0_BASE) ||
           (ulBase == CAN1_BASE) ||
           (ulBase == CAN2_BASE));
    ASSERT((ulIntFlags & ~(CAN_CTL_EIE | CAN_CTL_SIE | CAN_CTL_IE)) == 0);

    //
    // Disable the specified interrupts.
    //
    CANRegWrite(ulBase + CAN_O_CTL,
                CANRegRead(ulBase + CAN_O_CTL) & ~(ulIntFlags));
}

//*****************************************************************************
//
//! Returns the current CAN controller interrupt status.
//!
//! \param ulBase is the base address of the CAN controller.
//! \param eIntStsReg indicates which interrupt status register to read
//!
//! Returns the value of one of two interrupt status registers.  The interrupt
//! status register read is determined by the \e eIntStsReg parameter, which
//! can have one of the following values:
//!
//! - \b CAN_INT_STS_CAUSE - indicates the cause of the interrupt
//! - \b CAN_INT_STS_OBJECT - indicates pending interrupts of all message
//! objects
//!
//! \b CAN_INT_STS_CAUSE returns the value of the controller interrupt register
//! and indicates the cause of the interrupt.  It will be a value of
//! \b CAN_INT_INTID_STATUS if the cause is a status interrupt.  In this case,
//! the status register should be read with the CANStatusGet() function.
//! Calling this function to read the status will also clear the status
//! interrupt.  If the value of the interrupt register is in the range 1-32,
//! then this indicates the number of the highest priority message object that
//! has an interrupt pending.  The message object interrupt can be cleared by
//! using the CANIntClear() function, or by reading the message using
//! CANMessageGet() in the case of a received message.  The interrupt handler
//! can read the interrupt status again to make sure all pending interrupts are
//! cleared before returning from the interrupt.
//!
//! \b CAN_INT_STS_OBJECT returns a bit mask indicating which message objects
//! have pending interrupts.  This can be used to discover all of the pending
//! interrupts at once, as opposed to repeatedly reading the interrupt register
//! by using \b CAN_INT_STS_CAUSE.
//!
//! \return Returns the value of one of the interrupt status registers.
//
//*****************************************************************************
unsigned long
CANIntStatus(unsigned long ulBase, tCANIntStsReg eIntStsReg)
{
    unsigned long ulStatus;

    //
    // Check the arguments.
    //
    ASSERT((ulBase == CAN0_BASE) ||
           (ulBase == CAN1_BASE) ||
           (ulBase == CAN2_BASE));

    //
    // See which status the caller is looking for.
    //
    switch(eIntStsReg)
    {
        //
        // The caller wants the global interrupt status for the CAN controller
        // specified by ulBase.
        //
        case CAN_INT_STS_CAUSE:
        {
            ulStatus = CANRegRead(ulBase + CAN_O_INT);
            break;
        }

        //
        // The caller wants the current message status interrupt for all
        // messages.
        //
        case CAN_INT_STS_OBJECT:
        {
            //
            // Read and combine both 16 bit values into one 32bit status.
            //
            ulStatus = (CANRegRead(ulBase + CAN_O_MSG1INT) &
                        CAN_MSG1INT_INTPND_M);
            ulStatus |= (CANRegRead(ulBase + CAN_O_MSG2INT) << 16);
            break;
        }

        //
        // Request was for unknown status so just return 0.
        //
        default:
        {
            ulStatus = 0;
            break;
        }
    }
    //
    // Return the interrupt status value
    //
    return(ulStatus);
}

//*****************************************************************************
//
//! Clears a CAN interrupt source.
//!
//! \param ulBase is the base address of the CAN controller.
//! \param ulIntClr is a value indicating which interrupt source to clear.
//!
//! This function can be used to clear a specific interrupt source.  The
//! \e ulIntClr parameter should be one of the following values:
//!
//! - \b CAN_INT_INTID_STATUS - Clears a status interrupt.
//! - 1-32 - Clears the specified message object interrupt
//!
//! It is not necessary to use this function to clear an interrupt.  This
//! should only be used if the application wants to clear an interrupt source
//! without taking the normal interrupt action.
//!
//! Normally, the status interrupt is cleared by reading the controller status
//! using CANStatusGet().  A specific message object interrupt is normally
//! cleared by reading the message object using CANMessageGet().
//!
//! \note Since there is a write buffer in the Cortex-M3 processor, it may take
//! several clock cycles before the interrupt source is actually cleared.
//! Therefore, it is recommended that the interrupt source be cleared early in
//! the interrupt handler (as opposed to the very last action) to avoid
//! returning from the interrupt handler before the interrupt source is
//! actually cleared.  Failure to do so may result in the interrupt handler
//! being immediately reentered (since NVIC still sees the interrupt source
//! asserted).
//!
//! \return None.
//
//*****************************************************************************
void
CANIntClear(unsigned long ulBase, unsigned long ulIntClr)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == CAN0_BASE) ||
           (ulBase == CAN1_BASE) ||
           (ulBase == CAN2_BASE));
    ASSERT((ulIntClr == CAN_INT_INTID_STATUS) ||
           ((ulIntClr>=1) && (ulIntClr <=32)));

    if(ulIntClr == CAN_INT_INTID_STATUS)
    {
        //
        // Simply read and discard the status to clear the interrupt.
        //
        CANRegRead(ulBase + CAN_O_STS);
    }
    else
    {
        //
        // Wait to be sure that this interface is not busy.
        //
        while(CANRegRead(ulBase + CAN_O_IF1CRQ) & CAN_IF1CRQ_BUSY)
        {
        }

        //
        // Only change the interrupt pending state by setting only the
        // CAN_IF1CMSK_CLRINTPND bit.
        //
        CANRegWrite(ulBase + CAN_O_IF1CMSK, CAN_IF1CMSK_CLRINTPND);

        //
        // Send the clear pending interrupt command to the CAN controller.
        //
        CANRegWrite(ulBase + CAN_O_IF1CRQ, ulIntClr & CAN_IF1CRQ_MNUM_M);

        //
        // Wait to be sure that this interface is not busy.
        //
        while(CANRegRead(ulBase + CAN_O_IF1CRQ) & CAN_IF1CRQ_BUSY)
        {
        }
    }
}

//*****************************************************************************
//
//! Sets the CAN controller automatic retransmission behavior.
//!
//! \param ulBase is the base address of the CAN controller.
//! \param bAutoRetry enables automatic retransmission.
//!
//! Enables or disables automatic retransmission of messages with detected
//! errors.  If \e bAutoRetry is \b true, then automatic retransmission is
//! enabled, otherwise it is disabled.
//!
//! \return None.
//
//*****************************************************************************
void
CANRetrySet(unsigned long ulBase, tBoolean bAutoRetry)
{
    unsigned long ulCtlReg;

    //
    // Check the arguments.
    //
    ASSERT((ulBase == CAN0_BASE) ||
           (ulBase == CAN1_BASE) ||
           (ulBase == CAN2_BASE));

    ulCtlReg = CANRegRead(ulBase + CAN_O_CTL);

    //
    // Conditionally set the DAR bit to enable/disable auto-retry.
    //
    if(bAutoRetry)
    {
        //
        // Clearing the DAR bit tells the controller to not disable the
        // auto-retry of messages which were not transmited or received
        // correctly.
        //
        ulCtlReg &= ~CAN_CTL_DAR;
    }
    else
    {
        //
        // Setting the DAR bit tells the controller to disable the auto-retry
        // of messages which were not transmited or received correctly.
        //
        ulCtlReg |= CAN_CTL_DAR;
    }

    CANRegWrite(ulBase + CAN_O_CTL, ulCtlReg);
}

//*****************************************************************************
//
//! Returns the current setting for automatic retransmission.
//!
//! \param ulBase is the base address of the CAN controller.
//!
//! Reads the current setting for the automatic retransmission in the CAN
//! controller and returns it to the caller.
//!
//! \return Returns \b true if automatic retransmission is enabled, \b false
//! otherwise.
//
//*****************************************************************************
tBoolean
CANRetryGet(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT((ulBase == CAN0_BASE) ||
           (ulBase == CAN1_BASE) ||
           (ulBase == CAN2_BASE));

    //
    // Read the disable automatic retry setting from the CAN controller.
    //
    if(CANRegRead(ulBase + CAN_O_CTL) & CAN_CTL_DAR)
    {
        //
        // Automatic data retransmission is not enabled.
        //
        return(false);
    }

    //
    // Automatic data retransmission is enabled.
    //
    return(true);
}

//*****************************************************************************
//
//! Reads one of the controller status registers.
//!
//! \param ulBase is the base address of the CAN controller.
//! \param eStatusReg is the status register to read.
//!
//! Reads a status register of the CAN controller and returns it to the caller.
//! The different status registers are:
//!
//! - \b CAN_STS_CONTROL - the main controller status
//! - \b CAN_STS_TXREQUEST - bit mask of objects pending transmission
//! - \b CAN_STS_NEWDAT - bit mask of objects with new data
//! - \b CAN_STS_MSGVAL - bit mask of objects with valid configuration
//!
//! When reading the main controller status register, a pending status
//! interrupt will be cleared.  This should be used in the interrupt handler
//! for the CAN controller if the cause is a status interrupt.  The controller
//! status register fields are as follows:
//!
//! - \b CAN_STATUS_BUS_OFF - controller is in bus-off condition
//! - \b CAN_STATUS_EWARN - an error counter has reached a limit of at least 96
//! - \b CAN_STATUS_EPASS - CAN controller is in the error passive state
//! - \b CAN_STATUS_RXOK - a message was received successfully (independent of
//! any message filtering).
//! - \b CAN_STATUS_TXOK - a message was successfully transmitted
//! - \b CAN_STATUS_LEC_MSK - mask of last error code bits (3 bits)
//! - \b CAN_STATUS_LEC_NONE - no error
//! - \b CAN_STATUS_LEC_STUFF - stuffing error detected
//! - \b CAN_STATUS_LEC_FORM - a format error occurred in the fixed format part
//! of a message
//! - \b CAN_STATUS_LEC_ACK - a transmitted message was not acknowledged
//! - \b CAN_STATUS_LEC_BIT1 - dominant level detected when trying to send in
//! recessive mode
//! - \b CAN_STATUS_LEC_BIT0 - recessive level detected when trying to send in
//! dominant mode
//! - \b CAN_STATUS_LEC_CRC - CRC error in received message
//!
//! The remaining status registers are 32-bit bit maps to the message objects.
//! They can be used to quickly obtain information about the status of all the
//! message objects without needing to query each one.  They contain the
//! following information:
//!

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
青青草原综合久久大伊人精品 | 日韩一区二区高清| 久久无码av三级| 亚洲线精品一区二区三区| 激情综合色丁香一区二区| 在线观看亚洲精品视频| 欧美国产精品v| 久久国产精品无码网站| 欧美三区在线视频| 中文字幕一区免费在线观看| 麻豆国产精品视频| 欧美日韩三级一区| 国产农村妇女毛片精品久久麻豆| 日本在线不卡视频| 在线一区二区三区四区五区| 国产精品三级电影| 国产一区不卡精品| 日韩欧美国产三级| 亚洲精品成人少妇| av在线播放不卡| 欧美激情一区二区三区全黄| 精品一区二区影视| 欧美人牲a欧美精品| 亚洲三级久久久| av中文字幕不卡| 国产精品久久久一本精品 | 一区二区成人在线观看| 豆国产96在线|亚洲| 精品成a人在线观看| 久久精品国产免费看久久精品| 884aa四虎影成人精品一区| 亚洲激情自拍视频| 日本福利一区二区| 亚洲午夜一区二区| 在线观看一区二区视频| 亚洲色图视频网| 91麻豆6部合集magnet| 国产精品欧美精品| www.亚洲色图.com| 国产精品高潮呻吟| 99精品国产视频| 亚洲精品视频在线| 成人动漫一区二区三区| 亚洲欧美中日韩| 国产成人av资源| 国产精品传媒入口麻豆| 成人国产精品免费观看视频| 一区精品在线播放| 色综合久久88色综合天天| 亚洲色欲色欲www在线观看| 91美女在线视频| 亚洲久本草在线中文字幕| 欧美视频精品在线观看| 午夜视频久久久久久| 欧美日韩一本到| 偷拍与自拍一区| 精品捆绑美女sm三区| 日韩制服丝袜先锋影音| 日韩欧美亚洲另类制服综合在线| 精品一区二区三区蜜桃| 国产精品亲子伦对白| 日本福利一区二区| 蜜臀久久久久久久| 欧美日韩免费观看一区二区三区| 五月天欧美精品| 精品av久久707| av影院午夜一区| 日本亚洲一区二区| 欧美tk—视频vk| av亚洲产国偷v产偷v自拍| 亚洲国产视频直播| 精品免费日韩av| 99re成人在线| 日本美女视频一区二区| 国产精品三级av| 欧美一区二区视频在线观看2020| 国产一区二区日韩精品| 亚洲色图第一区| 欧美一区二区三区电影| 国产成人av一区二区三区在线| 亚洲美女屁股眼交| 欧美xxxxxxxx| 色综合久久88色综合天天| 精品影视av免费| 亚洲国产毛片aaaaa无费看 | 亚洲国产精品精华液网站| 亚洲免费高清视频在线| 91精品国产欧美一区二区18| 成人午夜激情在线| 日本伊人精品一区二区三区观看方式 | 欧美国产日本韩| 欧美人妇做爰xxxⅹ性高电影| 国产电影一区在线| 一区二区三区在线观看动漫| 欧美va在线播放| 欧美高清激情brazzers| bt7086福利一区国产| 麻豆91在线观看| 一区二区在线免费| 欧美激情一区二区三区蜜桃视频| 91亚洲资源网| 国产成a人亚洲精品| 青青青伊人色综合久久| 夜色激情一区二区| 中文字幕不卡三区| 日韩精品一区二区三区中文不卡 | 日韩欧美区一区二| 91丨九色丨黑人外教| 国产久卡久卡久卡久卡视频精品| 亚洲午夜视频在线| 国产欧美精品一区aⅴ影院| 51精品秘密在线观看| 在线观看日韩国产| 99精品在线免费| 成人黄色在线网站| 国内一区二区视频| 精品一区二区三区欧美| 视频一区欧美精品| 亚洲电影在线播放| 国产精品午夜春色av| 国产女人18毛片水真多成人如厕 | 国产精品18久久久久久久网站| 亚洲综合色婷婷| 一区二区三区四区不卡视频| 国产精品久久久久久久岛一牛影视| 久久精品日韩一区二区三区| 精品播放一区二区| 久久亚洲精精品中文字幕早川悠里| 精品少妇一区二区三区免费观看 | av中文字幕在线不卡| 成人国产精品免费网站| 成人国产精品免费网站| 99免费精品视频| 欧美日韩一二区| 国产精品1024| 成人aa视频在线观看| 91麻豆高清视频| 欧美视频第二页| 精品国产乱码久久久久久免费| 久久久另类综合| 亚洲色图20p| 日本美女一区二区三区视频| 国产成人免费在线| 日本黄色一区二区| 日韩免费在线观看| **欧美大码日韩| 奇米色一区二区| 成人a级免费电影| 91精品国产综合久久小美女| 久久九九久久九九| 亚洲线精品一区二区三区八戒| 久久成人精品无人区| 色综合夜色一区| 日韩欧美国产小视频| 综合av第一页| 理论电影国产精品| 色婷婷av久久久久久久| 日韩欧美色电影| 亚洲精品国产视频| 国内精品伊人久久久久av影院| 色综合婷婷久久| 精品国产1区二区| 亚洲成人一二三| 国产69精品久久777的优势| 在线不卡a资源高清| 亚洲视频 欧洲视频| 国内精品视频一区二区三区八戒| 色婷婷综合久久久久中文| 久久日一线二线三线suv| 亚洲一区二区黄色| 成人晚上爱看视频| 欧美二区乱c少妇| 亚洲欧美日韩国产综合| 激情综合色丁香一区二区| 欧美日韩一区二区三区在线| 久久精品夜夜夜夜久久| 视频精品一区二区| 91性感美女视频| 欧美国产禁国产网站cc| 精品伊人久久久久7777人| 欧美精品日韩一本| 亚洲欧美另类小说| 国产69精品久久久久毛片| 精品福利一二区| 日本网站在线观看一区二区三区| 欧洲av在线精品| 亚洲乱码精品一二三四区日韩在线| 国产乱码一区二区三区| 日韩三级视频在线看| 亚洲第一主播视频| 欧美日韩色一区| 亚洲高清免费视频| 欧美天天综合网| 亚洲国产精品久久不卡毛片| 欧美体内she精视频| 亚洲一区在线视频| 欧美专区亚洲专区| 一区二区三区在线免费观看| 91黄色免费观看| 亚洲一区二区欧美日韩|