Skip to content

Commit c53c0aa

Browse files
committed
Final(?) adjustments to doc
1 parent 59cef8c commit c53c0aa

File tree

1 file changed

+57
-6
lines changed

1 file changed

+57
-6
lines changed

src/mcpwm.rs

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ pub enum DeadtimeConfig {
218218
/// | . |
219219
/// --------------. . -----------------
220220
/// . . .
221-
/// . . . .
221+
/// . . .
222222
/// ```
223223
BypassRisingEdge { falling_edge_delay: u16 },
224224

@@ -250,7 +250,7 @@ pub enum DeadtimeConfig {
250250
/// | . |
251251
/// --------------- . ---------------------
252252
/// . . .
253-
/// . . . .
253+
/// . . .
254254
/// ```
255255
BypassFallingEdge { rising_edge_delay: u16 },
256256

@@ -378,7 +378,7 @@ pub enum DeadtimeConfig {
378378
/// red >. |< | .
379379
/// MCPWMXA out . | | .
380380
/// . | | .
381-
/// . ------------------
381+
/// . ------------------ .
382382
/// . . . .
383383
/// . . . .
384384
/// .------------------------.
@@ -398,6 +398,32 @@ pub enum DeadtimeConfig {
398398
///
399399
/// Note that `MCPWMXB in` will be completely ignored. This means `Operator::set_duty_b` will
400400
/// have no effect with this dead time mode
401+
///
402+
/// ```
403+
/// . . . .
404+
/// . . . .
405+
/// .--------------------. .
406+
/// | . | .
407+
/// MCPWMXA in | . | .
408+
/// | . | .
409+
/// --------------- . ---------------------
410+
/// . . . .
411+
/// . . . .
412+
/// . .--------------------.
413+
/// red >. |< . |
414+
/// MCPWMXA out . | . |
415+
/// . | . |
416+
/// ------------------- . ---------------------
417+
/// . . . .
418+
/// . . . .
419+
/// . .--------------------.
420+
/// red >. |< . |
421+
/// MCPWMXB out . | . |
422+
/// . | . |
423+
/// ------------------- . ---------------------
424+
/// . . . .
425+
/// . . . .
426+
/// ```
401427
ActiveRedFedFromPwmxa {
402428
rising_edge_delay: u16,
403429
falling_edge_delay: u16,
@@ -407,6 +433,31 @@ pub enum DeadtimeConfig {
407433
///
408434
/// Note that `MCPWMXA in` will be completely ignored. This means `Operator::set_duty_a` will
409435
/// have no effect with this dead time mode
436+
/// ```
437+
/// . . . .
438+
/// . . . .
439+
/// .--------------------. .
440+
/// | . | .
441+
/// MCPWMXB in | . | .
442+
/// | . | .
443+
/// --------------- . ---------------------
444+
/// . . . .
445+
/// . . . .
446+
/// . .--------------------.
447+
/// red >. |< . |
448+
/// MCPWMXA out . | . |
449+
/// . | . |
450+
/// ------------------- . ---------------------
451+
/// . . . .
452+
/// . . . .
453+
/// . .--------------------.
454+
/// red >. |< . |
455+
/// MCPWMXB out . | . |
456+
/// . | . |
457+
/// ------------------- . ---------------------
458+
/// . . . .
459+
/// . . . .
460+
/// ```
410461
ActiveRedFedFromPwmxb {
411462
rising_edge_delay: u16,
412463
falling_edge_delay: u16,
@@ -765,7 +816,6 @@ impl_operator!(
765816
);
766817

767818
// TODO: How do we want syncing to fit in to this?
768-
// TODO: How do we want dead time to fit into this?
769819
// TODO: How do we want carrier to fit into this?
770820
// TODO: How do we want capture to fit into this?
771821

@@ -880,7 +930,7 @@ where
880930
})
881931
}
882932

883-
pub fn release(self) -> (O, Option<PA>, Option<PB>) {
933+
/*pub fn release(self) -> (O, Option<PA>, Option<PB>) {
884934
// mcpwm_stop will only fail when invalid args are given
885935
esp!(unsafe { mcpwm_stop(U::unit(), O::timer()) }).unwrap();
886936
@@ -898,7 +948,7 @@ where
898948
899949
// TODO: Do we need to reset any more state here such as dead time config?
900950
(self._instance, self._pin_a, self._pin_b)
901-
}
951+
}*/
902952

903953
/// Get duty as percentage between 0.0 and 100.0 for output A
904954
pub fn get_duty_a(&self) -> Duty {
@@ -957,6 +1007,7 @@ where
9571007
}
9581008
}
9591009

1010+
/// Get PWM frequency
9601011
pub fn get_frequency(&self) -> Hertz {
9611012
Hertz::from(unsafe { esp_idf_sys::mcpwm_get_frequency(U::unit(), O::timer()) })
9621013
}

0 commit comments

Comments
 (0)