CRpi
A library for rpi with intefaces to: gpio, pwm, dma
|
Interface to the clock manager peripheral. More...
Go to the source code of this file.
Macros | |
#define | CLK_SRC_GND 0 |
Clock source: Ground: 0Hz. | |
#define | CLK_SRC_OSCILLATOR 1 |
Clock source: Oscillator: 19.2MHz. | |
#define | CLK_SRC_TESTDBG0 2 |
Clock source: Testdebug0: 0Hz. | |
#define | CLK_SRC_TESTDBG1 3 |
Clock source: TestDebug1: 0Hz. | |
#define | CLK_SRC_PLLA 4 |
Clock source: PLLA: 0Hz. | |
#define | CLK_SRC_PLLC 5 |
Clock source: PLLC: 1000MHz (changes with overclock) | |
#define | CLK_SRC_PLLD 6 |
Clock source: PLLD: 500MHz. | |
#define | CLK_SRC_HDMI 7 |
Clock source: HDMI: 216MHZ. | |
Functions | |
int | clkMan_init () |
Initializes this peripheral interface, to use before any other function in this file. More... | |
int | clkMan_isInit () |
true if clkMan_init has been called with success | |
int | clkMan_setClock_gp0 (int clockSrc, int divisorInt, int divisorFrac) |
sets the clock for the general purpouse clock 0 More... | |
int | clkMan_setClock_gp1 (int clockSrc, int divisorInt, int divisorFrac) |
sets the clock for the general purpouse clock 1 More... | |
int | clkMan_setClock_gp2 (int clockSrc, int divisorInt, int divisorFrac) |
sets the clock for the general purpouse clock 2 More... | |
int | clkMan_setClock_pcm (int clockSrc, int divisorInt, int divisorFrac) |
sets the clock for the pcm peripheral More... | |
int | clkMan_setClock_pwm (int clockSrc, int divisorInt, int divisorFrac) |
sets the clock for the pwm peripheral More... | |
Interface to the clock manager peripheral.
This peripheral controls various clocks in the BCM283x SoCs, for each of these clocks you can set a clock source and a frequency divider.
See the CLK_SRC_* macros for the available clock sources and their speed.
int clkMan_init | ( | ) |
Initializes this peripheral interface, to use before any other function in this file.
int clkMan_setClock_gp0 | ( | int | clockSrc, |
int | divisorInt, | ||
int | divisorFrac | ||
) |
sets the clock for the general purpouse clock 0
clockSrc | The desired clock source (use the CLK_SRC_* macros) |
divisorInt | Integer part of the divisor |
divisorFrac | Fractional part of the divisor |
int clkMan_setClock_gp1 | ( | int | clockSrc, |
int | divisorInt, | ||
int | divisorFrac | ||
) |
sets the clock for the general purpouse clock 1
clockSrc | The desired clock source (use the CLK_SRC_* macros) |
divisorInt | Integer part of the divisor |
divisorFrac | Fractional part of the divisor |
int clkMan_setClock_gp2 | ( | int | clockSrc, |
int | divisorInt, | ||
int | divisorFrac | ||
) |
sets the clock for the general purpouse clock 2
clockSrc | The desired clock source (use the CLK_SRC_* macros) |
divisorInt | Integer part of the divisor |
divisorFrac | Fractional part of the divisor |
int clkMan_setClock_pcm | ( | int | clockSrc, |
int | divisorInt, | ||
int | divisorFrac | ||
) |
sets the clock for the pcm peripheral
clockSrc | The desired clock source (use the CLK_SRC_* macros) |
divisorInt | Integer part of the divisor |
divisorFrac | Fractional part of the divisor |
int clkMan_setClock_pwm | ( | int | clockSrc, |
int | divisorInt, | ||
int | divisorFrac | ||
) |
sets the clock for the pwm peripheral
clockSrc | The desired clock source (use the CLK_SRC_* macros) |
divisorInt | Integer part of the divisor |
divisorFrac | Fractional part of the divisor |