SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Functions | Variables
sys-clk.c File Reference

System clock driver for Allwinner (sunxi) platforms. More...

#include <io.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include <log.h>
Include dependency graph for sys-clk.c:

Functions

void __attribute__ ((weak))
 Initialize system clocks.
 

Variables

uint32_t current_hosc_freq
 Current high-speed oscillator frequency.
 

Detailed Description

System clock driver for Allwinner (sunxi) platforms.

This file provides weak implementations of clock-related functions that can be overridden by platform-specific code.

Function Documentation

◆ __attribute__()

void __attribute__ ( (weak)  )

Initialize system clocks.

Set CPU PLL frequency.

Get peripheral 1x clock rate.

Initialize USB clocks.

Deinitialize USB clocks.

Dump clock information.

Reset system clocks.

Get high-speed oscillator type.

Pre-initialize system clocks.

This weak function initializes all system clocks. Platform-specific implementations should override this function.

This weak function performs preliminary clock initialization before the main clock initialization. Platform-specific implementations should override this function.

This weak function returns the type/frequency of the high-speed oscillator (HOSC). The default implementation returns 24 MHz.

Returns
High-speed oscillator frequency in MHz

This weak function resets system clocks to their default state. Platform-specific implementations should override this function.

This weak function dumps information about the current clock configuration for debugging purposes. Platform-specific implementations should override this function.

This weak function deinitializes clocks for USB controllers. Platform-specific implementations should override this function.

This weak function initializes clocks for USB controllers. Platform-specific implementations should override this function.

This weak function returns the frequency of the peripheral 1x clock. The default implementation returns 0.

Returns
Peripheral 1x clock frequency in Hz

This weak function configures the CPU PLL to the specified frequency. Platform-specific implementations should override this function.

Parameters
freqTarget frequency in Hz

Variable Documentation

◆ current_hosc_freq

uint32_t current_hosc_freq
extern

Current high-speed oscillator frequency.

This external variable holds the current frequency of the high-speed oscillator (HOSC) in MHz.

Current high-speed oscillator frequency.