![]() |
Choco OS
V.0.16.9.0
Join to the chocolate world
|
System clock related operations. More...
Typedefs | |
typedef void(* | oC_CLOCK_LLD_Interrupt_t) (oC_Frequency_t Frequency) |
type for storing interrupts pointers More... | |
Enumerations |
Functions | |
oC_ErrorCode_t | oC_CLOCK_LLD_TurnOnDriver (void) |
initializes the driver to work More... | |
oC_ErrorCode_t | oC_CLOCK_LLD_TurnOffDriver (void) |
release the driver More... | |
oC_CLOCK_LLD_ClockSource_t | oC_CLOCK_LLD_GetClockSource (void) |
returns source of the system clock More... | |
oC_Frequency_t | oC_CLOCK_LLD_GetClockFrequency (void) |
returns frequency of the system clock More... | |
oC_Frequency_t | oC_CLOCK_LLD_GetOscillatorFrequency (void) |
returns frequency of the oscillator More... | |
oC_Frequency_t | oC_CLOCK_LLD_GetMaximumClockFrequency (void) |
returns maximum frequency permissible for the machine More... | |
oC_ErrorCode_t | oC_CLOCK_LLD_SetClockConfiguredInterrupt (oC_CLOCK_LLD_Interrupt_t Interrupt) |
configures an interrupt for clock configured event More... | |
bool | oC_CLOCK_LLD_DelayForMicroseconds (oC_UInt_t Microseconds) |
perform a delay for us More... | |
oC_ErrorCode_t | oC_CLOCK_LLD_ConfigureInternalClock (oC_Frequency_t TargetFrequency, oC_Frequency_t PermissibleDifference) |
configures system clock in internal mode More... | |
oC_ErrorCode_t | oC_CLOCK_LLD_ConfigureExternalClock (oC_Frequency_t TargetFrequency, oC_Frequency_t PermissibleDifference, oC_Frequency_t OscillatorFrequency) |
configures system clock to work in external mode More... | |
oC_ErrorCode_t | oC_CLOCK_LLD_ConfigureHibernationClock (oC_Frequency_t TargetFrequency, oC_Frequency_t PermissibleDifference, oC_Frequency_t OscillatorFrequency) |
configures system clock to work in hibernation mode More... | |
typedef void(* oC_CLOCK_LLD_Interrupt_t) (oC_Frequency_t Frequency) |
Frequency | New frequency, that was configured |
The type is for storing pointers to interrupts for the CLOCK-LLD module.
Definition at line 88 of file oc_clock_lld.h.
The type is for storing source of the system clock.
Enumerator | |
---|---|
oC_CLOCK_LLD_ClockSource_Internal |
an internal clock source is used |
oC_CLOCK_LLD_ClockSource_External |
an external source of the clock is used |
Definition at line 73 of file oc_clock_lld.h.
oC_ErrorCode_t oC_CLOCK_LLD_ConfigureExternalClock | ( | oC_Frequency_t | TargetFrequency, |
oC_Frequency_t | PermissibleDifference, | ||
oC_Frequency_t | OscillatorFrequency | ||
) |
TargetFrequency | The frequency to achieve for the system clock. |
PermissibleDifference | Maximum difference between real frequency and the wanted frequency that is acceptable by the user |
OscillatorFrequency | The frequency of the external oscillator that is connected to the machine |
Definition at line 405 of file oc_clock_lld.c.
oC_ErrorCode_t oC_CLOCK_LLD_ConfigureHibernationClock | ( | oC_Frequency_t | TargetFrequency, |
oC_Frequency_t | PermissibleDifference, | ||
oC_Frequency_t | OscillatorFrequency | ||
) |
TargetFrequency | The frequency to achieve for the system clock. |
PermissibleDifference | Maximum difference between real frequency and the wanted frequency that is acceptable by the user |
OscillatorFrequency | The frequency of the external oscillator connected to the correct pins in the machine |
Definition at line 510 of file oc_clock_lld.c.
oC_ErrorCode_t oC_CLOCK_LLD_ConfigureInternalClock | ( | oC_Frequency_t | TargetFrequency, |
oC_Frequency_t | PermissibleDifference | ||
) |
The function configures the system clock to work with internal oscillator with given frequency.
TargetFrequency | The frequency to achieve for the system clock. |
PermissibleDifference | Maximum difference between real frequency and the wanted frequency that is acceptable by the user |
Definition at line 312 of file oc_clock_lld.c.
bool oC_CLOCK_LLD_DelayForMicroseconds | ( | oC_UInt_t | Microseconds | ) |
The function is for performing a delay in microseconds. It is important, that this function should be implemented as simple as possible (for example by using a loop) to provide shortest time that is possible. Note, that when this function is used, there is no guarantee, that some other system task will not interrupt this process, so there is a possible that this delay will stay for more time that expected. It is recommended only for short delays, that can not be achieved by using other delay functions.
Microseconds | Number of microseconds to delay |
Definition at line 297 of file oc_clock_lld.c.
oC_Frequency_t oC_CLOCK_LLD_GetClockFrequency | ( | void | ) |
The function is for reading actual clock frequency configuration
Definition at line 237 of file oc_clock_lld.c.
oC_CLOCK_LLD_ClockSource_t oC_CLOCK_LLD_GetClockSource | ( | void | ) |
The function returns actual configured clock source.
Definition at line 226 of file oc_clock_lld.c.
oC_Frequency_t oC_CLOCK_LLD_GetMaximumClockFrequency | ( | void | ) |
The function returns maximum frequency that is possible for the given machine.
Definition at line 259 of file oc_clock_lld.c.
oC_Frequency_t oC_CLOCK_LLD_GetOscillatorFrequency | ( | void | ) |
Definition at line 248 of file oc_clock_lld.c.
oC_ErrorCode_t oC_CLOCK_LLD_SetClockConfiguredInterrupt | ( | oC_CLOCK_LLD_Interrupt_t | Interrupt | ) |
The function is for setting a function handler for an interrupt that occurs, when the system clock is configured. The handler is called every time, when some module will change the clock configuration. It can be useful for some frequency related modules, such as #UART and #SPI, that use a system clock for its internal transmission clocks.
Interrupt | Pointer to the interrupt handler function |
Definition at line 270 of file oc_clock_lld.c.
oC_ErrorCode_t oC_CLOCK_LLD_TurnOffDriver | ( | void | ) |
The function is for releasing resources needed for the driver. The main driver should call it every time, when it is turned off. This function should restore default states in all resources, that are handled and was initialized by the driver. It must not protect by itself again turning off the driver when it is not turned on.
Definition at line 197 of file oc_clock_lld.c.
oC_ErrorCode_t oC_CLOCK_LLD_TurnOnDriver | ( | void | ) |
The function is for initializing the low level driver. It will be called every time when the driver will turned on. There is no need to protect again returning because the main driver should protect it by itself.
Definition at line 160 of file oc_clock_lld.c.