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

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

?? can_api.c

?? cpc-1631的BSP包for VxWorks操作系統
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* can_api.c - WIND NET CAN API Library */

/* Copyright 1984-2001 Wind River Systems, Inc. */
#include "copyright_wrs.h"

/*
modification history
--------------------
01, 18Dec01, jac created
02, 7Jul02,  lsg modified
03, 20Aug02, lsg changed resulting from api review
*/

/*
DESCRIPTION

This library defines the WIND NET CAN API, an interface for
implementations of CAN communications.

MACRO USE

For normal use, these routines are replaced by equivalent macro
definitions in CAN/wnCAN.h. To avoid namespace collisions in your
application code, or to implement a custom naming convention, you can
redefine the macro names. To dispense with the macro definitions and
use the function calls defined in this file, manually set the #define
USE_CAN_FUNCTION_DEFS in the header file CAN/wncan_api.h, then
recompile the CAN library with the make utility.


INCLUDE FILES

CAN/wnCAN.h
CAN/canBoard.h

*/

/* includes */
#include <vxWorks.h>
#include <errnoLib.h>
#include <stdlib.h>
#include <string.h>
#include <CAN/wnCAN.h>
#include <CAN/canBoard.h>
#include <CAN/canController.h>

#ifdef USE_CAN_FUNCTION_DEFS

/* subroutines */
/************************************************************************
* CAN_Open - get a handle to the requested WNCAN_DEVICE
*
* This is the first routine called. This routine establishes links to the
* CAN controller specific API implementation. The CAN API cannot be
* accessed before the device pointer has been correctly initialized
* by this routine.
*
* RETURNS: Pointer to valid WNCAN_DEVICE, or 0 if an error occurred.
*
* ERRNO: S_can_unknown_board, S_can_illegal_board_no,
* S_can_illegal_ctrl_no, S_can_busy
*
*/
struct WNCAN_Device *CAN_Open
    (
    unsigned int brdType,   /* board type       */
    unsigned int brdNdx,    /* board index      */
    unsigned int ctrlNdx    /* controller index */
    )
    {
        return  WNCAN_Open(brdType, brdNdx, ctrlNdx);
    }

/************************************************************************
* CAN_Close - close the handle to the requested WNCAN_DEVICE
*
* This routine deallocates the device struct that is passed in. The
* links to the CAN controller's API implementations do not exist after
* CAN_Close() is called.
*
* RETURNS: N/A
*
* ERRNO: N/A
*
*
*/

void CAN_Close
    (
    struct WNCAN_Device *pDev   /* CAN device pointer */
    )
    {
        WNCAN_Close(pDev);
    }

/***************************************************************************
* CAN_GetMode - get the current mode of the channel
*
* This routine returns the mode of the channel:
* WNCAN_CHN_TRANSMIT, WNCAN_CHN_RECEIVE, WNCAN_CHN_INACTIVE, or
* WNCAN_CHN_INVALID. For advanced controllers, two additional modes exist:
* WNCAN_CHN_RTR_REQUESTER, or WNCAN_CHN_RTR_RESPONDER.
*
* The mode of the channel is relevant in software only, and is indirectly
* related to the hardware capability (transmit, receive or both) of a channel.
*
* \ts
* Mode           | Function
* ---------------+--------------------
* 'TRANSMIT'     | Transmits data frames. In case of simple controllers, this mode can transmit a remote frame by calling CAN_SetRTR().
* 'RECEIVE'      | Receives data frames. In case of simple controllers can receive remote frames as well.
* 'INVALID'      | Channel is available to the CAN driver, but is free and has not been assigned a mode.
* 'INACTIVE'     | Channel is unavailable to the CAN driver.
* 'RTR_REQUESTER'| Valid only for advanced controllers. Channel is set up to send out a remote request and receives the response to the remote frame in the same hardware channel.
* 'RTR_RESPONDER'| Valid only for advanced controllers. Channel is set up to respond to an incoming remote request with the same identifier. On receiving such a frame, the response will be sent out automatically.
* \te
*
* Note, if the channel has not been allocated by a previous call to
* CAN_SetMode(), CAN_GetTxChannel(), CAN_GetRxChannel(),
* CAN_GetRTRResponderChannel() or CAN_GetRTRRequesterChannel(),
* the return value will be WNCAN_CHN_INVALID even though the channel
* number is within the range of channels available on the
* controller.
*
* RETURNS: The channel mode.
*
* ERRNO: N/A
*/
WNCAN_ChannelMode CAN_GetMode
    (
    struct WNCAN_Device *pDev, /* CAN Device pointer */
    UCHAR                chn   /* device channel */
    )
    {
       return(WNCAN_GetMode(pDev, chn));
    }

