diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-13 12:40:42 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-13 12:40:42 +0000 |
commit | fbac4d253d67cc5b1ec39166ce1abb8124b1e3a8 (patch) | |
tree | 23300615d3484cef1515fba815a7218f1118d377 /os/hal/src | |
parent | b86e5efeeb17af6937319d0fd874fc64b0c1ccb4 (diff) | |
download | ChibiOS-fbac4d253d67cc5b1ec39166ce1abb8124b1e3a8.tar.gz ChibiOS-fbac4d253d67cc5b1ec39166ce1abb8124b1e3a8.tar.bz2 ChibiOS-fbac4d253d67cc5b1ec39166ce1abb8124b1e3a8.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3314 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r-- | os/hal/src/ext.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/os/hal/src/ext.c b/os/hal/src/ext.c index d68758684..1c83cd2e6 100644 --- a/os/hal/src/ext.c +++ b/os/hal/src/ext.c @@ -78,6 +78,8 @@ void extObjectInit(EXTDriver *extp) { /**
* @brief Configures and activates the EXT peripheral.
+ * @post After activation all EXT channels are in the disabled state,
+ * use @p extChannelEnable() in order to activate them.
*
* @param[in] extp pointer to the @p EXTDriver object
* @param[in] config pointer to the @p EXTConfig object
@@ -116,6 +118,50 @@ void extStop(EXTDriver *extp) { chSysUnlock();
}
+/**
+ * @brief Enables an EXT channel.
+ *
+ * @param[in] extp pointer to the @p EXTDriver object
+ * @param[in] channel channel to be enabled
+ *
+ * @api
+ */
+void extChannelEnable(EXTDriver *extp, expchannel_t channel) {
+
+ chDbgCheck((extp != NULL) &&
+ (channel < EXT_MAX_CHANNELS) &&
+ (extp->config->channels[channel].mode != EXT_CH_MODE_DISABLED),
+ "extChannelEnable");
+
+ chSysLock();
+ chDbgAssert(extp->state == EXT_ACTIVE,
+ "extChannelEnable(), #1", "invalid state");
+ extChannelEnableI(extp, channel);
+ chSysUnlock();
+}
+
+/**
+ * @brief Disables an EXT channel.
+ *
+ * @param[in] extp pointer to the @p EXTDriver object
+ * @param[in] channel channel to be disabled
+ *
+ * @api
+ */
+void extChannelDisable(EXTDriver *extp, expchannel_t channel) {
+
+ chDbgCheck((extp != NULL) &&
+ (channel < EXT_MAX_CHANNELS) &&
+ (extp->config->channels[channel].mode != EXT_CH_MODE_DISABLED),
+ "extChannelDisable");
+
+ chSysLock();
+ chDbgAssert(extp->state == EXT_ACTIVE,
+ "extChannelDisable(), #1", "invalid state");
+ extChannelDisableI(extp, channel);
+ chSysUnlock();
+}
+
#endif /* HAL_USE_EXT */
/** @} */
|