From cd7e054f7d55d5d5be43c778fa800f0d598bb4ec Mon Sep 17 00:00:00 2001 From: Will Code Date: Tue, 29 May 2012 21:24:01 -0400 Subject: [PATCH] max2837: extern additional functions, put test code in ifdef --- firmware/common/max2837.c | 10 ++++++---- firmware/common/max2837.h | 8 ++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) 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