📄 bdlc.h
字号:
#define _11us_delay 0x02
/** 12us delay value in external transciever */
#define _12us_delay 0x03
/** 13us delay value in external transciever */
#define _13us_delay 0x04
/** 14us delay value in external transciever */
#define _14us_delay 0x05
/** 15us delay value in external transciever */
#define _15us_delay 0x06
/** Typical 16us delay value in external transciever */
#define _16us_delay 0x07
/** 17us delay value in external transciever */
#define _17us_delay 0x08
/** 18us delay value in external transciever */
#define _18us_delay 0x09
/** 19us delay value in external transciever */
#define _19us_delay 0x0A
/** 20us delay value in external transciever */
#define _20us_delay 0x0B
/** 21us delay value in external transciever */
#define _21us_delay 0x0C
/** 22us delay value in external transciever */
#define _22us_delay 0x0D
/** 23us delay value in external transciever */
#define _23us_delay 0x0E
/** 24us delay value in external transciever */
#define _24us_delay 0x0F
/******************************************************************************/
/**
* \brief This State check for any activity in the J1850 Bus
* \author R01160
* \param void
* \return void
*/
/******************************************************************************/
void vfnBDLC_Idle(void);
/******************************************************************************/
/**
* \brief Check if a J1850 packet is in the RX buffer and Process any \n
* received packet to take the proper actions
* \author R01160
* \param void
* \return void
*/
/******************************************************************************/
void vfnBDLC_ReceiveFrame(void);
/******************************************************************************/
/**
* \brief Send J1850 frames
* \author R01160
* \param void
* \return void
*/
/******************************************************************************/
void vfnBDLC_SendFrame(void);
/******************************************************************************/
/**
* \brief Check for errors during TX and RX
* \author R01160
* \param void
* \return void
*/
/******************************************************************************/
void vfnBDLC_ErrChecking(void);
/******************************************************************************/
/**
* \brief This function runs the BDLC state machine
* \author R01160
* \param void
* \return void
*/
/******************************************************************************/
void vfnBDLC_Driver(void);
/******************************************************************************/
/**
* \brief Initializes the BDLC module
* \author R01160
* \param Test
* \return void
*/
/******************************************************************************/
void vfnBDLCInit(UINT8 Test);
/******************************************************************************/
/**
* \brief Clear all RX buffers. Normal and Backup buffers are cleared
* \author R01160
* \param void
* \return void
*/
/******************************************************************************/
void vfnClearAllRxBuffers(void);
/******************************************************************************/
/**
* \brief Clear Retransmit buffer.
* \author R01160
* \param void
* \return void
*/
/******************************************************************************/
void vfnClearRetransmitBuff(void);
/******************************************************************************/
/**
* \brief Check priority commands in the buffer and return the MOST\n
* priority cmd in the retransmit Buffer.
* \author R01160
* \param void
* \return MOST priority Command.
*/
/******************************************************************************/
UINT8 u8fCheckBufferPriority(void);
/******************************************************************************/
/**
* \brief Transmits J1850 messages. This functions handles all the process\n
* in order to transmit the whole packet.Function will send one byte\n
* at a time.Enables J1850 transciever and Disable Single-Wire transciever \n
* Saves the InProgress Command in order to check if the command has been\n
* correctly sent.
* \author R01160
* \param void
* \return Status
*/
/******************************************************************************/
UINT8 u8fnBDLCTransmit(void);
/******************************************************************************/
/**
* \brief This routine handles all posible errors during any transmition\n
* or package reception.
* \author R01160
* \param Error Source
* \return void
*/
/******************************************************************************/
void vfnBDLCErrorHandling(UINT8 ErrorSource);
/******************************************************************************/
/**
* \brief This routine makes a Loopback test in order to determine the \n
* integrity of the link to the SAE J1850 network
* \author R01160
* \param LoopMode Test
* \return void
*/
/******************************************************************************/
void vfnBDLC_LoopBackTest(UINT8 LoopMode);
/******************************************************************************/
/**
* \brief If an unwanted message is received this function will be called\n
* in order to discard the rest of the frame
* \author R01160
* \param void
* \return void
*/
/******************************************************************************/
void Cmd_Invalid (void);
/******************************************************************************/
/**
* \brief Calculate the BDLC rate selection using the FBUS value \n
* DLCBRSR is calculated automatically when BDLCInit function\n
* becomes called.
* \author R01160
* \param BusClock frequency
* \return BDLC Rate Selection value
* \warning Developer must be aware to calculate the correct FBUS value\n
* since this function calculate the BDLC rate selection value\n
* according with the FBUS value. If FBUS value is set with an \n
* incorrect value, also the rate selection value will be wrong.
*/
/******************************************************************************/
UINT8 CalculateRateSelection(UINT32 BusClock);
/******************************************************************************/
/**
* \brief Set Error Variables when a J1850 has been detected.
* \author R01160
* \param void
* \return void
*/
/******************************************************************************/
void vfnErrDo_s(void);
/******************************************************************************/
/**
* \brief Swaps Rx Buffer from 0x0700 to 0x0712 and viceversa.
* \author R01160
* \param void
* \return void
*/
/******************************************************************************/
void vfnSwapRxBuffer(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -