Interface to the clock manager peripheral.
More...
#include <memoryManagement/addressing.h>
#include <memoryManagement/physMemoryManagement.h>
#include <CCRCodingUtils/include/errorManagement.h>
#include <peripherals/clockManager.h>
#include <CCRCodingUtils/include/utils.h>
#include <unistd.h>
|
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.
If you haven't already, see clockManager.h You can find the documentation on the BCM2835 at page 105. The documentation about pwm and pcm clocks is missing in the official doc, there's a pdf by G.J Van Loo with the missing info at https://www.scribd.com/doc/127599939/BCM2835-Audio-clocks
Initializes this peripheral interface, to use before any other function in this file.
- Returns
- negative in case of error
int clkMan_setClock_gp0 |
( |
int |
clockSrc, |
|
|
int |
divisorInt, |
|
|
int |
divisorFrac |
|
) |
| |
sets the clock for the general purpouse clock 0
- Parameters
-
clockSrc | The desired clock source (use the CLK_SRC_* macros) |
divisorInt | Integer part of the divisor |
divisorFrac | Fractional part of the divisor |
- Returns
- negative in case of error
int clkMan_setClock_gp1 |
( |
int |
clockSrc, |
|
|
int |
divisorInt, |
|
|
int |
divisorFrac |
|
) |
| |
sets the clock for the general purpouse clock 1
- Parameters
-
clockSrc | The desired clock source (use the CLK_SRC_* macros) |
divisorInt | Integer part of the divisor |
divisorFrac | Fractional part of the divisor |
- Returns
- negative in case of error
int clkMan_setClock_gp2 |
( |
int |
clockSrc, |
|
|
int |
divisorInt, |
|
|
int |
divisorFrac |
|
) |
| |
sets the clock for the general purpouse clock 2
- Parameters
-
clockSrc | The desired clock source (use the CLK_SRC_* macros) |
divisorInt | Integer part of the divisor |
divisorFrac | Fractional part of the divisor |
- Returns
- negative in case of error
int clkMan_setClock_pcm |
( |
int |
clockSrc, |
|
|
int |
divisorInt, |
|
|
int |
divisorFrac |
|
) |
| |
sets the clock for the pcm peripheral
- Parameters
-
clockSrc | The desired clock source (use the CLK_SRC_* macros) |
divisorInt | Integer part of the divisor |
divisorFrac | Fractional part of the divisor |
- Returns
- negative in case of error
int clkMan_setClock_pwm |
( |
int |
clockSrc, |
|
|
int |
divisorInt, |
|
|
int |
divisorFrac |
|
) |
| |
sets the clock for the pwm peripheral
- Parameters
-
clockSrc | The desired clock source (use the CLK_SRC_* macros) |
divisorInt | Integer part of the divisor |
divisorFrac | Fractional part of the divisor |
- Returns
- negative in case of error