/***************************************************************************
* CAN_SetMode - set the mode of the channel
*
* This routine sets the mode of the channel to one of five values:
* WNCAN_CHN_TRANSMIT, WNCAN_CHN_RECEIVE, WNCAN_CHN_INACTIVE,
* WNCAN_CHN_RTR_REQUESTER, or WNCAN_CHN_RTR_RESPONDER.
* WNCAN_CHN_RTR_REQUESTER and WNCAN_CHN_RTR_RESPONDER are used for
* advanced controllers. All available channels can be configured to be
* WNCAN_CHN_INACTIVE. The channels available for transmitting or receiving
* messages are determined by the device hardware, and therefore, may or may
* not be configurable with this function call. If an attempt is made to set
* the mode of a channel to WNCAN_CHN_RTR_RESPONDER or WNCAN_CHN_RTR_REQUESTER
* for a simple CAN controller such as SJA1000, WNCAN_CHN_INVALID is returned
* and an errno is set to reflect the error. The preferred approach is to
* allow the device driver to manage the channels internally using the
* CAN_GetTxChannel(), CAN_GetRxChannel(), CAN_GetRTRRequesterChannel(),
* CAN_GetRTRResponderChannel() and CAN_FreeChannel() function calls.
*
* RETURNS: 'OK', or 'ERROR' if the requested channel number is out of range.
*
* ERRNO: S_can_illegal_channel_no
*/
STATUS CAN_SetMode
    (
    struct WNCAN_Device *pDev,       /* CAN device pointer */
    UCHAR                channelNum, /* channel number */
    WNCAN_ChannelMode    mode        /* channel mode */
    )
    {
       return(WNCAN_SetMode(pDev,channelNum,mode));
    }


/***************************************************************************
* CAN_GetBusStatus - get the status of the CAN bus
*
* This routine returns the status of the CAN bus. The bus is
* either in a WNCAN_BUS_OFF, WNCAN_BUS_WARN, or WNCAN_BUS_OK state.
*
* \is
* \i WNCAN_BUS_OFF:
* CAN controller is in BUS OFF state. A CAN node is bus off when the
* transmit error count is greater than or equal to 256.
*
* \i WNCAN_BUS_WARN:
* CAN controller is in ERROR PASSIVE state. A CAN node is in error warning
* state when the number of transmit errors equals or exceeds 128, or the
* number of receive errors equals or exceeds 128.
*
* \i WNCAN_BUS_OK:
* CAN controller is in ERROR ACTIVE state. A CAN node in error active state
* can normally take part in bus communication and sends an ACTIVE ERROR FLAG
* when an error has been detected.
* \ie
*
* RETURNS: The status of the CAN bus.
*
* ERRNO:   N/A
*/
WNCAN_BusStatus CAN_GetBusStatus
    (
    struct WNCAN_Device *pDev  /* CAN Device pointer */
    )
    {
       return (pDev->GetBusStatus(pDev));
    }

/***************************************************************************
* CAN_GetBusError - get the bus errors
*
* This routine returns an \'OR\'ed bit mask of all the bus errors that have
* occurred during the last bus activity.
*
* Bus errors returned by this routine can have the following values:
*
* \ml
* \m -
* WNCAN_ERR_NONE: No errors detected.
* \m -
* WNCAN_ERR_BIT: Bit error.
* \m -
* WNCAN_ERR_ACK: Acknowledgement error.
* \m -
* WNCAN_ERR_CRC: CRC error.
* \m -
* WNCAN_ERR_FORM: Form error.
* \m -
* WNCAN_ERR_STUFF: Stuff error.
* \m -
* WNCAN_ERR_UNKNOWN: Unable to determine cause of error.
* \me
*
*
* The five errors are not mutually exclusive. The occurrence of an error
* will be indicated by an interrupt. Typically, this routine will be called
* from the error interrupt handling case in the user's ISR callback function,
* to find out the kind of error that occurred on the bus.
*
* RETURNS: An \'OR\'ed bit mask of all the bus errors.
*
* ERRNO: S_can_Unknown_error
*/
WNCAN_BusError CAN_GetBusError
    (
    struct WNCAN_Device *pDev  /* CAN Device pointer */
    )
    {
       return(pDev->GetBusError(pDev));
    }

