kopia lustrzana https://github.com/pa3gsb/Radioberry-2.x
rb clock
rodzic
93ff1bd708
commit
a93b896988
Plik binarny nie jest wyświetlany.
Przed Szerokość: | Wysokość: | Rozmiar: 57 KiB |
Plik binarny nie jest wyświetlany.
Plik diff jest za duży
Load Diff
Przed Szerokość: | Wysokość: | Rozmiar: 111 KiB |
Plik binarny nie jest wyświetlany.
|
@ -1,15 +1,30 @@
|
|||
/*
|
||||
Radioberry clock
|
||||
Radioberry supporting clock
|
||||
|
||||
This program sets the (fysical pin 36) gpio6 clock pin to 10 Mhz.
|
||||
This program sets the (fysical pin 7) GPCLK0 pin to 10 Mhz.
|
||||
|
||||
This supporting clock is used for:
|
||||
-) reset handler
|
||||
-) iambic (cw keying)
|
||||
-) heartbeat
|
||||
-) ad9866 spi controlling
|
||||
|
||||
It is an important clock but the timing is not used for
|
||||
the ADC and DAC conversions.
|
||||
|
||||
This program must be called (clock must be set first) before loading the firmware.
|
||||
|
||||
2017 Johan PA3GSB
|
||||
2018 Johan PA3GSB
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <pigpio.h>
|
||||
|
||||
#define GPCLK0 4 // pin 7
|
||||
#define GPCLK1 5 // pin 29 DO NOT USE => ADVICED NOT TO USE!
|
||||
#define GPCLK2 6 // pin 31 DO NOT USE => RESULTS IN ETHERNET CONNECTION PROBLEMS.
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (gpioInitialise() < 0) {
|
||||
|
@ -17,13 +32,15 @@ int main(int argc, char **argv)
|
|||
exit(-1);
|
||||
}
|
||||
|
||||
gpioSetMode(4, PI_ALT0);
|
||||
gpioSetMode(GPCLK0, PI_ALT0);
|
||||
|
||||
int result = gpioHardwareClock(4, 10000000);
|
||||
int result = gpioHardwareClock(GPCLK0, 10000000);
|
||||
|
||||
if (result == 0)
|
||||
printf("Radioberry supporting clock succesfully set to 10 MHz\n");
|
||||
else
|
||||
printf("Setting radioberry supporting clock FAILED!!!!!!! \n");
|
||||
|
||||
printf("result = %d\n", result);
|
||||
|
||||
|
||||
gpioTerminate();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <wiringPi.h>
|
||||
|
||||
#define GPCLK0 4 // pin 7
|
||||
#define GPCLK1 5 // pin 29
|
||||
#define GPCLK2 6 // pin 31
|
||||
|
||||
int main() {
|
||||
wiringPiSetupGpio();
|
||||
pinMode(GPCLK2, GPIO_CLOCK);
|
||||
gpioClockSet(GPCLK2, 10000000);
|
||||
return 0;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
|
||||
#define GPCLK0 4 // pin 7
|
||||
#define GPCLK1 5 // pin 29 -- do not use
|
||||
#define GPCLK2 6 // pin 31
|
||||
|
||||
int main() {
|
||||
|
||||
wiringPiSetupGpio();
|
||||
pinMode(GPCLK2, GPIO_CLOCK);
|
||||
gpioClockSet(GPCLK2, 10000000);
|
||||
return 0;
|
||||
|
||||
}
|
Ładowanie…
Reference in New Issue