SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Classes | Functions
sys-clk.h File Reference
#include <io.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include "reg/reg-ccu.h"
Include dependency graph for sys-clk.h:

Go to the source code of this file.

Classes

struct  sunxi_clk_t
 

Functions

void sunxi_clk_init (void)
 Initialize the global clocks.
 
void sunxi_clk_pre_init (void)
 Initialize the necessary clocks for minsys boot up.
 
uint32_t sunxi_clk_get_hosc_type (void)
 Get the type of High-Speed Oscillator (HOSC).
 
void sunxi_clk_reset (void)
 Reset the global clocks.
 
void sunxi_clk_dump (void)
 Dump all clock-related register values.
 
uint32_t sunxi_clk_get_peri1x_rate ()
 Get the clock rate of the PERI1X bus.
 
void sunxi_usb_clk_deinit ()
 Deinitialize USB clock.
 
void sunxi_clk_set_cpu_pll (uint32_t freq)
 Change the cpu freq.
 

Function Documentation

◆ sunxi_clk_dump()

void sunxi_clk_dump ( void  )

Dump all clock-related register values.

This function prints out all clock-related register values for debugging and observation.

◆ sunxi_clk_get_hosc_type()

uint32_t sunxi_clk_get_hosc_type ( void  )

Get the type of High-Speed Oscillator (HOSC).

This function retrieves the type of the High-Speed Oscillator currently being used. The returned value can indicate different HOSC configurations or features supported by the system.

Returns
uint32_t Type of the HOSC.

◆ sunxi_clk_get_peri1x_rate()

uint32_t sunxi_clk_get_peri1x_rate ( )

Get the clock rate of the PERI1X bus.

Returns
The clock rate of the PERI1X bus in Hz.

◆ sunxi_clk_init()

void sunxi_clk_init ( void  )

Initialize the global clocks.

This function initializes the global clocks, including PLLs and clock dividers.

Initialize the global clocks.

This function configures various clock sources for the CPU, AXI, APB, NSI, and MBUS based on the Sunxi platform's requirements. The function also prints debug messages to track the initialization process.

It performs the following tasks:

Note
This function should be called during the system initialization process to ensure the correct operation of the platform's clock system.
Warning
Ensure that all the clock configuration functions are correctly implemented and tested to avoid system instability.

◆ sunxi_clk_pre_init()

void sunxi_clk_pre_init ( void  )

Initialize the necessary clocks for minsys boot up.

This function initializes the necessary clocks for minsys boot up clocks

◆ sunxi_clk_reset()

void sunxi_clk_reset ( void  )

Reset the global clocks.

This function resets all global clocks to their default values.

◆ sunxi_clk_set_cpu_pll()

void sunxi_clk_set_cpu_pll ( uint32_t  freq)

Change the cpu freq.

Parameters
freqThe freq of cpu want to set.

◆ sunxi_usb_clk_deinit()

void sunxi_usb_clk_deinit ( )

Deinitialize USB clock.