max2837: extern additional functions, put test code in ifdef
This commit is contained in:
@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* 'gcc -DDEBUG -O2 -o test max2837.c' prints out what test program
|
* 'gcc -DTEST -DDEBUG -O2 -o test max2837.c' prints out what test
|
||||||
* would do if it had a real spi library
|
* program would do if it had a real spi library
|
||||||
*
|
*
|
||||||
* 'gcc -DBUS_PIRATE -O2 -o test max2837.c' prints out bus pirate commands to
|
* 'gcc -DTEST -DBUS_PIRATE -O2 -o test max2837.c' prints out bus
|
||||||
* do the same thing.
|
* pirate commands to do the same thing.
|
||||||
*/
|
*/
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "max2837.h"
|
#include "max2837.h"
|
||||||
@ -166,6 +166,7 @@ void max2837_set_frequency(uint32_t freq)
|
|||||||
max2837_regs_commit();
|
max2837_regs_commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TEST
|
||||||
uint16_t test(void)
|
uint16_t test(void)
|
||||||
{
|
{
|
||||||
LOG("# test\n");
|
LOG("# test\n");
|
||||||
@ -184,3 +185,4 @@ int main(int ac, char **av)
|
|||||||
max2837_set_frequency(2441000000);
|
max2837_set_frequency(2441000000);
|
||||||
max2837_stop();
|
max2837_stop();
|
||||||
}
|
}
|
||||||
|
#endif //TEST
|
||||||
|
@ -32,4 +32,12 @@ extern void max2837_regs_read(void);
|
|||||||
* provided routines for those operations. */
|
* provided routines for those operations. */
|
||||||
extern void max2837_regs_commit(void);
|
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
|
#endif // __MAX2837_H
|
||||||
|
Reference in New Issue
Block a user