Clock generator @ 145 MHz and 7 mhz
Fork of Check_Si5351A_Clock_generator by
Diff: si5351a_check.h
- Revision:
- 0:d68f1e7f7f49
- Child:
- 1:2b29f68043f7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/si5351a_check.h Sun Jan 01 01:28:25 2017 +0000 @@ -0,0 +1,69 @@ +/* + * mbed Application program / Si5351A sample program + * tested on: + * ST Nucleo-F411RE & F401RE + * LPC1114FN28 + * + * Copyright (c) 2016,'17 Kenji Arai / JH1PJL + * http://www.page.sannet.ne.jp/kenjia/index.html + * http://mbed.org/users/kenjiArai/ + * Created: December 28th, 2016 + * Revised: January 1st, 2017 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +// Definition ------------------------------------------------------------------------------------ +#define BAUD(x) pc.baud(x) +#define GETC(x) pc.getc(x) +#define PUTC(x) pc.putc(x) +#define PRINTF(...) pc.printf(__VA_ARGS__) +#define READABLE(x) pc.readable(x) + +#define BAUD_RATE 9600 + +#if 0 +#define INCREMENT // command 1,2,3 -> INCREMENT or TABLE_LOOK +#endif +#if !defined(INCREMENT) +#define TABLE_LOOK +#endif + +// Object --------------------------------------------------------------------- + +// RAM ------------------------------------------------------------------------ +char linebuf[64]; +int buf_size = sizeof(linebuf); + +// ROM / Constant data -------------------------------------------------------- +char *const opening_msg = + "Si5351 test program, created on UTC: "__DATE__"("__TIME__")"; +char *const msg0 = "output: Please enter freq. ex 1230000"; + +static const uint32_t freq_tbl[] = +{ + 4000, 5000, 8000, // 4KHz-8KHz + 10000, 20000, 50000, 80000, // 10KHz-80KHz + 100000, 200000, 500000, 800000, // 100KHz-800KHz + 1000000, 2000000, 5000000, 8000000, // 1MHz-8MHz + 10000000, 20000000, 50000000, 80000000, // 10MHz-80MHz + 100000000, 150000000, 200000000, // 100MHz-200MHz + 0 // Terminate data!! +}; + +// Function prototypes -------------------------------------------------------- +void test_si5351(void); +void msg_hlp(void); +void put_rn( void ); +void put_r( void ); +void put_lin( void ); +void put_spc( uint8_t n); +int xatoi(char **str, int32_t *res); +void get_line(char *buff, int len); +void get_line_no_param(char *buff);