ADD commnad frequency
This commit is contained in:
@ -22,6 +22,7 @@ extern RTC_HandleTypeDef hrtc;
|
||||
/* function prototypes */
|
||||
int do_help(char *args);
|
||||
int do_devid(char *args);
|
||||
int do_frequ(char *args);
|
||||
int do_info(char *args);
|
||||
int do_sinfo(char *args);
|
||||
int do_test(/*command_inst_t inst,*/ char *args);
|
||||
|
@ -21,6 +21,8 @@ char *ltrim(char *s);
|
||||
char *rtrim(char *s);
|
||||
char *trim(char *s);
|
||||
|
||||
int strtouint32 (char *s, uint32_t *uint32);
|
||||
|
||||
int strtotime (char *s, struct _tm_ *tp);
|
||||
// uint8_t dayofweek(uint8_t century, uint8_t y, uint8_t m, uint8_t d);
|
||||
|
||||
|
@ -72,6 +72,16 @@ extern "C" {
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* #include <errno.h> could also be included */
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* @brief SI5351 synthesis settings */
|
||||
typedef struct {
|
||||
uint32_t pll_multiplier; /*!< corresponds to feedback multisynth (N) a */
|
||||
uint32_t pll_numerator; /*!< corresponds to feedback multisynth (N) b */
|
||||
uint32_t pll_denominator; /*!< corresponds to feedback multisynth (N) c */
|
||||
uint32_t out_multiplier; /*!< corresponds to multisynth (M) a */
|
||||
uint32_t out_numerator; /*!< corresponds to multisynth (M) b */
|
||||
uint32_t out_denominator; /*!< corresponds to multisynth (M) c */
|
||||
uint8_t out_r_divider; /*!< R divider, log2 value bit set to 1; 2,4,8,...,128; for frequencies < 500 kHz, otherwise set to 1 i.e. bit 0 */
|
||||
} synthesis_t;
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/*!< Si5351 instance typedef -- handle as pointer */
|
||||
@ -129,6 +139,7 @@ int si5351_enable_output(si5351_inst_t inst, uint8_t clk);
|
||||
int si5351_disable_output(si5351_inst_t inst, uint8_t clk);
|
||||
int si5351_set_clk0(si5351_inst_t inst, uint32_t frequency);
|
||||
int si5351_set_clk(si5351_inst_t inst, uint8_t clk, uint32_t frequency, si5351_pll_t pll);
|
||||
int si5351_set_frequency(si5351_inst_t inst, uint32_t frequency);
|
||||
|
||||
char * si5351_read_debug_msg(si5351_inst_t inst);
|
||||
char * si5351_read_register_debug(si5351_inst_t inst, char *buf, size_t bufsize, uint8_t regaddr);
|
||||
@ -137,6 +148,11 @@ char * si5351_read_register_debug(si5351_inst_t inst, char *buf, size_t bufsize,
|
||||
int si5351_get_instance(si5351_inst_t *inst);
|
||||
int si5351_get_i2c_address(si5351_inst_t inst);
|
||||
void* si5351_get_i2c_handle(si5351_inst_t inst);
|
||||
uint32_t si5351_get_frequency(si5351_inst_t inst);
|
||||
uint32_t si5351_get_xtal(si5351_inst_t inst);
|
||||
|
||||
|
||||
synthesis_t si5351_calculation(uint32_t frequency, uint32_t xtal);
|
||||
|
||||
/* under development */
|
||||
int si5351_set_clk_phase(si5351_inst_t inst, uint8_t clk, uint32_t frequency, double phase, si5351_pll_t pll);
|
||||
|
Reference in New Issue
Block a user