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

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

?? can_api.c

?? CANOPen通信的一些源碼
?? 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国产精品免费网站| 1024亚洲合集| 欧美丰满嫩嫩电影| 欧美三片在线视频观看 | 成人黄色av网站在线| 国产成人免费视频一区| 豆国产96在线|亚洲| 成人午夜在线视频| 91美女精品福利| 欧美三区免费完整视频在线观看| 欧美亚洲国产一区二区三区va | 亚洲欧洲av另类| 国产亚洲精品资源在线26u| 精品久久人人做人人爱| 国产亚洲欧美日韩在线一区| 国产精品嫩草久久久久| 一区二区视频免费在线观看| 亚洲3atv精品一区二区三区| 日产国产欧美视频一区精品| 久久er精品视频| 成人激情小说乱人伦| 色哟哟国产精品免费观看| 欧美精品黑人性xxxx| 欧美精品一区二区在线播放| 国产蜜臀97一区二区三区| 亚洲欧美激情一区二区| 午夜精品福利一区二区三区蜜桃| 毛片av一区二区三区| 丁香另类激情小说| 欧美丝袜丝交足nylons图片| 欧美成人官网二区| 亚洲三级电影全部在线观看高清| 热久久免费视频| 成人激情开心网| 欧美一区二区视频网站| 国产精品福利一区二区三区| 亚洲高清视频中文字幕| 国产精品一区二区久久精品爱涩| 在线精品视频免费播放| 久久久精品综合| 日韩高清一区二区| av午夜一区麻豆| 精品国精品自拍自在线| 亚洲午夜精品网| 99久久久精品| 精品国产sm最大网站| 亚洲成在线观看| 91啪在线观看| 欧美激情一区二区在线| 日本不卡视频在线| 91国偷自产一区二区三区观看 | 91激情在线视频| 欧美国产一区在线| 久久精品国产精品亚洲红杏| 欧美视频在线不卡| 亚洲欧美中日韩| youjizz久久| 欧美一区二区在线免费播放 | 欧美日韩视频在线观看一区二区三区| 4438亚洲最大| 亚洲一区二区视频| 91免费看`日韩一区二区| 久久久精品影视| 国内国产精品久久| 日韩一区二区不卡| 琪琪久久久久日韩精品| 欧洲视频一区二区| 亚洲黄色小说网站| 色天使色偷偷av一区二区| 1区2区3区精品视频| 成人综合婷婷国产精品久久蜜臀| 久久综合九色欧美综合狠狠| 日韩av一区二区在线影视| 欧美疯狂做受xxxx富婆| 日本亚洲电影天堂| 日韩一区二区在线看片| 麻豆久久久久久| 日韩欧美一级精品久久| 乱中年女人伦av一区二区| 日韩一二在线观看| 国产在线视视频有精品| 久久先锋影音av| 国产成人免费视| 亚洲欧洲日韩一区二区三区| 91网上在线视频| 亚洲国产综合色| 欧美mv日韩mv| 国产99久久久久久免费看农村| 国产日韩三级在线| www.av亚洲| 亚洲一区二区三区在线看| 欧美日韩国产精品自在自线| 五月婷婷色综合| 精品国产123| 99在线精品观看| 亚洲成人在线免费| 久久亚洲免费视频| av网站一区二区三区| 亚洲一区二区欧美激情| 日韩欧美国产一区二区在线播放 | 亚洲女人小视频在线观看| 欧亚一区二区三区| 激情图片小说一区| 亚洲色图欧美激情| 日韩欧美国产综合| 99精品在线观看视频| 一级日本不卡的影视| 日韩欧美一区二区三区在线| 成人免费视频网站在线观看| 樱桃视频在线观看一区| 日韩女优av电影| aaa亚洲精品一二三区| 日韩精品欧美精品| 国产精品理伦片| 日韩免费看网站| 欧美性受xxxx| 成人高清免费观看| 蜜桃av一区二区| 亚洲日本一区二区| xfplay精品久久| 在线观看视频欧美| av一本久道久久综合久久鬼色| 秋霞影院一区二区| 亚洲精品videosex极品| 国产夜色精品一区二区av| 欧美精品高清视频| 色拍拍在线精品视频8848| 国产剧情一区二区三区| 日韩av电影免费观看高清完整版 | 国产精品福利一区二区三区| 欧美日韩成人在线一区| 成人动漫一区二区三区| 激情综合网激情| 亚洲bt欧美bt精品| 亚洲色图清纯唯美| 中国色在线观看另类| 欧美videos大乳护士334| 欧美性猛交xxxx黑人交| 成人h动漫精品一区二| 国产一区二区福利视频| 日本午夜精品一区二区三区电影| 亚洲欧洲日本在线| 中文字幕不卡的av| 久久精品欧美一区二区三区不卡| 日韩视频在线你懂得| 欧美日韩另类国产亚洲欧美一级| 91蜜桃视频在线| 91色视频在线| 色哟哟欧美精品| 91捆绑美女网站| 91麻豆国产自产在线观看| 99视频有精品| 色婷婷狠狠综合| 在线免费精品视频| 在线中文字幕一区二区| 欧美日韩精品欧美日韩精品一综合| 97久久精品人人爽人人爽蜜臀| 成人高清av在线| 色菇凉天天综合网| 在线播放一区二区三区| 欧美巨大另类极品videosbest | 久久久噜噜噜久久人人看| 欧美精品一区二区久久久| 精品久久久久久久久久久久久久久久久| 欧美精品高清视频| 日韩免费看的电影| 久久久久高清精品| 国产精品不卡在线观看| 亚洲人成电影网站色mp4| 亚洲福中文字幕伊人影院| 日韩国产欧美在线视频| 九色综合狠狠综合久久| 国产精品主播直播| a在线播放不卡| 欧美日韩精品是欧美日韩精品| 在线91免费看| 国产午夜精品一区二区三区视频 | 亚洲欧洲日产国码二区| 亚洲国产一区二区三区| 麻豆91在线看| 99re视频这里只有精品| 538prom精品视频线放| 久久色.com| 一区二区三区在线观看网站| 蜜臀精品一区二区三区在线观看 | 日韩欧美专区在线| 国产精品污www在线观看| 一区二区在线看| 蜜桃视频第一区免费观看| 国产电影一区在线| 欧美丰满少妇xxxbbb| 欧美国产激情二区三区| 午夜不卡av免费| 成人综合在线视频| 欧美一区二区三区四区在线观看| 国产精品久久久久影院| 日日摸夜夜添夜夜添国产精品 | 在线一区二区三区四区| 精品剧情v国产在线观看在线| 亚洲区小说区图片区qvod|