WBXNG: Can not enable/disable ADF4350 from set_enable()
[debian/gnuradio] / usrp / host / lib / db_wbxng_adf4350.cc
index f662ea26ee5f6b20eac500a73f60e7cdac3ae08d..2377608450d5b3302cbacf315f842f814b500484 100644 (file)
 #include <db_base_impl.h>
 #include <stdio.h>
 
-#define INPUT_REF_FREQ FREQ_C(64e6)
-#define DIV_ROUND(num, denom) (((num) + ((denom)/2))/(denom))
 #define FREQ_C(freq) uint64_t(freq)
+#define INPUT_REF_FREQ FREQ_C(64e6)
+#define DIV_ROUND(num, denom) FREQ_C((double(num) + (double(denom)/2))/double(denom))
 #define INPUT_REF_FREQ_2X (2*INPUT_REF_FREQ)                            /* input ref freq with doubler turned on */
 #define MIN_INT_DIV uint16_t(23)                                        /* minimum int divider, prescaler 4/5 only */
 #define MAX_RF_DIV uint8_t(16)                                          /* max rf divider, divides rf output */
 #define MIN_VCO_FREQ FREQ_C(2.2e9)                                      /* minimum vco freq */
 #define MAX_VCO_FREQ FREQ_C(4.4e9)                                      /* minimum vco freq */
-#define MAX_FREQ DIV_ROUND(MAX_VCO_FREQ, 1)                                           /* upper bound freq (rf div = 1) */
-#define MIN_FREQ DIV_ROUND(MIN_VCO_FREQ, MAX_RF_DIV)                    /* calculated lower bound freq */
+//#define MAX_FREQ DIV_ROUND(MAX_VCO_FREQ, 1)                                           /* upper bound freq (rf div = 1) */
+#define MAX_FREQ FREQ_C(2.3e9)
+//#define MIN_FREQ DIV_ROUND(MIN_VCO_FREQ, MAX_RF_DIV)                    /* calculated lower bound freq */
+#define MIN_FREQ FREQ_C(60e6)
 
 #define CE_PIN        (1 << 3)
 #define PDB_RF_PIN    (1 << 2)