From bedb87c1e7cc9741c57c299d81d6e24c5e9c59c5 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 2 Jan 2010 13:35:55 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1495 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/Win32/serial_lld.h | 71 +++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 31 deletions(-) (limited to 'os/hal/platforms/Win32/serial_lld.h') diff --git a/os/hal/platforms/Win32/serial_lld.h b/os/hal/platforms/Win32/serial_lld.h index 4690fcb60..ed70a880a 100644 --- a/os/hal/platforms/Win32/serial_lld.h +++ b/os/hal/platforms/Win32/serial_lld.h @@ -87,63 +87,72 @@ */ typedef uint32_t sdflags_t; +/** + * @brief Generic Serial Driver configuration structure. + * @details An instance of this structure must be passed to @p sdStart() + * in order to configure and start a serial driver operations. + * + * @note This structure content is architecture dependent, each driver + * implementation defines its own version and the custom static + * initializers. + */ +typedef struct { +} SerialConfig; + /** * @brief @p SerialDriver specific data. */ struct _serial_driver_data { /** - * Input queue, incoming data can be read from this input queue by - * using the queues APIs. + * @brief Driver state. + */ + sdstate_t state; + /** + * @brief Current configuration data. */ - InputQueue iqueue; + const SerialConfig *config; /** - * Output queue, outgoing data can be written to this output queue by - * using the queues APIs. + * @brief Input queue, incoming data can be read from this input queue by + * using the queues APIs. */ - OutputQueue oqueue; + InputQueue iqueue; /** - * Status Change @p EventSource. This event is generated when one or more - * condition flags change. + * @brief Output queue, outgoing data can be written to this output queue by + * using the queues APIs. */ - EventSource sevent; + OutputQueue oqueue; /** - * I/O driver status flags. + * @brief Status Change @p EventSource. This event is generated when one or + * more condition flags change. */ - sdflags_t flags; + EventSource sevent; /** - * Input circular buffer. + * @brief I/O driver status flags. */ - uint8_t ib[SERIAL_BUFFERS_SIZE]; + sdflags_t flags; /** - * Output circular buffer. + * @brief Input circular buffer. */ - uint8_t ob[SERIAL_BUFFERS_SIZE]; + uint8_t ib[SERIAL_BUFFERS_SIZE]; + /** + * @brief Output circular buffer. + */ + uint8_t ob[SERIAL_BUFFERS_SIZE]; + /* End of the mandatory fields.*/ /** * Listen socket for simulated serial port. */ - SOCKET com_listen; + SOCKET com_listen; /** * Data socket for simulated serial port. */ - SOCKET com_data; + SOCKET com_data; /** * Port readable name. */ - const char *com_name; + const char *com_name; }; -/** - * @brief Generic Serial Driver configuration structure. - * @details An instance of this structure must be passed to @p sdStart() - * in order to configure and start a serial driver operations. - * - * @note This structure content is architecture dependent, each driver - * implementation defines its own version and the custom static - * initializers. - */ -typedef struct { -} SerialDriverConfig; - /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ @@ -160,7 +169,7 @@ extern SerialDriver SD2; extern "C" { #endif void sd_lld_init(void); - void sd_lld_start(SerialDriver *sdp, const SerialDriverConfig *config); + void sd_lld_start(SerialDriver *sdp); void sd_lld_stop(SerialDriver *sdp); bool_t sd_lld_interrupt_pending(void); #ifdef __cplusplus -- cgit v1.2.3