📄 lpc2000_can.h
字号:
extern const UInt8 CAN_Error_80[];
extern const UInt8 CAN_Error_90[];
extern const UInt8 CAN_Error_100[];
extern const UInt8 CAN_Error_110[];
extern const UInt8 CAN_Error_120[];
extern const UInt8 CAN_Error_130[];
extern const UInt8 CAN2Rx_Return_Message_EI[];
extern const UInt8 CAN2Rx_Return_Message_DOI[];
extern const UInt8 CAN2Rx_Return_Message_WUI[];
extern const UInt8 CAN2Rx_Return_Message_EPI[];
extern const UInt8 CAN2Rx_Return_Message_ALI[];
extern const UInt8 CAN2Rx_Return_Message_BEI[];
extern const UInt8 CAN_ERROR_STOP_DEMO[];
extern const UInt8 Demo_Start[];
extern const UInt8 Demo_Sent_Choice[];
extern const UInt8 Label_Explanation[];
extern const UInt8 Demo_Sent_Data[];
extern const UInt8 Data_Sent_Start_or_Not[];
extern const UInt8 Rcv_Data_OK[];
extern const UInt8 Acceptance_Filter_Tables[];
extern const UInt8 FULLCAN_Acceptance_Filter_Tables[];
/*****************************************************************************/
/* External Functions */
/*****************************************************************************/
/**
* Calling this function initializes the selected CAN Controller with the
* specified Bit Timing and puts the CAN Controller into Operating Mode.
*
* @param[in] canChannel Channel number of CAN Controller
* @param[in] canBitrate Pre-defined CAN Bit Timing value
*
* @return The following error codes can be returned:
* - LPC2000_CANDRIVER_OK,
* on successful completion.
*/
CanStatusCode lpc2000CANdriver_CANInit(UInt32 canChannel,
UInt32 canBitrate);
/**
* Calling this function changes the CAN Controller mode.
*
* @param[in] canChannel Channel number of CAN Controller
* @param[in] CANMode desired CAN controller mode
*
* @return The following error codes can be returned;
* - LPC2000_CANDRIVER_OK,
* on successful completion.
* - LPC2000_CANDRIVER_ERR in case of an error.
*/
CanStatusCode lpc2000CANdriver_SetCANMode(UInt32 canChannel,
UInt8 CANMode);
/**
* Calling this function changes the Acceptance Filter mode.
*
* @param[in] ACFMode desired acceptance filter mode
*
* @return The following error codes can be returned;
* - LPC2000_CANDRIVER_OK,
* on successful completion.
* - LPC2000_CANDRIVER_ERR in case of an error.
*/
CanStatusCode lpc2000CANdriver_SetACFMode(UInt8 ACFMode);
/**
* Calling this function forces the CPU to copy transmit data from
* User RAM into a certain transmit buffer. A 'buffer not free'
* return code is given if a certain transmit buffers is occupied.
*
* @param[in] canChannel Channel number of CAN Controller
* @param[in] pTransmitBuf pointer to a Transmit Buffer in User RAM
* @param[in] txbuffer Transmit Buffer number: 1,2 or 3
*
* @return The following error codes can be returned;
* - LPC2000_CANDRIVER_OK,
* and in case of errors:
* - LPC2000_CANDRIVER_ERR_WRONG_CAN_CHANNEL_NUMBER
* - LPC2000_CANDRIVER_ERR
* - LPC2000_CANDRIVER_ERR_TRANSMIT_BUFFER1_NOT_FREE
* - LPC2000_CANDRIVER_ERR_TRANSMIT_BUFFER2_NOT_FREE
* - LPC2000_CANDRIVER_ERR_TRANSMIT_BUFFER3_NOT_FREE
*/
CanStatusCode lpc2000CANdriver_CertainTxBufTransmitMessage(UInt32 canChannel,
plpc2000CANdriver_TXObj_t pTransmitBuf,
UInt32 txbuffer);
/**
* Calling this function loads the Acceptance Filter Look_up table RAM with
* pre-defined values stored in lpc2000_CANdriver_cfg.h. Depending on the number of
* pre-defined identifiers the register start addresses for the Acceptance Filter
* RAM are calculated and initialised automatically.
*
* @return The following error codes can be returned;
* - LPC2000_CANDRIVER_OK,
* and in case of errors:
* - LPC2000_CANDRIVER_ERR
*/
CanStatusCode lpc2000CANdriver_LoadAcceptanceFilter(void);
/**
* Calling this function copies the current Receive Buffer contents into the
* specified Receive Buffer in User RAM. After copying the message data the
* CAN Controllers receive buffer is released.
*
* @param[out] pReceiveBuf pointer to ReceiveBuffer in User RAM
*
* @return The following error codes can be returned;
* - LPC2000_CANDRIVER_OK,
* and in case of errors:
* - LPC2000_CANDRIVER_ERR_WRONG_CAN_CHANNEL_NUMBER
*/
CanStatusCode lpc2000CANdriver_ReceiveMessageCh1 (plpc2000CANdriver_RXObj_t pReceiveBuf);
/**
* Calling this function copies the current Receive Buffer contents into the
* specified Receive Buffer in User RAM. After copying the message data the
* CAN Controllers receive buffer is released.
*
* @param[out] pReceiveBuf pointer to ReceiveBuffer in User RAM
*
* @return The following error codes can be returned;
* - LPC2000_CANDRIVER_OK,
* and in case of errors:
* - LPC2000_CANDRIVER_ERR_WRONG_CAN_CHANNEL_NUMBER
*/
CanStatusCode lpc2000CANdriver_ReceiveMessageCh2 (plpc2000CANdriver_RXObj_t pReceiveBuf);
/**
* Calling this function copies the current Receive Buffer contents into the
* specified Receive Buffer in User RAM. After copying the message data the
* CAN Controllers receive buffer is released.
*
* @param[out] pReceiveBuf pointer to ReceiveBuffer in User RAM
*
* @return The following error codes can be returned;
* - LPC2000_CANDRIVER_OK,
* and in case of errors:
* - LPC2000_CANDRIVER_ERR_WRONG_CAN_CHANNEL_NUMBER
*/
CanStatusCode lpc2000CANdriver_ReceiveMessageCh3 (plpc2000CANdriver_RXObj_t pReceiveBuf);
/**
* Calling this function copies the current Receive Buffer contents into the
* specified Receive Buffer in User RAM. After copying the message data the
* CAN Controllers receive buffer is released.
*
* @param[out] pReceiveBuf pointer to ReceiveBuffer in User RAM
*
* @return The following error codes can be returned;
* - LPC2000_CANDRIVER_OK,
* and in case of errors:
* - LPC2000_CANDRIVER_ERR_WRONG_CAN_CHANNEL_NUMBER
*/
CanStatusCode lpc2000CANdriver_ReceiveMessageCh4 (plpc2000CANdriver_RXObj_t pReceiveBuf);
/**
* Calling this function display one frame of Received Data information
* stored in User RAM to PC Screen by Uart0
*
* @param[in] pReceiveBuf pointer to ReceiveBuffer in User RAM
*
* @return
*/
UInt32 Rcv_Data_Output_to_Screen(plpc2000CANdriver_RXObj_t pReceiveBuf);
/**
* Calling this function Print Chars to Screen by Uart0
*
* @param[in] pscreen_print pointer to Chars that be prepared to printed
*
* @return
*/
UInt32 Print_Chars_to_Screen( UInt8 const * pscreen_print );
/**
* Calling this function Print 4bits hex data to Screen by Uart0
*
* @param[in] Value_Hex_4bits 4bits HEX value that be prepared to printed
*
* @return
*/
UInt32 Print_4bits_to_Screen( UInt32 Value_Hex_4bits);
#endif /* LPC2000CANDRIVER_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -