Removed test code

This commit is contained in:
Sebastian 2018-06-20 01:36:53 +02:00
parent 3894a9a923
commit a5009e7c69
1 changed files with 0 additions and 43 deletions

View File

@ -1,43 +0,0 @@
#include <stdint.h>
#include <stdio.h>
int main(void) {
uint32_t si5351_freq_a = 400000000;
uint32_t freq_xtal = 25000000;
uint32_t out_freq = 10000000;
double fdiv = (double) si5351_freq_a / (double) freq_xtal;
//TODO: Find better way to determine c and b
uint32_t c = 0x0FFFFF;
uint32_t a = (uint32_t) fdiv;
double rm = fdiv - a;
uint32_t b = rm * c;
printf("%u + %u / %u\n", a, b, c);
uint32_t p1 = 128 * a + (128 * b / c) - 512;
uint32_t p2 = 128 * b - c * (128 * b / c);
uint32_t p3 = c;
printf("%u %u %u\n", p1, p2, p3);
fdiv = (double) si5351_freq_a / (double) out_freq;
//TODO: Find better way to determine c and b
c = 0x0FFFFF;
a = (uint32_t) fdiv;
rm = fdiv - a;
b = rm * c;
printf("%u + %u / %u\n", a, b, c);
p1 = 128 * a + (128 * b / c) - 512;
p2 = 128 * b - c * (128 * b / c);
p3 = c;
printf("%u %u %u\n", p1, p2, p3);
return 0;
}