diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-04-20 15:39:07 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-04-20 15:39:07 +0000 |
commit | 3621ac37b0cbab7737d215db0335017561856a10 (patch) | |
tree | b40e3244e794f2dc706b71ff8bff44e1b0fdf0ad /os/hal/platforms/Win32 | |
parent | d49704990da043573942c0a35de92fc89d62d525 (diff) | |
download | ChibiOS-3621ac37b0cbab7737d215db0335017561856a10.tar.gz ChibiOS-3621ac37b0cbab7737d215db0335017561856a10.tar.bz2 ChibiOS-3621ac37b0cbab7737d215db0335017561856a10.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1881 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/Win32')
-rw-r--r-- | os/hal/platforms/Win32/serial_lld.c | 13 | ||||
-rw-r--r-- | os/hal/platforms/Win32/serial_lld.h | 38 |
2 files changed, 26 insertions, 25 deletions
diff --git a/os/hal/platforms/Win32/serial_lld.c b/os/hal/platforms/Win32/serial_lld.c index 098f1dc93..43c7b331a 100644 --- a/os/hal/platforms/Win32/serial_lld.c +++ b/os/hal/platforms/Win32/serial_lld.c @@ -216,14 +216,17 @@ void sd_lld_init(void) { }
/**
- * @brief Low level serial driver configuration and (re)start.
+ * @brief Low level serial driver configuration and (re)start.
*
- * @param[in] sdp pointer to a @p SerialDriver object
+ * @param[in] sdp pointer to a @p SerialDriver object
+ * @param[in] config the architecture-dependent serial driver configuration.
+ * If this parameter is set to @p NULL then a default
+ * configuration is used.
*/
-void sd_lld_start(SerialDriver *sdp) {
+void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) {
- if (sdp->config == NULL)
- sdp->config = &default_config;
+ if (config == NULL)
+ config = &default_config;
#if USE_WIN32_SERIAL1
if (sdp == &SD1)
diff --git a/os/hal/platforms/Win32/serial_lld.h b/os/hal/platforms/Win32/serial_lld.h index 6ded1c4f2..37f96e13b 100644 --- a/os/hal/platforms/Win32/serial_lld.h +++ b/os/hal/platforms/Win32/serial_lld.h @@ -18,8 +18,9 @@ */
/**
- * @file Win32/serial_lld.h
- * @brief Win32 low level simulated serial driver header.
+ * @file Win32/serial_lld.h
+ * @brief Win32 low level simulated serial driver header.
+ *
* @addtogroup WIN32_SERIAL
* @{
*/
@@ -34,41 +35,41 @@ /*===========================================================================*/
/**
- * @brief Serial buffers size.
+ * @brief Serial buffers size.
* @details Configuration parameter, you can change the depth of the queue
- * buffers depending on the requirements of your application.
+ * buffers depending on the requirements of your application.
*/
#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
#define SERIAL_BUFFERS_SIZE 1024
#endif
/**
- * @brief SD1 driver enable switch.
+ * @brief SD1 driver enable switch.
* @details If set to @p TRUE the support for SD1 is included.
- * @note The default is @p TRUE.
+ * @note The default is @p TRUE.
*/
#if !defined(USE_WIN32_SERIAL1) || defined(__DOXYGEN__)
#define USE_WIN32_SERIAL1 TRUE
#endif
/**
- * @brief SD2 driver enable switch.
+ * @brief SD2 driver enable switch.
* @details If set to @p TRUE the support for SD2 is included.
- * @note The default is @p TRUE.
+ * @note The default is @p TRUE.
*/
#if !defined(USE_WIN32_SERIAL2) || defined(__DOXYGEN__)
#define USE_WIN32_SERIAL2 TRUE
#endif
/**
- * @brief Listen port for SD1.
+ * @brief Listen port for SD1.
*/
#if !defined(SD1_PORT) || defined(__DOXYGEN__)
#define SD1_PORT 29001
#endif
/**
- * @brief Listen port for SD2.
+ * @brief Listen port for SD2.
*/
#if !defined(SD2_PORT) || defined(__DOXYGEN__)
#define SD2_PORT 29002
@@ -83,31 +84,28 @@ /*===========================================================================*/
/**
- * Serial Driver condition flags type.
+ * @brief Serial Driver condition flags type.
*/
typedef uint32_t sdflags_t;
/**
- * @brief Generic Serial Driver configuration structure.
+ * @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.
+ * @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.
+ * @brief @p SerialDriver specific data.
*/
#define _serial_driver_data \
_base_asynchronous_channel_data \
/* Driver state.*/ \
sdstate_t state; \
- /* Current configuration data.*/ \
- const SerialConfig *config; \
/* Input queue.*/ \
InputQueue iqueue; \
/* Output queue.*/ \
@@ -143,7 +141,7 @@ extern SerialDriver SD2; extern "C" {
#endif
void sd_lld_init(void);
- void sd_lld_start(SerialDriver *sdp);
+ void sd_lld_start(SerialDriver *sdp, const SerialConfig *config);
void sd_lld_stop(SerialDriver *sdp);
bool_t sd_lld_interrupt_pending(void);
#ifdef __cplusplus
|