diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-05-02 20:26:17 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-05-02 20:26:17 +0000 |
commit | b2431579e414f837add230e540af226a73ddc8ab (patch) | |
tree | 7183539f8effe30b104a7543f313dc53bb181c1d /os/hal/src | |
parent | 0b7c0f050c5ad42a55fc3635d6ae44bda5bfe049 (diff) | |
download | ChibiOS-b2431579e414f837add230e540af226a73ddc8ab.tar.gz ChibiOS-b2431579e414f837add230e540af226a73ddc8ab.tar.bz2 ChibiOS-b2431579e414f837add230e540af226a73ddc8ab.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7938 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r-- | os/hal/src/dac.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/os/hal/src/dac.c b/os/hal/src/dac.c index a4e0fa672..024547b78 100644 --- a/os/hal/src/dac.c +++ b/os/hal/src/dac.c @@ -131,6 +131,40 @@ void dacStop(DACDriver *dacp) { }
/**
+ * @brief Outputs a value directly on a DAC channel.
+ *
+ * @param[in] dacp pointer to the @p DACDriver object
+ * @param[in] channel DAC channel number
+ * @param[in] sample value to be output
+ *
+ * @api
+ */
+void dacPutChannel(DACDriver *dacp, dacchannel_t channel, dacsample_t sample) {
+
+ osalSysLock();
+ dacPutChannelI(dacp, channel, sample);
+ osalSysUnlock();
+}
+
+/**
+ * @brief Outputs a value directly on a DAC channel.
+ *
+ * @param[in] dacp pointer to the @p DACDriver object
+ * @param[in] channel DAC channel number
+ * @param[in] sample value to be output
+ *
+ * @iclass
+ */
+void dacPutChannelI(DACDriver *dacp, dacchannel_t channel, dacsample_t sample) {
+
+ osalDbgCheckClassI();
+ osalDbgCheck(channel < DAC_MAX_CHANNELS);
+ osalDbgAssert(dacp->state == DAC_READY, "invalid state");
+
+ dac_lld_put_channel(dacp, channel, sample);
+}
+
+/**
* @brief Starts a DAC conversion.
* @details Starts an asynchronous conversion operation.
* @note The buffer is organized as a matrix of M*N elements where M is the
|