@@ -122,25 +122,171 @@ impl From<CounterMode> for mcpwm_counter_type_t {
122122// TODO: Note that `red` and `fed` from the IDF's perspecitve is time as in number of clock cycles after the
123123// MCPWM modules group prescaler. How do we want to expose this? Do we expose it as just that, a cycle count?
124124// Or do we expose it as a time which we then calculate the cycle count from?
125+ /// Deadtime config for MCPWM operator
126+ /// Note that the dead times are calculated from MCPWMXA's flanks unless explicitly stated otherwise
125127#[ derive( Copy , Clone , PartialEq , Debug ) ]
126128pub enum DeadtimeConfig {
127129 // TODO: Figure out what all of those options do and give them nice descriptions
128130 /// MCPWM_BYPASS_RED
131+ ///
132+ /// . . .
133+ /// . . .
134+ /// .--------------------. .
135+ /// | | .
136+ /// MCPWMXA in | | .
137+ /// | | .
138+ /// --------------- ---------------------
139+ /// . . .
140+ /// . . .
141+ /// .--------------------. .
142+ /// | | .
143+ /// MCPWMXA out | | .
144+ /// | | .
145+ /// --------------- ---------------------
146+ /// . . .
147+ /// . . .
148+ /// .------------------------.
149+ /// | >. |< fed
150+ /// MCPWMXB out | . |
151+ /// | . |
152+ /// --------------. . -----------------
153+ /// . . .
129154 BypassRisingEdge { fed : u16 } ,
130155
131156 /// MCPWM_BYPASS_FED
157+ ///
158+ /// . . .
159+ /// . . .
160+ /// .--------------------.
161+ /// | . |
162+ /// MCPWMXA in | . |
163+ /// | . |
164+ /// --------------- . ---------------------
165+ /// . . .
166+ /// . . .
167+ /// . .----------------.
168+ /// red >. |< |
169+ /// MCPWMXA out . | |
170+ /// . | |
171+ /// ------------------- ---------------------
172+ /// . . .
173+ /// . . .
174+ /// .--------------------.
175+ /// | . |
176+ /// MCPWMXB out | . |
177+ /// | . |
178+ /// --------------- . ---------------------
179+ /// . . .
132180 BypassFallingEdge { red : u16 } ,
133181
134182 /// MCPWM_ACTIVE_HIGH_MODE
183+ ///
184+ /// . . . .
185+ /// . . . .
186+ /// .--------------------. .
187+ /// | . | .
188+ /// MCPWMXA in | . | .
189+ /// | . | .
190+ /// --------------- . ---------------------
191+ /// . . . .
192+ /// . . . .
193+ /// . .----------------. .
194+ /// red >. |< | .
195+ /// MCPWMXA out . | | .
196+ /// . | | .
197+ /// ------------------- ---------------------
198+ /// . . . .
199+ /// . . . .
200+ /// .------------------------.
201+ /// | . >. |< fed
202+ /// MCPWMXB out | . . |
203+ /// | . . |
204+ /// --------------. . . -----------------
205+ /// . . . .
135206 ActiveHigh { red : u16 , fed : u16 } ,
136207
137208 /// MCPWM_ACTIVE_LOW_MODE
209+ ///
210+ /// . . . .
211+ /// . . . .
212+ /// .--------------------. .
213+ /// | . | .
214+ /// MCPWMXA in | . | .
215+ /// | . | .
216+ /// --------------- . ---------------------
217+ /// . . . .
218+ /// . . . .
219+ /// ------------------. .--------------------
220+ /// red >. |< | .
221+ /// MCPWMXA out . | | .
222+ /// . | | .
223+ /// . ------------------
224+ /// . . . .
225+ /// . . . .
226+ /// --------------. . . .----------------
227+ /// | . >. |< fed
228+ /// MCPWMXB out | . . |
229+ /// | . . |
230+ /// --------------------------
231+ /// . . . .
232+ /// . . . .
138233 ActiveLow { red : u16 , fed : u16 } ,
139234
140- /// MCPWM_ACTIVE_HIGH_COMPLIMENT_MODE
235+ // TODO: Is this actually true? --------
236+ // |
237+ // v
238+ /// MCPWM_ACTIVE_HIGH_COMPLIMENT_MODE - The most common deadtime mode
239+ ///
240+ /// . . . .
241+ /// . . . .
242+ /// .--------------------. .
243+ /// | . | .
244+ /// MCPWMXA in | . | .
245+ /// | . | .
246+ /// --------------- . ---------------------
247+ /// . . . .
248+ /// . . . .
249+ /// . .----------------. .
250+ /// red >. |< | .
251+ /// MCPWMXA out . | | .
252+ /// . | | .
253+ /// ------------------- ---------------------
254+ /// . . . .
255+ /// . . . .
256+ /// --------------. . . .----------------
257+ /// | . >. |< fed
258+ /// MCPWMXB out | . . |
259+ /// | . . |
260+ /// --------------------------
261+ /// . . . .
262+ /// . . . .
141263 ActiveHighComplement { red : u16 , fed : u16 } ,
142264
143265 /// MCPWM_ACTIVE_LOW_COMPLIMENT_MODE
266+ ///
267+ /// . . . .
268+ /// . . . .
269+ /// .--------------------. .
270+ /// | . | .
271+ /// MCPWMXA in | . | .
272+ /// | . | .
273+ /// --------------- . ---------------------
274+ /// . . . .
275+ /// . . . .
276+ /// ------------------. .--------------------
277+ /// red >. |< | .
278+ /// MCPWMXA out . | | .
279+ /// . | | .
280+ /// . ------------------
281+ /// . . . .
282+ /// . . . .
283+ /// .------------------------.
284+ /// | . >. |< fed
285+ /// MCPWMXB out | . . |
286+ /// | . . |
287+ /// --------------- . . -----------------
288+ /// . . . .
289+ /// . . . .
144290 ActiveLowComplement { red : u16 , fed : u16 } ,
145291
146292 /// MCPWM_ACTIVE_RED_FED_FROM_PWMXA
0 commit comments