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

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

?? can_api.c

?? CAN例程 源碼 CAN例程 源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* can_api.c - WindNet CAN API documentation. *//* Copyright 1984-2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01, 18Dec01, jac created02, 7Jul02,  lsg modified03, 20Aug02, lsg changed resulting from api review   *//*DESCRIPTIONThis library provides functions to implement CAN communications usingthe WindNet CAN API.NOTEFor normal use, these functions are replaced by equivalent macro definitions in CAN/wnCAN.h. The user is free to redefine the macro namesin order to avoid namespace collisions in his application code, or toimplement a user-specific naming convention. The user may also dispensewith the macro definitions and use the function calls defined in thisfile by manually setting the #define USE_CAN_FUNCTION_DEFS in the headerfile CAN/wncan_api.h then recompiling the CAN library with the make utility.INCLUDE FILESCAN/wnCAN.hCAN/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/* subfunctions *//************************************************************************* CAN_Open - return a handle to the requested WNCAN_DEVICE* * This is the first function called. This function 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 function.** 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** Deallocates 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 function returns the mode of the channel:* WNCAN_CHN_TRANSMIT, WNCAN_CHN_RECEIVE, WNCAN_CHN_INACTIVE, 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 * 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 setup 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 setup to respond to an incoming remote request with *             the same identifier. On receiving such a frame, the response will*             be sent out automatically   ** 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 function sets the mode of the channel to one of five values:* WNCAN_CHN_TRANSMIT, WNCAN_CHN_RECEIVE, WNCAN_CHN_INACTIVE, * and in addition for advanced controllers,* WNCAN_CHN_RTR_REQUESTER, or WNCAN_CHN_RTR_RESPONDER.* 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* and errorno 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: ERROR if the requested channel number is out of range,           OK otherwise ** 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 function returns the status of the CAN bus. The bus is * either in a WNCAN_BUS_OFF, WNCAN_BUS_WARN, or WNCAN_BUS_OK state.** 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* 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* 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. ** 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 function returns an ORed bit mask of all the bus errors that have* occured during the last bus activity.* Bus errors returned by this function can have the following values:* WNCAN_ERR_NONE: No errors detected* WNCAN_ERR_BIT: Bit error. * WNCAN_ERR_ACK: Acknowledgement error. * WNCAN_ERR_CRC: CRC error* WNCAN_ERR_FORM: Form error* WNCAN_ERR_STUFF: Stuff error* WNCAN_ERR_UNKNOWN: this condition should not occur* The five errors are not mutually exclusive. * The occurence of an error will be indicated by an interrupt. Typically, * this function will be called from the error interrupt handling case in the* user's ISR callback function, to find out the kind of error that occured* 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** This function initializes the CAN controller and makes default selections.* 1. Puts the CAN controller into debug mode* 2. Disables interrupts at the CAN controller level as well as channel * 3. Sets bit timing values according to values stored in the CAN controller*    struct. Unless the user has changed these value, before init is called *    the default bit timing values are set to a baud rate of 250K* 4. Clears error counters* 5. Sets local and global receive masks to don't care (accept all)* 6. Makes all channels inactive in hardware* 7. Other controller specific initializations * 8. Before exiting the function, controller is brought of reset mode*    (where relevant) but clocks are not enabled. The CAN controller has*    now been initialized but will not participate in CAN bus communication* In order to bring the CAN controller online, and enable active participation* in CAN bus activity, CAN_Start must be called following CAN_Init.** The user must call CAN_Init, subsequently followed by CAN_Start,* after CAN_Open is called to obtain a valid device pointer. * In case of a bus off condition, user must call CAN_Init followed by CAN_Start* to reinitialize and bring the CAN controller online again.** RETURNS: OK** ERRNO:   N/A*/STATUS CAN_Init(struct WNCAN_Device *pDev  /* CAN Device pointer */){   return(pDev->Init(pDev));}/***************************************************************************   * CAN_Start - Bring CAN controller online** This function is called to bring the CAN controller online. The CAN controller* can now participate in transmissions and receptions on the CAN bus.* This function must be called after CAN_Init has been called to initialize and* bring the CAN controller up in a known state.* This function 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 CAN controller offline** Disables communication between CAN controller and the CAN bus** RETURNS: OK**/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 function sets the baud rate of the controller. The selection* of the input parameters should be based on an established set of * recommendations for the particular application.* This function sets the bit timing values in the hardware as well as the* controller structure, so that the bit timing values are not lost if Init* is called again. The function will preserve the state of the CAN controller.* i.e. if the CAN controller is online when the function is called, then the * CAN controller will be online when the function exits. ** bit time = 1 + (tseg1 + 1) + (tseg2+1) time quanta * The interpretation of tseg1 are tseg2 are according to the controller's * definition and hence can be written to directly using this function.** In all cases so far, tseg2 refers to the segment of bit time after the sample* point. However, in some controllers tseg1 refers to the segment of bit time* after the end of sync seg upto the sample point.                     *  ---------------------------------------------------------* |    |                    |                              |  *  sync <--------tseg1 --->^|^<---------tseg2 ------------->*                          sample point * 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产一区二区三区忘忧草| 99久久婷婷国产综合精品电影 | 亚洲一区二区欧美| 91视频一区二区三区| 国产精品国产自产拍高清av王其| 成人av免费观看| 亚洲精品国产成人久久av盗摄| 色琪琪一区二区三区亚洲区| 亚洲一区二区三区四区在线观看 | 国产自产视频一区二区三区| 91精品国产综合久久香蕉麻豆| 青青草91视频| 久久久美女艺术照精彩视频福利播放| 国产精品亚洲а∨天堂免在线| 久久精品这里都是精品| av男人天堂一区| 亚洲电影在线播放| 日韩精品一区二区三区swag | 青青草国产成人av片免费| 日韩精品一区二区三区视频播放| 国产在线精品一区二区三区不卡 | 精品av综合导航| 成人免费毛片嘿嘿连载视频| 一区二区三区中文免费| 日韩一区二区三区免费看| 国产盗摄女厕一区二区三区| 一区二区三区在线视频观看| 精品日韩成人av| 91老师片黄在线观看| 久久久欧美精品sm网站| 成人欧美一区二区三区| 成人毛片视频在线观看| 亚洲一区在线看| 国产女人aaa级久久久级| 欧美日韩一区小说| 91精品国产色综合久久久蜜香臀| 久久66热re国产| 一区二区三区精密机械公司| 精品久久免费看| 色悠悠久久综合| 国产精品91一区二区| 亚洲激情男女视频| 久久久久久日产精品| 精品视频一区三区九区| 国产suv精品一区二区883| 日韩高清欧美激情| 亚洲欧美日韩国产另类专区| 国产日产精品一区| 日韩一区二区免费在线电影| 日本电影亚洲天堂一区| 国内精品伊人久久久久av一坑| 亚洲国产欧美在线| 国产精品久久免费看| 精品国产成人在线影院| 欧美日韩国产首页| 91丨九色丨蝌蚪丨老版| 成人综合在线观看| 精品一区在线看| 日本在线播放一区二区三区| 日韩毛片高清在线播放| 国产欧美一二三区| 精品久久久久久无| 欧美一区二区三区视频免费播放 | 欧美亚洲免费在线一区| 高清日韩电视剧大全免费| 久久成人精品无人区| 日本不卡视频在线| 日韩综合小视频| 日韩中文字幕一区二区三区| 一区二区高清在线| 亚洲理论在线观看| 日韩精品中文字幕一区二区三区| 国内偷窥港台综合视频在线播放| 国产精品理论在线观看| 久久久av毛片精品| 久久综合999| 2021中文字幕一区亚洲| 欧美精品一区二区三区很污很色的| 欧美一级夜夜爽| 日韩一级二级三级精品视频| 日韩亚洲欧美在线| 亚洲一区影音先锋| 亚洲综合视频在线观看| 午夜伦欧美伦电影理论片| 亚洲aaa精品| 蜜臀av性久久久久蜜臀av麻豆| 麻豆一区二区在线| 国产精品自拍在线| av电影在线观看完整版一区二区 | 不卡视频一二三四| 99精品欧美一区二区蜜桃免费| 99国产欧美久久久精品| 91极品视觉盛宴| 欧美日韩在线播放| 日韩亚洲欧美一区二区三区| 久久久精品天堂| 国产精品久久三区| 亚洲在线观看免费视频| 青青草视频一区| 国产精品夜夜爽| 色综合天天综合色综合av| 欧美日韩一二三区| 欧美电影免费观看高清完整版| 国产网站一区二区| 亚洲欧美激情在线| 日本vs亚洲vs韩国一区三区| 国模冰冰炮一区二区| 99re成人在线| 91精品国产色综合久久久蜜香臀| 26uuu精品一区二区在线观看| 国产精品全国免费观看高清| 亚洲成人免费看| 国产精品66部| 色妞www精品视频| 日韩视频免费直播| 国产精品传媒入口麻豆| 午夜久久久久久电影| 国产成人在线网站| 欧日韩精品视频| 久久精品水蜜桃av综合天堂| 一区二区三区四区中文字幕| 激情综合色播激情啊| 91蝌蚪porny| 久久伊人中文字幕| 亚洲伊人伊色伊影伊综合网 | 国产91丝袜在线18| 欧美精品日韩一本| 国产免费成人在线视频| 视频一区免费在线观看| 99精品欧美一区二区三区综合在线| 日韩欧美一区二区不卡| 亚洲精品欧美在线| 国产成人免费在线视频| 91麻豆精品91久久久久久清纯| 国产精品国产a级| 久久99国产精品免费| 欧美年轻男男videosbes| 国产精品久久久久久久久久久免费看| 免费的成人av| 欧美日韩久久久久久| 自拍偷拍亚洲激情| 高清日韩电视剧大全免费| 日韩精品一区二区三区在线观看| 一区二区三区在线影院| 成人v精品蜜桃久久一区| 欧美zozozo| 日本vs亚洲vs韩国一区三区| 在线观看成人免费视频| 亚洲视频一区在线| 国产91精品精华液一区二区三区| 欧美一激情一区二区三区| 亚洲成人你懂的| 欧美亚洲国产bt| 亚洲免费在线视频一区 二区| 成人激情开心网| 欧美激情综合五月色丁香小说| 国产自产视频一区二区三区| 欧美xxx久久| 精品无人区卡一卡二卡三乱码免费卡 | 欧美四级电影在线观看| 亚洲免费伊人电影| 91麻豆精品在线观看| 亚洲少妇屁股交4| 91视视频在线直接观看在线看网页在线看 | 91首页免费视频| 综合久久久久久久| av影院午夜一区| 中文字幕欧美一| 99久久国产综合色|国产精品| 欧美国产精品一区二区| 国产精品一卡二卡在线观看| 久久综合久久综合久久| 国产精选一区二区三区| 中文字幕第一区第二区| 成人国产精品免费| 亚洲欧美另类小说| 欧美在线免费观看亚洲| 婷婷开心久久网| 日韩欧美成人午夜| 国产精选一区二区三区| 国产精品色眯眯| 色噜噜狠狠成人中文综合 | 欧美色偷偷大香| 热久久国产精品| 欧美精品一区二区三区一线天视频| 国产一区二区在线视频| 欧美激情一区二区三区| 91视频一区二区三区| 亚洲综合在线视频| 欧美一级高清片在线观看| 国产麻豆成人传媒免费观看| 日本一区二区不卡视频| 色婷婷综合久久久久中文| 亚洲成人午夜电影| 久久久噜噜噜久噜久久综合| gogogo免费视频观看亚洲一| 亚洲午夜影视影院在线观看| 日韩美女天天操| av午夜一区麻豆| 日韩不卡一区二区三区 |