📄 uartlowlevel.h
字号:
/*
@brief This function will be called to set the callback functions for the UART driver.
@param uint8_t UartNumber - input parameter: number of the UART instance to set the callback functions to
@param UartCallbackFunctions_t* pConfig - input parameter: a pointer to the stucture containing the callback functions for UART driver.
@return parameter of type UartErr_t
possible values: they are self-explaining
gUartErrNoError_c
gUartErrWrongUartNumber_c
gUartErrNullPointer_c
gUartErrUartNotOpen_c
Revision history:
date Author Comments
---------- ---------------------- -------
05.05.2006 r04471 Created
25.05.2006 r04471 Modified - Review ID 3556
*/
/*================================================================================================*/
extern UartErr_t UartSetCallbackFunctions(uint8_t UartNumber, UartCallbackFunctions_t* pConfig);
/*================================================================================================*/
/*===== UartReadData =====*/
/*
@brief This function is called to make a read request to a UART driver instance.
@param uint8_t UartNumber - input parameter: number of the UART instance to read from
@param uint8_t* pBuf - input parameter: pointer to a location in memory where the data shall be copied to.
@param uint16_t BufferSize - input parameter: maximum number of bytes that can be copied to the buffer.
@return parameter of type UartErr_t
possible values: they are self-explaining
gUartErrNoError_c
gUartErrWrongUartNumber_c
gUartErrNullPointer_c
gUartErrInvalidNrBytes_c
gUartErrUartNotOpen_c
gUartErrReadOngoing_c
gUartErrNoCallbackDefined_c
Revision history:
date Author Comments
---------- ---------------------- -------
05.05.2006 r04471 Created
25.05.2006 r04471 Modified - Review ID 3556
*/
/*================================================================================================*/
extern UartErr_t UartReadData(uint8_t UartNumber, uint8_t* pBuf, uint16_t BufferSize, uint8_t CircularBufferMode);
/*================================================================================================*/
/*===== UartGetByteFromRxBuffer =====*/
/*
@brief This function gets the trailing byte from the receiving queue
@param uint8_t UartNumber - input parameter: number of the UART instance to read from
@param uint8_t* pDst - output parameter: pointer to a location in memory where the byte shall be copied to.
@return parameter of type bool_t
possible values:
TRUE - if there is at least one byte in the queue
FALSE - otherwise
Revision history:
date Author Comments
---------- ---------------------- -------------
22.05.2007 r200036 Created
*/
/*================================================================================================*/
extern bool_t UartGetByteFromRxBuffer(uint8_t UartNumber, uint8_t *pDst);
/*================================================================================================*/
/*===== UartOpenCloseTransceiver =====*/
/*
@brief This function enables or disables the receiver or transmitter of the specified UART port
@param uint8_t UartNumber - input parameter: number of the UART instance to read from
@param uint8_t Pin - input parameter: BIT_RX_EN or BIT_TX_EN
@param bool_t Open - input parameter: TRUE if the specified pin will be enabled, FALSE otherwise
@return parameter or type void
Revision history:
date Author Comments
---------- ---------------------- -------------
22.05.2007 r200036 Created
*/
/*================================================================================================*/
extern void UartOpenCloseTransceiver(uint8_t UartNumber, uint8_t Pin, bool_t Open);
/*================================================================================================*/
/*===== UartClearErrors =====*/
/*
@brief This function clears the Status register of the specified UART port
@param uint8_t UartNumber - input parameter: number of the UART instance to read from
@return parameter or type void
Revision history:
date Author Comments
---------- ---------------------- -------------
22.05.2007 r200036 Created
*/
/*================================================================================================*/
extern void UartClearErrors(uint8_t UartNumber);
/*================================================================================================*/
/*===== UartCancelReadData =====*/
/*
@brief This function is called to make a cancel read request to a UART driver instance.
@param uint8_t UartNumber - input parameter: number of the UART instance to cancel read operation.
@return parameter of type UartErr_t
possible values: they are self-explaining
gUartErrNoError_c
gUartErrWrongUartNumber_c
gUartErrUartNotOpen_c
Revision history:
date Author Comments
---------- ---------------------- -------
05.05.2006 r04471 Created
25.05.2006 r04471 Modified - Review ID 3556
*/
/*================================================================================================*/
extern UartErr_t UartCancelReadData(uint8_t UartNumber);
/*================================================================================================*/
/*===== UartWriteData =====*/
/*
@brief This function is called to make a write request to the UART.
@param uint8_t UartNumber - input parameter: number of the UART instance to write to.
@param uint8_t* pBuf - input parameter: pointer to a location in memory where from the data shall be send from.
@param uint16_t NumberBytes - input parameter: number of bytes to send.
@return parameter of type UartErr_t
possible values: they are self-explaining
gUartErrNoError_c
gUartErrWrongUartNumber_c
gUartErrNullPointer_c
gUartErrInvalidNrBytes_c
gUartErrUartNotOpen_c
gUartErrWriteOngoing_c
gUartErrNoCallbackDefined_c
Revision history:
date Author Comments
---------- ---------------------- -------
05.05.2006 r04471 Created
25.05.2006 r04471 Modified - Review ID 3556
*/
/*================================================================================================*/
extern UartErr_t UartWriteData( uint8_t UartNumber, uint8_t* pBuf, uint16_t NumberBytes);
/*================================================================================================*/
/*===== UartCancelWriteData =====*/
/*
@brief This function is called to make a cancel write request to a UART driver instance.
@param uint8_t UartNumber - input parameter: number of the UART instance to cancel write operation.
@return parameter of type UartErr_t
possible values: they are self-explaining
gUartErrNoError_c
gUartErrWrongUartNumber_c
gUartErrUartNotOpen_c
Revision history:
date Author Comments
---------- ---------------------- -------
05.05.2006 r04471 Created
25.05.2006 r04471 Modified - Review ID 3556
*/
/*================================================================================================*/
extern UartErr_t UartCancelWriteData(uint8_t UartNumber);
/*================================================================================================*/
/*===== UartGetStatus =====*/
/*
@brief This function returns the status of the UART instance.
@param uint8_t UartNumber - input parameter: number of the UART instance to get status from
@return parameter of type UartErr_t
possible values: they are self-explaining
gUartErrNoError_c
gUartErrWrongUartNumber_c
gUartErrUartNotOpen_c
gUartErrReadOngoing_c
gUartErrWriteOngoing_c
gUartErrNoCallbacksDefined_c
Revision history:
date Author Comments
---------- ---------------------- -------
05.05.2006 r04471 Created
25.05.2006 r04471 Modified - Review ID 3556
*/
/*================================================================================================*/
extern UartErr_t UartGetStatus(uint8_t UartNumber);
/*================================================================================================*/
/*===== UartGetConfig =====*/
/*
@brief This function will be called to get the configuration of the UART.
@param uint8_t UartNumber - input parameter: number of the UART instance to get configuration from
@param UartConfig_t* pConfig - input parameter: a pointer to the stucture where the configuration settings for UART will be placed.
@return parameter of type UartErr_t
possible values: they are self-explaining
gUartErrNoError_c
gUartErrWrongUartNumber_c
gUartErrNullPointer_c
gUartErrUartNotOpen_c
Revision history:
date Author Comments
---------- ---------------------- -------
05.05.2006 r04471 Created
25.05.2006 r04471 Modified - Review ID 3556
01.06.2006 r04471 Flow control feature added
*/
/*================================================================================================*/
extern UartErr_t UartGetConfig(uint8_t UartNumber, UartConfig_t* pConfig);
extern uint32_t UartGetUnreadBytesNumber(uint8_t UartNumber);
/*================================================================================================*/
/*===== UartClose =====*/
/*
@brief This function will be called to close an UART instance.
@param uint8_t UartNumber - input parameter: number of the UART instance to close
@return parameter of type UartErr_t
possible values: they are self-explaining
gUartErrNoError_c
gUartErrWrongUartNumber_c
gUartErrReadOngoing_c
gUartErrWriteOngoing_c
Revision history:
date Author Comments
---------- ---------------------- -------
05.05.2006 r04471 Created
25.05.2006 r04471 Modified - Review ID 3556
*/
/*================================================================================================*/
extern UartErr_t UartClose(uint8_t UartNumber);
/*================================================================================================*/
/*===== UartIsr1 =====*/
/*
@brief This function will be called by the AITC driver when interrupt for UART 1 instance is triggered.
@param none
@return none
Revision history:
date Author Comments
---------- ---------------------- -------
05.05.2006 r04471 Created
*/
/*================================================================================================*/
extern void UartIsr1(void);
/*================================================================================================*/
/*===== UartIsr2 =====*/
/*
@brief This function will be called by the AITC driver when interrupt for UART 2 instance is triggered.
@param none
@return none
Revision history:
date Author Comments
---------- ---------------------- -------
05.05.2006 r04471 Created
*/
/*================================================================================================*/
extern void UartIsr2(void);
#endif /* _UART_LOW_LEVEL_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -