diff options
| -rw-r--r-- | embassy-stm32/src/dac/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/embassy-stm32/src/dac/mod.rs b/embassy-stm32/src/dac/mod.rs index 6ead00e15..3e48d558a 100644 --- a/embassy-stm32/src/dac/mod.rs +++ b/embassy-stm32/src/dac/mod.rs | |||
| @@ -153,11 +153,10 @@ pub trait DacChannel<T: Instance, Tx> { | |||
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | /// Perform a software trigger on `ch` | 155 | /// Perform a software trigger on `ch` |
| 156 | fn trigger(&mut self) -> Result<(), Error> { | 156 | fn trigger(&mut self) { |
| 157 | T::regs().swtrigr().write(|reg| { | 157 | T::regs().swtrigr().write(|reg| { |
| 158 | reg.set_swtrig(Self::CHANNEL.index(), true); | 158 | reg.set_swtrig(Self::CHANNEL.index(), true); |
| 159 | }); | 159 | }); |
| 160 | Ok(()) | ||
| 161 | } | 160 | } |
| 162 | 161 | ||
| 163 | /// Set a value to be output by the DAC on trigger. | 162 | /// Set a value to be output by the DAC on trigger. |
| @@ -230,6 +229,8 @@ impl<'d, T: Instance, Tx> DacCh1<'d, T, Tx> { | |||
| 230 | } | 229 | } |
| 231 | 230 | ||
| 232 | /// Select a new trigger for this channel | 231 | /// Select a new trigger for this channel |
| 232 | /// | ||
| 233 | /// **Important**: This disables the channel! | ||
| 233 | pub fn select_trigger(&mut self, trigger: Ch1Trigger) -> Result<(), Error> { | 234 | pub fn select_trigger(&mut self, trigger: Ch1Trigger) -> Result<(), Error> { |
| 234 | unwrap!(self.disable_channel()); | 235 | unwrap!(self.disable_channel()); |
| 235 | T::regs().cr().modify(|reg| { | 236 | T::regs().cr().modify(|reg| { |
| @@ -245,6 +246,7 @@ impl<'d, T: Instance, Tx> DacCh1<'d, T, Tx> { | |||
| 245 | /// Note that for performance reasons in circular mode the transfer complete interrupt is disabled. | 246 | /// Note that for performance reasons in circular mode the transfer complete interrupt is disabled. |
| 246 | /// | 247 | /// |
| 247 | /// **Important:** Channel 1 has to be configured for the DAC instance! | 248 | /// **Important:** Channel 1 has to be configured for the DAC instance! |
| 249 | #[cfg(all(bdma, not(dma)))] // It currently only works with BDMA-only chips (DMA should theoretically work though) | ||
| 248 | pub async fn write(&mut self, data: ValueArray<'_>, circular: bool) -> Result<(), Error> | 250 | pub async fn write(&mut self, data: ValueArray<'_>, circular: bool) -> Result<(), Error> |
| 249 | where | 251 | where |
| 250 | Tx: DmaCh1<T>, | 252 | Tx: DmaCh1<T>, |
| @@ -355,6 +357,7 @@ impl<'d, T: Instance, Tx> DacCh2<'d, T, Tx> { | |||
| 355 | /// Note that for performance reasons in circular mode the transfer complete interrupt is disabled. | 357 | /// Note that for performance reasons in circular mode the transfer complete interrupt is disabled. |
| 356 | /// | 358 | /// |
| 357 | /// **Important:** Channel 2 has to be configured for the DAC instance! | 359 | /// **Important:** Channel 2 has to be configured for the DAC instance! |
| 360 | #[cfg(all(bdma, not(dma)))] // It currently only works with BDMA-only chips (DMA should theoretically work though) | ||
| 358 | pub async fn write(&mut self, data: ValueArray<'_>, circular: bool) -> Result<(), Error> | 361 | pub async fn write(&mut self, data: ValueArray<'_>, circular: bool) -> Result<(), Error> |
| 359 | where | 362 | where |
| 360 | Tx: DmaCh2<T>, | 363 | Tx: DmaCh2<T>, |