/***************************************************************************
* CAN_Init - initialize the CAN device controller
*
* This routine initializes the CAN controller and makes default selections.
*
* \ml
* \m 1.
* Puts the CAN controller into debug mode.
* \m 2.
* Disables interrupts at the CAN controller level as well as channel.
* \m 3.
* Sets bit timing values according to values stored in the CAN controller
* struct. Unless the user has changed these values before CAN_Init() is called,
* the default bit timing values are set to a baud rate of 250K.
* \m 4.
* Clears error counters.
* \m 5.
* Sets local and global receive masks to don't care (accept all).
* \m 6.
* Makes all channels inactive in hardware.
* \m 7.
* Other controller specific initializations.
* \m 8.
* On exiting the CAN_Init() routine, the CAN controller has been initialized,
* but is offline and unable to participate in CAN bus communication.
* \me
*
*
* CAN_Open() is called to obtain a valid device pointer. Subsequently,
* CAN_Init() and CAN_Open() are called to initialize the controller, bring
* it online, and enable active participation in CAN bus activity.
*
* RETURNS: 'OK'.
*
* ERRNO:   N/A
*/
STATUS CAN_Init
    (
    struct WNCAN_Device *pDev  /* CAN Device pointer */
    )
    {
       return(pDev->Init(pDev));
    }

/***************************************************************************
* CAN_Start - bring the CAN controller online
*
* This routine is called to bring the CAN controller online. The CAN
* controller can now participate in transmissions and receptions on the CAN
* bus. This routine must be called after CAN_Init() has been called to
* initialize and bring the CAN controller up in a known state. This routine
* negates the INIT/HALT (offline) bit.
*
* RETURNS: 'OK'.
*
*/
void CAN_Start
    (
    struct WNCAN_Device *pDev  /* CAN Device pointer */
    )
    {
       return(pDev->Start(pDev));
    }

/***************************************************************************
* CAN_Stop - put the CAN controller offline
*
* This routine disables communication between the CAN controller and the
* CAN bus.
*
* RETURNS: 'OK'.
*
* ERRNO: N/A
*
*/
void CAN_Stop
    (
    struct WNCAN_Device *pDev  /* CAN Device pointer */
    )
    {
       return(pDev->Stop(pDev));
    }

