diff --git a/firmware/common/max2837.c b/firmware/common/max2837.c index d2b11b81..b57b8162 100644 --- a/firmware/common/max2837.c +++ b/firmware/common/max2837.c @@ -1,9 +1,9 @@ /* - * 'gcc -DDEBUG -O2 -o test max2837.c' prints out what test program - * would do if it had a real spi library + * 'gcc -DTEST -DDEBUG -O2 -o test max2837.c' prints out what test + * program would do if it had a real spi library * - * 'gcc -DBUS_PIRATE -O2 -o test max2837.c' prints out bus pirate commands to - * do the same thing. + * 'gcc -DTEST -DBUS_PIRATE -O2 -o test max2837.c' prints out bus + * pirate commands to do the same thing. */ #include #include "max2837.h" @@ -166,6 +166,7 @@ void max2837_set_frequency(uint32_t freq) max2837_regs_commit(); } +#ifdef TEST uint16_t test(void) { LOG("# test\n"); @@ -184,3 +185,4 @@ int main(int ac, char **av) max2837_set_frequency(2441000000); max2837_stop(); } +#endif //TEST diff --git a/firmware/common/max2837.h b/firmware/common/max2837.h index 40103911..1b7e96fb 100644 --- a/firmware/common/max2837.h +++ b/firmware/common/max2837.h @@ -32,4 +32,12 @@ extern void max2837_regs_read(void); * provided routines for those operations. */ extern void max2837_regs_commit(void); +/* Turn on/off all chip functions. Does not control oscillator and CLKOUT */ +extern void max2837_start(void); +extern void max2837_stop(void); + +/* Set frequency in Hz. Frequency setting is a multi-step function + * where order of register writes matters. */ +extern void max2837_set_frequency(uint32_t freq); + #endif // __MAX2837_H