diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-04-23 17:43:42 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-04-23 17:43:42 +0000 |
commit | e817b7032d9610508e39921c65cda6ba108db357 (patch) | |
tree | fc4f7dfd20f8655e87b6165a4da1f27ba134c3a4 /os/hal/include | |
parent | cdabdb46317e967dc0fa79e8c23cde3c2ffd0b10 (diff) | |
download | ChibiOS-e817b7032d9610508e39921c65cda6ba108db357.tar.gz ChibiOS-e817b7032d9610508e39921c65cda6ba108db357.tar.bz2 ChibiOS-e817b7032d9610508e39921c65cda6ba108db357.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4128 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r-- | os/hal/include/ext.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/os/hal/include/ext.h b/os/hal/include/ext.h index 56e683019..37a7dcd15 100644 --- a/os/hal/include/ext.h +++ b/os/hal/include/ext.h @@ -36,7 +36,7 @@ /*===========================================================================*/
/**
- * @name EXT channels modes
+ * @name EXT channel modes
* @{
*/
#define EXT_CH_MODE_EDGES_MASK 3 /**< @brief Mask of edges field. */
@@ -104,6 +104,27 @@ typedef struct EXTDriver EXTDriver; * @iclass
*/
#define extChannelDisableI(extp, channel) ext_lld_channel_disable(extp, channel)
+
+/**
+ * @brief Changes the operation mode of a channel.
+ * @note This function attempts to write over the current configuration
+ * structure that must have been not declared constant. This
+ * violates the @p const qualifier in @p extStart() but it is
+ * intentional. This function cannot be used if the configuration
+ * structure is declared @p const.
+ *
+ * @param[in] extp pointer to the @p EXTDriver object
+ * @param[in] channel channel to be changed
+ * @param[in] extcp new configuration for the channel
+ *
+ * @api
+ */
+#define extSetChannelMode(extp, channel, extcp) { \
+ chSysLock(); \
+ extSetChannelModeI(extp, channel, extcp); \
+ chSysUnlock(); \
+}
+
/** @} */
/*===========================================================================*/
@@ -119,6 +140,9 @@ extern "C" { void extStop(EXTDriver *extp);
void extChannelEnable(EXTDriver *extp, expchannel_t channel);
void extChannelDisable(EXTDriver *extp, expchannel_t channel);
+ void extSetChannelModeI(EXTDriver *extp,
+ expchannel_t channel,
+ const EXTChannelConfig *extcp);
#ifdef __cplusplus
}
#endif
|