📄 can.h
字号:
*
* Output: unsigned char status of the request
*
* Side Effects:
*
* Overview: Returns the tag of the data that was last transmitted.
* Any additional calls without additional transmissions
* will return NULL.
*
* Note: This is useful to determine when and who's data was
* placed on the bus. This may seem redundent since
* only one hardware buffer is used; however, this
* architecture allows for expansion to deep software/
* hardware buffer designs without major changes to
* the upper level firmware.
********************************************************************/
NEAR unsigned char CANIsMsgSent(void);
/*********************************************************************
* Function: void CANSend(NEAR unsigned char txTag)
*
* PreCondition:
*
* Input: none
*
* Output: none
*
* Side Effects:
*
* Overview: Tell the transmit engine that the loaded data is
* is ready to send.
*
* Note: Data may not be sent immediately. The tag is used
* to trace the transmission since other data may
* also be queued to transmit.
********************************************************************/
void CANSend(NEAR unsigned char txTag);
/*********************************************************************
* Function: NEAR unsigned int CANGetRxCID(void)
*
* PreCondition:
*
* Input: none
*
* Output: unsigned int connection ID (11-bit CAN ID)
*
* Side Effects:
*
* Overview: Get the connection ID from the current receive
* message.
*
* Note: The CAN ID is assumed to be left justified within
* the 16-bit word.
********************************************************************/
NEAR unsigned int CANGetRxCID(void);
/*********************************************************************
* Function: NEAR unsigned char CANGetRxCnt(void)
*
* PreCondition: Data should have been received prior to calling
* this function; otherwise, it is likely the returned
* count is either not valid or associated to the
* previous message. Use CANIsRxRdy() to determine if
* data is available.
*
* Input: none
*
* Output: unsigned char count of the data
*
* Side Effects:
*
* Overview: This function returns the number of bytes waiting
* in the receive buffer.
*
* Note:
********************************************************************/
NEAR unsigned char CANGetRxCnt(void);
/*********************************************************************
* Function: unsigned char * NEAR CANGetRxDataPtr(void)
*
* PreCondition: Data should have been received prior to calling
* this function; otherwise, it is likely the returned
* pointer is either not valid or associated to the
* previous message. Use CANIsRxRdy() to determine if
* data is available.
*
* Input: none
*
* Output: unsigned char *
*
* Side Effects:
*
* Overview: This function returns the pointer to the RX buffer.
*
* Note: Use the direct block copy methods for faster data
* movement.
********************************************************************/
unsigned char * NEAR CANGetRxDataPtr(void);
/*********************************************************************
* Function: void CANGetRxDataTyp0(unsigned char * NEAR usrBuf)
* void CANGetRxDataTyp1(unsigned char * NEAR usrBuf)
* void CANGetRxDataTyp2(unsigned char * NEAR usrBuf)
*
* PreCondition: Data should have been received prior to calling
* this function; otherwise, it is likely the returned
* count is either not valid or associated to the
* previous message. Use CANIsRxRdy() to determine if
* data is available.
*
* Input: pointer to user supplied buffer
*
* Output: void
*
* Side Effects:
*
* Overview: Get block data from the buffer.
*
* Note: These functions copy blocks of data rather than
* single bytes. This method is very fast; however,
* data limits are not checked. It is up to the
* caller to verify the count to toss data that is
* not valid.
********************************************************************/
void CANGetRxDataTyp0(unsigned char * NEAR usrBuf);
void CANGetRxDataTyp1(unsigned char * NEAR usrBuf);
void CANGetRxDataTyp2(unsigned char * NEAR usrBuf);
/*********************************************************************
* Function: void CANPutTxCID(NEAR unsigned int txCID)
*
* PreCondition: The function CANIsTxRdy() must be called prior
* to using this function; otherwise, the previous
* transmission request may be corrupted.
*
* Input: none
*
* Output: unsigned char *
*
* Side Effects:
*
* Overview: Write the CID to the TX buffer.
*
* Note:
********************************************************************/
void CANPutTxCID(NEAR unsigned int txCID);
/*********************************************************************
* Function: void CANPutTxCnt(NEAR unsigned char txCount)
*
* PreCondition: The function CANIsTxRdy() must be called prior
* to using this function; otherwise, the previous
* transmission request may be corrupted.
*
* Input: none
*
* Output: unsigned char *
*
* Side Effects:
*
* Overview: Write the count to the TX buffer.
*
*
* Note:
********************************************************************/
void CANPutTxCnt(NEAR unsigned char txCount);
/*********************************************************************
* Function: unsigned char * NEAR CANGetTxDataPtr(void)
*
* PreCondition: The function CANIsTxRdy() must be called prior
* to using this function; otherwise, the pointer
* may be invalid.
*
* Input: none
*
* Output: unsigned char *
*
* Side Effects:
*
* Overview: Return a pointer to the buffer.
*
*
* Note:
********************************************************************/
unsigned char * NEAR CANGetTxDataPtr(void);
/*********************************************************************
* Function: void CANPutTxDataTyp0(unsigned char * NEAR usrBuf)
* void CANPutTxDataTyp1(unsigned char * NEAR usrBuf)
* void CANPutTxDataTyp2(unsigned char * NEAR usrBuf)
*
* PreCondition: The function CANIsTxRdy() must be called prior
* to using this function; otherwise, the previous
* transmission request may be corrupted.
*
* Input: none
*
* Output: unsigned char *
*
* Side Effects:
*
* Overview: Return a pointer to the buffer.
*
*
* Note:
********************************************************************/
void CANPutTxDataTyp0(unsigned char * NEAR usrBuf);
void CANPutTxDataTyp1(unsigned char * NEAR usrBuf);
void CANPutTxDataTyp2(unsigned char * NEAR usrBuf);
/*********************************************************************
* Function: void CANInit(void)
*
* PreCondition:
*
* Input: none
*
* Output: unsigned char *
*
* Side Effects:
*
* Overview: Initialize the module.
*
*
* Note:
********************************************************************/
void CANInit(void);
#pragma udata
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -