diff options
Diffstat (limited to 'os/hal/templates')
-rw-r--r-- | os/hal/templates/ext_lld.c | 7 | ||||
-rw-r--r-- | os/hal/templates/ext_lld.h | 19 |
2 files changed, 23 insertions, 3 deletions
diff --git a/os/hal/templates/ext_lld.c b/os/hal/templates/ext_lld.c index 45bc1c3dc..fc9c2181d 100644 --- a/os/hal/templates/ext_lld.c +++ b/os/hal/templates/ext_lld.c @@ -39,6 +39,11 @@ /* Driver exported variables. */
/*===========================================================================*/
+/**
+ * @brief EXTD1 driver identifier.
+ */
+EXTDriver EXTD1;
+
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
@@ -62,6 +67,8 @@ */
void ext_lld_init(void) {
+ /* Driver initialization.*/
+ extObjectInit(&EXTD1);
}
/**
diff --git a/os/hal/templates/ext_lld.h b/os/hal/templates/ext_lld.h index 494cef1b9..f299a8914 100644 --- a/os/hal/templates/ext_lld.h +++ b/os/hal/templates/ext_lld.h @@ -63,14 +63,23 @@ typedef uint32_t expchannel_t; * @param[in] extp pointer to the @p EXPDriver object triggering the
* callback
*/
-typedef void (*extcallback_t)(EXTDriver *extp);
+typedef void (*extcallback_t)(EXTDriver *extp, expchannel_t channel);
/**
* @brief Channel configuration structure.
*/
typedef struct {
- uint32_t mode; /**< @brief Channel mode. */
- extcallback_t cb; /**< @brief Channel callback. */
+ /**
+ * @brief Channel mode.
+ */
+ uint32_t mode;
+ /**
+ * @brief Channel callback.
+ * @details In the STM32 implementation a @p NULL callback pointer is
+ * valid and configures the channel as an event sources instead
+ * of an interrupt source.
+ */
+ extcallback_t cb;
} EXTChannelConfig;
/**
@@ -108,6 +117,10 @@ struct EXTDriver { /* External declarations. */
/*===========================================================================*/
+#if !defined(__DOXYGEN__)
+extern EXTDriver EXTD1;
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
|