Struct kea_hal::clocks::ics::Ics [−][src]
pub struct Ics { pub system_clock: SystemClock<IntRefClock, FllEnabled, LpDisabled>, pub irc_out: IrcOut<DefaultIrcOut>, pub lock_status: LockStatus<Poll>, }
Expand description
HAL struct for the Internal clock system.
Fields
system_clock: SystemClock<IntRefClock, FllEnabled, LpDisabled>
The state of the source of the system clock
The ICS defaults to the FEI mode of operation. In this mode, ICSOUT, which is the system clock, is 16MHz = IRC * FLL * BDIV = 31.25kHz * 1024 / 2; at default values.
irc_out: IrcOut<DefaultIrcOut>
The state of ICSIRCLK output
lock_status: LockStatus<Poll>
The state of the frequency-locked loop monitor
Implementations
Read the IRC’s trim value.
This SCTRIM is used to tweak the frequency of the Internal Reference Clock. This factory trimmed value is loaded from nonvolatile memory on boot to set the IRC to be 31.25kHZ (yielding a 16MHz system clock in FEI mode). Note that this interface includes the SCFTRIM bit, which contains the LSB of the value used by the ICS module.
Set the IRC’s trim value.
This SCTRIM is used to tweak the frequency of the Internal Reference Clock. This factory trimmed value is loaded from nonvolatile memory on boot to set the IRC to be 31.25kHZ (yielding a 16MHz system clock in FEI mode). Note that this interface includes the SCFTRIM bit, which contains the LSB of the value used by the ICS module.
Write 0x1FF to max out the system clock frequency to (close to) 40MHz.
If system_clock configured in FEI mode this should probably wait for the FLL to stabilize (LOCK)
Returns which reference clock is currently active.
Indicates the current clock mode, either Internal or External Reference Clock 0 = ExtRefClock, 1 = IntRefClock.
This should probably return an Enum value, or the sub-types used in the SystemClock struct. For now this just returns the field value until this can be rethought.
Returns which clock mode is currently active.
0 = FllEnabled 1 = IntRefClock,FllBypassed (FBI mode) 2 = ExtRefClock,FllBypassed (FBE mode) 3 = Reserved, not used.
This should probably return an Enum value, or the sub-types used in the SystemClock struct. For nwo this just returns the field value until this can be rethough