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

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

?? 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:
//!

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产cao| 91福利视频在线| 日本韩国精品在线| 久久综合久久99| 一区二区三区不卡视频在线观看| 美女mm1313爽爽久久久蜜臀| 91丨porny丨在线| 久久精品一区八戒影视| 亚洲国产乱码最新视频| 成人动漫一区二区在线| 久久亚洲私人国产精品va媚药| 亚洲黄色性网站| 成人激情视频网站| 久久久91精品国产一区二区精品| 爽爽淫人综合网网站| 欧美中文字幕一二三区视频| 国产精品免费观看视频| 国产激情视频一区二区在线观看| 欧美大片一区二区| 三级欧美在线一区| 欧美精品久久久久久久久老牛影院| 亚洲精品国产精华液| 91在线无精精品入口| 国产精品久久久久久久久果冻传媒 | 国产免费久久精品| 老司机免费视频一区二区三区| 色素色在线综合| 亚洲男同性恋视频| 欧美主播一区二区三区| 亚洲一区二区视频在线观看| 色94色欧美sute亚洲线路二| 综合激情成人伊人| 91丨国产丨九色丨pron| 亚洲欧美日韩在线不卡| 91国产成人在线| 亚洲高清不卡在线观看| 91精品国产欧美一区二区成人| 日韩精品一卡二卡三卡四卡无卡| 91精品国产综合久久香蕉麻豆| 日本一道高清亚洲日美韩| 欧美电影免费观看完整版| 韩国欧美国产1区| 国产精品五月天| 91视频观看视频| 亚洲综合另类小说| 日韩欧美中文一区| 国产一区二区在线电影| 国产欧美一区二区三区在线看蜜臀| 国产91丝袜在线播放| 亚洲欧美日韩系列| 91精品在线麻豆| 国产99久久精品| 亚洲男同性恋视频| 日韩美女在线视频| eeuss影院一区二区三区| 亚洲免费观看视频| 日韩一级片网站| 99麻豆久久久国产精品免费优播| 亚洲卡通欧美制服中文| 欧美一卡在线观看| 成人av电影免费观看| 午夜不卡在线视频| 日本一区二区三区高清不卡| 欧美自拍偷拍午夜视频| 韩国精品主播一区二区在线观看 | 成人污视频在线观看| 一区二区视频在线看| 91麻豆精品国产91久久久久久久久| 精品中文av资源站在线观看| 亚洲精品中文在线| 精品欧美一区二区三区精品久久| 99久久久国产精品免费蜜臀| 美洲天堂一区二卡三卡四卡视频| 国产精品传媒在线| 日韩免费电影网站| 精品视频免费在线| 成人黄色免费短视频| 日日欢夜夜爽一区| 综合久久国产九一剧情麻豆| 精品入口麻豆88视频| 色吊一区二区三区| 成人av电影观看| 久久精品国产99国产| 亚洲国产综合色| 亚洲色欲色欲www| 国产网站一区二区| 欧美一区三区四区| 欧美色综合天天久久综合精品| 成人免费视频国产在线观看| 久久国产人妖系列| 天天综合日日夜夜精品| 一区二区三区在线观看欧美| 中文字幕不卡的av| 亚洲精品一区二区在线观看| 欧美一区二区三区在线观看| 91久久人澡人人添人人爽欧美 | 在线观看视频91| 高清beeg欧美| 国产精品亚洲专一区二区三区| 日本女人一区二区三区| 一个色综合av| 亚洲精品水蜜桃| 亚洲私人影院在线观看| 最新不卡av在线| 综合激情成人伊人| 亚洲欧美一区二区视频| 国产精品色眯眯| 国产精品欧美精品| 国产欧美1区2区3区| 国产欧美日韩三级| 国产精品久久久久一区| 国产精品美女www爽爽爽| 国产校园另类小说区| 国产网站一区二区| 国产精品免费视频网站| 亚洲欧洲成人自拍| 亚洲综合一区在线| 首页综合国产亚洲丝袜| 午夜精品一区在线观看| 偷拍与自拍一区| 毛片av中文字幕一区二区| 久久精品国产精品青草| 国产福利电影一区二区三区| 国产精品亚洲一区二区三区在线| 丁香六月久久综合狠狠色| 成人av午夜电影| 欧美性猛交xxxx乱大交退制版 | 色婷婷综合久久久中文字幕| 97se亚洲国产综合自在线不卡| 91成人国产精品| 91精品国产综合久久久久久久久久 | 欧美日韩在线亚洲一区蜜芽| 欧美日韩一级黄| 精品国产一区久久| 亚洲欧洲日韩综合一区二区| 一区二区三区欧美视频| 日韩专区中文字幕一区二区| 精品无码三级在线观看视频| 成人黄色av网站在线| 欧美日免费三级在线| 日韩美女主播在线视频一区二区三区| 精品久久久三级丝袜| 自拍偷拍国产亚洲| 日本怡春院一区二区| 成人黄页毛片网站| 在线成人av影院| 欧美高清一级片在线观看| 一区二区三区在线视频免费观看 | 日韩亚洲欧美中文三级| 久久男人中文字幕资源站| 亚洲欧美国产高清| 国产制服丝袜一区| 在线视频中文字幕一区二区| 精品久久久久久久人人人人传媒| 国产欧美精品区一区二区三区| 亚洲国产精品天堂| 成人99免费视频| 欧美电视剧在线观看完整版| 亚洲欧美国产三级| 国产精品乡下勾搭老头1| 欧美午夜影院一区| 国产欧美一区视频| 看片的网站亚洲| 91国偷自产一区二区使用方法| 久久久国产午夜精品| 日韩高清在线电影| 欧美制服丝袜第一页| 久久久久久久久久久久电影 | 国产成人亚洲综合色影视| 欧美日韩一区三区| 亚洲欧美视频一区| 成人亚洲一区二区一| 精品少妇一区二区三区在线播放| 亚洲欧美日本韩国| 国产寡妇亲子伦一区二区| 日韩美女主播在线视频一区二区三区| 亚洲影视资源网| 色婷婷综合久色| 亚洲色图欧美偷拍| 成人三级伦理片| 国产亚洲精品中文字幕| 韩国三级在线一区| 精品日韩在线观看| 老司机免费视频一区二区三区| 欧美放荡的少妇| 亚洲一区二区三区四区在线免费观看 | 精品视频免费看| 亚洲综合激情小说| 91搞黄在线观看| 亚洲综合色婷婷| 91福利国产成人精品照片| 亚洲欧美色图小说| 99精品久久免费看蜜臀剧情介绍| 中文久久乱码一区二区| 国产精品一级在线| 国产精品污www在线观看| 国产不卡免费视频| 国产精品理论片| 91蜜桃传媒精品久久久一区二区| 亚洲色图另类专区|