mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-11 04:51:31 +11:00
Update doc comment of set_clock_divisor, clock_divisor_fixed_point
This commit is contained in:
parent
81da6f12fe
commit
2f077a434b
|
@ -638,6 +638,10 @@ impl<SM: ValidStateMachine, State> StateMachine<SM, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Change the clock divider of a state machine.
|
/// Change the clock divider of a state machine.
|
||||||
|
///
|
||||||
|
/// Changing the clock divider of a running state machine is allowed
|
||||||
|
/// and guaranteed to not cause any glitches, but the exact timing of
|
||||||
|
/// clock pulses during the change is not specified.
|
||||||
pub fn set_clock_divisor(&mut self, divisor: f32) {
|
pub fn set_clock_divisor(&mut self, divisor: f32) {
|
||||||
// sm frequency = clock freq / (CLKDIV_INT + CLKDIV_FRAC / 256)
|
// sm frequency = clock freq / (CLKDIV_INT + CLKDIV_FRAC / 256)
|
||||||
let int = divisor as u16;
|
let int = divisor as u16;
|
||||||
|
@ -647,6 +651,10 @@ impl<SM: ValidStateMachine, State> StateMachine<SM, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Change the clock divider of a state machine using a 16.8 fixed point value.
|
/// Change the clock divider of a state machine using a 16.8 fixed point value.
|
||||||
|
///
|
||||||
|
/// Changing the clock divider of a running state machine is allowed
|
||||||
|
/// and guaranteed to not cause any glitches, but the exact timing of
|
||||||
|
/// clock pulses during the change is not specified.
|
||||||
pub fn clock_divisor_fixed_point(&mut self, int: u16, frac: u8) {
|
pub fn clock_divisor_fixed_point(&mut self, int: u16, frac: u8) {
|
||||||
self.sm.set_clock_divisor(int, frac);
|
self.sm.set_clock_divisor(int, frac);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue