#define MCLK_MULT 1 | #define MCLK_MULT 1 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 | ||||
#elif F_CPU == 216000000 | #elif F_CPU == 216000000 | ||||
#define MCLK_MULT 8 | |||||
#define MCLK_DIV 153 | |||||
#define MCLK_SRC 0 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#elif F_CPU == 240000000 | #elif F_CPU == 240000000 | ||||
#define MCLK_MULT 4 | |||||
#define MCLK_MULT 2 | |||||
#define MCLK_DIV 85 | #define MCLK_DIV 85 | ||||
#define MCLK_SRC 0 | |||||
#elif F_CPU == 256000000 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#elif F_CPU == 16000000 | #elif F_CPU == 16000000 | ||||
#define MCLK_MULT 12 | #define MCLK_MULT 12 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 | ||||
print "\n};\n"; | print "\n};\n"; | ||||
print "// max=$max, min=$min\n"; | print "// max=$max, min=$min\n"; | ||||
*/ | */ | ||||
#endif | |||||
#endif |
const tmclk clkArr[numfreqs] = {{32, 3375}, {49, 3750}, {64, 3375}, {49, 1875}, {128, 3375}, {98, 1875}, {8, 153}, {64, 1125}, {196, 1875}, {16, 153}, {128, 1125}, {226, 1081}, {32, 153}, {147, 646} }; | const tmclk clkArr[numfreqs] = {{32, 3375}, {49, 3750}, {64, 3375}, {49, 1875}, {128, 3375}, {98, 1875}, {8, 153}, {64, 1125}, {196, 1875}, {16, 153}, {128, 1125}, {226, 1081}, {32, 153}, {147, 646} }; | ||||
#elif (F_PLL==240000000) | #elif (F_PLL==240000000) | ||||
const tmclk clkArr[numfreqs] = {{16, 1875}, {29, 2466}, {32, 1875}, {89, 3784}, {64, 1875}, {147, 3125}, {4, 85}, {32, 625}, {205, 2179}, {8, 85}, {64, 625}, {89, 473}, {16, 85}, {128, 625} }; | const tmclk clkArr[numfreqs] = {{16, 1875}, {29, 2466}, {32, 1875}, {89, 3784}, {64, 1875}, {147, 3125}, {4, 85}, {32, 625}, {205, 2179}, {8, 85}, {64, 625}, {89, 473}, {16, 85}, {128, 625} }; | ||||
#elif (F_PLL==256000000) | |||||
// TODO: fix these... | |||||
const tmclk clkArr[numfreqs] = {{16, 1875}, {29, 2466}, {32, 1875}, {89, 3784}, {64, 1875}, {147, 3125}, {4, 85}, {32, 625}, {205, 2179}, {8, 85}, {64, 625}, {89, 473}, {16, 85}, {128, 625} }; | |||||
#endif | #endif | ||||
for (int f = 0; f < numfreqs; f++) { | for (int f = 0; f < numfreqs; f++) { |
#define MCLK_MULT 1 | #define MCLK_MULT 1 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 | ||||
#elif F_CPU == 216000000 | #elif F_CPU == 216000000 | ||||
#define MCLK_MULT 8 | |||||
#define MCLK_DIV 153 | |||||
#define MCLK_SRC 0 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#elif F_CPU == 240000000 | #elif F_CPU == 240000000 | ||||
#define MCLK_MULT 4 | |||||
#define MCLK_MULT 2 | |||||
#define MCLK_DIV 85 | #define MCLK_DIV 85 | ||||
#define MCLK_SRC 0 | |||||
#elif F_CPU == 256000000 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#elif F_CPU == 16000000 | #elif F_CPU == 16000000 | ||||
#define MCLK_MULT 12 | #define MCLK_MULT 12 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 |
#define MCLK_MULT 1 | #define MCLK_MULT 1 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 | ||||
#elif F_CPU == 216000000 | #elif F_CPU == 216000000 | ||||
#define MCLK_MULT 8 | |||||
#define MCLK_DIV 153 | |||||
#define MCLK_SRC 0 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#elif F_CPU == 240000000 | #elif F_CPU == 240000000 | ||||
#define MCLK_MULT 4 | |||||
#define MCLK_MULT 2 | |||||
#define MCLK_DIV 85 | #define MCLK_DIV 85 | ||||
#define MCLK_SRC 0 | |||||
#elif F_CPU == 256000000 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#elif F_CPU == 16000000 | #elif F_CPU == 16000000 | ||||
#define MCLK_MULT 12 | #define MCLK_MULT 12 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 |
#define MCLK_MULT 1 | #define MCLK_MULT 1 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 | ||||
#elif F_CPU == 216000000 | #elif F_CPU == 216000000 | ||||
#define MCLK_MULT 8 | |||||
#define MCLK_DIV 153 | |||||
#define MCLK_SRC 0 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#elif F_CPU == 240000000 | #elif F_CPU == 240000000 | ||||
#define MCLK_MULT 4 | |||||
#define MCLK_MULT 2 | |||||
#define MCLK_DIV 85 | #define MCLK_DIV 85 | ||||
#define MCLK_SRC 0 | |||||
#elif F_CPU == 256000000 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#elif F_CPU == 16000000 | #elif F_CPU == 16000000 | ||||
#define MCLK_MULT 12 | #define MCLK_MULT 12 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 |
#define MCLK_MULT 1 | #define MCLK_MULT 1 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 | ||||
#elif F_CPU == 216000000 | #elif F_CPU == 216000000 | ||||
#define MCLK_MULT 8 | |||||
#define MCLK_DIV 153 | |||||
#define MCLK_SRC 0 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#elif F_CPU == 240000000 | #elif F_CPU == 240000000 | ||||
#define MCLK_MULT 4 | |||||
#define MCLK_MULT 2 | |||||
#define MCLK_DIV 85 | #define MCLK_DIV 85 | ||||
#define MCLK_SRC 0 | |||||
#elif F_CPU == 256000000 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#elif F_CPU == 16000000 | #elif F_CPU == 16000000 | ||||
#define MCLK_MULT 12 | #define MCLK_MULT 12 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 |
#define MCLK_MULT 2 | #define MCLK_MULT 2 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 | ||||
#elif F_CPU == 216000000 | #elif F_CPU == 216000000 | ||||
#define MCLK_MULT 16 | |||||
#define MCLK_DIV 153 | |||||
#define MCLK_SRC 0 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#elif F_CPU == 240000000 | #elif F_CPU == 240000000 | ||||
#define MCLK_MULT 8 | |||||
#define MCLK_MULT 2 | |||||
#define MCLK_DIV 85 | #define MCLK_DIV 85 | ||||
#define MCLK_SRC 0 | |||||
#elif F_CPU == 256000000 | |||||
#define MCLK_MULT 12 | |||||
#define MCLK_DIV 17 | |||||
#define MCLK_SRC 1 | |||||
#else | #else | ||||
#error "This CPU Clock Speed is not supported by the Audio library"; | #error "This CPU Clock Speed is not supported by the Audio library"; | ||||
#endif | #endif |