aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/uart_lld.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-08-15 15:37:52 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-08-15 15:37:52 +0000
commitae70bb24cc5cd5b1d6a298ea298fe7c25b690dc8 (patch)
tree7d9485e52ffbb0129e0cb29f7c98a97692a048ba /os/hal/platforms/STM32/uart_lld.h
parentc36b827d05fef72a986d8b68f14ef043eb1fc895 (diff)
downloadChibiOS-ae70bb24cc5cd5b1d6a298ea298fe7c25b690dc8.tar.gz
ChibiOS-ae70bb24cc5cd5b1d6a298ea298fe7c25b690dc8.tar.bz2
ChibiOS-ae70bb24cc5cd5b1d6a298ea298fe7c25b690dc8.zip
UART driver improvements.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2131 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/uart_lld.h')
-rw-r--r--os/hal/platforms/STM32/uart_lld.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/os/hal/platforms/STM32/uart_lld.h b/os/hal/platforms/STM32/uart_lld.h
index d6927ccdb..4b5ee8dba 100644
--- a/os/hal/platforms/STM32/uart_lld.h
+++ b/os/hal/platforms/STM32/uart_lld.h
@@ -166,23 +166,32 @@
typedef uint32_t uartflags_t;
/**
+ * @brief Structure representing an UART driver.
+ */
+typedef struct _UARTDriver UARTDriver;
+
+/**
* @brief Generic UART notification callback type.
+ *
+ * @param[in] uartp pointer to the @p UARTDriver object
*/
-typedef void (*uartcb_t)(void);
+typedef void (*uartcb_t)(UARTDriver *uartp);
/**
* @brief Character received UART notification callback type.
*
+ * @param[in] uartp pointer to the @p UARTDriver object
* @param[in] c received character
*/
-typedef void (*uartccb_t)(uint16_t c);
+typedef void (*uartccb_t)(UARTDriver *uartp, uint16_t c);
/**
* @brief Receive error UART notification callback type.
*
+ * @param[in] uartp pointer to the @p UARTDriver object
* @param[in] e receive error mask
*/
-typedef void (*uartecb_t)(uartflags_t e);
+typedef void (*uartecb_t)(UARTDriver *uartp, uartflags_t e);
/**
* @brief Driver configuration structure.
@@ -213,7 +222,7 @@ typedef struct {
/**
* @brief Structure representing an UART driver.
*/
-typedef struct {
+struct _UARTDriver {
/** @brief Driver state.*/
uartstate_t ud_state;
/** @brief Current configuration data.*/
@@ -237,7 +246,7 @@ typedef struct {
uint8_t ud_dmatx;
/** @brief Default receive buffer while into @p UART_RX_IDLE state.*/
volatile uint16_t ud_rxbuf;
-} UARTDriver;
+};
/*===========================================================================*/
/* Driver macros. */