/***************************************************************************
* CAN_SetBitTiming - set the bit timing parameters of the controller
*
* This routine sets the baud rate and sample point of the controller. The
* values of the input parameters should be based on an established set of
* recommendations.
*
* This routine sets the bit timing values in the hardware as well as the
* controller structure, so that the bit timing values are not lost if
* CAN_Init() is called again.
*
* The routine will preserve the state of the CAN controller.
* For example, if the CAN controller is online when the routine

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产综合一区二区三区 | 亚洲一区二区在线视频| 日本一区二区三区电影| 中文字幕在线观看不卡视频| 亚洲综合男人的天堂| 蜜臀久久久久久久| 成人激情小说网站| 欧美视频在线播放| 欧美大片在线观看| 国产欧美日韩激情| 日韩精品视频网| 成人高清av在线| 欧美制服丝袜第一页| 久久这里都是精品| 亚洲福中文字幕伊人影院| 国产精品综合一区二区三区| 91黄色免费版| 国产女同互慰高潮91漫画| 亚洲国产日日夜夜| 国产东北露脸精品视频| 欧美在线高清视频| 国产三级精品视频| 日韩av高清在线观看| 波波电影院一区二区三区| 欧美一级黄色大片| 亚洲欧美色图小说| 国产精品中文有码| 宅男在线国产精品| 亚洲午夜影视影院在线观看| 国产寡妇亲子伦一区二区| 在线视频国产一区| 国产日韩精品一区二区浪潮av| 亚洲bt欧美bt精品| 国产精品18久久久久久久网站| 欧美男同性恋视频网站| 亚洲免费在线观看视频| 国产福利一区二区三区视频| 91精品国产高清一区二区三区蜜臀| 国产精品激情偷乱一区二区∴| 成人一级片在线观看| 精品国产欧美一区二区| 免费观看在线综合色| 欧美人牲a欧美精品| 亚洲欧洲制服丝袜| 成人app网站| 日本一区二区视频在线| 国内成人精品2018免费看| 欧美高清视频一二三区| 亚洲一区二区中文在线| 欧美色倩网站大全免费| 亚洲视频一二三| 91网站黄www| 国产精品国产三级国产aⅴ入口| 丁香一区二区三区| 国产精品国产三级国产有无不卡 | 91精品国产综合久久久蜜臀粉嫩| 夜夜嗨av一区二区三区网页| 国产在线视频一区二区三区| 777久久久精品| 日本欧美一区二区| 日韩欧美你懂的| 激情综合五月婷婷| 久久人人97超碰com| 国产福利91精品| 国产精品久久久久影视| 成人开心网精品视频| 亚洲精品免费视频| 欧美女孩性生活视频| 亚洲va欧美va天堂v国产综合| 91精品国产综合久久久蜜臀粉嫩| 美腿丝袜一区二区三区| 精品国产乱码久久久久久影片| 国产精品自拍网站| ●精品国产综合乱码久久久久| 91麻豆高清视频| 性做久久久久久久久| 欧美白人最猛性xxxxx69交| 国产伦精一区二区三区| 国产精品乱码一区二三区小蝌蚪| 91小视频在线| 三级亚洲高清视频| 久久精品一级爱片| 91麻豆视频网站| 日日欢夜夜爽一区| 国产日韩欧美综合在线| 一本高清dvd不卡在线观看| 午夜视频久久久久久| 久久婷婷成人综合色| 91玉足脚交白嫩脚丫在线播放| 亚洲国产精品一区二区久久恐怖片 | 精品盗摄一区二区三区| 成人黄色一级视频| 亚洲444eee在线观看| 日韩三级精品电影久久久| 成人av先锋影音| 午夜精品福利一区二区三区蜜桃| 亚洲精品一线二线三线 | 欧美一区二区大片| 成人午夜在线免费| 日韩不卡免费视频| 18成人在线观看| 日韩免费一区二区| 欧美亚洲动漫制服丝袜| 国产91露脸合集magnet| 日韩精品欧美成人高清一区二区| 中文字幕欧美一区| 日韩三级在线观看| 欧美主播一区二区三区美女| 国产91精品露脸国语对白| 五月开心婷婷久久| 国产日韩三级在线| 日韩欧美三级在线| 欧美日本乱大交xxxxx| 色综合天天综合狠狠| 国产原创一区二区| 理论片日本一区| 亚洲18女电影在线观看| 亚洲欧洲日韩一区二区三区| 久久先锋资源网| 欧美一区二区三区喷汁尤物| 欧美性色aⅴ视频一区日韩精品| 欧美日韩国产首页在线观看| jvid福利写真一区二区三区| 美女国产一区二区| 亚洲高清视频在线| 一区二区三区欧美亚洲| 亚洲人精品一区| 国产精品萝li| 中文字幕在线不卡一区 | 9191久久久久久久久久久| 色94色欧美sute亚洲线路一久| 丰满放荡岳乱妇91ww| 国产mv日韩mv欧美| 国产尤物一区二区| 久久精品国产**网站演员| 日本成人在线视频网站| 日韩不卡一二三区| 日韩vs国产vs欧美| 久久疯狂做爰流白浆xx| 日韩主播视频在线| 亚洲大片精品永久免费| 天天av天天翘天天综合网色鬼国产| 中文字幕一区二区三区av| 中文字幕中文在线不卡住| 国产精品蜜臀av| 亚洲精品免费电影| 天天av天天翘天天综合网色鬼国产 | 26uuu精品一区二区在线观看| 日韩亚洲欧美综合| 337p粉嫩大胆色噜噜噜噜亚洲| 精品福利一二区| 久久久久久久综合| 中文字幕一区二区三区色视频| 国产精品成人在线观看| 亚洲久草在线视频| 日韩中文字幕不卡| 久久国产精品色婷婷| 国产福利一区二区三区视频| 国产激情视频一区二区三区欧美| 韩国av一区二区三区| 国产一区二区不卡| 成人av资源在线观看| 在线日韩av片| 欧美一区二区三区性视频| 日韩一区二区精品葵司在线 | 日韩亚洲欧美在线| 精品成人a区在线观看| 亚洲欧美激情小说另类| 国产麻豆91精品| 91精品久久久久久久91蜜桃 | 成人app网站| 精品久久一区二区| 午夜伊人狠狠久久| 色婷婷亚洲精品| 国产欧美日韩中文久久| 日韩高清不卡一区二区| 91麻豆免费视频| 亚洲不卡一区二区三区| www.日韩av| 国产偷v国产偷v亚洲高清 | 亚洲精品国产一区二区三区四区在线 | 欧美日韩黄色一区二区| 亚洲欧美日韩在线| 成人午夜激情影院| 久久精品一区二区三区四区| 日本不卡视频一二三区| 欧美日韩二区三区| 亚洲一区二区三区中文字幕在线| av男人天堂一区| 日本一区二区久久| 国产一区福利在线| 亚洲精品在线观| 精品午夜一区二区三区在线观看| 在线91免费看| 免费日本视频一区| 欧美一区二区人人喊爽| 日韩激情视频网站| 91精品久久久久久蜜臀| 美腿丝袜一区二区三区| 日韩精品一区二区三区中文精品 |