aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-01-02 13:35:55 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-01-02 13:35:55 +0000
commitbedb87c1e7cc9741c57c299d81d6e24c5e9c59c5 (patch)
tree7a3f0b05365b525bd9335b9a660aa80b6b6975b3 /os/hal/templates
parent15e6fecf11e470abebe963177434f83883e63acf (diff)
downloadChibiOS-bedb87c1e7cc9741c57c299d81d6e24c5e9c59c5.tar.gz
ChibiOS-bedb87c1e7cc9741c57c299d81d6e24c5e9c59c5.tar.bz2
ChibiOS-bedb87c1e7cc9741c57c299d81d6e24c5e9c59c5.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1495 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/templates')
-rw-r--r--os/hal/templates/can_lld.h4
-rw-r--r--os/hal/templates/serial_lld.c11
-rw-r--r--os/hal/templates/serial_lld.h67
3 files changed, 44 insertions, 38 deletions
diff --git a/os/hal/templates/can_lld.h b/os/hal/templates/can_lld.h
index c6f0de0cb..6e55eb2c6 100644
--- a/os/hal/templates/can_lld.h
+++ b/os/hal/templates/can_lld.h
@@ -60,8 +60,8 @@
/* Derived constants and error checks. */
/*===========================================================================*/
-#if !CH_USE_SEMAPHORES || !CH_USE_EVENTS
-#error "the ADC driver requires CH_USE_SEMAPHORES and CH_USE_EVENTS"
+#if CAN_USE_SLEEP_MODE && !CAN_SUPPORTS_SLEEP
+#error "CAN sleep mode not supported in this architecture"
#endif
/*===========================================================================*/
diff --git a/os/hal/templates/serial_lld.c b/os/hal/templates/serial_lld.c
index 63d1b09cf..cd155f210 100644
--- a/os/hal/templates/serial_lld.c
+++ b/os/hal/templates/serial_lld.c
@@ -38,7 +38,7 @@
/*===========================================================================*/
/** @brief Driver default configuration.*/
-static const SerialDriverConfig default_config = {
+static const SerialConfig default_config = {
};
/*===========================================================================*/
@@ -64,14 +64,11 @@ void sd_lld_init(void) {
* @brief Low level serial driver configuration and (re)start.
*
* @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, const SerialDriverConfig *config) {
+void sd_lld_start(SerialDriver *sdp) {
- if (config == NULL)
- config = &default_config;
+ if (sdp->sd.config == NULL)
+ sdp->sd.config = &default_config;
}
diff --git a/os/hal/templates/serial_lld.h b/os/hal/templates/serial_lld.h
index 68d99c3e7..2a54fd56d 100644
--- a/os/hal/templates/serial_lld.h
+++ b/os/hal/templates/serial_lld.h
@@ -51,51 +51,60 @@
typedef uint8_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.*/
};
-/**
- * @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;
-
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
@@ -108,7 +117,7 @@ typedef struct {
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);
#ifdef __cplusplus
}